This commit is contained in:
joylink_cuiweidong 2020-07-10 14:46:38 +08:00
commit c432c8ffcb
15 changed files with 86 additions and 41 deletions

View File

@ -130,7 +130,9 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
} }
if(data.type == 'Simulation_Over'){ if(data.type == 'Simulation_Over'){
logout(getToken()).then(() => { logout(getToken()).then(() => {
window.location.reload(); this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}).catch(error => { }).catch(error => {
}); });

View File

@ -124,7 +124,9 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr
} }
if(data.type == 'Simulation_Over'){ if(data.type == 'Simulation_Over'){
logout(getToken()).then(() => { logout(getToken()).then(() => {
window.location.reload(); this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}).catch(error => { }).catch(error => {
}); });

View File

@ -266,6 +266,7 @@ class Painter {
const level = this.mapInstanceLevel[type]; const level = this.mapInstanceLevel[type];
if (level) { if (level) {
level.removeAll(); level.removeAll();
this.$transformHandleScreen.removeType(type);
} }
} }

View File

@ -524,6 +524,7 @@ export default class Switch extends Group {
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
this.recover(); this.recover();
// console.log('定位>', model.normalPosition, '反位>', model.reversePosition);
if (model.normalPosition) { if (model.normalPosition) {
this.setLocationAction(model); /** 定位*/ this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) { } else if (model.reversePosition) {

View File

@ -400,8 +400,8 @@ export default class Train extends Group {
this.isShowShape = false; this.isShowShape = false;
} }
} }
screenShow() { // screenShow() {
// this.text && this.text.hide(); // // this.text && this.text.hide();
this.setState(this.model); // this.setState(this.model);
} // }
} }

View File

