This commit is contained in:
zyy 2020-07-28 16:41:36 +08:00
commit 73f3cb0d0d
8 changed files with 56 additions and 19 deletions

View File

@ -102,6 +102,13 @@ export default {
return '';
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show && this.popClass === 'ningbo-01__systerm') {
this.commit();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');

View File

@ -157,6 +157,7 @@ export default {
mounted() {
this.version = this.$store.state.map.version;
this.initMenu();
/* 由于修改角色现行是先取消人员仿真角色后赋予故menuBar会在仿真角色取消时销毁在赋予特定角色是挂载故此处处理 */
if (this.$store.state.socket.simulationRoleList && this.$store.state.socket.simulationRoleList.length) {
this.checkRoleChange(this.$store.state.socket.simulationRoleList);
}

View File

@ -146,6 +146,17 @@ export default {
return list;
}
},
watch: {
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show) {
if (!this.disabledConfirm1) {
this.confirm1();
} else if (!this.disabledConfirm2) {
this.confirm2();
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');

View File

@ -234,7 +234,8 @@ const map = {
holdStatus: false, // 是否有扣车状态
jumpStandList: [], // 跳停站台列表
jumpStatus: false, // 是否有跳停状态
selectDeviceFlag: false // 设备管理激活判断
selectDeviceFlag: false, // 设备管理激活判断
keyboardEnterCount: 0 // 键盘enter键触发
},
getters: {
@ -871,6 +872,9 @@ const map = {
flag: data.flag,
type: data.type
};
},
setKeyboardEnter: (state) => {
state.keyboardEnterCount++;
}
},
@ -1072,6 +1076,9 @@ const map = {
},
selectDeviceCode: ({ commit }, data) => {
commit('selectDeviceCode', data);
},
setKeyboardEnter: ({ commit }) => {
commit('setKeyboardEnter');
}
}
};

View File

@ -65,7 +65,7 @@ export default {
default() {
return 0;
}
},
},
dataError: {
type: Boolean,
default() {
@ -80,7 +80,7 @@ export default {
timeNow: 0, //
time: null, //
countTime: 0, //
remainingTime: 0,
remainingTime: 0,
goodsId: this.$route.query.goodsId,
try: this.$route.query.try, //
training: {
@ -248,7 +248,7 @@ export default {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
},
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then(()=>{
@ -280,6 +280,7 @@ export default {
} else {
await clearSimulation(this.group);
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('map/setShowCentralizedStationCode', '');
history.go(-1);
Notification.closeAll();
});

View File

@ -120,7 +120,7 @@ export default {
}
},
'$store.state.training.rezoomCount': function () {
let code = this.$store.state.training.offsetStationCode; //
let code = this.$store.state.training.offsetStationCode; //
if (code && code.includes('TurnedAround')) { //
const cycleButtonList = this.$store.state.map.map.cycleButtonList;
if (cycleButtonList && cycleButtonList.length > 0) {
@ -262,6 +262,8 @@ export default {
this.$jlmap.on('contextmenu', this.onContextMenu, this);
if (this.$route.path.startsWith('/design/usermap/map/draw')) {
this.$jlmap.on('keyboard', this.onKeyboard, this);
} else {
this.$jlmap.on('keyboard', this.onSimulationKeyboard, this);
}
window.document.oncontextmenu = function () {
return false;
@ -337,6 +339,12 @@ export default {
break;
}
},
onSimulationKeyboard(hook) {
switch (hook) {
case 'Update': this.$store.dispatch('map/setKeyboardEnter');
break;
}
},
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);

View File

@ -123,10 +123,10 @@ export default {
},
project() {
return getSessionStorage('project');
},
isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design'
}
},
isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design';
}
},
watch: {
'$store.state.socket.roleList': function (roleList) { //
@ -224,8 +224,8 @@ export default {
},
selectBeginTime() {
this.$refs.setTime.doShow();
},
// 仿
},
// 仿
start(model) {
this.isDisable = true;
const data = {
@ -268,8 +268,8 @@ export default {
this.isDisable = false;
// EventBus.$emit('trainView');
exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setRunPlanStatus', false);
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/setRunPlanStatus', false);
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/resetActiveTrainList');
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
@ -330,16 +330,16 @@ export default {
}).then(() => {
this.submit();
});
},
// 退
},
// 退
refeeEndCompetition() {
refereeExitSimulation(this.group).then(resp => {
this.$router.replace({ path: `/refereeJsxt/home`, query: { raceId: this.$route.query.raceId } });
}).catch(()=> {
this.$message.success('退出系统失败');
});
},
//
},
//
submit() {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';

View File

@ -135,8 +135,10 @@ export default {
const point = { x: em.clientX, y: em.clientY };
const lineCode = this.$store.getters['map/lineCode'];
if (em.subType === 'TrainWindow') {
device = { _type: deviceType.TrainWindow, code: em.deviceCode };
this.$store.dispatch('map/setTrainWindowShow', true);
if (lineCode != '06') {
device = { _type: deviceType.TrainWindow, code: em.deviceCode };
this.$store.dispatch('map/setTrainWindowShow', true);
}
} else if (em.subType == 'button' && em.deviceType == 'Station') { // 线
const equipment = this.getDeviceByEm(em);
this.$store.dispatch('menuOperation/setSelected', {device:equipment, subType: em.subType});