<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/dataset/RepSetRule/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'

const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'ruleName',
    label: '规则名称'
  },
  {
    field: 'ruleClass',
    label: '规则分类'
  },
  {
    field: 'startDate',
    label: '启用日期'
  },
  {
    field: 'ruleProperty',
    label: '规则属性'
  },
  {
    field: 'ruleCycle',
    label: '规则周期'
  },
  {
    field: 'ruleStatus',
    label: '是否有效'
  },
  {
    field: 'description',
    label: '规则描述'
  },
  {
    field: 'createDate',
    label: '创建日期'
  },
  {
    field: 'createAccount',
    label: '创建账户'
  },
  {
    field: 'createOrgan',
    label: '创建机构'
  },
  {
    field: 'ruleJson',
    label: '规则json'
  },
  {
    field: 'ruleSql',
    label: '规则sql'
  },
  {
    field: 'organCode',
    label: '机构编码'
  },
  {
    field: 'failDate',
    label: '失效日期'
  },
  {
    field: 'indexCode',
    label: '规则加工指标集编号'
  },
  {
    field: 'machFormulas',
    label: '规则加载所有公式'
  },
  {
    field: 'itemId',
    label: '指标代码'
  },
  {
    field: 'itemName',
    label: '指标名称'
  }
])

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

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