module-menu-vue 0.0.66 → 0.0.67

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.66",
3
+ "version": "0.0.67",
4
4
  "description": "城市大数据平台菜单--Vue版",
5
5
  "main": "/index.js",
6
6
  "scripts": {
@@ -1,229 +1,229 @@
1
- <template>
2
- <div>
3
- <div class='menuPopupAndTitle'>
4
- <div class='menuIcon' @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
5
- <img class="menuIcon_img" :src="menuIconSrc" />
6
- </div>
7
- <div class="menu_title_content" v-show="showCollapse" @click="toHref()">
8
- <img class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" />
9
- <span class="menu_title">{{getLogoAndTitle().title}}</span>
10
- </div>
11
- </div>
12
- <div class='menu_list_content' :style="{ display: showMenuList ? 'block' : 'none' }" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
13
- <div v-for="(item, index) in menuList" :key="item.path">
14
- <div :key="item.name" class="cardLine" :style="{height: item.children.length > 3 ? '90px' : ''}">
15
- <div class='leftMenu'
16
- :style="{
17
- height: item.children.length > 3 ? '96px' : '70px',
18
- lineHeight: item.children.length > 3 ? '45px' : '70px',
19
- }">
20
- <img :src="item.url" class="middle" />
21
- <span class="middle textPad" @click="toHomePage(index)">{{item.name}}</span>
22
- </div>
23
- <div class='rightMenu'
24
- :style="{
25
- height: item.children.length > 3 ? '96px' : '70px',
26
- lineHeight: item.children.length > 3 ? '45px' : '70px',
27
- borderBottom: index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
28
- }">
29
- <span v-for="child in item.children" :key="child.url">
30
- <span :key="child.childName">
31
- <img :src="child.url" class="middle iconPad" />
32
- <span class='childMenu textPad middle' @click="toModulePage(child.childName)">{{child.childName}}</span>
33
- </span>
34
- </span>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div >
40
- </template>
41
-
42
- <script>
43
- import { menuList as menuListInit, menuIconSrc, sysNameMap } from './constant.js'
44
- import './menu.css'
45
- import {getMenuList} from './service.js'
46
- export default {
47
- name: 'ModuleMenu',
48
- props: {
49
- sysName: {
50
- type: String,
51
- default: 'admin'
52
- },
53
- collapse: {
54
- type: Boolean,
55
- default: true,
56
- },
57
- stash: {
58
- type: String,
59
- default: ''
60
- }
61
- },
62
- watch: {
63
- collapse: {
64
- handler: function (newVal, oldVal) {
65
- console.log('---', newVal, oldVal)
66
- this.showCollapse = newVal
67
- },
68
- deep: true
69
- }
70
- },
71
- data () {
72
- return {
73
- showMenuList: false,
74
- menuIconSrc: menuIconSrc,
75
- menuList: [],
76
- sessionMenu: [],
77
- menuListInit: menuListInit,
78
- sysNameMap: sysNameMap,
79
- showCollapse: true,
80
- }
81
- },
82
- created () {
83
- this.getSessionMenu();
84
- if (this.stash !== "integration") {
85
- this.getNewMenuList();
86
- }
87
- },
88
- methods: {
89
- toHref () {
90
- if (this.sysName === 'admin' && this.stash !== "integration") {
91
- location.href = '/#/admin/user/index'
92
- }
93
- },
94
- async getSessionMenu () {
95
- // 一体化
96
- if (this.stash === "integration") {
97
- const rsp = await getMenuList()
98
- const rspData = rsp.data.data
99
- if (rspData && rspData.length > 0) {
100
- const routesList = rspData[0].routes
101
- if (rsp.data.data) {
102
- const pathList = routesList.map(item => {
103
- if (item.path.indexOf('appSystem') !== -1) {
104
- let appSysMenuList = []
105
- let appSysNameList = []
106
- item.routes.forEach(obj => {
107
- appSysMenuList.push('/' + obj.path)
108
- appSysNameList.push(obj.name)
109
- }) || []
110
- localStorage.setItem('appSysMenuList', JSON.stringify(appSysMenuList))
111
- localStorage.setItem('appSysNameList', JSON.stringify(appSysNameList))
112
- }
113
- return {
114
- ...item,
115
- path: item.path.indexOf('/') === -1 ? '/' + item.path : item.path
116
- }
117
- })
118
- this.sessionMenu = [...pathList]
119
- this.getNewMenuList();
120
- }
121
- }
122
- } else {
123
- // 轻量级
124
- const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
125
- if (menuObj) {
126
- this.sessionMenu = [...menuObj.content]
127
- }
128
- }
129
- },
130
- // 获取系统logo及title
131
- getLogoAndTitle () {
132
- let sysInfo = this.sysNameMap.find(item => item.sysName === this.sysName);
133
- let logoAndTitle = { logoSrc: "", title: "" };
134
- if (sysInfo) {
135
- logoAndTitle.logoSrc = sysInfo.logoSrc;
136
- logoAndTitle.title = sysInfo.title;
137
- }
138
- return logoAndTitle;
139
- },
140
- // 跳转各个模块
141
- toModulePage (nameStr) {
142
- console.log('nameStr', nameStr)
143
- let thirdPartyServiceJumpPath = ""; // 第三方服务跳转路径
144
- switch (nameStr) {
145
- case "数据集成":
146
- thirdPartyServiceJumpPath = "/datacollect/";
147
- break;
148
- case "数据治理":
149
- thirdPartyServiceJumpPath = "/datamanage/";
150
- break;
151
- case "元数据管理":
152
- thirdPartyServiceJumpPath = "/metadata/";
153
- break;
154
- case "数据质量":
155
- thirdPartyServiceJumpPath = "/quality/";
156
- break;
157
- case "离线开发":
158
- thirdPartyServiceJumpPath = "/datadev/";
159
- break;
160
- case "实时开发":
161
- thirdPartyServiceJumpPath = "/dataanalytic/";
162
- break;
163
- case "数据服务":
164
- thirdPartyServiceJumpPath = "/dataservice/";
165
- break;
166
- case "数据资产":
167
- thirdPartyServiceJumpPath = "/dataasset/";
168
- break;
169
- case "数据共享":
170
- thirdPartyServiceJumpPath = "/datasharing/";
171
- break;
172
- case "运维中心":
173
- thirdPartyServiceJumpPath = "/operate/";
174
- break;
175
- case "消息中心":
176
- thirdPartyServiceJumpPath = "/alert/";
177
- break;
178
- case "数据安全":
179
- thirdPartyServiceJumpPath = "/datasecurity/";
180
- break;
181
- case "目录管理":
182
- thirdPartyServiceJumpPath = "/admin-ui/catalog/menuClassify/list";
183
- break;
184
- case "资源管理":
185
- thirdPartyServiceJumpPath = "/admin-ui/resource/tableResource/list";
186
- break;
187
- case "供需对接":
188
- thirdPartyServiceJumpPath = '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
189
- break;
190
- default:
191
- break;
192
- }
193
- location.href = thirdPartyServiceJumpPath
194
- },
195
- // 跳转首页
196
- toHomePage (index) {
197
- if (index === 0) {
198
- location.href = this.stash === "integration" ? '/dataadmin/#/index' : '/#/index'
199
- }
200
- },
201
- getNewMenuList () {
202
- let newMenuList = [...this.menuListInit];
203
- if (this.sessionMenu) {
204
- const pathList = this.sessionMenu.map(item => item.path)
205
- // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
206
- for (let index = newMenuList.length - 1; index >= 0; index--) {
207
- const menuItem = newMenuList[index]
208
- for (let index_ch = menuItem.children.length - 1; index_ch >= 0; index_ch--) {
209
- const child = menuItem.children[index_ch]
210
- if (!pathList.includes(child.path)) {
211
- newMenuList[index].children.splice(index_ch, 1)
212
- }
213
- }
214
- if (menuItem.children.length === 0 && menuItem.name !== '首页') {
215
- newMenuList.splice(index, 1)
216
- }
217
- }
218
- }
219
- this.menuList = [...newMenuList];
220
- },
221
- }
222
- }
223
- </script>
224
- <style scoped>
225
- .iconPad{
226
- width: 15px;
227
- height: 15px;
228
- }
229
- </style>
1
+ <template>
2
+ <div>
3
+ <div class='menuPopupAndTitle'>
4
+ <div class='menuIcon' @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
5
+ <img class="menuIcon_img" :src="menuIconSrc" />
6
+ </div>
7
+ <div class="menu_title_content" v-show="showCollapse" @click="toHref()">
8
+ <img class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" />
9
+ <span class="menu_title">{{getLogoAndTitle().title}}</span>
10
+ </div>
11
+ </div>
12
+ <div class='menu_list_content' :style="{ display: showMenuList ? 'block' : 'none' }" @mouseenter="showMenuList = true" @mouseleave="showMenuList = false">
13
+ <div v-for="(item, index) in menuList" :key="item.path">
14
+ <div :key="item.name" class="cardLine" :style="{height: item.children.length > 3 ? '90px' : ''}">
15
+ <div class='leftMenu'
16
+ :style="{
17
+ height: item.children.length > 3 ? '96px' : '70px',
18
+ lineHeight: item.children.length > 3 ? '45px' : '70px',
19
+ }">
20
+ <img :src="item.url" class="middle" />
21
+ <span class="middle textPad" @click="toHomePage(index)">{{item.name}}</span>
22
+ </div>
23
+ <div class='rightMenu'
24
+ :style="{
25
+ height: item.children.length > 3 ? '96px' : '70px',
26
+ lineHeight: item.children.length > 3 ? '45px' : '70px',
27
+ borderBottom: index === menuList.length - 1 ? '0px' : '1px solid #E9E9E9',
28
+ }">
29
+ <span v-for="child in item.children" :key="child.url">
30
+ <span :key="child.childName">
31
+ <img :src="child.url" class="middle iconPad" />
32
+ <span class='childMenu textPad middle' @click="toModulePage(child.childName)">{{child.childName}}</span>
33
+ </span>
34
+ </span>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div >
40
+ </template>
41
+
42
+ <script>
43
+ import { menuList as menuListInit, menuIconSrc, sysNameMap } from './constant.js'
44
+ import './menu.css'
45
+ import {getMenuList} from './service.js'
46
+ export default {
47
+ name: 'ModuleMenu',
48
+ props: {
49
+ sysName: {
50
+ type: String,
51
+ default: 'admin'
52
+ },
53
+ collapse: {
54
+ type: Boolean,
55
+ default: true,
56
+ },
57
+ stash: {
58
+ type: String,
59
+ default: ''
60
+ }
61
+ },
62
+ watch: {
63
+ collapse: {
64
+ handler: function (newVal, oldVal) {
65
+ console.log('---', newVal, oldVal)
66
+ this.showCollapse = newVal
67
+ },
68
+ deep: true
69
+ }
70
+ },
71
+ data () {
72
+ return {
73
+ showMenuList: false,
74
+ menuIconSrc: menuIconSrc,
75
+ menuList: [],
76
+ sessionMenu: [],
77
+ menuListInit: menuListInit,
78
+ sysNameMap: sysNameMap,
79
+ showCollapse: true,
80
+ }
81
+ },
82
+ created () {
83
+ this.getSessionMenu();
84
+ if (this.stash !== "integration") {
85
+ this.getNewMenuList();
86
+ }
87
+ },
88
+ methods: {
89
+ toHref () {
90
+ if (this.sysName === 'admin' && this.stash !== "integration") {
91
+ location.href = '/#/admin/user/index'
92
+ }
93
+ },
94
+ async getSessionMenu () {
95
+ // 一体化
96
+ if (this.stash === "integration") {
97
+ const rsp = await getMenuList()
98
+ const rspData = rsp.data.data
99
+ if (rspData && rspData.length > 0) {
100
+ const routesList = rspData[0].routes
101
+ if (rsp.data.data) {
102
+ const pathList = routesList.map(item => {
103
+ if (item.path.indexOf('appSystem') !== -1) {
104
+ let appSysMenuList = []
105
+ let appSysNameList = []
106
+ item.routes.forEach(obj => {
107
+ appSysMenuList.push('/' + obj.path)
108
+ appSysNameList.push(obj.name)
109
+ }) || []
110
+ localStorage.setItem('appSysMenuList', JSON.stringify(appSysMenuList))
111
+ localStorage.setItem('appSysNameList', JSON.stringify(appSysNameList))
112
+ }
113
+ return {
114
+ ...item,
115
+ path: item.path.indexOf('/') === -1 ? '/' + item.path : item.path
116
+ }
117
+ })
118
+ this.sessionMenu = [...pathList]
119
+ this.getNewMenuList();
120
+ }
121
+ }
122
+ } else {
123
+ // 轻量级
124
+ const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
125
+ if (menuObj) {
126
+ this.sessionMenu = [...menuObj.content]
127
+ }
128
+ }
129
+ },
130
+ // 获取系统logo及title
131
+ getLogoAndTitle () {
132
+ let sysInfo = this.sysNameMap.find(item => item.sysName === this.sysName);
133
+ let logoAndTitle = { logoSrc: "", title: "" };
134
+ if (sysInfo) {
135
+ logoAndTitle.logoSrc = sysInfo.logoSrc;
136
+ logoAndTitle.title = sysInfo.title;
137
+ }
138
+ return logoAndTitle;
139
+ },
140
+ // 跳转各个模块
141
+ toModulePage (nameStr) {
142
+ console.log('nameStr', nameStr)
143
+ let thirdPartyServiceJumpPath = ""; // 第三方服务跳转路径
144
+ switch (nameStr) {
145
+ case "数据集成":
146
+ thirdPartyServiceJumpPath = "/datacollect/";
147
+ break;
148
+ case "数据治理":
149
+ thirdPartyServiceJumpPath = "/datamanage/";
150
+ break;
151
+ case "元数据管理":
152
+ thirdPartyServiceJumpPath = "/metadata/";
153
+ break;
154
+ case "数据质量":
155
+ thirdPartyServiceJumpPath = "/quality/";
156
+ break;
157
+ case "离线开发":
158
+ thirdPartyServiceJumpPath = "/datadev/";
159
+ break;
160
+ case "实时开发":
161
+ thirdPartyServiceJumpPath = "/dataanalytic/";
162
+ break;
163
+ case "数据服务":
164
+ thirdPartyServiceJumpPath = "/dataservice/";
165
+ break;
166
+ case "数据资产":
167
+ thirdPartyServiceJumpPath = "/dataasset/";
168
+ break;
169
+ case "数据共享":
170
+ thirdPartyServiceJumpPath = "/datasharing/";
171
+ break;
172
+ case "运维中心":
173
+ thirdPartyServiceJumpPath = "/operate/";
174
+ break;
175
+ case "消息中心":
176
+ thirdPartyServiceJumpPath = "/alert/";
177
+ break;
178
+ case "数据安全":
179
+ thirdPartyServiceJumpPath = "/datasecurity/";
180
+ break;
181
+ case "目录管理":
182
+ thirdPartyServiceJumpPath = "/admin-ui/catalog/menuClassify/list";
183
+ break;
184
+ case "资源管理":
185
+ thirdPartyServiceJumpPath = "/admin-ui/resource/tableResource/list";
186
+ break;
187
+ case "供需对接":
188
+ thirdPartyServiceJumpPath = '/admin-ui/supply-and-demand-docking/dataRequirement/propose/list';
189
+ break;
190
+ default:
191
+ break;
192
+ }
193
+ location.href = thirdPartyServiceJumpPath
194
+ },
195
+ // 跳转首页
196
+ toHomePage (index) {
197
+ if (index === 0) {
198
+ location.href = this.stash === "integration" ? '/dataadmin/#/index' : '/#/index'
199
+ }
200
+ },
201
+ getNewMenuList () {
202
+ let newMenuList = [...this.menuListInit];
203
+ if (this.sessionMenu) {
204
+ const pathList = this.sessionMenu.map(item => item.path)
205
+ // 过滤掉没有权限的子菜单(PS:如果模块下面子菜单都没有,则不显示该模块)
206
+ for (let index = newMenuList.length - 1; index >= 0; index--) {
207
+ const menuItem = newMenuList[index]
208
+ for (let index_ch = menuItem.children.length - 1; index_ch >= 0; index_ch--) {
209
+ const child = menuItem.children[index_ch]
210
+ if (!pathList.includes(child.path)) {
211
+ newMenuList[index].children.splice(index_ch, 1)
212
+ }
213
+ }
214
+ if (menuItem.children.length === 0 && menuItem.name !== '首页') {
215
+ newMenuList.splice(index, 1)
216
+ }
217
+ }
218
+ }
219
+ this.menuList = [...newMenuList];
220
+ },
221
+ }
222
+ }
223
+ </script>
224
+ <style scoped>
225
+ .iconPad{
226
+ width: 15px;
227
+ height: 15px;
228
+ }
229
+ </style>
@@ -9,7 +9,7 @@
9
9
  <el-dropdown-menu slot="dropdown">
