| | |
| | | import { h } from 'vue' |
| | | import { $t } from '@/locales' |
| | | import ArtButtonMore from '@/components/core/forms/art-button-more/index.vue' |
| | | |
| | | export function createMatnrGroupTableColumns({ |
| | |
| | | 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 [ |
| | |
| | | }, |
| | | { |
| | | prop: 'code', |
| | | label: '分组编码', |
| | | label: $t('pages.basicInfo.matnrGroup.table.code'), |
| | | minWidth: 160, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'parCode', |
| | | label: '上级编码', |
| | | label: $t('pages.basicInfo.matnrGroup.table.parentCode'), |
| | | minWidth: 160, |
| | | showOverflowTooltip: true, |
| | | formatter: (row) => row.parCode || '--' |
| | | }, |
| | | { |
| | | prop: 'name', |
| | | label: '分组名称', |
| | | label: $t('pages.basicInfo.matnrGroup.table.name'), |
| | | minWidth: 240, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'operation', |
| | | label: '操作', |
| | | label: $t('table.operation'), |
| | | width: 120, |
| | | align: 'center', |
| | | fixed: 'right', |