This commit is contained in:
joylink_cuiweidong 2020-08-27 17:03:24 +08:00
commit 6ac28534ea
6 changed files with 25 additions and 16 deletions

View File

@ -169,11 +169,18 @@ class Jlmap {
}
setCenter(deviceCode) {
const device = this.mapDevice[deviceCode];
if (device && device.instance) {
var rect = createBoundingRect(device.instance);
var dcenter = calculateDCenter(rect, { width: this.$zr.getWidth(), height: this.$zr.getHeight() });
this.setOptions(dcenter);
const arr = Object.keys(this.mapDevice);
if (arr.length != 0) {
const device = this.mapDevice[deviceCode];
if (device && device.instance) {
var rect = createBoundingRect(device.instance);
var dcenter = calculateDCenter(rect, { width: this.$zr.getWidth(), height: this.$zr.getHeight() });
this.setOptions(dcenter);
}
} else {
setTimeout(() => {
this.setCenter(deviceCode);
}, 60);
}
}
setRevoverBigScreen() {

View File

@ -23,7 +23,7 @@ import { Notification } from 'element-ui';
import { startTrainingNew } from '@/api/jmap/training';
import { timeFormat } from '@/utils/date';
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
import { launchFullscreen } from '@/utils/screen';
// import { launchFullscreen } from '@/utils/screen';
export default {
name: 'MenuExam',
@ -154,7 +154,7 @@ export default {
});
},
init() {
launchFullscreen();
// launchFullscreen();
//
refreshExamList(this.$route.query.userExamId).then(response => {
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);

View File

@ -23,7 +23,7 @@
highlight-current
@node-click="getTrainDetail"
>
<span slot-scope="{ node, data }">
<span slot-scope="{ data }">
<span :style="{color: data.usedTime !== undefined ? 'green':''}">&nbsp;{{ trainingList.indexOf(data)+1 }}.{{
data.trainingName }}
</span>
@ -131,7 +131,7 @@ export default {
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function() {
'$store.state.map.mapViewLoadedCount': function() { //
this.$store.dispatch('exam/stopCountTime');
this.loadInitData();
this.$store.dispatch('exam/countUsedTime');
@ -165,7 +165,7 @@ export default {
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
this.$store.dispatch('exam/setCenter', res.data.locateDeviceCode);
// this.$store.dispatch('exam/setCenter', res.data.locateDeviceCode);
}).catch(error => {
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
});

View File

@ -234,9 +234,9 @@ export default {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (!this.planRunning) {
this.$store.dispatch('training/over');
}
// if (!this.planRunning) {
// this.$store.dispatch('training/over');
// }
if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
} else if (this.isScript) {

View File

@ -139,7 +139,10 @@ export default {
});
}
}
this.setCenter(code);
code && this.setCenter(code);
},
'$store.state.map.mapViewLoadedCount': function (val) { //
this.$store.state.exam.deviceCode && this.setCenter(this.$store.state.exam.deviceCode);
},
'$store.state.config.canvasSizeCount': function (val) {
this.resetSize();
@ -352,7 +355,7 @@ export default {
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('training/over');
await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');

View File

@ -38,7 +38,6 @@ export default {
methods: {
tipInit() {
this.$nextTick(() => {
console.log('tipInit',);
this.$store.dispatch('training/isTeachMode').then(() => {
this.tipShow = true;
const offset = this.$store.state.config.canvasOffset;