北京一号线 新版 指令调整

This commit is contained in:
joylink_cuiweidong 2020-02-17 10:55:44 +08:00
parent 2b5ac01556
commit 9b8079a7ea

View File

@ -36,12 +36,13 @@
<el-table-column label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.check"
:prop="'tempData.' + scope.$index + '.check'"
v-model="changeList[scope.$index]"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
@change="changeCheck(scope.row.check,scope.row.code)"
@change="changeCheck(changeList[scope.$index],scope.row.code)"
/>
<!-- -->
<!-- :prop="'tempData.' + scope.$index + '.check'" -->
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
@ -100,7 +101,9 @@ export default {
selection: [],
stationName: '',
signalName: '',
allSelect: false
allSelect: false,
changeList:[],
commitDisabled: true
};
},
computed: {
@ -136,22 +139,8 @@ export default {
return '';
}
},
commitDisabled() {
let disabled = true;
if (this.selection && this.selection.length) {
disabled = false;
}
return disabled;
}
},
watch: {
//
// tempData: {
// handler(val, oldVal) {
// this.checkTableDataSelction(val);
// },
// deep: true
// }
},
mounted() {
this.$nextTick(() => {
@ -161,7 +150,8 @@ export default {
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
this.allSelect=false;
this.allSelect = false;
this.changeList = [];
//
if (!this.dialogShow) {
this.signalName = '';
@ -204,58 +194,43 @@ export default {
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
changeCheck(check,code){
if(check){
changeCheck(check, code) {
if (check) {
this.selection.push(code);
}else{
this.selection.splice(this.selection.indexOf(code),1);
} else {
this.selection.splice(this.selection.indexOf(code), 1);
}
if(this.selection.length>=this.tempData.length){
this.allSelect=true;
}else{
this.allSelect=false;
if (this.selection.length >= this.tempData.length) {
this.allSelect = true;
} else {
this.allSelect = false;
}
if (this.selection.length > 0) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
}
},
// checkTableDataSelction(data) {
// const selection = [];
// if (data && data.length > 0) {
// data.forEach(row => {
// if (row.check && !row.disabled) {
// selection.push(row);
// }
// });
// }
// if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
// this.handleChooseChange(selection);
// this.selection = selection;
// }
// let num = 0;
// this.allSelect = false;
// this.tempData.forEach(item => {
// if (item.check) {
// num++;
// if (num == this.tempData.length) {
// this.allSelect = true;
// }
// }
// });
// },
allSelectChange() {
this.changeList = [];
if (this.allSelect) {
this.tempData.forEach(item => {
this.tempData.forEach((item, index)=> {
if (!item.disabled) {
item.check = true;
this.changeCheck(true,item.code);
this.changeList.push(true);
this.selection.push(item.code);
}
});
this.allSelect = true;
this.commitDisabled = false;
} else {
this.tempData.forEach(item => {
this.tempData.forEach((item, index) => {
if (!item.disabled) {
item.check = false;
this.changeCheck(false,item.code);
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
}
});
this.allSelect = false;
this.commitDisabled = true;
}
},
serializeCodeListWithSeparator(sep) {