import { h } from 'vue' import { ElTag } from 'element-plus' import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' import { getCheckDiffActionList, getCheckDiffStatusMeta } from './checkDiffPage.helpers' export function createCheckDiffTableColumns({ handleActionClick } = {}) { return [ { type: 'selection', width: 52, fixed: 'left' }, { prop: 'orderCode', label: '盘点单号', minWidth: 160, showOverflowTooltip: true }, { prop: 'checkTypeLabel', label: '盘点类型', width: 110, formatter: (row) => row.checkTypeLabel || '-' }, { prop: 'areaName', label: '库区名称', minWidth: 140, showOverflowTooltip: true }, { prop: 'anfme', label: '应盘数量', width: 110, formatter: (row) => row.anfme ?? '-' }, { prop: 'checkQty', label: '已盘数量', width: 110, formatter: (row) => row.checkQty ?? '-' }, { prop: 'exceStatus', label: '单据状态', width: 120, formatter: (row) => { const statusMeta = getCheckDiffStatusMeta(row.exceStatus ?? row.exceStatus$) return h(ElTag, { type: statusMeta.type, effect: 'light' }, () => statusMeta.text) } }, { prop: 'updateTimeText', label: '更新时间', minWidth: 180, sortable: true, formatter: (row) => row.updateTimeText || '-' }, { prop: 'operation', label: '操作', width: 120, align: 'center', fixed: 'right', formatter: (row) => h('div', [ h(ArtButtonMore, { list: getCheckDiffActionList(row), onClick: (item) => handleActionClick?.(item, row) }) ]) } ] }