cloud-web-corejs 1.1.0-dev.5 → 1.1.0-dev.7

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.
Files changed (52) hide show
  1. package/package.json +1 -1
  2. package/src/components/VabUpload/index.vue +1 -1
  3. package/src/components/VabUpload/view.vue +27 -26
  4. package/src/components/excelImport/index.vue +156 -156
  5. package/src/components/jsonImport/index.vue +1 -1
  6. package/src/components/langImport/index.vue +1 -1
  7. package/src/components/mobile/wf/addTaskUserdialog.vue +23 -3
  8. package/src/components/mobile/wf/content.vue +110 -67
  9. package/src/components/mobile/wf/deleteTaskUserDialog.vue +22 -3
  10. package/src/components/mobile/wf/selectUserDialog.vue +122 -0
  11. package/src/components/mobile/wf/setCandidateDialog.vue +25 -4
  12. package/src/components/mobile/wf/urgingDialog.vue +26 -3
  13. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  14. package/src/components/obsUpload/index.vue +1 -1
  15. package/src/components/xform/form-designer/designer.js +36 -52
  16. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +185 -185
  17. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  18. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +2 -2
  19. package/src/components/xform/form-designer/indexMixin.js +33 -1
  20. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +833 -860
  21. package/src/components/xform/form-designer/toolbar-panel/index.vue +874 -874
  22. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -0
  23. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  24. package/src/components/xform/form-designer/widget-panel/indexMixin.js +30 -6
  25. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +53 -1
  26. package/src/components/xform/form-render/container-item/list-h5-item.vue +154 -27
  27. package/src/components/xform/form-render/indexMixin.js +23 -3
  28. package/src/components/xform/styles/h5.scss +774 -588
  29. package/src/directive/append-to-body/index.js +48 -0
  30. package/src/index.js +4 -0
  31. package/src/layout/components/Sidebar/default.vue +1655 -1655
  32. package/src/router/index.js +48 -48
  33. package/src/utils/assetUrl.js +19 -0
  34. package/src/utils/vab.js +1283 -1279
  35. package/src/views/bd/setting/form_template/edit.vue +378 -356
  36. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  37. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  38. package/src/views/bd/setting/form_template/list.vue +304 -303
  39. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  40. package/src/views/bd/setting/form_template/mixins/list.js +748 -721
  41. package/src/views/user/file_view_ins/list.vue +970 -970
  42. package/src/views/user/form/vform/designer.vue +823 -821
  43. package/src/views/user/home/default.vue +1117 -1117
  44. package/src/views/user/home/index.vue +103 -103
  45. package/src/views/user/notify_message/dialog.vue +139 -139
  46. package/src/views/user/outLink/form_view.vue +202 -202
  47. package/src/views/user/outLink/index.vue +110 -110
  48. package/src/views/user/wf/iframe/index.vue +51 -51
  49. package/src/views/user/wf/iframe/index2.vue +64 -64
  50. package/src/views/user/wf/wf_manage/list2.vue +871 -871
  51. package/src/views/user/wf/wf_manage/wfContentDialog.vue +134 -134
  52. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
