<!--
  @description: 系统设置->接口权限->查看弹窗
  @author: change by zhangfan
  @routerPath:
  @date:  2020/5/13-15:05
-->
<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="权限名称" />
              </td>
              <td>
                {{ contentData.interfaceName }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="权限编号" />
              </td>
              <td>
                {{ contentData.modulePath }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="权限路径" />
              </td>
              <td>
                {{ contentData.modulePath }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="接口类型" />
              </td>
              <td>
                {{ contentData.interfaceName }}
              </td>
            </tr>
            <tr>
              <td>
                <el-form-item label="备注" />
              </td>
              <td>
                {{ contentData.interfaceName }}
              </td>
            </tr>
          </table>
        </div>
      </el-form>
    </section>
  </el-dialog>
</template>

<script>
import { GetqueryAuthInterface } from '@api/common/roleManage'
export default {
  name: 'ApiManageAddDialog',
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return
      }
    },
    detailId: {
      type: String,
      default: function() {
        return
      }
    }
  },
  data() {
    return {
      formData: {}, // 表单参数
      contentData: '' // 查看的数据
    }
  },
  watch: {
    // 监听父级传来的Id
    detailId(val) {
      this.getqueryAuthData(val)
    }
  },
  methods: {
    // 获取查看的数据
    getqueryAuthData(id) {
      GetqueryAuthInterface(id).then(res => {
        this.contentData = res.data
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped>
</style>

