zhou zhou
1 天以前 0a1d91e42e6c5af96e1108e9ebcc37e99eb3b22c
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import { h } from 'vue'
import { ElTag } from 'element-plus'
import ArtButtonTable from '@/components/core/forms/art-button-table/index.vue'
 
export function createSerialRuleItemTableColumns({ handleView, handleEdit, handleDelete }) {
  return [
    {
      type: 'globalIndex',
      label: '序号',
      width: 72,
      align: 'center'
    },
    {
      prop: 'ruleId',
      label: '规则主表标识',
      width: 120,
      align: 'center'
    },
    {
      prop: 'wkTypeText',
      label: '规则类型',
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'feildValue',
      label: '字段值',
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'len',
      label: '截取长度',
      width: 110,
      align: 'center',
      formatter: (row) => row.len ?? '-'
    },
    {
      prop: 'lenStr',
      label: '起始位置',
      width: 110,
      align: 'center',
      formatter: (row) => row.lenStr ?? '-'
    },
    {
      prop: 'sort',
      label: '排序顺序',
      width: 110,
      align: 'center',
      formatter: (row) => row.sort ?? '-'
    },
    {
      prop: 'status',
      label: '状态',
      width: 100,
      align: 'center',
      formatter: (row) => h(ElTag, { type: row.statusType, effect: 'light' }, () => row.statusText || '-')
    },
    {
      prop: 'updateTimeText',
      label: '更新时间',
      minWidth: 180,
      showOverflowTooltip: true,
      formatter: (row) => row.updateTimeText || '-'
    },
    {
      prop: 'memo',
      label: '备注',
      minWidth: 180,
      showOverflowTooltip: true,
      formatter: (row) => row.memo || '-'
    },
    {
      prop: 'operation',
      label: '操作',
      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)
      }
    }
  ]
}