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

const detailSchema = ref<DescriptionsSchema[]>([
  {
    field: 'pkid',
    label: '会话id'
  },
  {
    field: 'userId',
    label: '登录号'
  },
  {
    field: 'userName',
    label: '用户名称'
  },
  {
    field: 'organCode',
    label: '机构'
  },
  {
    field: 'organName',
    label: '机构名称',
  },
  {
    field: 'parentOrgan',
    label: '上级机构'
  },
  {
    field: 'loginIp',
    label: '登录ip'
  },
  {
    field: 'loginTime',
    label: '登录时间'
  },
  {
    field: 'url',
    label: '登录URL'
  },
  {
    field: 'logoutTime',
    label: '退出时间'
  }
])

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

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