<!--
  @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-p8 el-dialog_table"
    top="calc((100vh - 511px) / 2)"
  >
    <section class="main mb10">
      <table class="tableData">
        <tr>
          <td>文档名称</td>
          <td colspan="3">
            {{ formData.fileName }}
          </td>
        </tr>
        <tr>
          <td>文档类型</td>
          <td colspan="3">
            <span v-for="(item,index) in docTypeList" v-if="formData.docType === item.typecode" :key="index">
              {{ item.typename }}
            </span>
          </td>
        </tr>
        <tr>
          <td>角色类型</td>
          <td colspan="3">
            <span v-for="(item,index) in docRoleTypeList" v-if="formData.roleType === item.typecode" :key="index">
              {{ item.typename }}
            </span>
          </td>
        </tr>
        <tr>
          <td>上传时间</td>
          <td colspan="3">
            {{ formData.createTime }}
          </td>
        </tr>
        <tr>
          <td>创建人</td>
          <td colspan="3">
            <div v-html="formData.createUserName" />
          </td>
        </tr>
        <tr>
          <td>备注</td>
          <td colspan="3">
            <div v-html="formData.memo" />
          </td>
        </tr>
        <tr>
          <td>文件清单</td>
          <td colspan="3">
            <div v-html="formData.attachmentList" />
          </td>
        </tr>
      </table>
    </section>
  </el-dialog>
</template>

<script>
/* 接口*/
import { getSystemDocZipDetailById } from '@/api/common/systemConfigCenter'// 共享文档
import { systemZipDocMixin } from './mixins/systemZipDocMixin'
export default {
  name: 'SystemConfigDetailDialog',
  mixins: [systemZipDocMixin],
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {

      }
    }
  },
  data() {
    return {
      title: '查看共享文档', // 弹框标题
      formData: {
        fileName: '', // key键值
        docType: '', // key键值
        roleType: '', // 角色类型
        attachmentList: '', // key键值
        memo: '', // value值
        createUserName: '', // 启动状态
        createTime: '' // 配置描述
      }
    }
  },
  mounted() {
    this.getSystemDocZipDetailById(this.dialogData.id)
  },
  methods: {
    // 获取详情
    getSystemDocZipDetailById(id) {
      getSystemDocZipDetailById(id).then(res => {
        if (res.header.ret === '0') {
          this.formData = { ...res.data }
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
