module-menu-vue 0.0.95 → 0.0.97

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu-vue",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "description": "城市大数据平台菜单--Vue版",
5
5
  "main": "/index.js",
6
6
  "scripts": {
Binary file
Binary file
Binary file
@@ -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">
@@ -45,9 +44,9 @@
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
- import {getMenuList, isLogoutThird} from './service.js'
49
+ import { getMenuList, isLogoutThird, getInfoByName, getUrlByInfo } from './service.js'
51
50
  export default {
52
51
  name: 'ModuleMenu',
53
52
  props: {
@@ -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
- location.href = this.stash === "GZW" ? `/data-platform/#${this.systemPath}` : !["integration", 'LNRD'].includes(this.stash) ? `/#${this.systemPath}` : ''
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 () {
@@ -164,8 +172,19 @@ export default {
164
172
  }
165
173
  return logoAndTitle;
166
174
  },
175
+ async getUrl(name) {
176
+ let res = null;
177
+ let obj = {}
178
+ res = await getInfoByName(name)
179
+ obj = {
180
+ clientId: res.data.data.clientId,
181
+ redirectUrl: encodeURIComponent(res.data.data.redirectUris[0]),
182
+ }
183
+ res = await getUrlByInfo(obj)
184
+ return res.data.data
185
+ },
167
186
  // 跳转各个模块
168
- toModulePage (nameStr) {
187
+ async toModulePage (nameStr) {
169
188
  console.log('nameStr', nameStr)
170
189
  if (nameStr === '平台运行总览') {
171
190
  window.open('/dataadmin/#/overview', '_blank');
@@ -173,6 +192,15 @@ export default {
173
192
  }
174
193
  let thirdPartyServiceJumpPath = ""; // 第三方服务跳转路径
175
194
  switch (nameStr) {
195
+ case '数据可视化':
196
+ thirdPartyServiceJumpPath = await this.getUrl('dataview')
197
+ break;
198
+ case '数据填报':
199
+ thirdPartyServiceJumpPath = await this.getUrl('datafill')
200
+ break;
201
+ case '数据标签':
202
+ thirdPartyServiceJumpPath = '/datatag/';
203
+ break;
176
204
  case "数据集成":
177
205
  thirdPartyServiceJumpPath = "/datacollect/";
178
206
  break;
@@ -232,11 +260,21 @@ export default {
232
260
  // 跳转首页
233
261
  toHomePage (index) {
234
262
  if (index === 0) {
235
- location.href = ["integration", 'LNRD'].includes(this.stash) ? '/dataadmin/#/index' : this.stash === "GZW" ? '/data-platform/#/index' : '/#/index'
263
+ let url = ''
264
+ if (["integration", 'LNRD'].includes(this.stash)) {
265
+ url = '/dataadmin/#/index'
266
+ } else if (this.stash === "GZW") {
267
+ url = '/data-platform/#/index'
268
+ } else if (this.stash === "PANWEI") {
269
+ url = '/bigdata-portal/#/index'
270
+ } else {
271
+ url = '/#/index'
272
+ }
273
+ location.href = url
236
274
  }
237
275
  },
238
276
  getNewMenuList () {
239
- let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : [...this.menuListInit];
277
+ let newMenuList = this.stash === 'LNRD' ? [...lnrdMenuList] : this.stash === 'PANWEI' ? [...this.menuList_PANWEI] : [...this.menuListInit];
240
278
  if (this.sessionMenu) {
241
279
  const pathList = this.sessionMenu.map(item => item.path)
242
280
  // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
@@ -1,5 +1,5 @@
1
1
  const token = localStorage.getItem('ACCESS_TOKEN')
2
- console.log('token', token)
2
+
3
3
  export const menuList = [{
4
4
  name: '首页',
5
5
  url: require('../../assets/home.svg'),
@@ -8,11 +8,18 @@ export const menuList = [{
8
8
  {
9
9
  name: '数据汇聚',
10
10
  url: require('../../assets/ic_shujuhuiju_m.svg'),
11
- children: [{
12
- childName: '数据集成',
13
- path: token ? '/datacollect' : '/datacollection',
14
- url:require('../../assets/datacollection_slogo.svg'),
15
- }]
11
+ children: [
12
+ {
13
+ childName: '数据集成',
14
+ path: token ? '/datacollect' : '/datacollection',
15
+ url:require('../../assets/datacollection_slogo.svg'),
16
+ },
17
+ {
18
+ childrenName: "数据填报",
19
+ path: "/datafill",
20
+ url: require('../../assets/dataApp/datafill.png'),
21
+ }
22
+ ]
16
23
  },
17
24
  {
18
25
  name: '数据治理',
@@ -30,7 +37,12 @@ export const menuList = [{
30
37
  {
31
38
  childName: '数据质量',
32
39
  path: token ? '/quality' : '/quality/',
33
- url:require('../../assets/quality_slogo.svg'),
40
+ url: require('../../assets/quality_slogo.svg'),
41
+ },
42
+ {
43
+ childName: "指标管理",
44
+ path: "/indicator",
45
+ url: require('../../assets/dataApp/indicator.png'),
34
46
  }]
35
47
  },
36
48
  {
@@ -85,20 +97,28 @@ export const menuList = [{
85
97
  path: "/cascade",
86
98
  url: require("../../assets/ic_jilianguanli.png"),
87
99
  },
88
- {
89
- childName: '综合评价系统',
90
- path: '/evaluate',
91
- url: require("../../assets/ic_pingjia.png"),
92
- }]
100
+ ]
93
101
  },
94
102
  {
95
103
  name: '数据应用',
96
104
  url: require('../../assets/ic_shujuyingyong_m.svg'),
97
- children: [{
98
- childName: '数据标签',
99
- path: '',
100
- url:require('../../assets/datalabel_slogo.svg'),
101
- }]
105
+ children: [
106
+ {
107
+ childName: '数据标签',
108
+ path: '',
109
+ url: require('../../assets/datalabel_slogo.svg'),
110
+ },
111
+ {
112
+ childName: "数据可视化",
113
+ path: "/dataview",
114
+ url: require("../../assets/dataApp/dataview.png"),
115
+ },
116
+ {
117
+ childName: '综合评价系统',
118
+ path: '/evaluate',
119
+ url: require("../../assets/ic_pingjia.png"),
120
+ }
121
+ ]
102
122
  },
103
123
  {
104
124
  name: '公共模块',
@@ -133,7 +153,57 @@ export const menuList = [{
133
153
  url: require('../../assets/ic_zonglan.png'),
134
154
  }]
135
155
  }];
156
+
157
+ export const menuList_PANWEI = [{
158
+ name: '首页',
159
+ url: require('../../assets/home.svg'),
160
+ children: [],
161
+ },
162
+ {
163
+ name: '数据汇聚',
164
+ url: require('../../assets/ic_shujuhuiju_m.svg'),
165
+ children: [{
166
+ childName: '数据集成',
167
+ path: token ? '/datacollect' : '/datacollection',
168
+ url:require('../../assets/datacollection_slogo.svg'),
169
+ }]
170
+ },
171
+ {
172
+ name: '数据治理',
173
+ url: require('../../assets/ic_shujuzhili_m.svg'),
174
+ children: [
175
+ {
176
+ childName: '数据治理',
177
+ path: token ? '/datamanage' : '/dataManager',
178
+ url:require('../../assets/datamanager_slogo.svg'),
179
+ },
180
+ ]
181
+ },
182
+ {
183
+ name: '数据开发',
184
+ url: require('../../assets/ic_shujukaifa_m.svg'),
185
+ children: [
186
+ {
187
+ childName: '离线开发',
188
+ path: token ? '/datadev' : '/datadev/',
189
+ url:require('../../assets/datadev_slogo.svg'),
190
+ },
191
+ ]
192
+ },
193
+ {
194
+ name: '数据共享',
195
+ url: require('../../assets/ic_shujukaifang_m.svg'),
196
+ children: [
197
+ {
198
+ childName: '数据服务',
199
+ path: '/dataservice',
200
+ url:require('../../assets/dataservice_slogo.svg'),
201
+ },
202
+ ]
203
+ }];
204
+
136
205
  export const menuIconSrc = require('../../assets/menuIcon.svg');
206
+
137
207
  export const sysNameMap = [
138
208
  {
139
209
  sysName: 'datasecurity',
@@ -1,4 +1,5 @@
1
1
  import request from 'axios'
2
+
2
3
  export const getMenuList = () => {
3
4
  return request(`/admin-api/system/user/get-user-menu-List?menuName=数据平台`, {
4
5
  method: 'get'
@@ -8,4 +9,18 @@ export const getMenuList = () => {
8
9
  // 是否跳转到第三方
9
10
  export const isLogoutThird = () => {
10
11
  return request('/admin/social/logoutUri');
12
+ }
13
+
14
+ export function getInfoByName(name) {
15
+ return request({
16
+ url: `/admin-api/system/oauth2-client/getByName?name=${name}`,
17
+ method: 'get',
18
+ })
19
+ }
20
+
21
+ export function getUrlByInfo(obj) {
22
+ return request({
23
+ url: `/admin-api/system/oauth2/authorize?response_type=code&client_id=${obj.clientId}&redirect_uri=${obj.redirectUrl}&auto_approve=true&scope=%7B"user.read":true%7D`,
24
+ method: 'post',
25
+ })
11
26
  }
@@ -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
- url = ["integration", 'LNRD'].includes(this.stash) ? '/admin-ui/data-share-portal/personal/info' : this.stash === "GZW" ? '/data-platform/#/info/index' : '/#/info/index'
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
- location.href = this.stash === "GZW" ? `/data-platform/#${systemPath}` : `/#${systemPath}`
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
- const url = ["integration", 'LNRD'].includes(this.stash) ? '/admin-api/system/auth/logout' : this.stash === 'GZW' ? '/data-platform/auth/token/logout' : '/auth/token/logout'
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
- location.href = ["integration", 'LNRD'].includes(this.stash) ? '/admin-ui/login' : this.stash === 'GZW' ? '/data-platform/#/login' : '/#/login'
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
  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) => {
package/vue.config.js CHANGED
@@ -1,9 +1,4 @@
1
- /**npm
2
- * 配置参考:
3
- * https://cli.vuejs.org/zh/config/
4
- */
5
- const url = 'https://10.136.106.131:31950'
6
- // const url = 'https://192.168.108.86:30011/'
1
+ const url = 'https://192.168.108.203:31950'
7
2
  module.exports = {
8
3
  lintOnSave: true,
9
4
  productionSourceMap: false,
@@ -28,7 +23,7 @@ module.exports = {
28
23
  },
29
24
  },
30
25
  '/admin-api': {
31
- target: 'https://10.136.106.131:31950',
26
+ target: url,
32
27
  changeOrigin: true,
33
28
  pathRewrite: { '^': '' },
34
29
  }