<template>
  <el-dialog v-dialogDrag ref="diaFrom" title="详情" :close-on-click-modal="false" :visible.sync="daStatus" width="40%"
    top="10px" :before-close="cancel">
    <div>
      <el-form label-position="left" class="formDIa">
        <el-form-item label="项目名称：" v-if="showItemName">
          <span>{{ diaObj.item_name }}</span>
        </el-form-item>
        <el-form-item label="项目号：" v-if="showItemName">
          <span>{{ diaObj.item_id }}</span>
        </el-form-item>
        <el-form-item :label="titleKey |  titleWorld ">
          <span>{{ titleKey===2 ? diaObj.folder_no:diaObj.archive_no}}</span>
        </el-form-item>
        <el-form-item label="题名：">
          <span>{{ diaObj.maintitle }}</span>
        </el-form-item>
        <el-form-item label="全宗号：">
          <span>
            {{ (fondsList.filter(f => f.fondscode === diaObj.fonds_no)[0] || {}).codeName }}
          </span>
        </el-form-item>
        <el-form-item label="归档年度：">
          <span>{{ diaObj.filing_year }}</span>
        </el-form-item>
        <el-form-item label="保管期限：">
          <span>{{ diaObj.retention }}</span>
        </el-form-item>
        <el-form-item label="实体分类号：">
          <span>{{ diaObj.archive_ctg_no }}</span>
        </el-form-item>
        <!-- <el-form-item label="盒号：">
          <span>{{diaObj.case_no }}</span>
        </el-form-item> -->
        <!-- <el-form-item label="件号：">
          <span>{{ diaObj.piece_no}}</span>
        </el-form-item> -->
      </el-form>
    </div>
  </el-dialog>
</template>
<script>
  export default {
    props: {
      fondsList: {
        type: Array,
        default: () => [],
      },
      daStatus: {
        type: Boolean,
        default: () => false,
      },
      showItemName: {
        type: Boolean,
        default: () => false,
      },
      titleKey: {
        type: Number,
        default: () => 1,
      },
      diaObj: {
        type: Object,
        default: () => {},
      },
    },
    filters: {
      titleWorld(status) {
        const statusMap = {
          1: "档号",
          2: "案卷级档号",
          3: "文件级档号",
        };
        return statusMap[status];
      },
    },
    data() {
      return {}
    },
    methods: {
      cancel() {
        this.$emit("cancel")
      }
    }
  }

</script>
<style lang="scss" scoped>
  .formDIa {
    padding: 0 10px
  }

</style>
