lyh
2025-04-22 2103a99b803a34c1284acb20917e86f1625b117e
增加列表按钮权限控制
已修改2个文件
28 ■■■■■ 文件已修改
src/mixins/JeecgListMixin.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/authFilter.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js
@@ -78,6 +78,9 @@
    }
  },
  methods:{
    isShowAuth(code){
      return buttonShowAuthFilter(code);
    },
    loadData(arg) {
      if(!this.url.list){
        this.$message.error("请设置url.list属性!")
src/utils/authFilter.js
@@ -274,4 +274,29 @@
function substrPre(str,pre) {
  return str.substr(pre.length);
}
/**
 * 显示权限
 * @param {*} code
 * @returns
 */
export function buttonShowAuthFilter(code) {
  if(code){
    if(nodeShowAuth(code)){
      return true;
    }else{
      return false;
    }
  }else{
    return false;
  }
}
function nodeShowAuth(code){
  let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
  for (let auth of authList) {
    if(auth.action == code) {
      return true;
    }
  }
  return false;
}