| | |
| | | import { h } from 'vue' |
| | | import { $t } from '@/locales' |
| | | import { ElTag } from 'element-plus' |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | import { getLocTypeStatusMeta } from './locTypePage.helpers' |
| | |
| | | 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' }, |
| | | { type: 'globalIndex', label: $t('table.index'), width: 72, align: 'center' }, |
| | | { |
| | | prop: 'uuid', |
| | | label: '标识', |
| | | label: $t('pages.basicInfo.locType.table.uuid'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.uuid || '--' |
| | | }, |
| | | { |
| | | prop: 'code', |
| | | label: '编码', |
| | | label: $t('table.code'), |
| | | minWidth: 150, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.code || '--' |
| | | }, |
| | | { |
| | | prop: 'name', |
| | | label: '名称', |
| | | label: $t('table.name'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.name || '--' |
| | | }, |
| | | { |
| | | prop: 'regex', |
| | | label: '条码规则', |
| | | label: $t('pages.basicInfo.locType.table.regex'), |
| | | minWidth: 220, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.regex || '--' |
| | | }, |
| | | { |
| | | prop: 'status', |
| | | label: '状态', |
| | | label: $t('table.status'), |
| | | width: 100, |
| | | align: 'center', |
| | | formatter: (row) => { |
| | |
| | | }, |
| | | { |
| | | prop: 'memo', |
| | | label: '备注', |
| | | label: $t('table.memo'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.memo || '--' |
| | | }, |
| | | { |
| | | prop: 'updateByText', |
| | | label: '更新人', |
| | | label: $t('table.updateBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.updateByText || '--' |
| | | }, |
| | | { |
| | | prop: 'updateTimeText', |
| | | label: '更新时间', |
| | | label: $t('table.updateTime'), |
| | | minWidth: 170, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.updateTimeText || '--' |
| | | }, |
| | | { |
| | | prop: 'createByText', |
| | | label: '创建人', |
| | | label: $t('table.createBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createByText || '--' |
| | | }, |
| | | { |
| | | prop: 'createTimeText', |
| | | label: '创建时间', |
| | | label: $t('table.createTime'), |
| | | minWidth: 170, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.createTimeText || '--' |
| | | }, |
| | | { |
| | | prop: 'operation', |
| | | label: '操作', |
| | | width: 160, |
| | | align: 'right', |
| | | label: $t('table.operation'), |
| | | width: 120, |
| | | align: 'center', |
| | | fixed: 'right', |
| | | formatter: (row) => |
| | | h(ArtButtonMore, { |
| | | list: operations, |