From a7021b7620d04b04ffcd084ea07704b37b15be0a Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期一, 13 一月 2025 09:54:32 +0800
Subject: [PATCH] 按钮图标仅验证是图标类型显示方式

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue |  112 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 58 insertions(+), 54 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
index ad32bea..7e4965a 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -13,20 +13,30 @@
       @selection-change="selectChangeHandler"
       @row-click="rowClickHandler">
       <template slot="menuLeft" slot-scope="scope">
-        <el-button v-if="permissionChildrenList.UiPageLayoutAddBtn" icon="el-icon-plus" plain size="small" type="primary"
-                   @click="addClickHandler">澧炲姞
-        </el-button>
-        <el-button v-if="permissionChildrenList.UiPageLayoutDesignBtn" icon="el-icon-edit-outline" plain size="small" type="primary"
-                   @click="btnDesignClickHandler">鎸夐挳璁捐
+        <el-button v-if="permissionChildrenList.UiPageLayoutAddBtn" class="button-custom-icon" plain size="small" type="primary"
+                   @click="addClickHandler">
+          <icon-show :name="permissionChildrenList.UiPageLayoutAddBtn.source"></icon-show>
+          澧炲姞
         </el-button>
       </template>
 
       <template slot="menu" slot-scope="scope">
-        <el-button v-if="permissionChildrenList.UiPageLayoutEditBtn" icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">缂栬緫
+        <el-button v-if="permissionChildrenList.UiPageLayoutDesignBtn" size="small" type="text"
+                   @click="btnDesignClickHandler(scope.row)">
+          <icon-show :name="permissionChildrenList.UiPageLayoutDesignBtn.source"></icon-show>
+          鎸夐挳璁捐
         </el-button>
-        <el-button v-if="permissionChildrenList.UiPageLayoutDelBtn" icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
+        <el-button v-if="permissionChildrenList.UiPageLayoutEditBtn" size="small" type="text" @click="editBtnClick(scope.row)">
+          <icon-show :name="permissionChildrenList.UiPageLayoutEditBtn.source"></icon-show>
+          缂栬緫
         </el-button>
-        <el-button v-if="permissionChildrenList.UiPageLayoutCloneBtn" icon="el-icon-document-copy" size="small" type="text" @click="rowCloneHandler(scope.row)">鍏嬮殕
+        <el-button v-if="permissionChildrenList.UiPageLayoutDelBtn" size="small" type="text" @click="rowDeleteHandler(scope.row)">
+          <icon-show :name="permissionChildrenList.UiPageLayoutDelBtn.source"></icon-show>
+          鍒犻櫎
+        </el-button>
+        <el-button v-if="permissionChildrenList.UiPageLayoutCloneBtn" size="small" type="text" @click="rowCloneHandler(scope.row)">
+          <icon-show :name="permissionChildrenList.UiPageLayoutCloneBtn.source"></icon-show>
+          鍏嬮殕
         </el-button>
       </template>
 
@@ -166,7 +176,7 @@
                   </el-col>
 
                   <el-col :span="12">
-                    <el-form-item :inline-message='true' label="鍚嶇О锛�" prop="label">
+                    <el-form-item  label="鍚嶇О锛�" prop="label">
                       <el-input v-model="basicForm.label" :disabled="disabledBtn"></el-input>
                     </el-form-item>
                   </el-col>
@@ -202,7 +212,7 @@
                     </el-form-item>
                   </el-col>
                   <el-col :span="24" v-show="basicForm.show=='0' && (basicForm.displayMode=='image'||basicForm.displayMode=='textandimage')">
-                    <el-form-item label="鍥炬爣锛�" prop="iconPath">
+                    <el-form-item :class="basicForm.displayMode==='image'?'is-required':''" label="鍥炬爣锛�" prop="iconPath">
                       <input-icon v-model="basicForm.iconPath" :disabled="disabledBtn"></input-icon>
                     </el-form-item>
                   </el-col>
@@ -364,13 +374,14 @@
         delBtn: false,
         refreshBtn: false,
         dialogWidth:'600',
