eoss-ui 0.4.66 → 0.4.67
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.
- package/lib/checkbox-group.js +36 -7
- package/lib/dialog.js +3 -3
- package/lib/editor.js +2 -2
- package/lib/eoss-ui.common.js +270 -133
- package/lib/form.js +9 -4
- package/lib/index.js +1 -1
- package/lib/main.js +70 -51
- package/lib/menu.js +7 -3
- package/lib/nav.js +3 -2
- package/lib/player.js +2 -2
- package/lib/radio-group.js +36 -7
- package/lib/select-ganged.js +25 -5
- package/lib/select.js +55 -15
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/package.json +1 -1
- package/packages/checkbox-group/src/main.vue +47 -5
- package/packages/form/src/main.vue +7 -2
- package/packages/main/src/main.vue +30 -15
- package/packages/main/src/userinfo.vue +12 -2
- package/packages/menu/src/main.vue +19 -3
- package/packages/nav/src/main.vue +1 -0
- package/packages/radio-group/src/main.vue +47 -5
- package/packages/select/src/main.vue +66 -21
- package/packages/select-ganged/src/main.vue +42 -18
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/src/main.scss +5 -1
- package/packages/theme-chalk/src/menu.scss +1 -1
- package/src/index.js +1 -1
|
@@ -88,7 +88,9 @@ export default {
|
|
|
88
88
|
return {
|
|
89
89
|
maxH: '',
|
|
90
90
|
maxW: '',
|
|
91
|
-
menuId: null
|
|
91
|
+
menuId: null,
|
|
92
|
+
defaultOpeneds: [],
|
|
93
|
+
isChange: false
|
|
92
94
|
};
|
|
93
95
|
},
|
|
94
96
|
mounted() {},
|
|
@@ -110,6 +112,7 @@ export default {
|
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
114
|
handleSelect(key, keyPath, item) {
|
|
115
|
+
this.isChange = true;
|
|
113
116
|
if (this.menuId !== null && keyPath.indexOf(this.menuId) == -1) {
|
|
114
117
|
this.$refs.menu.close(this.menuId);
|
|
115
118
|
} else {
|
|
@@ -232,7 +235,13 @@ export default {
|
|
|
232
235
|
h(
|
|
233
236
|
'el-submenu',
|
|
234
237
|
{
|
|
235
|
-
class: [
|
|
238
|
+
class: [
|
|
239
|
+
'es-submenu',
|
|
240
|
+
`es-submenu-${this.mode}`,
|
|
241
|
+
item.id === this.active && !this.isChange
|
|
242
|
+
? 'es-menu-item-focus'
|
|
243
|
+
: ''
|
|
244
|
+
],
|
|
236
245
|
props: {
|
|
237
246
|
popperClass: popper,
|
|
238
247
|
popperAppendToBody: true,
|
|
@@ -264,7 +273,13 @@ export default {
|
|
|
264
273
|
h(
|
|
265
274
|
'el-submenu',
|
|
266
275
|
{
|
|
267
|
-
class: [
|
|
276
|
+
class: [
|
|
277
|
+
'es-submenu',
|
|
278
|
+
`es-submenu-${this.mode}`,
|
|
279
|
+
item.id === this.active && !this.isChange
|
|
280
|
+
? 'es-menu-item-focus'
|
|
281
|
+
: ''
|
|
282
|
+
],
|
|
268
283
|
props: {
|
|
269
284
|
popperClass: popper,
|
|
270
285
|
popperAppendToBody: true,
|
|
@@ -409,6 +424,7 @@ export default {
|
|
|
409
424
|
],
|
|
410
425
|
ref: 'menu',
|
|
411
426
|
props: {
|
|
427
|
+
defaultOpeneds: this.defaultOpeneds,
|
|
412
428
|
defaultActive: this.active,
|
|
413
429
|
collapse: this.collapse,
|
|
414
430
|
mode: this.mode,
|
|
@@ -60,6 +60,14 @@ import util from 'eoss-ui/src/utils/util';
|
|
|
60
60
|
export default {
|
|
61
61
|
name: 'EsRadioGroup',
|
|
62
62
|
inheritAttrs: false,
|
|
63
|
+
inject: {
|
|
64
|
+
esForm: {
|
|
65
|
+
default: ''
|
|
66
|
+
},
|
|
67
|
+
sysCodes: {
|
|
68
|
+
default: ''
|
|
69
|
+
}
|
|
70
|
+
},
|
|
63
71
|
props: {
|
|
64
72
|
method: {
|
|
65
73
|
type: String,
|
|
@@ -121,11 +129,13 @@ export default {
|
|
|
121
129
|
isNoParamRequest: {
|
|
122
130
|
type: Boolean,
|
|
123
131
|
default: true
|
|
124
|
-
}
|
|
132
|
+
},
|
|
133
|
+
dataKey: String
|
|
125
134
|
},
|
|
126
135
|
data() {
|
|
127
136
|
return {
|
|
128
|
-
options: null
|
|
137
|
+
options: null,
|
|
138
|
+
canceled: false
|
|
129
139
|
};
|
|
130
140
|
},
|
|
131
141
|
computed: {
|
|
@@ -214,6 +224,27 @@ export default {
|
|
|
214
224
|
handler() {
|
|
215
225
|
this.url && this.getData(this.url);
|
|
216
226
|
}
|
|
227
|
+
},
|
|
228
|
+
sysCodes: {
|
|
229
|
+
deep: true,
|
|
230
|
+
handler(val) {
|
|
231
|
+
if (
|
|
232
|
+
this.canceled &&
|
|
233
|
+
val &&
|
|
234
|
+
((this.sysCode && val[this.sysCode]) ||
|
|
235
|
+
(this.dataKey && val[this.dataKey]))
|
|
236
|
+
) {
|
|
237
|
+
if (this.parseData) {
|
|
238
|
+
this.options = this.parseData(
|
|
239
|
+
JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey]))
|
|
240
|
+
);
|
|
241
|
+
} else {
|
|
242
|
+
this.options = JSON.parse(
|
|
243
|
+
JSON.stringify(val[this.sysCode || this.dataKey])
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
217
248
|
}
|
|
218
249
|
},
|
|
219
250
|
created() {},
|
|
@@ -246,17 +277,28 @@ export default {
|
|
|
246
277
|
})
|
|
247
278
|
.then((res) => {
|
|
248
279
|
this.loading = false;
|
|
280
|
+
this.canceled = false;
|
|
249
281
|
if (res.rCode === 0) {
|
|
250
282
|
this.options = JSON.parse(JSON.stringify(res.results));
|
|
251
|
-
if (sysCode) {
|
|
283
|
+
if (sysCode || this.dataKey) {
|
|
284
|
+
this.esForm &&
|
|
285
|
+
this.esForm.setSysCodes(
|
|
286
|
+
sysCode || this.dataKey,
|
|
287
|
+
JSON.parse(JSON.stringify(this.options))
|
|
288
|
+
);
|
|
252
289
|
store.set(sysCode, JSON.parse(JSON.stringify(res.results)));
|
|
253
290
|
}
|
|
254
291
|
}
|
|
255
292
|
})
|
|
256
293
|
.catch((err) => {
|
|
257
294
|
this.loading = false;
|
|
258
|
-
if (err.message
|
|
259
|
-
|
|
295
|
+
if (err.message) {
|
|
296
|
+
if (err.message !== 'canceled') {
|
|
297
|
+
this.$message.error(err.message);
|
|
298
|
+
}
|
|
299
|
+
if (err.message === 'canceled' && sysCode) {
|
|
300
|
+
this.canceled = true;
|
|
301
|
+
}
|
|
260
302
|
}
|
|
261
303
|
});
|
|
262
304
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { findSysCode } from 'eoss-ui/src/config/api.js';
|
|
3
3
|
import store from 'eoss-ui/src/utils/store';
|
|
4
4
|
import util from 'eoss-ui/src/utils/util';
|
|
5
|
+
import { string } from 'slate';
|
|
5
6
|
export default {
|
|
6
7
|
name: 'EsSelect',
|
|
7
8
|
componentName: 'EsSelect',
|
|
@@ -11,6 +12,14 @@ export default {
|
|
|
11
12
|
esSelect: this
|
|
12
13
|
};
|
|
13
14
|
},
|
|
15
|
+
inject: {
|
|
16
|
+
esForm: {
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
19
|
+
sysCodes: {
|
|
20
|
+
default: ''
|
|
21
|
+
}
|
|
22
|
+
},
|
|
14
23
|
props: {
|
|
15
24
|
value: [String, Array, Object, Number],
|
|
16
25
|
method: {
|
|
@@ -119,7 +128,8 @@ export default {
|
|
|
119
128
|
isNoParamRequest: {
|
|
120
129
|
type: Boolean,
|
|
121
130
|
default: true
|
|
122
|
-
}
|
|
131
|
+
},
|
|
132
|
+
dataKey: String
|
|
123
133
|
},
|
|
124
134
|
data() {
|
|
125
135
|
return {
|
|
@@ -127,7 +137,8 @@ export default {
|
|
|
127
137
|
options: '',
|
|
128
138
|
valKey: this.valueKey,
|
|
129
139
|
label: this.labelKey,
|
|
130
|
-
hidden: false
|
|
140
|
+
hidden: false,
|
|
141
|
+
canceled: false
|
|
131
142
|
};
|
|
132
143
|
},
|
|
133
144
|
computed: {
|
|
@@ -214,6 +225,27 @@ export default {
|
|
|
214
225
|
this.getData(this.sysCode);
|
|
215
226
|
}
|
|
216
227
|
}
|
|
228
|
+
},
|
|
229
|
+
sysCodes: {
|
|
230
|
+
deep: true,
|
|
231
|
+
handler(val) {
|
|
232
|
+
if (
|
|
233
|
+
this.canceled &&
|
|
234
|
+
val &&
|
|
235
|
+
((this.sysCode && val[this.sysCode]) ||
|
|
236
|
+
(this.dataKey && val[this.dataKey]))
|
|
237
|
+
) {
|
|
238
|
+
if (this.parseData) {
|
|
239
|
+
this.options = this.parseData(
|
|
240
|
+
JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey]))
|
|
241
|
+
);
|
|
242
|
+
} else {
|
|
243
|
+
this.options = JSON.parse(
|
|
244
|
+
JSON.stringify(val[this.sysCode || this.dataKey])
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
217
249
|
}
|
|
218
250
|
},
|
|
219
251
|
mounted() {
|
|
@@ -321,13 +353,21 @@ export default {
|
|
|
321
353
|
})
|
|
322
354
|
.then((res) => {
|
|
323
355
|
this.loading = false;
|
|
356
|
+
this.canceled = false;
|
|
324
357
|
if (res.rCode === 0) {
|
|
325
358
|
if (this.parseData) {
|
|
326
|
-
this.options = this.parseData(
|
|
359
|
+
this.options = this.parseData(
|
|
360
|
+
JSON.parse(JSON.stringify(res.results))
|
|
361
|
+
);
|
|
327
362
|
} else {
|
|
328
363
|
this.options = JSON.parse(JSON.stringify(res.results));
|
|
329
364
|
}
|
|
330
|
-
if (sysCode) {
|
|
365
|
+
if (sysCode || this.dataKey) {
|
|
366
|
+
this.esForm &&
|
|
367
|
+
this.esForm.setSysCodes(
|
|
368
|
+
sysCode || this.dataKey,
|
|
369
|
+
JSON.parse(JSON.stringify(this.options))
|
|
370
|
+
);
|
|
331
371
|
store.set(sysCode, JSON.parse(JSON.stringify(this.options)));
|
|
332
372
|
}
|
|
333
373
|
} else {
|
|
@@ -336,14 +376,19 @@ export default {
|
|
|
336
376
|
})
|
|
337
377
|
.catch((err) => {
|
|
338
378
|
this.loading = false;
|
|
339
|
-
if (err.message
|
|
340
|
-
|
|
379
|
+
if (err.message) {
|
|
380
|
+
if (err.message !== 'canceled') {
|
|
381
|
+
this.$message.error(err.message);
|
|
382
|
+
}
|
|
383
|
+
if (err.message === 'canceled' && sysCode) {
|
|
384
|
+
this.canceled = true;
|
|
385
|
+
}
|
|
341
386
|
}
|
|
342
387
|
});
|
|
343
388
|
},
|
|
344
389
|
search(query) {
|
|
345
|
-
if (query !== '') {
|
|
346
|
-
if (this.url !== '') {
|
|
390
|
+
if (query && query !== '') {
|
|
391
|
+
if (this.url && this.url !== '') {
|
|
347
392
|
this.loading = true;
|
|
348
393
|
let params = {};
|
|
349
394
|
params[this.remoteKey] = query;
|
|
@@ -358,19 +403,7 @@ export default {
|
|
|
358
403
|
.then((res) => {
|
|
359
404
|
this.loading = false;
|
|
360
405
|
if (res.rCode === 0) {
|
|
361
|
-
this.options = res.results
|
|
362
|
-
if (item[this.label]) {
|
|
363
|
-
return (
|
|
364
|
-
item[this.label]
|
|
365
|
-
.toLowerCase()
|
|
366
|
-
.indexOf(query.toLowerCase()) > -1
|
|
367
|
-
);
|
|
368
|
-
} else {
|
|
369
|
-
return (
|
|
370
|
-
item.label.toLowerCase().indexOf(query.toLowerCase()) > -1
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
});
|
|
406
|
+
this.options = JSON.parse(JSON.stringify(res.results));
|
|
374
407
|
}
|
|
375
408
|
})
|
|
376
409
|
.catch((err) => {
|
|
@@ -509,6 +542,12 @@ export default {
|
|
|
509
542
|
.then((res) => {
|
|
510
543
|
this.loading = false;
|
|
511
544
|
this.$set(data, 'children', JSON.parse(JSON.stringify(res)));
|
|
545
|
+
if (this.dataKey && this.esForm) {
|
|
546
|
+
this.esForm.setSysCodes(
|
|
547
|
+
this.dataKey,
|
|
548
|
+
JSON.parse(JSON.stringify(this.options))
|
|
549
|
+
);
|
|
550
|
+
}
|
|
512
551
|
})
|
|
513
552
|
.catch((e) => {
|
|
514
553
|
this.loading = false;
|
|
@@ -536,6 +575,12 @@ export default {
|
|
|
536
575
|
} else {
|
|
537
576
|
console.error('tree数据格式错误');
|
|
538
577
|
}
|
|
578
|
+
if (this.dataKey && this.esForm) {
|
|
579
|
+
this.esForm.setSysCodes(
|
|
580
|
+
this.dataKey,
|
|
581
|
+
JSON.parse(JSON.stringify(this.options))
|
|
582
|
+
);
|
|
583
|
+
}
|
|
539
584
|
}
|
|
540
585
|
})
|
|
541
586
|
.catch((err) => {
|
|
@@ -9,6 +9,14 @@ export default {
|
|
|
9
9
|
ganged: this
|
|
10
10
|
};
|
|
11
11
|
},
|
|
12
|
+
inject: {
|
|
13
|
+
esForm: {
|
|
14
|
+
default: ''
|
|
15
|
+
},
|
|
16
|
+
sysCodes: {
|
|
17
|
+
default: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
12
20
|
props: {
|
|
13
21
|
method: {
|
|
14
22
|
type: String,
|
|
@@ -38,7 +46,7 @@ export default {
|
|
|
38
46
|
valueType: {
|
|
39
47
|
type: String,
|
|
40
48
|
default: 'object',
|
|
41
|
-
validator: function(value) {
|
|
49
|
+
validator: function (value) {
|
|
42
50
|
return ['string', 'object'].includes(value);
|
|
43
51
|
}
|
|
44
52
|
},
|
|
@@ -102,7 +110,8 @@ export default {
|
|
|
102
110
|
type: String,
|
|
103
111
|
default: 'hasSub'
|
|
104
112
|
},
|
|
105
|
-
defaultValue: Boolean
|
|
113
|
+
defaultValue: Boolean,
|
|
114
|
+
dataKey: String
|
|
106
115
|
},
|
|
107
116
|
data() {
|
|
108
117
|
return {
|
|
@@ -114,7 +123,8 @@ export default {
|
|
|
114
123
|
wheres: [{}],
|
|
115
124
|
first: true,
|
|
116
125
|
height: undefined,
|
|
117
|
-
gangedNum: null
|
|
126
|
+
gangedNum: null,
|
|
127
|
+
canceled: false
|
|
118
128
|
};
|
|
119
129
|
},
|
|
120
130
|
computed: {
|
|
@@ -154,7 +164,7 @@ export default {
|
|
|
154
164
|
}
|
|
155
165
|
let multiples = [];
|
|
156
166
|
if (this.multiple === undefined && this.value.length) {
|
|
157
|
-
multiples = this.value.map(item => {
|
|
167
|
+
multiples = this.value.map((item) => {
|
|
158
168
|
return Array.isArray(item);
|
|
159
169
|
});
|
|
160
170
|
} else if (Array.isArray(this.multiple) && this.multiple.length) {
|
|
@@ -234,15 +244,29 @@ export default {
|
|
|
234
244
|
params: this.param,
|
|
235
245
|
data: this.param
|
|
236
246
|
})
|
|
237
|
-
.then(res => {
|
|
247
|
+
.then((res) => {
|
|
248
|
+
this.canceled = false;
|
|
238
249
|
if (res.rCode === 0) {
|
|
239
250
|
this.lists = res.results;
|
|
240
251
|
this.getChildren(this.results, this.values);
|
|
252
|
+
if (sysCode || this.dataKey) {
|
|
253
|
+
this.esForm &&
|
|
254
|
+
this.esForm.setSysCodes(
|
|
255
|
+
sysCode || this.dataKey,
|
|
256
|
+
JSON.parse(JSON.stringify(this.lists))
|
|
257
|
+
);
|
|
258
|
+
store.set(sysCode, JSON.parse(JSON.stringify(this.lists)));
|
|
259
|
+
}
|
|
241
260
|
}
|
|
242
261
|
})
|
|
243
|
-
.catch(
|
|
244
|
-
if (err.message
|
|
245
|
-
|
|
262
|
+
.catch((err) => {
|
|
263
|
+
if (err.message) {
|
|
264
|
+
if (err.message !== 'canceled') {
|
|
265
|
+
this.$message.error(err.message);
|
|
266
|
+
}
|
|
267
|
+
if (err.message === 'canceled' && sysCode) {
|
|
268
|
+
this.canceled = true;
|
|
269
|
+
}
|
|
246
270
|
}
|
|
247
271
|
});
|
|
248
272
|
},
|
|
@@ -301,7 +325,7 @@ export default {
|
|
|
301
325
|
if (this.queryKey !== undefined) {
|
|
302
326
|
if (typeof this.queryKey === 'string') {
|
|
303
327
|
if (Array.isArray(values[i])) {
|
|
304
|
-
params[this.queryKey] = values[i].map(item => {
|
|
328
|
+
params[this.queryKey] = values[i].map((item) => {
|
|
305
329
|
return item[this.queryKey];
|
|
306
330
|
});
|
|
307
331
|
} else {
|
|
@@ -310,7 +334,7 @@ export default {
|
|
|
310
334
|
} else {
|
|
311
335
|
for (let x in this.queryKey) {
|
|
312
336
|
if (Array.isArray(values[i])) {
|
|
313
|
-
params[x] = values[i].map(item => {
|
|
337
|
+
params[x] = values[i].map((item) => {
|
|
314
338
|
return item[this.queryKey[x]];
|
|
315
339
|
});
|
|
316
340
|
} else {
|
|
@@ -431,14 +455,14 @@ export default {
|
|
|
431
455
|
if (this.queryKey !== undefined) {
|
|
432
456
|
if (typeof this.queryKey === 'string') {
|
|
433
457
|
params[this.queryKey] = Array.isArray(val)
|
|
434
|
-
? val.map(item => {
|
|
458
|
+
? val.map((item) => {
|
|
435
459
|
return item[this.queryKey];
|
|
436
460
|
})
|
|
437
461
|
: val[this.queryKey];
|
|
438
462
|
} else {
|
|
439
463
|
for (let i in this.queryKey) {
|
|
440
464
|
params[i] = Array.isArray(val)
|
|
441
|
-
? val.map(item => {
|
|
465
|
+
? val.map((item) => {
|
|
442
466
|
return item[this.queryKey[i]];
|
|
443
467
|
})
|
|
444
468
|
: val[this.queryKey[i]];
|
|
@@ -446,7 +470,7 @@ export default {
|
|
|
446
470
|
}
|
|
447
471
|
} else {
|
|
448
472
|
params.id = Array.isArray(val)
|
|
449
|
-
? val.map(item => {
|
|
473
|
+
? val.map((item) => {
|
|
450
474
|
return item[this.valueKey];
|
|
451
475
|
})
|
|
452
476
|
: val[this.valueKey];
|
|
@@ -459,8 +483,8 @@ export default {
|
|
|
459
483
|
for (let i = key + 1; i < this.gangedNum; i++) {
|
|
460
484
|
if (this.multiples[i - 1]) {
|
|
461
485
|
let newVal = [];
|
|
462
|
-
this.values[i - 1].forEach(element => {
|
|
463
|
-
this.values[i].forEach(itemVal => {
|
|
486
|
+
this.values[i - 1].forEach((element) => {
|
|
487
|
+
this.values[i].forEach((itemVal) => {
|
|
464
488
|
if (element[this.valueKey] === itemVal[this.filtrateKey]) {
|
|
465
489
|
newVal.push(itemVal);
|
|
466
490
|
}
|
|
@@ -524,7 +548,7 @@ export default {
|
|
|
524
548
|
let values = [];
|
|
525
549
|
this.value.forEach((item, index) => {
|
|
526
550
|
if (Array.isArray(item)) {
|
|
527
|
-
item.forEach(ele => {
|
|
551
|
+
item.forEach((ele) => {
|
|
528
552
|
let obj = ele;
|
|
529
553
|
if (!ele[this.filtrateKey]) {
|
|
530
554
|
obj = this.getLabel(ele[this.valueKey] || ele, index);
|
|
@@ -658,10 +682,10 @@ export default {
|
|
|
658
682
|
defaultValue: i === 0 ? this.defaultValue : false
|
|
659
683
|
},
|
|
660
684
|
on: {
|
|
661
|
-
change: val => {
|
|
685
|
+
change: (val) => {
|
|
662
686
|
this.handeChange(val, i);
|
|
663
687
|
},
|
|
664
|
-
resetInputHeight: val => {
|
|
688
|
+
resetInputHeight: (val) => {
|
|
665
689
|
this.height = val;
|
|
666
690
|
}
|
|
667
691
|
}
|