From c16329ea5a48ad2d6f84005817595b4e160169f2 Mon Sep 17 00:00:00 2001 From: zhangdi <15053473693@163.com> Date: Thu, 22 Jan 2026 10:59:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/index/index.vue | 3 +- src/page/login/authorization.vue | 235 +++++++++- src/views/system/menu.vue | 753 ++++++++++++++++--------------- 3 files changed, 611 insertions(+), 380 deletions(-) diff --git a/src/page/index/index.vue b/src/page/index/index.vue index 2a79a49..6a5abd1 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -89,8 +89,9 @@ //打开菜单 openMenu(item = {}) { console.log("itemitemitemopenMenu", this.userInfo) + let roleIds = this.userInfo.roleList.map(item => item.id); - this.$store.dispatch("GetMenu", item.id).then(data => { + this.$store.dispatch("GetMenu", {roleId:roleIds.join(',')}).then(data => { console.log("每次刷新调用", data); if (data.length !== 0) { this.$router.$avueRouter.formatRoutes(data, true); diff --git a/src/page/login/authorization.vue b/src/page/login/authorization.vue index b31e208..fa4dd6e 100644 --- a/src/page/login/authorization.vue +++ b/src/page/login/authorization.vue @@ -8,9 +8,9 @@ import { mapGetters } from "vuex"; export default { name: "authorization", -computed: { - ...mapGetters(["tagWel", "userInfo"]) - }, + computed: { + ...mapGetters(["tagWel", "userInfo"]), + }, data() { return {}; }, @@ -20,10 +20,231 @@ computed: { methods: { getUserinfo() { let data = this.$route.query.data; - + // let data1 = { + // success: true, + // message: "操作成功!", + // code: 200, + // result: { + // userId: "LiuXu", + // name: "刘旭", + // department: "青岛空管站/实业公司/IT事业部/产品研发室", + // mainDepartment: "82", + // mainErDepartment: "20", + // leaderInDept: ",", + // gender: "女", + // phone: "17853572157", + // mail: null, + // roleList: [ + // { + // id: 1, + // code: "admin", + // name: "超级管理员", + // }, + // { + // id: 11, + // code: "trainAdmin", + // name: "出行应用管理员", + // }, + // { + // id: 19, + // code: "dispatcherAdmin", + // name: "调度员", + // }, + // { + // id: 41, + // code: "sidelineDriver", + // name: "兼职驾驶员", + // }, + // { + // id: 62, + // code: "dutyAdmin", + // name: "运行总值班", + // }, + // { + // id: 119, + // code: "carDispatcherAdmin", + // name: "车辆调度管理员", + // }, + // { + // id: 180, + // code: "birthdayAdmin", + // name: "生日免单管理员", + // }, + // { + // id: 215, + // code: "TeaAdmin", + // name: "生日下午茶管理员", + // }, + // { + // id: 217, + // code: "AddressAdmin", + // name: "通讯录管理员", + // }, + // { + // id: 220, + // code: "comprehensiveAdmin", + // name: "综合管理管理员", + // }, + // { + // id: 223, + // code: "deptStockAdmin", + // name: "部门库存管理员", + // }, + // ], + // roleNames: + // "超级管理员,出行应用管理员,调度员,兼职驾驶员,运行总值班,车辆调度管理员,生日免单管理员,生日下午茶管理员,通讯录管理员,综合管理管理员,部门库存管理员", + // checked: false, + // manageNum: "1", + // deptId: null, + // deptList: [ + // { + // id: "12", + // name: "站值班", + // parentid: "1", + // order: 2147484447, + // oaId: 1000242, + // userList: null, + // children: [], + // }, + // { + // id: "18", + // name: "办公室", + // parentid: "1", + // order: 2147484322, + // oaId: 1000243, + // userList: null, + // children: [], + // }, + // { + // id: "17", + // name: "党委办公室", + // parentid: "1", + // order: 2147484197, + // oaId: 1000244, + // userList: null, + // children: [], + // }, + // { + // id: "22", + // name: "综合业务部", + // parentid: "1", + // order: 2147484134, + // oaId: 1000246, + // userList: null, + // children: [], + // }, + // { + // id: "23", + // name: "安全管理部", + // parentid: "1", + // order: 2147484103, + // oaId: 1000247, + // userList: null, + // children: [], + // }, + // { + // id: "21", + // name: "财务部", + // parentid: "1", + // order: 2147484087, + // oaId: 1000245, + // userList: null, + // children: [], + // }, + // { + // id: "15", + // name: "人力资源部", + // parentid: "1", + // order: 2147484072, + // oaId: 1000400, + // userList: null, + // children: [], + // }, + // { + // id: "19", + // name: "计划基建部", + // parentid: "1", + // order: 2147484009, + // oaId: 1000404, + // userList: null, + // children: [], + // }, + // { + // id: "14", + // name: "管制运行部", + // parentid: "1", + // order: 2147483947, + // oaId: 1000301, + // userList: null, + // children: [], + // }, + // { + // id: "2", + // name: "技术保障部", + // parentid: "1", + // order: 2147483884, + // oaId: 1000334, + // userList: null, + // children: [], + // }, + // { + // id: "16", + // name: "气象台", + // parentid: "1", + // order: 2147483822, + // oaId: 1000362, + // userList: null, + // children: [], + // }, + // { + // id: "24", + // name: "后勤服务中心", + // parentid: "1", + // order: 2147483697, + // oaId: 1000409, + // userList: null, + // children: [], + // }, + // { + // id: "20", + // name: "实业公司", + // parentid: "1", + // order: 2147483634, + // oaId: 1000564, + // userList: null, + // children: [], + // }, + // { + // id: "10", + // name: "建设指挥部", + // parentid: "1", + // order: 2147483572, + // oaId: 1000891, + // userList: null, + // children: [], + // }, + // { + // id: "60", + // name: "其他(待设置部门)", + // parentid: "1", + // order: 99996000, + // oaId: null, + // userList: null, + // children: [], + // }, + // ], + // postName: "二级正", + // virPostName: "二级正", + // apprStatus: null, + // isCanAbnormal: true, + // userSort: 1000, + // isDel: false, + // mainErDepartmentName: "实业公司", + // }, + // timestamp: 1768984070128, + // }; getUserinfo(this.$route.query.data).then((res) => { this.$store.dispatch("user/setUserInfo", res); - // console.log("获取用户信息", res.data.result); const loading = this.$loading({ lock: true, text: "登录中,请稍后。。。", @@ -32,9 +253,9 @@ computed: { this.$store .dispatch("AuthLoginByUsername", res.data.result) .then(() => { - console.log("登录成功", res.data.result); + console.log("登录成功", res.data.result); console.log("获取用户信息", this.tagWel.value); - // this.$router.push({path: this.tagWel.value}); + this.$router.push({path: this.tagWel.value}); loading.close(); }) .catch(() => { diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index 4873825..7518bfe 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -1,31 +1,35 @@