<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/srdb/TaskDiary/TaskDiary/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { REQ_STATUS_LIST,RECORD_TYPE_LIST } from "../constants"
const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'dataDate',
    label: '批次日期(接口)'
  },
  {
    field: 'workflowDataDate',
    label: '数据日期(工作流)'
  },
  {
    field: 'workflowId',
    label: '工作流编码'
  },
  {
    field: 'dispatchTime',
    label: '下发时间戳'
  },
  {
    field: 'reqStatus',
    label: '请求状态',
    slots:{
      default:(data:any)=>{
        return <span>{REQ_STATUS_LIST[data.row.reqStatus]?.label}</span>
      }
    }
  },
  {
    field: 'reqMessage',
    label: '请求报文'
  },
  {
    field: 'msg',
    label: '失败原因'
  },
  {
    field: 'createTime',
    label: '创建时间'
  },
  {
    field: 'updateTime',
    label: '更新时间'
  },
  {
    field: 'timeConsume',
    label: '耗时'
  },
  {
    field: 'recordType',
    label: '记录类型',
    slots:{
      default:(data:any)=>{
        return <span>{data.row.recordType?RECORD_TYPE_LIST[data.row.recordType]?.label:''}</span>
      }
    }
  }
])

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

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