eoss-ui 0.6.18 → 0.6.20

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 (101) hide show
  1. package/lib/eoss-ui.common.js +761 -657
  2. package/lib/flow.js +619 -515
  3. package/lib/index.js +1 -1
  4. package/lib/main.js +132 -132
  5. package/lib/qr-code.js +13 -13
  6. package/lib/theme-chalk/index.css +1 -1
  7. package/lib/theme-chalk/login.css +1 -1
  8. package/package.json +157 -157
  9. package/packages/button/src/main.vue +418 -418
  10. package/packages/button-group/src/main.vue +298 -298
  11. package/packages/checkbox-group/src/main.vue +333 -333
  12. package/packages/clients/src/main.vue +144 -144
  13. package/packages/data-table/src/children.vue +39 -39
  14. package/packages/data-table/src/column.vue +983 -983
  15. package/packages/data-table/src/main.vue +1812 -1812
  16. package/packages/data-table/src/sizer.vue +195 -195
  17. package/packages/date-picker/src/main.vue +236 -236
  18. package/packages/flow/src/component/CustomPreset.vue +1 -1
  19. package/packages/flow/src/component/Preset.vue +1 -1
  20. package/packages/flow/src/component/SendMsg.vue +3 -1
  21. package/packages/flow/src/component/taskUnionExamine.vue +38 -20
  22. package/packages/flow/src/main.vue +2731 -2711
  23. package/packages/flow/src/processForm.vue +13 -2
  24. package/packages/flow/src/processReject.vue +14 -3
  25. package/packages/flow/src/startTaskRead.vue +23 -5
  26. package/packages/flow-group/src/main.vue +684 -684
  27. package/packages/form/src/main.vue +3582 -3582
  28. package/packages/form/src/table.vue +1420 -1420
  29. package/packages/handle-user/src/main.vue +134 -134
  30. package/packages/handler/src/main.vue +374 -374
  31. package/packages/icon/src/main.vue +101 -101
  32. package/packages/input/src/main.vue +356 -356
  33. package/packages/login/src/main.vue +1851 -1851
  34. package/packages/login/src/resetPassword.vue +557 -557
  35. package/packages/main/src/default/message.vue +249 -249
  36. package/packages/main/src/default/notice.vue +157 -157
  37. package/packages/main/src/default/userinfo.vue +494 -494
  38. package/packages/main/src/public/online.vue +89 -89
  39. package/packages/main/src/public/search.vue +454 -454
  40. package/packages/main/src/public/settings.vue +221 -221
  41. package/packages/main/src/simplicity/apps.vue +388 -388
  42. package/packages/main/src/simplicity/avatar.vue +82 -82
  43. package/packages/main/src/simplicity/handler.vue +183 -183
  44. package/packages/main/src/simplicity/index.vue +1930 -1930
  45. package/packages/main/src/simplicity/lists.vue +84 -84
  46. package/packages/main/src/simplicity/menu-list.vue +128 -128
  47. package/packages/main/src/simplicity/message.vue +259 -259
  48. package/packages/main/src/simplicity/notice.vue +190 -190
  49. package/packages/main/src/simplicity/router-page.vue +45 -45
  50. package/packages/main/src/simplicity/sub-menu.vue +241 -241
  51. package/packages/main/src/simplicity/user.vue +248 -248
  52. package/packages/main/src/simplicity/userinfo.vue +304 -304
  53. package/packages/menu/src/main.vue +536 -536
  54. package/packages/pagination/src/main.vue +96 -96
  55. package/packages/qr-code/src/main.vue +170 -170
  56. package/packages/radio-group/src/main.vue +319 -319
  57. package/packages/select/src/main.vue +761 -761
  58. package/packages/selector/src/main.vue +677 -677
  59. package/packages/selector-panel/src/main.vue +1020 -1020
  60. package/packages/selector-panel/src/selection.vue +160 -160
  61. package/packages/tabs/src/main.vue +788 -788
  62. package/packages/theme-chalk/lib/index.css +1 -1
  63. package/packages/theme-chalk/lib/login.css +1 -1
  64. package/packages/theme-chalk/src/base.scss +260 -260
  65. package/packages/theme-chalk/src/button-group.scss +175 -175
  66. package/packages/theme-chalk/src/calendar.scss +113 -113
  67. package/packages/theme-chalk/src/clients.scss +87 -87
  68. package/packages/theme-chalk/src/common/var.scss +1 -4
  69. package/packages/theme-chalk/src/data-table.scss +276 -276
  70. package/packages/theme-chalk/src/dialog.scss +77 -77
  71. package/packages/theme-chalk/src/flow-group.scss +110 -110
  72. package/packages/theme-chalk/src/form.scss +496 -496
  73. package/packages/theme-chalk/src/handler.scss +133 -133
  74. package/packages/theme-chalk/src/icon.scss +1745 -1745
  75. package/packages/theme-chalk/src/icons.scss +99 -99
  76. package/packages/theme-chalk/src/login.scss +917 -926
  77. package/packages/theme-chalk/src/main.scss +632 -632
  78. package/packages/theme-chalk/src/menu.scss +222 -222
  79. package/packages/theme-chalk/src/nav.scss +125 -125
  80. package/packages/theme-chalk/src/pagination.scss +29 -29
  81. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  82. package/packages/theme-chalk/src/simplicity.scss +1246 -1246
  83. package/packages/theme-chalk/src/tabs.scss +87 -87
  84. package/packages/theme-chalk/src/toolbar.scss +179 -179
  85. package/packages/theme-chalk/src/tree-group.scss +72 -72
  86. package/packages/theme-chalk/src/tree.scss +165 -165
  87. package/packages/upload/src/main.vue +1313 -1313
  88. package/packages/wujie/src/main.vue +145 -145
  89. package/src/config/api.js +236 -236
  90. package/src/config/image.js +2 -2
  91. package/src/index.js +157 -157
  92. package/packages/.DS_Store +0 -0
  93. package/packages/checkbox-group/.DS_Store +0 -0
  94. package/packages/data-table/.DS_Store +0 -0
  95. package/packages/dialog/.DS_Store +0 -0
  96. package/packages/handler/.DS_Store +0 -0
  97. package/packages/login/.DS_Store +0 -0
  98. package/packages/main/.DS_Store +0 -0
  99. package/packages/main/src/.DS_Store +0 -0
  100. package/packages/theme-chalk/src/.DS_Store +0 -0
  101. package/src/.DS_Store +0 -0
