<el-table-column property="address" label="调整顺序" width="200px" align="center">
<template slot-scope="scope">
<el-button v-if="scope.$index != 0" @click="upward(scope.$index)" size="mini">↑</el-button>
<el-button v-if="scope.$index != tableInfoForm.info.length - 1" @click="downward(scope.$index)" size="mini">↓</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="left" prop="t0005Status" >
<template v-slot="scope">
<el-switch v-model="scope.row.t0005Status" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
inactive-value="0" @change="gbstate(scope.$index, scope.row)">
</el-switch>
</template>
</el-table-column>
// 调整顺序
upward(index){
let array = this.tableInfoForm.info;
// console.log([array[index],array[index-1]],index,index+1);
[array[index],array[index-1]] = [array[index-1],array[index]];
array[index].t0005XuHao = index+1
array[index-1].t0005XuHao = index
array.splice(0,0);
console.log(array);
},
downward(index){
let array = this.tableInfoForm.info;
[array[index],array[index+1]] = [array[index+1],array[index]];
// console.log(array[index],index,array[index+1],);
array[index+1].t0005XuHao = index+2
array[index].t0005XuHao = index+1
array.splice(0,0);
},
gbstate(index, value) {
console.log({index},{value});
let text = value.t0005Status == "0" ? "禁用" : "启用";
this.$confirm('确认要' + text + '该项目吗?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$message({
message:'成功',
type: "success",
});
})
},