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

View File

@ -674,6 +674,54 @@ export const OperationEvent = {
operation: '00b',
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: {
menu: {
operation: '616',
c: '616',
domId: '_Tips-Station-areaSelection-Menu'
},
mbar: {