<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/srdb/QueryInterfaceDiary/QueryInterfaceDiary/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { LOG_TYPE_LIST,HANDLE_STATUS_LIST } from "../constants"

const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'handleStatus',
    label: '处理状态',
    slots:{
      default:(data:any)=>{
        return <span>{HANDLE_STATUS_LIST[data.row.handleStatus]?.label}</span>
      }
    }
  },
  {
    field: 'requestTime',
    label: '请求时间'
  },
  {
    field: 'reqMessage',
    label: '请求报文'
  },
  {
    field: 'respMessage',
    label: '响应报文'
  },
  {
    field: 'msg',
    label: '失败原因'
  },
  {
    field: 'timeConsume',
    label: '耗时'
  },
  {
    field: 'logType',
    label: '查询类型',
    slots:{
      default:(data:any)=>{
        return <span>{LOG_TYPE_LIST[data.row.logType]?.label}</span>
      }
    }
  }
])

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

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