eoss-ui 0.7.73 → 0.7.74

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 (166) hide show
  1. package/lib/calogin.js +233 -233
  2. package/lib/eoss-ui.common.js +650 -2348
  3. package/lib/index.js +1 -1
  4. package/lib/main.js +320 -2014
  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/lib/theme-chalk/main.css +1 -1
  9. package/lib/theme-chalk/simplicity-top.css +1 -1
  10. package/package.json +1 -1
  11. package/packages/button/index.js +5 -5
  12. package/packages/button/src/main.vue +418 -418
  13. package/packages/button-group/index.js +5 -5
  14. package/packages/calendar/index.js +5 -5
  15. package/packages/calogin/index.js +5 -5
  16. package/packages/calogin/src/plugin.js +915 -915
  17. package/packages/card/index.js +5 -5
  18. package/packages/card/src/main.vue +156 -156
  19. package/packages/cascader/index.js +5 -5
  20. package/packages/cascader/src/main.vue +168 -168
  21. package/packages/checkbox-group/index.js +5 -5
  22. package/packages/checkbox-group/src/main.vue +333 -333
  23. package/packages/clients/index.js +5 -5
  24. package/packages/data-table/index.js +5 -5
  25. package/packages/data-table/src/children.vue +39 -39
  26. package/packages/data-table/src/sizer.vue +195 -195
  27. package/packages/data-table-form/index.js +5 -5
  28. package/packages/data-table-form/src/checkbox.vue +101 -101
  29. package/packages/data-table-form/src/colgroup.vue +17 -17
  30. package/packages/data-table-form/src/main.vue +181 -181
  31. package/packages/data-table-form/src/radio.vue +65 -65
  32. package/packages/data-table-form/src/table.vue +233 -233
  33. package/packages/data-table-form/src/tbody.vue +336 -336
  34. package/packages/data-table-form/src/thead.vue +68 -68
  35. package/packages/date-picker/index.js +5 -5
  36. package/packages/date-picker/src/main.vue +236 -236
  37. package/packages/dialog/index.js +5 -5
  38. package/packages/enable-drag/index.js +5 -5
  39. package/packages/enterprise/index.js +5 -5
  40. package/packages/enterprise/src/main.vue +66 -66
  41. package/packages/error-page/index.js +5 -5
  42. package/packages/error-page/src/main.vue +44 -44
  43. package/packages/flow/index.js +5 -5
  44. package/packages/flow/src/component/TimeLimit.vue +190 -190
  45. package/packages/flow/src/table.vue +58 -58
  46. package/packages/flow-group/index.js +5 -5
  47. package/packages/flow-list/index.js +5 -5
  48. package/packages/form/index.js +5 -5
  49. package/packages/handle-user/index.js +5 -5
  50. package/packages/handler/index.js +5 -5
  51. package/packages/icon/index.js +5 -5
  52. package/packages/icons/index.js +5 -5
  53. package/packages/icons/src/main.vue +81 -81
  54. package/packages/input/index.js +5 -5
  55. package/packages/input/src/main.vue +356 -356
  56. package/packages/input-number/index.js +5 -5
  57. package/packages/input-number/src/main.vue +106 -106
  58. package/packages/label/index.js +5 -5
  59. package/packages/label/src/main.vue +457 -457
  60. package/packages/layout/index.js +5 -5
  61. package/packages/layout/src/item.vue +152 -152
  62. package/packages/layout/src/main.vue +31 -31
  63. package/packages/login/index.js +5 -5
  64. package/packages/main/index.js +5 -5
  65. package/packages/main/src/default/index.vue +1 -0
  66. package/packages/main/src/default/message.vue +249 -249
  67. package/packages/main/src/default/notice.vue +157 -157
  68. package/packages/main/src/simplicity/index.vue +1 -0
  69. package/packages/main/src/simplicity/lists.vue +84 -84
  70. package/packages/main/src/simplicity/router-page.vue +45 -45
  71. package/packages/main/src/simplicityTop/handler.vue +5 -0
  72. package/packages/main/src/simplicityTop/index.vue +145 -281
  73. package/packages/menu/index.js +5 -5
  74. package/packages/nav/index.js +5 -5
  75. package/packages/notify/index.js +5 -5
  76. package/packages/notify/src/main.vue +538 -538
  77. package/packages/page/index.js +5 -5
  78. package/packages/page/src/main.vue +167 -167
  79. package/packages/pagination/index.js +5 -5
  80. package/packages/pagination/src/main.vue +96 -96
  81. package/packages/player/index.js +5 -5
  82. package/packages/player/src/main.vue +194 -194
  83. package/packages/qr-code/index.js +5 -5
  84. package/packages/qr-code/src/main.vue +170 -170
  85. package/packages/radio-group/index.js +6 -6
  86. package/packages/radio-group/src/main.vue +319 -319
  87. package/packages/retrial-auth/index.js +5 -5
  88. package/packages/retrial-auth/src/main.vue +280 -280
  89. package/packages/select/index.js +5 -5
  90. package/packages/select-ganged/index.js +5 -5
  91. package/packages/select-ganged/src/main.vue +724 -724
  92. package/packages/selector/index.js +5 -5
  93. package/packages/selector-panel/index.js +5 -5
  94. package/packages/selector-panel/src/tree.vue +129 -129
  95. package/packages/sizer/index.js +5 -5
  96. package/packages/sizer/src/main.vue +254 -254
  97. package/packages/steps/index.js +5 -5
  98. package/packages/steps/src/main.vue +181 -181
  99. package/packages/switch/index.js +5 -5
  100. package/packages/table-form/index.js +5 -5
  101. package/packages/tabs/index.js +5 -5
  102. package/packages/tabs/src/main.vue +788 -788
  103. package/packages/tabs-panel/index.js +5 -5
  104. package/packages/tabs-panel/src/main.vue +29 -29
  105. package/packages/theme-chalk/lib/index.css +1 -1
  106. package/packages/theme-chalk/lib/login.css +1 -1
  107. package/packages/theme-chalk/lib/main.css +1 -1
  108. package/packages/theme-chalk/lib/simplicity-top.css +1 -1
  109. package/packages/theme-chalk/src/base.scss +261 -261
  110. package/packages/theme-chalk/src/button-group.scss +176 -176
  111. package/packages/theme-chalk/src/button.scss +24 -24
  112. package/packages/theme-chalk/src/calendar.scss +113 -113
  113. package/packages/theme-chalk/src/card.scss +99 -99
  114. package/packages/theme-chalk/src/checkbox-group.scss +8 -8
  115. package/packages/theme-chalk/src/clients.scss +87 -87
  116. package/packages/theme-chalk/src/data-table-form.scss +67 -67
  117. package/packages/theme-chalk/src/date-picker.scss +7 -7
  118. package/packages/theme-chalk/src/dialog.scss +77 -77
  119. package/packages/theme-chalk/src/enable-drag.scss +181 -181
  120. package/packages/theme-chalk/src/enterprise.scss +5 -5
  121. package/packages/theme-chalk/src/error-page.scss +18 -18
  122. package/packages/theme-chalk/src/flow-group.scss +110 -110
  123. package/packages/theme-chalk/src/flow-list.scss +39 -39
  124. package/packages/theme-chalk/src/handle-user.scss +40 -40
  125. package/packages/theme-chalk/src/icons.scss +99 -99
  126. package/packages/theme-chalk/src/input.scss +9 -9
  127. package/packages/theme-chalk/src/label.scss +24 -24
  128. package/packages/theme-chalk/src/layout.scss +46 -46
  129. package/packages/theme-chalk/src/mixins/color.scss +117 -117
  130. package/packages/theme-chalk/src/nav.scss +111 -111
  131. package/packages/theme-chalk/src/page.scss +3 -3
  132. package/packages/theme-chalk/src/pagination.scss +29 -29
  133. package/packages/theme-chalk/src/player.scss +9 -9
  134. package/packages/theme-chalk/src/qr-code.scss +17 -17
  135. package/packages/theme-chalk/src/radio-group.scss +9 -9
  136. package/packages/theme-chalk/src/retrial-auth.scss +38 -38
  137. package/packages/theme-chalk/src/select-ganged.scss +8 -8
  138. package/packages/theme-chalk/src/select.scss +8 -8
  139. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  140. package/packages/theme-chalk/src/simplicity-top.scss +14 -0
  141. package/packages/theme-chalk/src/sizer.scss +36 -36
  142. package/packages/theme-chalk/src/steps.scss +88 -88
  143. package/packages/theme-chalk/src/switch.scss +3 -3
  144. package/packages/theme-chalk/src/table-form.scss +1 -1
  145. package/packages/theme-chalk/src/tabs.scss +87 -87
  146. package/packages/theme-chalk/src/tips.scss +7 -7
  147. package/packages/theme-chalk/src/toolbar.scss +179 -179
  148. package/packages/theme-chalk/src/tree-group.scss +72 -72
  149. package/packages/theme-chalk/src/wxlogin.scss +3 -3
  150. package/packages/tips/index.js +5 -5
  151. package/packages/toolbar/index.js +5 -5
  152. package/packages/tree/index.js +5 -5
  153. package/packages/tree-group/index.js +5 -5
  154. package/packages/upload/index.js +5 -5
  155. package/packages/upload/src/picture.js +15 -15
  156. package/packages/wujie/index.js +5 -5
  157. package/packages/wujie/src/main.vue +145 -145
  158. package/packages/wxlogin/index.js +5 -5
  159. package/packages/wxlogin/src/main.vue +128 -128
  160. package/src/config/image.js +2 -2
  161. package/src/index.js +1 -1
  162. package/src/utils/bus.js +3 -3
  163. package/src/utils/date-util.js +312 -312
  164. package/src/utils/http.js +50 -50
  165. package/src/utils/store.js +21 -21
  166. package/src/utils/webSocket.js +107 -107
