<!--
  @description: 系统配置管理查看
  @Modifier: zhuyanchao
  @routerPath:
  @date: 2020-7-11-15:23
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    :title="title"
    width="700px"
    custom-class="el-dialog__body-p0"
    top="calc((100vh - 511px) / 2)"
  >
    <section class="main mb10">
      <table class="tableData">
        <tr>
          <td>key键值</td>
          <td colspan="3">
            {{ formData.configType }}
          </td>
        </tr>
        <tr>
          <td>value值</td>
          <td colspan="3">
            {{ formData.configValue }}
          </td>
        </tr>
        <tr>
          <td>启动状态</td>
          <td colspan="3">
            <span v-for="(item,index) in systemConfigStatusList" v-if="formData.useStatus === item.typecode" :key="index">
              {{ item.typename }}
            </span>
          </td>
        </tr>
        <tr>
          <td>配置描述</td>
          <td colspan="3">
            {{ formData.configDesc }}
          </td>
        </tr>
        <tr>
          <td>系统类别</td>
          <td colspan="3">
            {{ formData.moduleType }}
          </td>
        </tr>
        <tr>
          <td>业务类别</td>
          <td colspan="3">
            {{ formData.configurationType }}
          </td>
        </tr>
        <tr>
          <td>模块类别</td>
          <td colspan="3">
            {{ formData.microServiceType }}
          </td>
        </tr>
        <tr>
          <td>备注</td>
          <td colspan="3">
            {{ formData.remark }}
          </td>
        </tr>
        <tr>
          <td>影响</td>
          <td colspan="3">
            {{ formData.effect }}
          </td>
        </tr>
      </table>
    </section>
  </el-dialog>
</template>

<script>
/* 接口*/
import { getSystemconfigById } from '@/api/common/systemConfigCenter'// 系统配置
import { systemConfigMixin } from './mixins/systemConfigMixin'
export default {
  name: 'SystemConfigDetailDialog',
  mixins: [systemConfigMixin],
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {

      }
    }
  },
  data() {
    return {
      title: '查看系统配置', // 弹框标题
      formData: {
        configType: '', // key键值
        configValue: '', // value值
        useStatus: '', // 启动状态
        configDesc: '' // 配置描述
      }
    }
  },
  mounted() {
    this.getSystemconfigById(this.dialogData.id)
  },
  methods: {
    // 获取详情
    getSystemconfigById(id) {
      getSystemconfigById(id).then(res => {
        if (res.header.ret === '0') {
          this.formData = { ...res.data }
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
