<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/srdb/PendingNotice/PendingNotice/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { PROCESS_FLAG_LIST } from "../constants"
const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'id',
    label: '主键'
  },
  {
    field: 'orgNo',
    label: '机构编号'
  },
  {
    field: 'subOrgNo',
    label: '子机构编号'
  },
  {
    field: 'content',
    label: '待处理通知内容'
  },
  {
    field: 'createTime',
    label: '数据库记录创建的时间'
  },
  {
    field: 'processFlag',
    label: '是否处理',
    slots:{
      default:(data:any)=>{
        return <span>{PROCESS_FLAG_LIST[data.row.processFlag]?.label}</span>
      }
    }
  }
])

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

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