eoss-ui 0.4.65 → 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/button-group.js +17 -8
- package/lib/button.js +17 -8
- package/lib/checkbox-group.js +53 -15
- package/lib/data-table-form.js +17 -8
- package/lib/data-table.js +17 -8
- package/lib/date-picker.js +17 -8
- package/lib/dialog.js +20 -11
- package/lib/editor.js +2 -2
- package/lib/eoss-ui.common.js +6479 -5844
- package/lib/flow-group.js +17 -8
- package/lib/flow-list.js +17 -8
- package/lib/flow.js +22 -12
- package/lib/form.js +6354 -5979
- package/lib/handle-user.js +17 -8
- package/lib/handler.js +17 -8
- package/lib/index.js +1 -1
- package/lib/input-number.js +17 -8
- package/lib/input.js +37 -15
- package/lib/login.js +22 -15
- package/lib/main.js +138 -101
- package/lib/menu.js +7 -3
- package/lib/nav.js +21 -11
- package/lib/page.js +17 -8
- package/lib/player.js +19 -10
- package/lib/qr-code.js +17 -8
- package/lib/radio-group.js +53 -15
- package/lib/retrial-auth.js +17 -8
- package/lib/select-ganged.js +42 -13
- package/lib/select.js +72 -23
- package/lib/selector-panel.js +17 -8
- package/lib/selector.js +17 -8
- package/lib/sizer.js +17 -8
- package/lib/steps.js +17 -8
- package/lib/switch.js +17 -8
- package/lib/table-form.js +1320 -1204
- package/lib/tabs.js +17 -8
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/tips.js +17 -8
- package/lib/tree-group.js +17 -8
- package/lib/tree.js +17 -8
- package/lib/upload.js +17 -8
- package/lib/utils/util.js +17 -8
- package/lib/wujie.js +17 -8
- package/lib/wxlogin.js +17 -8
- package/package.json +2 -2
- package/packages/checkbox-group/src/main.vue +47 -5
- package/packages/flow/src/main.vue +6 -5
- package/packages/form/src/main.vue +1442 -1315
- package/packages/form/src/table.vue +375 -318
- package/packages/input/src/main.vue +20 -7
- package/packages/login/src/main.vue +3 -5
- package/packages/main/src/main.vue +82 -61
- package/packages/main/src/userinfo.vue +12 -2
- package/packages/menu/src/main.vue +19 -3
- package/packages/nav/src/main.vue +2 -1
- 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
- package/src/utils/util.js +18 -8
|
@@ -48,9 +48,18 @@ export default {
|
|
|
48
48
|
scope: {},
|
|
49
49
|
exclude: Boolean
|
|
50
50
|
},
|
|
51
|
+
watch: {
|
|
52
|
+
data: {
|
|
53
|
+
immediate: true,
|
|
54
|
+
deep: true,
|
|
55
|
+
handler(val) {
|
|
56
|
+
this.results = val;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
51
60
|
data() {
|
|
52
61
|
return {
|
|
53
|
-
results:
|
|
62
|
+
results: []
|
|
54
63
|
};
|
|
55
64
|
},
|
|
56
65
|
computed: {
|
|
@@ -120,7 +129,7 @@ export default {
|
|
|
120
129
|
},
|
|
121
130
|
mounted() {},
|
|
122
131
|
methods: {
|
|
123
|
-
getData(query, callback) {
|
|
132
|
+
getData(query, callback, isChange) {
|
|
124
133
|
if (typeof this.url && this.results.length === 0) {
|
|
125
134
|
util
|
|
126
135
|
.ajax({
|
|
@@ -145,17 +154,21 @@ export default {
|
|
|
145
154
|
});
|
|
146
155
|
} else {
|
|
147
156
|
let results = query
|
|
148
|
-
? this.results.filter(this.searchFilter(query))
|
|
157
|
+
? this.results.filter(this.searchFilter(query, isChange))
|
|
149
158
|
: this.results;
|
|
150
159
|
callback(results);
|
|
151
160
|
}
|
|
152
161
|
},
|
|
153
|
-
searchFilter(query) {
|
|
162
|
+
searchFilter(query, isChange) {
|
|
154
163
|
return (state) => {
|
|
155
|
-
if (
|
|
156
|
-
return state.value.
|
|
164
|
+
if (isChange) {
|
|
165
|
+
return state.value.indexOf(query) > -1;
|
|
157
166
|
} else {
|
|
158
|
-
|
|
167
|
+
if (this.exclude) {
|
|
168
|
+
return state.value !== query;
|
|
169
|
+
} else {
|
|
170
|
+
return state.value === query;
|
|
171
|
+
}
|
|
159
172
|
}
|
|
160
173
|
};
|
|
161
174
|
},
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
:focusShow="focusShow"
|
|
66
66
|
:data="users"
|
|
67
67
|
@select="handleBlur"
|
|
68
|
-
autocomplete="
|
|
68
|
+
:autocomplete="true"
|
|
69
69
|
>
|
|
70
70
|
<template slot="prefix">
|
|
71
71
|
<i class="es-icon-zhanghao es-label-user"></i>
|
|
@@ -849,10 +849,8 @@ export default {
|
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
},
|
|
852
|
-
handleBlur() {
|
|
853
|
-
|
|
854
|
-
this.getRemember(this.formData.username);
|
|
855
|
-
}
|
|
852
|
+
handleBlur(res) {
|
|
853
|
+
this.getRemember(res.value);
|
|
856
854
|
},
|
|
857
855
|
handleRemember() {
|
|
858
856
|
let values = localStorage.getItem('unpd');
|
|
@@ -707,13 +707,16 @@ export default {
|
|
|
707
707
|
}
|
|
708
708
|
},
|
|
709
709
|
setTitle(id) {
|
|
710
|
+
let node;
|
|
710
711
|
for (let i = 0; i < this.menus.length; i++) {
|
|
711
712
|
let item = this.menus[i];
|
|
712
713
|
if (item.id == id) {
|
|
713
714
|
this.title = item.text;
|
|
714
|
-
|
|
715
|
+
node = item;
|
|
716
|
+
break;
|
|
715
717
|
}
|
|
716
718
|
}
|
|
719
|
+
return node;
|
|
717
720
|
},
|
|
718
721
|
renderMenu() {
|
|
719
722
|
if (this.data !== undefined && this.data.length) {
|
|
@@ -1224,6 +1227,7 @@ export default {
|
|
|
1224
1227
|
},
|
|
1225
1228
|
//设置默认导航页面
|
|
1226
1229
|
setDefault(res, active) {
|
|
1230
|
+
this.navIds = JSON.parse(JSON.stringify(active));
|
|
1227
1231
|
this.sysId = '';
|
|
1228
1232
|
this.tabsId = '';
|
|
1229
1233
|
this.active = '';
|
|
@@ -1335,18 +1339,7 @@ export default {
|
|
|
1335
1339
|
},
|
|
1336
1340
|
//应用导航交互
|
|
1337
1341
|
handleSelect(res, type, open) {
|
|
1338
|
-
console.log(type, 11);
|
|
1339
1342
|
const { node, fourthTabs } = res;
|
|
1340
|
-
let openIdex = 0;
|
|
1341
|
-
if (
|
|
1342
|
-
node.extendData &&
|
|
1343
|
-
(node.extendData.subDefOpenIndex || node.extendData.subDefOpen)
|
|
1344
|
-
) {
|
|
1345
|
-
openIdex = parseInt(
|
|
1346
|
-
node.extendData.subDefOpenIndex || node.extendData.subDefOpen,
|
|
1347
|
-
10
|
|
1348
|
-
);
|
|
1349
|
-
}
|
|
1350
1343
|
if (!open) {
|
|
1351
1344
|
if (
|
|
1352
1345
|
node.extendData &&
|
|
@@ -1364,13 +1357,16 @@ export default {
|
|
|
1364
1357
|
switch (type) {
|
|
1365
1358
|
case 'nav':
|
|
1366
1359
|
this.tabs = [];
|
|
1367
|
-
this.active = '';
|
|
1360
|
+
//this.active = '';
|
|
1368
1361
|
if (this.layout === 'topside') {
|
|
1369
|
-
this.
|
|
1370
|
-
|
|
1371
|
-
|
|
1362
|
+
if (this.title !== node.text) {
|
|
1363
|
+
this.navIds = [node.id];
|
|
1364
|
+
this.menu = node.children;
|
|
1365
|
+
this.active = node.id;
|
|
1366
|
+
this.title = node.text;
|
|
1367
|
+
}
|
|
1372
1368
|
if (this.setFirstAsDefault) {
|
|
1373
|
-
let subNode = this.getFirst(node
|
|
1369
|
+
let subNode = this.getFirst(node);
|
|
1374
1370
|
if (subNode) {
|
|
1375
1371
|
this.active = subNode.id;
|
|
1376
1372
|
this.navIds = [
|
|
@@ -1381,7 +1377,7 @@ export default {
|
|
|
1381
1377
|
}
|
|
1382
1378
|
} else {
|
|
1383
1379
|
this.navIds = this.getId(this.menus, node.url, true);
|
|
1384
|
-
this.setTitle(
|
|
1380
|
+
this.setTitle(this.navIds[0]);
|
|
1385
1381
|
this.tabsId = fourthTabs ? node.id : '';
|
|
1386
1382
|
}
|
|
1387
1383
|
break;
|
|
@@ -1390,9 +1386,19 @@ export default {
|
|
|
1390
1386
|
this.navIds = [node.id];
|
|
1391
1387
|
this.tabs = [];
|
|
1392
1388
|
this.menu = node.children;
|
|
1393
|
-
this.title
|
|
1389
|
+
if (this.title !== node.text) {
|
|
1390
|
+
this.active = '';
|
|
1391
|
+
this.title = node.text;
|
|
1392
|
+
}
|
|
1394
1393
|
if (this.setFirstAsDefault) {
|
|
1395
|
-
|
|
1394
|
+
let subNode = this.getFirst(node);
|
|
1395
|
+
if (subNode) {
|
|
1396
|
+
this.active = subNode.id;
|
|
1397
|
+
this.navIds = [
|
|
1398
|
+
node.id,
|
|
1399
|
+
...this.getId(node.children, subNode.url, true)
|
|
1400
|
+
];
|
|
1401
|
+
}
|
|
1396
1402
|
}
|
|
1397
1403
|
this.isSide = true;
|
|
1398
1404
|
}
|
|
@@ -1402,6 +1408,10 @@ export default {
|
|
|
1402
1408
|
if (node.url) {
|
|
1403
1409
|
this.tabs = [];
|
|
1404
1410
|
}
|
|
1411
|
+
if (this.title !== node.text) {
|
|
1412
|
+
this.active = [node.id];
|
|
1413
|
+
this.title = node.text;
|
|
1414
|
+
}
|
|
1405
1415
|
if (this.setFirstAsDefault) {
|
|
1406
1416
|
let subNode = this.getFirst(node);
|
|
1407
1417
|
this.active = [node.id];
|
|
@@ -1414,48 +1424,61 @@ export default {
|
|
|
1414
1424
|
case 'menu':
|
|
1415
1425
|
if (!open) {
|
|
1416
1426
|
this.tabs = [];
|
|
1417
|
-
if (this.
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
this.active = node.id;
|
|
1422
|
-
}
|
|
1427
|
+
if (this.biserial) {
|
|
1428
|
+
this.$set(this.active, 1, node.id);
|
|
1429
|
+
} else {
|
|
1430
|
+
this.active = node.id;
|
|
1423
1431
|
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1432
|
+
if (node.url) {
|
|
1433
|
+
if (node.children && node.children.length) {
|
|
1434
|
+
let tab = node.children.filter((item) => {
|
|
1435
|
+
return item.url === node.url;
|
|
1436
|
+
})[0];
|
|
1437
|
+
if (tab) {
|
|
1438
|
+
if (this.biserial) {
|
|
1439
|
+
this.$set(this.active, 1, tab.id);
|
|
1440
|
+
} else {
|
|
1441
|
+
this.active = tab.id;
|
|
1442
|
+
}
|
|
1443
|
+
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1444
|
+
}
|
|
1445
|
+
} else {
|
|
1446
|
+
let tab = (node.fourthTabs || []).filter((item) => {
|
|
1447
|
+
return item.url === node.url;
|
|
1448
|
+
})[0];
|
|
1449
|
+
if (tab) {
|
|
1450
|
+
this.tabs = node.fourthTabs;
|
|
1451
|
+
this.tabsId = tab.id;
|
|
1452
|
+
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1433
1453
|
} else {
|
|
1434
|
-
this.
|
|
1454
|
+
this.navIds = this.getId(this.menus, node.url, true);
|
|
1435
1455
|
}
|
|
1436
|
-
this.navIds = this.getId(this.menus, tab.url, true);
|
|
1437
1456
|
}
|
|
1438
1457
|
} else {
|
|
1439
|
-
|
|
1440
|
-
return item.url === node.url;
|
|
1441
|
-
})[0];
|
|
1442
|
-
if (tab) {
|
|
1458
|
+
if (node.fourthTabs.length) {
|
|
1443
1459
|
this.tabs = node.fourthTabs;
|
|
1444
|
-
this.tabsId =
|
|
1445
|
-
this.
|
|
1446
|
-
|
|
1447
|
-
|
|
1460
|
+
this.tabsId = this.tabs[0].id;
|
|
1461
|
+
this.handleJump(
|
|
1462
|
+
this.tabs[0].url,
|
|
1463
|
+
this.tabs[0].urlopenmode,
|
|
1464
|
+
this.tabs[0]
|
|
1465
|
+
);
|
|
1466
|
+
this.navIds = this.getId(this.menus, this.tabs[0].url, true);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
} else {
|
|
1470
|
+
if (this.setFirstAsDefault) {
|
|
1471
|
+
this.tabs = [];
|
|
1472
|
+
let subNode = this.getFirst(node);
|
|
1473
|
+
if (subNode) {
|
|
1474
|
+
if (this.biserial) {
|
|
1475
|
+
this.$set(this.active, 1, subNode.id);
|
|
1476
|
+
} else {
|
|
1477
|
+
this.active = subNode.id;
|
|
1478
|
+
}
|
|
1479
|
+
this.navIds = this.getId(this.menus, subNode.url, true);
|
|
1448
1480
|
}
|
|
1449
1481
|
}
|
|
1450
|
-
} else if (node.fourthTabs.length) {
|
|
1451
|
-
this.tabs = node.fourthTabs;
|
|
1452
|
-
this.tabsId = this.tabs[0].id;
|
|
1453
|
-
this.handleJump(
|
|
1454
|
-
this.tabs[0].url,
|
|
1455
|
-
this.tabs[0].urlopenmode,
|
|
1456
|
-
this.tabs[0]
|
|
1457
|
-
);
|
|
1458
|
-
this.navIds = this.getId(this.menus, this.tabs[0].url, true);
|
|
1459
1482
|
}
|
|
1460
1483
|
break;
|
|
1461
1484
|
case 'tabs':
|
|
@@ -1671,13 +1694,8 @@ export default {
|
|
|
1671
1694
|
}
|
|
1672
1695
|
}
|
|
1673
1696
|
} else {
|
|
1674
|
-
if (menus.fourthTabs && menus.fourthTabs.length) {
|
|
1675
|
-
|
|
1676
|
-
let item = menus.fourthTabs[i];
|
|
1677
|
-
if (item.id === id) {
|
|
1678
|
-
return item;
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1697
|
+
if (menus.fourthTabs && menus.fourthTabs.length && menus.id === id) {
|
|
1698
|
+
return menus;
|
|
1681
1699
|
}
|
|
1682
1700
|
if (menus.children && menus.children.length) {
|
|
1683
1701
|
for (let i = 0; i < menus.children.length; i++) {
|
|
@@ -1691,6 +1709,9 @@ export default {
|
|
|
1691
1709
|
return false;
|
|
1692
1710
|
},
|
|
1693
1711
|
handleLayout(res, old) {
|
|
1712
|
+
if (res == old) {
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1694
1715
|
this.layout = res;
|
|
1695
1716
|
switch (res) {
|
|
1696
1717
|
case 'topnav':
|
|
@@ -28,6 +28,10 @@ export default {
|
|
|
28
28
|
showNotify: {
|
|
29
29
|
type: Boolean,
|
|
30
30
|
default: true
|
|
31
|
+
},
|
|
32
|
+
secret: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
data() {
|
|
@@ -351,14 +355,20 @@ export default {
|
|
|
351
355
|
officeTel: this.values.officetel,
|
|
352
356
|
phone: this.values.phone,
|
|
353
357
|
oldPassword:
|
|
354
|
-
|
|
358
|
+
this.secret &&
|
|
359
|
+
initLogin &&
|
|
360
|
+
initLogin.secret &&
|
|
361
|
+
this.values.oldpassword
|
|
355
362
|
? util.esmEncrypt({
|
|
356
363
|
data: this.values.oldpassword,
|
|
357
364
|
key: initLogin.secret
|
|
358
365
|
})
|
|
359
366
|
: this.values.oldpassword,
|
|
360
367
|
password:
|
|
361
|
-
|
|
368
|
+
this.secret &&
|
|
369
|
+
initLogin &&
|
|
370
|
+
initLogin.secret &&
|
|
371
|
+
this.values.password
|
|
362
372
|
? util.esmEncrypt({
|
|
363
373
|
data: this.values.password,
|
|
364
374
|
key: initLogin.secret
|
|
@@ -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,
|
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
},
|
|
108
108
|
menuActive() {
|
|
109
109
|
let active =
|
|
110
|
-
this.defaultActive === 'string'
|
|
110
|
+
typeof this.defaultActive === 'string'
|
|
111
111
|
? this.defaultActive
|
|
112
112
|
: this.defaultActive.length
|
|
113
113
|
? this.defaultActive[this.defaultActive.length - 1]
|
|
@@ -140,6 +140,7 @@ export default {
|
|
|
140
140
|
biserial: {
|
|
141
141
|
handler(val) {
|
|
142
142
|
this.isShow = !val;
|
|
143
|
+
this.resetHeight();
|
|
143
144
|
}
|
|
144
145
|
},
|
|
145
146
|
defaultActive: {
|
|
@@ -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) => {
|