import { h } from 'vue' import { $t } from '@/locales' import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' import { getTaskActionList } from './taskPage.helpers' export function createTaskTableColumns({ handleActionClick, createExpandContent }) { return [ ...(createExpandContent ? [ { type: 'expand', width: 56, formatter: (row) => createExpandContent(row) } ] : []), { prop: 'taskCode', label: $t('pages.task.search.taskCode'), minWidth: 170, showOverflowTooltip: true }, { prop: 'taskStatusLabel', label: $t('table.status'), minWidth: 140, showOverflowTooltip: true }, { prop: 'taskTypeLabel', label: $t('table.type'), minWidth: 140, showOverflowTooltip: true }, { prop: 'warehTypeLabel', label: $t('pages.task.detail.warehType'), minWidth: 120, showOverflowTooltip: true }, { prop: 'orgLoc', label: $t('pages.task.search.orgLoc'), minWidth: 140, showOverflowTooltip: true }, { prop: 'orgSiteLabel', label: $t('pages.task.detail.orgSite'), minWidth: 160, showOverflowTooltip: true }, { prop: 'targLoc', label: $t('pages.task.search.targLoc'), minWidth: 140, showOverflowTooltip: true }, { prop: 'targSiteLabel', label: $t('pages.task.detail.targSite'), minWidth: 160, showOverflowTooltip: true }, { prop: 'barcode', label: $t('pages.task.search.barcode'), minWidth: 150, showOverflowTooltip: true }, { prop: 'robotCode', label: $t('pages.task.detail.robotCode'), minWidth: 150, showOverflowTooltip: true }, { prop: 'sort', label: $t('pages.task.detail.priority'), width: 100, align: 'right' }, { prop: 'updateTimeText', label: $t('table.updateTime'), minWidth: 180, showOverflowTooltip: true }, { prop: 'operation', label: $t('table.operation'), width: 120, align: 'center', fixed: 'right', formatter: (row) => h('div', [ h(ArtButtonMore, { list: getTaskActionList(row), onClick: (item) => handleActionClick(item, row) }) ]) } ] }