| | |
| | | import { h } from 'vue' |
| | | import { ElTag } from 'element-plus' |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | import { $t } from '@/locales' |
| | | import { getLocStatusMeta, getLocUseStatusMeta } from './locPage.helpers' |
| | | |
| | | function createTextColumn(prop, label, minWidth, formatter) { |
| | |
| | | canEdit = true, |
| | | canDelete = true |
| | | } = {}) { |
| | | const operations = [{ key: 'view', label: '详情', icon: 'ri:eye-line' }] |
| | | const operations = [{ key: 'view', label: $t('common.actions.detail'), icon: 'ri:eye-line' }] |
| | | |
| | | if (canEdit && handleEdit) { |
| | | operations.push({ key: 'edit', label: '编辑', icon: 'ri:pencil-line' }) |
| | | operations.push({ key: 'edit', label: $t('common.actions.edit'), icon: 'ri:pencil-line' }) |
| | | } |
| | | |
| | | if (canDelete && handleDelete) { |
| | | operations.push({ key: 'delete', label: '删除', 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 [ |
| | | { type: 'selection', width: 48, align: 'center' }, |
| | | { type: 'globalIndex', label: '序号', width: 72, align: 'center' }, |
| | | createTextColumn('code', '库位号', 160), |
| | | createTextColumn('warehouseName', '仓库', 150, (row) => row.warehouseName || row.warehouseId$ || '--'), |
| | | createTextColumn('areaName', '库区', 150, (row) => row.areaName || row.areaId$ || '--'), |
| | | createTextColumn('typeIdsText', '库位类型', 180), |
| | | createNumberColumn('row', '排', 80), |
| | | createNumberColumn('col', '列', 80), |
| | | createNumberColumn('lev', '层', 80), |
| | | createNumberColumn('channel', '巷道', 90), |
| | | createTagColumn('useStatus', '使用状态', 110, (row) => getLocUseStatusMeta(row.useStatus)), |
| | | createTextColumn('flagLogicText', '虚拟库位', 110), |
| | | createTextColumn('flagLabelMangeText', '标签管理', 110), |
| | | createTextColumn('barcode', '容器编码', 150), |
| | | createTagColumn('status', '状态', 100, (row) => getLocStatusMeta(row.statusBool ?? row.status)), |
| | | createTextColumn('updateTimeText', '更新时间', 170, (row) => row.updateTimeText || row.updateTime$ || '--'), |
| | | createTextColumn('memo', '备注', 180), |
| | | { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' }, |
| | | createTextColumn('code', $t('pages.basicInfo.loc.table.code'), 160), |
| | | createTextColumn('warehouseName', $t('pages.basicInfo.loc.table.warehouseName'), 150, (row) => row.warehouseName || row.warehouseId$ || '--'), |
| | | createTextColumn('areaName', $t('pages.basicInfo.loc.table.areaName'), 150, (row) => row.areaName || row.areaId$ || '--'), |
| | | createTextColumn('typeIdsText', $t('pages.basicInfo.loc.table.typeIds'), 180), |
| | | createNumberColumn('row', $t('pages.basicInfo.loc.table.row'), 80), |
| | | createNumberColumn('col', $t('pages.basicInfo.loc.table.col'), 80), |
| | | createNumberColumn('lev', $t('pages.basicInfo.loc.table.lev'), 80), |
| | | createNumberColumn('channel', $t('pages.basicInfo.loc.table.channel'), 90), |
| | | createTagColumn('useStatus', $t('pages.basicInfo.loc.table.useStatus'), 110, (row) => getLocUseStatusMeta(row.useStatus)), |
| | | createTextColumn('flagLogicText', $t('pages.basicInfo.loc.table.flagLogic'), 110), |
| | | createTextColumn('flagLabelMangeText', $t('pages.basicInfo.loc.table.flagLabelManage'), 110), |
| | | createTextColumn('barcode', $t('pages.basicInfo.loc.table.barcode'), 150), |
| | | createTagColumn('status', $t('table.status'), 100, (row) => getLocStatusMeta(row.statusBool ?? row.status)), |
| | | createTextColumn('updateTimeText', $t('table.updateTime'), 170, (row) => row.updateTimeText || row.updateTime$ || '--'), |
| | | createTextColumn('memo', $t('table.remark'), 180), |
| | | { |
| | | prop: 'operation', |
| | | label: '操作', |
| | | label: $t('table.operation'), |
| | | width: 120, |
| | | align: 'center', |
| | | fixed: 'right', |