模式转换功能调整

This commit is contained in:
dong 2023-02-17 15:01:59 +08:00
parent 2c41be9df5
commit fcb9ce5e08
5 changed files with 105 additions and 27 deletions

View File

@ -909,11 +909,6 @@ export const menuOperate = {
agreeSwitchControlMode:{
operation: OperationEvent.MixinCommand.modeCovert.agreeModeCovertCommit.operation,
cmdType: CMD.CTC.CTC_AGREE_OPERATION_MODEL
},
// 不同意操作模式转换
noAgreeSwitchControlMode:{
operation: OperationEvent.MixinCommand.modeCovert.agreeModeCovertCommit.operation,
cmdType: CMD.CTC.CTC_NO_AGREE_OPERATION_MODEL
}
},
Rail: {

View File

@ -24,31 +24,31 @@
</el-table-column>
<el-table-column>
<template slot="header" slot-scope="scope">
<el-radio v-model="controlTypeAll" label="Center" @input="changeControlTypeAll">全选</el-radio>
<el-radio v-model="controlTypeAll" label="Center" :disabled="isAgreeMode" @input="changeControlTypeAll">全选</el-radio>
</template>
<template slot-scope="scope">
<el-radio v-model="scope.row.target" label="Center">
<span :class="scope.row.source == 'Center' ? 'redText' : ''">中心控制</span>
<el-radio v-model="scope.row.target" label="Center" :disabled="isAgreeMode">
<span :class="getTextColor(scope.row, 'Center')">中心控制</span>
</el-radio>
</template>
</el-table-column>
<el-table-column>
<template slot="header" slot-scope="scope">
<el-radio v-model="controlTypeAll" label="Station" @input="changeControlTypeAll">全选</el-radio>
<el-radio v-model="controlTypeAll" label="Station" :disabled="isAgreeMode" @input="changeControlTypeAll">全选</el-radio>
</template>
<template slot-scope="scope">
<el-radio v-model="scope.row.target" label="Station">
<span :class="scope.row.source == 'Station' ? 'redText' : ''">车站控制</span>
<el-radio v-model="scope.row.target" label="Station" :disabled="isAgreeMode">
<span :class="getTextColor(scope.row, 'Station')">车站控制</span>
</el-radio>
</template>
</el-table-column>
<el-table-column>
<template slot="header" slot-scope="scope">
<el-radio v-model="controlTypeAll" label="Station_Shunt" @input="changeControlTypeAll">全选</el-radio>
<el-radio v-model="controlTypeAll" label="Station_Shunt" :disabled="isAgreeMode" @input="changeControlTypeAll">全选</el-radio>
</template>
<template slot-scope="scope">
<el-radio v-model="scope.row.target" label="Station_Shunt">
<span :class="scope.row.source == 'Station_Shunt' ? 'redText' : ''">车站调车</span>
<el-radio v-model="scope.row.target" label="Station_Shunt" :disabled="isAgreeMode">
<span :class="getTextColor(scope.row, 'Station_Shunt')">车站调车</span>
</el-radio>
</template>
</el-table-column>
@ -108,6 +108,9 @@ export default {
},
roleDeviceCode() {
return this.$store.state.training.roleDeviceCode;
},
operationModeApplyList() {
return this.$store.state.socket.operationModeApplyList;
}
},
watch: {
@ -141,6 +144,18 @@ export default {
}
},
methods:{
getTextColor(row, type) {
let colorClass = '';
if (row.source == type) {
colorClass = 'redText';
}
if (this.isAgreeMode) {
if (row.target == type) {
colorClass = 'orangeText';
}
}
return colorClass;
},
changeAllAgreeChecked() {
this.tableData.forEach(item => {
this.$set(item, 'isAgree', this.allAgreeChecked);
@ -169,7 +184,15 @@ export default {
getListData() {
this.tableData = [];
if (this.isAgreeMode) {
console.log('============');
this.operationModeApplyList.forEach(item => {
const info = this.$store.getters['map/getDeviceByCode'](item.code);
const obj = {
...item,
name: info ? info.name : '',
isAgree: false
};
this.tableData.push(obj);
});
} else {
let list = this.stationList;
if (this.work == 'ctcWork') {
@ -194,9 +217,38 @@ export default {
}
},
commit() {
console.log('--commit---');
if (this.isAgreeMode) {
console.log('==----------===');
const list = [];
const noList = [];
this.tableData.forEach(item => {
if (item.isAgree) {
list.push(item.code);
} else {
noList.push(item.code);
}
});
const operate = {
over: true,
operation: menuOperate.CTC.agreeSwitchControlMode.operation,
userOperationType: UserOperationType.LEFTCLICK,
cmdType: menuOperate.CTC.agreeSwitchControlMode.cmdType,
param: {
agreeStationCodes: list,
noAgreeStationCodes: noList
}
};
this.loading = true;
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.loading = false;
this.doClose();
this.$store.commit('socket/clearOperationModeApplyList', JSON.parse(JSON.stringify(this.tableData)));
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
} else {
const list = [];
this.tableData.forEach(item => {
@ -262,4 +314,7 @@ export default {
.redText {
color: red;
}
.orangeText {
color: orange;
}
</style>

View File

@ -102,15 +102,15 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="MixinCommand.modeCovert.button.domId" class="button_box" @click="modeCovertBtn(MixinCommand.modeCovert.button.operation)">
<span :style="{color: operation === MixinCommand.modeCovert.button.operation ? '#ccc':'black'}">
<button :id="MixinCommand.modeCovert.button.domId" class="button_box" :class="{flicker: hasModeApplyList && !modeCovertShow, redFlick: hasModeApplyList && !modeCovertShow}" @click="modeCovertBtn(MixinCommand.modeCovert.button.operation)">
<span :style="{color: modeCovertShow ? '#ccc':'black'}">
<center><b></b><b></b></center>
<center><b></b><b></b></center>
</span>
</button>
<div v-if="modeCovertShow" class="modeCovertPopList">
<div :id="MixinCommand.modeCovert.applyModeCovert.domId" class="eachModeCovertPop" @click="applyModeCovert">模式申请</div>
<div :id="MixinCommand.modeCovert.agreeModeCovert.domId" class="eachModeCovertPop" @click="agreeModeCovert">同意模式申请</div>
<div :id="MixinCommand.modeCovert.agreeModeCovert.domId" class="eachModeCovertPop" :class="{flicker: hasModeApplyList && modeCovertShow, redFlick: hasModeApplyList && modeCovertShow}" @click="agreeModeCovert">同意模式申请</div>
</div>
<password-box ref="password" @checkOver="passWordCommit" @checkCancel="clearOperate" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
@ -216,6 +216,9 @@ export default {
'autoReentryList',
'autoReentryData'
]),
hasModeApplyList() {
return this.$store.state.socket.operationModeApplyList.length;
},
isDispatchWork () {
return this.work == 'dispatchWork';
},
@ -285,7 +288,11 @@ export default {
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.clearOperate();
},
'$store.state.menuOperation.leftClickCount': function (val) {
this.modeCovertShow = false;
},
'$store.state.menuOperation.menuCount': function (val) {
this.modeCovertShow = false;
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
const operate = {
userOperationType: 'rightClick',
@ -1070,4 +1077,21 @@ export default {
color: #ccc !important;
}
}
.redFlick {
background: red;
}
@keyframes fade {
from {
opacity: 1.0;
}
50% {
opacity: 0.2;
}
to {
opacity: 1.0;
}
}
.flicker {
animation: fade 600ms infinite;
}
</style>

View File

@ -494,8 +494,7 @@ export default {
CTC_READ_DISPATCH_COMMAND:{value:'CTC_READ_DISPATCH_COMMAND', label: '调度台命令已读'},
CTC_SWITCH_ROUTE_SET_MODEL:{value:'Station_Switch_Route_Set_Model', label: '状态切换操作'},
CTC_SWITCH_CONTROL_OPERATION_MODEL:{value:'Station_Switch_Control_Operation_Mode', label: '操作模式转换'},
CTC_AGREE_OPERATION_MODEL:{value:'Station_Agree_Operation_Mode', label: '同意操作模式转换'},
CTC_NO_AGREE_OPERATION_MODEL:{value:'Station_No_Agree_Operation_Mode', label: '不同意操作模式转换'}
CTC_AGREE_OPERATION_MODEL:{value:'Station_Handle_Operation_Mode_Apply', label: '同意操作模式转换'}
},
RAIL: {

View File

@ -395,12 +395,17 @@ const socket = {
state.controlTransfer = transfer;
},
operationModeApply: (state, list) => {
list.forEach(item => {
state.operationModeApplyList.push(item);
});
state.operationModeApplyList = list;
},
clearOperationModeApplyList: (state) => {
state.operationModeApplyList = [];
clearOperationModeApplyList: (state, list) => {
list.forEach(item => {
const index = state.operationModeApplyList.findIndex(every => {
return every.code == item.code && every.target == item.target;
});
if (index >= 0) {
state.operationModeApplyList.splice(index, 1);
}
});
}
},