@@ -1,684 +1,684 @@
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="index"
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="index"
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
- v-bind="
285
- handleExclAttribute({
286
- data: item,
287
- attrs: ['is', 'type']
288
- })
289
- "
290
- ></component>
291
- </template>
292
- </template>
293
- </template>
294
- <template v-else>
295
- <component
296
- v-if="contents.component || contents.type == 'component'"
297
- :is="contents.is || contents.type"
298
- v-bind="
299
- handleExclAttribute({
300
- data: contents,
301
- attrs: ['is', 'type']
302
- })
303
- "
304
- ></component>
305
- <es-form
306
- v-if="contents.type === 'form'"
307
- :show-button="false"
308
- ref="esFlowForm"
309
- :showMsg="showMsg"
310
- v-bind="
311
- handleExclAttribute({
312
- data: contents,
313
- attrs: ['events', 'visible', 'type', 'model', 'ref']
314
- })
315
- "
316
- full
317
- :autoId="true"
318
- :businessId.sync="businessId"
319
- :closeDialog="false"
320
- :display="activeName === String(indexs)"
321
- :model="contents.model"
322
- v-on="{ ...contents.events }"
323
- ></es-form>
324
- <es-flow-list
325
- v-if="
326
- contents.type === 'flow-list' ||
327
- contents.type === 'flowList'
328
- "
329
- :businessId="businessId"
330
- v-bind="
331
- handleExclAttribute({
332
- data: contents,
333
- attrs: ['events', 'visible', 'type']
334
- })
335
- "
336
- :display="activeName === String(indexs)"
337
- ></es-flow-list>
338
- <es-data-table
339
- v-if="
340
- contents.type === 'data-table' ||
341
- contents.type === 'dataTable'
342
- "
343
- :appId="taskExamineAppId"
344
- v-bind="
345
- handleExclAttribute({
346
- data: contents,
347
- attrs: ['events', 'visible', 'type']
348
- })
349
- "
350
- :class="{
351
- 'es-flow-group-data-table':
352
- contents.type === 'data-table' ||
353
- contents.type === 'dataTable'
354
- }"
355
- :display="activeName === String(indexs)"
356
- v-on="contents.events"
357
- >
358
- <template v-if="contents.dialog" slot="dialog">
359
- <template v-if="Array.isArray(contents.dialog)">
360
- <es-dialog
361
- v-for="(ele, ids) in contents.dialog"
362
- :isReload="true"
363
- v-bind="ele"
364
- :key="ids"
365
- :visible.sync="ele.visible"
366
- v-on="{ ...ele.events }"
367
- >
368
- </es-dialog>
369
- </template>
370
- <es-dialog
371
- v-else
372
- :isReload="true"
373
- v-bind="contents.dialog"
374
- :visible.sync="contents.dialog.visible"
375
- v-on="{ ...contents.dialog.events }"
376
- >
377
- </es-dialog>
378
- </template>
379
- </es-data-table>
380
- <es-tree-group
381
- v-if="
382
- contents.type === 'tree-group' ||
383
- contents.type === 'treeGroup'
384
- "
385
- :appId="taskExamineAppId"
386
- v-bind="
387
- handleExclAttribute({
388
- data: contents,
389
- attrs: ['events', 'visible', 'type']
390
- })
391
- "
392
- :display="activeName === String(indexs)"
393
- v-on="{ ...contents.events }"
394
- ></es-tree-group>
395
- <iframe
396
- v-if="contents.type === 'iframe' && !contents.blank"
397
- :id="contents.id || contents.name"
398
- :name="contents.name"
399
- frameborder="0"
400
- width="100%"
401
- height="100%"
402
- :src="handleUrlJoinParams(contents)"
403
- ></iframe>
404
- <es-upload
405
- v-if="contents.type === 'attachment'"
406
- :ownId="businessId"
407
- v-bind="
408
- handleExclAttribute({
409
- data: contents,
410
- attrs: ['events', 'type']
411
- })
412
- "
413
- :file-count.sync="title.count"
414
- :display="activeName === String(indexs)"
415
- height="auto"
416
- class="es-attachment"
417
- v-on="{ ...contents.events }"
418
- ></es-upload>
419
- </template>
420
- </template>
421
- </es-tabs-panel>
422
- </el-tab-pane>
423
- </template>
424
- </el-tabs>
425
- </div>
426
- <es-flow
427
- v-if="isShow"
428
- class="es-group-flow"
429
- v-bind="_flow"
430
- :width="width"
431
- :before-submit="isSubmit ? handleSubmit : undefined"
432
- :businessId="businessId"
433
- @startTaskRead="handleTaskRead"
434
- @success="handleSuccess"
435
- @save="handleSave"
436
- :closeParent="closeParent"
437
- ></es-flow>
438
- <slot></slot>
439
- </div>
440
- </template>
441
- <script>
442
- import util from 'eoss-ui/src/utils/util';
443
- export default {
444
- name: 'EsFlowGroup',
445
- inject: {
446
- esDialog: {
447
- default: ''
448
- },
449
- injector: {
450
- default: ''
451
- }
452
- },
453
- props: {
454
- // autoId: {
455
- // type: Boolean,
456
- // default: true
457
- // },
458
- active: {
459
- type: String,
460
- default: '0'
461
- },
462
- contents: Array,
463
- closeDialog: {
464
- type: Boolean,
465
- default: true
466
- },
467
- flow: Object,
468
- events: Object,
469
- recordid: String,
470
- pendingId: String,
471
- arcurl: String,
472
- itemname: String,
473
- show: {
474
- type: Boolean,
475
- default: true
476
- },
477
- closeParent: {
478
- type: Boolean,
479
- default: true
480
- },
481
- appId: String,
482
- zoom: false,
483
- width: {
484
- type: String,
485
- default: '360px'
486
- },
487
- refs: String,
488
- isSubmit: {
489
- type: Boolean,
490
- default: true
491
- }
492
- },
493
- data() {
494
- return {
495
- activeName: this.active,
496
- businessId: undefined,
497
- taskExamineAppId: this.appId,
498
- showMsg: true,
499
- formRefs: this.refs,
500
- submits: null
501
- };
502
- },
503
- computed: {
504
- tabs() {
505
- return this.contents ? this.contents : [];
506
- },
507
- isShow() {
508
- if (
509
- this.flow &&
510
- Object.prototype.hasOwnProperty.call(this.flow, 'show')
511
- ) {
512
- return this.flow.show;
513
- }
514
- let flow = util.getParams({ name: 'flow' });
515
- if (flow == 0) {
516
- return false;
517
- }
518
- return this.show;
519
- },
520
- _flow() {
521
- return !this.flow.pendingId
522
- ? { ...this.flow, pendingId: this.pendingId }
523
- : this.flow;
524
- }
525
- },
526
- watch: {
527
- activeName(val) {
528
- this.$emit('update:active', val);
529
- },
530
- businessId(val) {
531
- this.handleChangeData({ businessId: val });
532
- }
533
- },
534
- created() {
535
- if (this.flow.businessId || this.flow.pendingId) {
536
- this.businessId = this.flow.businessId || this.flow.pendingId;
537
- }
538
- },
539
- mounted() {},
540
- methods: {
541
- handleHide(res) {
542
- return typeof res === 'boolean'
543
- ? !res
544
- : typeof res === 'string'
545
- ? this[res]
546
- : true;
547
- },
548
- handleExclAttribute({ data, attrs }) {
549
- if (!attrs || !attrs.length) {
550
- this.ref && (this.formRefs = this.ref);
551
- return data;
552
- }
553
- return util.exclAttribute({
554
- data: data,
555
- attrs: attrs
556
- });
557
- },
558
- handleUrlJoinParams(res, flag = true) {
559
- let url = res.url;
560
- if (flag) {
561
- if (res.method) {
562
- this.submit = {
563
- id: res.id,
564
- url: url,
565
- method: typeof res.method === 'boolean' ? 'submit' : res.method
566
- };
567
- }
568
- }
569
- let param = util.extend(
570
- {},
571
- { id: this.businessId, appId: this.taskExamineAppId },
572
- res.param || {}
573
- );
574
- return util.urlJoinParams({ url, param });
575
- },
576
- handleBefore(active, old) {
577
- return new Promise((resolve, reject) => {
578
- let n = parseInt(active, 10);
579
- let item = this.tabs[n];
580
- let url = null;
581
- let name = item.name;
582
- let width = 0;
583
- let height = 0;
584
- let win = util.win.top;
585
- width = win.screen.availWidth - 10;
586
- height = win.screen.availHeight - 60;
587
- if (item.url) {
588
- url = this.handleUrlJoinParams(item);
589
- }
590
- if (
591
- item.contents &&
592
- item.contents.type === 'iframe' &&
593
- item.contents.blank
594
- ) {
595
- item.contents.name && (name = item.contents.name);
596
- url = this.handleUrlJoinParams(item.contents);
597
- }
598
- if (url) {
599
- reject();
600
- util.win.open(
601
- url,
602
- name,
603
- `width=${width}px,height=${height}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
604
- );
605
- } else {
606
- resolve();
607
- }
608
- });
609
- },
610
- handleSubmit(res) {
611
- if (this.submit) {
612
- if (this.submit.id) {
613
- let iframe = document.getElementById(this.submit.id); //先找到ifram
614
-
615
- if (this.submit.url) {
616
- let url = new URL(this.submit.url);
617
- let origin = url.origin;
618
- let _origin = util.win.location.origin;
619
- if (origin != _origin) {
620
- iframe.postMessage({ submit: res }, '*');
621
- return new Promise((resolve, reject) => {
622
- window.addEventListener('message', function (obj) {
623
- if (obj.origin == origin) {
624
- let results = obj.data;
625
- if (results.code == 0) {
626
- resolve();
627
- } else {
628
- reject();
629
- }
630
- }
631
- });
632
- });
633
- }
634
- }
635
- return iframe.contentWindow[this.submit.method](res); //用dom对象调用子页面的方法
636
- }
637
- }
638
- let esFlowForm = this.formRefs
639
- ? this.$refs[this.formRefs]
640
- : this.$refs.esFlowForm;
641
- if (Array.isArray(esFlowForm)) {
642
- esFlowForm = esFlowForm[0];
643
- }
644
- esFlowForm;
645
- this.showMsg = res == 1 ? false : true;
646
- return esFlowForm.submitData(undefined, false, {}, res);
647
- },
648
- handleTaskRead(res) {
649
- if (res.data.taskExamine && res.data.taskExamine.appId) {
650
- this.taskExamineAppId = res.data.taskExamine.appId;
651
- this.injector &&
652
- this.injector.handleChangeData({ appId: this.taskExamineAppId });
653
- }
654
- },
655
- handleSuccess() {
656
- if (this.closeDialog && this.esDialog) {
657
- this.esDialog.handleClose();
658
- } else if (util.win.top.COOS_SDK) {
659
- util.win.top.COOS_SDK.closePopup && util.win.top.COOS_SDK.closePopup();
660
- } else if (util.win.top.opener) {
661
- util.win.top.close();
662
- }
663
- if (this.events && this.events.success) {
664
- this.events.success();
665
- }
666
- this.$emit('success');
667
- },
668
- handleSave(id, event) {
669
- if (this.closeDialog && this.esDialog) {
670
- this.esDialog.handleClose();
671
- }
672
- this.events && this.events.save(id, event);
673
- this.$emit('save', id, event);
674
- },
675
- handleChangeId(id) {
676
- this.businessId = id;
677
- },
678
- handleChangeData(res) {
679
- this.$emit('changeData', res);
680
- this.$emit('change-data', res);
681
- }
682
- }
683
- };
684
- </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="index"
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="index"
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
+ v-bind="
285
+ handleExclAttribute({
286
+ data: item,
287
+ attrs: ['is', 'type']
288
+ })
289
+ "
290
+ ></component>
291
+ </template>
292
+ </template>
293
+ </template>
294
+ <template v-else>
295
+ <component
296
+ v-if="contents.component || contents.type == 'component'"
297
+ :is="contents.is || contents.type"
298
+ v-bind="
299
+ handleExclAttribute({
300
+ data: contents,
301
+ attrs: ['is', 'type']
302
+ })
303
+ "
304
+ ></component>
305
+ <es-form
306
+ v-if="contents.type === 'form'"
307
+ :show-button="false"
308
+ ref="esFlowForm"
309
+ :showMsg="showMsg"
310
+ v-bind="
311
+ handleExclAttribute({
312
+ data: contents,
313
+ attrs: ['events', 'visible', 'type', 'model', 'ref']
314
+ })
315
+ "
316
+ full
317
+ :autoId="true"
318
+ :businessId.sync="businessId"
319
+ :closeDialog="false"
320
+ :display="activeName === String(indexs)"
321
+ :model="contents.model"
322
+ v-on="{ ...contents.events }"
323
+ ></es-form>
324
+ <es-flow-list
325
+ v-if="
326
+ contents.type === 'flow-list' ||
327
+ contents.type === 'flowList'
328
+ "
329
+ :businessId="businessId"
330
+ v-bind="
331
+ handleExclAttribute({
332
+ data: contents,
333
+ attrs: ['events', 'visible', 'type']
334
+ })
335
+ "
336
+ :display="activeName === String(indexs)"
337
+ ></es-flow-list>
338
+ <es-data-table
339
+ v-if="
340
+ contents.type === 'data-table' ||
341
+ contents.type === 'dataTable'
342
+ "
343
+ :appId="taskExamineAppId"
344
+ v-bind="
345
+ handleExclAttribute({
346
+ data: contents,
347
+ attrs: ['events', 'visible', 'type']
348
+ })
349
+ "
350
+ :class="{
351
+ 'es-flow-group-data-table':
352
+ contents.type === 'data-table' ||
353
+ contents.type === 'dataTable'
354
+ }"
355
+ :display="activeName === String(indexs)"
356
+ v-on="contents.events"
357
+ >
358
+ <template v-if="contents.dialog" slot="dialog">
359
+ <template v-if="Array.isArray(contents.dialog)">
360
+ <es-dialog
361
+ v-for="(ele, ids) in contents.dialog"
362
+ :isReload="true"
363
+ v-bind="ele"
364
+ :key="ids"
365
+ :visible.sync="ele.visible"
366
+ v-on="{ ...ele.events }"
367
+ >
368
+ </es-dialog>
369
+ </template>
370
+ <es-dialog
371
+ v-else
372
+ :isReload="true"
373
+ v-bind="contents.dialog"
374
+ :visible.sync="contents.dialog.visible"
375
+ v-on="{ ...contents.dialog.events }"
376
+ >
377
+ </es-dialog>
378
+ </template>
379
+ </es-data-table>
380
+ <es-tree-group
381
+ v-if="
382
+ contents.type === 'tree-group' ||
383
+ contents.type === 'treeGroup'
384
+ "
385
+ :appId="taskExamineAppId"
386
+ v-bind="
387
+ handleExclAttribute({
388
+ data: contents,
389
+ attrs: ['events', 'visible', 'type']
390
+ })
391
+ "
392
+ :display="activeName === String(indexs)"
393
+ v-on="{ ...contents.events }"
394
+ ></es-tree-group>
395
+ <iframe
396
+ v-if="contents.type === 'iframe' && !contents.blank"
397
+ :id="contents.id || contents.name"
398
+ :name="contents.name"
399
+ frameborder="0"
400
+ width="100%"
401
+ height="100%"
402
+ :src="handleUrlJoinParams(contents)"
403
+ ></iframe>
404
+ <es-upload
405
+ v-if="contents.type === 'attachment'"
406
+ :ownId="businessId"
407
+ v-bind="
408
+ handleExclAttribute({
409
+ data: contents,
410
+ attrs: ['events', 'type']
411
+ })
412
+ "
413
+ :file-count.sync="title.count"
414
+ :display="activeName === String(indexs)"
415
+ height="auto"
416
+ class="es-attachment"
417
+ v-on="{ ...contents.events }"
418
+ ></es-upload>
419
+ </template>
420
+ </template>
421
+ </es-tabs-panel>
422
+ </el-tab-pane>
423
+ </template>
424
+ </el-tabs>
425
+ </div>
426
+ <es-flow
427
+ v-if="isShow"
428
+ class="es-group-flow"
429
+ v-bind="_flow"
430
+ :width="width"
431
+ :before-submit="isSubmit ? handleSubmit : undefined"
432
+ :businessId="businessId"
433
+ @startTaskRead="handleTaskRead"
434
+ @success="handleSuccess"
435
+ @save="handleSave"
436
+ :closeParent="closeParent"
437
+ ></es-flow>
438
+ <slot></slot>
439
+ </div>
440
+ </template>
441
+ <script>
442
+ import util from 'eoss-ui/src/utils/util';
443
+ export default {
444
+ name: 'EsFlowGroup',
445
+ inject: {
446
+ esDialog: {
447
+ default: ''
448
+ },
449
+ injector: {
450
+ default: ''
451
+ }
452
+ },
453
+ props: {
454
+ // autoId: {
455
+ // type: Boolean,
456
+ // default: true
457
+ // },
458
+ active: {
459
+ type: String,
460
+ default: '0'
461
+ },
462
+ contents: Array,
463
+ closeDialog: {
464
+ type: Boolean,
465
+ default: true
466
+ },
467
+ flow: Object,
468
+ events: Object,
469
+ recordid: String,
470
+ pendingId: String,
471
+ arcurl: String,
472
+ itemname: String,
473
+ show: {
474
+ type: Boolean,
475
+ default: true
476
+ },
477
+ closeParent: {
478
+ type: Boolean,
479
+ default: true
480
+ },
481
+ appId: String,
482
+ zoom: false,
483
+ width: {
484
+ type: String,
485
+ default: '360px'
486
+ },
487
+ refs: String,
488
+ isSubmit: {
489
+ type: Boolean,
490
+ default: true
491
+ }
492
+ },
493
+ data() {
494
+ return {
495
+ activeName: this.active,
496
+ businessId: undefined,
497
+ taskExamineAppId: this.appId,
498
+ showMsg: true,
499
+ formRefs: this.refs,
500
+ submits: null
501
+ };
502
+ },
503
+ computed: {
504
+ tabs() {
505
+ return this.contents ? this.contents : [];
506
+ },
507
+ isShow() {
508
+ if (
509
+ this.flow &&
510
+ Object.prototype.hasOwnProperty.call(this.flow, 'show')
511
+ ) {
512
+ return this.flow.show;
513
+ }
514
+ let flow = util.getParams({ name: 'flow' });
515
+ if (flow == 0) {
516
+ return false;
517
+ }
518
+ return this.show;
519
+ },
520
+ _flow() {
521
+ return !this.flow.pendingId
522
+ ? { ...this.flow, pendingId: this.pendingId }
523
+ : this.flow;
524
+ }
525
+ },
526
+ watch: {
527
+ activeName(val) {
528
+ this.$emit('update:active', val);
529
+ },
530
+ businessId(val) {
531
+ this.handleChangeData({ businessId: val });
532
+ }
533
+ },
534
+ created() {
535
+ if (this.flow.businessId || this.flow.pendingId) {
536
+ this.businessId = this.flow.businessId || this.flow.pendingId;
537
+ }
538
+ },
539
+ mounted() {},
540
+ methods: {
541
+ handleHide(res) {
542
+ return typeof res === 'boolean'
543
+ ? !res
544
+ : typeof res === 'string'
545
+ ? this[res]
546
+ : true;
547
+ },
548
+ handleExclAttribute({ data, attrs }) {
549
+ if (!attrs || !attrs.length) {
550
+ this.ref && (this.formRefs = this.ref);
551
+ return data;
552
+ }
553
+ return util.exclAttribute({
554
+ data: data,
555
+ attrs: attrs
556
+ });
557
+ },
558
+ handleUrlJoinParams(res, flag = true) {
559
+ let url = res.url;
560
+ if (flag) {
561
+ if (res.method) {
562
+ this.submit = {
563
+ id: res.id,
564
+ url: url,
565
+ method: typeof res.method === 'boolean' ? 'submit' : res.method
566
+ };
567
+ }
568
+ }
569
+ let param = util.extend(
570
+ {},
571
+ { id: this.businessId, appId: this.taskExamineAppId },
572
+ res.param || {}
573
+ );
574
+ return util.urlJoinParams({ url, param });
575
+ },
576
+ handleBefore(active, old) {
577
+ return new Promise((resolve, reject) => {
578
+ let n = parseInt(active, 10);
579
+ let item = this.tabs[n];
580
+ let url = null;
581
+ let name = item.name;
582
+ let width = 0;
583
+ let height = 0;
584
+ let win = util.win.top;
585
+ width = win.screen.availWidth - 10;
586
+ height = win.screen.availHeight - 60;
587
+ if (item.url) {
588
+ url = this.handleUrlJoinParams(item);
589
+ }
590
+ if (
591
+ item.contents &&
592
+ item.contents.type === 'iframe' &&
593
+ item.contents.blank
594
+ ) {
595
+ item.contents.name && (name = item.contents.name);
596
+ url = this.handleUrlJoinParams(item.contents);
597
+ }
598
+ if (url) {
599
+ reject();
600
+ util.win.open(
601
+ url,
602
+ name,
603
+ `width=${width}px,height=${height}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
604
+ );
605
+ } else {
606
+ resolve();
607
+ }
608
+ });
609
+ },
610
+ handleSubmit(res) {
611
+ if (this.submit) {
612
+ if (this.submit.id) {
613
+ let iframe = document.getElementById(this.submit.id); //先找到ifram
614
+
615
+ if (this.submit.url) {
616
+ let url = new URL(this.submit.url);
617
+ let origin = url.origin;
618
+ let _origin = util.win.location.origin;
619
+ if (origin != _origin) {
620
+ iframe.postMessage({ submit: res }, '*');
621
+ return new Promise((resolve, reject) => {
622
+ window.addEventListener('message', function (obj) {
623
+ if (obj.origin == origin) {
624
+ let results = obj.data;
625
+ if (results.code == 0) {
626
+ resolve();
627
+ } else {
628
+ reject();
629
+ }
630
+ }
631
+ });
632
+ });
633
+ }
634
+ }
635
+ return iframe.contentWindow[this.submit.method](res); //用dom对象调用子页面的方法
636
+ }
637
+ }
638
+ let esFlowForm = this.formRefs
639
+ ? this.$refs[this.formRefs]
640
+ : this.$refs.esFlowForm;
641
+ if (Array.isArray(esFlowForm)) {
642
+ esFlowForm = esFlowForm[0];
643
+ }
644
+ esFlowForm;
645
+ this.showMsg = res == 1 ? false : true;
646
+ return esFlowForm.submitData(undefined, false, {}, res);
647
+ },
648
+ handleTaskRead(res) {
649
+ if (res.data.taskExamine && res.data.taskExamine.appId) {
650
+ this.taskExamineAppId = res.data.taskExamine.appId;
651
+ this.injector &&
652
+ this.injector.handleChangeData({ appId: this.taskExamineAppId });
653
+ }
654
+ },
655
+ handleSuccess() {
656
+ if (this.closeDialog && this.esDialog) {
657
+ this.esDialog.handleClose();
658
+ } else if (util.win.top.COOS_SDK) {
659
+ util.win.top.COOS_SDK.closePopup && util.win.top.COOS_SDK.closePopup();
660
+ } else if (util.win.top.opener) {
661
+ util.win.top.close();
662
+ }
663
+ if (this.events && this.events.success) {
664
+ this.events.success();
665
+ }
666
+ this.$emit('success');
667
+ },
668
+ handleSave(id, event) {
669
+ if (this.closeDialog && this.esDialog) {
670
+ this.esDialog.handleClose();
671
+ }
672
+ this.events && this.events.save(id, event);
673
+ this.$emit('save', id, event);
674
+ },
675
+ handleChangeId(id) {
676
+ this.businessId = id;
677
+ },
678
+ handleChangeData(res) {
679
+ this.$emit('changeData', res);
680
+ this.$emit('change-data', res);
681
+ }
682
+ }
683
+ };
684
+ </script>