From b202c4dc1c3b7b1c5353e818d6b74858e2b5df79 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Tue, 30 Apr 2024 14:47:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.js | 21 +++++++++++++++++++ .../laborManage/personAuditAg.vue | 9 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/pages/index/index.js b/src/pages/index/index.js index 4beaad1c..f489dd26 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -277,6 +277,27 @@ Vue.use(vuescroll, { }, }) +// 按钮权限控制指令 +Vue.directive('permission', { + inserted: (el, binding)=>{ + const { value } = binding; + // 判断当前用户是否拥有该按钮权限 + if (!checkPermission(value)) { + el.parentNode.removeChild(el); + } + } +}); +// 判断权限的函数 +function checkPermission(permission) { + var permissions = store.state.userInfo.menuAuthority.menuList; + permissions = permissions.filter( + (x) => x.menuName == permission.moduleName + )[0]; + let index = permissions.actionList.findIndex( + (x) => x.actionCode == permission.key + ) + return index != -1?true:false; +} // 加载缩略图 Vue.prototype.downloadImgMin = function(row) { let fileUrl = store.state.FILEURL + row.fileUrl diff --git a/src/views/projectFront/laborManage/personAuditAg.vue b/src/views/projectFront/laborManage/personAuditAg.vue index 85b30592..b3470e80 100644 --- a/src/views/projectFront/laborManage/personAuditAg.vue +++ b/src/views/projectFront/laborManage/personAuditAg.vue @@ -66,7 +66,7 @@ plain >{{ $t("message.laborMange.refresh") }} - 人员录入二维码 --> + 人员录入二维码