-        menuWidth:'150',
+        menuWidth:'140',
         column: [
           {
             label: '鍚嶇О',
             prop: 'name',
             width:180,
             span: 24,
+            overHidden:true,
             rules: [
               {
                 required: true,
@@ -384,6 +395,7 @@
             prop: 'value',
             type:'textarea',
             span: 24,
+            overHidden:true,
             rules: [
               {
                 required: true,
@@ -402,13 +414,11 @@
           {required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur'},
         ],
         actionName: [
-          {required: true, message: '璇烽�夋嫨Action', trigger: 'blur'},
+          {required: true, message: '璇烽�夋嫨Action', trigger: 'change'},
         ],
       },
       // 鎸夐挳璁捐 鍩虹淇℃伅
-      basicForm: {
-        seq: 1
-      },
+      basicForm: {},
       treeData: [],
       treeOption: {
         menu: false,
@@ -434,10 +444,12 @@
         calcHeight: -30,
         editBtn: false,
         delBtn: false,
+        menuWidth:300,
         column: [
           {
             label: '鍚嶇О',
             prop: 'name',
+            width: 220,
             labelWidth: 110,
             rules: [
               {
@@ -450,6 +462,7 @@
           {
             label: '缂栧彿',
             prop: 'seq',
+            width:100,
             labelWidth: 110,
             hide: false,
             rules: [
@@ -461,13 +474,13 @@
             ],
           },
           {
-            label: '',
+            label: 'UI瑙f瀽绫诲瀷',
             prop: 'uiParser',
             hide: true,
             labelWidth: 110,
           },
           {
-            label: '',
+            label: '鎵╁睍灞炴��',
             prop: 'extAttr',
             hide: true,
             labelWidth: 110,
@@ -853,17 +866,18 @@
       lastIndex: null,
       selectList: [],
       formDataRow: {},
+      defaultForm:{},
     }
   },
   computed:{
     ...mapGetters(["permission"]),
     permissionChildrenList() {
       return {
-        UiPageLayoutAddBtn: this.vaildData(this.permission[this.$route.query.id].UiPageLayoutAdd, false),
-        UiPageLayoutEditBtn: this.vaildData(this.permission[this.$route.query.id].UiPageLayoutEdit, false),
-        UiPageLayoutDelBtn: this.vaildData(this.permission[this.$route.query.id].UiPageLayoutDel, false),
-        UiPageLayoutCloneBtn: this.vaildData(this.permission[this.$route.query.id].UiPageLayoutClone, false),
-        UiPageLayoutDesignBtn: this.vaildData(this.permission[this.$route.query.id].UiPageLayoutDesign, false),
+        UiPageLayoutAddBtn: this.vaildData(this.permission[this.$route.query.id].CLSRIGHT, false),
+        UiPageLayoutEditBtn: this.vaildData(this.permission[this.$route.query.id].DATARIGHT, false),
+        UiPageLayoutDelBtn: this.vaildData(this.permission[this.$route.query.id].ATTRRIGHT, false),
+        UiPageLayoutCloneBtn: this.vaildData(this.permission[this.$route.query.id].CLONE, false),
+        UiPageLayoutDesignBtn: this.vaildData(this.permission[this.$route.query.id].UPLOAD, false),
       }
     }
   },
@@ -923,7 +937,7 @@
           this.lastIndex = newIndex;
         },
         () => {
-          this.selectList = [];
+          this.selectList = [row];
         }
       );
     },
@@ -961,7 +975,6 @@
           };
         });
       }
-      console.log('row',row);
       this.searchTargerChangeFlag = false;
       this.$refs.crud.rowEdit(row);
     },
@@ -995,6 +1008,10 @@
       if (row.templateType === '6') {
         row.SubUIObjType = row.showType;
         row.showType = "";
+      }
+      if (row.templateType === '5' && this.form.linkType && !this.form.showLinkAbs) {
+        this.$message.error('璇烽�夋嫨鍙傜収鏍戣缃�');
+        return loading();
       }
       const params = {
         ...row,
@@ -1038,24 +1055,6 @@
 
     // 瀵硅瘽妗嗚〃鏍兼坊鍔�
     formDataAddClickHandler() {
-      // if (!this.form.eventKey) {
-      //   this.$message.error('璇烽�夋嫨EventKey');
-      //   return;
-      // }
-      //
-      // if (!this.form.eventValue) {
-      //   this.$message.error('璇疯緭鍏ventValue');
-      //   return;
-      // }
-      //
-      // if (this.eventData.length >= 1) {
-      //   const eventValueStatus = this.eventData.some(item => item.eventValue === this.form.eventValue);
-      //
-      //   if (eventValueStatus) {
-      //     this.$message.error('宸插瓨鍦ㄧ浉鍚岀殑 EventValue锛屼笉鑳介噸澶嶆坊鍔�');
-      //     return;
-      //   }
-      // }
       const obj = {
         index: this.eventData.length,
         eventKey: this.form.eventKey || 'SelectionEvent',
@@ -1147,34 +1146,34 @@
     },
 
     // 鎸夐挳璁捐
-    btnDesignClickHandler() {
-      if (this.selectList.length != 1) {
+    btnDesignClickHandler(row) {
+      /*if (this.selectList.length != 1) {
         this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�');
         return;
-      }
+      }*/
       this.btnDesignVisible = true;
-      this.formBtnOid = this.selectList[0].id;
-      this.getTabBtnTree();
+      this.formBtnOid = row.id;
+      this.getTabBtnTree(row);
     },
 
     // 宸︿晶鏍戣姹�
-    getTabBtnTree() {
+    getTabBtnTree(row) {
       const params = {
-        pageDefinationOid: this.selectList[0].id
+        pageDefinationOid: row && row.id ? row.id : this.selectList[0].id
       }
       this.treeLoading = true;
       getTabButtons(params).then(res => {
         if (res.data.code === 200) {
           const data = res.data.data;
           this.treeData = [{
-            label: this.selectList[0].name,
+            label: row && row.id ? row.name : this.selectList[0].name,
             oId: 'parentNode',
             disabled: true,
             children: data
           }];
           this.treeLoading = false;
         } else {
-          this.$message.error('璇锋鏌ユ帶鍒跺彴閿欒');
+          this.$message.error(res.data.msg);
         }
       })
     },
@@ -1182,13 +1181,14 @@
     // 鎸夐挳璁捐琛岀偣鍑�
     nodeTreeClick(row) {
       this.nodeTreeRow = row;
+      this.defaultForm = {...row};
       this.basicForm = {...row};
       this.paramsData = row.buttonParams ? Object.entries(row.buttonParams).map(([key, value]) => ({
         name: key,
         value: value
       })) : [];
       this.disabledBtn = true;
-      this.$refs.form.clearValidate()
+      this.$refs.form.clearValidate();
     },
 
     // 鎸夐挳璁捐鍙傛暟淇℃伅鍒犻櫎
@@ -1261,12 +1261,15 @@
       this.disabledBtn = true;
       if (this.saveType === 'add') {
         this.$refs.Tree.setCurrentKey(null);
+        this.$refs.form.resetFields();
+      }else {
+        this.basicForm = {...this.defaultForm};
       }
     },
 
     // 鎸夐挳璁捐淇濆瓨
     saveClickBtnHandler() {
-      if (this.basicForm.show == '0' && (this.basicForm.displayMode == 'image' || this.basicForm.displayMode == 'textandimage') && this.basicForm.iconPath == '') {
+      if (this.basicForm.show == '0' && this.basicForm.displayMode == 'image' && this.basicForm.iconPath == '') {
         this.$message.error('璇烽�夋嫨鍥炬爣');
         return;
       }
@@ -1295,9 +1298,9 @@
               this.$message.success(res.data.obj);
               this.disabledBtn = true;
               this.getTabBtnTree();
-              this.basicForm = {};
               this.paramsData = [];
               this.dialogLoading = false;
+              this.$refs.form.resetFields();
             }
           }).catch(err => {
             this.dialogLoading = false;
@@ -1365,6 +1368,7 @@
     actionSaveHandler(val) {
       this.$set(this.basicForm, 'actionName', val.plName);
       this.$set(this.basicForm, 'actionOId', val.plOId);
+      this.$set(this.basicForm, 'iconPath', val.plImage);//鍥炬爣
       this.$refs.form.clearValidate('Action')
     },
     // action閫夋嫨寮圭獥鐩存帴鍏抽棴

--
Gitblit v1.9.3