@ -29,7 +29,7 @@ class TransformHandle {
} }
} }
// 视图进行缩放/平移 // 视图进行初始化
transformView(view) { transformView(view) {
if (view) { if (view) {
for (let i = 0; i < this.transform.length; i++) { for (let i = 0; i < this.transform.length; i++) {
@ -50,7 +50,7 @@ class TransformHandle {
} }
} }
// 视图进行缩放/平移 // 视图进行平移
transformView1(view) { transformView1(view) {
if (view) { if (view) {
view.transform = this.transform[view.transformIndex]; view.transform = this.transform[view.transformIndex];
@ -104,6 +104,27 @@ class TransformHandle {
this.transformAll1(); this.transformAll1();
} }
removeType(type) {
this.parentLevel.eachChild(level => {
level.eachChild((view) => {
if (view) {
view.transform = this.transform[view.transformIndex];
view.decomposeTransform();
if (view._type == type) {
view.hide();
} else {
if (view.screenShow) {
view.screenShow();
} else {
view.show();
}
}
view.dirty();
}
});
});
}
// 更新画布尺寸 // 更新画布尺寸
updateZrSize(opts) { updateZrSize(opts) {
this.rect = { x: 0, y: 0, width: opts.width, height: opts.height }; this.rect = { x: 0, y: 0, width: opts.width, height: opts.height };

View File

@ -70,7 +70,7 @@ function handle(state, data) {
state.simulationStart = msg; state.simulationStart = msg;
break; break;
case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车 case 'Simulation_Reset': // 仿真-仿真重置消息 退出计划行车
state.simulationReset = 'reset'; state.simulationReset += 1;
break; break;
case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令) case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令)
handleSimulationInfo(state, msg); handleSimulationInfo(state, msg);
@ -221,7 +221,7 @@ const socket = {
simulationError: 0, // 仿真-异常消息 simulationError: 0, // 仿真-异常消息
simulationStart: '', // 仿真-开始消息 simulationStart: '', // 仿真-开始消息
simulationOver:0, // 退出仿真推送消息 simulationOver:0, // 退出仿真推送消息
simulationReset: '', // 仿真-异常消息 simulationReset: 0, // 仿真-异常消息
inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息 inviteOtherIntoChat:{}, // 综合演练仿真-聊天界面用户邀请其他人加入群聊推送信息
acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请, acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请,
quitCoversition:{}, // 综合演练仿真-聊天界面用户退出群聊推送消息, quitCoversition:{}, // 综合演练仿真-聊天界面用户退出群聊推送消息,
@ -335,7 +335,7 @@ const socket = {
}, },
setSimulationReset: ({ commit }) => { setSimulationReset: ({ commit }) => {
commit('setSimulationReset', ''); commit('setSimulationReset', 0);
}, },
setSimulationInvite: ({ commit }) => { setSimulationInvite: ({ commit }) => {

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -1,7 +1,7 @@
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { getBaseUrl } from '@/utils/baseUrl'; import { getBaseUrl } from '@/utils/baseUrl';
import { MessageBox, Message } from 'element-ui'; import { MessageBox } from 'element-ui';
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import SockJS from 'sockjs-client'; import SockJS from 'sockjs-client';
import Stomp from 'stompjs'; import Stomp from 'stompjs';
@ -65,7 +65,7 @@ StompClient.prototype = {
const that = this; const that = this;
this.clientIns.connect({ 'X-Token': getToken() }, () => { this.clientIns.connect({ 'X-Token': getToken() }, () => {
if (notFirstConnect) { if (notFirstConnect) {
setTimeout(()=>{ Message.success('连接成功'); }); // setTimeout(()=>{ Message.success('连接成功'); });
} }
console.info('连接成功.'); console.info('连接成功.');
that.count = 0; that.count = 0;
@ -78,7 +78,7 @@ StompClient.prototype = {
// sock断开回调 // sock断开回调
that.clientIns.ws.onclose = () => { that.clientIns.ws.onclose = () => {
Message.error(`通信连接已断开!`); // Message.error(`通信连接已断开!`);
notFirstConnect = true; notFirstConnect = true;
checkLoginLine().then(() => { checkLoginLine().then(() => {
that.status = false; that.status = false;
@ -121,7 +121,7 @@ StompClient.prototype = {
// 恢复链接 // 恢复链接
reconnect(count) { reconnect(count) {
console.info(`尝试第${count || 1}次连接.`); console.info(`尝试第${count || 1}次连接.`);
Message.warning(`正在尝试第${count || 1}次通讯连接。`); // Message.warning(`正在尝试第${count || 1}次通讯连接。`);
const that = this; const that = this;
setTimeout(() => { setTimeout(() => {
that.connect().then(() => { }).catch(() => { that.connect().then(() => { }).catch(() => {

View File

@ -12,7 +12,7 @@
<!-- <el-button type="primary" @click="raystand">站台选择</el-button> --> <!-- <el-button type="primary" @click="raystand">站台选择</el-button> -->
<el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button> <el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button>
<el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button> <el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button>
<el-button type="primary" @click="back">{{$t('global.back')}}</el-button> <el-button type="primary" @click="back">{{backmsg}}</el-button>
</el-button-group> </el-button-group>
</div> </div>
@ -87,6 +87,7 @@ export default {
cctvbuttonmsg: this.$t('jlmap3d.surveillanceHidden'), cctvbuttonmsg: this.$t('jlmap3d.surveillanceHidden'),
mmishow: false, mmishow: false,
showbuttonmsg: this.$t('jlmap3d.trainInstrumentationDisplay'), showbuttonmsg: this.$t('jlmap3d.trainInstrumentationDisplay'),
backmsg:this.$t('global.back'),
trainnum: '', trainnum: '',
stoptimes: '', stoptimes: '',
dcontrolshow: false, dcontrolshow: false,
@ -175,7 +176,9 @@ export default {
window.datanew = this.datanew; window.datanew = this.datanew;
window.updatestatus = this.updatestatus; window.updatestatus = this.updatestatus;
if(this.$route.query.type == "DRIVE"){
this.backmsg = "退出";
}
// this.$refs.mmiui.init(); // this.$refs.mmiui.init();
}, },
methods: { methods: {
@ -244,7 +247,9 @@ export default {
back() { back() {
if(this.$route.query.type == "DRIVE"){ if(this.$route.query.type == "DRIVE"){
logout(getToken()).then(() => { logout(getToken()).then(() => {
window.location.reload(); this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}).catch(error => { }).catch(error => {
}); });

View File

@ -24,7 +24,7 @@ import { runDiagramIsStart, runDiagramStart, runDiagramOver, runDiagramGetTime }
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat'; import { putJointTrainingSimulationUser } from '@/api/chat';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { EventBus } from '@/scripts/event-bus'; // import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice'; import RealDevice from './menuDraft/realDevice';
@ -302,7 +302,7 @@ export default {
}, },
end() { end() {
this.isDisable = false; this.isDisable = false;
EventBus.$emit('trainView'); // EventBus.$emit('trainView');
runDiagramOver(this.group).catch(() => { runDiagramOver(this.group).catch(() => {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
this.isDisable = true; this.isDisable = true;

View File

@ -188,6 +188,11 @@ export default {
} }
this.setCenter(code); this.setCenter(code);
} }
},
'$store.state.socket.simulationReset': function (val) {
if (val) {
this.simulationReset(val);
}
} }
}, },
created() { created() {
@ -335,6 +340,14 @@ export default {
break; break;
} }
}, },
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');
},
// //
onDataZoom(dataZoom) { onDataZoom(dataZoom) {
this.dataZoom.offsetX = dataZoom.offsetX.toFixed(1) + ''; this.dataZoom.offsetX = dataZoom.offsetX.toFixed(1) + '';

View File

@ -471,11 +471,11 @@ export default {
// Admin Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP // Admin Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP
switch (this.userRole) { switch (this.userRole) {
// case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break; // case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break;
case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); this.drivingShow = false;break; case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); this.drivingShow = false; break;
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp();this.drivingShow = false; break; case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); this.drivingShow = false; break;
case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break; case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break;
case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.hideIbp(); break; case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); break;
case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp();this.drivingShow = false;this.jl3dmaintainershow = true; break; case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp(); this.jl3dmaintainershow = true; break;
} }
if (this.isAdmin && this.adminMode) { if (this.isAdmin && this.adminMode) {
this.$store.dispatch('training/setPrdType', swch || '02'); this.$store.dispatch('training/setPrdType', swch || '02');

View File

@ -34,7 +34,7 @@ import SetTime from '@/views/newMap/displayNew/demon/setTime';
import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation'; import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation';
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
import { getSimulationQrcode } from '@/api/jointSimulation'; import { getSimulationQrcode } from '@/api/jointSimulation';
import { EventBus } from '@/scripts/event-bus'; // import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice'; import RealDevice from './menuDraft/realDevice';
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition'; import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
@ -300,7 +300,7 @@ export default {
}, },
end() { end() {
this.isDisable = false; this.isDisable = false;
EventBus.$emit('trainView'); // EventBus.$emit('trainView');
exitRunPlan(this.group).then(()=>{ exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setRunPlanStatus', false); this.$store.dispatch('map/setRunPlanStatus', false);
}).catch(() => { }).catch(() => {

View File

@ -44,12 +44,12 @@ export default {
if (val) { if (val) {
this.simulationError(val); this.simulationError(val);
} }
},
'$store.state.socket.simulationReset': function (val) {
if (val) {
this.simulationReset(val);
}
} }
// '$store.state.socket.simulationReset': function (val) {
// if (val) {
// this.simulationReset(val);
// }
// }
}, },
mounted() { mounted() {
window.onbeforeunload = this.clearSubscribe; window.onbeforeunload = this.clearSubscribe;
@ -92,14 +92,14 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
async simulationReset() { // async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView'); // await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false); // await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over'); // await this.$store.dispatch('training/over');
await this.$store.dispatch('socket/setSimulationReset'); // await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart'); // await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState'); // await this.$store.dispatch('training/setMapDefaultState');
}, // },
async subscribe() { async subscribe() {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };