eoss-ui 0.8.38 → 0.8.39

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 (78) hide show
  1. package/lib/eoss-ui.common.js +746 -687
  2. package/lib/flow-group.js +2 -2
  3. package/lib/flow.js +724 -669
  4. package/lib/index.js +1 -1
  5. package/lib/selector.js +7 -3
  6. package/package.json +1 -1
  7. package/packages/flow/src/component/taskUnionExamine.vue +821 -771
  8. package/packages/flow/src/flow.vue +4534 -4526
  9. package/packages/flow/src/main.vue +4411 -4411
  10. package/packages/flow/src/selectUser.vue +1 -0
  11. package/packages/flow/src/startTaskRead.vue +718 -718
  12. package/packages/flow-group/src/main.vue +756 -756
  13. package/packages/selector/src/main.vue +764 -761
  14. package/packages/theme-chalk/lib/archives.css +1 -0
  15. package/packages/theme-chalk/lib/base.css +1 -0
  16. package/packages/theme-chalk/lib/button-group.css +1 -0
  17. package/packages/theme-chalk/lib/button.css +1 -0
  18. package/packages/theme-chalk/lib/calendar.css +1 -0
  19. package/packages/theme-chalk/lib/calogin.css +0 -0
  20. package/packages/theme-chalk/lib/card.css +1 -0
  21. package/packages/theme-chalk/lib/cascader.css +0 -0
  22. package/packages/theme-chalk/lib/checkbox-group.css +1 -0
  23. package/packages/theme-chalk/lib/clients.css +1 -0
  24. package/packages/theme-chalk/lib/data-table-form.css +1 -0
  25. package/packages/theme-chalk/lib/data-table.css +1 -0
  26. package/packages/theme-chalk/lib/date-picker.css +1 -0
  27. package/packages/theme-chalk/lib/dialog.css +1 -0
  28. package/packages/theme-chalk/lib/enable-drag.css +1 -0
  29. package/packages/theme-chalk/lib/enterprise.css +1 -0
  30. package/packages/theme-chalk/lib/error-page.css +1 -0
  31. package/packages/theme-chalk/lib/flow-chart.css +0 -0
  32. package/packages/theme-chalk/lib/flow-group.css +1 -0
  33. package/packages/theme-chalk/lib/flow-list.css +1 -0
  34. package/packages/theme-chalk/lib/flow.css +1 -0
  35. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  36. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  37. package/packages/theme-chalk/lib/form.css +1 -0
  38. package/packages/theme-chalk/lib/handle-user.css +1 -0
  39. package/packages/theme-chalk/lib/handler.css +1 -0
  40. package/packages/theme-chalk/lib/icon.css +1 -0
  41. package/packages/theme-chalk/lib/icons.css +1 -0
  42. package/packages/theme-chalk/lib/index.css +1 -0
  43. package/packages/theme-chalk/lib/input-number.css +0 -0
  44. package/packages/theme-chalk/lib/input.css +1 -0
  45. package/packages/theme-chalk/lib/label.css +1 -0
  46. package/packages/theme-chalk/lib/layout.css +1 -0
  47. package/packages/theme-chalk/lib/login.css +1 -0
  48. package/packages/theme-chalk/lib/main.css +1 -0
  49. package/packages/theme-chalk/lib/menu.css +1 -0
  50. package/packages/theme-chalk/lib/nav.css +1 -0
  51. package/packages/theme-chalk/lib/notify.css +0 -0
  52. package/packages/theme-chalk/lib/page.css +1 -0
  53. package/packages/theme-chalk/lib/pagination.css +1 -0
  54. package/packages/theme-chalk/lib/player.css +1 -0
  55. package/packages/theme-chalk/lib/qr-code.css +1 -0
  56. package/packages/theme-chalk/lib/radio-group.css +1 -0
  57. package/packages/theme-chalk/lib/retrial-auth.css +1 -0
  58. package/packages/theme-chalk/lib/select-ganged.css +1 -0
  59. package/packages/theme-chalk/lib/select.css +1 -0
  60. package/packages/theme-chalk/lib/selector-panel.css +1 -0
  61. package/packages/theme-chalk/lib/selector.css +1 -0
  62. package/packages/theme-chalk/lib/simplicity-top.css +1 -0
  63. package/packages/theme-chalk/lib/simplicity.css +1 -0
  64. package/packages/theme-chalk/lib/sizer.css +1 -0
  65. package/packages/theme-chalk/lib/steps.css +1 -0
  66. package/packages/theme-chalk/lib/switch.css +1 -0
  67. package/packages/theme-chalk/lib/table-form.css +0 -0
  68. package/packages/theme-chalk/lib/tabs-panel.css +0 -0
  69. package/packages/theme-chalk/lib/tabs.css +1 -0
  70. package/packages/theme-chalk/lib/tips.css +1 -0
  71. package/packages/theme-chalk/lib/toolbar.css +1 -0
  72. package/packages/theme-chalk/lib/tree-group.css +1 -0
  73. package/packages/theme-chalk/lib/tree.css +1 -0
  74. package/packages/theme-chalk/lib/upload.css +1 -0
  75. package/packages/theme-chalk/lib/wujie.css +0 -0
  76. package/packages/theme-chalk/lib/wxlogin.css +1 -0
  77. package/src/index.js +1 -1
  78. package/packages/theme-chalk/gulpfile.js +0 -25
