eoss-ui 0.5.30 → 0.5.31

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