宁波一区域选择弹窗按钮添加domId

This commit is contained in:
dong 2022-12-16 22:29:55 +08:00
parent 2c66d6aadf
commit 38e91e8202
2 changed files with 143 additions and 37 deletions

View File

@ -5,7 +5,7 @@
:title="title" :title="title"
:visible.sync="show" :visible.sync="show"
width="650px" width="650px"
:before-close="doClose" :before-close="() => show=false"
:show-close="true" :show-close="true"
:z-index="2000" :z-index="2000"
:modal="false" :modal="false"
@ -43,14 +43,14 @@
</el-table> </el-table>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-button style="width: 125px;margin-left: 10px;" @click="applyAll">全部申请</el-button> <el-button :id="getDomId('applyAll')" style="width: 125px;margin-left: 10px;" @click="applyAll">全部申请</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="cancelApplyAll">取消全部申请</el-button> <el-button :id="getDomId('cancelApplyAll')" style="width: 125px;margin-top: 10px;" @click="cancelApplyAll">取消全部申请</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="releaseAll">全部释放</el-button> <el-button :id="getDomId('releaseAll')" style="width: 125px;margin-top: 10px;" @click="releaseAll">全部释放</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="cancelReleaseAll">取消全部释放</el-button> <el-button :id="getDomId('cancelReleaseAll')" style="width: 125px;margin-top: 10px;" @click="cancelReleaseAll">取消全部释放</el-button>
<el-button style="width: 125px;margin-top: 10px;" :disabled="true" @click="distributionAll">全部强制分配</el-button> <el-button :id="getDomId('distributionAll')" style="width: 125px;margin-top: 10px;" :disabled="true" @click="distributionAll">全部强制分配</el-button>
<el-button style="width: 125px;margin-top: 10px;" :disabled="true" @click="cancelDistributionAll">取消全部强制分配</el-button> <el-button :id="getDomId('cancelDistributionAll')" style="width: 125px;margin-top: 10px;" :disabled="true" @click="cancelDistributionAll">取消全部强制分配</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="commit">应用</el-button> <el-button :id="commitDomId" style="width: 125px;margin-top: 10px;" @click="commit">应用</el-button>
<el-button style="width: 125px;margin-top: 10px;" @click="doClose">退出</el-button> <el-button :id="getDomId('doClose')" style="width: 125px;margin-top: 10px;" @click="doClose">退出</el-button>
</el-col> </el-col>
</el-row> </el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" /> <notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -87,7 +87,10 @@ export default {
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationList' 'stationList'
]) ]),
commitDomId() {
return this.show ? OperationEvent.Station.areaSelection.confirm.domId : '';
}
}, },
watch: { watch: {
'$store.state.map.mapStateLoadedCount': function () { '$store.state.map.mapStateLoadedCount': function () {
@ -107,6 +110,12 @@ export default {
}); });
}, },
methods: { methods: {
getDomId(key) {
return this.show ? OperationEvent.Command.commandNingBo1[key].domId : '';
},
getOperation(key) {
return OperationEvent.Command.commandNingBo1[key] ? OperationEvent.Command.commandNingBo1[key].operation : '';
},
doShow() { doShow() {
this.tableData = []; this.tableData = [];
this.$store.state.training.simulationUserList.forEach(item => { this.$store.state.training.simulationUserList.forEach(item => {
@ -138,7 +147,14 @@ export default {
this.show = true; this.show = true;
}, },
doClose() { doClose() {
this.show = false; const operate = {
operation: this.getOperation('doClose')
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.show = false;
}
});
}, },
getControlStatus(code) { getControlStatus(code) {
const newStation = this.$store.getters['map/getDeviceByCode'](code); const newStation = this.$store.getters['map/getDeviceByCode'](code);
@ -167,49 +183,91 @@ export default {
} }
}, },
applyAll() { applyAll() {
this.tableData.forEach(item => { const operate = {
const centralizedStationCode = this.stationCentralizedMap[item.code]; operation: this.getOperation('applyAll')
const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); };
const station = this.$store.getters['map/getDeviceByCode'](item.code); this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { if (valid) {
item.apply = false; this.tableData.forEach(item => {
} else if (station.controller !== this.memberId) { const centralizedStationCode = this.stationCentralizedMap[item.code];
item.apply = true; const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode);
const station = this.$store.getters['map/getDeviceByCode'](item.code);
if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') {
item.apply = false;
} else if (station.controller !== this.memberId) {
item.apply = true;
}
});
} }
}); });
}, },
cancelApplyAll() { cancelApplyAll() {
this.tableData.forEach(item => { const operate = {
item.apply = false; operation: this.getOperation('cancelApplyAll')
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.tableData.forEach(item => {
item.apply = false;
});
}
}); });
}, },
releaseAll() { releaseAll() {
this.tableData.forEach(item => { const operate = {
const centralizedStationCode = this.stationCentralizedMap[item.code]; operation: this.getOperation('releaseAll')
const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode); };
const station = this.$store.getters['map/getDeviceByCode'](item.code); this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') { if (valid) {
item.apply = false; this.tableData.forEach(item => {
} else if (station.controller === this.memberId) { const centralizedStationCode = this.stationCentralizedMap[item.code];
item.release = true; const centralizedStation = this.$store.getters['map/getDeviceByCode'](centralizedStationCode);
const station = this.$store.getters['map/getDeviceByCode'](item.code);
if (this.work === 'localWork' && centralizedStation.controlMode === 'Center') {
item.apply = false;
} else if (station.controller === this.memberId) {
item.release = true;
}
});
} }
}); });
}, },
cancelReleaseAll() { cancelReleaseAll() {
this.tableData.forEach(item => { const operate = {
item.release = false; operation: this.getOperation('cancelReleaseAll')
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.tableData.forEach(item => {
item.release = false;
});
}
}); });
}, },
distributionAll() { distributionAll() {
this.tableData.forEach(item => { const operate = {
if (item.controller !== this.memberId) { operation: this.getOperation('distributionAll')
item.distribution = true; };
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.tableData.forEach(item => {
if (item.controller !== this.memberId) {
item.distribution = true;
}
});
} }
}); });
}, },
cancelDistributionAll() { cancelDistributionAll() {
this.tableData.forEach(item => { const operate = {
item.distribution = false; operation: this.getOperation('cancelDistributionAll')
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.tableData.forEach(item => {
item.distribution = false;
});
}
}); });
}, },
commit() { commit() {

View File

@ -674,6 +674,54 @@ export const OperationEvent = {
operation: '00b', operation: '00b',
domId: '' domId: ''
} }
},
// 宁波一
commandNingBo1: {
// 区域选择
areaSelection: {
operation: '00c',
domId: '_Tips-ningBo1-areaSelection'
},
// 全部申请
applyAll: {
operation: '00c1',
domId: '_Tips-ningBo1-areaSelection-applyAll'
},
// 取消全部申请
cancelApplyAll: {
operation: '00c2',
domId: '_Tips-ningBo1-areaSelection-cancelApplyAll'
},
// 全部释放
releaseAll: {
operation: '00c3',
domId: '_Tips-ningBo1-areaSelection-releaseAll'
},
// 取消全部释放
cancelReleaseAll: {
operation: '00c4',
domId: '_Tips-ningBo1-areaSelection-cancelReleaseAll'
},
// 全部强制分配
distributionAll: {
operation: '00c5',
domId: '_Tips-ningBo1-areaSelection-distributionAll'
},
// 取消全部强制分配
cancelDistributionAll: {
operation: '00c6',
domId: '_Tips-ningBo1-areaSelection-cancelDistributionAll'
},
// 应用
commit: {
operation: '00c7',
domId: '_Tips-ningBo1-areaSelection-commit'
},
// 退出
doClose: {
operation: '00c8',
domId: '_Tips-ningBo1-areaSelection-doClose'
}
} }
}, },
// 站台概要表 // 站台概要表
@ -2966,7 +3014,7 @@ export const OperationEvent = {
// 区域选择 申请控制权 // 区域选择 申请控制权
areaSelection: { areaSelection: {
menu: { menu: {
operation: '616', c: '616',
domId: '_Tips-Station-areaSelection-Menu' domId: '_Tips-Station-areaSelection-Menu'
}, },
mbar: { mbar: {