eoss-ui 0.4.24 → 0.4.26
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/eoss-ui.common.js +77 -34
- package/lib/handler.js +16 -4
- package/lib/index.js +1 -1
- package/lib/main.js +38 -10
- package/lib/menu.js +12 -9
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/menu.css +1 -1
- package/package.json +151 -151
- package/packages/handler/src/main.vue +25 -6
- package/packages/main/src/main.vue +54 -6
- package/packages/menu/src/main.vue +34 -17
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/menu.css +1 -1
- package/packages/theme-chalk/src/menu.scss +13 -0
- package/src/index.js +1 -1
|
@@ -37,7 +37,11 @@
|
|
|
37
37
|
<li
|
|
38
38
|
v-for="ele in system"
|
|
39
39
|
class="es-sub-system-item"
|
|
40
|
-
:class="{
|
|
40
|
+
:class="{
|
|
41
|
+
'es-disabled':
|
|
42
|
+
(application && !ele.hasPermission) ||
|
|
43
|
+
(ele.extendData && ele.extendData.businessStatus == 0)
|
|
44
|
+
}"
|
|
41
45
|
:key="ele.id"
|
|
42
46
|
:title="ele.text"
|
|
43
47
|
@click.stop="handleSelect({ node: ele })"
|
|
@@ -159,7 +163,7 @@ export default {
|
|
|
159
163
|
deep: true,
|
|
160
164
|
handler(val) {
|
|
161
165
|
if (val !== undefined) {
|
|
162
|
-
this.lists.forEach(item => {
|
|
166
|
+
this.lists.forEach((item) => {
|
|
163
167
|
item.hide = val[item.type];
|
|
164
168
|
});
|
|
165
169
|
}
|
|
@@ -241,7 +245,22 @@ export default {
|
|
|
241
245
|
},
|
|
242
246
|
handleSelect(res) {
|
|
243
247
|
const { node } = res;
|
|
244
|
-
|
|
248
|
+
console.log(node);
|
|
249
|
+
if (
|
|
250
|
+
node.extendData &&
|
|
251
|
+
node.extendData.businessStatus == 0 &&
|
|
252
|
+
node.extendData.businessWarnMsg
|
|
253
|
+
) {
|
|
254
|
+
this.$alert(node.extendData.businessWarnMsg, '提示', {
|
|
255
|
+
type: 'warning'
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (
|
|
259
|
+
!this.application &&
|
|
260
|
+
!node.hasPermission &&
|
|
261
|
+
node.extendData &&
|
|
262
|
+
node.extendData.businessStatus != 0
|
|
263
|
+
) {
|
|
245
264
|
this.$emit('select', res);
|
|
246
265
|
}
|
|
247
266
|
},
|
|
@@ -254,7 +273,7 @@ export default {
|
|
|
254
273
|
.then(() => {
|
|
255
274
|
util
|
|
256
275
|
.ajax({ method: 'post', url: logout })
|
|
257
|
-
.then(res => {
|
|
276
|
+
.then((res) => {
|
|
258
277
|
if (res.rCode == 0) {
|
|
259
278
|
util.removeStorage([
|
|
260
279
|
'Authorization',
|
|
@@ -293,13 +312,13 @@ export default {
|
|
|
293
312
|
}
|
|
294
313
|
}
|
|
295
314
|
})
|
|
296
|
-
.catch(err => {
|
|
315
|
+
.catch((err) => {
|
|
297
316
|
if (err.message && err.message !== 'canceled') {
|
|
298
317
|
this.$message.error(err.message);
|
|
299
318
|
}
|
|
300
319
|
});
|
|
301
320
|
})
|
|
302
|
-
.catch(e => {});
|
|
321
|
+
.catch((e) => {});
|
|
303
322
|
}
|
|
304
323
|
}
|
|
305
324
|
};
|
|
@@ -286,6 +286,7 @@ export default {
|
|
|
286
286
|
type: String,
|
|
287
287
|
default: ''
|
|
288
288
|
},
|
|
289
|
+
param: Object,
|
|
289
290
|
header: {
|
|
290
291
|
type: Boolean,
|
|
291
292
|
default: true
|
|
@@ -665,7 +666,7 @@ export default {
|
|
|
665
666
|
}
|
|
666
667
|
});
|
|
667
668
|
},
|
|
668
|
-
|
|
669
|
+
// 将chalk写入到页面中
|
|
669
670
|
handleColorToPage(globalThalk) {
|
|
670
671
|
const thalk = document.getElementById('chalk-style');
|
|
671
672
|
if (!thalk) {
|
|
@@ -689,7 +690,7 @@ export default {
|
|
|
689
690
|
if (ids) {
|
|
690
691
|
this.defaultActive = ids;
|
|
691
692
|
}
|
|
692
|
-
} else {
|
|
693
|
+
} else if (util.win.location.hash) {
|
|
693
694
|
let hash = util.win.location.hash;
|
|
694
695
|
if (hash) {
|
|
695
696
|
hash = hash.split('?')[0];
|
|
@@ -699,6 +700,24 @@ export default {
|
|
|
699
700
|
if (ids) {
|
|
700
701
|
this.defaultActive = ids;
|
|
701
702
|
}
|
|
703
|
+
} else if (sessionStorage.getItem('jump')) {
|
|
704
|
+
let ids = this.getId(
|
|
705
|
+
this.menus,
|
|
706
|
+
sessionStorage.getItem('jump'),
|
|
707
|
+
true
|
|
708
|
+
);
|
|
709
|
+
if (ids) {
|
|
710
|
+
this.defaultActive = ids;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
} else if (sessionStorage.getItem('jump')) {
|
|
714
|
+
let ids = this.getId(
|
|
715
|
+
this.menus,
|
|
716
|
+
sessionStorage.getItem('jump'),
|
|
717
|
+
true
|
|
718
|
+
);
|
|
719
|
+
if (ids) {
|
|
720
|
+
this.defaultActive = ids;
|
|
702
721
|
}
|
|
703
722
|
}
|
|
704
723
|
this.setMenu(this.menus);
|
|
@@ -917,7 +936,7 @@ export default {
|
|
|
917
936
|
//获取应用导航菜单
|
|
918
937
|
getMenu() {
|
|
919
938
|
util
|
|
920
|
-
.ajax({ url: this.action })
|
|
939
|
+
.ajax({ url: this.action, params: this.param ? this.param : {} })
|
|
921
940
|
.then((res) => {
|
|
922
941
|
if (res.rCode === 0) {
|
|
923
942
|
this.menus = JSON.parse(JSON.stringify(res.results));
|
|
@@ -929,7 +948,7 @@ export default {
|
|
|
929
948
|
if (ids) {
|
|
930
949
|
this.defaultActive = ids;
|
|
931
950
|
}
|
|
932
|
-
} else {
|
|
951
|
+
} else if (util.win.location.hash) {
|
|
933
952
|
let hash = util.win.location.hash;
|
|
934
953
|
if (hash) {
|
|
935
954
|
hash = hash.split('?')[0];
|
|
@@ -939,6 +958,24 @@ export default {
|
|
|
939
958
|
if (ids) {
|
|
940
959
|
this.defaultActive = ids;
|
|
941
960
|
}
|
|
961
|
+
} else if (sessionStorage.getItem('jump')) {
|
|
962
|
+
let ids = this.getId(
|
|
963
|
+
this.menus,
|
|
964
|
+
sessionStorage.getItem('jump'),
|
|
965
|
+
true
|
|
966
|
+
);
|
|
967
|
+
if (ids) {
|
|
968
|
+
this.defaultActive = ids;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
} else if (sessionStorage.getItem('jump')) {
|
|
972
|
+
let ids = this.getId(
|
|
973
|
+
this.menus,
|
|
974
|
+
sessionStorage.getItem('jump'),
|
|
975
|
+
true
|
|
976
|
+
);
|
|
977
|
+
if (ids) {
|
|
978
|
+
this.defaultActive = ids;
|
|
942
979
|
}
|
|
943
980
|
}
|
|
944
981
|
this.setTips(this.menus);
|
|
@@ -1222,8 +1259,18 @@ export default {
|
|
|
1222
1259
|
},
|
|
1223
1260
|
//应用导航交互
|
|
1224
1261
|
handleSelect(res, type) {
|
|
1225
|
-
this.isDefault = false;
|
|
1226
1262
|
const { node } = res;
|
|
1263
|
+
if (
|
|
1264
|
+
node.extendData &&
|
|
1265
|
+
node.extendData.businessStatus == 0 &&
|
|
1266
|
+
node.extendData.businessWarnMsg
|
|
1267
|
+
) {
|
|
1268
|
+
this.$alert(node.extendData.businessWarnMsg, '提示', {
|
|
1269
|
+
type: 'warning'
|
|
1270
|
+
});
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
this.isDefault = false;
|
|
1227
1274
|
switch (type) {
|
|
1228
1275
|
case 'nav':
|
|
1229
1276
|
this.tabs = [];
|
|
@@ -1398,6 +1445,7 @@ export default {
|
|
|
1398
1445
|
//跳转页面
|
|
1399
1446
|
handleJump(page, type, res) {
|
|
1400
1447
|
console.log(page);
|
|
1448
|
+
sessionStorage.setItem('jump', page);
|
|
1401
1449
|
if (util.win.location.hash === page) {
|
|
1402
1450
|
this.refresh = true;
|
|
1403
1451
|
return;
|
|
@@ -1648,7 +1696,7 @@ export default {
|
|
|
1648
1696
|
},
|
|
1649
1697
|
openPage(url, name, width, height) {
|
|
1650
1698
|
let src = url;
|
|
1651
|
-
if (!util.startWith(url, ['http', '/'])) {
|
|
1699
|
+
if (!util.startWith(url, ['http', '/'], true)) {
|
|
1652
1700
|
let pathname = window.location.pathname;
|
|
1653
1701
|
if (pathname !== '/') {
|
|
1654
1702
|
pathname = pathname.split('/');
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
} else {
|
|
71
71
|
this.$nextTick(() => {
|
|
72
72
|
let w = 0;
|
|
73
|
-
Array.from(this.$refs.menu.$el.children).forEach(item => {
|
|
73
|
+
Array.from(this.$refs.menu.$el.children).forEach((item) => {
|
|
74
74
|
w += item.offsetWidth;
|
|
75
75
|
});
|
|
76
76
|
const styles = window.getComputedStyle(this.$refs.menu.$el);
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
this.$refs.menu.close(this.menuId);
|
|
115
115
|
} else {
|
|
116
116
|
let openedMenus = item.rootMenu.openedMenus;
|
|
117
|
-
openedMenus.forEach(item => {
|
|
117
|
+
openedMenus.forEach((item) => {
|
|
118
118
|
if (keyPath.indexOf(item) == -1) {
|
|
119
119
|
this.$refs.menu.close(item);
|
|
120
120
|
}
|
|
@@ -166,7 +166,7 @@ export default {
|
|
|
166
166
|
h(
|
|
167
167
|
'div',
|
|
168
168
|
{
|
|
169
|
-
class: `es-menu-title-text es-menu-title-${this.mode}`
|
|
169
|
+
class: [`es-menu-title-text es-menu-title-${this.mode}`]
|
|
170
170
|
},
|
|
171
171
|
[
|
|
172
172
|
h(
|
|
@@ -200,7 +200,12 @@ export default {
|
|
|
200
200
|
let doms = [
|
|
201
201
|
h('template', { slot: 'title' }, this.titleIcons ? title : [title[1]])
|
|
202
202
|
];
|
|
203
|
-
if (
|
|
203
|
+
if (
|
|
204
|
+
this.deep &&
|
|
205
|
+
item.children &&
|
|
206
|
+
item.children.length &&
|
|
207
|
+
(!item.extendData || item.extendData.businessStatus != 0)
|
|
208
|
+
) {
|
|
204
209
|
doms = doms.concat(
|
|
205
210
|
item.children.map((ele, index) => {
|
|
206
211
|
if (!ele) {
|
|
@@ -230,7 +235,8 @@ export default {
|
|
|
230
235
|
this.deep &&
|
|
231
236
|
this.mode === 'horizontal' &&
|
|
232
237
|
item.fourthTabs &&
|
|
233
|
-
item.fourthTabs.length
|
|
238
|
+
item.fourthTabs.length &&
|
|
239
|
+
(!item.extendData || item.extendData.businessStatus != 0)
|
|
234
240
|
) {
|
|
235
241
|
doms = doms.concat(
|
|
236
242
|
item.fourthTabs.map((ele, index) => {
|
|
@@ -262,10 +268,12 @@ export default {
|
|
|
262
268
|
h(
|
|
263
269
|
'el-menu-item',
|
|
264
270
|
{
|
|
265
|
-
class:
|
|
266
|
-
'es-menu-item ' + (this.deep ? '' : `es-item-${this.mode}`)
|
|
271
|
+
class: [
|
|
272
|
+
'es-menu-item ' + (this.deep ? '' : `es-item-${this.mode}`)
|
|
273
|
+
],
|
|
267
274
|
props: {
|
|
268
|
-
paddingLeft: this.paddingLeft
|
|
275
|
+
paddingLeft: this.paddingLeft,
|
|
276
|
+
disabled: item.extendData && item.extendData.businessStatus == 0
|
|
269
277
|
},
|
|
270
278
|
attrs: {
|
|
271
279
|
data: item,
|
|
@@ -288,17 +296,24 @@ export default {
|
|
|
288
296
|
},
|
|
289
297
|
render(h) {
|
|
290
298
|
let doms = [];
|
|
291
|
-
this.data.forEach(item => {
|
|
292
|
-
if (
|
|
299
|
+
this.data.forEach((item) => {
|
|
300
|
+
if (
|
|
301
|
+
item.children &&
|
|
302
|
+
item.children.length &&
|
|
303
|
+
(!item.extendData || item.extendData.businessStatus != 0)
|
|
304
|
+
) {
|
|
293
305
|
doms = doms.concat(this.getSub(item, h, 'es-sub-menu'));
|
|
294
306
|
} else {
|
|
295
307
|
const title = [
|
|
296
308
|
h('i', {
|
|
297
|
-
class:
|
|
298
|
-
|
|
299
|
-
? item.icons
|
|
300
|
-
|
|
301
|
-
|
|
309
|
+
class: [
|
|
310
|
+
item.icons
|
|
311
|
+
? this.unicode(item.icons)
|
|
312
|
+
? item.icons
|
|
313
|
+
: 'es-icons iconfont'
|
|
314
|
+
: 'es-icon-application',
|
|
315
|
+
'es-menu-item-icon'
|
|
316
|
+
],
|
|
302
317
|
domProps:
|
|
303
318
|
item.icons === '' || this.unicode(item.icons)
|
|
304
319
|
? {}
|
|
@@ -307,7 +322,7 @@ export default {
|
|
|
307
322
|
h(
|
|
308
323
|
'div',
|
|
309
324
|
{
|
|
310
|
-
class: `es-menu-title-text es-menu-title-${this.mode}`
|
|
325
|
+
class: [`es-menu-title-text es-menu-title-${this.mode}`]
|
|
311
326
|
},
|
|
312
327
|
[
|
|
313
328
|
h(
|
|
@@ -343,8 +358,10 @@ export default {
|
|
|
343
358
|
h(
|
|
344
359
|
'el-menu-item',
|
|
345
360
|
{
|
|
361
|
+
class: [`es-menu-item-${this.mode}`],
|
|
346
362
|
props: {
|
|
347
|
-
paddingLeft: this.paddingLeft
|
|
363
|
+
paddingLeft: this.paddingLeft,
|
|
364
|
+
disabled: item.extendData && item.extendData.businessStatus == 0
|
|
348
365
|
},
|
|
349
366
|
attrs: {
|
|
350
367
|
data: item,
|