From 6ba67905ae3e502103a940f5f6f907e8f491ae62 Mon Sep 17 00:00:00 2001 From: 王旭 <1377869194@qq.com> Date: 星期四, 13 十月 2022 17:13:11 +0800 Subject: [PATCH] 用户角色授权页面接口对接 --- src/api/api.js | 20 ++++++++++ src/assets/lang/zh.js | 9 ++++ src/components/customElMenu.vue | 2 src/assets/lang/en.js | 9 ++++ src/components/navMenu.vue | 26 ++++++++++++- src/router/index.js | 18 +++++++++ 6 files changed, 81 insertions(+), 3 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 8506e53..c4d3fe8 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -230,3 +230,23 @@ pageSize ); } +//鏍规嵁瑙掕壊鏌ヨ鐢ㄦ埛 +export function roleUserselectByPageForRole(params) { + //璇锋眰鍦板潃 + return request.get('/roleUser/selectByPageAndCount', { params: params }); +} +//鐢ㄦ埛瑙掕壊鍒犻櫎 +export function roleUserdeletes(params) { + //璇锋眰鍦板潃 + return request.get('/roleUser/deletes', { params: params }); +} +//鏍规嵁瑙掕壊閮ㄩ棬鏌ヨ鐢ㄦ埛 +export function userselectByPageForRole(params) { + //璇锋眰鍦板潃 + return request.get('/user/selectByPageForRole', { params: params }); +} +// 鐢ㄦ埛瑙掕壊鏂板澶氶�� +export function roleUserinserts(params) { + //璇锋眰鍦板潃 + return request.post('/roleUser/inserts', params ); +} \ No newline at end of file diff --git a/src/assets/lang/en.js b/src/assets/lang/en.js index 44cbc70..bd2aef1 100644 --- a/src/assets/lang/en.js +++ b/src/assets/lang/en.js @@ -104,6 +104,15 @@ operatManage: { operatManage: 'Operat Manage', ResourceLog: 'Resource Log', + UserRoleAuthorization:"User Role Authorization", + UserRoleAuthorizationObj:{ + RoleTable: 'Role Table', + userTable: 'user Table', + Added: 'Added', + delete: 'delete', + serialNumber: 'serial Number', + name: 'name', + }, ELM: { username: 'username', ownedSystem: 'ownedSystem', diff --git a/src/assets/lang/zh.js b/src/assets/lang/zh.js index b3acd41..77e197e 100644 --- a/src/assets/lang/zh.js +++ b/src/assets/lang/zh.js @@ -106,6 +106,15 @@ operatManage: { operatManage: '杩愮淮绠$悊', ResourceLog: '璧勬簮鏃ュ織', + UserRoleAuthorization:"鐢ㄦ埛瑙掕壊鎺堟潈", + UserRoleAuthorizationObj:{ + RoleTable: '瑙掕壊琛�', + userTable: '鐢ㄦ埛琛�', + Added: '鏂板', + delete: '鍒犻櫎', + serialNumber: '缂栧彿', + name: '鍚嶇О', + }, ELM: { username: '鐢ㄦ埛鍚嶇О', ownedSystem: '鎵�灞炵郴缁�', diff --git a/src/components/customElMenu.vue b/src/components/customElMenu.vue index f6f38fb..0b78d2f 100644 --- a/src/components/customElMenu.vue +++ b/src/components/customElMenu.vue @@ -14,7 +14,7 @@ <el-menu-item v-else :key="item.id" - :index="item.url == null ? null : item.url + ''" + :index="item.url == null ? item.id.toString() : item.url + ''" > <span slot="title">{{ $store.state.lang == "zh" ? item.cnName : item.enName diff --git a/src/components/navMenu.vue b/src/components/navMenu.vue index 29a68b1..1bcffec 100644 --- a/src/components/navMenu.vue +++ b/src/components/navMenu.vue @@ -67,7 +67,20 @@ mounted() { this.getMenuTree(); }, - computed: {}, + computed: { + // 鎴戜滑浣跨敤璁$畻灞炴�ф潵鑾峰彇鍒板綋鍓嶇偣鍑荤殑鑿滃崟鐨勮矾鐢辫矾寰勶紝鐒跺悗璁剧疆default-active涓殑鍊� + // 浣垮緱鑿滃崟鍦ㄨ浇鍏ユ椂灏辫兘瀵瑰簲楂樹寒 + // activeIndex() { + // const route = this.$route; + // const { meta, path } = route; + // // if set path, the sidebar will highlight the path you set + // // 鍙互鍦ㄨ矾鐢遍厤缃枃浠朵腑璁剧疆鑷畾涔夌殑璺敱璺緞鍒癿eta.activeMenu灞炴�т腑锛屾潵鎺у埗鑿滃崟鑷畾涔夐珮浜樉绀� + // if (meta.activeMenu) { + // return meta.activeMenu; + // } + // return path; + // }, + }, methods: { getMenuTree() { //鑾峰彇鐩綍鏍戞渶澶D锛屾柊寤鸿妭鐐逛娇鐢� @@ -160,9 +173,18 @@ }, watch: { $route() { - this.activeIndex = this.$route.path; + let str = this.$route.path; + if (str[0] == "/") { + this.activeIndex = str.slice(1); + } }, }, + created() { + let str = this.$route.path; + if (str[0] == "/") { + this.activeIndex = str.slice(1); + } + }, }; </script> <style lang="less" scoped> diff --git a/src/router/index.js b/src/router/index.js index 8a06dac..8d351de 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -37,6 +37,15 @@ import groupManage from '../views/userManage/groupManage.vue'; // 鐢ㄦ埛绠$悊妯″潡 import authorityManage from '@/views/userManage/authorityManage.vue'; //鐢ㄦ埛绠$悊-鏉冮檺绠$悊 import resourceManage from '@/views/userManage/resourceManage.vue'; //鐢ㄦ埛绠$悊-璧勬簮绠$悊 +import userRoleAuthorization from '@/views/AuthorizationManagement/userRoleAuthorization.vue'; //绯荤粺绠$悊- +const originalPush = VueRouter.prototype.push + +VueRouter.prototype.push = function push(location) { + + return originalPush.call(this, location).catch(err => err) + +} + // 缇ょ粍绠$悊 Vue.use(VueRouter); @@ -337,6 +346,15 @@ requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� }, }, + { + path: '/userRoleAuthorization', + component: userRoleAuthorization, + name: 'userRoleAuthorization', + meta: { + title: '鐢ㄦ埛瑙掕壊鎺堟潈', + requireAuth: true, // 鏍囪瘑璇ヨ矾鐢辨槸鍚﹂渶瑕佺櫥褰� + }, + }, ], }, -- Gitblit v1.9.3