socket 退出登陆 断开连接

绘图代码调整
This commit is contained in:
joylink_cuiweidong 2020-07-14 11:01:22 +08:00
parent d2f653bc54
commit a462e540fb
2 changed files with 16 additions and 13 deletions

View File

@ -79,6 +79,7 @@ StompClient.prototype = {
// sock断开回调 // sock断开回调
that.clientIns.ws.onclose = () => { that.clientIns.ws.onclose = () => {
// Message.error(`通信连接已断开!`); // Message.error(`通信连接已断开!`);
console.info(`通信连接已断开!`);
notFirstConnect = true; notFirstConnect = true;
checkLoginLine().then(() => { checkLoginLine().then(() => {
that.status = false; that.status = false;
@ -107,16 +108,18 @@ StompClient.prototype = {
}, },
logOut(err) { logOut(err) {
console.info(err); console.info(err);
MessageBox.confirm('你已被登出,请重新登录', '确定登出', { // 退出登陆前断开连接
confirmButtonText: '重新登录', store.dispatch('disconnect').then(()=>{
showCancelButton: false, MessageBox.confirm('你已被登出,请重新登录', '确定登出', {
type: 'warning' confirmButtonText: '重新登录',
}).then(() => { showCancelButton: false,
store.dispatch('FedLogOut').then(() => { type: 'warning'
location.reload();// 为了重新实例化vue-router对象 避免bug }).then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload();// 为了重新实例化vue-router对象 避免bug
});
}); });
}); });
}, },
// 恢复链接 // 恢复链接
reconnect(count) { reconnect(count) {

View File

@ -330,10 +330,10 @@ export default {
return this.editModel.type == '01' || this.editModel.type == '03'; return this.editModel.type == '01' || this.editModel.type == '03';
}, },
leftAxlePositionShow() { leftAxlePositionShow() {
return (this.editModel.type == '01' || this.editModel.type == '03') && this.editModel.leftAxlePosition; return this.hasAssociatedSection && this.editModel.leftAxlePosition;
}, },
rightAxlePositionShow() { rightAxlePositionShow() {
return (this.editModel.type == '01' || this.editModel.type == '03') && this.editModel.rightAxlePosition; return this.hasAssociatedSection && this.editModel.rightAxlePosition;
}, },
isParentCode() { isParentCode() {
return this.editModel.type == '02' || this.editModel.type == '03'; return this.editModel.type == '02' || this.editModel.type == '03';
@ -342,7 +342,7 @@ export default {
return this.editModel.type == '01' && this.editModel.standTrack; return this.editModel.type == '01' && this.editModel.standTrack;
}, },
isreentryTrackName() { isreentryTrackName() {
return this.editModel.type != '02' && this.editModel.type != '03' && this.editModel.reentryTrack; return !this.isParentCode && this.editModel.reentryTrack;
}, },
istransferTrackName() { istransferTrackName() {
return this.editModel.type == '01' && this.editModel.transferTrack; return this.editModel.type == '01' && this.editModel.transferTrack;
@ -351,10 +351,10 @@ export default {
return this.editModel.type == '01' && !this.editModel.reentryTrack; return this.editModel.type == '01' && !this.editModel.reentryTrack;
}, },
isReentryTrackShow() { isReentryTrackShow() {
return this.editModel.type != '02' && this.editModel.type != '03' && !this.editModel.transferTrack; return !this.isParentCode && !this.editModel.transferTrack;
}, },
isdestinationCode() { isdestinationCode() {
return this.editModel.type != '02' && this.editModel.type != '03' && (this.editModel.reentryTrack || this.editModel.transferTrack); return !this.isParentCode && (this.editModel.reentryTrack || this.editModel.transferTrack);
}, },
isStopPointOffset() { isStopPointOffset() {
return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.standTrack || this.editModel.transferTrack); return this.editModel.type !== '04' && (this.editModel.reentryTrack || this.editModel.standTrack || this.editModel.transferTrack);