lyh
2025-04-22 4442d11ce67ae83fedac69c177b7f49c0a7e3d94
增加按钮控制
已修改2个文件
30 ■■■■■ 文件已修改
src/mixins/JeecgListMixin.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/authFilter.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js
@@ -8,6 +8,7 @@
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import store from '@/store'
import { buttonShowAuthFilter } from '@/utils/authFilter'
export const JeecgListMixin = {
  data(){
@@ -78,6 +79,9 @@
    }
  },
  methods:{
    isShowAuth(code){
      return buttonShowAuthFilter(code);
    },
    loadData(arg) {
      if(!this.url.list){
        this.$message.error("请设置url.list属性!")
src/utils/authFilter.js
@@ -238,6 +238,32 @@
}
/**
 * 显示权限
 * @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;
}
/**
 * 额外增加方法【用于行编辑组件】