fix: BUG修改

This commit is contained in:
kun 2024-04-30 14:47:40 +08:00
parent e041ea2646
commit b202c4dc1c
2 changed files with 29 additions and 1 deletions

View File

@ -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

View File

@ -66,7 +66,7 @@
plain
>{{ $t("message.laborMange.refresh") }}</el-button
>
<el-button
<!-- <el-button
v-if="
menuList.actionList.findIndex(
(x) => x.actionCode == 'qrcodeAg'
@ -76,6 +76,13 @@
@click="openCode"
plain
>人员录入二维码</el-button
> -->
<el-button
v-permission="{key: 'qrcodeAg', moduleName: '人员登记培训'}"
type="primary"
@click="openCode"
plain
>人员录入二维码</el-button
>
<!-- <el-button type="primary" @click="editProjectSettingDialog = true"
>{{ $t("message.laborMange.mobilePersonnelEntryOptions") }}</el-button