10
10
  <el-dropdown-item command="single">
11
11
  <img :src="PersonalCenterSrc" alt="" class="menuItem" />
12
- <span>个人中心</span>
12
+ <span>{{stash === "integration" ? '用户中心' : '个人中心'}}</span>
13
13
  </el-dropdown-item>
14
14
  <el-dropdown-item v-show="isShowSys" command="systerm">
15
15
  <img :src="SystemManageSrc" alt="" class="menuItem" />
@@ -85,7 +85,7 @@ export default {
85
85
  handleClickmenu (flag){
86
86
  let url = ''
87
87
  if (flag === 'single') {
88
- url = this.stash === "integration" ? '/admin-ui/user/profile' : '/#/info/index'
88
+ url = this.stash === "integration" ? '/admin-ui/data-share-portal/personal/info' : '/#/info/index'
89
89
  location.href = url;
90
90
  } else if (flag === 'systerm') {
91
91
  url = this.stash === "integration" ? '/admin-ui/bpm/manager/user-group' : '/#/admin/user/index'
package/vue.config.js CHANGED
@@ -1,38 +1,38 @@
1
- /**npm
2
- * 配置参考:
3
- * https://cli.vuejs.org/zh/config/
4
- */
5
- const url = 'http://10.136.106.131:31950'
6
- module.exports = {
7
- lintOnSave: true,
8
- productionSourceMap: false,
9
- css: {
10
- // 忽略 CSS order 顺序警告
11
- extract: { ignoreOrder: true },
12
- // 查看CSS属于哪个css文件
13
- sourceMap: process.env.NODE_ENV === "development",
14
- },
15
- // 配置转发代理
16
- devServer: {
17
- // disableHostCheck: true,
18
- port: 8080,
19
- proxy: {
20
- "/": {
21
- // target:' https://10.136.106.82:30011',
22
- target: url,
23
- ws: false, // 需要websocket 开启
24
- changOrigin: true, //允许跨域
25
- pathRewrite: {
26
- "^/": "/",
27
- },
28
- },
29
- '/admin-api': {
30
- target: 'http://10.136.106.131:30097',
31
- changeOrigin: true,
32
- pathRewrite: { '^': '' },
33
- }
34
- // 3.5 以后不需要再配置
35
- },
36
- },
37
- };
38
-
1
+ /**npm
2
+ * 配置参考:
3
+ * https://cli.vuejs.org/zh/config/
4
+ */
5
+ const url = 'http://10.136.106.131:31950'
6
+ module.exports = {
7
+ lintOnSave: true,
8
+ productionSourceMap: false,
9
+ css: {
10
+ // 忽略 CSS order 顺序警告
11
+ extract: { ignoreOrder: true },
12
+ // 查看CSS属于哪个css文件
13
+ sourceMap: process.env.NODE_ENV === "development",
14
+ },
15
+ // 配置转发代理
16
+ devServer: {
17
+ // disableHostCheck: true,
18
+ port: 8080,
19
+ proxy: {
20
+ "/": {
21
+ // target:' https://10.136.106.82:30011',
22
+ target: url,
23
+ ws: false, // 需要websocket 开启
24
+ changOrigin: true, //允许跨域
25
+ pathRewrite: {
26
+ "^/": "/",
27
+ },
28
+ },
29
+ '/admin-api': {
30
+ target: 'http://10.136.106.131:30097',
31
+ changeOrigin: true,
32
+ pathRewrite: { '^': '' },
33
+ }
34
+ // 3.5 以后不需要再配置
35
+ },
36
+ },
37
+ };
38
+