| | |
| | | import { ElTag } from 'element-plus' |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | import { $t } from '@/locales' |
| | | import BasStationTagCell from './modules/bas-station-tag-cell.vue' |
| | | import { |
| | | getBasStationUseStatusMeta, |
| | | getBasStationStatusMeta, |
| | |
| | | |
| | | export function createBasStationTableColumns({ |
| | | handleView, |
| | | handleCopy, |
| | | handleEdit, |
| | | handleDelete, |
| | | canEdit = true, |
| | |
| | | } = {}) { |
| | | const operations = [{ key: 'view', label: $t('common.actions.detail'), icon: 'ri:eye-line' }] |
| | | |
| | | if (handleCopy) { |
| | | operations.push({ key: 'copy', label: '复制初始化', icon: 'ri:file-copy-line' }) |
| | | } |
| | | |
| | | if (canEdit && handleEdit) { |
| | | operations.push({ key: 'edit', label: $t('common.actions.edit'), icon: 'ri:pencil-line' }) |
| | | } |
| | | |
| | | if (canDelete && handleDelete) { |
| | | operations.push({ key: 'delete', label: $t('common.actions.delete'), icon: 'ri:delete-bin-5-line', color: 'var(--art-error)' }) |
| | | operations.push({ |
| | | key: 'delete', |
| | | label: $t('common.actions.delete'), |
| | | icon: 'ri:delete-bin-5-line', |
| | | color: 'var(--art-error)' |
| | | }) |
| | | } |
| | | |
| | | return [ |
| | |
| | | formatter: (row) => row.areaText || row.area$ || '--' |
| | | }, |
| | | { |
| | | prop: 'crossZoneAreaText', |
| | | prop: 'crossZoneAreaItems', |
| | | label: $t('pages.basicInfo.basStation.table.crossZoneArea'), |
| | | minWidth: 220, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.crossZoneAreaText || '--' |
| | | formatter: (row) => |
| | | h(BasStationTagCell, { |
| | | items: row.crossZoneAreaItems || [], |
| | | title: '可跨区库区' |
| | | }) |
| | | }, |
| | | { |
| | | prop: 'containerTypesText', |
| | | prop: 'containerTypeItems', |
| | | label: $t('pages.basicInfo.basStation.table.containerTypes'), |
| | | minWidth: 200, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.containerTypesText || '--' |
| | | formatter: (row) => |
| | | h(BasStationTagCell, { |
| | | items: row.containerTypeItems || [], |
| | | title: '可入容器类型' |
| | | }) |
| | | }, |
| | | { |
| | | prop: 'barcode', |
| | |
| | | formatter: (row) => row.updateTimeText || row.updateTime$ || '--' |
| | | }, |
| | | { |
| | | prop: 'createByText', |
| | | label: $t('table.createBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createByText || row.createBy$ || '--' |
| | | }, |
| | | { |
| | | prop: 'createTimeText', |
| | | label: $t('table.createTime'), |
| | | minWidth: 170, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createTimeText || row.createTime$ || '--' |
| | | }, |
| | | { |
| | | prop: 'memo', |
| | | label: $t('table.remark'), |
| | | minWidth: 180, |
| | |
| | | list: operations, |
| | | onClick: (item) => { |
| | | if (item.key === 'view') handleView?.(row) |
| | | if (item.key === 'copy') handleCopy?.(row) |
| | | if (item.key === 'edit') handleEdit?.(row) |
| | | if (item.key === 'delete') handleDelete?.(row) |
| | | } |