imatrix-ui 2.8.97-dw-tmp11 → 2.8.97-dw-tmp13
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/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +7 -7
- package/package.json +1 -1
- package/src/views/dsc-component/Sidebar/Item.vue +2 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +1 -2
- package/src/views/dsc-component/Sidebar/index.vue +11 -9
- package/src/views/dsc-component/Sidebar/SidebarItemChild.vue +0 -152
package/package.json
CHANGED
|
@@ -52,9 +52,9 @@ export default {
|
|
|
52
52
|
</div>)
|
|
53
53
|
} else {
|
|
54
54
|
// 有子菜单时
|
|
55
|
-
vnodes.push(<
|
|
55
|
+
vnodes.push(<template v-slot:title> <div style='display: inline-block'>
|
|
56
56
|
<div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
57
|
-
</div>)
|
|
57
|
+
</div></template>)
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return vnodes
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" :show-timeout="0" :hide-timeout="50" popper-class="sidebar-container-popper">
|
|
12
|
-
<template slot
|
|
12
|
+
<template v-slot:title>
|
|
13
13
|
<item :icon="item.iconName" :title="getI18nName(item)" :has-children="item.children.length > 0?true:false" />
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<template v-for="child in item.children">
|
|
17
|
-
<!-- <sidebar-item-child :key="child.code" :child="child" /> -->
|
|
18
17
|
<sidebar-item
|
|
19
18
|
v-if="child.children&&child.children.length>0"
|
|
20
19
|
:key="child.code"
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
<keep-alive>
|
|
5
|
+
<el-menu
|
|
6
|
+
:show-timeout="200"
|
|
7
|
+
:default-active="getDefaultActive()"
|
|
8
|
+
:collapse="isCollapse"
|
|
9
|
+
mode="vertical"
|
|
10
|
+
@select="selectMenu"
|
|
11
|
+
>
|
|
12
|
+
<sidebar-item v-for="menu in menus" :key="menu.code" :item="menu" />
|
|
13
|
+
</el-menu>
|
|
14
|
+
</keep-alive>
|
|
13
15
|
</el-scrollbar>
|
|
14
16
|
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
|
15
17
|
</div>
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<sidebar-item
|
|
4
|
-
v-if="child && child.children&&child.children.length>0"
|
|
5
|
-
:is-nest="true"
|
|
6
|
-
:item="child"
|
|
7
|
-
class="nest-menu"
|
|
8
|
-
/>
|
|
9
|
-
<app-link v-else :key="child.code" :to="toPath(child)" @click.native="clickMenu(toPath(child))">
|
|
10
|
-
<el-menu-item :index="resolvePath(child.code,child.path,child.pageType)">
|
|
11
|
-
<item :icon="child.iconName" :title="getI18nName(child)" />
|
|
12
|
-
</el-menu-item>
|
|
13
|
-
</app-link>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
// import { isExternal } from 'imatrix-ui/src/utils'
|
|
19
|
-
import Item from './Item'
|
|
20
|
-
import AppLink from './Link'
|
|
21
|
-
import Vue from 'vue'
|
|
22
|
-
import tabJs from '../../../api/tab'
|
|
23
|
-
import { getI18nName } from '../../../utils/menu'
|
|
24
|
-
import SidebarItem from './SidebarItem.vue'
|
|
25
|
-
export default {
|
|
26
|
-
name: 'SidebarItemChild',
|
|
27
|
-
components: { Item, AppLink, SidebarItem },
|
|
28
|
-
props: {
|
|
29
|
-
// route object
|
|
30
|
-
child: {
|
|
31
|
-
type: Object,
|
|
32
|
-
required: true
|
|
33
|
-
},
|
|
34
|
-
isNest: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
}
|
|
38
|
-
// basePath: {
|
|
39
|
-
// type: String,
|
|
40
|
-
// default: ''
|
|
41
|
-
// }
|
|
42
|
-
},
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
onlyOneChild: null
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
methods: {
|
|
49
|
-
...tabJs,
|
|
50
|
-
hasOneShowingChild(children, parent) {
|
|
51
|
-
if (children && children.length > 0) {
|
|
52
|
-
this.onlyOneChild = children[0]
|
|
53
|
-
}
|
|
54
|
-
// When there is only one child router, the child router is displayed by default
|
|
55
|
-
if (children.length === 1) {
|
|
56
|
-
return true
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Show parent if there are no child router to display
|
|
60
|
-
if (!children || children.length === 0) {
|
|
61
|
-
// children不存在
|
|
62
|
-
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
|
|
63
|
-
return true
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return false
|
|
67
|
-
},
|
|
68
|
-
resolvePath(menuCode, pageCode, pageType) {
|
|
69
|
-
if (this.isExternalLink(pageType)) {
|
|
70
|
-
return '/dsc/' + menuCode + '~~'
|
|
71
|
-
} else {
|
|
72
|
-
return '/dsc/' + menuCode + '~~' + pageCode
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
toPath(menu) {
|
|
76
|
-
const toPathObj = {}
|
|
77
|
-
const routePath = menu.path
|
|
78
|
-
toPathObj.openWay = menu.openWay
|
|
79
|
-
if (this.isExternalLink(menu.pageType)) {
|
|
80
|
-
toPathObj.path = '/dsc-index/iframe-page'
|
|
81
|
-
toPathObj.tabPath = '/dsc/iframe-page'
|
|
82
|
-
toPathObj.query = {}
|
|
83
|
-
toPathObj.query.src = routePath
|
|
84
|
-
toPathObj.isExternal = true
|
|
85
|
-
// 如果路径中没有拼系统编码,才需要把系统编码放到参数中
|
|
86
|
-
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
87
|
-
toPathObj.query._menuCode = menu.code
|
|
88
|
-
toPathObj.query._menuName = getI18nName(menu)
|
|
89
|
-
} else {
|
|
90
|
-
const pageCode = routePath
|
|
91
|
-
toPathObj.path = '/dsc-index/page'
|
|
92
|
-
toPathObj.tabPath = '/dsc/page'
|
|
93
|
-
toPathObj.query = {}
|
|
94
|
-
toPathObj.query.pageCode = pageCode
|
|
95
|
-
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
96
|
-
toPathObj.query._menuCode = menu.code
|
|
97
|
-
toPathObj.query._menuName = getI18nName(menu)
|
|
98
|
-
}
|
|
99
|
-
return toPathObj
|
|
100
|
-
},
|
|
101
|
-
// 是否已存在customSystem参数
|
|
102
|
-
isHasCustomSystem(routePath) {
|
|
103
|
-
if (routePath && routePath.indexOf('?') > 0) {
|
|
104
|
-
const params = routePath.substring(routePath.indexOf('?') + 1)
|
|
105
|
-
const paramArr = params.split('&')
|
|
106
|
-
for (let i = 0; i < paramArr.length; i++) {
|
|
107
|
-
const item = paramArr[i]
|
|
108
|
-
const key = item.split('=')[0]
|
|
109
|
-
if (key === 'customSystem') {
|
|
110
|
-
return true
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return false
|
|
115
|
-
},
|
|
116
|
-
clickMenu(toPathObj) {
|
|
117
|
-
// console.log('clickMenu----toPathObj=', toPathObj)
|
|
118
|
-
if (toPathObj.openWay && toPathObj.openWay === 'NEW_PAGE_OPEN' && toPathObj.query) {
|
|
119
|
-
// 新页签打开菜单
|
|
120
|
-
let url = toPathObj.query.src
|
|
121
|
-
if (url && url.indexOf('?') > 0) {
|
|
122
|
-
url += '&'
|
|
123
|
-
} else {
|
|
124
|
-
url += '?'
|
|
125
|
-
}
|
|
126
|
-
if (toPathObj.query.customSystem) {
|
|
127
|
-
url += 'customSystem=' + toPathObj.query.customSystem
|
|
128
|
-
}
|
|
129
|
-
if (toPathObj.query._menuCode) {
|
|
130
|
-
url += '_menuCode=' + toPathObj.query._menuCode
|
|
131
|
-
}
|
|
132
|
-
if (toPathObj.query._menuCode) {
|
|
133
|
-
url += '_menuName=' + toPathObj.query._menuName
|
|
134
|
-
}
|
|
135
|
-
window.open(url, toPathObj.query._menuCode)
|
|
136
|
-
} else {
|
|
137
|
-
// 刷新页签打开菜单
|
|
138
|
-
this.addTabs(toPathObj.query, this.$store.state.tabContent.openTab, toPathObj.tabPath)
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
isExternalLink(pageType) {
|
|
142
|
-
if (pageType && pageType === 'iframe') {
|
|
143
|
-
return true
|
|
144
|
-
}
|
|
145
|
-
return false
|
|
146
|
-
},
|
|
147
|
-
getI18nName(menu) {
|
|
148
|
-
return getI18nName(menu)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
</script>
|