代码调整

This commit is contained in:
joylink_cuiweidong 2023-02-15 18:25:09 +08:00
parent 90e0084247
commit 2d8d1d3c11
3 changed files with 246 additions and 19 deletions

View File

@ -0,0 +1,148 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="apply-agree chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="applyOrAgreeAll">
<div class="applyOrAgreeTitle">
<div class="applyOrAgreeStation">站名</div>
<!-- <el-radio-group v-model="controlTypeAll"> -->
<div class="applyOrAgreeCenterControl">
<el-radio key="centerControlAll" v-model="controlTypeAll" label="centerControlAll" :size="small">全选</el-radio>
</div>
<div class="applyOrAgreeStationControl">
<el-radio key="stationControlAll" v-model="controlTypeAll" label="stationControlAll" :size="small">全选</el-radio>
</div>
<div class="applyOrAgreeStationDispatchControl">
<el-radio key="stationDispatchControlAll" v-model="controlTypeAll" label="stationDispatchControlAll" :size="small">全选</el-radio>
</div>
</div>
<div class="applyOrAgreeContent">
<div v-for="(station,index) in stationList" :key="index" class="applyOrAgreeContentIn">
<div class="applyOrAgreeStation">{{ station.name }}</div>
<div class="applyOrAgreeCenterControl">
<el-radio key="centerControlAll" v-model="selectedControlList[index]" label="centerControlAll" :size="small">中心控制</el-radio>
</div>
<div class="applyOrAgreeStationControl">
<el-radio key="stationControlAll" v-model="selectedControlList[index]" label="stationControlAll" :size="small">车站控制</el-radio>
</div>
<div class="applyOrAgreeStationDispatchControl">
<el-radio key="stationDispatchControlAll" v-model="selectedControlList[index]" label="stationDispatchControlAll" :size="small">车站调车</el-radio>
</div>
</div>
</div>
</div>
<el-row justify="center" class="button-group" style="margin-bottom:20px;margin-top:20px">
<el-col :span="5" :offset="6">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="5" :offset="2">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</el-dialog></div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
export default {
name: 'ForkDirective',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
title:'操作方式转换',
controlTypeAll:'',
selectedControlList:[],
loading: false,
domIdConfirm:''
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
methods:{
doShow(operate) {
this.operation = operate.operation;
if (this.operation == OperationEvent.MixinCommand.modeCovert.applyModeCovert.operation) {
this.domIdConfirm = OperationEvent.MixinCommand.modeCovert.applyModeCovertCommit.domId;
} else if (this.operation == OperationEvent.MixinCommand.modeCovert.agreeModeCovert.operation) {
this.domIdConfirm = OperationEvent.MixinCommand.modeCovert.agreeModeCovertCommit.domId;
}
this.selectedControlList = [];
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
}
}
};
</script>
<style lang="scss">
.applyOrAgreeAll{display:inline-block;min-height:200px}
.applyOrAgreeTitle{display:inline-block;font-size:0px}
.applyOrAgreeContentIn{font-size:0px}
.applyOrAgreeStation{
display: inline-block;
border-right: 1px #6e6e6e solid;
border-bottom: 1px #6e6e6e solid;
background: #fff2f0;
font-size: 14px;
width: 100px;
text-align: center;
padding-top: 5px;
padding-bottom: 5px;
}
.applyOrAgreeCenterControl,.applyOrAgreeStationControl,.applyOrAgreeStationDispatchControl{
display: inline-block;
background: #fff2f0;
padding: 2px 0px;
border-right: 1px #6e6e6e solid;
border-bottom: 1px #6e6e6e solid;
font-size: 14px;
vertical-align: top;
text-align: center;
width: 108px;
}
.apply-agree.chengdou-03__systerm .el-dialog .el-dialog__body{
padding:0px;
}
</style>

View File

