panhui 5 gadi atpakaļ
vecāks
revīzija
a0283b55e2
1 mainītis faili ar 35 papildinājumiem un 9 dzēšanām
  1. 35 9
      src/main/vue/src/views/PerformanceApplyList2.vue

+ 35 - 9
src/main/vue/src/views/PerformanceApplyList2.vue

@@ -142,9 +142,19 @@
                         <template slot-scope="{ row }"> {{ row.showStartTime }} 至 {{ row.showEndTime }} </template>
                         <template slot-scope="{ row }"> {{ row.showStartTime }} 至 {{ row.showEndTime }} </template>
                     </el-table-column>
                     </el-table-column>
                     <el-table-column label="操作">
                     <el-table-column label="操作">
-                        <template slot-scope="{ row, $index }">
-                            <el-button icon="el-icon-top" circle @click="move($index, -1)"></el-button>
-                            <el-button icon="el-icon-bottom" @click="move($index, 1)" circle></el-button>
+                        <template slot-scope="{ $index }">
+                            <el-button
+                                icon="el-icon-top"
+                                :disabled="$index == 0"
+                                circle
+                                @click="move($index, -1)"
+                            ></el-button>
+                            <el-button
+                                icon="el-icon-bottom"
+                                :disabled="$index == timeList.length - 1"
+                                @click="move($index, 1)"
+                                circle
+                            ></el-button>
                         </template>
                         </template>
                     </el-table-column>
                     </el-table-column>
                 </el-table>
                 </el-table>
@@ -383,14 +393,30 @@ export default {
             this.getArrangement();
             this.getArrangement();
         },
         },
         move(index, direction) {
         move(index, direction) {
+            let timeList = [...this.timeList];
             const start = index;
             const start = index;
             const end = direction + index;
             const end = direction + index;
-            const startInfo = { ...this.tableData[start] };
-            const endInfo = { ...this.tableData[end] };
-            // console.log(startInfo);
-            // console.log(endInfo);
-            startInfo.showStartTime = endInfo.showStartTime;
-            startInfo.showEndTime = endInfo.showEndTime;
+
+            const startInfo = {
+                showStartTime: timeList[end].showStartTime,
+                showEndTime: timeList[end].showStartTime
+            };
+            const endInfo = {
+                showStartTime: timeList[start].showStartTime,
+                showEndTime: timeList[start].showStartTime
+            };
+
+            timeList[start] = {
+                ...timeList[start],
+                ...startInfo
+            };
+
+            timeList[end] = {
+                ...timeList[end],
+                ...endInfo
+            };
+
+            this.timeList = timeList;
         }
         }
     }
     }
 };
 };