module-menu-vue 0.0.94 → 0.0.96
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/package.json +1 -1
- package/src/components/Menu/ModuleMenu.vue +26 -8
- package/src/components/Menu/constant.js +47 -0
- package/src/components/Menu/menu.css +6 -0
- package/src/components/User/UserInfo.vue +41 -4
- package/src/components/Util/axios.js +1 -1
- package/src/components/Util/permessionUtils.js +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- :class="stash === 'LNRD' ? 'backGroundImg' : ''" -->
|
|
3
2
|
<div>
|
|
4
3
|
<div class='menuPopupAndTitle' :style="{height: stash === 'LNRD' ? '75px': 'auto'}">
|
|
5
4
|
<div class='menuIcon' :style="{background: stash === 'LNRD' ? '#EA1A1A' : '#4091f7',height: stash === 'LNRD' ? '75px' : '50px', width: stash === 'LNRD' ? '75px' : '60px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
|
|
@@ -7,7 +6,7 @@
|
|
|
7
6
|
</div>
|
|
8
7
|
<div :class="'menu_title_content'" v-show="showCollapse" @click="toHref()" :style="{lineHeight: stash === 'LNRD' ? '53px' : '49px'}">
|
|
9
8
|
<img class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" :style="{verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}"/>
|
|
10
|
-
<span class=
|
|
9
|
+
<span class='menu_title' :style="{color: stash === 'LNRD' ? '#fff' : '#1890ff',verticalAlign: stash === 'LNRD' ? 'bottom': 'middle'}">{{getLogoAndTitle().title}}</span>
|
|
11
10
|
</div>
|
|
12
11
|
</div>
|
|
13
12
|
<div class='menu_list_content' :style="{ display: showMenuList ? 'block' : 'none', top: stash === 'LNRD' ? '75px' : '50px'}" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
lineHeight: item.children.length > 3 ? '45px' : '70px',
|
|
20
19
|
}">
|
|
21
20
|
<img :src="item.url" class="middle imgWidth" />
|
|
22
|
-
<span class="middle textPad" @click="toHomePage(index)">{{item.name}}</span>
|
|
21
|
+
<span class="middle textPad" :class="stash === 'LNRD' ? 'LNRD_menu_title' : 'textPad'" @click="toHomePage(index)">{{item.name}}</span>
|
|
23
22
|
</div>
|
|
24
23
|
<div class='rightMenu'
|
|
25
24
|
:style="{
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
<span v-for="child in item.children" :key="child.url">
|
|
35
34
|
<span :key="child.childName">
|
|
36
35
|
<img :src="child.url" class="middle iconPad" />
|
|
37
|
-
<span class='childMenu textPad middle' @click="toModulePage(child.childName)">{{child.childName}}</span>
|
|
36
|
+
<span :class="stash === 'LNRD' ? 'LNRD_menu_title childMenu textPad' : 'childMenu textPad middle'" @click="toModulePage(child.childName)">{{child.childName}}</span>
|
|
38
37
|
</span>
|
|
39
38
|
</span>
|
|
40
39
|
</div>
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
</template>
|
|
46
45
|
|
|
47
46
|
<script>
|
|
48
|
-
import { menuList as menuListInit, menuIconSrc, sysNameMap, lnrdMenuList, lnrdSysNameMap } from './constant.js'
|
|
47
|
+
import { menuList as menuListInit, menuList_PANWEI, menuIconSrc, sysNameMap, lnrdMenuList, lnrdSysNameMap } from './constant.js'
|
|
49
48
|
import './menu.css'
|
|
50
49
|
import {getMenuList, isLogoutThird} from './service.js'
|
|
51
50
|
export default {
|
|
@@ -80,6 +79,7 @@ export default {
|
|
|
80
79
|
menuList: [],
|
|
81
80
|
sessionMenu: [],
|
|
82
81
|
menuListInit: menuListInit,
|
|
82
|
+
menuList_PANWEI,
|
|
83
83
|
lnrdMenuList,
|
|
84
84
|
lnrdSysNameMap,
|
|
85
85
|
sysNameMap: sysNameMap,
|
|
@@ -107,7 +107,15 @@ export default {
|
|
|
107
107
|
},
|
|
108
108
|
toHref () {
|
|
109
109
|
if (this.sysName === 'admin') {
|
|
110
|
-
|
|
110
|
+
let url = ''
|
|
111
|
+
if (this.stash === "GZW") {
|
|
112
|
+
url = `/data-platform/#${this.systemPath}`
|
|
113
|
+
} else if (this.stash === 'PANWEI') {
|
|
114
|
+
url = `/bigdata-portal/#${this.systemPath}`
|
|
115
|
+
} else if (!["integration", 'LNRD'].includes(this.stash)) {
|
|
116
|
+
url = `/#${this.systemPath}`
|
|
117
|
+
}
|
|
118
|
+
location.href = url
|
|
111
119
|
}
|
|
112
120
|
},
|
|
113
121
|
async getSessionMenu () {
|
|
@@ -232,11 +240,21 @@ export default {
|
|
|
232
240
|
// 跳转首页
|
|
233
241
|
toHomePage (index) {
|
|
234
242
|
if (index === 0) {
|
|
235
|
-
|
|
243
|
+
let url = ''
|
|
244
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
245
|
+
url = '/dataadmin/#/index'
|
|
246
|
+
} else if (this.stash === "GZW") {
|
|
247
|
+
url = '/data-platform/#/index'
|
|
248
|
+
} else if (this.stash === "PANWEI") {
|
|
249
|
+
url = '/bigdata-portal/#/index'
|
|
250
|
+
} else {
|
|
251
|
+
url = '/#/index'
|
|
252
|
+
}
|
|
253
|
+
location.href = url
|
|
236
254
|
}
|
|
237
255
|
},
|
|
238
256
|
getNewMenuList () {
|
|
239
|
-
let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : [...this.menuListInit];
|
|
257
|
+
let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : this.stash === 'PANWEI' ? [...this.menuList_PANWEI] : [...this.menuListInit];
|
|
240
258
|
if (this.sessionMenu) {
|
|
241
259
|
const pathList = this.sessionMenu.map(item => item.path)
|
|
242
260
|
// 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
|
|
@@ -133,6 +133,53 @@ export const menuList = [{
|
|
|
133
133
|
url: require('../../assets/ic_zonglan.png'),
|
|
134
134
|
}]
|
|
135
135
|
}];
|
|
136
|
+
export const menuList_PANWEI = [{
|
|
137
|
+
name: '首页',
|
|
138
|
+
url: require('../../assets/home.svg'),
|
|
139
|
+
children: [],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: '数据汇聚',
|
|
143
|
+
url: require('../../assets/ic_shujuhuiju_m.svg'),
|
|
144
|
+
children: [{
|
|
145
|
+
childName: '数据集成',
|
|
146
|
+
path: token ? '/datacollect' : '/datacollection',
|
|
147
|
+
url:require('../../assets/datacollection_slogo.svg'),
|
|
148
|
+
}]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: '数据治理',
|
|
152
|
+
url: require('../../assets/ic_shujuzhili_m.svg'),
|
|
153
|
+
children: [
|
|
154
|
+
{
|
|
155
|
+
childName: '数据治理',
|
|
156
|
+
path: token ? '/datamanage' : '/dataManager',
|
|
157
|
+
url:require('../../assets/datamanager_slogo.svg'),
|
|
158
|
+
},
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: '数据开发',
|
|
163
|
+
url: require('../../assets/ic_shujukaifa_m.svg'),
|
|
164
|
+
children: [
|
|
165
|
+
{
|
|
166
|
+
childName: '离线开发',
|
|
167
|
+
path: token ? '/datadev' : '/datadev/',
|
|
168
|
+
url:require('../../assets/datadev_slogo.svg'),
|
|
169
|
+
},
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: '数据共享',
|
|
174
|
+
url: require('../../assets/ic_shujukaifang_m.svg'),
|
|
175
|
+
children: [
|
|
176
|
+
{
|
|
177
|
+
childName: '数据服务',
|
|
178
|
+
path: '/dataservice',
|
|
179
|
+
url:require('../../assets/dataservice_slogo.svg'),
|
|
180
|
+
},
|
|
181
|
+
]
|
|
182
|
+
}];
|
|
136
183
|
export const menuIconSrc = require('../../assets/menuIcon.svg');
|
|
137
184
|
export const sysNameMap = [
|
|
138
185
|
{
|
|
@@ -68,6 +68,8 @@ export default {
|
|
|
68
68
|
}
|
|
69
69
|
if (this.stash === 'GZW') {
|
|
70
70
|
sessionStorage.setItem('stash', 'GZW')
|
|
71
|
+
} else if (this.stash === 'PANWEI') {
|
|
72
|
+
sessionStorage.setItem('stash', 'PANWEI')
|
|
71
73
|
} else {
|
|
72
74
|
sessionStorage.removeItem('stash')
|
|
73
75
|
}
|
|
@@ -90,7 +92,15 @@ export default {
|
|
|
90
92
|
handleClickmenu (flag){
|
|
91
93
|
let url = ''
|
|
92
94
|
if (flag === 'single') {
|
|
93
|
-
|
|
95
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
96
|
+
url = '/admin-ui/data-share-portal/personal/info'
|
|
97
|
+
} else if (this.stash === "GZW") {
|
|
98
|
+
url = '/data-platform/#/info/index'
|
|
99
|
+
} else if (this.stash === "PANWEI") {
|
|
100
|
+
url = '/bigdata-portal/#/info/index'
|
|
101
|
+
} else {
|
|
102
|
+
url = '/#/info/index'
|
|
103
|
+
}
|
|
94
104
|
location.href = url;
|
|
95
105
|
} else if (flag === 'systerm') {
|
|
96
106
|
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
@@ -113,7 +123,17 @@ export default {
|
|
|
113
123
|
}
|
|
114
124
|
})
|
|
115
125
|
}
|
|
116
|
-
|
|
126
|
+
if (this.sysName === 'admin') {
|
|
127
|
+
let url = ''
|
|
128
|
+
if (this.stash === "GZW") {
|
|
129
|
+
url = `/data-platform/#${systemPath}`
|
|
130
|
+
} else if (this.stash === 'PANWEI') {
|
|
131
|
+
url = `/bigdata-portal/#${systemPath}`
|
|
132
|
+
} else {
|
|
133
|
+
url = `/#${systemPath}`
|
|
134
|
+
}
|
|
135
|
+
location.href = url
|
|
136
|
+
}
|
|
117
137
|
}
|
|
118
138
|
} else if (flag === 'app') {
|
|
119
139
|
url = '/dataadmin/#/appSystem/index'
|
|
@@ -128,7 +148,14 @@ export default {
|
|
|
128
148
|
await integrationLogout();
|
|
129
149
|
this.logoutUrl()
|
|
130
150
|
} else {
|
|
131
|
-
|
|
151
|
+
let url = ''
|
|
152
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
153
|
+
url = '/admin-ui/system/auth/logout'
|
|
154
|
+
} else if (this.stash === 'GZW') {
|
|
155
|
+
url = '/data-platform/auth/token/logout'
|
|
156
|
+
} else {
|
|
157
|
+
url = '/auth/token/logout'
|
|
158
|
+
}
|
|
132
159
|
const method = ["integration", 'LNRD'].includes(this.stash) ? 'post' : 'delete'
|
|
133
160
|
Axios(url, method).then(() => {
|
|
134
161
|
this.logoutUrl();
|
|
@@ -141,7 +168,17 @@ export default {
|
|
|
141
168
|
logoutUrl() {
|
|
142
169
|
localStorage.clear();
|
|
143
170
|
sessionStorage.clear();
|
|
144
|
-
|
|
171
|
+
let url = ''
|
|
172
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
173
|
+
url = '/admin-ui/login'
|
|
174
|
+
} else if (this.stash === 'GZW') {
|
|
175
|
+
url = '/data-platform/#/login'
|
|
176
|
+
} else if (this.stash === 'PANWEI') {
|
|
177
|
+
url = '/bigdata-portal/#/login'
|
|
178
|
+
} else {
|
|
179
|
+
url = '/#/login'
|
|
180
|
+
}
|
|
181
|
+
location.href = url
|
|
145
182
|
},
|
|
146
183
|
getName () {
|
|
147
184
|
return getUserName()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import getStore from './userInfo';
|
|
3
3
|
import { checkToken } from './permessionUtils';
|
|
4
|
-
let tokenValue = '
|
|
4
|
+
let tokenValue = 'ba8db130f3334ae5b432b1398e0c1b1d';
|
|
5
5
|
axios.interceptors.response.use(
|
|
6
6
|
(response) => {
|
|
7
7
|
if (response.status === 200) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Axios from './axios';
|
|
2
2
|
const localStorageToken = localStorage.getItem('ACCESS_TOKEN')
|
|
3
3
|
const stash = sessionStorage.getItem('stash')
|
|
4
|
-
const DEFAULT_LOGOUT_URL = localStorageToken ? '/admin-ui/login' : stash === 'GZW' ? '/data-platform/#/login' : '/#/login'
|
|
4
|
+
const DEFAULT_LOGOUT_URL = localStorageToken ? '/admin-ui/login' : stash === 'GZW' ? '/data-platform/#/login' : stash === 'PANWEI' ? '/bigdata-portal/#/login' : '/#/login'
|
|
5
5
|
import { integrationLogout } from '../User/service.js'
|
|
6
6
|
// 校验token是否失效
|
|
7
7
|
export const checkToken = async (token) => {
|