菜单路由

This commit is contained in:
姚亚男
2021-09-18 14:46:44 +08:00
parent 141f733972
commit 8e84d2d1ef
21 changed files with 376 additions and 60 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ const queryTreeListForRole = (params)=>getAction('/sys/role/queryTreeList',param
const queryListAsync = (params)=>getAction('/sys/permission/queryListAsync',params)
const queryRolePermission = (params)=>getAction('/sys/permission/queryRolePermission',params)
const saveRolePermission = (params)=>postAction('/sys/permission/saveRolePermission',params)
const queryPermissionsByUser = ()=>getAction('/sys/permission/getUserPermissionByToken')
// const queryPermissionsByUser = ()=>getAction('/sys/permission/getUserPermissionByToken')
const loadAllRoleIds = (params)=>getAction('/sys/permission/loadAllRoleIds',params)
const getPermissionRuleList = (params)=>getAction('/sys/permission/getPermRuleListByPermId',params)
const queryPermissionRule = (params)=>getAction('/sys/permission/queryPermissionRule',params)
@@ -118,7 +118,7 @@ export {
queryListAsync,
queryRolePermission,
saveRolePermission,
queryPermissionsByUser,
// queryPermissionsByUser,
loadAllRoleIds,
getPermissionRuleList,
queryPermissionRule,
+12
View File
@@ -0,0 +1,12 @@
/* 引入 icon class 文件 */
@import "./iconfont.css";
/* 设置使用字体的优先级 anticon 高 */
:global(.anticon) { /* :global() 是为了覆盖全局class .anticon 的样式 */
&:before {
font-family: "anticon", "anticon-jeecg" !important;
/* 默认样式是这样
font-family: "anticon" !important;
*/
}
}
+47
View File
@@ -0,0 +1,47 @@
@font-face {
font-family: "anticon-jeecg"; /* Project id 2798517 */
src: url('iconfont.woff2?t=1631613073967') format('woff2'),
url('iconfont.woff?t=1631613073967') format('woff'),
url('iconfont.ttf?t=1631613073967') format('truetype');
}
.anticon-jeecg {
font-family: "anticon-jeecg" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.anticonmeeting:before {
content: "\e60f";
}
.anticonproject:before {
content: "\e609";
}
.anticonpack:before {
content: "\e60a";
}
.anticonmember:before {
content: "\e60b";
}
.anticondata-network-disk:before {
content: "\e60c";
}
.anticonfinancial:before {
content: "\e60e";
}
.anticoncontract:before {
content: "\e608";
}
.anticoncompany:before {
content: "\e607";
}
File diff suppressed because one or more lines are too long
+65
View File
@@ -0,0 +1,65 @@
{
"id": "2798517",
"name": "zx-project",
"font_family": "anticon-jeecg",
"css_prefix_text": "anticon",
"description": "",
"glyphs": [
{
"icon_id": "24340808",
"name": "cus_meeting",
"font_class": "meeting1",
"unicode": "e60f",
"unicode_decimal": 58895
},
{
"icon_id": "24340604",
"name": "cus_project",
"font_class": "project",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "24340605",
"name": "cus_pack",
"font_class": "pack",
"unicode": "e60a",
"unicode_decimal": 58890
},
{
"icon_id": "24340606",
"name": "cus_member",
"font_class": "member",
"unicode": "e60b",
"unicode_decimal": 58891
},
{
"icon_id": "24340607",
"name": "cus_data-network-disk",
"font_class": "data-network-disk",
"unicode": "e60c",
"unicode_decimal": 58892
},
{
"icon_id": "24340609",
"name": "cus_financial",
"font_class": "financial",
"unicode": "e60e",
"unicode_decimal": 58894
},
{
"icon_id": "24337509",
"name": "cus_contract",
"font_class": "contract",
"unicode": "e608",
"unicode_decimal": 58888
},
{
"icon_id": "24337464",
"name": "cus_company",
"font_class": "company",
"unicode": "e607",
"unicode_decimal": 58887
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5
View File
@@ -97,6 +97,7 @@ export default {
// render
renderItem (menu) {
if (!menu.hidden) {
return menu.children && !menu.alwaysShow ? this.renderSubMenu(menu) : this.renderMenuItem(menu)
}
@@ -146,6 +147,10 @@ export default {
)
},
renderIcon (icon) {
if (icon !== 'none' && icon !== undefined && icon.indexOf('cus_') !== -1) {
let className = `anticon-jeecg anticon${icon.substr(4)}`
return <i class={className} style='margin-right: 8px'></i>
}
if (icon === 'none' || icon === undefined) {
return null
}
+1 -1
View File
@@ -187,7 +187,7 @@
},
toMyAnnouncement(){
this.$router.push({
path: '/isps/userAnnouncement'
path: '/system/userAnnouncementList'
})
},
modalFormOk(){
+126 -1
View File
@@ -34,7 +34,7 @@ export const constantRouterMap = [
{
path: "login",
name: "login",
component: () => import( /* webpackChunkName: "user" */ "@/views/user/Login")
component: () => import(/* webpackChunkName: "user" */ "@/views/user/Login")
},
{
path: "register",
@@ -54,3 +54,128 @@ export const constantRouterMap = [
]
}
];
/**
* 页面路由
* @type { *[] }
*/
export const routerData = [
{
redirect: null,
path: '/dashboard/analysis',
component: 'dashboard/Analysis',
route: '1',
meta: {
icon: 'home', // 菜单前图标
componentName: 'Analysis',
title: '首页' // 菜单名称
},
name: 'dashboard-analysis',
id: '1'
},
{
redirect: null,
path: '/mineProject/MineProject',
component: 'mineProject/MineProject',
route: '2',
meta: {
icon: 'cus_project', // 菜单前图标
componentName: 'MineProject',
title: '我的项目' // 菜单名称
},
name: 'mine-project',
id: '2'
},
{
redirect: null,
path: '/subBidComittee/SubBidComittee',
component: 'subBidComittee/SubBidComittee',
route: '3',
meta: {
icon: 'team', // 菜单前图标
componentName: 'SubBidComittee',
title: '分标委' // 菜单名称
},
name: 'sub-bid-comittee',
id: '3'
},
{
redirect: null,
path: '/workTeam/WorkTeam',
component: 'workTeam/WorkTeam',
route: '4',
meta: {
icon: 'cus_member', // 菜单前图标
componentName: 'WorkTeam',
title: '工作组' // 菜单名称
},
name: 'work-team',
id: '4'
},
{
redirect: null,
path: '/dataMember/DataMember',
component: 'dataMember/DataMember',
route: '5',
meta: {
icon: 'cus_pack', // 菜单前图标
componentName: 'DataMember',
title: '资料网员' // 菜单名称
},
name: 'data-member',
id: '5'
},
{
redirect: null,
path: '/meetingActivity/MeetingActivity',
component: 'meetingActivity/MeetingActivity',
route: '6',
meta: {
icon: 'cus_meeting', // 菜单前图标
componentName: 'MeetingActivity',
title: '会议活动' // 菜单名称
},
name: 'meeting-activity',
id: '6'
},
{
redirect: null,
path: '/dataDownload/DataDownload',
component: 'dataDownload/DataDownload',
route: '7',
meta: {
icon: 'cus_data-network-disk', // 菜单前图标
componentName: 'DataDownload',
title: '资料下载' // 菜单名称
},
name: 'data-download',
id: '7'
},
{
redirect: null,
path: '/mineContract/MineContract',
component: 'mineContract/MineContract',
route: '8',
meta: {
icon: 'cus_contract', // 菜单前图标
componentName: 'MineContract',
title: '我的合同' // 菜单名称
},
name: 'mine-contract',
id: '8'
},
{
path: "/system/UserAnnouncementList",
component: 'system/UserAnnouncementList',
redirect: null,
hidden: true,
route: '9',
meta: {
icon: '', // 菜单前图标
componentName: 'UserAnnouncementList',
title: '我的消息' // 菜单名称
},
name: 'user-announcement-list',
id: '9'
}
]
+4
View File
@@ -26,6 +26,10 @@ import JeroComponents from '@/components/jero/index'
import JDictSelectTag from './components/dict/index.js'
import '@/utils/filter' // base filtermybatis-plus
import vTrim from '@/utils/vTrim'
// Fontclass模式
import '@/components/iconfont/common.less'
// 使用 symbol模式 支持多色
import '@/components/iconfont/iconfont.js'
Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)
+21 -56
View File
@@ -2,8 +2,8 @@ import Vue from 'vue'
import { login, logout, phoneLogin, thirdLogin } from '@/api/login'
import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID,CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
import { welcome } from '@/utils/util'
import { queryPermissionsByUser } from '@/api/api'
import { getAction } from '@/api/manage'
import { routerData } from "@/config/router.config";
const user = {
state: {
@@ -116,62 +116,27 @@ const user = {
// 获取用户信息
GetPermissionList({ commit }) {
return new Promise((resolve, reject) => {
queryPermissionsByUser().then(response => {
const menuData = [
{
'redirect': null,
'path': '/dashboard/analysis',
'component': 'dashboard/Analysis',
'route': '1',
'meta': {
'icon': 'home', // 菜单前图标
'componentName': 'Analysis',
'title': '首页' // 菜单名称
},
'name': 'dashboard-analysis',
'id': '1'
},
{
'redirect': null,
'path': '',
'component': '',
'route': '1',
'meta': {
'icon': 'home', // 菜单前图标
'componentName': 'Analysis',
'title': '菜单2' // 菜单名称
},
'name': 'dashboard-analysis',
'id': '2'
}
]
const authData = []
const allAuthData = []
//Vue.ls.set(USER_AUTH,authData);
sessionStorage.setItem(USER_AUTH,JSON.stringify(authData))
sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData))
if (menuData && menuData.length > 0) {
//update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
menuData.forEach((item) => {
if (item['children']) {
let hasChildrenMenu = item['children'].filter((i) => {
return !i.hidden || i.hidden == false
})
if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
item['hidden'] = true
}
const menuData = routerData
const authData = []
const allAuthData = []
sessionStorage.setItem(USER_AUTH,JSON.stringify(authData))
sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData))
if (menuData && menuData.length > 0) {
menuData.forEach((item) => {
if (item['children']) {
let hasChildrenMenu = item['children'].filter((i) => {
return !i.hidden || i.hidden == false
})
if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
item['hidden'] = true
}
})
//console.log(" menu show json ", menuData)
//update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
commit('SET_PERMISSIONLIST', menuData)
} else {
reject('getPermissionList: permissions must be a non-null array !')
}
resolve(response)
}).catch(error => {
reject(error)
})
}
})
commit('SET_PERMISSIONLIST', menuData)
resolve({result: {menu:menuData}})
} else {
reject('getPermissionList: permissions must be a non-null array !')
}
})
},
+1
View File
@@ -1,5 +1,6 @@
<template>
<div>
我是首页
</div>
</template>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>资料下载</div>
</template>
<script>
export default {
name: 'DataDownload',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>资料网员</div>
</template>
<script>
export default {
name: 'DataMember',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
@@ -0,0 +1,13 @@
<template>
<div>会议活动</div>
</template>
<script>
export default {
name: 'MeetingActivity',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>我的合同</div>
</template>
<script>
export default {
name: 'MineContract',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>我的项目</div>
</template>
<script>
export default {
name: 'MineProject',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
@@ -0,0 +1,13 @@
<template>
<div>分标委</div>
</template>
<script>
export default {
name: 'SubBidCommittee',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>工作组</div>
</template>
<script>
export default {
name: 'WorkTeam',
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less"></style>