<!--
  @description: 系统设置->数据权限->查看弹窗
  @author: change by zhangfan
  @routerPath:
  @date:  2020/5/12-15:12
-->
<template>
  <el-dialog
    :visible.sync="dialogData.dialog"
    :modal="true"
    :lock-scroll="false"
    title="查看"
    width="600px"
    custom-class="el-dialog__body-p0"
  >
    <section class="tools p0-16 pt16 clearfix">
      <el-form
        :model="formData"
        :inline-message="true"
      >
        <div class="block">
          <table class="from_table">
            <tr>
              <td>
                <el-form-item label="权限名称" prop="interfaceName" />
              </td>
              <td>
                {{ contData.interfaceName }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="权限编号" prop="route" />
              </td>
              <td>
                {{ contData.route }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="权限字段" prop="column" />
              </td>
              <td>
                {{ contData.column }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="规则类型" prop="value" />
              </td>
              <td>
                {{ contData.value }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="指定表" prop="table" />
              </td>
              <td>
                {{ contData.table }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="指定别名" prop="alias" />
              </td>
              <td>
                {{ contData.alias }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="类型" prop="effect" />
              </td>
              <td>
                {{ contData.effect }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="备注" prop="roleDesc" />
              </td>
              <td>
                备注
              </td>
            </tr>
          </table>
        </div>
      </el-form>
    </section>
  </el-dialog>
</template>

<script>
import { queryAuthData } from '@api/common/roleManage'
export default {
  name: 'DataManageAddDialog',
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return
      }
    },
    detailId: {
      type: String,
      default: function() {
        return
      }
    }
  },
  data() {
    return {
      formData: {},
      contData: '' // 查看的内容
    }
  },
  watch: {
    // 监听父级传的id
    detailId(val) {
      console.log(val)
      this.getqueryAuthData(val)
    }
  },
  methods: {
    // 查询数据
    getqueryAuthData(id) {
      queryAuthData(id).then(res => {
        this.contData = res.data
      }).catch(err => {
        console.log(err)
      })
    }

  }
}
</script>

<style scoped>
</style>

