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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
| /*
| * @Description: file content
| * @Author: Ben Lin
| * @version:
| * @Date: 2024-06-13 16:18:39
| * @LastEditors: your name
| * @LastEditTime: 2024-06-13 22:47:11
| */
| import { h, unref } from "vue";
| import { ActionItem, BasicColumn, FormSchema } from "/@/components/Table";
| import { Tag, Tooltip } from "ant-design-vue";
| import { GetEnum } from "/@/api/tigerapi/system";
| import { useLocale } from "/@/locales/useLocale";
| import { useI18n } from '/@/hooks/web/useI18n';
|
| const { t } = useI18n();
| const { getLocale } = useLocale();
| export const firstColumns: BasicColumn[] = [
| {
| dataIndex: "LABEL_ID",
| title: "标签模板ID",
| ifShow: false,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: "VAR_NAME",
| title: "变量名称",
| ifShow: true,
| sorter: true,
| resizable: true,
| customRender: () => { }
| },
| {
| dataIndex: "VAR_TYPE",
| title: "变量类型",
| ifShow: true,
| sorter: true,
| resizable: true,
| customRender: ({ record }) => {
| let color = ''; let text = '';
| switch (record.VAR_TYPE) {
| case 0:
| text = '常量';
| color = 'green';
| break;
| case 1:
| text = '过程变量';
| color = 'orange';
| break;
| case 2:
| text = '日期变量';
| color = '#4f68b0';
| break;
| case 3:
| text = '自定义变量';
| color = '#bfbfbf';
| break;
| }
| return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text),);
| }
| },
| {
| dataIndex: "VAR_VALUE",
| title: "变量值",
| ifShow: true,
| sorter: true,
| resizable: true,
| },
| {
| dataIndex: "REMARK",
| title: "备注",
| ifShow: true,
| sorter: true,
| resizable: true,
| }];
|
| export const secondColumns: BasicColumn[] = [];
|
| let isShow = true;
| export const firstFormSchemas: FormSchema[] = [
| {
| field: 'ID',
| label: '变量ID',
| component: 'Input',
| colProps: {
| span: 20,
| },
| show: false,
| },
| {
| field: 'LABEL_ID',
| label: '标签模板ID',
| component: 'Input',
| colProps: {
| span: 20,
| },
| show: false,
| },
| {
| field: 'VAR_NAME',
| label: '变量名',
| required: true,
| component: 'Input',
| colProps: {
| span: 20,
| },
| },
| {
| field: 'VAR_TYPE',
| label: '变量类型',
| component: 'ApiSelect',
| colProps: {
| span: 20,
| },
| componentProps: {
| api: GetEnum,
| params: { name: 'BAS_LABEL_VAR+VAR_TYPEs' },
| resultField: 'Data',
| labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
| valueField: 'Value',
| onChange: (e) => {
| if(e == 1){
| isShow = true;
| }else{
| isShow = false;
| }
| }
| },
| },
| {
| field: 'VAR_VALUE',
| label: '变量值',
| required: true,
| component: 'Input',
| colProps: {
| span: 20,
| },
| },
| {
| field:"BAS_LABEL_PV1PSelect_0",
| label:"1",
| defaultValue:"BAS_LABEL_PV",
| component:"Input",
| colProps:{"span":4},
| ifShow: ({ values }) => isShow,
| colSlot:"BAS_LABEL_PV1add"
| },
| {
| field: 'REMARK',
| label: '备注',
| component: 'Input',
| colProps: {
| span: 20,
| },
| },
| ];
| export const secondFormSchemas: FormSchema[] = [];
|
| export const firstSearchForm: FormSchema[] = [
| {
| field: 'VAR_NAME',
| label: t('变量名'),
| colProps: { span: 8 },
| component: 'Input',
| },
| ];
|
| export const labelActionItem: ActionItem[] = [
| {
| icon: 'clarity:info-standard-line',
| tooltip: '模板变量',
| onClick: () => { },
| },
| ];
|
| /**
| * @description: 跳转到详情页面方法
| * @param {Fn} go
| * @return {*}
| */
| export function goDetail(go: Fn, record: Recordable) {
| const id = {
| ID: 'BAS_LABEL_VAR',
| firstTabName: '标签模板变量',
| secondTabName:'', //'标签过程变量',
| firstTitle: '模板变量',
| secondTitle: '', //'过程变量',
| contentStr: '这里是标签模板变量管理页面,可以管理标签的模板变量或者打印过程中的变量',
| detailName: `模板[${record.LABEL_NAME}]`,
| others: { LABEL_ID: record.ID },
| colSlots: ['BAS_LABEL_PV1add'],
| };
| go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`);
| }
|
| export function labelOpenSelectItem(openItemModal: Fn) {
| openItemModal(true, {
| title: '过程变量列表',
| schemas: [
| {
| field: 'VAR_CODE',
| component: 'Input',
| label: '过程变量编码',
| colProps: {
| span: 12,
| },
| },
| ],
| ItemColumns: [
| {
| title: t('过程变量编码'),
| dataIndex: 'VAR_CODE',
| resizable: true,
| sorter: true,
| width: 200,
| },
| {
| title: t('过程变量名称'),
| dataIndex: 'VAR_NAME',
| resizable: true,
| sorter: true,
| width: 180,
| },
| ],
| tableName: 'BAS_LABEL_PV',
| rowKey: 'VAR_CODE',
| });
| }
|
| /**
| * @description: 选择过程变量弹出选择框成功返回赋值方法
| * @param {*} d
| * @param {*} u
| * @return {*}
| */
| export function labelGetSelectSuccess(d, u) {
| return {
| VAR_VALUE: d.values['val'],
| };
| }
|
|