From bf8ac795a96457586b2b7346cdfc3a52994cac4d Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 07 十一月 2024 18:20:22 +0800
Subject: [PATCH] 调整Action管理

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue |  120 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 86 insertions(+), 34 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 6b235af..efaba17 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
@@ -46,8 +46,8 @@
             v-model="form"
             :data="data"
             :option="option"
-            :page.sync="page"
             :table-loading="tableLoading"
+            :before-open="beforeOpen"
             @row-del="rowDelHandler"
             @row-save="rowSaveHandler"
             @row-update="rowUpdateHandler"
@@ -74,6 +74,7 @@
         <div style="margin-top: 10px">
           <avue-crud
             ref="BottomCrud"
+            v-model="bottomForm"
             :data="bottomData"
             :option="bottomOption"
             :table-loading="bottomTableLoading"
@@ -85,7 +86,13 @@
               <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
               </el-button>
             </template>
-
+            <template slot="menuForm" slot-scope="scope">
+              <el-button type="primary"
+                         size="small"
+                         icon="el-icon-check"
+                         v-if="scope.type === 'add'"
+                         @click="handleSaveNext()">淇濆瓨鍚庣户缁坊鍔�</el-button>
+            </template>
           </avue-crud>
         </div>
       </basic-container>
@@ -138,6 +145,7 @@
       rightRoleData: [],
       form: {},
       bottomTableLoading: false,
