1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
| import { h } from 'vue'
| import { ElTag } from 'element-plus'
| import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
|
| export function createConfigTableColumns({ t, handleView, handleEdit, handleDelete }) {
| return [
| {
| prop: 'uuid',
| label: t('table.code'),
| minWidth: 140,
| showOverflowTooltip: true
| },
| {
| prop: 'name',
| label: t('table.name'),
| minWidth: 180,
| showOverflowTooltip: true
| },
| {
| prop: 'flag',
| label: t('pages.system.config.table.flag'),
| minWidth: 180,
| showOverflowTooltip: true
| },
| {
| prop: 'typeText',
| label: t('pages.system.config.table.type'),
| width: 110,
| formatter: (row) => t(row.typeTextKey || 'common.placeholder.empty')
| },
| {
| prop: 'val',
| label: t('pages.system.config.table.value'),
| minWidth: 180,
| showOverflowTooltip: true,
| formatter: (row) => row.val || t('common.placeholder.empty')
| },
| {
| prop: 'status',
| label: t('table.status'),
| width: 100,
| formatter: (row) =>
| h(ElTag, { type: row.statusType, effect: 'light' }, () =>
| t(row.statusTextKey || 'common.placeholder.empty')
| )
| },
| {
| prop: 'updateTimeText',
| label: t('table.updateTime'),
| minWidth: 180,
| formatter: (row) => row.updateTimeText || t('common.placeholder.empty')
| },
| {
| prop: 'operation',
| label: t('table.operation'),
| width: handleDelete ? 160 : 120,
| align: 'right',
| formatter: (row) => {
| const buttons = [
| h(ArtButtonTable, {
| type: 'view',
| onClick: () => handleView(row)
| }),
| h(ArtButtonTable, {
| type: 'edit',
| onClick: () => handleEdit(row)
| })
| ]
|
| if (handleDelete) {
| buttons.push(
| h(ArtButtonTable, {
| type: 'delete',
| onClick: () => handleDelete(row)
| })
| )
| }
|
| return h('div', { class: 'flex justify-end' }, buttons)
| }
| }
| ]
| }
|
|