From 9e22890d57562cae603f56441ea14dc7d093054b Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Tue, 30 Jul 2024 10:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E4=BB=98=E6=AC=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=AE=A1=E6=A0=B8=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 10 ++++-- src/views/budget/component/payPlan.vue | 44 ++++++++++++++++++++------ 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 3a8f4c6..4ced732 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -19,7 +19,8 @@ const getDefaultState = () => { name: '', info: {}, avatar: '', - roles: [] + roles: [], + myRole: [], } } @@ -43,6 +44,9 @@ const mutations = { }, SET_ROLES: (state, roles) => { state.roles = roles + }, + SET_MYROLE: (state, roles) => { + state.myRole = roles } } @@ -117,13 +121,13 @@ const actions = { } response["roles"] = ["admin"]; const { + role, roles, name, avatar } = response - - + commit('SET_MYROLE', role) commit('SET_ROLES', roles) commit('SET_NAME', name) commit('SET_AVATAR', avatar) diff --git a/src/views/budget/component/payPlan.vue b/src/views/budget/component/payPlan.vue index d298b69..eee78df 100644 --- a/src/views/budget/component/payPlan.vue +++ b/src/views/budget/component/payPlan.vue @@ -127,6 +127,7 @@ export default { { - /* - - */ + (this.$store.state.user.myRole.find(i => /领导|系统管理员/g.test(i.name)) && row.id && (row.status === 0 || row.status === undefined || row.status === null)) ? + () : "" + } + { + (this.$store.state.user.myRole.find(i => /领导|系统管理员/g.test(i.name)) && row.id && (row.status === 1)) ? + () : "" } );