<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/srdb/SystemPackageQuery/SystemPackageQuery/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { ENABLE_LIST } from "../constants"
const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'regulationId',
    label: '制度编号'
  },
  {
    field: 'regulationName',
    label: '制度名称'
  },
  {
    field: 'regulationVersion',
    label: '制度版本'
  },
  {
    field: 'filePwd',
    label: '制度文件压缩密码'
  },
  {
    field: 'collectingCode',
    label: '采集编号'
  },
  {
    field: 'filePath',
    label: '制度文件绝对路径'
  },
  {
    field: 'fileMd5',
    label: '制度包MD5'
  },
  {
    field: 'deliveryTime',
    label: '制度下发时间'
  },
  {
    field: 'enable',
    label: '是否启用',
    slots:{
      default:(data:any)=>{
        return <span>{ENABLE_LIST[data.row.enable]?.label}</span>
      }
    }
  },
  {
    field: 'createTime',
    label: '数据库记录创建的时间'
  }
])

defineProps({
  currentRow: {
    type: Object as PropType<TableData>,
    default: () => {}
  }
})
</script>

<template>
  <Descriptions :schema="detailSchema" :data="currentRow || {}" />
</template>
