cloud-web-corejs 1.1.0-dev.34 → 1.1.0-dev.35

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 (31) hide show
  1. package/bin/core-resources.js +16 -0
  2. package/docs/child-app/README.md +6 -3
  3. package/docs/child-app/activiti-resources.md +63 -0
  4. package/docs/child-app/generate-prompt.md +7 -1
  5. package/docs/child-app/luckysheet-resources.md +80 -0
  6. package/docs/child-app/public-resources-plan.md +288 -0
  7. package/docs/child-app/resources-implementation.md +101 -0
  8. package/docs/child-app/tinymce-resources.md +88 -0
  9. package/docs/child-app/validation.md +4 -3
  10. package/package.json +10 -2
  11. package/resource-tools/index.js +126 -0
  12. package/src/app-bootstrap.js +7 -2
  13. package/src/components/Tinymce/dynamicLoadScript.js +51 -59
  14. package/src/components/Tinymce/index.vue +382 -339
  15. package/src/components/code-editor/index.vue +361 -343
  16. package/src/components/luckysheet/loadResources.js +64 -0
  17. package/src/components/luckysheet/view.vue +239 -210
  18. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +34 -3
  19. package/src/utils/featureResources.js +57 -0
  20. package/src/views/bd/setting/form_template/mixins/list.js +7 -6
  21. package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
  22. package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
  23. package/src/views/user/form/form_template/list.vue +513 -512
  24. package/src/views/user/wf/wf_obj_config/activiti_wf.vue +134 -133
  25. package/src/views/user/wf/wf_obj_config/list.vue +747 -746
  26. package/src/views/user/wf/wf_obj_config/list_form.vue +374 -373
  27. package/templates/child-app/README.md +2 -0
  28. package/templates/child-app/core-resources.config.js +15 -0
  29. package/templates/child-app/gitignore +1 -0
  30. package/templates/child-app/package.json +5 -0
  31. package/templates/child-app/vue.config.js +2 -1