@@ -1,756 +1,756 @@
1
- <template>
2
- <div class="es-flow-group" :class="{ 'is-hide-flow': !isShow }">
3
- <div class="es-flow-group-main">
4
- <el-tabs
5
- class="es-flow-tabs es-tabs"
6
- type="border-card"
7
- v-model="activeName"
8
- ref="tabs"
9
- :before-leave="handleBefore"
10
- >
11
- <template v-for="(items, indexs) in tabs">
12
- <el-tab-pane
13
- v-if="handleHide(items.hide)"
14
- :key="items.id || indexs"
15
- :immediate="items.label === '流程图' ? false : items.immediate"
16
- :name="String(indexs)"
17
- :class="{ 'es-flex-vertical': items.average }"
18
- >
19
- <span
20
- slot="label"
21
- :style="{
22
- color:
23
- activeName == String(indexs) ? items.activeColor : items.color
24
- }"
25
- >
26
- <template v-if="items.title">
27
- <template v-if="typeof items.title === 'object'">
28
- <i v-if="items.title.icon" :class="items.title.icon"></i>
29
- <el-badge
30
- v-if="items.title.count"
31
- type="primary"
32
- :value="items.title.count"
33
- :color="items.title.color"
34
- :max="99"
35
- >{{ items.title.text }}
36
- </el-badge>
37
- <template v-else>{{ items.title.text }}</template>
38
- </template>
39
- <template v-else>{{ items.title }}</template>
40
- </template>
41
- <template>{{ items.label }}</template>
42
- </span>
43
- <es-tabs-panel v-bind="items" :show="activeName === String(indexs)">
44
- <template
45
- slot-scope="{ contents, average, data, title, show, isShow }"
46
- >
47
- <template v-if="Array.isArray(contents)">
48
- <template v-for="(item, index) in contents">
49
- <div class="es-tab-pane-list" :key="index" v-if="average">
50
- <div class="es-tab-pane-main">
51
- <es-flow-list
52
- v-if="
53
- item.type === 'flow-list' ||
54
- item.type === 'flowList'
55
- "
56
- :businessId="businessId"
57
- v-bind="
58
- handleExclAttribute({
59
- data: item,
60
- attrs: ['events', 'visible', 'type']
61
- })
62
- "
63
- :display="activeName === String(indexs)"
64
- :key="'fl-' + index + '-' + flowListKey"
65
- ></es-flow-list>
66
- <es-data-table
67
- v-if="
68
- item.type === 'data-table' ||
69
- item.type === 'dataTable'
70
- "
71
- :appId="taskExamineAppId"
72
- v-bind="
73
- handleExclAttribute({
74
- data: item,
75
- attrs: ['events', 'visible', 'type']
76
- })
77
- "
78
- :class="{
79
- 'es-flow-group-data-table':
80
- item.type === 'data-table' ||
81
- item.type === 'dataTable'
82
- }"
83
- :display="activeName === String(indexs)"
84
- v-on="item.events"
85
- >
86
- <template v-if="item.dialog" slot="dialog">
87
- <template v-if="Array.isArray(item.dialog)">
88
- <es-dialog
89
- v-for="(ele, ids) in item.dialog"
90
- :isReload="true"
91
- v-bind="ele"
92
- :key="ids"
93
- :visible.sync="ele.visible"
94
- v-on="{ ...ele.events }"
95
- >
96
- </es-dialog>
97
- </template>
98
- <es-dialog
99
- v-else
100
- :isReload="true"
101
- v-bind="item.dialog"
102
- :visible.sync="item.dialog.visible"
103
- v-on="{ ...item.dialog.events }"
104
- >
105
- </es-dialog>
106
- </template>
107
- </es-data-table>
108
- <es-tree-group
109
- v-if="
110
- item.type === 'tree-group' ||
111
- item.type === 'treeGroup'
112
- "
113
- :appId="taskExamineAppId"
114
- v-bind="
115
- handleExclAttribute({
116
- data: item,
117
- attrs: ['events', 'visible', 'type']
118
- })
119
- "
120
- :display="activeName === String(indexs)"
121
- v-on="{ ...item.events }"
122
- ></es-tree-group>
123
- <iframe
124
- v-if="item.type === 'iframe' && !item.blank"
125
- :id="item.id || item.name"
126
- :name="item.name"
127
- frameborder="0"
128
- width="100%"
129
- height="100%"
130
- :src="handleUrlJoinParams(item)"
131
- ></iframe>
132
- <es-upload
133
- v-if="item.type === 'attachment'"
134
- :file-count.sync="title.count"
135
- height="auto"
136
- class="es-attachment"
137
- :ownId="businessId"
138
- v-bind="
139
- handleExclAttribute({
140
- data: item,
141
- attrs: ['events', 'type']
142
- })
143
- "
144
- :display="activeName === String(indexs)"
145
- v-on="{ ...item.events }"
146
- ></es-upload>
147
- </div>
148
- </div>
149
- <template v-else>
150
- <es-form
151
- v-if="item.type === 'form'"
152
- ref="esFlowForm"
153
- :showMsg="showMsg"
154
- v-bind="
155
- handleExclAttribute({
156
- data: item,
157
- attrs: ['events', 'visible', 'type', 'model', 'ref']
158
- })
159
- "
160
- full
161
- :key="index"
162
- :autoId="true"
163
- :show-button="false"
164
- :closeDialog="false"
165
- :display="activeName === String(indexs)"
166
- :model="item.model"
167
- :businessId.sync="businessId"
168
- v-on="{ ...item.events }"
169
- ></es-form>
170
- <es-flow-list
171
- v-if="
172
- item.type === 'flow-list' || item.type === 'flowList'
173
- "
174
- :businessId="businessId"
175
- v-bind="
176
- handleExclAttribute({
177
- data: item,
178
- attrs: ['events', 'visible', 'type']
179
- })
180
- "
181
- :display="activeName === String(indexs)"
182
- :key="'fl-' + index + '-' + flowListKey"
183
- ></es-flow-list>
184
- <es-data-table
185
- v-if="
186
- item.type === 'data-table' ||
187
- item.type === 'dataTable'
188
- "
189
- :appId="taskExamineAppId"
190
- v-bind="
191
- handleExclAttribute({
192
- data: item,
193
- attrs: ['events', 'visible', 'type']
194
- })
195
- "
196
- :key="index"
197
- :class="{
198
- 'es-flow-group-data-table':
199
- item.type === 'data-table' ||
200
- item.type === 'dataTable'
201
- }"
202
- :display="activeName === String(indexs)"
203
- v-on="item.events"
204
- >
205
- <template v-if="item.dialog" slot="dialog">
206
- <template v-if="Array.isArray(item.dialog)">
207
- <es-dialog
208
- v-for="(ele, ids) in item.dialog"
209
- :isReload="true"
210
- v-bind="ele"
211
- :key="ids"
212
- :visible.sync="ele.visible"
213
- v-on="{ ...ele.events }"
214
- >
215
- </es-dialog>
216
- </template>
217
- <es-dialog
218
- v-else
219
- :isReload="true"
220
- v-bind="item.dialog"
221
- :visible.sync="item.dialog.visible"
222
- v-on="{ ...item.dialog.events }"
223
- >
224
- </es-dialog>
225
- </template>
226
- </es-data-table>
227
- <es-tree-group
228
- v-if="
229
- item.type === 'tree-group' ||
230
- item.type === 'treeGroup'
231
- "
232
- :appId="taskExamineAppId"
233
- v-bind="
234
- handleExclAttribute({
235
- data: item,
236
- attrs: ['events', 'visible', 'type']
237
- })
238
- "
239
- :key="index"
240
- :display="activeName === String(indexs)"
241
- v-on="{ ...item.events }"
242
- ></es-tree-group>
243
- <iframe
244
- v-if="item.type === 'iframe' && !item.blank"
245
- frameborder="0"
246
- width="100%"
247
- height="100%"
248
- :key="index"
249
- :id="item.id || item.name"
250
- :name="item.name"
251
- :src="handleUrlJoinParams(item)"
252
- ></iframe>
253
- <es-upload
254
- v-if="item.type === 'attachment'"
255
- height="auto"
256
- class="es-attachment"
257
- :ownId="businessId"
258
- v-bind="
259
- handleExclAttribute({
260
- data: item,
261
- attrs: ['events', 'type']
262
- })
263
- "
264
- :key="index"
265
- :file-count.sync="title.count"
266
- :display="activeName === String(indexs)"
267
- v-on="{ ...item.events }"
268
- ></es-upload>
269
- <es-dialog
270
- v-if="
271
- item.type === 'dialog' &&
272
- activeName === String(indexs)
273
- "
274
- :isReload="true"
275
- v-bind="item"
276
- :key="index"
277
- :visible.sync="item.visible"
278
- v-on="{ ...item.events }"
279
- >
280
- </es-dialog>
281
- <component
282
- v-if="item.component || item.type == 'component'"
283
- :is="item.is || item.type"
284
- show
285
- isShow
286
- v-bind="
287
- handleExclAttribute({
288
- data: item,
289
- attrs: ['is', 'type']
290
- })
291
- "
292
- ></component>
293
- </template>
294
- </template>
295
- </template>
296
- <template v-else>
297
- <component
298
- v-if="contents.component || contents.type == 'component'"
299
- :is="contents.is || contents.type"
300
- show
301
- isShow
302
- v-bind="
303
- handleExclAttribute({
304
- data: contents,
305
- attrs: ['is', 'type']
306
- })
307
- "
308
- ></component>
309
- <es-form
310
- v-if="contents.type === 'form'"
311
- :show-button="false"
312
- ref="esFlowForm"
313
- :showMsg="showMsg"
314
- v-bind="
315
- handleExclAttribute({
316
- data: contents,
317
- attrs: ['events', 'visible', 'type', 'model', 'ref']
318
- })
319
- "
320
- full
321
- :autoId="true"
322
- :businessId.sync="businessId"
323
- :closeDialog="false"
324
- :display="activeName === String(indexs)"
325
- :model="contents.model"
326
- v-on="{ ...contents.events }"
327
- ></es-form>
328
- <es-flow-list
329
- v-if="
330
- contents.type === 'flow-list' ||
331
- contents.type === 'flowList'
332
- "
333
- :businessId="businessId"
334
- v-bind="
335
- handleExclAttribute({
336
- data: contents,
337
- attrs: ['events', 'visible', 'type']
338
- })
339
- "
340
- :display="activeName === String(indexs)"
341
- :key="'fl-' + flowListKey"
342
- ></es-flow-list>
343
- <es-data-table
344
- v-if="
345
- contents.type === 'data-table' ||
346
- contents.type === 'dataTable'
347
- "
348
- :appId="taskExamineAppId"
349
- v-bind="
350
- handleExclAttribute({
351
- data: contents,
352
- attrs: ['events', 'visible', 'type']
353
- })
354
- "
355
- :class="{
356
- 'es-flow-group-data-table':
357
- contents.type === 'data-table' ||
358
- contents.type === 'dataTable'
359
- }"
360
- :display="activeName === String(indexs)"
361
- v-on="contents.events"
362
- >
363
- <template v-if="contents.dialog" slot="dialog">
364
- <template v-if="Array.isArray(contents.dialog)">
365
- <es-dialog
366
- v-for="(ele, ids) in contents.dialog"
367
- :isReload="true"
368
- v-bind="ele"
369
- :key="ids"
370
- :visible.sync="ele.visible"
371
- v-on="{ ...ele.events }"
372
- >
373
- </es-dialog>
374
- </template>
375
- <es-dialog
376
- v-else
377
- :isReload="true"
378
- v-bind="contents.dialog"
379
- :visible.sync="contents.dialog.visible"
380
- v-on="{ ...contents.dialog.events }"
381
- >
382
- </es-dialog>
383
- </template>
384
- </es-data-table>
385
- <es-tree-group
386
- v-if="
387
- contents.type === 'tree-group' ||
388
- contents.type === 'treeGroup'
389
- "
390
- :appId="taskExamineAppId"
391
- v-bind="
392
- handleExclAttribute({
393
- data: contents,
394
- attrs: ['events', 'visible', 'type']
395
- })
396
- "
397
- :display="activeName === String(indexs)"
398
- v-on="{ ...contents.events }"
399
- ></es-tree-group>
400
- <iframe
401
- v-if="contents.type === 'iframe' && !contents.blank"
402
- :id="contents.id || contents.name"
403
- :name="contents.name"
404
- frameborder="0"
405
- width="100%"
406
- height="100%"
407
- :src="handleUrlJoinParams(contents)"
408
- ></iframe>
409
- <es-upload
410
- v-if="contents.type === 'attachment'"
411
- :ownId="businessId"
412
- v-bind="
413
- handleExclAttribute({
414
- data: contents,
415
- attrs: ['events', 'type']
416
- })
417
- "
418
- :file-count.sync="title.count"
419
- :display="activeName === String(indexs)"
420
- height="auto"
421
- class="es-attachment"
422
- v-on="{ ...contents.events }"
423
- ></es-upload>
424
- </template>
425
- </template>
426
- </es-tabs-panel>
427
- </el-tab-pane>
428
- </template>
429
- </el-tabs>
430
- </div>
431
- <es-flow
432
- v-if="isShow"
433
- class="es-group-flow"
434
- v-bind="_flow"
435
- :width="width"
436
- :before-submit="isSubmit ? handleSubmit : undefined"
437
- :businessId="businessId"
438
- @startTaskRead="handleTaskRead"
439
- @success="handleSuccess"
440
- @save="handleSave"
441
- @endMessageChange="handleEndMessageChange"
442
- @successRead="handleSuccessRead"
443
- :closeParent="closeParent"
444
- ></es-flow>
445
- <slot></slot>
446
- </div>
447
- </template>
448
- <script>
449
- import util from 'eoss-ui/src/utils/util';
450
- export default {
451
- name: 'EsFlowGroup',
452
- inject: {
453
- esDialog: {
454
- default: ''
455
- },
456
- injector: {
457
- default: ''
458
- }
459
- },
460
- props: {
461
- // autoId: {
462
- // type: Boolean,
463
- // default: true
464
- // },
465
- active: {
466
- type: String,
467
- default: '0'
468
- },
469
- contents: Array,
470
- closeWindow: Boolean,
471
- closeDialog: {
472
- type: Boolean,
473
- default: true
474
- },
475
- otherValidate: Function,
476
- flow: Object,
477
- events: Object,
478
- recordid: String,
479
- pendingId: String,
480
- arcurl: String,
481
- itemname: String,
482
- show: {
483
- type: Boolean,
484
- default: true
485
- },
486
- closeParent: {
487
- type: Boolean,
488
- default: true
489
- },
490
- appId: String,
491
- zoom: false,
492
- width: {
493
- type: String,
494
- default: '360px'
495
- },
496
- refs: String,
497
- isSubmit: {
498
- type: Boolean,
499
- default: true
500
- }
501
- },
502
- data() {
503
- return {
504
- activeName: this.active,
505
- businessId: undefined,
506
- taskExamineAppId: this.appId,
507
- showMsg: true,
508
- formRefs: this.refs,
509
- submits: null,
510
- flowListKey: 0
511
- };
512
- },
513
- computed: {
514
- tabs() {
515
- return this.contents ? this.contents : [];
516
- },
517
- isShow() {
518
- if (
519
- this.flow &&
520
- Object.prototype.hasOwnProperty.call(this.flow, 'show')
521
- ) {
522
- return this.flow.show;
523
- }
524
- let flow = util.getParams({ name: 'flow' });
525
- if (flow == 0) {
526
- return false;
527
- }
528
- return this.show;
529
- },
530
- _flow() {
531
- return !this.flow.pendingId
532
- ? { ...this.flow, pendingId: this.pendingId }
533
- : this.flow;
534
- }
535
- },
536
- watch: {
537
- activeName(val) {
538
- this.$emit('update:active', val);
539
- },
540
- businessId(val) {
541
- this.handleChangeData({ businessId: val });
542
- }
543
- },
544
- created() {
545
- if (this.flow.businessId || this.flow.pendingId) {
546
- this.businessId = this.flow.businessId || this.flow.pendingId;
547
- }
548
- },
549
- mounted() {},
550
- methods: {
551
- handleSuccessRead(){
552
- this.flowListKey++;
553
- },
554
- handleHide(res) {
555
- return typeof res === 'boolean'
556
- ? !res
557
- : typeof res === 'string'
558
- ? this[res]
559
- : true;
560
- },
561
- handleExclAttribute({ data, attrs }) {
562
- if (!attrs || !attrs.length) {
563
- this.ref && (this.formRefs = this.ref);
564
- return data;
565
- }
566
- return util.exclAttribute({
567
- data: data,
568
- attrs: attrs
569
- });
570
- },
571
- handleUrlJoinParams(res, flag = true) {
572
- let url = res.url;
573
- if (flag) {
574
- if (res.method) {
575
- this.submit = {
576
- id: res.id,
577
- url: url,
578
- method: typeof res.method === 'boolean' ? 'submit' : res.method
579
- };
580
- }
581
- }
582
- let param = util.extend(
583
- {},
584
- { id: this.businessId, appId: this.taskExamineAppId },
585
- res.param || {}
586
- );
587
- return util.urlJoinParams({ url, param });
588
- },
589
- handleBefore(active, old) {
590
- return new Promise((resolve, reject) => {
591
- let n = parseInt(active, 10);
592
- let item = this.tabs[n];
593
- let url = null;
594
- let name = item.name;
595
- let width = 0;
596
- let height = 0;
597
- width = util.win.screen.availWidth - 10;
598
- height = util.win.screen.availHeight - 60;
599
- if (item.url) {
600
- url = this.handleUrlJoinParams(item);
601
- }
602
- if (
603
- item.contents &&
604
- item.contents.type === 'iframe' &&
605
- item.contents.blank
606
- ) {
607
- item.contents.name && (name = item.contents.name);
608
- url = this.handleUrlJoinParams(item.contents);
609
- }
610
- if (url) {
611
- reject();
612
- util.win.open(
613
- url,
614
- name,
615
- `width=${width}px,height=${height}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
616
- );
617
- } else {
618
- resolve();
619
- }
620
- });
621
- },
622
- handleSubmit(res) {
623
- if (this.submit) {
624
- if (this.submit.id) {
625
- let iframe = document.getElementById(this.submit.id); //先找到ifram
626
-
627
- if (this.submit.url) {
628
- let url = new URL(this.submit.url);
629
- let origin = url.origin;
630
- let _origin = util.win.location.origin;
631
- if (origin != _origin) {
632
- iframe.contentWindow.postMessage({ submit: res }, '*');
633
- return new Promise((resolve, reject) => {
634
- window.addEventListener('message', function (obj) {
635
- if (obj.origin == origin) {
636
- let results = obj.data;
637
- if (results.code == 0) {
638
- resolve();
639
- } else {
640
- reject();
641
- }
642
- }
643
- });
644
- });
645
- }
646
- }
647
- return iframe.contentWindow[this.submit.method](res); //用dom对象调用子页面的方法
648
- }
649
- }
650
- let esFlowForm = this.formRefs
651
- ? this.$refs[this.formRefs]
652
- : this.$refs.esFlowForm;
653
- if (Array.isArray(esFlowForm)) {
654
- esFlowForm = esFlowForm[0];
655
- }
656
- esFlowForm;
657
- this.showMsg = res == 1 ? false : true;
658
-
659
- if (this.otherValidate) {
660
- return new Promise((resolve, reject) => {
661
- esFlowForm
662
- .submitData(undefined, false, res, res === 1)
663
- .then(() => {
664
- // 如果submitData验证通过,则执行otherValidate验证
665
- this.otherValidate(resolve, reject);
666
- })
667
- .catch((error) => {
668
- // 处理submitData可能抛出的错误
669
- reject(error);
670
- });
671
- });
672
- }
673
- return esFlowForm.submitData(undefined, false, res, res === 1);
674
- },
675
- handleTaskRead(res) {
676
- if (res.data.taskExamine && res.data.taskExamine.appId) {
677
- this.taskExamineAppId = res.data.taskExamine.appId;
678
- this.injector &&
679
- this.injector.handleChangeData({ appId: this.taskExamineAppId });
680
- }
681
- },
682
- handleEndMessageChange(val) {
683
- this.$emit('endMessageChange', val);
684
- },
685
- handleSuccess() {
686
- let windowOpenConfig = sessionStorage.getItem('windowOpenConfig');
687
- if (this.closeWindow && windowOpenConfig) {
688
- util.busEmit(this, {
689
- method: 'windowClose',
690
- ...JSON.parse(windowOpenConfig)
691
- });
692
- try {
693
- const topWin = util.getWinTop();
694
- topWin.windowClose(JSON.parse(windowOpenConfig));
695
- } catch (error) {
696
- console.warn('Failed to call windowClose:', error);
697
- }
698
- } else if (this.closeDialog && this.esDialog) {
699
- this.esDialog.handleClose();
700
- } else {
701
- try {
702
- const topWin = util.getWinTop();
703
- if (topWin.COOS_SDK) {
704
- topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
705
- } else if (topWin.opener) {
706
- topWin.close();
707
- }
708
- } catch (error) {
709
- console.warn('Failed to close window/popup:', error);
710
- }
711
- }
712
- if (this.events && this.events.success) {
713
- this.events.success();
714
- }
715
- this.$emit('success');
716
- },
717
- handleSave(id, event) {
718
- let windowOpenConfig = sessionStorage.getItem('windowOpenConfig');
719
- if (this.closeWindow && windowOpenConfig) {
720
- util.busEmit(this, {
721
- method: 'windowClose',
722
- ...JSON.parse(windowOpenConfig)
723
- });
724
- try {
725
- const topWin = util.getWinTop();
726
- topWin.windowClose(JSON.parse(windowOpenConfig));
727
- } catch (error) {
728
- console.warn('Failed to call windowClose:', error);
729
- }
730
- } else if (this.closeDialog && this.esDialog) {
731
- this.esDialog.handleClose();
732
- } else {
733
- try {
734
- const topWin = util.getWinTop();
735
- if (topWin.COOS_SDK) {
736
- topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
737
- } else if (topWin.opener) {
738
- topWin.close();
739
- }
740
- } catch (error) {
741
- console.warn('Failed to close window/popup:', error);
742
- }
743
- }
744
- this.events && this.events.save(id, event);
745
- this.$emit('save', id, event);
746
- },
747
- handleChangeId(id) {
748
- this.businessId = id;
749
- },
750
- handleChangeData(res) {
751
- this.$emit('changeData', res);
752
- this.$emit('change-data', res);
753
- }
754
- }
755
- };
756
- </script>
1
+ <template>
2
+ <div class="es-flow-group" :class="{ 'is-hide-flow': !isShow }">
3
+ <div class="es-flow-group-main">
4
+ <el-tabs
5
+ class="es-flow-tabs es-tabs"
6
+ type="border-card"
7
+ v-model="activeName"
8
+ ref="tabs"
9
+ :before-leave="handleBefore"
10
+ >
11
+ <template v-for="(items, indexs) in tabs">
12
+ <el-tab-pane
13
+ v-if="handleHide(items.hide)"
14
+ :key="items.id || indexs"
15
+ :immediate="items.label === '流程图' ? false : items.immediate"
16
+ :name="String(indexs)"
17
+ :class="{ 'es-flex-vertical': items.average }"
18
+ >
19
+ <span
20
+ slot="label"
21
+ :style="{
22
+ color:
23
+ activeName == String(indexs) ? items.activeColor : items.color
24
+ }"
25
+ >
26
+ <template v-if="items.title">
27
+ <template v-if="typeof items.title === 'object'">
28
+ <i v-if="items.title.icon" :class="items.title.icon"></i>
29
+ <el-badge
30
+ v-if="items.title.count"
31
+ type="primary"
32
+ :value="items.title.count"
33
+ :color="items.title.color"
34
+ :max="99"
35
+ >{{ items.title.text }}
36
+ </el-badge>
37
+ <template v-else>{{ items.title.text }}</template>
38
+ </template>
39
+ <template v-else>{{ items.title }}</template>
40
+ </template>
41
+ <template>{{ items.label }}</template>
42
+ </span>
43
+ <es-tabs-panel v-bind="items" :show="activeName === String(indexs)">
44
+ <template
45
+ slot-scope="{ contents, average, data, title, show, isShow }"
46
+ >
47
+ <template v-if="Array.isArray(contents)">
48
+ <template v-for="(item, index) in contents">
49
+ <div class="es-tab-pane-list" :key="index" v-if="average">
50
+ <div class="es-tab-pane-main">
51
+ <es-flow-list
52
+ v-if="
53
+ item.type === 'flow-list' ||
54
+ item.type === 'flowList'
55
+ "
56
+ :businessId="businessId"
57
+ v-bind="
58
+ handleExclAttribute({
59
+ data: item,
60
+ attrs: ['events', 'visible', 'type']
61
+ })
62
+ "
63
+ :display="activeName === String(indexs)"
64
+ :key="'fl-' + index + '-' + flowListKey"
65
+ ></es-flow-list>
66
+ <es-data-table
67
+ v-if="
68
+ item.type === 'data-table' ||
69
+ item.type === 'dataTable'
70
+ "
71
+ :appId="taskExamineAppId"
72
+ v-bind="
73
+ handleExclAttribute({
74
+ data: item,
75
+ attrs: ['events', 'visible', 'type']
76
+ })
77
+ "
78
+ :class="{
79
+ 'es-flow-group-data-table':
80
+ item.type === 'data-table' ||
81
+ item.type === 'dataTable'
82
+ }"
83
+ :display="activeName === String(indexs)"
84
+ v-on="item.events"
85
+ >
86
+ <template v-if="item.dialog" slot="dialog">
87
+ <template v-if="Array.isArray(item.dialog)">
88
+ <es-dialog
89
+ v-for="(ele, ids) in item.dialog"
90
+ :isReload="true"
91
+ v-bind="ele"
92
+ :key="ids"
93
+ :visible.sync="ele.visible"
94
+ v-on="{ ...ele.events }"
95
+ >
96
+ </es-dialog>
97
+ </template>
98
+ <es-dialog
99
+ v-else
100
+ :isReload="true"
101
+ v-bind="item.dialog"
102
+ :visible.sync="item.dialog.visible"
103
+ v-on="{ ...item.dialog.events }"
104
+ >
105
+ </es-dialog>
106
+ </template>
107
+ </es-data-table>
108
+ <es-tree-group
109
+ v-if="
110
+ item.type === 'tree-group' ||
111
+ item.type === 'treeGroup'
112
+ "
113
+ :appId="taskExamineAppId"
114
+ v-bind="
115
+ handleExclAttribute({
116
+ data: item,
117
+ attrs: ['events', 'visible', 'type']
118
+ })
119
+ "
120
+ :display="activeName === String(indexs)"
121
+ v-on="{ ...item.events }"
122
+ ></es-tree-group>
123
+ <iframe
124
+ v-if="item.type === 'iframe' && !item.blank"
125
+ :id="item.id || item.name"
126
+ :name="item.name"
127
+ frameborder="0"
128
+ width="100%"
129
+ height="100%"
130
+ :src="handleUrlJoinParams(item)"
131
+ ></iframe>
132
+ <es-upload
133
+ v-if="item.type === 'attachment'"
134
+ :file-count.sync="title.count"
135
+ height="auto"
136
+ class="es-attachment"
137
+ :ownId="businessId"
138
+ v-bind="
139
+ handleExclAttribute({
140
+ data: item,
141
+ attrs: ['events', 'type']
142
+ })
143
+ "
144
+ :display="activeName === String(indexs)"
145
+ v-on="{ ...item.events }"
146
+ ></es-upload>
147
+ </div>
148
+ </div>
149
+ <template v-else>
150
+ <es-form
151
+ v-if="item.type === 'form'"
152
+ ref="esFlowForm"
153
+ :showMsg="showMsg"
154
+ v-bind="
155
+ handleExclAttribute({
156
+ data: item,
157
+ attrs: ['events', 'visible', 'type', 'model', 'ref']
158
+ })
159
+ "
160
+ full
161
+ :key="index"
162
+ :autoId="true"
163
+ :show-button="false"
164
+ :closeDialog="false"
165
+ :display="activeName === String(indexs)"
166
+ :model="item.model"
167
+ :businessId.sync="businessId"
168
+ v-on="{ ...item.events }"
169
+ ></es-form>
170
+ <es-flow-list
171
+ v-if="
172
+ item.type === 'flow-list' || item.type === 'flowList'
173
+ "
174
+ :businessId="businessId"
175
+ v-bind="
176
+ handleExclAttribute({
177
+ data: item,
178
+ attrs: ['events', 'visible', 'type']
179
+ })
180
+ "
181
+ :display="activeName === String(indexs)"
182
+ :key="'fl-' + index + '-' + flowListKey"
183
+ ></es-flow-list>
184
+ <es-data-table
185
+ v-if="
186
+ item.type === 'data-table' ||
187
+ item.type === 'dataTable'
188
+ "
189
+ :appId="taskExamineAppId"
190
+ v-bind="
191
+ handleExclAttribute({
192
+ data: item,
193
+ attrs: ['events', 'visible', 'type']
194
+ })
195
+ "
196
+ :key="index"
197
+ :class="{
198
+ 'es-flow-group-data-table':
199
+ item.type === 'data-table' ||
200
+ item.type === 'dataTable'
201
+ }"
202
+ :display="activeName === String(indexs)"
203
+ v-on="item.events"
204
+ >
205
+ <template v-if="item.dialog" slot="dialog">
206
+ <template v-if="Array.isArray(item.dialog)">
207
+ <es-dialog
208
+ v-for="(ele, ids) in item.dialog"
209
+ :isReload="true"
210
+ v-bind="ele"
211
+ :key="ids"
212
+ :visible.sync="ele.visible"
213
+ v-on="{ ...ele.events }"
214
+ >
215
+ </es-dialog>
216
+ </template>
217
+ <es-dialog
218
+ v-else
219
+ :isReload="true"
220
+ v-bind="item.dialog"
221
+ :visible.sync="item.dialog.visible"
222
+ v-on="{ ...item.dialog.events }"
223
+ >
224
+ </es-dialog>
225
+ </template>
226
+ </es-data-table>
227
+ <es-tree-group
228
+ v-if="
229
+ item.type === 'tree-group' ||
230
+ item.type === 'treeGroup'
231
+ "
232
+ :appId="taskExamineAppId"
233
+ v-bind="
234
+ handleExclAttribute({
235
+ data: item,
236
+ attrs: ['events', 'visible', 'type']
237
+ })
238
+ "
239
+ :key="index"
240
+ :display="activeName === String(indexs)"
241
+ v-on="{ ...item.events }"
242
+ ></es-tree-group>
243
+ <iframe
244
+ v-if="item.type === 'iframe' && !item.blank"
245
+ frameborder="0"
246
+ width="100%"
247
+ height="100%"
248
+ :key="index"
249
+ :id="item.id || item.name"
250
+ :name="item.name"
251
+ :src="handleUrlJoinParams(item)"
252
+ ></iframe>
253
+ <es-upload
254
+ v-if="item.type === 'attachment'"
255
+ height="auto"
256
+ class="es-attachment"
257
+ :ownId="businessId"
258
+ v-bind="
259
+ handleExclAttribute({
260
+ data: item,
261
+ attrs: ['events', 'type']
262
+ })
263
+ "
264
+ :key="index"
265
+ :file-count.sync="title.count"
266
+ :display="activeName === String(indexs)"
267
+ v-on="{ ...item.events }"
268
+ ></es-upload>
269
+ <es-dialog
270
+ v-if="
271
+ item.type === 'dialog' &&
272
+ activeName === String(indexs)
273
+ "
274
+ :isReload="true"
275
+ v-bind="item"
276
+ :key="index"
277
+ :visible.sync="item.visible"
278
+ v-on="{ ...item.events }"
279
+ >
280
+ </es-dialog>
281
+ <component
282
+ v-if="item.component || item.type == 'component'"
283
+ :is="item.is || item.type"
284
+ show
285
+ isShow
286
+ v-bind="
287
+ handleExclAttribute({
288
+ data: item,
289
+ attrs: ['is', 'type']
290
+ })
291
+ "
292
+ ></component>
293
+ </template>
294
+ </template>
295
+ </template>
296
+ <template v-else>
297
+ <component
298
+ v-if="contents.component || contents.type == 'component'"
299
+ :is="contents.is || contents.type"
300
+ show
301
+ isShow
302
+ v-bind="
303
+ handleExclAttribute({
304
+ data: contents,
305
+ attrs: ['is', 'type']
306
+ })
307
+ "
308
+ ></component>
309
+ <es-form
310
+ v-if="contents.type === 'form'"
311
+ :show-button="false"
312
+ ref="esFlowForm"
313
+ :showMsg="showMsg"
314
+ v-bind="
315
+ handleExclAttribute({
316
+ data: contents,
317
+ attrs: ['events', 'visible', 'type', 'model', 'ref']
318
+ })
319
+ "
320
+ full
321
+ :autoId="true"
322
+ :businessId.sync="businessId"
323
+ :closeDialog="false"
324
+ :display="activeName === String(indexs)"
325
+ :model="contents.model"
326
+ v-on="{ ...contents.events }"
327
+ ></es-form>
328
+ <es-flow-list
329
+ v-if="
330
+ contents.type === 'flow-list' ||
331
+ contents.type === 'flowList'
332
+ "
333
+ :businessId="businessId"
334
+ v-bind="
335
+ handleExclAttribute({
336
+ data: contents,
337
+ attrs: ['events', 'visible', 'type']
338
+ })
339
+ "
340
+ :display="activeName === String(indexs)"
341
+ :key="'fl-' + flowListKey"
342
+ ></es-flow-list>
343
+ <es-data-table
344
+ v-if="
345
+ contents.type === 'data-table' ||
346
+ contents.type === 'dataTable'
347
+ "
348
+ :appId="taskExamineAppId"
349
+ v-bind="
350
+ handleExclAttribute({
351
+ data: contents,
352
+ attrs: ['events', 'visible', 'type']
353
+ })
354
+ "
355
+ :class="{
356
+ 'es-flow-group-data-table':
357
+ contents.type === 'data-table' ||
358
+ contents.type === 'dataTable'
359
+ }"
360
+ :display="activeName === String(indexs)"
361
+ v-on="contents.events"
362
+ >
363
+ <template v-if="contents.dialog" slot="dialog">
364
+ <template v-if="Array.isArray(contents.dialog)">
365
+ <es-dialog
366
+ v-for="(ele, ids) in contents.dialog"
367
+ :isReload="true"
368
+ v-bind="ele"
369
+ :key="ids"
370
+ :visible.sync="ele.visible"
371
+ v-on="{ ...ele.events }"
372
+ >
373
+ </es-dialog>
374
+ </template>
375
+ <es-dialog
376
+ v-else
377
+ :isReload="true"
378
+ v-bind="contents.dialog"
379
+ :visible.sync="contents.dialog.visible"
380
+ v-on="{ ...contents.dialog.events }"
381
+ >
382
+ </es-dialog>
383
+ </template>
384
+ </es-data-table>
385
+ <es-tree-group
386
+ v-if="
387
+ contents.type === 'tree-group' ||
388
+ contents.type === 'treeGroup'
389
+ "
390
+ :appId="taskExamineAppId"
391
+ v-bind="
392
+ handleExclAttribute({
393
+ data: contents,
394
+ attrs: ['events', 'visible', 'type']
395
+ })
396
+ "
397
+ :display="activeName === String(indexs)"
398
+ v-on="{ ...contents.events }"
399
+ ></es-tree-group>
400
+ <iframe
401
+ v-if="contents.type === 'iframe' && !contents.blank"
402
+ :id="contents.id || contents.name"
403
+ :name="contents.name"
404
+ frameborder="0"
405
+ width="100%"
406
+ height="100%"
407
+ :src="handleUrlJoinParams(contents)"
408
+ ></iframe>
409
+ <es-upload
410
+ v-if="contents.type === 'attachment'"
411
+ :ownId="businessId"
412
+ v-bind="
413
+ handleExclAttribute({
414
+ data: contents,
415
+ attrs: ['events', 'type']
416
+ })
417
+ "
418
+ :file-count.sync="title.count"
419
+ :display="activeName === String(indexs)"
420
+ height="auto"
421
+ class="es-attachment"
422
+ v-on="{ ...contents.events }"
423
+ ></es-upload>
424
+ </template>
425
+ </template>
426
+ </es-tabs-panel>
427
+ </el-tab-pane>
428
+ </template>
429
+ </el-tabs>
430
+ </div>
431
+ <es-flow
432
+ v-if="isShow"
433
+ class="es-group-flow"
434
+ v-bind="_flow"
435
+ :width="width"
436
+ :before-submit="isSubmit ? handleSubmit : undefined"
437
+ :businessId="businessId"
438
+ @startTaskRead="handleTaskRead"
439
+ @success="handleSuccess"
440
+ @save="handleSave"
441
+ @endMessageChange="handleEndMessageChange"
442
+ @successRead="handleSuccessRead"
443
+ :closeParent="closeParent"
444
+ ></es-flow>
445
+ <slot></slot>
446
+ </div>
447
+ </template>
448
+ <script>
449
+ import util from 'eoss-ui/src/utils/util';
450
+ export default {
451
+ name: 'EsFlowGroup',
452
+ inject: {
453
+ esDialog: {
454
+ default: ''
455
+ },
456
+ injector: {
457
+ default: ''
458
+ }
459
+ },
460
+ props: {
461
+ // autoId: {
462
+ // type: Boolean,
463
+ // default: true
464
+ // },
465
+ active: {
466
+ type: String,
467
+ default: '0'
468
+ },
469
+ contents: Array,
470
+ closeWindow: Boolean,
471
+ closeDialog: {
472
+ type: Boolean,
473
+ default: true
474
+ },
475
+ otherValidate: Function,
476
+ flow: Object,
477
+ events: Object,
478
+ recordid: String,
479
+ pendingId: String,
480
+ arcurl: String,
481
+ itemname: String,
482
+ show: {
483
+ type: Boolean,
484
+ default: true
485
+ },
486
+ closeParent: {
487
+ type: Boolean,
488
+ default: true
489
+ },
490
+ appId: String,
491
+ zoom: false,
492
+ width: {
493
+ type: String,
494
+ default: '360px'
495
+ },
496
+ refs: String,
497
+ isSubmit: {
498
+ type: Boolean,
499
+ default: true
500
+ }
501
+ },
502
+ data() {
503
+ return {
504
+ activeName: this.active,
505
+ businessId: undefined,
506
+ taskExamineAppId: this.appId,
507
+ showMsg: true,
508
+ formRefs: this.refs,
509
+ submits: null,
510
+ flowListKey: 0
511
+ };
512
+ },
513
+ computed: {
514
+ tabs() {
515
+ return this.contents ? this.contents : [];
516
+ },
517
+ isShow() {
518
+ if (
519
+ this.flow &&
520
+ Object.prototype.hasOwnProperty.call(this.flow, 'show')
521
+ ) {
522
+ return this.flow.show;
523
+ }
524
+ let flow = util.getParams({ name: 'flow' });
525
+ if (flow == 0) {
526
+ return false;
527
+ }
528
+ return this.show;
529
+ },
530
+ _flow() {
531
+ return !this.flow.pendingId
532
+ ? { ...this.flow, pendingId: this.pendingId }
533
+ : this.flow;
534
+ }
535
+ },
536
+ watch: {
537
+ activeName(val) {
538
+ this.$emit('update:active', val);
539
+ },
540
+ businessId(val) {
541
+ this.handleChangeData({ businessId: val });
542
+ }
543
+ },
544
+ created() {
545
+ if (this.flow.businessId || this.flow.pendingId) {
546
+ this.businessId = this.flow.businessId || this.flow.pendingId;
547
+ }
548
+ },
549
+ mounted() {},
550
+ methods: {
551
+ handleSuccessRead() {
552
+ this.flowListKey++;
553
+ },
554
+ handleHide(res) {
555
+ return typeof res === 'boolean'
556
+ ? !res
557
+ : typeof res === 'string'
558
+ ? this[res]
559
+ : true;
560
+ },
561
+ handleExclAttribute({ data, attrs }) {
562
+ if (!attrs || !attrs.length) {
563
+ this.ref && (this.formRefs = this.ref);
564
+ return data;
565
+ }
566
+ return util.exclAttribute({
567
+ data: data,
568
+ attrs: attrs
569
+ });
570
+ },
571
+ handleUrlJoinParams(res, flag = true) {
572
+ let url = res.url;
573
+ if (flag) {
574
+ if (res.method) {
575
+ this.submit = {
576
+ id: res.id,
577
+ url: url,
578
+ method: typeof res.method === 'boolean' ? 'submit' : res.method
579
+ };
580
+ }
581
+ }
582
+ let param = util.extend(
583
+ {},
584
+ { id: this.businessId, appId: this.taskExamineAppId },
585
+ res.param || {}
586
+ );
587
+ return util.urlJoinParams({ url, param });
588
+ },
589
+ handleBefore(active, old) {
590
+ return new Promise((resolve, reject) => {
591
+ let n = parseInt(active, 10);
592
+ let item = this.tabs[n];
593
+ let url = null;
594
+ let name = item.name;
595
+ let width = 0;
596
+ let height = 0;
597
+ width = util.win.screen.availWidth - 10;
598
+ height = util.win.screen.availHeight - 60;
599
+ if (item.url) {
600
+ url = this.handleUrlJoinParams(item);
601
+ }
602
+ if (
603
+ item.contents &&
604
+ item.contents.type === 'iframe' &&
605
+ item.contents.blank
606
+ ) {
607
+ item.contents.name && (name = item.contents.name);
608
+ url = this.handleUrlJoinParams(item.contents);
609
+ }
610
+ if (url) {
611
+ reject();
612
+ util.win.open(
613
+ url,
614
+ name,
615
+ `width=${width}px,height=${height}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
616
+ );
617
+ } else {
618
+ resolve();
619
+ }
620
+ });
621
+ },
622
+ handleSubmit(res) {
623
+ if (this.submit) {
624
+ if (this.submit.id) {
625
+ let iframe = document.getElementById(this.submit.id); //先找到ifram
626
+
627
+ if (this.submit.url) {
628
+ let url = new URL(this.submit.url);
629
+ let origin = url.origin;
630
+ let _origin = util.win.location.origin;
631
+ if (origin != _origin) {
632
+ iframe.contentWindow.postMessage({ submit: res }, '*');
633
+ return new Promise((resolve, reject) => {
634
+ window.addEventListener('message', function (obj) {
635
+ if (obj.origin == origin) {
636
+ let results = obj.data;
637
+ if (results.code == 0) {
638
+ resolve();
639
+ } else {
640
+ reject();
641
+ }
642
+ }
643
+ });
644
+ });
645
+ }
646
+ }
647
+ return iframe.contentWindow[this.submit.method](res); //用dom对象调用子页面的方法
648
+ }
649
+ }
650
+ let esFlowForm = this.formRefs
651
+ ? this.$refs[this.formRefs]
652
+ : this.$refs.esFlowForm;
653
+ if (Array.isArray(esFlowForm)) {
654
+ esFlowForm = esFlowForm[0];
655
+ }
656
+ esFlowForm;
657
+ this.showMsg = res == 1 ? false : true;
658
+
659
+ if (this.otherValidate) {
660
+ return new Promise((resolve, reject) => {
661
+ esFlowForm
662
+ .submitData(undefined, false, res, res === 1)
663
+ .then(() => {
664
+ // 如果submitData验证通过,则执行otherValidate验证
665
+ this.otherValidate(resolve, reject);
666
+ })
667
+ .catch((error) => {
668
+ // 处理submitData可能抛出的错误
669
+ reject(error);
670
+ });
671
+ });
672
+ }
673
+ return esFlowForm.submitData(undefined, false, res, res === 1);
674
+ },
675
+ handleTaskRead(res) {
676
+ if (res.data.taskExamine && res.data.taskExamine.appId) {
677
+ this.taskExamineAppId = res.data.taskExamine.appId;
678
+ this.injector &&
679
+ this.injector.handleChangeData({ appId: this.taskExamineAppId });
680
+ }
681
+ },
682
+ handleEndMessageChange(val) {
683
+ this.$emit('endMessageChange', val);
684
+ },
685
+ handleSuccess() {
686
+ let windowOpenConfig = sessionStorage.getItem('windowOpenConfig');
687
+ if (this.closeWindow && windowOpenConfig) {
688
+ util.busEmit(this, {
689
+ method: 'windowClose',
690
+ ...JSON.parse(windowOpenConfig)
691
+ });
692
+ try {
693
+ const topWin = util.getWinTop();
694
+ topWin.windowClose(JSON.parse(windowOpenConfig));
695
+ } catch (error) {
696
+ console.warn('Failed to call windowClose:', error);
697
+ }
698
+ } else if (this.closeDialog && this.esDialog) {
699
+ this.esDialog.handleClose();
700
+ } else {
701
+ try {
702
+ const topWin = util.getWinTop();
703
+ if (topWin.COOS_SDK) {
704
+ topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
705
+ } else if (topWin.opener) {
706
+ topWin.close();
707
+ }
708
+ } catch (error) {
709
+ console.warn('Failed to close window/popup:', error);
710
+ }
711
+ }
712
+ if (this.events && this.events.success) {
713
+ this.events.success();
714
+ }
715
+ this.$emit('success');
716
+ },
717
+ handleSave(id, event) {
718
+ let windowOpenConfig = sessionStorage.getItem('windowOpenConfig');
719
+ if (this.closeWindow && windowOpenConfig) {
720
+ util.busEmit(this, {
721
+ method: 'windowClose',
722
+ ...JSON.parse(windowOpenConfig)
723
+ });
724
+ try {
725
+ const topWin = util.getWinTop();
726
+ topWin.windowClose(JSON.parse(windowOpenConfig));
727
+ } catch (error) {
728
+ console.warn('Failed to call windowClose:', error);
729
+ }
730
+ } else if (this.closeDialog && this.esDialog) {
731
+ this.esDialog.handleClose();
732
+ } else {
733
+ try {
734
+ const topWin = util.getWinTop();
735
+ if (topWin.COOS_SDK) {
736
+ topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
737
+ } else if (topWin.opener) {
738
+ topWin.close();
739
+ }
740
+ } catch (error) {
741
+ console.warn('Failed to close window/popup:', error);
742
+ }
743
+ }
744
+ this.events && this.events.save(id, event);
745
+ this.$emit('save', id, event);
746
+ },
747
+ handleChangeId(id) {
748
+ this.businessId = id;
749
+ },
750
+ handleChangeData(res) {
751
+ this.$emit('changeData', res);
752
+ this.$emit('change-data', res);
753
+ }
754
+ }
755
+ };
756
+ </script>