+      bottomForm:{},
       bottomData: [],
       bottomOption: {
         ...basicOption,
@@ -145,6 +153,7 @@
         calcHeight: -30,
         selection: false,
         refreshBtn: false,
+        dialogWidth:'700',
         // height:'auto',
         column: [
           {
@@ -181,6 +190,9 @@
         height: 350,
         highlightCurrentRow: true,
         menuWidth:160,
+        span:24,
+        labelWidth:100,
+        dialogWidth:'700',
         column: [
           {
             label: '缂栧彿',
@@ -209,13 +221,6 @@
             ]
           },
           {
-            label: 'C/S绫昏矾寰�',
-            prop: 'plCSClass',
-            search: true,
-            searchLabelWidth:120,
-            overHidden: true,
-          },
-          {
             label: '鍒嗙被',
             prop: 'plActionCls',
             type: 'tree',
@@ -235,6 +240,13 @@
             dicData: []
           },
           {
+            label: 'C/S绫昏矾寰�',
+            prop: 'plCSClass',
+            search: true,
+            searchLabelWidth:120,
+            overHidden: true,
+          },
+          {
             label: 'B/S閾炬帴鍦板潃',
             prop: 'plBSUrl',
             search: true,
@@ -245,7 +257,7 @@
             label: '绫诲瀷',
             prop: 'plTypeType',
             search: true,
-            type: 'select',
+            type: 'radio',
             width:100,
             dicData: [{
               label: '涓氬姟绫诲瀷',
@@ -267,6 +279,7 @@
             prop: 'plDesc',
             search: true,
             overHidden: true,
+            type: 'textarea'
           },
         ]
       },
@@ -280,7 +293,10 @@
           value: 'id',
           children: 'childs'
         },
+        dialogWidth:'800',
+        dialogMenuPosition: 'right',
         formOption: {
+          dialogMenuPosition: 'right',
           column: [
             {
               label: '鍒嗙被鍚嶇О',
@@ -307,21 +323,24 @@
             {
               label: '鍒涘缓鑰�',
               prop: 'creator',
-              readonly: true,
+              disabled: true,
             },
             {
               label: '鍒涘缓鏃堕棿',
               prop: 'createTime',
-              readonly: true,
+              disabled: true,
             },
             {
               label: '鐖朵富绫�',
               prop: 'pidName',
-              readonly: true,
+              disabled: true,
+              span:24
             },
             {
               label: '澶囨敞',
-              prop: 'description'
+              prop: 'description',
+              type:'textarea',
+              span:24
             },
           ],
         }
@@ -429,6 +448,16 @@
       this.getRightTableList(this.treeNodeRow);
     },
 
+    beforeOpen(done, type, loading) {
+      if ([ 'edit'].includes(type)) {
+        // 缂栬緫閫昏緫
+        this.option.column[32].disabled = false;
+      } else {
+        // 鏂板閫昏緫
+        this.option.column[2].disabled = true;
+      }
+      done();
+    },
     // action鍒楄〃澧炲姞
     addClickHandler() {
       if (func.isEmptyObject(this.treeNodeRow)) {
@@ -473,29 +502,24 @@
       this.leftRoleData = [{
         name: '缂栧彿',
         oid: '缂栧彿'
-      },
-        {
-          name: '绫昏矾寰�',
-          oid: '绫昏矾寰�'
-        },
-        {
-          name: '閾炬帴鍦板潃',
-          oid: '閾炬帴鍦板潃'
-        },
-        {
-          name: '绫诲瀷',
-          oid: '绫诲瀷'
-        },
-        {
-          name: '鎻忚堪',
-          oid: '鎻忚堪'
-        },]
+      }, {
+        name: '绫昏矾寰�',
+        oid: '绫昏矾寰�'
+      }, {
+        name: '閾炬帴鍦板潃',
+        oid: '閾炬帴鍦板潃'
+      }, {
+        name: '绫诲瀷',
+        oid: '绫诲瀷'
+      }, {
+        name: '鎻忚堪',
+        oid: '鎻忚堪'
+      },]
       this.$refs.transfer.visible = true;
     },
 
     // 绌挎妗嗕繚瀛� index涓�0鏄�夋嫨 1鏄叏閮�
     exportSendHandler(row, index) {
-      console.log(row, index);
       const params = {
         dataType: index,
         chooseDataOid: index === 0 ? this.selectList.map(item => item.plOId) : [],
@@ -553,6 +577,7 @@
 
     // 鍙傛暟鍒楄〃鏂板淇濆瓨
     BottomRowSaveHandler(form, done, loading) {
+      form.actionOid=this.currenRow.plOId;
       savePLActionParam(form).then(res => {
         if (res.data.code === 200) {
           this.$message.success('娣诲姞鎴愬姛');
@@ -562,7 +587,24 @@
       })
       loading();
     },
+    handleSaveNext(){
+      this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.validate((valid) => {
+        if (valid) {
+          this.bottomForm.actionOid=this.currenRow.plOId;
+          savePLActionParam(this.bottomForm).then(res => {
+            if (res.data.code === 200) {
+              this.$message.success('娣诲姞鎴愬姛');
+              this.bottomForm={};
+              this.getBottomList();
+              this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.resetFields()
+            }
+          })
+        } else {
+          return false;
+        }
+      });
 
+    },
     // 鍙傛暟鍒楄〃淇敼淇濆瓨
     BottomRowUpdateHandler(row, index, done, loading) {
       updatePLActionParam(row).then(res => {
@@ -602,7 +644,10 @@
         this.$message.error('璇烽�夋嫨涓�鏉″垎绫昏繘琛屾坊鍔�');
         return;
       }
-
+      if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+        this.$message.error('鏈垎绫讳笅涓嶈兘鍒涘缓瀛愬垎绫�');
+        return;
+      }
       const {createTime, creator, name, id, description} = this.treeNodeRow;
       this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
       this.$set(this.treeForm, 'creator', creator);
@@ -635,6 +680,10 @@
         this.$message.error('鏍硅妭鐐逛笉鑳戒慨鏀�');
         return;
       }
+      if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+        this.$message.error('鏈垎绫讳笉鑳戒慨鏀�');
+        return;
+      }
       const {name, serialno, creator, createTime, pid, description, id} = this.treeNodeRow;
       const pidName = this.findObjectNameById(this.treeData, pid);
       this.$set(this.treeForm, 'name', name);
@@ -654,7 +703,7 @@
       updateActionCls(data).then(res => {
         if (res.data.code === 200) {
           this.$message.success('淇敼鎴愬姛');
-          this.getBottomList();
+          //this.getBottomList();
         }
         done();
       })
@@ -727,5 +776,8 @@
   .el-scrollbar__wrap {
     overflow: auto !important;
   }
+  .avue-dialog .el-dialog__body .avue-form{
+    margin: 0 auto;
+  }
 }
 </style>

--
Gitblit v1.9.3