@@ -1,746 +1,747 @@
1
- <template>
2
- <div id="containt">
3
- <el-tabs v-model="activeName" class="tab-box">
4
- <el-tab-pane :label="$t1('常规')" name="first">
5
- <editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :serviceId.sync="serviceId"
6
- :parent-target="_self" @reload="$reloadHandle"></editView>
7
- <itemEditView
8
- v-if="showItemEdit"
9
- visible-key="showItemEdit"
10
- :_dataId.sync="itemEditId"
11
- :serviceId.sync="itemServiceId"
12
- :wfObjConfig.sync="pRow"
13
- :parent-target="_self"
14
- @reload="$reloadHandle"
15
- ></itemEditView>
16
- </el-tab-pane>
17
- <el-tab-pane :label="$t1('流程配置列表')" name="second">
18
- <div class="grid-height">
19
- <div style="height: 345px;">
20
- <vxe-grid
21
- ref="table-m1"
22
- :auto-resize="true"
23
- v-bind="vxeOption"
24
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
25
- @custom="$vxeTableUtil.customHandle"
26
- @checkbox-change="chooseCellM1"
27
- class="is-pointer"
28
- >
29
- <template #form>
30
- <div style="margin-bottom: 8px;" class="clearfix">
31
- <div class="fl">
32
- <vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
33
- {{ $t1('新增单据') }}
34
- </vxe-button>
35
- </div>
36
- <div class="fr">
37
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
38
- plain>{{ $t1('刷新') }}
39
- </vxe-button>
40
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
41
- {{ $t1('搜索') }}
42
- </vxe-button>
43
- </div>
44
- </div>
45
- <vxe-form ref="form" class="screen-box" :data-form="formData" title-width="92px" title-align="right"
46
- @submit="searchEvent" @reset="searchEvent">
47
- <vxe-form-item :title="$t1('单据类型名称')+':'" field="objTypeName">
48
- <template v-slot="">
49
- <el-input v-model="formData.objTypeName" size="small" clearable/>
50
- </template>
51
- </vxe-form-item>
52
- <vxe-form-item :title="$t1('单据类型编号')+':'" field="objTypeCode">
53
- <template v-slot="">
54
- <el-input v-model="formData.objTypeCode" size="small" clearable/>
55
- </template>
56
- </vxe-form-item>
57
- </vxe-form>
58
- </template>
59
- </vxe-grid>
60
- </div>
61
- <label id="labBtn" class="transverse">
62
- <div class="icon">
63
- <i class="el-icon-more"></i>
64
- <i class="el-icon-more"></i>
65
- </div>
66
- </label>
67
- <div style="height: calc(100vh - 345px - 105px);">
68
- <vxe-grid ref="table-m2" v-bind="vxeOption1" @resizable-change="$vxeTableUtil.onColumnWitchChange"
69
- @custom="$vxeTableUtil.customHandle">
70
- <template #row_edit>
71
- <a href="#" class="a-link"><i class="el-icon-edit"/></a>
72
- </template>
73
- </vxe-grid>
74
- </div>
75
- </div>
76
- </el-tab-pane>
77
- <el-tab-pane :label="$t1('待办列表字段名扩展')" name="third">
78
- <wfParamEdit v-if="showParamEdit" visible-key="showParamEdit"
79
- :parent-target="_self" @reload="$reloadHandle"></wfParamEdit>
80
- </el-tab-pane>
81
- <el-tab-pane :label="$t1('自定义流程操作属性')" name="fourth">
82
- <wfDiyAttributeEdit v-if="showWfDiyAttributeEdit" visible-key="showWfDiyAttributeEdit"
83
- :parent-target="_self" @reload="$reloadHandle"></wfDiyAttributeEdit>
84
- </el-tab-pane>
85
-
86
- </el-tabs>
87
-
88
- <el-dialog
89
- :title="$t1('流程设计')"
90
- :append-to-body="true"
91
- :modal-append-to-body="true"
92
- :close-on-click-modal="false"
93
- v-if="showWfDialog"
94
- :visible.sync="showWfDialog"
95
- :modal="false"
96
- custom-class="dialog-style designer-dialog"
97
- width="100%"
98
- height="100%"
99
- top="0px"
100
- bottom="0px"
101
- :before-close="closeDesignwinEvent"
102
- :destroy-on-close="true"
103
- v-el-drag-dialog
104
- >
105
- <iframe :src="wfUrl" :style="'width:100%;height:' + ($root.$el.clientHeight - 30 - 12) + 'px'"></iframe>
106
- </el-dialog>
107
-
108
- <userDialog v-if="showUserDialog" :visiable.sync="showUserDialog" @confirm="confirmUser"
109
- :multi.sync="wfAssignMulti"/>
110
- <positionDialog v-if="showPositionDialog" :visiable.sync="showPositionDialog" :rows="wfAssignPositionData" @confirm="confirmPosition"/>
111
- <scriptDescriptionDialog path="static/readme/Wf.txt" v-if="showScriptDescriptionDialog"
112
- :visiable.sync="showScriptDescriptionDialog"></scriptDescriptionDialog>
113
- <wfBizDataSettingDialog v-if="showWfBizDataSettingDialog" :visiable.sync="showWfBizDataSettingDialog"
114
- @confirm="confirmWfBizDataSettingDialog"
115
- :objConfigItem="objConfigItem" :serviceId="currentRow.serviceId"></wfBizDataSettingDialog>
116
-
117
- <importItemDialog v-if="showImportItemDialog" :visiable.sync="showImportItemDialog" @confirm="confirmImportItemDialog"/>
118
- </div>
119
- </template>
120
- <script>
121
- import {treeScolly} from '@base/utils/global.js';
122
- import editView from './edit.vue';
123
- import itemEditView from './itemEdit.vue';
124
-
125
- import userDialog from '../../../../views/user/user/dialog.vue';
126
- import positionDialog from '../../../../views/user/position/dialog.vue';
127
-
128
- import wfParamEdit from '../../../../views/user/wf/wf_param/edit'
129
- import scriptDescriptionDialog from '@base/components/scriptDescription/dialog'
130
- import wfDiyAttributeEdit from '../../../../views/user/wf/wf_diy_attribute/edit'
131
- import wfBizDataSettingDialog from "./wfBizDataSettingDialog";
132
-
133
- import importItemDialog from "./importItemDialog.vue";
134
-
135
-
136
-
137
- export default {
138
- name: 'wf_obj_config:list',
139
- components: {
140
- editView,
141
- itemEditView,
142
- wfParamEdit,
143
- userDialog,
144
- positionDialog,
145
- scriptDescriptionDialog,
146
- wfDiyAttributeEdit,
147
- wfBizDataSettingDialog,
148
- importItemDialog
149
- },
150
- created() {
151
- },
152
- mounted() {
153
- treeScolly({target: this, type: 'default'});
154
- this.initTableList();
155
- this.initTableM2();
156
-
157
- this.ph = this.$root.$el.clientHeight;
158
- this.initWfWinParam();
159
- },
160
- data() {
161
- return {
162
- dataId: 0,
163
- showEdit: false,
164
- showItemEdit: false,
165
- showParamEdit: false,
166
- vxeOption: {},
167
- vxeOption1: {},
168
- formData: {},
169
- editId: '',
170
- itemEditId: '',
171
- pRow: null,
172
- activeName: 'second',
173
- currentRow: {},
174
- serviceId: null,
175
- itemServiceId: null,
176
-
177
- showWfDialog: false,
178
- wfUrl: '',
179
- ph: '',
180
- dialogActiveName: 'first',
181
- showFunctionScriptList: false,
182
- showUserDialog: false,
183
- wfAssignData: [],
184
- wfAssignCallback: null,
185
- wfAssignMulti: true,
186
-
187
- showPositionDialog: false,
188
- wfAssignPositionData: [],
189
- wfAssignPositionCallback: null,
190
-
191
- showFormTemplateDialog: false,
192
- wfAssignFormTemplateCallback: null,
193
-
194
- showScriptDescriptionDialog: false,
195
- showWfDiyAttributeEdit: false,
196
-
197
- objConfigItem: null,
198
- showWfBizDataSettingDialog: false,
199
- showImportItemDialog:false
200
- };
201
- },
202
- watch: {
203
- dialogActiveName(val) {
204
- if (val == 'second') {
205
- this.showFunctionScriptList = true;
206
- }
207
- },
208
- activeName(val) {
209
- if (val == 'third' && !this.showParamEdit) {
210
- this.showParamEdit = true;
211
- } else if (val == 'fourth' && !this.showWfDiyAttributeEdit) {
212
- this.showWfDiyAttributeEdit = true;
213
- }
214
- }
215
- },
216
- methods: {
217
- searchEvent() {
218
- this.$refs['table-m1'].commitProxy('reload');
219
- this.chooseCellM1({row: {}});
220
- },
221
- resetEvent() {
222
- this.formData = {};
223
- this.$refs['table-m1'].commitProxy('reload');
224
- },
225
- openEditDialog(id, serviceId) {
226
- this.dataId = !id || typeof id == 'object' ? 0 : id;
227
- this.serviceId = serviceId || '';
228
- this.activeName = 'first';
229
- this.showItemEdit = false;
230
- this.$openEditView('showEdit');
231
- },
232
- openEditItemDialog(id, currentRow) {
233
- if (id) {
234
- this.pRow = null;
235
- this.itemEditId = id;
236
- this.itemServiceId = this.currentRow.serviceId;
237
- this.activeName = 'first';
238
- this.showEdit = false;
239
- this.$openEditView('showItemEdit');
240
- } else if (currentRow) {
241
- if (currentRow && currentRow.id) {
242
- this.pRow = currentRow;
243
- this.itemEditId = '';
244
- this.itemServiceId = currentRow.serviceId;
245
- this.activeName = 'first';
246
- this.showEdit = false;
247
- this.$openEditView('showItemEdit');
248
- }
249
- }
250
- },
251
- initTableList() {
252
- let tableOption = {
253
- vue: this,
254
- tableRef: 'table-m1',
255
- tableName: 'user_wf_obj_config_list-m1',
256
- path: USER_PREFIX + '/wf_obj_config/listPage',
257
- param: () => {
258
- return this.formData;
259
- },
260
- config: {
261
- checkboxConfig: {
262
- checkStrictly: true,
263
- showHeader: false,
264
- trigger: 'row'
265
- },
266
- pagerConfig: {
267
- autoHidden: true
268
- }
269
- },
270
- columns: [
271
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
272
- {
273
- title: this.$t1('单据类型名称'),
274
- field: 'objTypeName',
275
- width: 150,
276
- fixed: 'left'
277
- },
278
- {
279
- title: this.$t1('单据类型编号'),
280
- field: 'objTypeCode',
281
- width: 150
282
- },
283
- {
284
- title: this.$t1('跳转url'),
285
- field: 'url',
286
- width: 150
287
- },
288
- {
289
- title: this.$t1('移动端url'),
290
- field: 'mobileUrl',
291
- width: 150
292
- },
293
- {
294
- title: this.$t1('服务名'),
295
- field: 'serviceId',
296
- width: 150
297
- },
298
- {
299
- field: 'note',
300
- title: this.$t1('备注'),
301
- width: 150
302
- },
303
-
304
- {
305
- field: 'forms',
306
- title: this.$t1('是否表单'),
307
- width: 150,
308
- slots: {
309
- default: ({row}) => {
310
- if (row.forms) {
311
- return [<div class="txt-status">{this.$t1('是')}</div>];
312
- } else {
313
- return [<div class="txt-status s-3">{this.$t1('否')}</div>];
314
- }
315
- }
316
- }
317
- },
318
- {
319
- field: 'createDate',
320
- title: this.$t1('创建时间'),
321
- width: 200
322
- },
323
- {
324
- width: 180,
325
- fixed: 'right',
326
- title: '',
327
- sortable: false,
328
- slots: {
329
- default: ({row}) => {
330
- return [
331
- <div>
332
- <a
333
- class="a-link"
334
- onclick={event => {
335
- event.stopPropagation();
336
- this.openEditItemDialog('', row);
337
- }}
338
- >
339
- <el-tooltip enterable={false} effect="dark" content={this.$t1('新增流程模板')} placement="top"
340
- popper-class="tooltip-skin">
341
- <div>
342
- <i class="el-icon-circle-plus-outline"/>
343
- <span>{this.$t1('新增流程模板')}</span>
344
- </div>
345
- </el-tooltip>
346
- </a>
347
- <a
348
- href="javascript:void(0);"
349
- class="a-link"
350
- onclick={event => {
351
- event.stopPropagation();
352
- this.openEditDialog(row.id, row.serviceId);
353
- }}
354
- >
355
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
356
- popper-class="tooltip-skin">
357
- <i class="el-icon-edit"/>
358
- </el-tooltip>
359
- </a>
360
- </div>
361
- ];
362
- }
363
- }
364
- }
365
- ]
366
- };
367
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
368
- this.vxeOption = opts;
369
- });
370
- },
371
- initTableM2() {
372
- let startModeMap = {
373
- 1: this.$t1('节点无候选人,提示异常'),
374
- 2: this.$t1('节点无候选人,提示警告'),
375
- 3: this.$t1('节点无候选人,无提示'),
376
- }
377
- var that = this;
378
- let tableOption1 = {
379
- vue: that,
380
- tableRef: 'table-m2',
381
- tableName: 'user_wf_obj_config_item_list-m2',
382
- config: {
383
- maxHeight: ''
384
- },
385
- columns: [
386
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
387
- {
388
- title: this.$t1('流程模版名称'),
389
- field: 'modelName',
390
- width: 150,
391
- fixed: 'left'
392
- },
393
- {
394
- title: this.$t1('序号'),
395
- field: 'orders',
396
- width: 150
397
- },
398
- {
399
- title: this.$t1('流程模版KEY'),
400
- field: 'modelKey',
401
- width: 150
402
- },
403
- {
404
- title: this.$t1('单据类型编码'),
405
- field: 'objTypeCode',
406
- width: 150
407
- },
408
- {
409
- field: 'enabled',
410
- title: this.$t1('是否启用'),
411
- width: 150,
412
- slots: {
413
- default: ({row}) => {
414
- if (row.enabled) {
415
- return [<div class="txt-status">{this.$t1('启用')}</div>];
416
- } else {
417
- return [<div class="txt-status s-3">{this.$t1('禁用')}</div>];
418
- }
419
- }
420
- }
421
- },
422
- {
423
- title: this.$t1('跳过相邻任务'),
424
- field: 'skipAdjacentTask',
425
- width: 150,
426
- slots: {
427
- default: ({row}) => {
428
- if (row.skipAdjacentTask) {
429
- return [<div class="txt-status">{this.$t1('是')}</div>];
430
- } else {
431
- return [<div class="txt-status s-3">{this.$t1('否')}</div>];
432
- }
433
- }
434
- }
435
- },
436
- {
437
- title: this.$t1('驳回后提交模式'),
438
- field: 'toRejectNode',
439
- width: 180,
440
- slots: {
441
- default: ({row}) => {
442
- if (row.toNextNode === 1) {
443
- return [<div class="txt-status">{this.$t1('顺延下一步提交')}</div>];
444
- } else if (row.toRejectNode) {
445
- return [<div class="txt-status">{this.$t1('由提交人确定节点提交')}</div>];
446
- } else {
447
- return [<div class="txt-status s-3">{this.$t1('直接提交到驳回节点')}</div>];
448
- }
449
- }
450
- }
451
- },
452
- {
453
- title: this.$t1('流程启动处理'),
454
- field: 'startMode',
455
- width: 180,
456
- slots: {
457
- default: ({row}) => {
458
- return startModeMap[row.startMode] || '';
459
- }
460
- }
461
- },
462
- {
463
- title: this.$t1('跨任务跳过'),
464
- field: 'skipSameUserTask',
465
- width: 150,
466
- slots: {
467
- default: ({row}) => {
468
- if (row.skipSameUserTask) {
469
- return [<div class="txt-status">{this.$t1('是')}</div>];
470
- } else {
471
- return [<div class="txt-status s-3">{this.$t1('否')}</div>];
472
- }
473
- }
474
- }
475
- },
476
- {
477
- title: this.$t1('是否允许流程启动更改候选人'),
478
- field: 'startNoSetCandidate',
479
- width: 230,
480
- slots: {
481
- default: ({row}) => {
482
- if (row.startNoSetCandidate) {
483
- return [<div class="txt-status">{this.$t1('否')}</div>];
484
- } else {
485
- return [<div class="txt-status s-3">{this.$t1('是')}</div>];
486
- }
487
- }
488
- }
489
- },
490
- {
491
- field: 'createDate',
492
- title: this.$t1('创建时间'),
493
- width: 200
494
- },
495
- {
496
- width: 200,
497
- fixed: 'right',
498
- sortable: false,
499
- title: '',
500
- slots: {
501
- default: ({row}) => {
502
- return [
503
- <a
504
- href="javascript:void(0);"
505
- class="a-link"
506
- onclick={() => {
507
- this.openEditItemDialog(row.id);
508
- }}
509
- >
510
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
511
- popper-class="tooltip-skin">
512
- <i class="el-icon-edit"/>
513
- </el-tooltip>
514
- </a>,
515
- <a
516
- href="javascript:void(0);"
517
- onClick={() => {
518
- this.wfEdit(row.modelId, this.currentRow.serviceId);
519
- }}
520
- class="a-link"
521
- >
522
- <el-tooltip enterable={false} effect="dark" content={this.$t1('流程设计')} placement="top"
523
- popper-class="tooltip-skin">
524
- <i class="iconfont icon-liuchengguanli-shejiqi_liucheng"/>
525
- </el-tooltip>
526
- </a>,
527
- <a
528
- href="javascript:void(0);"
529
- class="a-link"
530
- onclick={() => {
531
- this.exportWfXml(row);
532
- }}
533
- >
534
- <el-tooltip enterable={false} effect="dark" content={this.$t1('导出')} placement="top"
535
- popper-class="tooltip-skin">
536
- <i class="el-icon-upload2"/>
537
- </el-tooltip>
538
- </a>,
539
- <a
540
- href="javascript:void(0);"
541
- class="a-link"
542
- onclick={() => {
543
- this.importWfXml(row);
544
- }}
545
- >
546
- <el-tooltip enterable={false} effect="dark" content={this.$t1('导入')} placement="top"
547
- popper-class="tooltip-skin">
548
- <i class="el-icon-download"/>
549
- </el-tooltip>
550
- </a>,
551
- ];
552
- }
553
- }
554
- }
555
- ]
556
- };
557
- this.$vxeTableUtil.initVxeTable(tableOption1).then(opts => {
558
- that.vxeOption1 = opts;
559
- });
560
- },
561
- chooseCellM1({row}) {
562
- if (row && row.id) {
563
- let $table1 = this.$refs['table-m1'];
564
- this.$nextTick(() => {
565
- $table1.clearCheckboxRow();
566
- $table1.setCheckboxRow(row, true);
567
- });
568
- this.currentRow = row;
569
- this.$http({
570
- method: 'post',
571
- url: '/' + row.serviceId + '/wf_obj_config_item/list',
572
- data: {objConfigId: row.id || ''},
573
- success: res => {
574
- let rows = res.objx || [];
575
- /* rows.forEach(function(item) {
576
- item.name = row.name;
577
- }); */
578
- this.$refs['table-m2'].loadData(rows);
579
- }
580
- });
581
- } else {
582
- this.$refs['table-m2'].loadData([]);
583
- }
584
- },
585
-
586
- wfEdit(actModelId, serviceId) {
587
- //wfType 0:单据流程,1:场景流程
588
- this.wfUrl = WEB_PREFIX + '/activiti-explorer/modeler.html?wfType=0&serviceId=' + serviceId + '&modelId=' + actModelId;
589
- this.dialogActiveName = 'first';
590
- this.showWfDialog = true;
591
- },
592
- closeDesignwinEvent(done) {
593
- this.$baseConfirm(this.$t1('请确认"已保存"流程模板,是否继续关闭?')).then(() => {
594
- this.showWfDialog = false;
595
- });
596
- },
597
- initWfWinParam() {
598
- this.initCloseWfDesignWin();
599
- this.initWinUserDialog();
600
- this.initWinPositionDialog();
601
- this.initSysParamForWf();
602
- this.initWinFormTemplateDialog();
603
- this.initWinScriptDescriptionDialog();
604
- },
605
- initCloseWfDesignWin() {
606
- window.closeWfDesignWin = () => {
607
- this.showWfDialog = false;
608
- };
609
- },
610
- initWinUserDialog() {
611
- window.openAssignUserDialog = opts => {
612
- this.wfAssignMulti = opts.multi;
613
- this.wfAssignData = opts.data || [];
614
- this.wfAssignCallback = opts.callback;
615
- this.showUserDialog = true;
616
- };
617
- },
618
- confirmUser(rows) {
619
- this.wfAssignCallback(rows);
620
- },
621
- initWinPositionDialog() {
622
- window.openAssignPositionDialog = opts => {
623
- this.wfAssignPositionData = opts.data || [];
624
- this.wfAssignPositionCallback = opts.callback;
625
- this.showPositionDialog = true;
626
- };
627
- },
628
- initSysParamForWf() {
629
- let webPrefix = WEB_PREFIX;
630
- let baseApi = process.env.VUE_APP_BASE_API;
631
- window.sysParamForWf = {
632
- webPrefix,
633
- baseApi
634
- }
635
- },
636
- confirmPosition(rows) {
637
- this.wfAssignPositionCallback(rows);
638
- },
639
- deleteItem(row) {
640
- this.$baseConfirm(this.$t1('您确定要删除吗?')).then(() => {
641
- this.$http({
642
- method: 'post',
643
- url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/delete',
644
- data: {id: row.id},
645
- success: res => {
646
- this.$message({
647
- message: res.content,
648
- type: 'success',
649
- duration: 500,
650
- });
651
- this.$refs['table-m2'].remove(row);
652
- }
653
- });
654
- });
655
- },
656
- initWinFormTemplateDialog() {
657
- window.openAssignFormTemplateDialog = opts => {
658
- this.wfAssignFormTemplateCallback = opts.callback;
659
- this.showFormTemplateDialog = true;
660
- };
661
- },
662
- confirmFormTemplate(rows) {
663
- this.wfAssignFormTemplateCallback(rows);
664
- },
665
- initWinScriptDescriptionDialog() {
666
- window.openScriptDescriptionDialog = opts => {
667
- this.showScriptDescriptionDialog = true;
668
- };
669
- },
670
- openWfBizDataSettingDialog(row) {
671
- this.objConfigItem = row;
672
- this.showWfBizDataSettingDialog = true
673
- },
674
- confirmWfBizDataSettingDialog(rows) {
675
-
676
- },
677
- saveAs(blob, filename) {
678
- if (window.navigator.msSaveOrOpenBlob) {
679
- navigator.msSaveBlob(blob, filename);
680
- } else {
681
- var link = document.createElement("a");
682
- var body = document.querySelector("body");
683
-
684
- link.href = window.URL.createObjectURL(blob);
685
- link.download = filename;
686
-
687
- // fix Firefox
688
- link.style.display = "none";
689
- body.appendChild(link);
690
-
691
- link.click();
692
- body.removeChild(link);
693
-
694
- window.URL.revokeObjectURL(link.href);
695
- }
696
- },
697
- exportWfXml(row){
698
- this.$baseConfirm(this.$t1('您确定要导出吗?')).then(() => {
699
- this.$http({
700
- url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/exportModelXml',
701
- method: `post`,
702
- data: {
703
- stringOne:row.modelId
704
- },
705
- isLoading: true,
706
- responseType: "blob",
707
- resultType: "other",
708
- callback: res => {
709
- let fileName = row.modelName + ".bpmn20.xml"
710
- this.saveAs(res,fileName)
711
- }
712
- });
713
- });
714
- },
715
- importWfXml(row){
716
- this.importXmlRow = row;
717
- this.showImportItemDialog = true;
718
- },
719
- confirmImportItemDialog(file){
720
- var form = new FormData();
721
- // 文件对象
722
- form.append("file", file);
723
- form.append("modelId", this.importXmlRow.modelId);
724
- this.$http({
725
- url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/importProcess',
726
- method: `post`,
727
- headers: {
728
- 'Content-Type': 'multipart/form-data'
729
- },
730
- data: form,
731
- isLoading: true,
732
- success: res => {
733
- this.$message({
734
- message: res.content,
735
- type: 'success',
736
- duration: 2000,
737
- onClose: t => {
738
-
739
- }
740
- });
741
- }
742
- });
743
- }
744
- }
745
- };
746
- </script>
1
+ <template>
2
+ <div id="containt">
3
+ <el-tabs v-model="activeName" class="tab-box">
4
+ <el-tab-pane :label="$t1('常规')" name="first">
5
+ <editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :serviceId.sync="serviceId"
6
+ :parent-target="_self" @reload="$reloadHandle"></editView>
7
+ <itemEditView
8
+ v-if="showItemEdit"
9
+ visible-key="showItemEdit"
10
+ :_dataId.sync="itemEditId"
11
+ :serviceId.sync="itemServiceId"
12
+ :wfObjConfig.sync="pRow"
13
+ :parent-target="_self"
14
+ @reload="$reloadHandle"
15
+ ></itemEditView>
16
+ </el-tab-pane>
17
+ <el-tab-pane :label="$t1('流程配置列表')" name="second">
18
+ <div class="grid-height">
19
+ <div style="height: 345px;">
20
+ <vxe-grid
21
+ ref="table-m1"
22
+ :auto-resize="true"
23
+ v-bind="vxeOption"
24
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
25
+ @custom="$vxeTableUtil.customHandle"
26
+ @checkbox-change="chooseCellM1"
27
+ class="is-pointer"
28
+ >
29
+ <template #form>
30
+ <div style="margin-bottom: 8px;" class="clearfix">
31
+ <div class="fl">
32
+ <vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
33
+ {{ $t1('新增单据') }}
34
+ </vxe-button>
35
+ </div>
36
+ <div class="fr">
37
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
38
+ plain>{{ $t1('刷新') }}
39
+ </vxe-button>
40
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
41
+ {{ $t1('搜索') }}
42
+ </vxe-button>
43
+ </div>
44
+ </div>
45
+ <vxe-form ref="form" class="screen-box" :data-form="formData" title-width="92px" title-align="right"
46
+ @submit="searchEvent" @reset="searchEvent">
47
+ <vxe-form-item :title="$t1('单据类型名称')+':'" field="objTypeName">
48
+ <template v-slot="">
49
+ <el-input v-model="formData.objTypeName" size="small" clearable/>
50
+ </template>
51
+ </vxe-form-item>
52
+ <vxe-form-item :title="$t1('单据类型编号')+':'" field="objTypeCode">
53
+ <template v-slot="">
54
+ <el-input v-model="formData.objTypeCode" size="small" clearable/>
55
+ </template>
56
+ </vxe-form-item>
57
+ </vxe-form>
58
+ </template>
59
+ </vxe-grid>
60
+ </div>
61
+ <label id="labBtn" class="transverse">
62
+ <div class="icon">
63
+ <i class="el-icon-more"></i>
64
+ <i class="el-icon-more"></i>
65
+ </div>
66
+ </label>
67
+ <div style="height: calc(100vh - 345px - 105px);">
68
+ <vxe-grid ref="table-m2" v-bind="vxeOption1" @resizable-change="$vxeTableUtil.onColumnWitchChange"
69
+ @custom="$vxeTableUtil.customHandle">
70
+ <template #row_edit>
71
+ <a href="#" class="a-link"><i class="el-icon-edit"/></a>
72
+ </template>
73
+ </vxe-grid>
74
+ </div>
75
+ </div>
76
+ </el-tab-pane>
77
+ <el-tab-pane :label="$t1('待办列表字段名扩展')" name="third">
78
+ <wfParamEdit v-if="showParamEdit" visible-key="showParamEdit"
79
+ :parent-target="_self" @reload="$reloadHandle"></wfParamEdit>
80
+ </el-tab-pane>
81
+ <el-tab-pane :label="$t1('自定义流程操作属性')" name="fourth">
82
+ <wfDiyAttributeEdit v-if="showWfDiyAttributeEdit" visible-key="showWfDiyAttributeEdit"
83
+ :parent-target="_self" @reload="$reloadHandle"></wfDiyAttributeEdit>
84
+ </el-tab-pane>
85
+
86
+ </el-tabs>
87
+
88
+ <el-dialog
89
+ :title="$t1('流程设计')"
90
+ :append-to-body="true"
91
+ :modal-append-to-body="true"
92
+ :close-on-click-modal="false"
93
+ v-if="showWfDialog"
94
+ :visible.sync="showWfDialog"
95
+ :modal="false"
96
+ custom-class="dialog-style designer-dialog"
97
+ width="100%"
98
+ height="100%"
99
+ top="0px"
100
+ bottom="0px"
101
+ :before-close="closeDesignwinEvent"
102
+ :destroy-on-close="true"
103
+ v-el-drag-dialog
104
+ >
105
+ <iframe :src="wfUrl" :style="'width:100%;height:' + ($root.$el.clientHeight - 30 - 12) + 'px'"></iframe>
106
+ </el-dialog>
107
+
108
+ <userDialog v-if="showUserDialog" :visiable.sync="showUserDialog" @confirm="confirmUser"
109
+ :multi.sync="wfAssignMulti"/>
110
+ <positionDialog v-if="showPositionDialog" :visiable.sync="showPositionDialog" :rows="wfAssignPositionData" @confirm="confirmPosition"/>
111
+ <scriptDescriptionDialog path="static/readme/Wf.txt" v-if="showScriptDescriptionDialog"
112
+ :visiable.sync="showScriptDescriptionDialog"></scriptDescriptionDialog>
113
+ <wfBizDataSettingDialog v-if="showWfBizDataSettingDialog" :visiable.sync="showWfBizDataSettingDialog"
114
+ @confirm="confirmWfBizDataSettingDialog"
115
+ :objConfigItem="objConfigItem" :serviceId="currentRow.serviceId"></wfBizDataSettingDialog>
116
+
117
+ <importItemDialog v-if="showImportItemDialog" :visiable.sync="showImportItemDialog" @confirm="confirmImportItemDialog"/>
118
+ </div>
119
+ </template>
120
+ <script>
121
+ import {treeScolly} from '@base/utils/global.js';
122
+ import editView from './edit.vue';
123
+ import itemEditView from './itemEdit.vue';
124
+
125
+ import userDialog from '../../../../views/user/user/dialog.vue';
126
+ import positionDialog from '../../../../views/user/position/dialog.vue';
127
+
128
+ import wfParamEdit from '../../../../views/user/wf/wf_param/edit'
129
+ import scriptDescriptionDialog from '@base/components/scriptDescription/dialog'
130
+ import wfDiyAttributeEdit from '../../../../views/user/wf/wf_diy_attribute/edit'
131
+ import wfBizDataSettingDialog from "./wfBizDataSettingDialog";
132
+
133
+ import importItemDialog from "./importItemDialog.vue";
134
+ import { workflowDesignerUrl } from "@base/utils/featureResources";
135
+
136
+
137
+
138
+ export default {
139
+ name: 'wf_obj_config:list',
140
+ components: {
141
+ editView,
142
+ itemEditView,
143
+ wfParamEdit,
144
+ userDialog,
145
+ positionDialog,
146
+ scriptDescriptionDialog,
147
+ wfDiyAttributeEdit,
148
+ wfBizDataSettingDialog,
149
+ importItemDialog
150
+ },
151
+ created() {
152
+ },
153
+ mounted() {
154
+ treeScolly({target: this, type: 'default'});
155
+ this.initTableList();
156
+ this.initTableM2();
157
+
158
+ this.ph = this.$root.$el.clientHeight;
159
+ this.initWfWinParam();
160
+ },
161
+ data() {
162
+ return {
163
+ dataId: 0,
164
+ showEdit: false,
165
+ showItemEdit: false,
166
+ showParamEdit: false,
167
+ vxeOption: {},
168
+ vxeOption1: {},
169
+ formData: {},
170
+ editId: '',
171
+ itemEditId: '',
172
+ pRow: null,
173
+ activeName: 'second',
174
+ currentRow: {},
175
+ serviceId: null,
176
+ itemServiceId: null,
177
+
178
+ showWfDialog: false,
179
+ wfUrl: '',
180
+ ph: '',
181
+ dialogActiveName: 'first',
182
+ showFunctionScriptList: false,
183
+ showUserDialog: false,
184
+ wfAssignData: [],
185
+ wfAssignCallback: null,
186
+ wfAssignMulti: true,
187
+
188
+ showPositionDialog: false,
189
+ wfAssignPositionData: [],
190
+ wfAssignPositionCallback: null,
191
+
192
+ showFormTemplateDialog: false,
193
+ wfAssignFormTemplateCallback: null,
194
+
195
+ showScriptDescriptionDialog: false,
196
+ showWfDiyAttributeEdit: false,
197
+
198
+ objConfigItem: null,
199
+ showWfBizDataSettingDialog: false,
200
+ showImportItemDialog:false
201
+ };
202
+ },
203
+ watch: {
204
+ dialogActiveName(val) {
205
+ if (val == 'second') {
206
+ this.showFunctionScriptList = true;
207
+ }
208
+ },
209
+ activeName(val) {
210
+ if (val == 'third' && !this.showParamEdit) {
211
+ this.showParamEdit = true;
212
+ } else if (val == 'fourth' && !this.showWfDiyAttributeEdit) {
213
+ this.showWfDiyAttributeEdit = true;
214
+ }
215
+ }
216
+ },
217
+ methods: {
218
+ searchEvent() {
219
+ this.$refs['table-m1'].commitProxy('reload');
220
+ this.chooseCellM1({row: {}});
221
+ },
222
+ resetEvent() {
223
+ this.formData = {};
224
+ this.$refs['table-m1'].commitProxy('reload');
225
+ },
226
+ openEditDialog(id, serviceId) {
227
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
228
+ this.serviceId = serviceId || '';
229
+ this.activeName = 'first';
230
+ this.showItemEdit = false;
231
+ this.$openEditView('showEdit');
232
+ },
233
+ openEditItemDialog(id, currentRow) {
234
+ if (id) {
235
+ this.pRow = null;
236
+ this.itemEditId = id;
237
+ this.itemServiceId = this.currentRow.serviceId;
238
+ this.activeName = 'first';
239
+ this.showEdit = false;
240
+ this.$openEditView('showItemEdit');
241
+ } else if (currentRow) {
242
+ if (currentRow && currentRow.id) {
243
+ this.pRow = currentRow;
244
+ this.itemEditId = '';
245
+ this.itemServiceId = currentRow.serviceId;
246
+ this.activeName = 'first';
247
+ this.showEdit = false;
248
+ this.$openEditView('showItemEdit');
249
+ }
250
+ }
251
+ },
252
+ initTableList() {
253
+ let tableOption = {
254
+ vue: this,
255
+ tableRef: 'table-m1',
256
+ tableName: 'user_wf_obj_config_list-m1',
257
+ path: USER_PREFIX + '/wf_obj_config/listPage',
258
+ param: () => {
259
+ return this.formData;
260
+ },
261
+ config: {
262
+ checkboxConfig: {
263
+ checkStrictly: true,
264
+ showHeader: false,
265
+ trigger: 'row'
266
+ },
267
+ pagerConfig: {
268
+ autoHidden: true
269
+ }
270
+ },
271
+ columns: [
272
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
273
+ {
274
+ title: this.$t1('单据类型名称'),
275
+ field: 'objTypeName',
276
+ width: 150,
277
+ fixed: 'left'
278
+ },
279
+ {
280
+ title: this.$t1('单据类型编号'),
281
+ field: 'objTypeCode',
282
+ width: 150
283
+ },
284
+ {
285
+ title: this.$t1('跳转url'),
286
+ field: 'url',
287
+ width: 150
288
+ },
289
+ {
290
+ title: this.$t1('移动端url'),
291
+ field: 'mobileUrl',
292
+ width: 150
293
+ },
294
+ {
295
+ title: this.$t1('服务名'),
296
+ field: 'serviceId',
297
+ width: 150
298
+ },
299
+ {
300
+ field: 'note',
301
+ title: this.$t1('备注'),
302
+ width: 150
303
+ },
304
+
305
+ {
306
+ field: 'forms',
307
+ title: this.$t1('是否表单'),
308
+ width: 150,
309
+ slots: {
310
+ default: ({row}) => {
311
+ if (row.forms) {
312
+ return [<div class="txt-status">{this.$t1('是')}</div>];
313
+ } else {
314
+ return [<div class="txt-status s-3">{this.$t1('否')}</div>];
315
+ }
316
+ }
317
+ }
318
+ },
319
+ {
320
+ field: 'createDate',
321
+ title: this.$t1('创建时间'),
322
+ width: 200
323
+ },
324
+ {
325
+ width: 180,
326
+ fixed: 'right',
327
+ title: '',
328
+ sortable: false,
329
+ slots: {
330
+ default: ({row}) => {
331
+ return [
332
+ <div>
333
+ <a
334
+ class="a-link"
335
+ onclick={event => {
336
+ event.stopPropagation();
337
+ this.openEditItemDialog('', row);
338
+ }}
339
+ >
340
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('新增流程模板')} placement="top"
341
+ popper-class="tooltip-skin">
342
+ <div>
343
+ <i class="el-icon-circle-plus-outline"/>
344
+ <span>{this.$t1('新增流程模板')}</span>
345
+ </div>
346
+ </el-tooltip>
347
+ </a>
348
+ <a
349
+ href="javascript:void(0);"
350
+ class="a-link"
351
+ onclick={event => {
352
+ event.stopPropagation();
353
+ this.openEditDialog(row.id, row.serviceId);
354
+ }}
355
+ >
356
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
357
+ popper-class="tooltip-skin">
358
+ <i class="el-icon-edit"/>
359
+ </el-tooltip>
360
+ </a>
361
+ </div>
362
+ ];
363
+ }
364
+ }
365
+ }
366
+ ]
367
+ };
368
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
369
+ this.vxeOption = opts;
370
+ });
371
+ },
372
+ initTableM2() {
373
+ let startModeMap = {
374
+ 1: this.$t1('节点无候选人,提示异常'),
375
+ 2: this.$t1('节点无候选人,提示警告'),
376
+ 3: this.$t1('节点无候选人,无提示'),
377
+ }
378
+ var that = this;
379
+ let tableOption1 = {
380
+ vue: that,
381
+ tableRef: 'table-m2',
382
+ tableName: 'user_wf_obj_config_item_list-m2',
383
+ config: {
384
+ maxHeight: ''
385
+ },
386
+ columns: [
387
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
388
+ {
389
+ title: this.$t1('流程模版名称'),
390
+ field: 'modelName',
391
+ width: 150,
392
+ fixed: 'left'
393
+ },
394
+ {
395
+ title: this.$t1('序号'),
396
+ field: 'orders',
397
+ width: 150
398
+ },
399
+ {
400
+ title: this.$t1('流程模版KEY'),
401
+ field: 'modelKey',
402
+ width: 150
403
+ },
404
+ {
405
+ title: this.$t1('单据类型编码'),
406
+ field: 'objTypeCode',
407
+ width: 150
408
+ },
409
+ {
410
+ field: 'enabled',
411
+ title: this.$t1('是否启用'),
412
+ width: 150,
413
+ slots: {
414
+ default: ({row}) => {
415
+ if (row.enabled) {
416
+ return [<div class="txt-status">{this.$t1('启用')}</div>];
417
+ } else {
418
+ return [<div class="txt-status s-3">{this.$t1('禁用')}</div>];
419
+ }
420
+ }
421
+ }
422
+ },
423
+ {
424
+ title: this.$t1('跳过相邻任务'),
425
+ field: 'skipAdjacentTask',
426
+ width: 150,
427
+ slots: {
428
+ default: ({row}) => {
429
+ if (row.skipAdjacentTask) {
430
+ return [<div class="txt-status">{this.$t1('是')}</div>];
431
+ } else {
432
+ return [<div class="txt-status s-3">{this.$t1('否')}</div>];
433
+ }
434
+ }
435
+ }
436
+ },
437
+ {
438
+ title: this.$t1('驳回后提交模式'),
439
+ field: 'toRejectNode',
440
+ width: 180,
441
+ slots: {
442
+ default: ({row}) => {
443
+ if (row.toNextNode === 1) {
444
+ return [<div class="txt-status">{this.$t1('顺延下一步提交')}</div>];
445
+ } else if (row.toRejectNode) {
446
+ return [<div class="txt-status">{this.$t1('由提交人确定节点提交')}</div>];
447
+ } else {
448
+ return [<div class="txt-status s-3">{this.$t1('直接提交到驳回节点')}</div>];
449
+ }
450
+ }
451
+ }
452
+ },
453
+ {
454
+ title: this.$t1('流程启动处理'),
455
+ field: 'startMode',
456
+ width: 180,
457
+ slots: {
458
+ default: ({row}) => {
459
+ return startModeMap[row.startMode] || '';
460
+ }
461
+ }
462
+ },
463
+ {
464
+ title: this.$t1('跨任务跳过'),
465
+ field: 'skipSameUserTask',
466
+ width: 150,
467
+ slots: {
468
+ default: ({row}) => {
469
+ if (row.skipSameUserTask) {
470
+ return [<div class="txt-status">{this.$t1('是')}</div>];
471
+ } else {
472
+ return [<div class="txt-status s-3">{this.$t1('否')}</div>];
473
+ }
474
+ }
475
+ }
476
+ },
477
+ {
478
+ title: this.$t1('是否允许流程启动更改候选人'),
479
+ field: 'startNoSetCandidate',
480
+ width: 230,
481
+ slots: {
482
+ default: ({row}) => {
483
+ if (row.startNoSetCandidate) {
484
+ return [<div class="txt-status">{this.$t1('否')}</div>];
485
+ } else {
486
+ return [<div class="txt-status s-3">{this.$t1('是')}</div>];
487
+ }
488
+ }
489
+ }
490
+ },
491
+ {
492
+ field: 'createDate',
493
+ title: this.$t1('创建时间'),
494
+ width: 200
495
+ },
496
+ {
497
+ width: 200,
498
+ fixed: 'right',
499
+ sortable: false,
500
+ title: '',
501
+ slots: {
502
+ default: ({row}) => {
503
+ return [
504
+ <a
505
+ href="javascript:void(0);"
506
+ class="a-link"
507
+ onclick={() => {
508
+ this.openEditItemDialog(row.id);
509
+ }}
510
+ >
511
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
512
+ popper-class="tooltip-skin">
513
+ <i class="el-icon-edit"/>
514
+ </el-tooltip>
515
+ </a>,
516
+ <a
517
+ href="javascript:void(0);"
518
+ onClick={() => {
519
+ this.wfEdit(row.modelId, this.currentRow.serviceId);
520
+ }}
521
+ class="a-link"
522
+ >
523
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('流程设计')} placement="top"
524
+ popper-class="tooltip-skin">
525
+ <i class="iconfont icon-liuchengguanli-shejiqi_liucheng"/>
526
+ </el-tooltip>
527
+ </a>,
528
+ <a
529
+ href="javascript:void(0);"
530
+ class="a-link"
531
+ onclick={() => {
532
+ this.exportWfXml(row);
533
+ }}
534
+ >
535
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('导出')} placement="top"
536
+ popper-class="tooltip-skin">
537
+ <i class="el-icon-upload2"/>
538
+ </el-tooltip>
539
+ </a>,
540
+ <a
541
+ href="javascript:void(0);"
542
+ class="a-link"
543
+ onclick={() => {
544
+ this.importWfXml(row);
545
+ }}
546
+ >
547
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('导入')} placement="top"
548
+ popper-class="tooltip-skin">
549
+ <i class="el-icon-download"/>
550
+ </el-tooltip>
551
+ </a>,
552
+ ];
553
+ }
554
+ }
555
+ }
556
+ ]
557
+ };
558
+ this.$vxeTableUtil.initVxeTable(tableOption1).then(opts => {
559
+ that.vxeOption1 = opts;
560
+ });
561
+ },
562
+ chooseCellM1({row}) {
563
+ if (row && row.id) {
564
+ let $table1 = this.$refs['table-m1'];
565
+ this.$nextTick(() => {
566
+ $table1.clearCheckboxRow();
567
+ $table1.setCheckboxRow(row, true);
568
+ });
569
+ this.currentRow = row;
570
+ this.$http({
571
+ method: 'post',
572
+ url: '/' + row.serviceId + '/wf_obj_config_item/list',
573
+ data: {objConfigId: row.id || ''},
574
+ success: res => {
575
+ let rows = res.objx || [];
576
+ /* rows.forEach(function(item) {
577
+ item.name = row.name;
578
+ }); */
579
+ this.$refs['table-m2'].loadData(rows);
580
+ }
581
+ });
582
+ } else {
583
+ this.$refs['table-m2'].loadData([]);
584
+ }
585
+ },
586
+
587
+ wfEdit(actModelId, serviceId) {
588
+ //wfType 0:单据流程,1:场景流程
589
+ this.wfUrl = workflowDesignerUrl({ wfType: 0, serviceId, modelId: actModelId, baseApi: process.env.VUE_APP_BASE_API });
590
+ this.dialogActiveName = 'first';
591
+ this.showWfDialog = true;
592
+ },
593
+ closeDesignwinEvent(done) {
594
+ this.$baseConfirm(this.$t1('请确认"已保存"流程模板,是否继续关闭?')).then(() => {
595
+ this.showWfDialog = false;
596
+ });
597
+ },
598
+ initWfWinParam() {
599
+ this.initCloseWfDesignWin();
600
+ this.initWinUserDialog();
601
+ this.initWinPositionDialog();
602
+ this.initSysParamForWf();
603
+ this.initWinFormTemplateDialog();
604
+ this.initWinScriptDescriptionDialog();
605
+ },
606
+ initCloseWfDesignWin() {
607
+ window.closeWfDesignWin = () => {
608
+ this.showWfDialog = false;
609
+ };
610
+ },
611
+ initWinUserDialog() {
612
+ window.openAssignUserDialog = opts => {
613
+ this.wfAssignMulti = opts.multi;
614
+ this.wfAssignData = opts.data || [];
615
+ this.wfAssignCallback = opts.callback;
616
+ this.showUserDialog = true;
617
+ };
618
+ },
619
+ confirmUser(rows) {
620
+ this.wfAssignCallback(rows);
621
+ },
622
+ initWinPositionDialog() {
623
+ window.openAssignPositionDialog = opts => {
624
+ this.wfAssignPositionData = opts.data || [];
625
+ this.wfAssignPositionCallback = opts.callback;
626
+ this.showPositionDialog = true;
627
+ };
628
+ },
629
+ initSysParamForWf() {
630
+ let webPrefix = WEB_PREFIX;
631
+ let baseApi = process.env.VUE_APP_BASE_API;
632
+ window.sysParamForWf = {
633
+ webPrefix,
634
+ baseApi
635
+ }
636
+ },
637
+ confirmPosition(rows) {
638
+ this.wfAssignPositionCallback(rows);
639
+ },
640
+ deleteItem(row) {
641
+ this.$baseConfirm(this.$t1('您确定要删除吗?')).then(() => {
642
+ this.$http({
643
+ method: 'post',
644
+ url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/delete',
645
+ data: {id: row.id},
646
+ success: res => {
647
+ this.$message({
648
+ message: res.content,
649
+ type: 'success',
650
+ duration: 500,
651
+ });
652
+ this.$refs['table-m2'].remove(row);
653
+ }
654
+ });
655
+ });
656
+ },
657
+ initWinFormTemplateDialog() {
658
+ window.openAssignFormTemplateDialog = opts => {
659
+ this.wfAssignFormTemplateCallback = opts.callback;
660
+ this.showFormTemplateDialog = true;
661
+ };
662
+ },
663
+ confirmFormTemplate(rows) {
664
+ this.wfAssignFormTemplateCallback(rows);
665
+ },
666
+ initWinScriptDescriptionDialog() {
667
+ window.openScriptDescriptionDialog = opts => {
668
+ this.showScriptDescriptionDialog = true;
669
+ };
670
+ },
671
+ openWfBizDataSettingDialog(row) {
672
+ this.objConfigItem = row;
673
+ this.showWfBizDataSettingDialog = true
674
+ },
675
+ confirmWfBizDataSettingDialog(rows) {
676
+
677
+ },
678
+ saveAs(blob, filename) {
679
+ if (window.navigator.msSaveOrOpenBlob) {
680
+ navigator.msSaveBlob(blob, filename);
681
+ } else {
682
+ var link = document.createElement("a");
683
+ var body = document.querySelector("body");
684
+
685
+ link.href = window.URL.createObjectURL(blob);
686
+ link.download = filename;
687
+
688
+ // fix Firefox
689
+ link.style.display = "none";
690
+ body.appendChild(link);
691
+
692
+ link.click();
693
+ body.removeChild(link);
694
+
695
+ window.URL.revokeObjectURL(link.href);
696
+ }
697
+ },
698
+ exportWfXml(row){
699
+ this.$baseConfirm(this.$t1('您确定要导出吗?')).then(() => {
700
+ this.$http({
701
+ url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/exportModelXml',
702
+ method: `post`,
703
+ data: {
704
+ stringOne:row.modelId
705
+ },
706
+ isLoading: true,
707
+ responseType: "blob",
708
+ resultType: "other",
709
+ callback: res => {
710
+ let fileName = row.modelName + ".bpmn20.xml"
711
+ this.saveAs(res,fileName)
712
+ }
713
+ });
714
+ });
715
+ },
716
+ importWfXml(row){
717
+ this.importXmlRow = row;
718
+ this.showImportItemDialog = true;
719
+ },
720
+ confirmImportItemDialog(file){
721
+ var form = new FormData();
722
+ // 文件对象
723
+ form.append("file", file);
724
+ form.append("modelId", this.importXmlRow.modelId);
725
+ this.$http({
726
+ url: '/' + this.currentRow.serviceId + '/wf_obj_config_item/importProcess',
727
+ method: `post`,
728
+ headers: {
729
+ 'Content-Type': 'multipart/form-data'
730
+ },
731
+ data: form,
732
+ isLoading: true,
733
+ success: res => {
734
+ this.$message({
735
+ message: res.content,
736
+ type: 'success',
737
+ duration: 2000,
738
+ onClose: t => {
739
+
740
+ }
741
+ });
742
+ }
743
+ });
744
+ }
745
+ }
746
+ };
747
+ </script>