<script setup lang="tsx">
import { PropType, ref } from 'vue'
import { TableData } from '@/api/srdb/OperationLog/OperationLog/types'
import { Descriptions, DescriptionsSchema } from '@/components/Descriptions'
import { OPERATION_TYPE_LIST } from "../constants"
const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'orgNo',
    label: '机构金融许可证号'
  },
  {
    field: 'orgName',
    label: '机构编号'
  },
  {
    field: 'logRecordTime',
    label: '日志记录时间'
  },
  {
    field: 'operationDate',
    label: '操作日期'
  },
  {
    field: 'operationTime',
    label: '操作时间'
  },
  {
    field: 'userName',
    label: '操作账号'
  },
  {
    field: 'userIp',
    label: '操作IP'
  },
  {
    field: 'operationType',
    label: '操作类型',
    slots:{
      default:(data:any)=>{
        return <span>{OPERATION_TYPE_LIST[data.row.operationType]?.label}</span>
      }
    }
  },
  {
    field: 'logDetail',
    label: '日志详情'
  }
])

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

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