From 1b84a05dd84e535284ac6e2d2b360d76a4b8e7ac Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期二, 17 十二月 2024 16:11:30 +0800
Subject: [PATCH] 查询模板&&功能权限模块添加按钮权限

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue |  240 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 134 insertions(+), 106 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
index 5a2a9f3..55a088a 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -4,15 +4,15 @@
       <basic-container>
         <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
           <div class="headerCon">
-            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
+            <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
             </el-button>
-            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
+            <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
             </el-button>
-            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
+            <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
             </el-button>
-            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+            <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
             </el-button>
-            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
+            <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
             </el-button>
           </div>
           <!-- 宸︿晶鏍� -->
@@ -61,10 +61,10 @@
               </el-tag>
             </template>
             <template slot="menuLeft" slot-scope="scope">
-              <el-button v-if="treeNodeRow.id !== 'root'" icon="el-icon-plus" plain size="small" type="primary"
+              <el-button v-if="treeNodeRow.id !== 'root' && permissionList.actionTopAddBtn" icon="el-icon-plus" plain size="small" type="primary"
                          @click="addClickHandler">澧炲姞
               </el-button>
-              <el-button icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">瀵煎嚭
+              <el-button v-if="permissionList.actionTopExportBtn" icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">瀵煎嚭
               </el-button>
             </template>
           </avue-crud>
@@ -82,7 +82,7 @@
             @row-del="BottomRowDelHandler"
           >
             <template slot="menuLeft" slot-scope="scope">
-              <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
+              <el-button v-if="permissionList.actionBottomAddBtn" icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
               </el-button>
             </template>
             <template slot="menuForm" slot-scope="scope">
@@ -133,6 +133,7 @@
 } from '@/api/UI/Action/api'
 import func from "@/util/func";
 import basicOption from "@/util/basic-option";
+import {mapGetters} from "vuex";
 
 export default {
   name: "index",
@@ -151,46 +152,98 @@
       bottomTableLoading: false,
       bottomForm:{},
       bottomData: [],
-      bottomOption: {
-        ...basicOption,
-        addBtn: false,
-        calcHeight: -30,
-        selection: false,
-        refreshBtn: false,
-        dialogWidth:'700',
-        saveBtn:false,
-        // height:'auto',
-        column: [
-          {
-            label: '鍙傛暟鍚嶇О',
-            prop: 'name',
-            rules: [
-              {
-                required: true,
-                message: '璇疯緭鍏ュ弬鏁板悕绉�',
-                trigger: 'blur'
-              }
-            ]
-          },
-          {
-            label: '榛樿鍊�',
-            prop: 'defaultValue',
-          },
-          {
-            label: '鎻愮ず淇℃伅',
-            prop: 'description',
-            span: 24,
-            type: 'textarea',
-            rows: 4
-          },
-        ],
-      },
       tableLoading: false,
       lastIndex: null,
       selectList: [],
       data: [],
-      option: {
+      treeNodeRow: {},
+      treeForm: {},
+      treeOption: {
+        addBtn: false,
+        defaultExpandedKeys: ['root'],
+        props: {
+          label: 'name',
+          value: 'id',
+          children: 'childs'
+        },
+        dialogWidth:'800',
+        dialogMenuPosition: 'right',
+        formOption: {
+          dialogMenuPosition: 'right',
+          column: [
+            {
+              label: '鍒嗙被鍚嶇О',
+              prop: 'name',
+              rules: [
+                {
+                  required: true,
+                  message: '璇疯緭鍏ュ垎绫诲悕绉�',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '鍒嗙被搴忓彿',
+              prop: 'serialno',
+              rules: [
+                {
+                  required: true,
+                  message: '璇疯緭鍏ュ垎绫诲簭鍙�',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: '鍒涘缓鑰�',
+              prop: 'creator',
+              disabled: true,
+            },
+            {
+              label: '鍒涘缓鏃堕棿',
+              prop: 'createTime',
+              disabled: true,
+            },
+            {
+              label: '鐖朵富绫�',
+              prop: 'pidName',
+              disabled: true,
+              span:24
+            },
+            {
+              label: '澶囨敞',
+              prop: 'description',
+              type:'textarea',
+              span:24
+            },
+          ],
+        }
+      },
+      treeData: [],
+    }
+  },
+  computed:{
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+        importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+        actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].actionTopAdd, false),
+        actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].actionTopDel, false),
+        actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].actionTopEdit, false),
+        actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].actionTopExport, false),
+        actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomAdd, false),
+        actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomDel, false),
+        actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomEdit, false),
+      };
+    },
+    option() {
+      return {
         ...basicOption,
+        editBtn:this.permissionList.actionTopEditBtn,
+        delBtn:this.permissionList.actionTopDelBtn,
         addBtn: false,
         height: 350,
         highlightCurrentRow: true,
@@ -287,70 +340,45 @@
             type: 'textarea'
           },
         ]
-      },
-      treeNodeRow: {},
-      treeForm: {},
-      treeOption: {
+      }
+    },
+    bottomOption(){
+      return {
+        ...basicOption,
         addBtn: false,
-        defaultExpandedKeys: ['root'],
-        props: {
-          label: 'name',
-          value: 'id',
-          children: 'childs'
-        },
-        dialogWidth:'800',
-        dialogMenuPosition: 'right',
-        formOption: {
-          dialogMenuPosition: 'right',
-          column: [
-            {
-              label: '鍒嗙被鍚嶇О',
-              prop: 'name',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲悕绉�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒嗙被搴忓彿',
-              prop: 'serialno',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲簭鍙�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒涘缓鑰�',
-              prop: 'creator',
-              disabled: true,
-            },
-            {
-              label: '鍒涘缓鏃堕棿',
-              prop: 'createTime',
-              disabled: true,
-            },
-            {
-              label: '鐖朵富绫�',
-              prop: 'pidName',
-              disabled: true,
-              span:24
-            },
-            {
-              label: '澶囨敞',
-              prop: 'description',
-              type:'textarea',
-              span:24
-            },
-          ],
-        }
-      },
-      treeData: [],
+        editBtn:this.permissionList.actionBottomEditBtn,
+        delBtn:this.permissionList.actionBottomDelBtn,
+        calcHeight: -30,
+        selection: false,
+        refreshBtn: false,
+        dialogWidth:'700',
+        saveBtn:false,
+        // height:'auto',
+        column: [
+          {
+            label: '鍙傛暟鍚嶇О',
+            prop: 'name',
+            rules: [
+              {
+                required: true,
+                message: '璇疯緭鍏ュ弬鏁板悕绉�',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '榛樿鍊�',
+            prop: 'defaultValue',
+          },
+          {
+            label: '鎻愮ず淇℃伅',
+            prop: 'description',
+            span: 24,
+            type: 'textarea',
+            rows: 4
+          },
+        ],
+      }
     }
   },
   created() {

--
Gitblit v1.9.3