修改代码
This commit is contained in:
parent
f9129558a6
commit
a60b41398b
@ -64,7 +64,7 @@ class Jlmap {
|
|||||||
|
|
||||||
loadStyle(lineCode) {
|
loadStyle(lineCode) {
|
||||||
return selectLineCode(lineCode);
|
return selectLineCode(lineCode);
|
||||||
}ine
|
}
|
||||||
|
|
||||||
loadDefaultState() {
|
loadDefaultState() {
|
||||||
const defaultStateDict = {};
|
const defaultStateDict = {};
|
||||||
@ -186,8 +186,8 @@ class Jlmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (var prop in elem) {
|
for (var prop in elem) {
|
||||||
if (elem[prop] != oDevice[prop]) {
|
if (oDevice[prop] != elem[prop]) {
|
||||||
deepAssign(oDevice, elem);
|
oDevice[prop] = elem[prop];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,15 +93,11 @@ const exam = {
|
|||||||
setSuspend({ commit }, suspend) {
|
setSuspend({ commit }, suspend) {
|
||||||
commit('setSuspend', suspend);
|
commit('setSuspend', suspend);
|
||||||
},
|
},
|
||||||
setUsedTime({ state }, usedTime) {
|
setUsedTime({ commit }, usedTime) {
|
||||||
if (usedTime) {
|
commit('setUsedTime', usedTime || 0);
|
||||||
state.usedTime = usedTime;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
setTotalTime({ commit }, totalTime) {
|
setTotalTime({ commit }, totalTime) {
|
||||||
if (totalTime) {
|
commit('setTotalTime', totalTime || 0);
|
||||||
commit('setTotalTime', totalTime);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
countUsedTime({ commit }) {
|
countUsedTime({ commit }) {
|
||||||
commit('countUsedTime');
|
commit('countUsedTime');
|
||||||
|
@ -531,6 +531,7 @@ const map = {
|
|||||||
state.map = map;
|
state.map = map;
|
||||||
state.mapDevice = parser(map, map.skinVO.code);
|
state.mapDevice = parser(map, map.skinVO.code);
|
||||||
} else {
|
} else {
|
||||||
|
state.map = null;
|
||||||
state.mapDevice = {};
|
state.mapDevice = {};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
export function getBaseUrl() {
|
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'; // 杜闪
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import store from '../store';
|
import store from '../store';
|
||||||
|
import { i18n } from '@/main.js';
|
||||||
import { MessageBox } from 'element-ui';
|
import { MessageBox } from 'element-ui';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getBaseUrl } from '@/utils/baseUrl';
|
import { getBaseUrl } from '@/utils/baseUrl';
|
||||||
@ -42,8 +43,8 @@ service.interceptors.response.use(
|
|||||||
EventBus.$emit('viewLoading', false);
|
EventBus.$emit('viewLoading', false);
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
EventBus.$emit('clearCheckLogin');
|
EventBus.$emit('clearCheckLogin');
|
||||||
MessageBox.confirm(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
MessageBox.confirm(i18n.t('tip.logoutTips'), i18n.t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('tip.confirmLogin'),
|
confirmButtonText: i18n.t('tip.confirmLogin'),
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -2,24 +2,23 @@ import Vue from 'vue';
|
|||||||
import StompClient from '@/utils/sock';
|
import StompClient from '@/utils/sock';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
|
||||||
export const displayTopic = '/user/queue/simulation'; // 其他仿真topic
|
export const displayTopic = '/user/queue/simulation/design'; // 其他仿真topic
|
||||||
export const planTopic = '/user/queue/simulation/plan'; // 测试运行仿真
|
|
||||||
export const designDisplayTopic = '/user/queue/simulation/design'; // 设计平台仿真订阅路径
|
|
||||||
export const perpetualTopic = '/user/topic/message'; // 公用topic
|
export const perpetualTopic = '/user/topic/message'; // 公用topic
|
||||||
export const commonTopic = '/topic/message'; // 公共topic(不区分用户)
|
export const commonTopic = '/topic/message'; // 公共topic(不区分用户)
|
||||||
|
|
||||||
// 建立连接并订阅地址
|
// 建立连接并订阅地址
|
||||||
export function creatSubscribe(topic, header) {
|
export function creatSubscribe(topic, header) {
|
||||||
// if ([displayTopic, planTopic, designDisplayTopic].includes(topic)) {
|
|
||||||
// topic = `${topic}/${header.group}`;
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!Vue.prototype.$stomp) {
|
if (!Vue.prototype.$stomp) {
|
||||||
Vue.prototype.$stomp = new StompClient();
|
Vue.prototype.$stomp = new StompClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.prototype.$stomp.subscribe(topic, callback, header);
|
Vue.prototype.$stomp.subscribe(
|
||||||
|
// [displayTopic].includes(topic) ? `${topic}/${header.group}` : topic,
|
||||||
|
topic,
|
||||||
|
callback,
|
||||||
|
header
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('websocket订阅失败');
|
console.error('websocket订阅失败');
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
import TipExamList from './tipExamList';
|
import TipExamList from './tipExamList';
|
||||||
import { Notification } from 'element-ui';
|
import { Notification } from 'element-ui';
|
||||||
import { startTraining } from '@/api/jmap/training';
|
import { startTraining } from '@/api/jmap/training';
|
||||||
import { exitFullscreen } from '@/utils/screen';
|
|
||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
|
@ -180,6 +180,7 @@ export default {
|
|||||||
trainingId: '',
|
trainingId: '',
|
||||||
id: ''
|
id: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
|
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
|
||||||
obj.trainingId = this.$route.query.trainingId;
|
obj.trainingId = this.$route.query.trainingId;
|
||||||
obj.id = this.$route.query.examQuestionId;
|
obj.id = this.$route.query.examQuestionId;
|
||||||
@ -260,7 +261,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// exitFullscreen();
|
|
||||||
this.$store.dispatch('exam/over').then(() => {
|
this.$store.dispatch('exam/over').then(() => {
|
||||||
this.$store.dispatch('trainingList/clearTrainingList');
|
this.$store.dispatch('trainingList/clearTrainingList');
|
||||||
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
|
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import MapCommon from './common/index';
|
import MapCommon from './common/index';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { creatSubscribe, clearSubscribe, displayTopic, planTopic, designDisplayTopic} from '@/utils/stomp';
|
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||||
import { sendCommand } from '@/api/jmap/training';
|
import { sendCommand } from '@/api/jmap/training';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
|
||||||
@ -105,21 +105,12 @@ export default {
|
|||||||
async subscribe() {
|
async subscribe() {
|
||||||
this.clearSubscribe();
|
this.clearSubscribe();
|
||||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||||
|
creatSubscribe(displayTopic, header);
|
||||||
if (this.mode === 'plan') {
|
|
||||||
creatSubscribe(planTopic, header);
|
|
||||||
} else {
|
|
||||||
creatSubscribe(this.isDesignPlatform ? designDisplayTopic : displayTopic, header);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.$store.dispatch('training/setHasSubscribed');
|
await this.$store.dispatch('training/setHasSubscribed');
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
if (this.mode === 'plan') {
|
clearSubscribe(displayTopic);
|
||||||
clearSubscribe(planTopic);
|
|
||||||
} else {
|
|
||||||
clearSubscribe(this.isDesignPlatform ? designDisplayTopic : displayTopic);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
sendDeviceChangeEvent(data, header) {
|
sendDeviceChangeEvent(data, header) {
|
||||||
// 发送设备操作事件到服务器
|
// 发送设备操作事件到服务器
|
||||||
|
Loading…
Reference in New Issue
Block a user