import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { CrmContractCommandApi } from '#/api/crm/contract-command';

import { DICT_TYPE } from '@vben/constants';

/** 合同指令详情列表字段 */
export function useDetailListColumns(): VxeTableGridOptions<CrmContractCommandApi.ContractCommand>['columns'] {
  return [
    {
      field: 'commandType',
      title: '指令类型',
      width: 120,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_COMMAND_TYPE },
      },
    },
    {
      field: 'targetModule',
      title: '目标模块',
      width: 130,
    },
    {
      field: 'bizNo',
      title: '业务单号',
      minWidth: 140,
    },
    {
      field: 'operatorName',
      title: '操作人',
      width: 100,
    },
    {
      field: 'operateTime',
      title: '操作时间',
      minWidth: 160,
      formatter: 'formatDateTime',
    },
    {
      field: 'status',
      title: '状态',
      width: 100,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_COMMAND_STATUS },
      },
    },
    {
      title: '操作',
      width: 220,
      fixed: 'right',
      slots: { default: 'actions' },
    },
  ];
}
