import { h } from 'vue' import { ElTag } from 'element-plus' import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue' import { $t } from '@/locales' export function createInStatisticItemTableColumns({ handleView } = {}) { return [ { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' }, { prop: 'id', label: $t('table.id'), width: 90, align: 'center', formatter: (row) => row.id ?? '--' }, { prop: 'dayTimeText', label: $t('pages.manager.inStatisticItem.table.dayTime'), minWidth: 130, showOverflowTooltip: true, formatter: (row) => row.dayTimeText || '--' }, { prop: 'locCode', label: $t('pages.manager.inStatisticItem.table.locCode'), minWidth: 140, showOverflowTooltip: true, formatter: (row) => row.locCode || '--' }, { prop: 'matnrCode', label: $t('pages.manager.inStatisticItem.table.matnrCode'), minWidth: 150, showOverflowTooltip: true, formatter: (row) => row.matnrCode || '--' }, { prop: 'maktx', label: $t('pages.manager.inStatisticItem.table.maktx'), minWidth: 180, showOverflowTooltip: true, formatter: (row) => row.maktx || '--' }, { prop: 'anfme', label: $t('pages.manager.inStatisticItem.table.anfme'), width: 120, align: 'right', formatter: (row) => row.anfme ?? '--' }, { prop: 'batch', label: $t('pages.manager.inStatisticItem.table.batch'), minWidth: 140, showOverflowTooltip: true, formatter: (row) => row.batch || '--' }, { prop: 'unit', label: $t('table.unit'), width: 90, align: 'center', formatter: (row) => row.unit || '--' }, { prop: 'barcode', label: $t('pages.manager.inStatisticItem.table.barcode'), minWidth: 160, showOverflowTooltip: true, formatter: (row) => row.barcode || '--' }, { prop: 'createByText', label: $t('table.createBy'), minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.createByText || '--' }, { prop: 'createTimeText', label: $t('table.createTime'), minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.createTimeText || '--' }, { prop: 'updateByText', label: $t('table.updateBy'), minWidth: 120, showOverflowTooltip: true, formatter: (row) => row.updateByText || '--' }, { prop: 'updateTimeText', label: $t('table.updateTime'), minWidth: 170, showOverflowTooltip: true, formatter: (row) => row.updateTimeText || '--' }, { prop: 'operation', label: $t('table.operation'), width: 90, align: 'center', fixed: 'right', formatter: (row) => h(ArtButtonTable, { type: 'view', onClick: () => handleView?.(row) }) } ] }