<template>
  <el-dialog title="查看档案" :visible.sync="visible" v-dialogDrag width="75%" :before-close="cancel">
    <el-table border v-loading="loading" :data="tableData" max-height="500px">
      <el-table-column prop="archive_file_num" width="100" label="原文数量" align="center">
        <template slot-scope="scope">
          <span>{{scope.row.archive_file_num?scope.row.archive_file_num:0}}</span>
        </template>
      </el-table-column>
      <el-table-column 
        v-for="(ele, index) in JSON.parse(Alltable.tableShow)" 
        :prop="ele.columnName"
        :label="ele.columnChnName" 
        :min-width="ele.width" 
        :key="index+'_approval'" 
        align="center" show-overflow-tooltip>
        <template slot-scope="scope">
          <span>{{ scope.row[ele.columnName] }}</span>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: () => false,
    },
    loading: {
      type: Boolean,
      default: () => false,
    },
    tableData: {
      type: Array,
      default: () => [],
    },
    Alltable: {
      type: Object,
      default: () => {
        tableShow: "[]";
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    cancel() {
      this.$emit("cancel");
    },
  },
};
</script>

<style></style>
