|
|
@@ -142,9 +142,19 @@
|
|
|
<template slot-scope="{ row }"> {{ row.showStartTime }} 至 {{ row.showEndTime }} </template>
|
|
|
</el-table-column>
|
|
|
<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>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -383,14 +393,30 @@ export default {
|
|
|
this.getArrangement();
|
|
|
},
|
|
|
move(index, direction) {
|
|
|
+ let timeList = [...this.timeList];
|
|
|
const start = 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;
|
|
|
}
|
|
|
}
|
|
|
};
|