From d327dc5cc832df94a364d468aca74dea8d7624c8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 30 八月 2024 19:37:56 +0800
Subject: [PATCH] 工单图片优化

---
 src/views/system/platform/index.vue |   49 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/src/views/system/platform/index.vue b/src/views/system/platform/index.vue
index 79a3a40..627102f 100644
--- a/src/views/system/platform/index.vue
+++ b/src/views/system/platform/index.vue
@@ -40,15 +40,19 @@
         border
         style="width: 100%; margin-top: 20px">
         <el-table-column
-          prop="platform"
+          prop="platformName"
           label="骞冲彴鍚嶇О">
         </el-table-column>
         <el-table-column
-          prop="amount1"
+          prop="subPlatformName"
+          label="瀛愮骇骞冲彴鍚嶇О">
+        </el-table-column>
+        <el-table-column
+          prop="area"
           label="琛屾斂鍖哄煙">
         </el-table-column>
         <el-table-column
-          prop="IP"
+          prop="platformIP"
           label="骞冲彴IP">
         </el-table-column>
         <el-table-column
@@ -99,7 +103,7 @@
           <div v-for="(deploy, index) in addForm.deployList" :key="index" style="margin-bottom: 20px">
             <el-form size="small" ref="deployForm" :inline="true">
               <el-form-item label="骞冲彴鍚嶇О" prop="platformName">
-                <el-input v-model="deploy.platformName"></el-input>
+                <el-input v-model="deploy.subPlatformName"></el-input>
               </el-form-item>
               <el-form-item label="骞冲彴IP" prop="platformIP">
                 <el-input v-model="deploy.platformIP"></el-input>
@@ -156,7 +160,7 @@
         platformIp: '',
         deployList: [
           {
-            platformName: '',
+            subPlatformName: '',
             platformIp: '',
             remark: '',
             area: ''
@@ -169,7 +173,8 @@
         platformName: ''
       },
       tableData: [],
-      total: 0
+      total: 0,
+      currentRowNum: 0
     }
   },
   mounted() {
@@ -189,12 +194,8 @@
     },
     checkDeployList() {
       if (this.addForm.deployList) {
-        return
-      } else {
         this.addForm.deployList = this.addForm.deployList.filter(item => {
-          if (item.platformName && item.platformIp && item.remark && item.area) {
-            return true
-          }
+          return item.platformName || item.platformIp || item.remark || item.area;
         })
       }
     },
@@ -203,13 +204,11 @@
         if (valid) {
           this.checkDeployList()
           if (this.addForm.deployList) {
-            console.log(this.addForm.deployList[0])
-            this.addForm.deployList.forEach(item => {
-              if (!item.platformName || !item.platformIp || !item.area) {
-                this.$message.error("璇锋鏌ュ钩鍙伴儴缃蹭俊鎭槸鍚﹀~鍐欏畬鏁�")
-                return
-              }
-            })
+            console.log(this.addForm.deployList)
+            if (this.addForm.deployList.some(item => !item.platformName || !item.platformIP || !item.area)) {
+              this.$message.error("璇锋鏌ュ钩鍙伴儴缃蹭俊鎭槸鍚﹀~鍐欏畬鏁�");
+              return; // 閫�鍑� validate 鍥炶皟
+            }
           }
           addPlatform(this.addForm).then(res => {
             this.$message.success("娣诲姞鎴愬姛")
@@ -239,7 +238,6 @@
       })
     },
     resetQuery() {
-      this.daterangeYwHandleTime = []
       this.resetForm('queryForm')
       this.handleQuery()
     },
@@ -248,6 +246,19 @@
       this.getList()
     },
     spanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0) {
+        if (row.parentId === 0) {
+          return {
+            rowspan: row.childNum + 1,
+            colspan: 1  // 鍙悎骞剁涓�鍒�
+          };
+        } else {
+          return {
+            rowspan: 0,
+            colspan: 0
+          };
+        }
+      }
 
     }
   }

--
Gitblit v1.8.0