Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2023-02-14 14:48:25 +08:00
commit 01aebf47f3
6 changed files with 105 additions and 20 deletions

View File

@ -88,6 +88,11 @@ export default {
] ]
}; };
}, },
computed:{
roleDeviceCode() {
return this.$store.state.training.roleDeviceCode;
}
},
watch: { watch: {
'$store.state.menuOperation.menuCount': function () { '$store.state.menuOperation.menuCount': function () {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) {
@ -100,7 +105,11 @@ export default {
methods: { methods: {
initMenu() { initMenu() {
// //
if (this.selected.code == this.roleDeviceCode) {
this.menu = [...this.menuNormal]; this.menu = [...this.menuNormal];
} else {
this.menu = [];
}
}, },
// //
handleTurnDirection() { handleTurnDirection() {

View File

@ -11,7 +11,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row justify="center" style="text-align: center;margin-bottom: 10px;"> <el-row justify="center" style="text-align: center;margin-bottom: 10px;">
分路不良请输入第1重密码 {{ name+ '请输入第1重密码' }}
</el-row> </el-row>
<el-row justify="center" style="text-align:center;"> <el-row justify="center" style="text-align:center;">
<el-input v-model="passwordCheck" placeholder="" size="medium" type="password" style="width: 180px;display: inline-block;margin-bottom: 10px;" /> <el-input v-model="passwordCheck" placeholder="" size="medium" type="password" style="width: 180px;display: inline-block;margin-bottom: 10px;" />
@ -41,6 +41,7 @@ export default {
return { return {
/* 写死的初始密码*/ /* 写死的初始密码*/
correctPassword: '123', correctPassword: '123',
name:'',
/* 输入值*/ /* 输入值*/
passwordCheck: '', passwordCheck: '',
dialogShow: false, dialogShow: false,
@ -65,6 +66,11 @@ export default {
methods:{ methods:{
doShow(operate) { doShow(operate) {
this.operation = operate.operation; this.operation = operate.operation;
if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
this.name = '取消分路不良';
} else {
this.name = '分路不良';
}
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');

View File

@ -12,7 +12,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row justify="center" class="ForkDirectiveTips"> <el-row justify="center" class="ForkDirectiveTips">
下发 "分路不良" 命令吗 {{ '下发"'+title+'" 命令吗?' }}
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
@ -63,7 +63,13 @@ export default {
doShow(operate, selected) { doShow(operate, selected) {
this.selected = selected; this.selected = selected;
this.operation = operate.operation; this.operation = operate.operation;
if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
this.title = '取消分路不良';
} else {
this.title = '分路不良';
}
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
@ -108,6 +114,14 @@ export default {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE; operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE;
break; break;
} }
case OperationEvent.Section.defectiveShunting.menu.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING;
break;
}
case OperationEvent.Switch.cancelDefectiveShunting.menu.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_CANCEL_DEFECTIVE_SHUNTING;
break;
}
} }
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
}).catch(() => { }).catch(() => {

View File

@ -113,6 +113,7 @@
<pop-menu ref="popMenu" :menu="menu" /> <pop-menu ref="popMenu" :menu="menu" />
<train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" /> <train-route ref="trainRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" /> <shunt-route ref="shuntRoute" @routeCommit="routeCommit" @routeCancel="clearOperate" />
<fork-directive ref="forkDirective" />
</div> </div>
</template> </template>
@ -130,6 +131,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MouseEvent, DeviceMenu } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import {UserOperationType} from '../../../../scripts/ConstDic'; import {UserOperationType} from '../../../../scripts/ConstDic';
import ForkDirective from './dialog/forkDirective';
export default { export default {
name: 'MapButtonMenu', name: 'MapButtonMenu',
components: { components: {
@ -138,7 +140,8 @@ export default {
NoticeInfo, NoticeInfo,
PopMenu, PopMenu,
TrainRoute, TrainRoute,
ShuntRoute ShuntRoute,
ForkDirective
}, },
props: { props: {
selected: { selected: {
@ -795,11 +798,10 @@ export default {
}, },
// //
handelDefectiveShunting(model) { handelDefectiveShunting(model) {
// CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING;
if (model._type == 'Section') { if (model._type == 'Section') {
const operate = { const operate = {
over: true, start: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING, // cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
operation: OperationEvent.Section.defectiveShunting.menu.operation, operation: OperationEvent.Section.defectiveShunting.menu.operation,
userOperationType: UserOperationType.LEFTCLICK, userOperationType: UserOperationType.LEFTCLICK,
param:{ param:{
@ -808,23 +810,25 @@ export default {
} }
}; };
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) { if (valid) {
// } // operate.operation = OperationEvent.Section.defectiveShunting.menu.operation;
this.$refs.forkDirective.doShow(operate, this.selected);
}
}); });
} else if (model._type == 'Switch') { } else if (model._type == 'Switch') {
const operate = { const operate = {
over: true, start: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
operation: OperationEvent.Section.defectiveShunting.menu.operation, operation: OperationEvent.Section.defectiveShunting.menu.operation,
userOperationType: UserOperationType.LEFTCLICK, userOperationType: UserOperationType.LEFTCLICK,
param:{ param:{
sectionCode: model.sectionACode, sectionCode: model.sectionACode
shuntingTypeList:['SWITCH_FRONT_SHUNTING']
} }
}; };
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) { if (valid) {
// } operate.operation = OperationEvent.Switch.defectiveShunting.before.operation;
this.$refs.forkDirective.doShow(operate, this.selected);
}
}); });
} }
this.clearOperate(); this.clearOperate();

View File

@ -366,8 +366,8 @@ export default {
// //
cancleForkDirective() { cancleForkDirective() {
const operate = { const operate = {
over: true, start: true,
cmdType:CMD.Section.CMD_SECTION_CANCEL_DEFECTIVE_SHUNTING, // cmdType:CMD.Section.CMD_SECTION_CANCEL_DEFECTIVE_SHUNTING,
operation: OperationEvent.Switch.cancelDefectiveShunting.menu.operation, operation: OperationEvent.Switch.cancelDefectiveShunting.menu.operation,
userOperationType: UserOperationType.RIGHTCLICK, userOperationType: UserOperationType.RIGHTCLICK,
param:{ param:{
@ -375,8 +375,9 @@ export default {
} }
}; };
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) { if (valid) {
// } this.$refs.forkDirective.doShow(operate, this.selected);
}
}); });
}, },
// //

View File

@ -2,10 +2,21 @@
<div> <div>
<component :is="menus" :selected="selected" /> <component :is="menus" :selected="selected" />
<station-diagram ref="stationDiagram" @setSelected="setSelected" /> <station-diagram ref="stationDiagram" @setSelected="setSelected" />
<div class="changeDriver">
<el-select v-model="currentDriver" placeholder="请选择" style="width: 260px;" @change="changeTrain">
<el-option
v-for="item in trainList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div> </div>
</template> </template>
<script> <script>
import StationDiagram from '../stationDiagram/index'; import StationDiagram from '../stationDiagram/index';
// import {covertMemberData} from '@/utils/simulation';
// import {mapGetters} from 'vuex'; // import {mapGetters} from 'vuex';
import { clearSubscribe, getTopic} from '@/utils/stomp'; import { clearSubscribe, getTopic} from '@/utils/stomp';
export default { export default {
@ -16,7 +27,8 @@ export default {
data() { data() {
return { return {
menus: null, menus: null,
selected: null selected: null,
currentDriver:''
}; };
}, },
computed: { computed: {
@ -28,6 +40,25 @@ export default {
}, },
mapDevice() { mapDevice() {
return this.$store.state.map.mapDevice; return this.$store.state.map.mapDevice;
},
trainList() {
const trainInList = [];
const activeTrainList = this.$store.state.map.activeTrainList;
let train;
activeTrainList.forEach(element => {
train = this.$store.getters['map/getDeviceByCode'](element);
// const nameList = train.nameFormat.split(':');
// let realName = '';
// nameList.forEach(name=>{
// if (name == 'targetCode') {
// realName += train.destinationCode;
// } else {
// realName += train[name] ? train[name] : '';
// }
// });
trainInList.push({value:train.code, label:'表号' + train.serviceNumber + '-车次号' + train.tripNumber + '-车组号' + train.groupNumber});
});
return trainInList;
} }
}, },
watch: { watch: {
@ -38,8 +69,18 @@ export default {
this.menus = this.$theme.loadDriverAtsWorkMenuComponent(lineCode); this.menus = this.$theme.loadDriverAtsWorkMenuComponent(lineCode);
} }
}, },
'$store.state.map.mapViewLoadedCount': function (val) {
this.currentDriver = this.$store.state.training.roleDeviceCode;
this.changeTrain(this.currentDriver);
},
'$store.state.map.initJlmapLoadedCount': function (val) { '$store.state.map.initJlmapLoadedCount': function (val) {
this.handleDispatchWorkData(); this.handleDispatchWorkData();
},
'$store.state.training.roleDeviceCode':function (val) {
if (val) {
this.currentDriver = val;
this.changeTrain(this.currentDriver);
}
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -59,7 +100,17 @@ export default {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint); this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
}); });
},
changeTrain(code) {
this.$jlmap.setCenter(code);
} }
} }
}; };
</script> </script>
<style lang="scss">
.changeDriver{
position: absolute;
left: 42%;
top: 30px;
}
</style>