From 8a166a60cfd1a2e593ffa103d10c0dc224fc8628 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 09 一月 2025 11:14:50 +0800
Subject: [PATCH] 表格定义显示字段设置拖拽排序

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue |   79 ++++++++++++++++++++++++++++-----------
 1 files changed, 57 insertions(+), 22 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
index 83f30a9..fa92e85 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -11,12 +11,12 @@
               <el-radio v-model="treeRadio" label="1" @input="TreeRadioChange">閾炬帴绫诲瀷鏍�</el-radio>
             </div>
             <avue-tree v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
-          <span slot-scope="{ node, data }" class="el-tree-node__label">
-           <span style="font-size: 15px">
-              <i class="el-icon-s-promotion"></i>
-                {{ (node || {}).label }}
-            </span>
-          </span>
+              <span slot-scope="{ node, data }" class="el-tree-node__label">
+               <span>
+                  <icon-show :name="data.icon"></icon-show>
+                    {{ (node || {}).label }}
+                </span>
+              </span>
             </avue-tree>
           </div>
         </div>
@@ -26,12 +26,30 @@
     <el-main>
       <basic-container>
         <div v-if="!tableStatus" style="display: flex;justify-content: left;margin-top: 15px">
-          <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">澧炲姞</el-button>
-          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎</el-button>
-          <el-button icon="el-icon-document-add" plain size="small" type="primary" @click="copyClickHandler">鍏嬮殕
+          <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary"
+                     @click="addClickHandler">
+            <icon-show :name="permissionList.addBtn.source"></icon-show>
+            澧炲姞
           </el-button>
-          <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button>
-          <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+          <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger"
+                     @click="deleteClickHandler">
+            <icon-show :name="permissionList.delBtn.source"></icon-show>
+            鍒犻櫎
+          </el-button>
+          <el-button v-if="permissionList.cloneBtn" class="button-custom-icon" plain size="small" type="primary"
+                     @click="copyClickHandler">
+            <icon-show :name="permissionList.cloneBtn.source"></icon-show>
+            鍏嬮殕
+          </el-button>
+          <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary"
+                     @click="upLoadClickHandler">
+            <icon-show :name="permissionList.importBtn.source"></icon-show>
+            瀵煎叆
+          </el-button>
+          <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary"
+                     @click="exportClickHandler">
+            <icon-show :name="permissionList.exportBtn.source"></icon-show>
+            瀵煎嚭
           </el-button>
         </div>
         <avue-crud
@@ -58,9 +76,13 @@
             </div>
           </template>
           <template slot="menu" slot-scope="scope">
-            <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫
+            <el-button v-if="permissionList.editBtn" size="small" type="text" @click="editBtnClick(scope.row)">
+              <icon-show :name="permissionList.editBtn.source"></icon-show>
+              缂栬緫
             </el-button>
-            <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
+            <el-button v-if="permissionList.delBtn" size="small" type="text" @click="rowDeleteHandler(scope.row)">
+              <icon-show :name="permissionList.delBtn.source"></icon-show>
+              鍒犻櫎
             </el-button>
           </template>
         </avue-crud>
@@ -90,12 +112,12 @@
             </div>
             <avue-tree ref="cloneTree" v-loading="cloneTreeLoading" :data="cloneTreeData" :option="treeOption"
                        @node-click="cloneTreeNodeClick">
-          <span slot-scope="{ node, data }" class="el-tree-node__label">
-           <span style="font-size: 15px">
-              <i class="el-icon-s-promotion"></i>
-                {{ (node || {}).label }}
-            </span>
-          </span>
+              <span slot-scope="{ node, data }" class="el-tree-node__label">
+               <span>
+                 <icon-show :name="data.icon"></icon-show>
+                    {{ (node || {}).label }}
+                </span>
+              </span>
             </avue-tree>
           </div>
         </div>
@@ -116,6 +138,7 @@
 import {getBizTypes} from "@/api/modeling/businessType/api";
 import {gridLink} from "@/api/modeling/linkType/api";
 import func from "@/util/func";
+import {mapGetters} from "vuex";
 
 export default {
   name: "index",
@@ -188,6 +211,17 @@
     this.getTreeList();
   },
   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),
+        cloneBtn: this.vaildData(this.permission[this.$route.query.id].CLONE, false),
+      };
+    },
     tableStatus() {
       return func.isEmptyObject(this.nodeRow);
     }
@@ -218,6 +252,7 @@
         const data = res.data.data.map(item => {
           this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
           item.attributes.id = item.attributes.id;
+          item.attributes.icon = item.attributes.imageName;
           return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes
         });
         this.treeData = data;
@@ -236,6 +271,7 @@
           const data = res.data.data.map(item => {
             this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
             item.attributes.id = item.attributes.id;
+            item.attributes.icon = item.attributes.imageName;
             return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes
           });
           this.treeData = data;
@@ -258,6 +294,7 @@
       if (item.children && item.children.length > 0) {
         item.attributes.children = item.children.map(child => {
           child.attributes.id = child.attributes.id;
+          child.attributes.icon = child.attributes.imageName;
           this.processChildren(child); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
           return child.attributes; // 鍙繑鍥炲瓙鑺傜偣鐨� attributes
         });
@@ -463,7 +500,7 @@
           this.lastIndex = newIndex;
         },
         () => {
-          this.selectList = [];
+          this.selectList = [row];
         }
       );
     },
@@ -481,8 +518,6 @@
       exportExcel(params).then(res => {
         func.downloadFileByBlobHandler(res);
         this.$message.success('瀵煎嚭鎴愬姛');
-      }).catch(err => {
-        this.$message.error(err);
       });
     },
 

--
Gitblit v1.9.3