@ -102,18 +102,23 @@
<center><b></b><b></b></center>
</span>
</button>
<button :id="555" class="button_box" @click="buttonDown()">
<span style="color: black;">
<button :id="MixinCommand.modeCovert.button.domId" class="button_box" @click="buttonDown(MixinCommand.modeCovert.button.operation)">
<span :style="{color: operation === MixinCommand.modeCovert.button.operation ? '#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>
<password-box ref="password" @checkOver="passWordCommit" @checkCancel="clearOperate" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
<pop-menu ref="popMenu" :menu="menu" />
<train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<fork-directive ref="forkDirective" />
<apply-or-agree-mode-covert ref="applyOrAgreeModeCovert" />
</div>
</template>
@ -132,6 +137,7 @@ import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
import {UserOperationType} from '../../../../scripts/ConstDic';
import ForkDirective from './dialog/forkDirective';
import ApplyOrAgreeModeCovert from './dialog/applyOrAgreeModeCovert';
export default {
name: 'MapButtonMenu',
components: {
@ -141,7 +147,8 @@ export default {
PopMenu,
TrainRoute,
ShuntRoute,
ForkDirective
ForkDirective,
ApplyOrAgreeModeCovert
},
props: {
selected: {
@ -158,6 +165,7 @@ export default {
y: 0
},
operation: '',
modeCovertShow:false,
buttonName: '',
guideColorDown: '#FEEE1A',
guideColorUp: '#DCDCDC',
@ -378,6 +386,7 @@ export default {
}
},
buttonDown(operation, commandTypeList) {
// MixinCommand.modeCovert.button.operation
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
if (!station || station.controlMode === 'Interlock') { return; }
const operate = {
@ -385,26 +394,58 @@ export default {
userOperationType: UserOperationType.LEFTCLICK,
operation: operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation === this.Command.cancel.clearMbm.operation ? null : operation);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (operation == this.MixinCommand.modeCovert.button.operation) {
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
this.modeCovertShow = true;
this.operation = operation;
this.commandTypeList = commandTypeList;
const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Signal.guide.button.operation,
this.Station.guideLock.button.operation
];
if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
});
} else {
this.modeCovertShow = false;
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.$store.dispatch('menuOperation/setButtonOperation', operation === this.Command.cancel.clearMbm.operation ? null : operation);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.operation = operation;
this.commandTypeList = commandTypeList;
const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Signal.guide.button.operation,
this.Station.guideLock.button.operation
];
if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
this.timeNode = this.$store.state.socket.simulationTimeSync;
}
this.timeNode = this.$store.state.socket.simulationTimeSync;
}
});
}
},
applyModeCovert() {
const operate = {
userOperationType: UserOperationType.LEFTCLICK,
operation: this.MixinCommand.modeCovert.applyModeCovert.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
this.modeCovertShow = false;
this.$refs.applyOrAgreeModeCovert.doShow(operate);
this.clearOperate();
});
},
agreeModeCovert() {
const operate = {
userOperationType: UserOperationType.LEFTCLICK,
operation: this.MixinCommand.modeCovert.agreeModeCovert.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
this.modeCovertShow = false;
this.$refs.applyOrAgreeModeCovert.doShow(operate);
this.clearOperate();
});
},
//
handleRouteDataMap() {
this.routeDataMap = {};
@ -976,4 +1017,20 @@ export default {
background-color: $hoverBg;
}
}
.modeCovertPopList{
position: absolute;
width: 130px;
background: #F0F0F0;
bottom: 18px;
left: 780px;
box-shadow: 1px 3px 3px #000;
}
.eachModeCovertPop{
font-size: 15px;
padding: 5px 0px 5px 10px;
cursor: pointer;
}
.eachModeCovertPop:hover{
background: #c3c3c3;
}
</style>

View File

@ -3803,6 +3803,28 @@ export const OperationEvent = {
operation: '299c',
domId: '_Tips-Control-StationControl-Confirm{TOP}'
}
},
modeCovert:{
button:{
operation: '299d',
domId: '_Tips-Mode-Covert-Button{TOP}'
},
agreeModeCovert:{
operation: '299e',
domId: '_Tips-Agree-Mode-Covert{TOP}'
},
applyModeCovert:{
operation: '299f',
domId: '_Tips-Apply-Mode-Covert{TOP}'
},
agreeModeCovertCommit:{
operation: '299g',
domId: '_Tips-Agree-Mode-Covert-Commit{TOP}'
},
applyModeCovertCommit:{
operation: '299g',
domId: '_Tips-Apply-Mode-Covert-Commit{TOP}'
}
}
},
CTCCommand: {