@@ -1,788 +1,788 @@
1
- <template>
2
- <el-tabs
3
- class="es-tabs"
4
- v-bind="{ type: mold, ...$attrs }"
5
- v-on="$listeners"
6
- v-model="activeName"
7
- ref="elTab"
8
- :before-leave="handleBefore"
9
- :class="{ 'es-tabs-full': isFull }"
10
- :style="styles"
11
- >
12
- <slot>
13
- <template v-for="(items, indexs) in tabs">
14
- <el-tab-pane
15
- v-if="!items.hide"
16
- :key="indexs"
17
- :label="items.label"
18
- :immediate="items.immediate"
19
- :name="items.name || String(indexs)"
20
- >
21
- <template slot="label" v-if="items.title">
22
- <template v-if="typeof items.title === 'object'">
23
- <i v-if="items.title.icon" :class="items.title.icon"></i>
24
- <template v-if="items.title.text">
25
- {{ items.title.text }}
26
- </template>
27
- <el-badge
28
- v-if="
29
- Object.prototype.hasOwnProperty.call(items.title, 'count')
30
- "
31
- type="primary"
32
- :value="items.title.count"
33
- :max="99"
34
- >
35
- </el-badge>
36
- </template>
37
- <template v-else>{{ items.title }}</template>
38
- </template>
39
- <template slot-scope="{ loaded }">
40
- <component
41
- v-if="items.component || items.type == 'component'"
42
- :is="contents.is || contents.type"
43
- v-bind="
44
- handleExclAttribute({
45
- data: contents,
46
- attrs: ['is', 'type']
47
- })
48
- "
49
- ></component>
50
- <es-tabs-panel v-else v-bind="items" :show="loaded">
51
- <template
52
- slot-scope="{ contents, average, data, title, show, isShow }"
53
- >
54
- <template v-if="Array.isArray(contents)">
55
- <template v-for="(item, index) in contents">
56
- <div class="es-tab-pane-list" :key="index" v-if="average">
57
- <div class="es-tab-pane-main">
58
- <template v-if="item.htmlType">
59
- <template v-if="item.htmlType === 'h1'">
60
- <h1
61
- v-if="item.html"
62
- :style="item.style"
63
- v-html="item.html"
64
- ></h1>
65
- <h1 v-else :style="item.style">
66
- {{ item.text }}
67
- </h1>
68
- </template>
69
- <template v-if="item.htmlType === 'h2'">
70
- <h2
71
- v-if="item.html"
72
- :style="item.style"
73
- v-html="item.html"
74
- ></h2>
75
- <h2 v-else :style="item.style">
76
- {{ item.text }}
77
- </h2>
78
- </template>
79
- <ul v-if="item.htmlType === 'ul'" :style="item.style">
80
- <template v-for="(liItem, liIndex) in data">
81
- <li
82
- v-if="liitems.html"
83
- :key="liIndex"
84
- v-html="liitems.html"
85
- ></li>
86
- <li v-else :key="liIndex">
87
- {{ liItem }}
88
- </li>
89
- </template>
90
- </ul>
91
- <img
92
- v-if="
93
- item.htmlType === 'image' ||
94
- item.htmlType === 'img'
95
- "
96
- :src="item.url"
97
- :style="item.style"
98
- />
99
- <template v-if="item.htmlType === 'p'">
100
- <p
101
- v-if="item.html"
102
- :style="item.style"
103
- v-html="item.html"
104
- ></p>
105
- <p v-else :style="item.style">
106
- {{ item.text }}
107
- </p>
108
- </template>
109
- <template v-if="item.htmlType === 'div'">
110
- <div
111
- v-if="item.html"
112
- :style="item.style"
113
- v-html="item.html"
114
- ></div>
115
- <div v-else :style="item.style">
116
- {{ item.text }}
117
- </div>
118
- </template>
119
- </template>
120
- <template v-else>
121
- <es-data-table
122
- v-if="
123
- item.type === 'data-table' ||
124
- item.type === 'dataTable' ||
125
- item.type === 'flow-list' ||
126
- item.type === 'flowList'
127
- "
128
- v-bind="
129
- handleExclAttribute({
130
- data: item,
131
- attrs: ['events', 'visible', 'type']
132
- })
133
- "
134
- :display="show"
135
- :class="{
136
- 'es-flow-group-data-table':
137
- item.type === 'data-table' ||
138
- item.type === 'dataTable',
139
- 'es-flow-list':
140
- item.type === 'flow-list' ||
141
- item.type === 'flowList'
142
- }"
143
- v-on="item.events"
144
- >
145
- <template v-if="item.dialog" slot="dialog">
146
- <template v-if="Array.isArray(item.dialog)">
147
- <es-dialog
148
- v-for="(ele, ids) in item.dialog"
149
- :isReload="true"
150
- v-bind="
151
- handleExclAttribute({
152
- data: ele,
153
- attrs: ['visible']
154
- })
155
- "
156
- :key="ids"
157
- :visible.sync="ele.visible"
158
- v-on="{ ...ele.events }"
159
- >
160
- </es-dialog>
161
- </template>
162
- <es-dialog
163
- v-else
164
- :isReload="true"
165
- v-bind="
166
- handleExclAttribute({
167
- data: item.dialog,
168
- attrs: ['visible']
169
- })
170
- "
171
- :visible.sync="item.dialog.visible"
172
- v-on="{ ...item.dialog.events }"
173
- >
174
- </es-dialog>
175
- </template>
176
- </es-data-table>
177
- <es-tree-group
178
- v-if="
179
- item.type === 'tree-group' ||
180
- item.type === 'treeGroup'
181
- "
182
- v-bind="
183
- handleExclAttribute({
184
- data: item,
185
- attrs: ['events', 'visible', 'type']
186
- })
187
- "
188
- :display="show"
189
- v-on="{ ...item.events }"
190
- ></es-tree-group>
191
- <iframe
192
- v-if="item.type === 'iframe' && !item.blank"
193
- :id="item.id || item.name"
194
- :name="item.name"
195
- frameborder="0"
196
- width="100%"
197
- height="100%"
198
- :src="
199
- handleUrlJoinParams({
200
- url: item.url,
201
- param: item.param || {}
202
- })
203
- "
204
- ></iframe>
205
- <es-upload
206
- v-if="item.type === 'attachment'"
207
- :file-count.sync="title.count"
208
- height="auto"
209
- class="es-attachment"
210
- v-bind="
211
- handleExclAttribute({
212
- data: item,
213
- attrs: ['events', 'type']
214
- })
215
- "
216
- :display="show"
217
- v-on="{ ...item.events }"
218
- ></es-upload>
219
- </template>
220
- </div>
221
- </div>
222
- <template v-else>
223
- <template v-if="item.htmlType === 'h1'">
224
- <h1
225
- v-if="item.html"
226
- v-bind="
227
- handleExclAttribute({
228
- data: item,
229
- attrs: ['html', 'htmlType']
230
- })
231
- "
232
- :key="index"
233
- v-html="item.html"
234
- ></h1>
235
- <h1
236
- v-else
237
- v-bind="
238
- handleExclAttribute({
239
- data: item,
240
- attrs: ['html', 'htmlType']
241
- })
242
- "
243
- :key="index"
244
- >
245
- {{ item.text }}
246
- </h1>
247
- </template>
248
- <template v-if="item.htmlType === 'h2'">
249
- <h2
250
- v-if="item.html"
251
- v-bind="
252
- handleExclAttribute({
253
- data: item,
254
- attrs: ['html', 'htmlType']
255
- })
256
- "
257
- :key="index"
258
- v-html="item.html"
259
- ></h2>
260
- <h2
261
- v-else
262
- v-bind="
263
- handleExclAttribute({
264
- data: item,
265
- attrs: ['html', 'htmlType']
266
- })
267
- "
268
- :key="index"
269
- >
270
- {{ item.text }}
271
- </h2>
272
- </template>
273
- <template v-if="item.htmlType === 'ul'">
274
- <ul
275
- v-if="item.html"
276
- v-bind="
277
- handleExclAttribute({
278
- data: item,
279
- attrs: ['html', 'htmlType']
280
- })
281
- "
282
- :key="index"
283
- v-html="item.html"
284
- ></ul>
285
- <ul
286
- v-else
287
- v-bind="
288
- handleExclAttribute({
289
- data: item,
290
- attrs: ['html', 'htmlType']
291
- })
292
- "
293
- :key="index"
294
- >
295
- <template v-for="(liItem, liIndex) in data">
296
- <li
297
- v-if="liitems.html"
298
- :key="liIndex"
299
- v-html="liitems.html"
300
- ></li>
301
- <li v-else :key="liIndex">
302
- {{ liItem }}
303
- </li>
304
- </template>
305
- </ul>
306
- </template>
307
- <template
308
- v-if="
309
- item.htmlType === 'image' || item.htmlType === 'img'
310
- "
311
- >
312
- <img
313
- :key="index"
314
- v-bind="
315
- handleExclAttribute({
316
- data: item,
317
- attrs: ['html', 'htmlType', 'src']
318
- })
319
- "
320
- :src="item.url || item.src"
321
- />
322
- </template>
323
- <template v-if="item.htmlType === 'p'">
324
- <p
325
- v-if="item.html"
326
- v-bind="
327
- handleExclAttribute({
328
- data: item,
329
- attrs: ['html', 'htmlType']
330
- })
331
- "
332
- :key="index"
333
- v-html="item.html"
334
- ></p>
335
- <p
336
- v-else
337
- v-bind="
338
- handleExclAttribute({
339
- data: item,
340
- attrs: ['text', 'htmlType']
341
- })
342
- "
343
- :key="index"
344
- >
345
- {{ item.text }}
346
- </p>
347
- </template>
348
- <template v-if="item.htmlType === 'div'">
349
- <div
350
- v-if="item.html"
351
- v-bind="
352
- handleExclAttribute({
353
- data: item,
354
- attrs: ['html', 'htmlType']
355
- })
356
- "
357
- :key="index"
358
- v-html="item.html"
359
- ></div>
360
- <div
361
- v-else
362
- v-bind="
363
- handleExclAttribute({
364
- data: item,
365
- attrs: ['html', 'htmlType']
366
- })
367
- "
368
- :key="index"
369
- >
370
- {{ item.text }}
371
- </div>
372
- </template>
373
- <es-form
374
- v-if="item.type === 'form'"
375
- ref="esFlowForm"
376
- v-bind="
377
- handleExclAttribute({
378
- data: item,
379
- attrs: ['events', 'visible', 'model', 'type', 'ref']
380
- })
381
- "
382
- full
383
- :model.sync="item.model"
384
- :display="show"
385
- :key="index"
386
- :closeDialog="false"
387
- v-on="{ ...item.events }"
388
- ></es-form>
389
- <es-data-table
390
- v-if="
391
- item.type === 'data-table' ||
392
- item.type === 'dataTable' ||
393
- item.type === 'flow-list' ||
394
- item.type === 'flowList'
395
- "
396
- v-bind="
397
- handleExclAttribute({
398
- data: item,
399
- attrs: ['events', 'visible', 'type']
400
- })
401
- "
402
- :class="{
403
- 'es-flow-group-data-table':
404
- item.type === 'data-table' ||
405
- item.type === 'dataTable',
406
- 'es-flow-list':
407
- item.type === 'flow-list' ||
408
- item.type === 'flowList'
409
- }"
410
- :display="show"
411
- :key="index"
412
- v-on="item.events"
413
- >
414
- <template v-if="item.dialog" slot="dialog">
415
- <template v-if="Array.isArray(item.dialog)">
416
- <es-dialog
417
- v-for="(ele, ids) in item.dialog"
418
- :isReload="true"
419
- v-bind="
420
- handleExclAttribute({
421
- data: ele,
422
- attrs: ['visible']
423
- })
424
- "
425
- :key="ids"
426
- :visible.sync="ele.visible"
427
- v-on="{ ...ele.events }"
428
- >
429
- </es-dialog>
430
- </template>
431
- <es-dialog
432
- v-else
433
- :isReload="true"
434
- v-bind="
435
- handleExclAttribute({
436
- data: item.dialog,
437
- attrs: ['visible']
438
- })
439
- "
440
- :visible.sync="item.dialog.visible"
441
- v-on="{ ...item.dialog.events }"
442
- >
443
- </es-dialog>
444
- </template>
445
- </es-data-table>
446
- <es-tree-group
447
- v-if="
448
- item.type === 'tree-group' ||
449
- item.type === 'treeGroup'
450
- "
451
- v-bind="
452
- handleExclAttribute({
453
- data: item,
454
- attrs: ['events', 'visible', 'type']
455
- })
456
- "
457
- :key="index"
458
- :display="show"
459
- v-on="{ ...item.events }"
460
- ></es-tree-group>
461
- <iframe
462
- v-if="item.type === 'iframe' && !item.blank"
463
- frameborder="0"
464
- width="100%"
465
- height="100%"
466
- :key="index"
467
- :id="item.id || item.name"
468
- :name="item.name"
469
- :src="
470
- handleUrlJoinParams({
471
- url: item.url,
472
- param: item.param || {}
473
- })
474
- "
475
- ></iframe>
476
- <es-upload
477
- v-if="item.type === 'attachment'"
478
- height="auto"
479
- class="es-attachment"
480
- v-bind="
481
- handleExclAttribute({
482
- data: item,
483
- attrs: ['events', 'type']
484
- })
485
- "
486
- :file-count.sync="title.count"
487
- :key="index"
488
- :display="show"
489
- v-on="{ ...item.events }"
490
- ></es-upload>
491
- <es-dialog
492
- v-if="item.type === 'dialog'"
493
- :isReload="true"
494
- v-bind="
495
- handleExclAttribute({
496
- data: item,
497
- attrs: ['visible', 'type']
498
- })
499
- "
500
- :key="index"
501
- :visible.sync="item.visible"
502
- v-on="{ ...item.events }"
503
- >
504
- </es-dialog>
505
- </template>
506
- </template>
507
- </template>
508
- <template v-else>
509
- <es-form
510
- v-if="contents.type === 'form'"
511
- ref="esFlowForm"
512
- v-bind="
513
- handleExclAttribute({
514
- data: contents,
515
- attrs: ['events', 'visible', 'model', 'type', 'ref']
516
- })
517
- "
518
- full
519
- :model.sync="contents.model"
520
- :display="show"
521
- :closeDialog="false"
522
- v-on="{ ...contents.events }"
523
- ></es-form>
524
- <es-data-table
525
- v-if="
526
- contents.type === 'data-table' ||
527
- contents.type === 'dataTable' ||
528
- contents.type === 'flow-list' ||
529
- items.contents.type === 'flowList'
530
- "
531
- v-bind="
532
- handleExclAttribute({
533
- data: contents,
534
- attrs: ['events', 'visible', 'type']
535
- })
536
- "
537
- :class="{
538
- 'es-flow-group-data-table':
539
- contents.type === 'data-table' ||
540
- items.contents.type === 'dataTable',
541
- 'es-flow-list':
542
- contents.type === 'flow-list' ||
543
- contents.type === 'flowList'
544
- }"
545
- :display="show"
546
- v-on="contents.events"
547
- >
548
- <template v-if="contents.dialog" slot="dialog">
549
- <template v-if="Array.isArray(contents.dialog)">
550
- <es-dialog
551
- v-for="(ele, ids) in contents.dialog"
552
- :isReload="true"
553
- v-bind="
554
- handleExclAttribute({
555
- data: ele,
556
- attrs: ['visible']
557
- })
558
- "
559
- :key="ids"
560
- :visible.sync="ele.visible"
561
- v-on="{ ...ele.events }"
562
- >
563
- </es-dialog>
564
- </template>
565
- <es-dialog
566
- v-else
567
- :isReload="true"
568
- v-bind="
569
- handleExclAttribute({
570
- data: contents.dialog,
571
- attrs: ['visible']
572
- })
573
- "
574
- :visible.sync="contents.dialog.visible"
575
- v-on="{ ...contents.dialog.events }"
576
- >
577
- </es-dialog>
578
- </template>
579
- </es-data-table>
580
- <es-tree-group
581
- v-if="
582
- contents.type === 'tree-group' ||
583
- contents.type === 'treeGroup'
584
- "
585
- v-bind="
586
- handleExclAttribute({
587
- data: contents,
588
- attrs: ['events', 'visible', 'type']
589
- })
590
- "
591
- :display="show"
592
- v-on="{ ...contents.events }"
593
- ></es-tree-group>
594
- <iframe
595
- v-if="contents.type === 'iframe' && !contents.blank"
596
- :id="contents.id || contents.name"
597
- :name="contents.name"
598
- frameborder="0"
599
- width="100%"
600
- height="100%"
601
- :src="
602
- handleUrlJoinParams({
603
- url: contents.url,
604
- param: contents.param || {}
605
- })
606
- "
607
- ></iframe>
608
- <es-upload
609
- v-if="contents.type === 'attachment'"
610
- v-bind="
611
- handleExclAttribute({
612
- data: contents,
613
- attrs: ['events', 'type']
614
- })
615
- "
616
- :display="show"
617
- :file-count.sync="title.count"
618
- height="auto"
619
- class="es-attachment"
620
- v-on="{ ...contents.events }"
621
- ></es-upload>
622
- </template>
623
- </template>
624
- </es-tabs-panel>
625
- </template>
626
- </el-tab-pane>
627
- </template>
628
- </slot>
629
- </el-tabs>
630
- </template>
631
-
632
- <script>
633
- import util from 'eoss-ui/src/utils/util';
634
- export default {
635
- name: 'EsTabs',
636
- inheritAttrs: false,
637
- provide() {
638
- return {
639
- esTabs: this
640
- };
641
- },
642
- props: {
643
- mold: String,
644
- full: {
645
- type: Boolean,
646
- default: undefined
647
- },
648
- height: String,
649
- value: {
650
- type: String,
651
- default: '0'
652
- },
653
- isSubmit: Boolean,
654
- multiple: Boolean,
655
- // 页面主体内容
656
- contents: {
657
- type: Array,
658
- default() {
659
- return [];
660
- }
661
- },
662
- states: [Array, Object]
663
- },
664
- watch: {
665
- activeName(val) {
666
- this.$emit('input', val);
667
- },
668
- tabs: {
669
- immediate: true,
670
- deep: true,
671
- handler(val) {
672
- if (val.length) {
673
- this.getState(val);
674
- }
675
- }
676
- },
677
- states: {
678
- immediate: true,
679
- deep: true,
680
- handler(val) {
681
- if (val) {
682
- if (Array.isArray(val) && val.length) {
683
- this.getState(val);
684
- } else if (Object.keys(val).length) {
685
- this.state = val;
686
- }
687
- }
688
- }
689
- }
690
- },
691
- computed: {
692
- tabs() {
693
- return this.contents ? this.contents : [];
694
- },
695
- isFull() {
696
- return this.full !== undefined ? this.full : this.fill;
697
- },
698
- styles() {
699
- return {
700
- height: this.height ? this.height : this.full || this.fill ? '100%' : ''
701
- };
702
- }
703
- },
704
- data() {
705
- return {
706
- activeName: this.value,
707
- state: {},
708
- id: null,
709
- fill: false
710
- };
711
- },
712
- mounted() {
713
- if (
714
- this.$el.parentNode.children.length == 1 &&
715
- util.getStyle(this.$el.parentNode, 'height')
716
- ) {
717
- this.fill = true;
718
- }
719
- },
720
- methods: {
721
- getState(val) {
722
- if (this.isSubmit) {
723
- let obj = {};
724
- val.forEach((item, index) => {
725
- let key = item.name || String(index);
726
- if (Array.isArray(item.contents)) {
727
- obj[key] = true;
728
- for (let i = 0; i < item.contents.length; i++) {
729
- if (item.contents[i].type === 'form') {
730
- obj[key] = Object.prototype.hasOwnProperty.call(
731
- item.contents[i],
732
- 'isSubmit'
733
- )
734
- ? item.contents[i].isSubmit
735
- : this.isSubmit
736
- ? false
737
- : true;
738
- break;
739
- }
740
- }
741
- } else {
742
- obj[key] =
743
- item.contents.type === 'form'
744
- ? (obj[key] = Object.prototype.hasOwnProperty.call(
745
- item.contents,
746
- 'isSubmit'
747
- )
748
- ? item.contents.isSubmit
749
- : this.isSubmit
750
- ? false
751
- : true)
752
- : true;
753
- }
754
- });
755
- this.state = obj;
756
- }
757
- },
758
- handleExclAttribute({ data, attrs }) {
759
- return util.exclAttribute({
760
- data: data,
761
- attrs: attrs
762
- });
763
- },
764
- handleUrlJoinParams({ url, param }) {
765
- return util.urlJoinParams({ url, param });
766
- },
767
- handleBefore(active, old) {
768
- return new Promise((resolve, reject) => {
769
- if (this.isSubmit && old !== undefined && !this.state[old]) {
770
- reject();
771
- this.$alert('请先保存基本信息', '提示!', {
772
- confirmButtonText: '确定'
773
- }).catch(() => {});
774
- } else {
775
- resolve();
776
- }
777
- });
778
- },
779
- handleTabState(res) {
780
- this.isSubmit && this.$set(this.state, this.activeName, res);
781
- },
782
- handleChangeData(res) {
783
- this.$emit('changeData', res);
784
- this.$emit('change-data', res);
785
- }
786
- }
787
- };
788
- </script>
1
+ <template>
2
+ <el-tabs
3
+ class="es-tabs"
4
+ v-bind="{ type: mold, ...$attrs }"
5
+ v-on="$listeners"
6
+ v-model="activeName"
7
+ ref="elTab"
8
+ :before-leave="handleBefore"
9
+ :class="{ 'es-tabs-full': isFull }"
10
+ :style="styles"
11
+ >
12
+ <slot>
13
+ <template v-for="(items, indexs) in tabs">
14
+ <el-tab-pane
15
+ v-if="!items.hide"
16
+ :key="indexs"
17
+ :label="items.label"
18
+ :immediate="items.immediate"
19
+ :name="items.name || String(indexs)"
20
+ >
21
+ <template slot="label" v-if="items.title">
22
+ <template v-if="typeof items.title === 'object'">
23
+ <i v-if="items.title.icon" :class="items.title.icon"></i>
24
+ <template v-if="items.title.text">
25
+ {{ items.title.text }}
26
+ </template>
27
+ <el-badge
28
+ v-if="
29
+ Object.prototype.hasOwnProperty.call(items.title, 'count')
30
+ "
31
+ type="primary"
32
+ :value="items.title.count"
33
+ :max="99"
34
+ >
35
+ </el-badge>
36
+ </template>
37
+ <template v-else>{{ items.title }}</template>
38
+ </template>
39
+ <template slot-scope="{ loaded }">
40
+ <component
41
+ v-if="items.component || items.type == 'component'"
42
+ :is="contents.is || contents.type"
43
+ v-bind="
44
+ handleExclAttribute({
45
+ data: contents,
46
+ attrs: ['is', 'type']
47
+ })
48
+ "
49
+ ></component>
50
+ <es-tabs-panel v-else v-bind="items" :show="loaded">
51
+ <template
52
+ slot-scope="{ contents, average, data, title, show, isShow }"
53
+ >
54
+ <template v-if="Array.isArray(contents)">
55
+ <template v-for="(item, index) in contents">
56
+ <div class="es-tab-pane-list" :key="index" v-if="average">
57
+ <div class="es-tab-pane-main">
58
+ <template v-if="item.htmlType">
59
+ <template v-if="item.htmlType === 'h1'">
60
+ <h1
61
+ v-if="item.html"
62
+ :style="item.style"
63
+ v-html="item.html"
64
+ ></h1>
65
+ <h1 v-else :style="item.style">
66
+ {{ item.text }}
67
+ </h1>
68
+ </template>
69
+ <template v-if="item.htmlType === 'h2'">
70
+ <h2
71
+ v-if="item.html"
72
+ :style="item.style"
73
+ v-html="item.html"
74
+ ></h2>
75
+ <h2 v-else :style="item.style">
76
+ {{ item.text }}
77
+ </h2>
78
+ </template>
79
+ <ul v-if="item.htmlType === 'ul'" :style="item.style">
80
+ <template v-for="(liItem, liIndex) in data">
81
+ <li
82
+ v-if="liitems.html"
83
+ :key="liIndex"
84
+ v-html="liitems.html"
85
+ ></li>
86
+ <li v-else :key="liIndex">
87
+ {{ liItem }}
88
+ </li>
89
+ </template>
90
+ </ul>
91
+ <img
92
+ v-if="
93
+ item.htmlType === 'image' ||
94
+ item.htmlType === 'img'
95
+ "
96
+ :src="item.url"
97
+ :style="item.style"
98
+ />
99
+ <template v-if="item.htmlType === 'p'">
100
+ <p
101
+ v-if="item.html"
102
+ :style="item.style"
103
+ v-html="item.html"
104
+ ></p>
105
+ <p v-else :style="item.style">
106
+ {{ item.text }}
107
+ </p>
108
+ </template>
109
+ <template v-if="item.htmlType === 'div'">
110
+ <div
111
+ v-if="item.html"
112
+ :style="item.style"
113
+ v-html="item.html"
114
+ ></div>
115
+ <div v-else :style="item.style">
116
+ {{ item.text }}
117
+ </div>
118
+ </template>
119
+ </template>
120
+ <template v-else>
121
+ <es-data-table
122
+ v-if="
123
+ item.type === 'data-table' ||
124
+ item.type === 'dataTable' ||
125
+ item.type === 'flow-list' ||
126
+ item.type === 'flowList'
127
+ "
128
+ v-bind="
129
+ handleExclAttribute({
130
+ data: item,
131
+ attrs: ['events', 'visible', 'type']
132
+ })
133
+ "
134
+ :display="show"
135
+ :class="{
136
+ 'es-flow-group-data-table':
137
+ item.type === 'data-table' ||
138
+ item.type === 'dataTable',
139
+ 'es-flow-list':
140
+ item.type === 'flow-list' ||
141
+ item.type === 'flowList'
142
+ }"
143
+ v-on="item.events"
144
+ >
145
+ <template v-if="item.dialog" slot="dialog">
146
+ <template v-if="Array.isArray(item.dialog)">
147
+ <es-dialog
148
+ v-for="(ele, ids) in item.dialog"
149
+ :isReload="true"
150
+ v-bind="
151
+ handleExclAttribute({
152
+ data: ele,
153
+ attrs: ['visible']
154
+ })
155
+ "
156
+ :key="ids"
157
+ :visible.sync="ele.visible"
158
+ v-on="{ ...ele.events }"
159
+ >
160
+ </es-dialog>
161
+ </template>
162
+ <es-dialog
163
+ v-else
164
+ :isReload="true"
165
+ v-bind="
166
+ handleExclAttribute({
167
+ data: item.dialog,
168
+ attrs: ['visible']
169
+ })
170
+ "
171
+ :visible.sync="item.dialog.visible"
172
+ v-on="{ ...item.dialog.events }"
173
+ >
174
+ </es-dialog>
175
+ </template>
176
+ </es-data-table>
177
+ <es-tree-group
178
+ v-if="
179
+ item.type === 'tree-group' ||
180
+ item.type === 'treeGroup'
181
+ "
182
+ v-bind="
183
+ handleExclAttribute({
184
+ data: item,
185
+ attrs: ['events', 'visible', 'type']
186
+ })
187
+ "
188
+ :display="show"
189
+ v-on="{ ...item.events }"
190
+ ></es-tree-group>
191
+ <iframe
192
+ v-if="item.type === 'iframe' && !item.blank"
193
+ :id="item.id || item.name"
194
+ :name="item.name"
195
+ frameborder="0"
196
+ width="100%"
197
+ height="100%"
198
+ :src="
199
+ handleUrlJoinParams({
200
+ url: item.url,
201
+ param: item.param || {}
202
+ })
203
+ "
204
+ ></iframe>
205
+ <es-upload
206
+ v-if="item.type === 'attachment'"
207
+ :file-count.sync="title.count"
208
+ height="auto"
209
+ class="es-attachment"
210
+ v-bind="
211
+ handleExclAttribute({
212
+ data: item,
213
+ attrs: ['events', 'type']
214
+ })
215
+ "
216
+ :display="show"
217
+ v-on="{ ...item.events }"
218
+ ></es-upload>
219
+ </template>
220
+ </div>
221
+ </div>
222
+ <template v-else>
223
+ <template v-if="item.htmlType === 'h1'">
224
+ <h1
225
+ v-if="item.html"
226
+ v-bind="
227
+ handleExclAttribute({
228
+ data: item,
229
+ attrs: ['html', 'htmlType']
230
+ })
231
+ "
232
+ :key="index"
233
+ v-html="item.html"
234
+ ></h1>
235
+ <h1
236
+ v-else
237
+ v-bind="
238
+ handleExclAttribute({
239
+ data: item,
240
+ attrs: ['html', 'htmlType']
241
+ })
242
+ "
243
+ :key="index"
244
+ >
245
+ {{ item.text }}
246
+ </h1>
247
+ </template>
248
+ <template v-if="item.htmlType === 'h2'">
249
+ <h2
250
+ v-if="item.html"
251
+ v-bind="
252
+ handleExclAttribute({
253
+ data: item,
254
+ attrs: ['html', 'htmlType']
255
+ })
256
+ "
257
+ :key="index"
258
+ v-html="item.html"
259
+ ></h2>
260
+ <h2
261
+ v-else
262
+ v-bind="
263
+ handleExclAttribute({
264
+ data: item,
265
+ attrs: ['html', 'htmlType']
266
+ })
267
+ "
268
+ :key="index"
269
+ >
270
+ {{ item.text }}
271
+ </h2>
272
+ </template>
273
+ <template v-if="item.htmlType === 'ul'">
274
+ <ul
275
+ v-if="item.html"
276
+ v-bind="
277
+ handleExclAttribute({
278
+ data: item,
279
+ attrs: ['html', 'htmlType']
280
+ })
281
+ "
282
+ :key="index"
283
+ v-html="item.html"
284
+ ></ul>
285
+ <ul
286
+ v-else
287
+ v-bind="
288
+ handleExclAttribute({
289
+ data: item,
290
+ attrs: ['html', 'htmlType']
291
+ })
292
+ "
293
+ :key="index"
294
+ >
295
+ <template v-for="(liItem, liIndex) in data">
296
+ <li
297
+ v-if="liitems.html"
298
+ :key="liIndex"
299
+ v-html="liitems.html"
300
+ ></li>
301
+ <li v-else :key="liIndex">
302
+ {{ liItem }}
303
+ </li>
304
+ </template>
305
+ </ul>
306
+ </template>
307
+ <template
308
+ v-if="
309
+ item.htmlType === 'image' || item.htmlType === 'img'
310
+ "
311
+ >
312
+ <img
313
+ :key="index"
314
+ v-bind="
315
+ handleExclAttribute({
316
+ data: item,
317
+ attrs: ['html', 'htmlType', 'src']
318
+ })
319
+ "
320
+ :src="item.url || item.src"
321
+ />
322
+ </template>
323
+ <template v-if="item.htmlType === 'p'">
324
+ <p
325
+ v-if="item.html"
326
+ v-bind="
327
+ handleExclAttribute({
328
+ data: item,
329
+ attrs: ['html', 'htmlType']
330
+ })
331
+ "
332
+ :key="index"
333
+ v-html="item.html"
334
+ ></p>
335
+ <p
336
+ v-else
337
+ v-bind="
338
+ handleExclAttribute({
339
+ data: item,
340
+ attrs: ['text', 'htmlType']
341
+ })
342
+ "
343
+ :key="index"
344
+ >
345
+ {{ item.text }}
346
+ </p>
347
+ </template>
348
+ <template v-if="item.htmlType === 'div'">
349
+ <div
350
+ v-if="item.html"
351
+ v-bind="
352
+ handleExclAttribute({
353
+ data: item,
354
+ attrs: ['html', 'htmlType']
355
+ })
356
+ "
357
+ :key="index"
358
+ v-html="item.html"
359
+ ></div>
360
+ <div
361
+ v-else
362
+ v-bind="
363
+ handleExclAttribute({
364
+ data: item,
365
+ attrs: ['html', 'htmlType']
366
+ })
367
+ "
368
+ :key="index"
369
+ >
370
+ {{ item.text }}
371
+ </div>
372
+ </template>
373
+ <es-form
374
+ v-if="item.type === 'form'"
375
+ ref="esFlowForm"
376
+ v-bind="
377
+ handleExclAttribute({
378
+ data: item,
379
+ attrs: ['events', 'visible', 'model', 'type', 'ref']
380
+ })
381
+ "
382
+ full
383
+ :model.sync="item.model"
384
+ :display="show"
385
+ :key="index"
386
+ :closeDialog="false"
387
+ v-on="{ ...item.events }"
388
+ ></es-form>
389
+ <es-data-table
390
+ v-if="
391
+ item.type === 'data-table' ||
392
+ item.type === 'dataTable' ||
393
+ item.type === 'flow-list' ||
394
+ item.type === 'flowList'
395
+ "
396
+ v-bind="
397
+ handleExclAttribute({
398
+ data: item,
399
+ attrs: ['events', 'visible', 'type']
400
+ })
401
+ "
402
+ :class="{
403
+ 'es-flow-group-data-table':
404
+ item.type === 'data-table' ||
405
+ item.type === 'dataTable',
406
+ 'es-flow-list':
407
+ item.type === 'flow-list' ||
408
+ item.type === 'flowList'
409
+ }"
410
+ :display="show"
411
+ :key="index"
412
+ v-on="item.events"
413
+ >
414
+ <template v-if="item.dialog" slot="dialog">
415
+ <template v-if="Array.isArray(item.dialog)">
416
+ <es-dialog
417
+ v-for="(ele, ids) in item.dialog"
418
+ :isReload="true"
419
+ v-bind="
420
+ handleExclAttribute({
421
+ data: ele,
422
+ attrs: ['visible']
423
+ })
424
+ "
425
+ :key="ids"
426
+ :visible.sync="ele.visible"
427
+ v-on="{ ...ele.events }"
428
+ >
429
+ </es-dialog>
430
+ </template>
431
+ <es-dialog
432
+ v-else
433
+ :isReload="true"
434
+ v-bind="
435
+ handleExclAttribute({
436
+ data: item.dialog,
437
+ attrs: ['visible']
438
+ })
439
+ "
440
+ :visible.sync="item.dialog.visible"
441
+ v-on="{ ...item.dialog.events }"
442
+ >
443
+ </es-dialog>
444
+ </template>
445
+ </es-data-table>
446
+ <es-tree-group
447
+ v-if="
448
+ item.type === 'tree-group' ||
449
+ item.type === 'treeGroup'
450
+ "
451
+ v-bind="
452
+ handleExclAttribute({
453
+ data: item,
454
+ attrs: ['events', 'visible', 'type']
455
+ })
456
+ "
457
+ :key="index"
458
+ :display="show"
459
+ v-on="{ ...item.events }"
460
+ ></es-tree-group>
461
+ <iframe
462
+ v-if="item.type === 'iframe' && !item.blank"
463
+ frameborder="0"
464
+ width="100%"
465
+ height="100%"
466
+ :key="index"
467
+ :id="item.id || item.name"
468
+ :name="item.name"
469
+ :src="
470
+ handleUrlJoinParams({
471
+ url: item.url,
472
+ param: item.param || {}
473
+ })
474
+ "
475
+ ></iframe>
476
+ <es-upload
477
+ v-if="item.type === 'attachment'"
478
+ height="auto"
479
+ class="es-attachment"
480
+ v-bind="
481
+ handleExclAttribute({
482
+ data: item,
483
+ attrs: ['events', 'type']
484
+ })
485
+ "
486
+ :file-count.sync="title.count"
487
+ :key="index"
488
+ :display="show"
489
+ v-on="{ ...item.events }"
490
+ ></es-upload>
491
+ <es-dialog
492
+ v-if="item.type === 'dialog'"
493
+ :isReload="true"
494
+ v-bind="
495
+ handleExclAttribute({
496
+ data: item,
497
+ attrs: ['visible', 'type']
498
+ })
499
+ "
500
+ :key="index"
501
+ :visible.sync="item.visible"
502
+ v-on="{ ...item.events }"
503
+ >
504
+ </es-dialog>
505
+ </template>
506
+ </template>
507
+ </template>
508
+ <template v-else>
509
+ <es-form
510
+ v-if="contents.type === 'form'"
511
+ ref="esFlowForm"
512
+ v-bind="
513
+ handleExclAttribute({
514
+ data: contents,
515
+ attrs: ['events', 'visible', 'model', 'type', 'ref']
516
+ })
517
+ "
518
+ full
519
+ :model.sync="contents.model"
520
+ :display="show"
521
+ :closeDialog="false"
522
+ v-on="{ ...contents.events }"
523
+ ></es-form>
524
+ <es-data-table
525
+ v-if="
526
+ contents.type === 'data-table' ||
527
+ contents.type === 'dataTable' ||
528
+ contents.type === 'flow-list' ||
529
+ items.contents.type === 'flowList'
530
+ "
531
+ v-bind="
532
+ handleExclAttribute({
533
+ data: contents,
534
+ attrs: ['events', 'visible', 'type']
535
+ })
536
+ "
537
+ :class="{
538
+ 'es-flow-group-data-table':
539
+ contents.type === 'data-table' ||
540
+ items.contents.type === 'dataTable',
541
+ 'es-flow-list':
542
+ contents.type === 'flow-list' ||
543
+ contents.type === 'flowList'
544
+ }"
545
+ :display="show"
546
+ v-on="contents.events"
547
+ >
548
+ <template v-if="contents.dialog" slot="dialog">
549
+ <template v-if="Array.isArray(contents.dialog)">
550
+ <es-dialog
551
+ v-for="(ele, ids) in contents.dialog"
552
+ :isReload="true"
553
+ v-bind="
554
+ handleExclAttribute({
555
+ data: ele,
556
+ attrs: ['visible']
557
+ })
558
+ "
559
+ :key="ids"
560
+ :visible.sync="ele.visible"
561
+ v-on="{ ...ele.events }"
562
+ >
563
+ </es-dialog>
564
+ </template>
565
+ <es-dialog
566
+ v-else
567
+ :isReload="true"
568
+ v-bind="
569
+ handleExclAttribute({
570
+ data: contents.dialog,
571
+ attrs: ['visible']
572
+ })
573
+ "
574
+ :visible.sync="contents.dialog.visible"
575
+ v-on="{ ...contents.dialog.events }"
576
+ >
577
+ </es-dialog>
578
+ </template>
579
+ </es-data-table>
580
+ <es-tree-group
581
+ v-if="
582
+ contents.type === 'tree-group' ||
583
+ contents.type === 'treeGroup'
584
+ "
585
+ v-bind="
586
+ handleExclAttribute({
587
+ data: contents,
588
+ attrs: ['events', 'visible', 'type']
589
+ })
590
+ "
591
+ :display="show"
592
+ v-on="{ ...contents.events }"
593
+ ></es-tree-group>
594
+ <iframe
595
+ v-if="contents.type === 'iframe' && !contents.blank"
596
+ :id="contents.id || contents.name"
597
+ :name="contents.name"
598
+ frameborder="0"
599
+ width="100%"
600
+ height="100%"
601
+ :src="
602
+ handleUrlJoinParams({
603
+ url: contents.url,
604
+ param: contents.param || {}
605
+ })
606
+ "
607
+ ></iframe>
608
+ <es-upload
609
+ v-if="contents.type === 'attachment'"
610
+ v-bind="
611
+ handleExclAttribute({
612
+ data: contents,
613
+ attrs: ['events', 'type']
614
+ })
615
+ "
616
+ :display="show"
617
+ :file-count.sync="title.count"
618
+ height="auto"
619
+ class="es-attachment"
620
+ v-on="{ ...contents.events }"
621
+ ></es-upload>
622
+ </template>
623
+ </template>
624
+ </es-tabs-panel>
625
+ </template>
626
+ </el-tab-pane>
627
+ </template>
628
+ </slot>
629
+ </el-tabs>
630
+ </template>
631
+
632
+ <script>
633
+ import util from 'eoss-ui/src/utils/util';
634
+ export default {
635
+ name: 'EsTabs',
636
+ inheritAttrs: false,
637
+ provide() {
638
+ return {
639
+ esTabs: this
640
+ };
641
+ },
642
+ props: {
643
+ mold: String,
644
+ full: {
645
+ type: Boolean,
646
+ default: undefined
647
+ },
648
+ height: String,
649
+ value: {
650
+ type: String,
651
+ default: '0'
652
+ },
653
+ isSubmit: Boolean,
654
+ multiple: Boolean,
655
+ // 页面主体内容
656
+ contents: {
657
+ type: Array,
658
+ default() {
659
+ return [];
660
+ }
661
+ },
662
+ states: [Array, Object]
663
+ },
664
+ watch: {
665
+ activeName(val) {
666
+ this.$emit('input', val);
667
+ },
668
+ tabs: {
669
+ immediate: true,
670
+ deep: true,
671
+ handler(val) {
672
+ if (val.length) {
673
+ this.getState(val);
674
+ }
675
+ }
676
+ },
677
+ states: {
678
+ immediate: true,
679
+ deep: true,
680
+ handler(val) {
681
+ if (val) {
682
+ if (Array.isArray(val) && val.length) {
683
+ this.getState(val);
684
+ } else if (Object.keys(val).length) {
685
+ this.state = val;
686
+ }
687
+ }
688
+ }
689
+ }
690
+ },
691
+ computed: {
692
+ tabs() {
693
+ return this.contents ? this.contents : [];
694
+ },
695
+ isFull() {
696
+ return this.full !== undefined ? this.full : this.fill;
697
+ },
698
+ styles() {
699
+ return {
700
+ height: this.height ? this.height : this.full || this.fill ? '100%' : ''
701
+ };
702
+ }
703
+ },
704
+ data() {
705
+ return {
706
+ activeName: this.value,
707
+ state: {},
708
+ id: null,
709
+ fill: false
710
+ };
711
+ },
712
+ mounted() {
713
+ if (
714
+ this.$el.parentNode.children.length == 1 &&
715
+ util.getStyle(this.$el.parentNode, 'height')
716
+ ) {
717
+ this.fill = true;
718
+ }
719
+ },
720
+ methods: {
721
+ getState(val) {
722
+ if (this.isSubmit) {
723
+ let obj = {};
724
+ val.forEach((item, index) => {
725
+ let key = item.name || String(index);
726
+ if (Array.isArray(item.contents)) {
727
+ obj[key] = true;
728
+ for (let i = 0; i < item.contents.length; i++) {
729
+ if (item.contents[i].type === 'form') {
730
+ obj[key] = Object.prototype.hasOwnProperty.call(
731
+ item.contents[i],
732
+ 'isSubmit'
733
+ )
734
+ ? item.contents[i].isSubmit
735
+ : this.isSubmit
736
+ ? false
737
+ : true;
738
+ break;
739
+ }
740
+ }
741
+ } else {
742
+ obj[key] =
743
+ item.contents.type === 'form'
744
+ ? (obj[key] = Object.prototype.hasOwnProperty.call(
745
+ item.contents,
746
+ 'isSubmit'
747
+ )
748
+ ? item.contents.isSubmit
749
+ : this.isSubmit
750
+ ? false
751
+ : true)
752
+ : true;
753
+ }
754
+ });
755
+ this.state = obj;
756
+ }
757
+ },
758
+ handleExclAttribute({ data, attrs }) {
759
+ return util.exclAttribute({
760
+ data: data,
761
+ attrs: attrs
762
+ });
763
+ },
764
+ handleUrlJoinParams({ url, param }) {
765
+ return util.urlJoinParams({ url, param });
766
+ },
767
+ handleBefore(active, old) {
768
+ return new Promise((resolve, reject) => {
769
+ if (this.isSubmit && old !== undefined && !this.state[old]) {
770
+ reject();
771
+ this.$alert('请先保存基本信息', '提示!', {
772
+ confirmButtonText: '确定'
773
+ }).catch(() => {});
774
+ } else {
775
+ resolve();
776
+ }
777
+ });
778
+ },
779
+ handleTabState(res) {
780
+ this.isSubmit && this.$set(this.state, this.activeName, res);
781
+ },
782
+ handleChangeData(res) {
783
+ this.$emit('changeData', res);
784
+ this.$emit('change-data', res);
785
+ }
786
+ }
787
+ };
788
+ </script>