wangting
2025-01-08 354cad3d3ab22ba147169beb6a0f6f51b9bab3a8
Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue
@@ -7,7 +7,7 @@
          <div style="height:  calc(100vh - 195px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span style="font-size: 15px">
               <span>
                  <i class="el-icon-user-solid"></i>
                    {{ (node || {}).label }}
                </span>
@@ -22,15 +22,20 @@
      <basic-container v-loading="treeLoading">
        <h3 style="margin: 0 0 10px 0">功能权限配置</h3>
        <div>
          <el-button icon="el-icon-place" plain size="small" type="primary" @click="saveHandler">授权</el-button>
          <el-button icon="el-icon-close" plain size="small" style="margin-right: 40px;" type="primary"
                     @click="clearValue">重置
          <el-button v-if="permissionList.rightBtn" class="button-custom-icon" plain size="small" type="primary" @click="saveHandler">
            <icon-show :name="permissionList.rightBtn.source"></icon-show>
            授权
          </el-button>
          <el-button v-if="permissionList.resetBtn" class="button-custom-icon" plain size="small" style="margin-right: 40px;" type="primary"
                     @click="clearValue">
            <icon-show :name="permissionList.resetBtn.source"></icon-show>
            重置
          </el-button>
        </div>
        <div style="height:  calc(100vh - 232px);margin-top: 10px;">
          <avue-tree ref="uiTree" :data="uiTreeData" :node-key="id" :option="uiTreeOption">
            <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span style="font-size: 15px">
               <span>
                  <i :class="data.icon"></i>
                    {{ (node || {}).label }}
                </span>
@@ -46,6 +51,7 @@
<script>
import {gridRoles} from "@/api/system/role/api";
import {getSysModelAuthTreeMenuByPID, getSysModelAuth, saveRoleRight} from "@/api/authority/functionView/api"
import {mapGetters} from "vuex";
export default {
  name: "index",
@@ -83,6 +89,15 @@
      contextData: []
    }
  },
  computed:{
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        rightBtn: this.vaildData(this.permission[this.$route.query.id].RIGHT, false),
        resetBtn: this.vaildData(this.permission[this.$route.query.id].RESET, false),
      };
    },
  },
  created() {
    this.getTreeList();
    this.getUITree();