eoss-ui 0.4.66 → 0.4.68
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 +11 -11
- package/lib/button.js +11 -11
- package/lib/card.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +48 -19
- package/lib/clients.js +2 -2
- package/lib/data-table-form.js +11 -12
- package/lib/data-table.js +11 -12
- package/lib/date-picker.js +11 -11
- package/lib/dialog.js +10 -13
- package/lib/enterprise.js +2 -2
- package/lib/eoss-ui.common.js +729 -2699
- package/lib/error-page.js +2 -2
- package/lib/flow-group.js +17 -15
- package/lib/flow-list.js +377 -1358
- package/lib/flow.js +20 -36
- package/lib/form.js +46 -41
- package/lib/handle-user.js +12 -12
- package/lib/handler.js +12 -12
- package/lib/icons.js +4 -4
- package/lib/index.js +1 -1
- package/lib/input-number.js +18 -18
- package/lib/input.js +43 -43
- package/lib/label.js +2 -2
- package/lib/login.js +110 -101
- package/lib/main.js +131 -101
- package/lib/menu.js +12 -5
- package/lib/nav.js +14 -13
- package/lib/notify.js +4 -4
- package/lib/page.js +18 -18
- package/lib/pagination.js +2 -2
- package/lib/player.js +22 -22
- package/lib/qr-code.js +13 -13
- package/lib/radio-group.js +48 -19
- package/lib/retrial-auth.js +12 -12
- package/lib/select-ganged.js +36 -16
- package/lib/select.js +62 -22
- package/lib/selector-panel.js +66 -56
- package/lib/selector.js +14 -14
- package/lib/sizer.js +12 -12
- package/lib/steps.js +11 -11
- package/lib/switch.js +11 -11
- package/lib/table-form.js +36 -36
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +11 -11
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/tips.js +19 -19
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +11 -11
- package/lib/tree.js +12 -12
- package/lib/upload.js +12 -12
- package/lib/wujie.js +11 -11
- package/lib/wxlogin.js +11 -11
- package/package.json +1 -1
- package/packages/checkbox-group/src/main.vue +47 -5
- package/packages/flow/src/processForm.vue +0 -3
- package/packages/flow-group/src/main.vue +4 -2
- package/packages/flow-list/src/main.vue +1 -99
- package/packages/form/src/main.vue +7 -2
- package/packages/main/src/main.vue +86 -54
- package/packages/main/src/message.vue +7 -8
- package/packages/main/src/userinfo.vue +12 -2
- package/packages/menu/src/main.vue +22 -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/index.scss +0 -1
- package/packages/theme-chalk/src/main.scss +5 -1
- package/packages/theme-chalk/src/menu.scss +1 -1
- package/src/index.js +1 -4
- package/lib/editor.js +0 -1345
- package/lib/theme-chalk/editor.css +0 -1
- package/packages/editor/index.js +0 -5
- package/packages/editor/src/color.vue +0 -148
- package/packages/editor/src/editor.vue +0 -25
- package/packages/editor/src/main.vue +0 -114
- package/packages/editor/src/minx.js +0 -213
- package/packages/editor/src/toolbar.vue +0 -224
- package/packages/flow-list/src/flow-table.vue +0 -441
- package/packages/theme-chalk/lib/editor.css +0 -1
- package/packages/theme-chalk/src/editor.scss +0 -94
|
@@ -365,7 +365,10 @@ export default {
|
|
|
365
365
|
type: String,
|
|
366
366
|
default: '/main'
|
|
367
367
|
},
|
|
368
|
-
setFirstAsDefault:
|
|
368
|
+
setFirstAsDefault: {
|
|
369
|
+
type: Boolean,
|
|
370
|
+
default: true
|
|
371
|
+
},
|
|
369
372
|
pathUrl: {
|
|
370
373
|
type: String,
|
|
371
374
|
default: '/primary'
|
|
@@ -641,8 +644,10 @@ export default {
|
|
|
641
644
|
menuSuccess(res) {
|
|
642
645
|
// this.menus
|
|
643
646
|
this.menuType = 'custom';
|
|
644
|
-
|
|
645
|
-
|
|
647
|
+
if (res && res.length) {
|
|
648
|
+
this.customMenu = res;
|
|
649
|
+
this.setMenu(res);
|
|
650
|
+
}
|
|
646
651
|
},
|
|
647
652
|
//获取主题模板JSON
|
|
648
653
|
getMainDetail(id) {
|
|
@@ -682,8 +687,10 @@ export default {
|
|
|
682
687
|
if (_that.showDefault && _that.data === undefined) {
|
|
683
688
|
_that.getMenu();
|
|
684
689
|
} else if (_that.showDefault) {
|
|
685
|
-
_that.
|
|
686
|
-
|
|
690
|
+
if (_that.data && _that.data.length) {
|
|
691
|
+
_that.menus = JSON.parse(JSON.stringify(_that.data));
|
|
692
|
+
_that.setMenu(_that.data);
|
|
693
|
+
}
|
|
687
694
|
}
|
|
688
695
|
})
|
|
689
696
|
.catch((err) => {
|
|
@@ -838,7 +845,7 @@ export default {
|
|
|
838
845
|
if (i === 'indexUrl') {
|
|
839
846
|
this.homePage = results[i];
|
|
840
847
|
if (this.isHomePage) {
|
|
841
|
-
if (this.menus) {
|
|
848
|
+
if (this.menus && this.menus.length) {
|
|
842
849
|
let ids = null;
|
|
843
850
|
this.homePage && (ids = this.getId(this.menus, this.homePage));
|
|
844
851
|
if (ids) {
|
|
@@ -995,26 +1002,43 @@ export default {
|
|
|
995
1002
|
.ajax({ url: this.action, params: this.param ? this.param : {} })
|
|
996
1003
|
.then((res) => {
|
|
997
1004
|
if (res.rCode === 0) {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
this.defaultActive = ids;
|
|
1006
|
-
}
|
|
1007
|
-
} else if (util.win.location.hash) {
|
|
1008
|
-
let hash = util.win.location.hash;
|
|
1009
|
-
if (hash) {
|
|
1010
|
-
hash = hash.split('?')[0];
|
|
1011
|
-
}
|
|
1012
|
-
if (hash !== '#/' && hash !== '#/main') {
|
|
1013
|
-
let ids = this.getId(this.menus, util.win.location.hash, true);
|
|
1005
|
+
if (res.results && res.results.length) {
|
|
1006
|
+
this.menus = JSON.parse(JSON.stringify(res.results));
|
|
1007
|
+
let applicationid =
|
|
1008
|
+
util.getParams('applicationid') ||
|
|
1009
|
+
util.getParams('applicationId');
|
|
1010
|
+
if (applicationid) {
|
|
1011
|
+
let ids = this.getId(this.menus, applicationid);
|
|
1014
1012
|
if (ids) {
|
|
1015
1013
|
this.defaultActive = ids;
|
|
1016
|
-
|
|
1017
|
-
|
|
1014
|
+
}
|
|
1015
|
+
} else if (util.win.location.hash) {
|
|
1016
|
+
let hash = util.win.location.hash;
|
|
1017
|
+
if (hash) {
|
|
1018
|
+
hash = hash.split('?')[0];
|
|
1019
|
+
}
|
|
1020
|
+
if (hash !== '#/' && hash !== '#/main') {
|
|
1021
|
+
let ids = this.getId(
|
|
1022
|
+
this.menus,
|
|
1023
|
+
util.win.location.hash,
|
|
1024
|
+
true
|
|
1025
|
+
);
|
|
1026
|
+
if (ids) {
|
|
1027
|
+
this.defaultActive = ids;
|
|
1028
|
+
this.navIds = ids;
|
|
1029
|
+
this.setTitle(ids[0]);
|
|
1030
|
+
}
|
|
1031
|
+
} else if (sessionStorage.getItem('jump') && this.history) {
|
|
1032
|
+
let ids = this.getId(
|
|
1033
|
+
this.menus,
|
|
1034
|
+
sessionStorage.getItem('jump'),
|
|
1035
|
+
true
|
|
1036
|
+
);
|
|
1037
|
+
if (ids) {
|
|
1038
|
+
this.defaultActive = ids;
|
|
1039
|
+
this.navIds = ids;
|
|
1040
|
+
this.setTitle(ids[0]);
|
|
1041
|
+
}
|
|
1018
1042
|
}
|
|
1019
1043
|
} else if (sessionStorage.getItem('jump') && this.history) {
|
|
1020
1044
|
let ids = this.getId(
|
|
@@ -1028,21 +1052,12 @@ export default {
|
|
|
1028
1052
|
this.setTitle(ids[0]);
|
|
1029
1053
|
}
|
|
1030
1054
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
);
|
|
1037
|
-
if (ids) {
|
|
1038
|
-
this.defaultActive = ids;
|
|
1039
|
-
this.navIds = ids;
|
|
1040
|
-
this.setTitle(ids[0]);
|
|
1041
|
-
}
|
|
1055
|
+
this.setTips(this.menus);
|
|
1056
|
+
store.set('nav', this.menus);
|
|
1057
|
+
this.setMenu(this.menus);
|
|
1058
|
+
} else {
|
|
1059
|
+
this.$message.error('未分配菜单权限,请联系管理员!');
|
|
1042
1060
|
}
|
|
1043
|
-
this.setTips(this.menus);
|
|
1044
|
-
store.set('nav', this.menus);
|
|
1045
|
-
this.setMenu(this.menus);
|
|
1046
1061
|
} else {
|
|
1047
1062
|
let msg = res.msg || '系统错误,请联系管理员!';
|
|
1048
1063
|
this.$message.error(msg);
|
|
@@ -1357,11 +1372,14 @@ export default {
|
|
|
1357
1372
|
switch (type) {
|
|
1358
1373
|
case 'nav':
|
|
1359
1374
|
this.tabs = [];
|
|
1360
|
-
this.active = '';
|
|
1375
|
+
//this.active = '';
|
|
1361
1376
|
if (this.layout === 'topside') {
|
|
1362
|
-
this.
|
|
1363
|
-
|
|
1364
|
-
|
|
1377
|
+
if (this.title !== node.text) {
|
|
1378
|
+
this.navIds = [node.id];
|
|
1379
|
+
this.menu = node.children;
|
|
1380
|
+
this.active = node.id;
|
|
1381
|
+
this.title = node.text;
|
|
1382
|
+
}
|
|
1365
1383
|
if (this.setFirstAsDefault) {
|
|
1366
1384
|
let subNode = this.getFirst(node);
|
|
1367
1385
|
if (subNode) {
|
|
@@ -1374,7 +1392,7 @@ export default {
|
|
|
1374
1392
|
}
|
|
1375
1393
|
} else {
|
|
1376
1394
|
this.navIds = this.getId(this.menus, node.url, true);
|
|
1377
|
-
this.setTitle(
|
|
1395
|
+
this.setTitle(this.navIds[0]);
|
|
1378
1396
|
this.tabsId = fourthTabs ? node.id : '';
|
|
1379
1397
|
}
|
|
1380
1398
|
break;
|
|
@@ -1383,7 +1401,10 @@ export default {
|
|
|
1383
1401
|
this.navIds = [node.id];
|
|
1384
1402
|
this.tabs = [];
|
|
1385
1403
|
this.menu = node.children;
|
|
1386
|
-
this.title
|
|
1404
|
+
if (this.title !== node.text) {
|
|
1405
|
+
this.active = '';
|
|
1406
|
+
this.title = node.text;
|
|
1407
|
+
}
|
|
1387
1408
|
if (this.setFirstAsDefault) {
|
|
1388
1409
|
let subNode = this.getFirst(node);
|
|
1389
1410
|
if (subNode) {
|
|
@@ -1402,6 +1423,10 @@ export default {
|
|
|
1402
1423
|
if (node.url) {
|
|
1403
1424
|
this.tabs = [];
|
|
1404
1425
|
}
|
|
1426
|
+
if (this.title !== node.text) {
|
|
1427
|
+
this.active = [node.id];
|
|
1428
|
+
this.title = node.text;
|
|
1429
|
+
}
|
|
1405
1430
|
if (this.setFirstAsDefault) {
|
|
1406
1431
|
let subNode = this.getFirst(node);
|
|
1407
1432
|
this.active = [node.id];
|
|
@@ -1456,16 +1481,18 @@ export default {
|
|
|
1456
1481
|
this.navIds = this.getId(this.menus, this.tabs[0].url, true);
|
|
1457
1482
|
}
|
|
1458
1483
|
}
|
|
1459
|
-
} else
|
|
1460
|
-
this.
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
if (
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1484
|
+
} else {
|
|
1485
|
+
if (this.setFirstAsDefault) {
|
|
1486
|
+
this.tabs = [];
|
|
1487
|
+
let subNode = this.getFirst(node);
|
|
1488
|
+
if (subNode) {
|
|
1489
|
+
if (this.biserial) {
|
|
1490
|
+
this.$set(this.active, 1, subNode.id);
|
|
1491
|
+
} else {
|
|
1492
|
+
this.active = subNode.id;
|
|
1493
|
+
}
|
|
1494
|
+
this.navIds = this.getId(this.menus, subNode.url, true);
|
|
1467
1495
|
}
|
|
1468
|
-
this.navIds = this.getId(this.menus, subNode.url, true);
|
|
1469
1496
|
}
|
|
1470
1497
|
}
|
|
1471
1498
|
break;
|
|
@@ -1529,7 +1556,9 @@ export default {
|
|
|
1529
1556
|
this.active = [];
|
|
1530
1557
|
this.defaultActive = [];
|
|
1531
1558
|
this.tabs = [];
|
|
1532
|
-
this.
|
|
1559
|
+
if (this.menus && this.menus.length) {
|
|
1560
|
+
this.setMenu(this.menus);
|
|
1561
|
+
}
|
|
1533
1562
|
this.$nextTick(() => {
|
|
1534
1563
|
this.reset = true;
|
|
1535
1564
|
});
|
|
@@ -1697,6 +1726,9 @@ export default {
|
|
|
1697
1726
|
return false;
|
|
1698
1727
|
},
|
|
1699
1728
|
handleLayout(res, old) {
|
|
1729
|
+
if (res == old) {
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1700
1732
|
this.layout = res;
|
|
1701
1733
|
switch (res) {
|
|
1702
1734
|
case 'topnav':
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</el-card>
|
|
40
40
|
<p class="es-msg-tips" v-if="loading">加载中...</p>
|
|
41
|
-
<p class="es-msg-tips" v-if="noMore && count > 0">
|
|
42
|
-
没有更多了
|
|
43
|
-
</p>
|
|
41
|
+
<p class="es-msg-tips" v-if="noMore && count > 0">没有更多了</p>
|
|
44
42
|
</div>
|
|
45
43
|
</el-scrollbar>
|
|
46
44
|
</div>
|
|
@@ -100,6 +98,7 @@ export default {
|
|
|
100
98
|
return this.msgs.length >= this.count;
|
|
101
99
|
},
|
|
102
100
|
disabled() {
|
|
101
|
+
console.log(this.loading, this.noMore);
|
|
103
102
|
return this.loading || this.noMore;
|
|
104
103
|
}
|
|
105
104
|
},
|
|
@@ -145,7 +144,7 @@ export default {
|
|
|
145
144
|
pageSize: this.pageSize
|
|
146
145
|
}
|
|
147
146
|
})
|
|
148
|
-
.then(res => {
|
|
147
|
+
.then((res) => {
|
|
149
148
|
if (res && res.rCode === 0) {
|
|
150
149
|
this.pageCount = res.results.pageCount;
|
|
151
150
|
this.loading = false;
|
|
@@ -160,7 +159,7 @@ export default {
|
|
|
160
159
|
this.$message.error(msg);
|
|
161
160
|
}
|
|
162
161
|
})
|
|
163
|
-
.catch(err => {
|
|
162
|
+
.catch((err) => {
|
|
164
163
|
this.loading = false;
|
|
165
164
|
if (err.message && err.message !== 'canceled') {
|
|
166
165
|
this.$message.error(err.message);
|
|
@@ -177,7 +176,7 @@ export default {
|
|
|
177
176
|
id: res.id
|
|
178
177
|
}
|
|
179
178
|
})
|
|
180
|
-
.then(res => {
|
|
179
|
+
.then((res) => {
|
|
181
180
|
if (res.rCode == 0) {
|
|
182
181
|
this.count -= 1;
|
|
183
182
|
this.msgs.splice(i, 1);
|
|
@@ -193,12 +192,12 @@ export default {
|
|
|
193
192
|
.ajax({
|
|
194
193
|
url: ignoreAllSysMsg
|
|
195
194
|
})
|
|
196
|
-
.then(res => {
|
|
195
|
+
.then((res) => {
|
|
197
196
|
this.count = 0;
|
|
198
197
|
this.msgs = [];
|
|
199
198
|
this.$emit('ignore', { type: 'ignore', value: 'all' });
|
|
200
199
|
})
|
|
201
|
-
.catch(err => {
|
|
200
|
+
.catch((err) => {
|
|
202
201
|
if (err.message && err.message !== 'canceled') {
|
|
203
202
|
this.$message.error(err.message);
|
|
204
203
|
}
|
|
@@ -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 {
|
|
@@ -193,6 +196,9 @@ export default {
|
|
|
193
196
|
'es-dot-right': item.tips && typeof item.tips === 'boolean'
|
|
194
197
|
}
|
|
195
198
|
],
|
|
199
|
+
attrs:{
|
|
200
|
+
title: item.text.length > 18 ? item.text : undefined,
|
|
201
|
+
},
|
|
196
202
|
props:
|
|
197
203
|
typeof item.tips === 'boolean' && item.tips
|
|
198
204
|
? {
|
|
@@ -232,7 +238,13 @@ export default {
|
|
|
232
238
|
h(
|
|
233
239
|
'el-submenu',
|
|
234
240
|
{
|
|
235
|
-
class: [
|
|
241
|
+
class: [
|
|
242
|
+
'es-submenu',
|
|
243
|
+
`es-submenu-${this.mode}`,
|
|
244
|
+
item.id === this.active && !this.isChange
|
|
245
|
+
? 'es-menu-item-focus'
|
|
246
|
+
: ''
|
|
247
|
+
],
|
|
236
248
|
props: {
|
|
237
249
|
popperClass: popper,
|
|
238
250
|
popperAppendToBody: true,
|
|
@@ -264,7 +276,13 @@ export default {
|
|
|
264
276
|
h(
|
|
265
277
|
'el-submenu',
|
|
266
278
|
{
|
|
267
|
-
class: [
|
|
279
|
+
class: [
|
|
280
|
+
'es-submenu',
|
|
281
|
+
`es-submenu-${this.mode}`,
|
|
282
|
+
item.id === this.active && !this.isChange
|
|
283
|
+
? 'es-menu-item-focus'
|
|
284
|
+
: ''
|
|
285
|
+
],
|
|
268
286
|
props: {
|
|
269
287
|
popperClass: popper,
|
|
270
288
|
popperAppendToBody: true,
|
|
@@ -409,6 +427,7 @@ export default {
|
|
|
409
427
|
],
|
|
410
428
|
ref: 'menu',
|
|
411
429
|
props: {
|
|
430
|
+
defaultOpeneds: this.defaultOpeneds,
|
|
412
431
|
defaultActive: this.active,
|
|
413
432
|
collapse: this.collapse,
|
|
414
433
|
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) => {
|