@@ -1,871 +1,871 @@
1
- <template>
2
- <div id="containt">
3
- <el-tabs v-model="activeName" class="tab-box">
4
- <el-tab-pane :label="$t1('常规2')" name="first">
5
- <component
6
- v-if="showWfContent && wfContent"
7
- :is="wfContent"
8
- visible-key="showWfContent"
9
- v-bind="param"
10
- :parent-target="_self"
11
- :defaultShowWfContent="true"
12
- :_viewType="1"
13
- @reload="$reloadHandle"
14
- ></component>
15
- <micro-view-host
16
- v-else-if="showWfContent && remoteView"
17
- :owner="remoteView.owner"
18
- :target-path="remoteView.targetPath"
19
- :biz-params="remoteView.bizParams"
20
- :view-meta="remoteView.viewMeta"
21
- @reload="$reloadHandle"
22
- @close="showWfContent = false"
23
- ></micro-view-host>
24
- </el-tab-pane>
25
- <el-tab-pane :label="$t1('我的流程2')" name="second">
26
- <div class="tree-box fl">
27
- <div class="tit">
28
- <b>{{ $t1("待办类型") }}</b>
29
- </div>
30
- <el-tree
31
- :props="defaultProps"
32
- :load="loadNode"
33
- node-key="uuid"
34
- ref="tree"
35
- highlight-current
36
- lazy
37
- :expand-on-click-node="false"
38
- @node-click="handleNodeClick"
39
- class="tree-list"
40
- icon-class="el-icon-arrow-down"
41
- ></el-tree>
42
- </div>
43
- <label id="labBtn">
44
- <div class="icon">
45
- <i class="el-icon-more"></i>
46
- <i class="el-icon-more"></i>
47
- </div>
48
- </label>
49
- <div class="main-right fr" style="padding-left: 6px">
50
- <div class="grid-height">
51
- <vxe-grid
52
- ref="table-m1"
53
- v-bind="vxeOption"
54
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
55
- @custom="$vxeTableUtil.customHandle"
56
- >
57
- <template #form>
58
- <div class="clearfix screen-btns">
59
- <div class="fl">
60
- <base-table-export
61
- :option="{
62
- title: $t1('流程待办导出'),
63
- targetRef: 'table-m1',
64
- }"
65
- :parent-target="_self"
66
- />
67
- </div>
68
- <div class="fr">
69
- <vxe-button
70
- icon="el-icon-brush"
71
- class="button-sty"
72
- @click="resetEvent"
73
- type="text"
74
- status="primary"
75
- plain
76
- >{{ $t1("刷新") }}
77
- </vxe-button>
78
- <vxe-button
79
- status="warning"
80
- icon="el-icon-search"
81
- class="button-sty"
82
- @click="searchEvent"
83
- >
84
- {{ $t1("搜索") }}
85
- </vxe-button>
86
- </div>
87
- </div>
88
- <vxe-form
89
- ref="form"
90
- class="screen-box"
91
- title-width="92px"
92
- title-align="right"
93
- :data="formData"
94
- @submit="searchEvent"
95
- @reset="searchEvent"
96
- >
97
- <vxe-form-item :title="$t1('待办类型') + ':'">
98
- <template v-slot>
99
- <el-input
100
- v-model="checkNodeData.label"
101
- size="small"
102
- disabled
103
- />
104
- </template>
105
- </vxe-form-item>
106
- <vxe-form-item :title="$t1('流程主题') + ':'" field="name">
107
- <template v-slot>
108
- <el-input
109
- v-model="formData.name"
110
- size="small"
111
- clearable
112
- />
113
- </template>
114
- </vxe-form-item>
115
- <vxe-form-item
116
- :title="$t1('单据类型') + ':'"
117
- field="objTypeName"
118
- >
119
- <template v-slot>
120
- <el-input
121
- class="search-input"
122
- max="200"
123
- v-model="formData.objTypeName"
124
- @clear="
125
- formData.objTypeCode = null;
126
- $forceUpdate();
127
- "
128
- v-el-readonly
129
- clearable
130
- >
131
- <i
132
- slot="suffix"
133
- class="el-input__icon el-icon-search"
134
- @click="showWfObjConfigDialog = true"
135
- ></i>
136
- </el-input>
137
- </template>
138
- </vxe-form-item>
139
- <vxe-form-item :title="$t1('流程状态') + ':'" field="stat">
140
- <template v-slot>
141
- <el-select v-model="formData.stat" clearable>
142
- <el-option
143
- :value="1"
144
- :label="$t1('审核中')"
145
- ></el-option>
146
- <el-option
147
- :value="2"
148
- :label="$t1('已完成')"
149
- ></el-option>
150
- <el-option
151
- :value="3"
152
- :label="$t1('已驳回')"
153
- ></el-option>
154
- </el-select>
155
- </template>
156
- </vxe-form-item>
157
- <vxe-form-item
158
- :title="$t1('启动人') + ':'"
159
- field="starterName"
160
- >
161
- <template v-slot>
162
- <el-input
163
- v-model="formData.starterName"
164
- size="small"
165
- clearable
166
- />
167
- </template>
168
- </vxe-form-item>
169
- <vxe-form-item title="启动时间:">
170
- <template v-slot>
171
- <el-date-picker
172
- v-model="formData.startTime"
173
- type="datetime"
174
- placeholder=""
175
- size="small"
176
- clearable
177
- value-format="yyyy-MM-dd HH:mm:ss"
178
- :picker-options="
179
- $baseStartPickerOptions(formData.endTime)
180
- "
181
- ></el-date-picker>
182
- <span>-</span>
183
- <el-date-picker
184
- v-model="formData.endTime"
185
- type="datetime"
186
- placeholder=""
187
- size="small"
188
- clearable
189
- value-format="yyyy-MM-dd HH:mm:ss"
190
- default-time="23:59:59"
191
- :picker-options="
192
- $baseEndPickerOptions(formData.startTime)
193
- "
194
- ></el-date-picker>
195
- </template>
196
- </vxe-form-item>
197
- </vxe-form>
198
- </template>
199
- </vxe-grid>
200
- </div>
201
- </div>
202
- </el-tab-pane>
203
- <el-tab-pane :label="$t1('全部流程2')" name="third" v-if="flag == 1">
204
- <div class="grid-height">
205
- <vxe-grid
206
- ref="table-m2"
207
- v-bind="vxeOption2"
208
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
209
- @custom="$vxeTableUtil.customHandle"
210
- >
211
- <template #form>
212
- <div class="clearfix screen-btns">
213
- <div class="fl">
214
- <base-table-export
215
- :option="{
216
- title: $t1('流程待办导出'),
217
- targetRef: 'table-m2',
218
- }"
219
- :parent-target="_self"
220
- />
221
- </div>
222
- <div class="fr">
223
- <vxe-button
224
- icon="el-icon-brush"
225
- class="button-sty"
226
- @click="resetEvent2"
227
- type="text"
228
- status="primary"
229
- plain
230
- >{{ $t1("刷新") }}
231
- </vxe-button>
232
- <vxe-button
233
- status="warning"
234
- icon="el-icon-search"
235
- class="button-sty"
236
- @click="searchEvent2"
237
- >
238
- {{ $t1("搜索") }}
239
- </vxe-button>
240
- </div>
241
- </div>
242
- <vxe-form
243
- ref="form"
244
- class="screen-box"
245
- title-width="92px"
246
- title-align="right"
247
- :data="formData2"
248
- @submit="searchEvent2"
249
- @reset="searchEvent2"
250
- >
251
- <vxe-form-item :title="$t1('流程主题') + ':'" field="name">
252
- <template v-slot>
253
- <el-input v-model="formData2.name" size="small" clearable />
254
- </template>
255
- </vxe-form-item>
256
- <vxe-form-item
257
- :title="$t1('单据类型') + ':'"
258
- field="objTypeName"
259
- >
260
- <template v-slot>
261
- <el-input
262
- class="search-input"
263
- max="200"
264
- v-model="formData2.objTypeName"
265
- @clear="
266
- formData2.objTypeCode = null;
267
- $forceUpdate();
268
- "
269
- v-el-readonly
270
- clearable
271
- >
272
- <i
273
- slot="suffix"
274
- class="el-input__icon el-icon-search"
275
- @click="showWfObjConfigDialog2 = true"
276
- ></i>
277
- </el-input>
278
- </template>
279
- </vxe-form-item>
280
- <vxe-form-item :title="$t1('流程状态') + ':'" field="stat">
281
- <template v-slot>
282
- <el-select v-model="formData2.stat" clearable>
283
- <el-option :value="1" :label="$t1('审核中')"></el-option>
284
- <el-option :value="2" :label="$t1('已完成')"></el-option>
285
- <el-option :value="3" :label="$t1('已驳回')"></el-option>
286
- </el-select>
287
- </template>
288
- </vxe-form-item>
289
- <vxe-form-item
290
- :title="$t1('当前任务用户') + ':'"
291
- field="candidateNames"
292
- >
293
- <template v-slot>
294
- <el-input
295
- v-model="formData2.candidateNames"
296
- size="small"
297
- clearable
298
- />
299
- </template>
300
- </vxe-form-item>
301
- </vxe-form>
302
- </template>
303
- </vxe-grid>
304
- </div>
305
- </el-tab-pane>
306
- </el-tabs>
307
- <wfObjConfigDialog
308
- v-if="showWfObjConfigDialog"
309
- :visiable.sync="showWfObjConfigDialog"
310
- :type.sync="type"
311
- @confirm="confirmInsertWfObjConfig"
312
- :multi="false"
313
- ></wfObjConfigDialog>
314
- <wfObjConfigDialog
315
- v-if="showWfObjConfigDialog2"
316
- :visiable.sync="showWfObjConfigDialog2"
317
- :type="99"
318
- @confirm="confirmInsertWfObjConfig2"
319
- :multi="false"
320
- ></wfObjConfigDialog>
321
- </div>
322
- </template>
323
- <script>
324
- import { treeScollx } from "@base/utils/global.js";
325
- import wfObjConfigDialog from "../wf_obj_config/dialog.vue";
326
- import { loadViewComponentAsync } from "@base/utils/resolveViewComponent";
327
-
328
- export default {
329
- name: "wf_manage:list2",
330
- components: { wfObjConfigDialog },
331
- created() {},
332
- async mounted() {
333
- treeScollx({ target: this, type: "default" });
334
- await this.initWfParam();
335
- this.initTableList();
336
- this.initRole();
337
- },
338
- data() {
339
- return {
340
- activeName: "second",
341
- // dataId: 0,
342
- // showEdit: false,
343
- vxeOption: {},
344
- formData: {},
345
- checkNode: {},
346
- defaultProps: {
347
- label: "label", //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
348
- children: [],
349
- isLeaf: "leaf",
350
- },
351
- wfObjTypes: [],
352
- showWfObjConfigDialog: false,
353
- showWfObjConfigDialog2: false,
354
- flag: 0,
355
- vxeOption2: {},
356
- formData2: {},
357
-
358
- param: {},
359
- wfContent: null,
360
- remoteView: null,
361
- showWfContent: false,
362
- };
363
- },
364
- computed: {
365
- type() {
366
- return this.checkNode && this.checkNode.data
367
- ? this.checkNode.data.type
368
- : "";
369
- },
370
- checkNodeData() {
371
- return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
372
- },
373
- },
374
- methods: {
375
- searchEvent() {
376
- this.$refs["table-m1"].commitProxy("reload");
377
- },
378
- resetEvent() {
379
- this.formData = {};
380
- this.$refs["table-m1"].commitProxy("reload");
381
- },
382
-
383
- initTableList() {
384
- let that = this;
385
- let paramColumns = this.wfParamDTOs.map((item) => {
386
- let flag = item.paramName == "单号";
387
- return {
388
- title: this.$t1(item.paramName),
389
- field: item.paramKey,
390
- width: 150,
391
- fixed: flag ? "left" : "",
392
- slots: flag
393
- ? {
394
- default: ({ row }) => {
395
- return [
396
- <div>
397
- <a
398
- href="javascript:void(0);"
399
- class="a-link"
400
- onclick={() => {
401
- this.openEditDialog(row);
402
- }}
403
- style="font-weight:bold; text-decoration: underline"
404
- >
405
- <el-tooltip
406
- class="item"
407
- effect="dark"
408
- content={this.$t1("查看")}
409
- placement="top-start"
410
- >
411
- <span>{row.param1}</span>
412
- </el-tooltip>
413
- </a>
414
- </div>,
415
- ];
416
- },
417
- }
418
- : "",
419
- };
420
- });
421
-
422
- // let statuses = {0: '未启动', 1: '审核中', 2: '已完成', 3: '已驳回', 4: '中断'};
423
- var statuses = {
424
- 0: [<el-tag type="warning">{this.$t1("未启动")}</el-tag>],
425
- 1: [<el-tag>{this.$t1("审核中")}</el-tag>],
426
- 2: [<el-tag type="success">{this.$t1("已完成")}</el-tag>],
427
- 3: [<el-tag type="danger">{this.$t1("已驳回")}</el-tag>],
428
- 4: [<el-tag type="danger">{this.$t1("中断")}</el-tag>],
429
- };
430
- let tableOption = {
431
- vue: this,
432
- tableRef: "table-m1",
433
- tableName: "user-wf-wf_manage-list-m2",
434
- path: USER_PREFIX + "/wf_info/listPage",
435
- param: () => {
436
- return {
437
- type: this.type,
438
- ...this.formData,
439
- };
440
- },
441
- /*config: {
442
- proxyConfig: {
443
- autoLoad: false
444
- }
445
- },*/
446
- columns: [
447
- { type: "checkbox", width: 48, resizable: false, fixed: "left" },
448
- {
449
- title: this.$t1("流程主题"),
450
- field: "name",
451
- width: 150,
452
- fixed: "left",
453
- },
454
- {
455
- title: this.$t1("单据类型"),
456
- field: "objTypeName",
457
- width: 150,
458
- },
459
- {
460
- title: this.$t1("启动人"),
461
- field: "starterName",
462
- width: 150,
463
- },
464
- {
465
- title: this.$t1("当前任务"),
466
- field: "taskName",
467
- width: 150,
468
- },
469
- {
470
- title: this.$t1("当前任务用户"),
471
- field: "candidateNames",
472
- width: 150,
473
- },
474
- {
475
- title: this.$t1("流程状态"),
476
- field: "stat",
477
- width: 150,
478
- slots: {
479
- default: ({ row }) => {
480
- let html = statuses[row.stat] || "";
481
- return html;
482
- },
483
- },
484
- },
485
- {
486
- title: this.$t1("启动时间"),
487
- field: "createDate",
488
- width: 150,
489
- },
490
- ...paramColumns,
491
- {
492
- width: 47,
493
- fixed: "right",
494
- title: "",
495
- sortable: false,
496
- slots: {
497
- default: ({ row }) => {
498
- return [
499
- <a
500
- href="javascript:void(0);"
501
- class="a-link"
502
- onclick={() => {
503
- // this.$refs["wfIframeDialog"].wfEdit(row);
504
- this.openEditDialog(row);
505
- }}
506
- >
507
- <el-tooltip
508
- enterable={false}
509
- effect="dark"
510
- content={this.$t1("查看")}
511
- placement="top"
512
- popper-class="tooltip-skin"
513
- >
514
- <i class="el-icon-edit" />
515
- </el-tooltip>
516
- </a>,
517
- ];
518
- },
519
- },
520
- },
521
- ],
522
- };
523
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
524
- this.vxeOption = opts;
525
- });
526
- },
527
- // 异步:await 之后才置 activeName / 调 $openEditView,否则弹窗先开出空壳
528
- // ($openEditView 是 200ms 定时放行,冷启动拉 chunk 常超过它)
529
- async openEditDialog(row) {
530
- let id = row.objId;
531
- let wfDataId = !id || typeof id == "object" ? 0 : Number(id);
532
-
533
- if (row.url == "form") {
534
- let formCode = null;
535
- if (row.formCode) {
536
- formCode = row.formCode;
537
- } else {
538
- formCode = row.objTypeCode.substr(9);
539
- }
540
- this.param = {
541
- formCode: formCode,
542
- dataId: wfDataId,
543
- };
544
- // 路径是常量,用字面量 import:生成普通 ImportDependency,不参与 views context
545
- this.wfContent = (
546
- await import("@base/views/user/form/vform/render.vue")
547
- ).default;
548
- } else {
549
- this.param = {
550
- _dataId: wfDataId,
551
- };
552
- let url = row.url + ".vue";
553
- const res = await loadViewComponentAsync(url);
554
- this.remoteView =
555
- res.kind === "remote"
556
- ? {
557
- owner: res.owner,
558
- targetPath: res.targetPath,
559
- bizParams: this.param,
560
- viewMeta: { visibleKey: "showWfContent", defaultShowWfContent: true, viewType: 1 },
561
- }
562
- : null;
563
- this.wfContent = res.component;
564
- }
565
- this.activeName = "first";
566
- this.$openEditView("showWfContent");
567
- },
568
- guid() {
569
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
570
- /[xy]/g,
571
- function (c) {
572
- var r = (Math.random() * 16) | 0,
573
- v = c == "x" ? r : (r & 0x3) | 0x8;
574
- return v.toString(16);
575
- }
576
- );
577
- },
578
- clearNodeClick() {
579
- /* this.formData.saleOrgId = '';
580
- this.formData.saleOrgName = '';
581
- this.$refs.tree.setCurrentKey();
582
- this.searchEvent(); */
583
- },
584
- handleNodeClick(data, node, v) {
585
- this.checkNode = node;
586
- this.formData.objTypeName = null;
587
- this.formData.objTypeCode = null;
588
- this.$forceUpdate();
589
- this.searchEvent();
590
- },
591
- // 异步树叶子节点懒加载逻辑
592
- loadNode(node, resolve) {
593
- if (!node || !node.data || node.data.type === undefined) {
594
- this.initNodeData(node, resolve);
595
- return;
596
- }
597
- this.$http({
598
- url: USER_PREFIX + "/wf_obj_config/getWfGroups",
599
- method: "post",
600
- data: {
601
- type: node.data.type,
602
- },
603
- success: (res) => {
604
- let rows = res.objx || [];
605
- rows.forEach((item) => {
606
- item.leaf = true;
607
- item.label = item.objTypeName + "(" + item.num + ")";
608
- item.type = node.data.type;
609
- item.uuid = this.guid();
610
- });
611
- resolve(rows);
612
- },
613
- });
614
- },
615
- initNodeData(node, resolve) {
616
- let data = [
617
- {
618
- uuid: -1,
619
- label: this.$t1("待审批的"),
620
- type: 0,
621
- leaf: true,
622
- },
623
- {
624
- uuid: -2,
625
- label: this.$t1("我发起的"),
626
- type: 1,
627
- leaf: true,
628
- },
629
- {
630
- uuid: -3,
631
- label: this.$t1("已审批的"),
632
- type: 2,
633
- leaf: true,
634
- },
635
- {
636
- uuid: -4,
637
- label: this.$t1("已完成的"),
638
- type: "3",
639
- leaf: true,
640
- },
641
- {
642
- uuid: -5,
643
- label: this.$t1("我转办的"),
644
- type: "4",
645
- leaf: true,
646
- },
647
- ];
648
- resolve(data);
649
- this.$nextTick(() => {
650
- if (node.childNodes.length) {
651
- let firstNode = node.childNodes[0];
652
- this.$refs.tree.setCurrentKey(firstNode.data.uuid);
653
- this.checkNode = firstNode;
654
- this.$forceUpdate();
655
- // this.handleNodeClick(firstNode.data, firstNode);
656
- }
657
- });
658
- /*this.$nextTick(() => {
659
- if (node.childNodes.length) {
660
- let nodedata = node.childNodes[0];
661
- nodedata.expanded = true;
662
- nodedata.loadData(arr => {
663
- if (arr.length) {
664
- setTimeout(() => {
665
- this.$refs.tree.setCurrentKey(arr[0].uuid);
666
- let node = this.$refs.tree.getNode(arr[0]);
667
- this.handleNodeClick(arr[0], node);
668
- }, 50);
669
- }
670
- });
671
- }
672
- });*/
673
- },
674
- confirmInsertWfObjConfig(rows) {
675
- if (rows.length) {
676
- let row = rows[0];
677
- this.$set(this.formData, "objTypeName", row.objTypeName);
678
- this.$set(this.formData, "objTypeCode", row.objTypeCode);
679
- }
680
- },
681
- async initWfParam() {
682
- return this.$http({
683
- url: USER_PREFIX + "/wf_param/list",
684
- method: `post`,
685
- data: {},
686
- success: (res) => {
687
- this.wfParamDTOs = res.objx || [];
688
- },
689
- });
690
- },
691
- //m2
692
- initRole() {
693
- this.$http({
694
- url: USER_PREFIX + "/user/currentUser",
695
- method: "post",
696
- success: (res) => {
697
- let userInfo = res.objx;
698
- this.getIsAdmin(userInfo);
699
- },
700
- });
701
- },
702
- getIsAdmin(userInfo) {
703
- this.$http({
704
- url: USER_PREFIX + "/userb/getUserRole",
705
- method: `post`,
706
- data: { id: userInfo.id },
707
- success: (res2) => {
708
- let rows = res2.objx || [];
709
- let codes = rows.map((row) => row.roleCode);
710
- if (codes.includes("superadmin") || codes.includes("wfadmin")) {
711
- this.flag = 1;
712
- setTimeout(() => {
713
- this.initTableList2();
714
- }, 200);
715
- }
716
- },
717
- });
718
- },
719
- searchEvent2() {
720
- this.$refs["table-m2"].commitProxy("reload");
721
- },
722
- resetEvent2() {
723
- this.formData2 = {};
724
- this.$refs["table-m2"].commitProxy("reload");
725
- },
726
- initTableList2() {
727
- let that = this;
728
- let paramColumns = this.wfParamDTOs.map((item) => {
729
- let flag = item.paramName == "单号";
730
- return {
731
- title: this.$t1(item.paramName),
732
- field: item.paramKey,
733
- width: 150,
734
- fixed: flag ? "left" : "",
735
- slots: flag
736
- ? {
737
- default: ({ row }) => {
738
- return [
739
- <div>
740
- <a
741
- href="javascript:void(0);"
742
- class="a-link"
743
- onclick={() => {
744
- this.openEditDialog(row);
745
- }}
746
- style="font-weight:bold; text-decoration: underline"
747
- >
748
- <el-tooltip
749
- class="item"
750
- effect="dark"
751
- content={this.$t1("查看")}
752
- placement="top-start"
753
- >
754
- <span>{row.param1}</span>
755
- </el-tooltip>
756
- </a>
757
- </div>,
758
- ];
759
- },
760
- }
761
- : "",
762
- };
763
- });
764
-
765
- var statuses = {
766
- 0: [<el-tag type="warning">{this.$t1("未启动")}</el-tag>],
767
- 1: [<el-tag>{this.$t1("审核中")}</el-tag>],
768
- 2: [<el-tag type="success">{this.$t1("已完成")}</el-tag>],
769
- 3: [<el-tag type="danger">{this.$t1("已驳回")}</el-tag>],
770
- 4: [<el-tag type="danger">{this.$t1("中断")}</el-tag>],
771
- };
772
- let tableOption = {
773
- vue: this,
774
- tableRef: "table-m2",
775
- tableName: "user-wf-wf_manage-list-m3",
776
- path: USER_PREFIX + "/wf_info/listPageAll",
777
- param: () => {
778
- return {
779
- ...this.formData2,
780
- };
781
- },
782
- columns: [
783
- { type: "checkbox", width: 48, resizable: false, fixed: "left" },
784
- {
785
- title: this.$t1("流程主题"),
786
- field: "name",
787
- width: 150,
788
- fixed: "left",
789
- },
790
- {
791
- title: this.$t1("单据类型"),
792
- field: "objTypeName",
793
- width: 150,
794
- },
795
- {
796
- title: this.$t1("启动人"),
797
- field: "starterName",
798
- width: 150,
799
- },
800
- {
801
- title: this.$t1("当前任务"),
802
- field: "taskName",
803
- width: 150,
804
- },
805
- {
806
- title: this.$t1("当前任务用户"),
807
- field: "candidateNames",
808
- width: 150,
809
- },
810
- {
811
- title: this.$t1("流程状态"),
812
- field: "stat",
813
- width: 150,
814
- slots: {
815
- default: ({ row }) => {
816
- let html = statuses[row.stat] || "";
817
- return html;
818
- },
819
- },
820
- },
821
- {
822
- title: this.$t1("启动时间"),
823
- field: "createDate",
824
- width: 150,
825
- },
826
- ...paramColumns,
827
- {
828
- width: 47,
829
- fixed: "right",
830
- title: "",
831
- sortable: false,
832
- slots: {
833
- default: ({ row }) => {
834
- return [
835
- <a
836
- href="javascript:void(0);"
837
- class="a-link"
838
- onclick={() => {
839
- this.openEditDialog(row);
840
- }}
841
- >
842
- <el-tooltip
843
- enterable={false}
844
- effect="dark"
845
- content={this.$t1("查看")}
846
- placement="top"
847
- popper-class="tooltip-skin"
848
- >
849
- <i class="el-icon-edit" />
850
- </el-tooltip>
851
- </a>,
852
- ];
853
- },
854
- },
855
- },
856
- ],
857
- };
858
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
859
- this.vxeOption2 = opts;
860
- });
861
- },
862
- confirmInsertWfObjConfig2(rows) {
863
- if (rows.length) {
864
- let row = rows[0];
865
- this.$set(this.formData2, "objTypeName", row.objTypeName);
866
- this.$set(this.formData2, "objTypeCode", row.objTypeCode);
867
- }
868
- },
869
- },
870
- };
871
- </script>
1
+ <template>
2
+ <div id="containt">
3
+ <el-tabs v-model="activeName" class="tab-box">
4
+ <el-tab-pane :label="$t1('常规2')" name="first">
5
+ <component
6
+ v-if="showWfContent && wfContent"
7
+ :is="wfContent"
8
+ visible-key="showWfContent"
9
+ v-bind="param"
10
+ :parent-target="_self"
11
+ :defaultShowWfContent="true"
12
+ :_viewType="1"
13
+ @reload="$reloadHandle"
14
+ ></component>
15
+ <micro-view-host
16
+ v-else-if="showWfContent && remoteView"
17
+ :owner="remoteView.owner"
18
+ :target-path="remoteView.targetPath"
19
+ :biz-params="remoteView.bizParams"
20
+ :view-meta="remoteView.viewMeta"
21
+ @reload="$reloadHandle"
22
+ @close="showWfContent = false"
23
+ ></micro-view-host>
24
+ </el-tab-pane>
25
+ <el-tab-pane :label="$t1('我的流程2')" name="second">
26
+ <div class="tree-box fl">
27
+ <div class="tit">
28
+ <b>{{ $t1("待办类型") }}</b>
29
+ </div>
30
+ <el-tree
31
+ :props="defaultProps"
32
+ :load="loadNode"
33
+ node-key="uuid"
34
+ ref="tree"
35
+ highlight-current
36
+ lazy
37
+ :expand-on-click-node="false"
38
+ @node-click="handleNodeClick"
39
+ class="tree-list"
40
+ icon-class="el-icon-arrow-down"
41
+ ></el-tree>
42
+ </div>
43
+ <label id="labBtn">
44
+ <div class="icon">
45
+ <i class="el-icon-more"></i>
46
+ <i class="el-icon-more"></i>
47
+ </div>
48
+ </label>
49
+ <div class="main-right fr" style="padding-left: 6px">
50
+ <div class="grid-height">
51
+ <vxe-grid
52
+ ref="table-m1"
53
+ v-bind="vxeOption"
54
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
55
+ @custom="$vxeTableUtil.customHandle"
56
+ >
57
+ <template #form>
58
+ <div class="clearfix screen-btns">
59
+ <div class="fl">
60
+ <base-table-export
61
+ :option="{
62
+ title: $t1('流程待办导出'),
63
+ targetRef: 'table-m1',
64
+ }"
65
+ :parent-target="_self"
66
+ />
67
+ </div>
68
+ <div class="fr">
69
+ <vxe-button
70
+ icon="el-icon-brush"
71
+ class="button-sty"
72
+ @click="resetEvent"
73
+ type="text"
74
+ status="primary"
75
+ plain
76
+ >{{ $t1("刷新") }}
77
+ </vxe-button>
78
+ <vxe-button
79
+ status="warning"
80
+ icon="el-icon-search"
81
+ class="button-sty"
82
+ @click="searchEvent"
83
+ >
84
+ {{ $t1("搜索") }}
85
+ </vxe-button>
86
+ </div>
87
+ </div>
88
+ <vxe-form
89
+ ref="form"
90
+ class="screen-box"
91
+ title-width="92px"
92
+ title-align="right"
93
+ :data="formData"
94
+ @submit="searchEvent"
95
+ @reset="searchEvent"
96
+ >
97
+ <vxe-form-item :title="$t1('待办类型') + ':'">
98
+ <template v-slot>
99
+ <el-input
100
+ v-model="checkNodeData.label"
101
+ size="small"
102
+ disabled
103
+ />
104
+ </template>
105
+ </vxe-form-item>
106
+ <vxe-form-item :title="$t1('流程主题') + ':'" field="name">
107
+ <template v-slot>
108
+ <el-input
109
+ v-model="formData.name"
110
+ size="small"
111
+ clearable
112
+ />
113
+ </template>
114
+ </vxe-form-item>
115
+ <vxe-form-item
116
+ :title="$t1('单据类型') + ':'"
117
+ field="objTypeName"
118
+ >
119
+ <template v-slot>
120
+ <el-input
121
+ class="search-input"
122
+ max="200"
123
+ v-model="formData.objTypeName"
124
+ @clear="
125
+ formData.objTypeCode = null;
126
+ $forceUpdate();
127
+ "
128
+ v-el-readonly
129
+ clearable
130
+ >
131
+ <i
132
+ slot="suffix"
133
+ class="el-input__icon el-icon-search"
134
+ @click="showWfObjConfigDialog = true"
135
+ ></i>
136
+ </el-input>
137
+ </template>
138
+ </vxe-form-item>
139
+ <vxe-form-item :title="$t1('流程状态') + ':'" field="stat">
140
+ <template v-slot>
141
+ <el-select v-model="formData.stat" clearable>
142
+ <el-option
143
+ :value="1"
144
+ :label="$t1('审核中')"
145
+ ></el-option>
146
+ <el-option
147
+ :value="2"
148
+ :label="$t1('已完成')"
149
+ ></el-option>
150
+ <el-option
151
+ :value="3"
152
+ :label="$t1('已驳回')"
153
+ ></el-option>
154
+ </el-select>
155
+ </template>
156
+ </vxe-form-item>
157
+ <vxe-form-item
158
+ :title="$t1('启动人') + ':'"
159
+ field="starterName"
160
+ >
161
+ <template v-slot>
162
+ <el-input
163
+ v-model="formData.starterName"
164
+ size="small"
165
+ clearable
166
+ />
167
+ </template>
168
+ </vxe-form-item>
169
+ <vxe-form-item title="启动时间:">
170
+ <template v-slot>
171
+ <el-date-picker
172
+ v-model="formData.startTime"
173
+ type="datetime"
174
+ placeholder=""
175
+ size="small"
176
+ clearable
177
+ value-format="yyyy-MM-dd HH:mm:ss"
178
+ :picker-options="
179
+ $baseStartPickerOptions(formData.endTime)
180
+ "
181
+ ></el-date-picker>
182
+ <span>-</span>
183
+ <el-date-picker
184
+ v-model="formData.endTime"
185
+ type="datetime"
186
+ placeholder=""
187
+ size="small"
188
+ clearable
189
+ value-format="yyyy-MM-dd HH:mm:ss"
190
+ default-time="23:59:59"
191
+ :picker-options="
192
+ $baseEndPickerOptions(formData.startTime)
193
+ "
194
+ ></el-date-picker>
195
+ </template>
196
+ </vxe-form-item>
197
+ </vxe-form>
198
+ </template>
199
+ </vxe-grid>
200
+ </div>
201
+ </div>
202
+ </el-tab-pane>
203
+ <el-tab-pane :label="$t1('全部流程2')" name="third" v-if="flag == 1">
204
+ <div class="grid-height">
205
+ <vxe-grid
206
+ ref="table-m2"
207
+ v-bind="vxeOption2"
208
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
209
+ @custom="$vxeTableUtil.customHandle"
210
+ >
211
+ <template #form>
212
+ <div class="clearfix screen-btns">
213
+ <div class="fl">
214
+ <base-table-export
215
+ :option="{
216
+ title: $t1('流程待办导出'),
217
+ targetRef: 'table-m2',
218
+ }"
219
+ :parent-target="_self"
220
+ />
221
+ </div>
222
+ <div class="fr">
223
+ <vxe-button
224
+ icon="el-icon-brush"
225
+ class="button-sty"
226
+ @click="resetEvent2"
227
+ type="text"
228
+ status="primary"
229
+ plain
230
+ >{{ $t1("刷新") }}
231
+ </vxe-button>
232
+ <vxe-button
233
+ status="warning"
234
+ icon="el-icon-search"
235
+ class="button-sty"
236
+ @click="searchEvent2"
237
+ >
238
+ {{ $t1("搜索") }}
239
+ </vxe-button>
240
+ </div>
241
+ </div>
242
+ <vxe-form
243
+ ref="form"
244
+ class="screen-box"
245
+ title-width="92px"
246
+ title-align="right"
247
+ :data="formData2"
248
+ @submit="searchEvent2"
249
+ @reset="searchEvent2"
250
+ >
251
+ <vxe-form-item :title="$t1('流程主题') + ':'" field="name">
252
+ <template v-slot>
253
+ <el-input v-model="formData2.name" size="small" clearable />
254
+ </template>
255
+ </vxe-form-item>
256
+ <vxe-form-item
257
+ :title="$t1('单据类型') + ':'"
258
+ field="objTypeName"
259
+ >
260
+ <template v-slot>
261
+ <el-input
262
+ class="search-input"
263
+ max="200"
264
+ v-model="formData2.objTypeName"
265
+ @clear="
266
+ formData2.objTypeCode = null;
267
+ $forceUpdate();
268
+ "
269
+ v-el-readonly
270
+ clearable
271
+ >
272
+ <i
273
+ slot="suffix"
274
+ class="el-input__icon el-icon-search"
275
+ @click="showWfObjConfigDialog2 = true"
276
+ ></i>
277
+ </el-input>
278
+ </template>
279
+ </vxe-form-item>
280
+ <vxe-form-item :title="$t1('流程状态') + ':'" field="stat">
281
+ <template v-slot>
282
+ <el-select v-model="formData2.stat" clearable>
283
+ <el-option :value="1" :label="$t1('审核中')"></el-option>
284
+ <el-option :value="2" :label="$t1('已完成')"></el-option>
285
+ <el-option :value="3" :label="$t1('已驳回')"></el-option>
286
+ </el-select>
287
+ </template>
288
+ </vxe-form-item>
289
+ <vxe-form-item
290
+ :title="$t1('当前任务用户') + ':'"
291
+ field="candidateNames"
292
+ >
293
+ <template v-slot>
294
+ <el-input
295
+ v-model="formData2.candidateNames"
296
+ size="small"
297
+ clearable
298
+ />
299
+ </template>
300
+ </vxe-form-item>
301
+ </vxe-form>
302
+ </template>
303
+ </vxe-grid>
304
+ </div>
305
+ </el-tab-pane>
306
+ </el-tabs>
307
+ <wfObjConfigDialog
308
+ v-if="showWfObjConfigDialog"
309
+ :visiable.sync="showWfObjConfigDialog"
310
+ :type.sync="type"
311
+ @confirm="confirmInsertWfObjConfig"
312
+ :multi="false"
313
+ ></wfObjConfigDialog>
314
+ <wfObjConfigDialog
315
+ v-if="showWfObjConfigDialog2"
316
+ :visiable.sync="showWfObjConfigDialog2"
317
+ :type="99"
318
+ @confirm="confirmInsertWfObjConfig2"
319
+ :multi="false"
320
+ ></wfObjConfigDialog>
321
+ </div>
322
+ </template>
323
+ <script>
324
+ import { treeScollx } from "@base/utils/global.js";
325
+ import wfObjConfigDialog from "../wf_obj_config/dialog.vue";
326
+ import { loadViewComponentAsync } from "@base/utils/resolveViewComponent";
327
+
328
+ export default {
329
+ name: "wf_manage:list2",
330
+ components: { wfObjConfigDialog },
331
+ created() {},
332
+ async mounted() {
333
+ treeScollx({ target: this, type: "default" });
334
+ await this.initWfParam();
335
+ this.initTableList();
336
+ this.initRole();
337
+ },
338
+ data() {
339
+ return {
340
+ activeName: "second",
341
+ // dataId: 0,
342
+ // showEdit: false,
343
+ vxeOption: {},
344
+ formData: {},
345
+ checkNode: {},
346
+ defaultProps: {
347
+ label: "label", //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
348
+ children: [],
349
+ isLeaf: "leaf",
350
+ },
351
+ wfObjTypes: [],
352
+ showWfObjConfigDialog: false,
353
+ showWfObjConfigDialog2: false,
354
+ flag: 0,
355
+ vxeOption2: {},
356
+ formData2: {},
357
+
358
+ param: {},
359
+ wfContent: null,
360
+ remoteView: null,
361
+ showWfContent: false,
362
+ };
363
+ },
364
+ computed: {
365
+ type() {
366
+ return this.checkNode && this.checkNode.data
367
+ ? this.checkNode.data.type
368
+ : "";
369
+ },
370
+ checkNodeData() {
371
+ return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
372
+ },
373
+ },
374
+ methods: {
375
+ searchEvent() {
376
+ this.$refs["table-m1"].commitProxy("reload");
377
+ },
378
+ resetEvent() {
379
+ this.formData = {};
380
+ this.$refs["table-m1"].commitProxy("reload");
381
+ },
382
+
383
+ initTableList() {
384
+ let that = this;
385
+ let paramColumns = this.wfParamDTOs.map((item) => {
386
+ let flag = item.paramName == "单号";
387
+ return {
388
+ title: this.$t1(item.paramName),
389
+ field: item.paramKey,
390
+ width: 150,
391
+ fixed: flag ? "left" : "",
392
+ slots: flag
393
+ ? {
394
+ default: ({ row }) => {
395
+ return [
396
+ <div>
397
+ <a
398
+ href="javascript:void(0);"
399
+ class="a-link"
400
+ onclick={() => {
401
+ this.openEditDialog(row);
402
+ }}
403
+ style="font-weight:bold; text-decoration: underline"
404
+ >
405
+ <el-tooltip
406
+ class="item"
407
+ effect="dark"
408
+ content={this.$t1("查看")}
409
+ placement="top-start"
410
+ >
411
+ <span>{row.param1}</span>
412
+ </el-tooltip>
413
+ </a>
414
+ </div>,
415
+ ];
416
+ },
417
+ }
418
+ : "",
419
+ };
420
+ });
421
+
422
+ // let statuses = {0: '未启动', 1: '审核中', 2: '已完成', 3: '已驳回', 4: '中断'};
423
+ var statuses = {
424
+ 0: [<el-tag type="warning">{this.$t1("未启动")}</el-tag>],
425
+ 1: [<el-tag>{this.$t1("审核中")}</el-tag>],
426
+ 2: [<el-tag type="success">{this.$t1("已完成")}</el-tag>],
427
+ 3: [<el-tag type="danger">{this.$t1("已驳回")}</el-tag>],
428
+ 4: [<el-tag type="danger">{this.$t1("中断")}</el-tag>],
429
+ };
430
+ let tableOption = {
431
+ vue: this,
432
+ tableRef: "table-m1",
433
+ tableName: "user-wf-wf_manage-list-m2",
434
+ path: USER_PREFIX + "/wf_info/listPage",
435
+ param: () => {
436
+ return {
437
+ type: this.type,
438
+ ...this.formData,
439
+ };
440
+ },
441
+ /*config: {
442
+ proxyConfig: {
443
+ autoLoad: false
444
+ }
445
+ },*/
446
+ columns: [
447
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
448
+ {
449
+ title: this.$t1("流程主题"),
450
+ field: "name",
451
+ width: 150,
452
+ fixed: "left",
453
+ },
454
+ {
455
+ title: this.$t1("单据类型"),
456
+ field: "objTypeName",
457
+ width: 150,
458
+ },
459
+ {
460
+ title: this.$t1("启动人"),
461
+ field: "starterName",
462
+ width: 150,
463
+ },
464
+ {
465
+ title: this.$t1("当前任务"),
466
+ field: "taskName",
467
+ width: 150,
468
+ },
469
+ {
470
+ title: this.$t1("当前任务用户"),
471
+ field: "candidateNames",
472
+ width: 150,
473
+ },
474
+ {
475
+ title: this.$t1("流程状态"),
476
+ field: "stat",
477
+ width: 150,
478
+ slots: {
479
+ default: ({ row }) => {
480
+ let html = statuses[row.stat] || "";
481
+ return html;
482
+ },
483
+ },
484
+ },
485
+ {
486
+ title: this.$t1("启动时间"),
487
+ field: "createDate",
488
+ width: 150,
489
+ },
490
+ ...paramColumns,
491
+ {
492
+ width: 47,
493
+ fixed: "right",
494
+ title: "",
495
+ sortable: false,
496
+ slots: {
497
+ default: ({ row }) => {
498
+ return [
499
+ <a
500
+ href="javascript:void(0);"
501
+ class="a-link"
502
+ onclick={() => {
503
+ // this.$refs["wfIframeDialog"].wfEdit(row);
504
+ this.openEditDialog(row);
505
+ }}
506
+ >
507
+ <el-tooltip
508
+ enterable={false}
509
+ effect="dark"
510
+ content={this.$t1("查看")}
511
+ placement="top"
512
+ popper-class="tooltip-skin"
513
+ >
514
+ <i class="el-icon-edit" />
515
+ </el-tooltip>
516
+ </a>,
517
+ ];
518
+ },
519
+ },
520
+ },
521
+ ],
522
+ };
523
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
524
+ this.vxeOption = opts;
525
+ });
526
+ },
527
+ // 异步:await 之后才置 activeName / 调 $openEditView,否则弹窗先开出空壳
528
+ // ($openEditView 是 200ms 定时放行,冷启动拉 chunk 常超过它)
529
+ async openEditDialog(row) {
530
+ let id = row.objId;
531
+ let wfDataId = !id || typeof id == "object" ? 0 : Number(id);
532
+
533
+ if (row.url == "form") {
534
+ let formCode = null;
535
+ if (row.formCode) {
536
+ formCode = row.formCode;
537
+ } else {
538
+ formCode = row.objTypeCode.substr(9);
539
+ }
540
+ this.param = {
541
+ formCode: formCode,
542
+ dataId: wfDataId,
543
+ };
544
+ // 路径是常量,用字面量 import:生成普通 ImportDependency,不参与 views context
545
+ this.wfContent = (
546
+ await import("@base/views/user/form/vform/render.vue")
547
+ ).default;
548
+ } else {
549
+ this.param = {
550
+ _dataId: wfDataId,
551
+ };
552
+ let url = row.url + ".vue";
553
+ const res = await loadViewComponentAsync(url);
554
+ this.remoteView =
555
+ res.kind === "remote"
556
+ ? {
557
+ owner: res.owner,
558
+ targetPath: res.targetPath,
559
+ bizParams: this.param,
560
+ viewMeta: { visibleKey: "showWfContent", defaultShowWfContent: true, viewType: 1 },
561
+ }
562
+ : null;
563
+ this.wfContent = res.component;
564
+ }
565
+ this.activeName = "first";
566
+ this.$openEditView("showWfContent");
567
+ },
568
+ guid() {
569
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
570
+ /[xy]/g,
571
+ function (c) {
572
+ var r = (Math.random() * 16) | 0,
573
+ v = c == "x" ? r : (r & 0x3) | 0x8;
574
+ return v.toString(16);
575
+ }
576
+ );
577
+ },
578
+ clearNodeClick() {
579
+ /* this.formData.saleOrgId = '';
580
+ this.formData.saleOrgName = '';
581
+ this.$refs.tree.setCurrentKey();
582
+ this.searchEvent(); */
583
+ },
584
+ handleNodeClick(data, node, v) {
585
+ this.checkNode = node;
586
+ this.formData.objTypeName = null;
587
+ this.formData.objTypeCode = null;
588
+ this.$forceUpdate();
589
+ this.searchEvent();
590
+ },
591
+ // 异步树叶子节点懒加载逻辑
592
+ loadNode(node, resolve) {
593
+ if (!node || !node.data || node.data.type === undefined) {
594
+ this.initNodeData(node, resolve);
595
+ return;
596
+ }
597
+ this.$http({
598
+ url: USER_PREFIX + "/wf_obj_config/getWfGroups",
599
+ method: "post",
600
+ data: {
601
+ type: node.data.type,
602
+ },
603
+ success: (res) => {
604
+ let rows = res.objx || [];
605
+ rows.forEach((item) => {
606
+ item.leaf = true;
607
+ item.label = item.objTypeName + "(" + item.num + ")";
608
+ item.type = node.data.type;
609
+ item.uuid = this.guid();
610
+ });
611
+ resolve(rows);
612
+ },
613
+ });
614
+ },
615
+ initNodeData(node, resolve) {
616
+ let data = [
617
+ {
618
+ uuid: -1,
619
+ label: this.$t1("待审批的"),
620
+ type: 0,
621
+ leaf: true,
622
+ },
623
+ {
624
+ uuid: -2,
625
+ label: this.$t1("我发起的"),
626
+ type: 1,
627
+ leaf: true,
628
+ },
629
+ {
630
+ uuid: -3,
631
+ label: this.$t1("已审批的"),
632
+ type: 2,
633
+ leaf: true,
634
+ },
635
+ {
636
+ uuid: -4,
637
+ label: this.$t1("已完成的"),
638
+ type: "3",
639
+ leaf: true,
640
+ },
641
+ {
642
+ uuid: -5,
643
+ label: this.$t1("我转办的"),
644
+ type: "4",
645
+ leaf: true,
646
+ },
647
+ ];
648
+ resolve(data);
649
+ this.$nextTick(() => {
650
+ if (node.childNodes.length) {
651
+ let firstNode = node.childNodes[0];
652
+ this.$refs.tree.setCurrentKey(firstNode.data.uuid);
653
+ this.checkNode = firstNode;
654
+ this.$forceUpdate();
655
+ // this.handleNodeClick(firstNode.data, firstNode);
656
+ }
657
+ });
658
+ /*this.$nextTick(() => {
659
+ if (node.childNodes.length) {
660
+ let nodedata = node.childNodes[0];
661
+ nodedata.expanded = true;
662
+ nodedata.loadData(arr => {
663
+ if (arr.length) {
664
+ setTimeout(() => {
665
+ this.$refs.tree.setCurrentKey(arr[0].uuid);
666
+ let node = this.$refs.tree.getNode(arr[0]);
667
+ this.handleNodeClick(arr[0], node);
668
+ }, 50);
669
+ }
670
+ });
671
+ }
672
+ });*/
673
+ },
674
+ confirmInsertWfObjConfig(rows) {
675
+ if (rows.length) {
676
+ let row = rows[0];
677
+ this.$set(this.formData, "objTypeName", row.objTypeName);
678
+ this.$set(this.formData, "objTypeCode", row.objTypeCode);
679
+ }
680
+ },
681
+ async initWfParam() {
682
+ return this.$http({
683
+ url: USER_PREFIX + "/wf_param/list",
684
+ method: `post`,
685
+ data: {},
686
+ success: (res) => {
687
+ this.wfParamDTOs = res.objx || [];
688
+ },
689
+ });
690
+ },
691
+ //m2
692
+ initRole() {
693
+ this.$http({
694
+ url: USER_PREFIX + "/user/currentUser",
695
+ method: "post",
696
+ success: (res) => {
697
+ let userInfo = res.objx;
698
+ this.getIsAdmin(userInfo);
699
+ },
700
+ });
701
+ },
702
+ getIsAdmin(userInfo) {
703
+ this.$http({
704
+ url: USER_PREFIX + "/userb/getUserRole",
705
+ method: `post`,
706
+ data: { id: userInfo.id },
707
+ success: (res2) => {
708
+ let rows = res2.objx || [];
709
+ let codes = rows.map((row) => row.roleCode);
710
+ if (codes.includes("superadmin") || codes.includes("wfadmin")) {
711
+ this.flag = 1;
712
+ setTimeout(() => {
713
+ this.initTableList2();
714
+ }, 200);
715
+ }
716
+ },
717
+ });
718
+ },
719
+ searchEvent2() {
720
+ this.$refs["table-m2"].commitProxy("reload");
721
+ },
722
+ resetEvent2() {
723
+ this.formData2 = {};
724
+ this.$refs["table-m2"].commitProxy("reload");
725
+ },
726
+ initTableList2() {
727
+ let that = this;
728
+ let paramColumns = this.wfParamDTOs.map((item) => {
729
+ let flag = item.paramName == "单号";
730
+ return {
731
+ title: this.$t1(item.paramName),
732
+ field: item.paramKey,
733
+ width: 150,
734
+ fixed: flag ? "left" : "",
735
+ slots: flag
736
+ ? {
737
+ default: ({ row }) => {
738
+ return [
739
+ <div>
740
+ <a
741
+ href="javascript:void(0);"
742
+ class="a-link"
743
+ onclick={() => {
744
+ this.openEditDialog(row);
745
+ }}
746
+ style="font-weight:bold; text-decoration: underline"
747
+ >
748
+ <el-tooltip
749
+ class="item"
750
+ effect="dark"
751
+ content={this.$t1("查看")}
752
+ placement="top-start"
753
+ >
754
+ <span>{row.param1}</span>
755
+ </el-tooltip>
756
+ </a>
757
+ </div>,
758
+ ];
759
+ },
760
+ }
761
+ : "",
762
+ };
763
+ });
764
+
765
+ var statuses = {
766
+ 0: [<el-tag type="warning">{this.$t1("未启动")}</el-tag>],
767
+ 1: [<el-tag>{this.$t1("审核中")}</el-tag>],
768
+ 2: [<el-tag type="success">{this.$t1("已完成")}</el-tag>],
769
+ 3: [<el-tag type="danger">{this.$t1("已驳回")}</el-tag>],
770
+ 4: [<el-tag type="danger">{this.$t1("中断")}</el-tag>],
771
+ };
772
+ let tableOption = {
773
+ vue: this,
774
+ tableRef: "table-m2",
775
+ tableName: "user-wf-wf_manage-list-m3",
776
+ path: USER_PREFIX + "/wf_info/listPageAll",
777
+ param: () => {
778
+ return {
779
+ ...this.formData2,
780
+ };
781
+ },
782
+ columns: [
783
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
784
+ {
785
+ title: this.$t1("流程主题"),
786
+ field: "name",
787
+ width: 150,
788
+ fixed: "left",
789
+ },
790
+ {
791
+ title: this.$t1("单据类型"),
792
+ field: "objTypeName",
793
+ width: 150,
794
+ },
795
+ {
796
+ title: this.$t1("启动人"),
797
+ field: "starterName",
798
+ width: 150,
799
+ },
800
+ {
801
+ title: this.$t1("当前任务"),
802
+ field: "taskName",
803
+ width: 150,
804
+ },
805
+ {
806
+ title: this.$t1("当前任务用户"),
807
+ field: "candidateNames",
808
+ width: 150,
809
+ },
810
+ {
811
+ title: this.$t1("流程状态"),
812
+ field: "stat",
813
+ width: 150,
814
+ slots: {
815
+ default: ({ row }) => {
816
+ let html = statuses[row.stat] || "";
817
+ return html;
818
+ },
819
+ },
820
+ },
821
+ {
822
+ title: this.$t1("启动时间"),
823
+ field: "createDate",
824
+ width: 150,
825
+ },
826
+ ...paramColumns,
827
+ {
828
+ width: 47,
829
+ fixed: "right",
830
+ title: "",
831
+ sortable: false,
832
+ slots: {
833
+ default: ({ row }) => {
834
+ return [
835
+ <a
836
+ href="javascript:void(0);"
837
+ class="a-link"
838
+ onclick={() => {
839
+ this.openEditDialog(row);
840
+ }}
841
+ >
842
+ <el-tooltip
843
+ enterable={false}
844
+ effect="dark"
845
+ content={this.$t1("查看")}
846
+ placement="top"
847
+ popper-class="tooltip-skin"
848
+ >
849
+ <i class="el-icon-edit" />
850
+ </el-tooltip>
851
+ </a>,
852
+ ];
853
+ },
854
+ },
855
+ },
856
+ ],
857
+ };
858
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
859
+ this.vxeOption2 = opts;
860
+ });
861
+ },
862
+ confirmInsertWfObjConfig2(rows) {
863
+ if (rows.length) {
864
+ let row = rows[0];
865
+ this.$set(this.formData2, "objTypeName", row.objTypeName);
866
+ this.$set(this.formData2, "objTypeCode", row.objTypeCode);
867
+ }
868
+ },
869
+ },
870
+ };
871
+ </script>