cloud-web-corejs 1.0.54-dev.125 → 1.0.54-dev.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,543 +1,608 @@
1
- import projectTagView from "@base/components/projectTag/view.vue";
2
- import projectTagAddButton from "@base/components/projectTag/addButton.vue";
3
- import projectTagDeleteButton from "@base/components/projectTag/deleteButton.vue";
4
- import tableForm from "@base/components/table/tableForm.vue";
5
- import editView from "@base/views/bd/setting/form_template/edit.vue";
6
- import userDialog from "@base/views/user/user/dialog.vue";
7
- import positionDialog from "@base/views/user/position/dialog.vue";
8
- import scriptDescriptionDialog from "@base/components/scriptDescription/dialog.vue";
9
- import ftHistoryDialog from "@base/views/bd/setting/form_template/ftHistoryDialog.vue";
10
- import itemList from "@base/views/bd/setting/form_template/itemList.vue";
11
- import formTypeEditDialog from "@base/views/user/form/form_type/editDialog.vue";
12
- import formScriptList from "@base/views/bd/setting/form_script/form_list.vue";
13
- import projectTagDialog from "@base/views/user/project_tag/dialog.vue";
14
- import {treeScollx} from "@base/utils/global";
15
- import indexUtil from "@base/utils";
16
- import {getBdFlag} from "@base/api/user";
17
- import designer from "@base/views/user/form/vform/designer.vue";
18
- import {getJsxBtnList, getJsxStatus} from "@base/views/bd/setting/utils/index";
19
-
20
- let modules = {};
21
- modules = {
22
- name: 'bd_form_template:list',
23
- components: {
24
- projectTagView,
25
- projectTagAddButton, projectTagDeleteButton,
26
- tableForm,
27
- editView,
28
- userDialog,
29
- positionDialog,
30
- scriptDescriptionDialog,
31
- ftHistoryDialog,
32
- itemList,
33
- formTypeEditDialog,
34
- formScriptList,
35
- projectTagDialog,
36
- designer
37
- },
38
- data() {
39
- return {
40
- isFullscreen: false,
41
- formDesTabs: 'first',
42
- activeName: 'second',
43
- dataId: 0,
44
- showEdit: false,
45
- vxeOption: {},
46
- formData: {},
47
- showDesingerDialog: false,
48
- formCode: null,
49
- formName: null,
50
- templateId: null,
51
- currentFormTemplate: null,
52
-
53
- showItemEdit: false,
54
- showParamEdit: false,
55
- vxeOption1: {},
56
- editId: '',
57
- itemEditId: '',
58
- pRow: null,
59
- currentRow: {},
60
- serviceId: null,
61
- itemServiceId: null,
62
-
63
- showWfDialog: false,
64
- wfUrl: '',
65
- ph: '',
66
- dialogActiveName: 'first',
67
- showFunctionScriptList: false,
68
- showUserDialog: false,
69
- wfAssignData: [],
70
- wfAssignCallback: null,
71
- wfAssignMulti: true,
72
-
73
- showPositionDialog: false,
74
- wfAssignPositionData: [],
75
- wfAssignPositionCallback: null,
76
-
77
- showFormTemplateDialog: false,
78
- wfAssignFormTemplateCallback: null,
79
-
80
- showScriptDescriptionDialog: false,
81
- showWfDiyAttributeEdit: false,
82
-
83
- showFtHistoryDialog: false,
84
- operateFtHistory: null,
85
-
86
- defaultProps: {
87
- label: 'name', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
88
- children: [],
89
- isLeaf: 'leaf'
90
- },
91
- showItemView: false,
92
-
93
- currentFormType: {},
94
- editFormTypeId: null,
95
- showFormTypeDialog: false,
96
- showFormScriptList: false,
97
- addProjectTagOption: {
98
- url: USER_PREFIX + `/formTemplate/saveTag`,
99
- tableDatas: () => {
100
- return this.$refs["table-m1"].getCheckboxRecords(true);
101
- },
102
- reqData: (tagDatas, tableDatas) => {
103
- let sids = tableDatas.map(item => item.sid);
104
- let tagCodes = tagDatas.map(item => item.tagCode);
105
- let reqData = {
106
- tagCodes,
107
- sids
108
- };
109
- return reqData;
110
- },
111
- callback: () => {
112
- this.searchEvent()
113
- }
114
- },
115
- deleteProjectTagOption: {
116
- url: USER_PREFIX + `/formTemplate/deleteTag`,
117
- tableDatas: () => {
118
- return this.$refs["table-m1"].getCheckboxRecords(true);
119
- },
120
- reqData: (tagDatas, tableDatas) => {
121
- let sids = tableDatas.map(item => item.sid);
122
- let tagCodes = tagDatas.map(item => item.tagCode);
123
- let reqData = {
124
- tagCodes,
125
- sids
126
- };
127
- return reqData;
128
- },
129
- callback: () => {
130
- this.searchEvent()
131
- }
132
- },
133
- showProjectTagDialog3: false,
134
- checkTags: [],
135
- isDev: true,
136
- menuKindAuth: {},
137
- showTree: false
138
- };
139
- },
140
- computed: {
141
- currentMenuKindId() {
142
- return this.currentFormType?.id || null
143
- },
144
- currentMenuKindName() {
145
- return this.currentFormType?.name || null
146
- }
147
- },
148
- watch: {
149
- formDesTabs(val) {
150
- if (this.showFormScriptList == false && val == 'second') {
151
- this.showFormScriptList = true;
152
- }
153
- }
154
- },
155
- mounted() {
156
- treeScollx({target: this, type: 'default'});
157
- this.getBdEnv();
158
- this.initTableList();
159
- this.initWfWinParam();
160
- },
161
- methods: {
162
- searchEvent() {
163
- this.$refs['table-m1'].commitProxy('reload');
164
- },
165
- resetEvent() {
166
- this.formData = {};
167
- this.checkTags = [];
168
- this.$refs['table-m1'].commitProxy('reload');
169
- },
170
- openEditDialog(row) {
171
- let formCode = row?.formCode || null;
172
- /*this.dataId = !id || typeof id == 'object' ? 0 : id;
173
- this.activeName = 'first';
174
- this.showItemEdit = false;
175
- this.$openEditView('showEdit');*/
176
- if (!formCode) {
177
- this.dataId = formCode;
178
- this.activeName = 'first';
179
- this.$openEditView('showEdit');
180
- } else {
181
- this.$refs.xTabs.openEditTab(row);
182
- }
183
-
184
- },
185
- openDesingerDialog(row, callback) {
186
- this.formCode = row.formCode;
187
- this.formName = row.formName;
188
- this.currentFormTemplate = row;
189
- this.isFullscreen = false;
190
- this.showDesingerDialog = true;
191
- this.designerSaveCallback = callback ?? null;
192
- },
193
- openDesingerDialogByChild({row, callback}) {
194
- this.openDesingerDialog(row, callback)
195
- },
196
- reflushTemplateList() {
197
- this.searchEvent();
198
- this.designerSaveCallback && this.designerSaveCallback();
199
- },
200
- handleFullscreen() {
201
- let isFullscreen = this.isFullscreen;
202
- if (!isFullscreen) {
203
- indexUtil.addClass(document.body, "hideMenu");
204
- } else {
205
- indexUtil.removeClass(document.body, "hideMenu");
206
- }
207
- this.isFullscreen = !isFullscreen;
208
- },
209
- openFtHistoryDialog(row) {
210
- this.operateFtHistory = row;
211
- this.showFtHistoryDialog = true;
212
- },
213
- confirmFtHistoryDialog(row) {
214
- this.searchEvent();
215
- },
216
- closeFormDesignwinEvent(done) {
217
- this.$baseConfirm(this.$t1('请确认"已保存"报表模板,是否继续关闭?')).then(() => {
218
- indexUtil.removeClass(document.body, "hideMenu");
219
- done && done();
220
- });
221
- },
222
- getSearchParam() {
223
- let tagCodes = null;
224
- if (this.checkTags.length) {
225
- tagCodes = this.checkTags.map(item => item.tagCode);
226
- }
227
- let currentFormType = this.currentFormType || {}
228
- return {
229
- ...this.formData,
230
- tagCodes,
231
- menuKindCode: currentFormType.menuKindCode || null,
232
- history: false
233
- };
234
- },
235
- initTableList() {
236
- let that = this;
237
- let tableOption = {
238
- vue: this,
239
- tableRef: 'table-m1',
240
- tableName: 'bd_form_template_list-m1',
241
- path: USER_PREFIX + '/formTemplate/listPage',
242
- param: () => {
243
- return this.getSearchParam();
244
- },
245
- columns: [
246
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
247
- {
248
- title: this.$t1('模板名称'),
249
- field: 'formName',
250
- width: 150,
251
- fixed: 'left'
252
- },
253
- {
254
- title: this.$t1('模板编码'),
255
- field: 'formCode',
256
- width: 150
257
- },
258
- {
259
- title: this.$t1('模板版本'),
260
- field: 'formVersion',
261
- width: 150
262
- },
263
- {
264
- title: this.$t1('表单分类'),
265
- field: 'menuKindName',
266
- width: 150,
267
- },
268
- {
269
- title: this.$t1('是否启用'),
270
- field: 'enabled',
271
- width: 150,
272
- slots: {
273
- default: ({row}) => {
274
- if (row.enabled) {
275
- return getJsxStatus(null, this.$t1('启用'))
276
- } else {
277
- return getJsxStatus('s-3', this.$t1('禁用'))
278
- }
279
- }
280
- }
281
- },
282
- {
283
- title: this.$t1('启用流程'),
284
- field: 'hasWf',
285
- width: 150,
286
- slots: {
287
- default: ({row}) => {
288
- if (row.hasWf) {
289
- return getJsxStatus(null, this.$t1('是'))
290
- } else {
291
- return getJsxStatus('s-3', this.$t1('否'))
292
- }
293
- }
294
- }
295
- },
296
- {title: this.$t1('默认流程单据类型名称'), field: "objTypeName", width: 200},
297
- {title: this.$t1('引用流程的表单编码'), field: "fromWfFormCode", width: 200},
298
- {
299
- title: this.$t1('备注'),
300
- field: 'remark',
301
- width: 150
302
- },
303
- {
304
- title: this.$t1('项目标签'), field: 'tag', width: 250, slots: {default: "tag"}, params: {
305
- exportVal: ({row}) => {
306
- if (row.formTemplateTagDTOs) {
307
- return row.formTemplateTagDTOs.map(item => item.tagName).join(",")
308
- }
309
- }
310
- }
311
- },
312
- {field: 'serviceName', title: this.$t1('服务名'), width: 150},
313
- {title: this.$t1('唯一标识'), field: 'sid', width: 280},
314
- {
315
- title: this.$t1('更新时间'),
316
- field: 'modifyDate',
317
- width: 150
318
- },
319
- {
320
- title: this.$t1('创建时间'),
321
- field: 'createDate',
322
- width: 150
323
- },
324
- {
325
- width: 100,
326
- fixed: 'right',
327
- title: '',
328
- sortable: false,
329
- slots: {
330
- default: ({row}) => {
331
- return getJsxBtnList([
332
- {
333
- iconName: "el-icon-edit",
334
- content: this.$t1('查看'),
335
- onclick: () => {
336
- this.openEditDialog(row);
337
- }
338
- },
339
- {
340
- iconName: "iconfont icon-liuchengguanli-shejiqi_liucheng",
341
- content: this.$t1('表单设计'),
342
- onclick: () => {
343
- this.openDesingerDialog(row);
344
- }
345
- }
346
- ]);
347
- }
348
- }
349
- }
350
- ],
351
- searchColumns: [
352
- {
353
- title: this.$t1('表单分类'),
354
- field: "menuKindName",
355
- type: "input",
356
- common: true,
357
- disabled: true,
358
- defaultValueEnabled: false,
359
- slot: "menuKindName"
360
- },
361
- {title: this.$t1('模板名称'), field: "formName", type: "input", common: true},
362
- {title: this.$t1('模板编码'), field: "formCode", type: "input", common: true},
363
- {
364
- title: this.$t1('是否启用'), field: "enabled", type: "select", common: true, itemOption: [
365
- {label: this.$t1('启用'), value: true},
366
- {label: this.$t1('禁用'), value: false}
367
- ]
368
- },
369
- {title: this.$t1('项目标签'), field: "tag", type: "input", common: true, slot: "tag"},
370
- ],
371
- config: {
372
- proxyConfig: {
373
- autoLoad: false
374
- }
375
- },
376
- };
377
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
378
- this.vxeOption = opts;
379
- this.showTree = true;
380
- });
381
- },
382
- chooseCellM1(row) {
383
- this.currentRow = row;
384
- this.showItemView = true;
385
- },
386
- openWfDesignDialog(actModelId) {
387
- //wfType 0:单据流程,1:场景流程
388
- let serviceId = this.currentRow.serviceName;
389
- this.wfUrl = WEB_PREFIX + '/activiti-explorer/modeler.html?wfType=0&serviceId=' + serviceId + '&modelId=' + actModelId;
390
- this.dialogActiveName = 'first';
391
- this.showWfDialog = true;
392
- },
393
- closeDesignwinEvent(done) {
394
- this.$baseConfirm(this.$t1('请确认"已保存"流程模板,是否继续关闭?')).then(() => {
395
- this.showWfDialog = false;
396
- // this.showDesingerDialog = false;
397
- });
398
- },
399
- initWfWinParam() {
400
- this.initCloseWfDesignWin();
401
- this.initWinUserDialog();
402
- this.initWinPositionDialog();
403
- this.initSysParamForWf();
404
- this.initWinFormTemplateDialog();
405
- this.initWinScriptDescriptionDialog();
406
- },
407
- initCloseWfDesignWin() {
408
- window.closeWfDesignWin = () => {
409
- this.showWfDialog = false;
410
- };
411
- },
412
- initWinUserDialog() {
413
- window.openAssignUserDialog = opts => {
414
- this.wfAssignMulti = opts.multi;
415
- this.wfAssignData = opts.data || [];
416
- this.wfAssignCallback = opts.callback;
417
- this.showUserDialog = true;
418
- };
419
- },
420
- confirmUser(rows) {
421
- this.wfAssignCallback(rows);
422
- },
423
- initWinPositionDialog() {
424
- window.openAssignPositionDialog = opts => {
425
- this.wfAssignPositionData = opts.data || [];
426
- this.wfAssignPositionCallback = opts.callback;
427
- this.showPositionDialog = true;
428
- };
429
- },
430
- initSysParamForWf() {
431
- let webPrefix = WEB_PREFIX;
432
- let baseApi = process.env.VUE_APP_BASE_API;
433
- window.sysParamForWf = {
434
- webPrefix,
435
- baseApi
436
- }
437
- },
438
- confirmPosition(rows) {
439
- this.wfAssignPositionCallback(rows);
440
- },
441
- initWinFormTemplateDialog() {
442
- window.openAssignFormTemplateDialog = opts => {
443
- this.wfAssignFormTemplateCallback = opts.callback;
444
- this.showFormTemplateDialog = true;
445
- };
446
- },
447
- confirmFormTemplate(rows) {
448
- this.wfAssignFormTemplateCallback(rows);
449
- },
450
- initWinScriptDescriptionDialog() {
451
- window.openScriptDescriptionDialog = opts => {
452
- this.showScriptDescriptionDialog = true;
453
- };
454
- },
455
- handleNodeClick(data, node, v) {
456
- this.handleNodeData(node)
457
- this.$forceUpdate();
458
- this.searchEvent();
459
- },
460
- // 异步树叶子节点懒加载逻辑
461
- loadNode(node, resolve) {
462
- let id = node && node.data && node.data.id ? node.data.id || '' : 0;
463
- let param = {enabled: true};
464
- let url = !id ? USER_PREFIX + '/menuKind/getAllList' : USER_PREFIX + '/menuKind/getChildren';
465
- this.$http({
466
- aes: true,
467
- url: url,
468
- method: 'post',
469
- data: {
470
- parent: id,
471
- enabled: true
472
- },
473
- success: res => {
474
- let rows = res.objx || [];
475
- rows.forEach(value => {
476
- value.leaf = !value.hasChild;
477
- });
478
- if (node.level === 0) {
479
- if (rows.length > 0) {
480
- this.$nextTick(() => {
481
- let firstNode = node.childNodes[0];
482
- if (rows[0].hasChild) {
483
- firstNode.expand();
484
- }
485
- this.$refs.tree.setCurrentKey(firstNode.data);
486
- this.handleNodeClick(firstNode.data, firstNode, this)
487
- });
488
- }
489
- }
490
- resolve(rows);
491
- }
492
- });
493
- },
494
- handleNodeData(node) {
495
- this.currentFormType = node ? node.data : null;
496
- this.currentNode = node;
497
- },
498
- handleFormDesignClose() {
499
- this.formDesTabs = 'first';
500
- this.showFormScriptList = false;
501
- },
502
- openProjectTagDialog3() {
503
- this.showProjectTagDialog3 = true;
504
- },
505
- confirmProjectTagDialog3(rows) {
506
- this.checkTags = rows;
507
- },
508
- getTabNames() {
509
- return this.checkTags.map(item => item.tagName).join(",");
510
- },
511
- jsonImport() {
512
- this.$jsonImport({
513
- saveUrl: USER_PREFIX + '/form_develop/importFormTemplate',
514
- showResult: true,
515
- resultColumns: [
516
- {title: this.$t1('模板名称'), field: "formName", width: 200},
517
- {title: this.$t1('模板编码'), field: "formCode", width: 200},
518
- {title: this.$t1('结果信息'), field: "impReturnMsg", width: 300}
519
- ],
520
- callback: () => {
521
- this.searchEvent();
522
- }
523
- });
524
- },
525
- jsonExport() {
526
- this.$jsonExport({
527
- targetRef: "table-m1",
528
- url: USER_PREFIX + "/form_develop/exportFormTemplate",
529
- abcEnabled: true,
530
- editAuth: this.currentFormType.editAuth,
531
- selectTypeAuth: this.currentFormType.selectTypeAuth
532
- })
533
- },
534
- getBdEnv() {
535
- getBdFlag({
536
- success: res => {
537
- this.isDev = res.objx == 1
538
- }
539
- });
540
- }
541
- }
542
- };
543
- export default modules
1
+ import projectTagView from "@base/components/projectTag/view.vue";
2
+ import projectTagAddButton from "@base/components/projectTag/addButton.vue";
3
+ import projectTagDeleteButton from "@base/components/projectTag/deleteButton.vue";
4
+ import tableForm from "@base/components/table/tableForm.vue";
5
+ import editView from "@base/views/bd/setting/form_template/edit.vue";
6
+ import userDialog from "@base/views/user/user/dialog.vue";
7
+ import positionDialog from "@base/views/user/position/dialog.vue";
8
+ import scriptDescriptionDialog from "@base/components/scriptDescription/dialog.vue";
9
+ import ftHistoryDialog from "@base/views/bd/setting/form_template/ftHistoryDialog.vue";
10
+ import itemList from "@base/views/bd/setting/form_template/itemList.vue";
11
+ import formTypeEditDialog from "@base/views/user/form/form_type/editDialog.vue";
12
+ import formScriptList from "@base/views/bd/setting/form_script/form_list.vue";
13
+ import projectTagDialog from "@base/views/user/project_tag/dialog.vue";
14
+ import { treeScollx } from "@base/utils/global";
15
+ import indexUtil from "@base/utils";
16
+ import { getBdFlag } from "@base/api/user";
17
+ import designer from "@base/views/user/form/vform/designer.vue";
18
+ import {
19
+ getJsxBtnList,
20
+ getJsxStatus,
21
+ } from "@base/views/bd/setting/utils/index";
22
+
23
+ let modules = {};
24
+ modules = {
25
+ name: "bd_form_template:list",
26
+ components: {
27
+ projectTagView,
28
+ projectTagAddButton,
29
+ projectTagDeleteButton,
30
+ tableForm,
31
+ editView,
32
+ userDialog,
33
+ positionDialog,
34
+ scriptDescriptionDialog,
35
+ ftHistoryDialog,
36
+ itemList,
37
+ formTypeEditDialog,
38
+ formScriptList,
39
+ projectTagDialog,
40
+ designer,
41
+ },
42
+ data() {
43
+ return {
44
+ isFullscreen: false,
45
+ formDesTabs: "first",
46
+ activeName: "second",
47
+ dataId: 0,
48
+ showEdit: false,
49
+ vxeOption: {},
50
+ formData: {},
51
+ showDesingerDialog: false,
52
+ formCode: null,
53
+ formName: null,
54
+ templateId: null,
55
+ currentFormTemplate: null,
56
+
57
+ showItemEdit: false,
58
+ showParamEdit: false,
59
+ vxeOption1: {},
60
+ editId: "",
61
+ itemEditId: "",
62
+ pRow: null,
63
+ currentRow: {},
64
+ serviceId: null,
65
+ itemServiceId: null,
66
+
67
+ showWfDialog: false,
68
+ wfUrl: "",
69
+ ph: "",
70
+ dialogActiveName: "first",
71
+ showFunctionScriptList: false,
72
+ showUserDialog: false,
73
+ wfAssignData: [],
74
+ wfAssignCallback: null,
75
+ wfAssignMulti: true,
76
+
77
+ showPositionDialog: false,
78
+ wfAssignPositionData: [],
79
+ wfAssignPositionCallback: null,
80
+
81
+ showFormTemplateDialog: false,
82
+ wfAssignFormTemplateCallback: null,
83
+
84
+ showScriptDescriptionDialog: false,
85
+ showWfDiyAttributeEdit: false,
86
+
87
+ showFtHistoryDialog: false,
88
+ operateFtHistory: null,
89
+
90
+ defaultProps: {
91
+ label: "name", //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
92
+ children: [],
93
+ isLeaf: "leaf",
94
+ },
95
+ showItemView: false,
96
+
97
+ currentFormType: {},
98
+ editFormTypeId: null,
99
+ showFormTypeDialog: false,
100
+ showFormScriptList: false,
101
+ addProjectTagOption: {
102
+ url: USER_PREFIX + `/formTemplate/saveTag`,
103
+ tableDatas: () => {
104
+ return this.$refs["table-m1"].getCheckboxRecords(true);
105
+ },
106
+ reqData: (tagDatas, tableDatas) => {
107
+ let sids = tableDatas.map((item) => item.sid);
108
+ let tagCodes = tagDatas.map((item) => item.tagCode);
109
+ let reqData = {
110
+ tagCodes,
111
+ sids,
112
+ };
113
+ return reqData;
114
+ },
115
+ callback: () => {
116
+ this.searchEvent();
117
+ },
118
+ },
119
+ deleteProjectTagOption: {
120
+ url: USER_PREFIX + `/formTemplate/deleteTag`,
121
+ tableDatas: () => {
122
+ return this.$refs["table-m1"].getCheckboxRecords(true);
123
+ },
124
+ reqData: (tagDatas, tableDatas) => {
125
+ let sids = tableDatas.map((item) => item.sid);
126
+ let tagCodes = tagDatas.map((item) => item.tagCode);
127
+ let reqData = {
128
+ tagCodes,
129
+ sids,
130
+ };
131
+ return reqData;
132
+ },
133
+ callback: () => {
134
+ this.searchEvent();
135
+ },
136
+ },
137
+ showProjectTagDialog3: false,
138
+ checkTags: [],
139
+ isDev: true,
140
+ menuKindAuth: {},
141
+ showTree: false,
142
+ };
143
+ },
144
+ computed: {
145
+ currentMenuKindId() {
146
+ return this.currentFormType?.id || null;
147
+ },
148
+ currentMenuKindName() {
149
+ return this.currentFormType?.name || null;
150
+ },
151
+ },
152
+ watch: {
153
+ formDesTabs(val) {
154
+ if (this.showFormScriptList == false && val == "second") {
155
+ this.showFormScriptList = true;
156
+ }
157
+ },
158
+ },
159
+ mounted() {
160
+ treeScollx({ target: this, type: "default" });
161
+ this.getBdEnv();
162
+ this.initTableList();
163
+ this.initWfWinParam();
164
+ },
165
+ methods: {
166
+ searchEvent() {
167
+ this.$refs["table-m1"].commitProxy("reload");
168
+ },
169
+ resetEvent() {
170
+ this.formData = {};
171
+ this.checkTags = [];
172
+ this.$refs["table-m1"].commitProxy("reload");
173
+ },
174
+ openEditDialog(row) {
175
+ let formCode = row?.formCode || null;
176
+ /*this.dataId = !id || typeof id == 'object' ? 0 : id;
177
+ this.activeName = 'first';
178
+ this.showItemEdit = false;
179
+ this.$openEditView('showEdit');*/
180
+ if (!formCode) {
181
+ this.dataId = formCode;
182
+ this.activeName = "first";
183
+ this.$openEditView("showEdit");
184
+ } else {
185
+ this.$refs.xTabs.openEditTab(row);
186
+ }
187
+ },
188
+ openDesingerDialog(row, callback) {
189
+ this.formCode = row.formCode;
190
+ this.formName = row.formName;
191
+ this.currentFormTemplate = row;
192
+ this.isFullscreen = false;
193
+ this.showDesingerDialog = true;
194
+ this.designerSaveCallback = callback ?? null;
195
+ },
196
+ openDesingerDialogByChild({ row, callback }) {
197
+ this.openDesingerDialog(row, callback);
198
+ },
199
+ reflushTemplateList() {
200
+ this.searchEvent();
201
+ this.designerSaveCallback && this.designerSaveCallback();
202
+ },
203
+ handleFullscreen() {
204
+ let isFullscreen = this.isFullscreen;
205
+ if (!isFullscreen) {
206
+ indexUtil.addClass(document.body, "hideMenu");
207
+ } else {
208
+ indexUtil.removeClass(document.body, "hideMenu");
209
+ }
210
+ this.isFullscreen = !isFullscreen;
211
+ },
212
+ openFtHistoryDialog(row) {
213
+ this.operateFtHistory = row;
214
+ this.showFtHistoryDialog = true;
215
+ },
216
+ confirmFtHistoryDialog(row) {
217
+ this.searchEvent();
218
+ },
219
+ closeFormDesignwinEvent(done) {
220
+ this.$baseConfirm(
221
+ this.$t1('请确认"已保存"报表模板,是否继续关闭?')
222
+ ).then(() => {
223
+ indexUtil.removeClass(document.body, "hideMenu");
224
+ done && done();
225
+ });
226
+ },
227
+ getSearchParam() {
228
+ let tagCodes = null;
229
+ if (this.checkTags.length) {
230
+ tagCodes = this.checkTags.map((item) => item.tagCode);
231
+ }
232
+ let currentFormType = this.currentFormType || {};
233
+ return {
234
+ ...this.formData,
235
+ tagCodes,
236
+ menuKindCode: currentFormType.menuKindCode || null,
237
+ history: false,
238
+ };
239
+ },
240
+ initTableList() {
241
+ let that = this;
242
+ let tableOption = {
243
+ vue: this,
244
+ tableRef: "table-m1",
245
+ tableName: "bd_form_template_list-m1",
246
+ path: USER_PREFIX + "/formTemplate/listPage",
247
+ param: () => {
248
+ return this.getSearchParam();
249
+ },
250
+ columns: [
251
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
252
+ {
253
+ title: this.$t1("模板名称"),
254
+ field: "formName",
255
+ width: 150,
256
+ fixed: "left",
257
+ },
258
+ {
259
+ title: this.$t1("模板编码"),
260
+ field: "formCode",
261
+ width: 150,
262
+ },
263
+ {
264
+ title: this.$t1("模板版本"),
265
+ field: "formVersion",
266
+ width: 150,
267
+ },
268
+ {
269
+ title: this.$t1("表单分类"),
270
+ field: "menuKindName",
271
+ width: 150,
272
+ },
273
+ {
274
+ title: this.$t1("是否启用"),
275
+ field: "enabled",
276
+ width: 150,
277
+ slots: {
278
+ default: ({ row }) => {
279
+ if (row.enabled) {
280
+ return getJsxStatus(null, this.$t1("启用"));
281
+ } else {
282
+ return getJsxStatus("s-3", this.$t1("禁用"));
283
+ }
284
+ },
285
+ },
286
+ },
287
+ {
288
+ title: this.$t1("启用流程"),
289
+ field: "hasWf",
290
+ width: 150,
291
+ slots: {
292
+ default: ({ row }) => {
293
+ if (row.hasWf) {
294
+ return getJsxStatus(null, this.$t1("是"));
295
+ } else {
296
+ return getJsxStatus("s-3", this.$t1(""));
297
+ }
298
+ },
299
+ },
300
+ },
301
+ {
302
+ title: this.$t1("默认流程单据类型名称"),
303
+ field: "objTypeName",
304
+ width: 200,
305
+ },
306
+ {
307
+ title: this.$t1("引用流程的表单编码"),
308
+ field: "fromWfFormCode",
309
+ width: 200,
310
+ },
311
+ {
312
+ title: this.$t1("备注"),
313
+ field: "remark",
314
+ width: 150,
315
+ },
316
+ {
317
+ title: this.$t1("项目标签"),
318
+ field: "tag",
319
+ width: 250,
320
+ slots: { default: "tag" },
321
+ params: {
322
+ exportVal: ({ row }) => {
323
+ if (row.formTemplateTagDTOs) {
324
+ return row.formTemplateTagDTOs
325
+ .map((item) => item.tagName)
326
+ .join(",");
327
+ }
328
+ },
329
+ },
330
+ },
331
+ { field: "serviceName", title: this.$t1("服务名"), width: 150 },
332
+ { title: this.$t1("唯一标识"), field: "sid", width: 280 },
333
+ {
334
+ title: this.$t1("更新时间"),
335
+ field: "modifyDate",
336
+ width: 150,
337
+ },
338
+ {
339
+ title: this.$t1("创建时间"),
340
+ field: "createDate",
341
+ width: 150,
342
+ },
343
+ {
344
+ width: 100,
345
+ fixed: "right",
346
+ title: "",
347
+ sortable: false,
348
+ slots: {
349
+ default: ({ row }) => {
350
+ return getJsxBtnList([
351
+ {
352
+ iconName: "el-icon-edit",
353
+ content: this.$t1("查看"),
354
+ onclick: () => {
355
+ this.openEditDialog(row);
356
+ },
357
+ },
358
+ {
359
+ iconName: "iconfont icon-liuchengguanli-shejiqi_liucheng",
360
+ content: this.$t1("表单设计"),
361
+ onclick: () => {
362
+ this.openDesingerDialog(row);
363
+ },
364
+ },
365
+ ]);
366
+ },
367
+ },
368
+ },
369
+ ],
370
+ searchColumns: [
371
+ {
372
+ title: this.$t1("表单分类"),
373
+ field: "menuKindName",
374
+ type: "input",
375
+ common: true,
376
+ disabled: true,
377
+ defaultValueEnabled: false,
378
+ slot: "menuKindName",
379
+ },
380
+ {
381
+ title: this.$t1("模板名称"),
382
+ field: "formName",
383
+ type: "input",
384
+ common: true,
385
+ },
386
+ {
387
+ title: this.$t1("模板编码"),
388
+ field: "formCode",
389
+ type: "input",
390
+ common: true,
391
+ },
392
+ {
393
+ title: this.$t1("是否启用"),
394
+ field: "enabled",
395
+ type: "select",
396
+ common: true,
397
+ itemOption: [
398
+ { label: this.$t1("启用"), value: true },
399
+ { label: this.$t1("禁用"), value: false },
400
+ ],
401
+ },
402
+ {
403
+ title: this.$t1("项目标签"),
404
+ field: "tag",
405
+ type: "input",
406
+ common: true,
407
+ slot: "tag",
408
+ },
409
+ ],
410
+ config: {
411
+ proxyConfig: {
412
+ autoLoad: false,
413
+ },
414
+ },
415
+ };
416
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
417
+ this.vxeOption = opts;
418
+ this.showTree = true;
419
+ });
420
+ },
421
+ chooseCellM1(row) {
422
+ this.currentRow = row;
423
+ this.showItemView = true;
424
+ },
425
+ openWfDesignDialog(actModelId) {
426
+ //wfType 0:单据流程,1:场景流程
427
+ let serviceId = this.currentRow.serviceName;
428
+ this.wfUrl =
429
+ WEB_PREFIX +
430
+ "/activiti-explorer/modeler.html?wfType=0&serviceId=" +
431
+ serviceId +
432
+ "&modelId=" +
433
+ actModelId;
434
+ this.dialogActiveName = "first";
435
+ this.showWfDialog = true;
436
+ },
437
+ closeDesignwinEvent(done) {
438
+ this.$baseConfirm(
439
+ this.$t1('请确认"已保存"流程模板,是否继续关闭?')
440
+ ).then(() => {
441
+ this.showWfDialog = false;
442
+ // this.showDesingerDialog = false;
443
+ });
444
+ },
445
+ initWfWinParam() {
446
+ this.initCloseWfDesignWin();
447
+ this.initWinUserDialog();
448
+ this.initWinPositionDialog();
449
+ this.initSysParamForWf();
450
+ this.initWinFormTemplateDialog();
451
+ this.initWinScriptDescriptionDialog();
452
+ },
453
+ initCloseWfDesignWin() {
454
+ window.closeWfDesignWin = () => {
455
+ this.showWfDialog = false;
456
+ };
457
+ },
458
+ initWinUserDialog() {
459
+ window.openAssignUserDialog = (opts) => {
460
+ this.wfAssignMulti = opts.multi;
461
+ this.wfAssignData = opts.data || [];
462
+ this.wfAssignCallback = opts.callback;
463
+ this.showUserDialog = true;
464
+ };
465
+ },
466
+ confirmUser(rows) {
467
+ this.wfAssignCallback(rows);
468
+ },
469
+ initWinPositionDialog() {
470
+ window.openAssignPositionDialog = (opts) => {
471
+ this.wfAssignPositionData = opts.data || [];
472
+ this.wfAssignPositionCallback = opts.callback;
473
+ this.showPositionDialog = true;
474
+ };
475
+ },
476
+ initSysParamForWf() {
477
+ let webPrefix = WEB_PREFIX;
478
+ let baseApi = process.env.VUE_APP_BASE_API;
479
+ window.sysParamForWf = {
480
+ webPrefix,
481
+ baseApi,
482
+ };
483
+ },
484
+ confirmPosition(rows) {
485
+ this.wfAssignPositionCallback(rows);
486
+ },
487
+ initWinFormTemplateDialog() {
488
+ window.openAssignFormTemplateDialog = (opts) => {
489
+ this.wfAssignFormTemplateCallback = opts.callback;
490
+ this.showFormTemplateDialog = true;
491
+ };
492
+ },
493
+ confirmFormTemplate(rows) {
494
+ this.wfAssignFormTemplateCallback(rows);
495
+ },
496
+ initWinScriptDescriptionDialog() {
497
+ window.openScriptDescriptionDialog = (opts) => {
498
+ this.showScriptDescriptionDialog = true;
499
+ };
500
+ },
501
+ handleNodeClick(data, node, v) {
502
+ this.handleNodeData(node);
503
+ this.$forceUpdate();
504
+ this.searchEvent();
505
+ },
506
+ // 异步树叶子节点懒加载逻辑
507
+ loadNode(node, resolve) {
508
+ let id = node && node.data && node.data.id ? node.data.id || "" : 0;
509
+ let param = { enabled: true };
510
+ let url = !id
511
+ ? USER_PREFIX + "/menuKind/getAllList"
512
+ : USER_PREFIX + "/menuKind/getChildren";
513
+ this.$http({
514
+ aes: true,
515
+ url: url,
516
+ method: "post",
517
+ data: {
518
+ parent: id,
519
+ enabled: true,
520
+ },
521
+ success: (res) => {
522
+ let rows = res.objx || [];
523
+ rows.forEach((value) => {
524
+ value.leaf = !value.hasChild;
525
+ });
526
+ if (node.level === 0) {
527
+ if (rows.length > 0) {
528
+ this.$nextTick(() => {
529
+ let firstNode = node.childNodes[0];
530
+ if (rows[0].hasChild) {
531
+ firstNode.expand();
532
+ }
533
+ this.$refs.tree.setCurrentKey(firstNode.data);
534
+ this.handleNodeClick(firstNode.data, firstNode, this);
535
+ });
536
+ }
537
+ }
538
+ resolve(rows);
539
+ },
540
+ });
541
+ },
542
+ handleNodeData(node) {
543
+ this.currentFormType = node ? node.data : null;
544
+ this.currentNode = node;
545
+ },
546
+ handleFormDesignClose() {
547
+ this.formDesTabs = "first";
548
+ this.showFormScriptList = false;
549
+ },
550
+ openProjectTagDialog3() {
551
+ this.showProjectTagDialog3 = true;
552
+ },
553
+ confirmProjectTagDialog3(rows) {
554
+ this.checkTags = rows;
555
+ },
556
+ getTabNames() {
557
+ return this.checkTags.map((item) => item.tagName).join(",");
558
+ },
559
+ jsonImport() {
560
+ this.$jsonImport({
561
+ saveUrl: USER_PREFIX + "/form_develop/importFormTemplate",
562
+ showResult: true,
563
+ resultColumns: [
564
+ { title: this.$t1("模板名称"), field: "formName", width: 200 },
565
+ { title: this.$t1("模板编码"), field: "formCode", width: 200 },
566
+ {
567
+ title: this.$t1("结果信息"),
568
+ field: "impReturnMsg",
569
+ width: 300,
570
+ showOverflow: false,
571
+ slots: {
572
+ default: ({ row }, h) => {
573
+ let impReturnMsg = row.impReturnMsg;
574
+ let items = impReturnMsg
575
+ .split(";")
576
+ .filter((item) => !!item && !!item.trim())
577
+ .map((item) => {
578
+ return h("p", {}, `${item.trim()};`);
579
+ });
580
+ return h("div", {}, items);
581
+ },
582
+ }
583
+ },
584
+ ],
585
+ callback: () => {
586
+ this.searchEvent();
587
+ },
588
+ });
589
+ },
590
+ jsonExport() {
591
+ this.$jsonExport({
592
+ targetRef: "table-m1",
593
+ url: USER_PREFIX + "/form_develop/exportFormTemplate",
594
+ abcEnabled: true,
595
+ editAuth: this.currentFormType.editAuth,
596
+ selectTypeAuth: this.currentFormType.selectTypeAuth,
597
+ });
598
+ },
599
+ getBdEnv() {
600
+ getBdFlag({
601
+ success: (res) => {
602
+ this.isDev = res.objx == 1;
603
+ },
604
+ });
605
+ },
606
+ },
607
+ };
608
+ export default modules;