From 363ee432fd559cbfc4006b3ea8aa951e2a27bda3 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Wed, 15 May 2024 11:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NavLeft.vue | 9 +++++---- src/main.js | 12 ++++++++++++ src/store/index.js | 4 ++++ src/utils/utils.js | 4 +++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/components/NavLeft.vue b/src/components/NavLeft.vue index c9930ed9..3e6c57c1 100644 --- a/src/components/NavLeft.vue +++ b/src/components/NavLeft.vue @@ -573,7 +573,7 @@ 员工学习数据 - + { + store.commit("SET_USER_ORGS", res.data); + }) } async function initDict(key) { const list = await getDictList(key); diff --git a/src/store/index.js b/src/store/index.js index 637acc6f..502b02cb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -17,6 +17,7 @@ export default createStore({ routerId: null, projectTemplateId: null, userInfo: {}, + userInfoOrgs: [], orgtreeList: [], faceclassPic: null, faceclassClass: [], @@ -62,6 +63,9 @@ export default createStore({ userInfo.avatar = userInfo.avatar?.includes(process.env.VUE_APP_AVATAR_PATH) ? userInfo.avatar : (process.env.VUE_APP_AVATAR_PATH + userInfo.avatar); state.userInfo = userInfo; }, + SET_USER_ORGS(state,orgs){ + state.userInfoOrgs = orgs; + }, SET_projectTemplateId(state, projectTemplateId) { state.projectTemplateId = projectTemplateId; }, diff --git a/src/utils/utils.js b/src/utils/utils.js index 9c673d54..92407261 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -57,7 +57,9 @@ export function checkOwner(per) { export function checkMenu(path = "") { return store?.state?.menus.some(t => path.split(",").some(s => "/" + s === t)); } - +export function checkOrgs(){ + return store?.state?.userInfoOrgs.length > 0 +} export function deepClone(obj) { let result = typeof obj.splice === "function" ? [] : {}; if (obj && typeof obj === "object") {