修改代码
This commit is contained in:
parent
00f0fd84a3
commit
d083482b10
@ -3,8 +3,8 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
||||
} else {
|
||||
|
@ -43,10 +43,8 @@
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
|
||||
</div>
|
||||
|
||||
<Jl3d-Simulation v-show="simulationShow" :panelShow="simulationShow" ref="Jl3dSimulation" @showpanel="showpanel">
|
||||
</Jl3d-Simulation>
|
||||
<Jl3d-Drive v-show="drivingShow" :panelShow="drivingShow" ref="Jl3dDrive" @showdriving="showdriving">
|
||||
</Jl3d-Drive>
|
||||
<Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" />
|
||||
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||
|
||||
<fault-choose ref="faultChoose" :group="group" />
|
||||
<run-plan-Load ref="runPlanLoad" :group="group" />
|
||||
@ -195,13 +193,6 @@ export default {
|
||||
},
|
||||
async created() {
|
||||
this.group = this.$route.query.group || '';
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.loading.close();
|
||||
},
|
||||
async mounted() {
|
||||
this.mode = this.$route.params.mode;
|
||||
|
@ -40,7 +40,7 @@ export default {
|
||||
name: 'MenuDemon',
|
||||
components: {
|
||||
// ChartView,
|
||||
SetTime,
|
||||
SetTime
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
@ -167,7 +167,7 @@ export default {
|
||||
});
|
||||
},
|
||||
handleQuitQuest() {
|
||||
quitScript(this.group).then(resp => {
|
||||
quitScript(this.group).then(resp => {
|
||||
this.$emit('quitQuest');
|
||||
}).catch(() => {
|
||||
this.$messageBox('退出任务失败');
|
||||
|
@ -1,159 +1,158 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset + 'px'}">
|
||||
<el-row style="vertical-align:middle; ">
|
||||
<span class="display-time">{{formatTrainingUsedTime}}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="success" @click="start" :disabled="isDisable" :loading="startLoading">开始</el-button>
|
||||
<el-button type="danger" @click="end" :disabled="!isDisable">结束</el-button>
|
||||
<el-button type="primary" @click="back" class="back">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-exam-list @refresh="refresh"></tip-exam-list>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset + 'px'}">
|
||||
<el-row style="vertical-align:middle; ">
|
||||
<span class="display-time">{{ formatTrainingUsedTime }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="success" :disabled="isDisable" :loading="startLoading" @click="start">开始</el-button>
|
||||
<el-button type="danger" :disabled="!isDisable" @click="end">结束</el-button>
|
||||
<el-button type="primary" class="back" @click="back">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-exam-list @refresh="refresh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TipExamList from './tipExamList';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTraining } from '@/api/jmap/training';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||
import { getTrainingDetail } from '@/api/jmap/training';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import TipExamList from './tipExamList';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTraining } from '@/api/jmap/training';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
|
||||
export default {
|
||||
name: 'MenuExam',
|
||||
components: {
|
||||
TipExamList
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
startLoading: false,
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'mapDeviceStatus'
|
||||
]),
|
||||
formatTrainingUsedTime() {
|
||||
return timeFormat(this.$store.state.training.usedTime);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
const h = this.$createElement;
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作')
|
||||
});
|
||||
}
|
||||
},
|
||||
start() {
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
this.startLoading = true;
|
||||
if (this.$route.query.trainingId) {
|
||||
this.isDisable = true;
|
||||
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
|
||||
this.$store.dispatch('training/examModeStart');
|
||||
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
})
|
||||
})
|
||||
this.startLoading = false;
|
||||
}).catch(error => {
|
||||
this.isDisable = false;
|
||||
this.startLoading = false;
|
||||
})
|
||||
} else {
|
||||
this.startLoading = true;
|
||||
this.$messageBox(`请选择试题`);
|
||||
}
|
||||
},
|
||||
end() {
|
||||
if (this.$route.query.trainingId) {
|
||||
this.isDisable = false;
|
||||
if (this.$store.state.training.started) {
|
||||
let model = {
|
||||
id: this.$route.query.examQuestionId,
|
||||
usedTime: this.$store.state.training.usedTime,
|
||||
group: this.group
|
||||
}
|
||||
export default {
|
||||
name: 'MenuExam',
|
||||
components: {
|
||||
TipExamList
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisable: false,
|
||||
startLoading: false,
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'mapDeviceStatus'
|
||||
]),
|
||||
formatTrainingUsedTime() {
|
||||
return timeFormat(this.$store.state.training.usedTime);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
const h = this.$createElement;
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作')
|
||||
});
|
||||
}
|
||||
},
|
||||
start() {
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
this.startLoading = true;
|
||||
if (this.$route.query.trainingId) {
|
||||
this.isDisable = true;
|
||||
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
|
||||
this.$store.dispatch('training/examModeStart');
|
||||
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
});
|
||||
this.startLoading = false;
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.startLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.startLoading = true;
|
||||
this.$messageBox(`请选择试题`);
|
||||
}
|
||||
},
|
||||
end() {
|
||||
if (this.$route.query.trainingId) {
|
||||
this.isDisable = false;
|
||||
if (this.$store.state.training.started) {
|
||||
const model = {
|
||||
id: this.$route.query.examQuestionId,
|
||||
usedTime: this.$store.state.training.usedTime,
|
||||
group: this.group
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/end', null);
|
||||
finishOneExamQuestion(model).then(response => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.init();
|
||||
}).catch(error => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$messageBox(`结束实训错误`);
|
||||
});
|
||||
} else {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(`请先开始考试`);
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$confirm('是否放弃本次考试?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('quit');
|
||||
this.$router.push({ path: `/exam/home` });
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('training/end', null);
|
||||
finishOneExamQuestion(model).then(response => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.init();
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$messageBox(`结束实训错误`);
|
||||
});
|
||||
} else {
|
||||
this.isDisable = true;
|
||||
this.$messageBox(`请先开始考试`);
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$confirm('是否放弃本次考试?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('quit');
|
||||
this.$router.push({ path: `/exam/home` });
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
init() {
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
launchFullscreen();
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
}).catch(error => {
|
||||
//如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
|
||||
} else {
|
||||
this.$messageBox(`刷新列表失败`);
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
init() {
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
launchFullscreen();
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
|
||||
} else {
|
||||
this.$messageBox(`刷新列表失败`);
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -292,4 +291,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,197 +1,202 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset + 'px'}">
|
||||
<el-row>
|
||||
<el-radio-group class="mode" size="small" v-model="demoMode">
|
||||
<el-radio-button :label="TrainingMode.TEACH">教学模式</el-radio-button>
|
||||
<el-radio-button :label="TrainingMode.PRACTICE">练习模式</el-radio-button>
|
||||
<el-radio-button :label="TrainingMode.TEST">测验模式</el-radio-button>
|
||||
</el-radio-group>
|
||||
<span class="display-time">{{formatUsedTime}}</span>
|
||||
<span class="display-score" v-if="demoMode === TrainingMode.TEST">得分:{{formatScore}}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="success" @click="start" :disabled="isDisable" :loading="startLoading">开始</el-button>
|
||||
<el-button type="danger" @click="end" class="end" :disabled="!isDisable">结束</el-button>
|
||||
<el-button type="primary" @click="back" :disabled="backDisable" class="back">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-training-detail :trainingObj="trainingObj"></tip-training-detail>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset + 'px'}">
|
||||
<el-row>
|
||||
<el-radio-group v-model="demoMode" class="mode" size="small">
|
||||
<el-radio-button :label="TrainingMode.TEACH">教学模式</el-radio-button>
|
||||
<el-radio-button :label="TrainingMode.PRACTICE">练习模式</el-radio-button>
|
||||
<el-radio-button :label="TrainingMode.TEST">测验模式</el-radio-button>
|
||||
</el-radio-group>
|
||||
<span class="display-time">{{ formatUsedTime }}</span>
|
||||
<span v-if="demoMode === TrainingMode.TEST" class="display-score">得分:{{ formatScore }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="success" :disabled="isDisable" :loading="startLoading" @click="start">开始</el-button>
|
||||
<el-button type="danger" class="end" :disabled="!isDisable" @click="end">结束</el-button>
|
||||
<el-button type="primary" :disabled="backDisable" class="back" @click="back">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-training-detail :training-obj="trainingObj" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TipTrainingDetail from './tipTrainingDetail';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTraining, endTraining } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import TipTrainingDetail from './tipTrainingDetail';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTraining, endTraining } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'MenuLesson',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
trainingObj: {
|
||||
type: Object
|
||||
},
|
||||
offset: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
components: {
|
||||
TipTrainingDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeInterval: null,
|
||||
TrainingMode: TrainingMode,
|
||||
demoMode: TrainingMode.TEACH,
|
||||
isDisable: false,
|
||||
backDisable: false,
|
||||
startLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'mapDeviceStatus'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'score',
|
||||
'started',
|
||||
'usedTime',
|
||||
'basicInfo'
|
||||
]),
|
||||
formatScore() {
|
||||
return this.score;
|
||||
},
|
||||
formatUsedTime() {
|
||||
return timeFormat(this.usedTime);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
demoMode: function (val) {
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/reset');
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
export default {
|
||||
name: 'MenuLesson',
|
||||
components: {
|
||||
TipTrainingDetail
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
trainingObj: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeInterval: null,
|
||||
TrainingMode: TrainingMode,
|
||||
demoMode: TrainingMode.TEACH,
|
||||
isDisable: false,
|
||||
backDisable: false,
|
||||
startLoading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'mapDeviceStatus'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'score',
|
||||
'started',
|
||||
'usedTime',
|
||||
'basicInfo'
|
||||
]),
|
||||
formatScore() {
|
||||
return this.score;
|
||||
},
|
||||
formatUsedTime() {
|
||||
return timeFormat(this.usedTime);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
demoMode: function (val) {
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/reset');
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
|
||||
this.isDisable = false;
|
||||
},
|
||||
'$store.state.training.operateErrMsg': function (val) {
|
||||
this.tipInfo({ color: val.color, message: val.errMsg });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
const h = this.$createElement;
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: h('i', { style: 'color:' + opt.color }, opt.message)
|
||||
});
|
||||
}
|
||||
},
|
||||
start() {
|
||||
//清空按钮操作
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
this.startLoading = true;
|
||||
if (this.trainingObj && this.trainingObj.id) {
|
||||
this.isDisable = true;
|
||||
startTraining(this.trainingObj, this.group).then(response => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
this.$store.dispatch('training/teachModeStart', this.demoMode);
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.tipInfo({ color: 'green', message: '请开始操作' });
|
||||
});
|
||||
});
|
||||
this.startLoading = false;
|
||||
}).catch(error => {
|
||||
this.isDisable = false;
|
||||
this.startLoading = false;
|
||||
})
|
||||
} else {
|
||||
this.startLoading = false;
|
||||
this.$messageBox(`请选择实训`);
|
||||
}
|
||||
},
|
||||
endCommit() {
|
||||
this.$store.dispatch('training/setStopCountTime');
|
||||
let mode = {
|
||||
mode: this.demoMode,
|
||||
id: this.trainingObj.id,
|
||||
lessonId: this.$route.query.lessonId,
|
||||
usedTime: this.usedTime
|
||||
}
|
||||
this.isDisable = false;
|
||||
},
|
||||
'$store.state.training.operateErrMsg': function (val) {
|
||||
this.tipInfo({ color: val.color, message: val.errMsg });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
const h = this.$createElement;
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: h('i', { style: 'color:' + opt.color }, opt.message)
|
||||
});
|
||||
}
|
||||
},
|
||||
start() {
|
||||
// 清空按钮操作
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
this.startLoading = true;
|
||||
if (this.trainingObj && this.trainingObj.id) {
|
||||
this.isDisable = true;
|
||||
startTraining(this.trainingObj, this.group).then(response => {
|
||||
debugger;
|
||||
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
this.$store.dispatch('training/teachModeStart', this.demoMode);
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.tipInfo({ color: 'green', message: '请开始操作' });
|
||||
});
|
||||
});
|
||||
this.startLoading = false;
|
||||
}).catch(() => {
|
||||
this.isDisable = false;
|
||||
this.startLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.startLoading = false;
|
||||
this.$messageBox(`请选择实训`);
|
||||
}
|
||||
},
|
||||
endCommit() {
|
||||
this.$store.dispatch('training/setStopCountTime');
|
||||
const mode = {
|
||||
mode: this.demoMode,
|
||||
id: this.trainingObj.id,
|
||||
lessonId: this.$route.query.lessonId,
|
||||
usedTime: this.usedTime
|
||||
};
|
||||
|
||||
endTraining(mode, this.group).then(response => {
|
||||
let data = response.data;
|
||||
this.$store.dispatch('training/judgeFinish', data).then(rsp => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$messageBox(`结束实训错误`);
|
||||
});
|
||||
},
|
||||
end() {
|
||||
//如果是测试模式需要获取最终的得分
|
||||
if (this.trainingObj && this.trainingObj.id) {
|
||||
if (this.started) {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/isStepOver').then((rnt) => {
|
||||
if (rnt) {
|
||||
this.endCommit();
|
||||
} else {
|
||||
this.backDisable = true;
|
||||
this.$confirm('操作未完成,是否确认结束?', '提示', {
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
center: true,
|
||||
zIndex: 9999
|
||||
}).then(() => {
|
||||
this.backDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/setScore', 0);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
}).catch(() => {
|
||||
this.isDisable = true;
|
||||
this.backDisable = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(`请先开始实训`);
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$emit('quit');
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
endTraining(mode, this.group).then(response => {
|
||||
const data = response.data;
|
||||
this.$store.dispatch('training/judgeFinish', data).then(rsp => {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(`结束实训错误`);
|
||||
});
|
||||
},
|
||||
end() {
|
||||
// 如果是测试模式需要获取最终的得分
|
||||
if (this.trainingObj && this.trainingObj.id) {
|
||||
if (this.started) {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/isStepOver').then((rnt) => {
|
||||
if (rnt) {
|
||||
this.endCommit();
|
||||
} else {
|
||||
this.backDisable = true;
|
||||
this.$confirm('操作未完成,是否确认结束?', '提示', {
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
center: true,
|
||||
zIndex: 9999
|
||||
}).then(() => {
|
||||
this.backDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/setScore', 0);
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
}).catch(() => {
|
||||
this.isDisable = true;
|
||||
this.backDisable = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(`请先开始实训`);
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$emit('quit');
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
|
||||
if (this.$route.params.mode == 'record') {
|
||||
/** 如果是演示返回时,需要重新创建仿真*/
|
||||
trainingNotify({ trainingId: this.$route.query.trainingId }).then(resp => {
|
||||
this.$router.push({ path: `${UrlConfig.lesson.record}/${this.$route.query.trainingId}/${this.$route.query.trainingName}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
})
|
||||
} else {
|
||||
history.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.$route.params.mode == 'record') {
|
||||
/** 如果是演示返回时,需要重新创建仿真*/
|
||||
trainingNotify({ trainingId: this.$route.query.trainingId }).then(resp => {
|
||||
this.$router.push({ path: `${UrlConfig.lesson.record}/${this.$route.query.trainingId}/${this.$route.query.trainingName}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
history.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -265,4 +270,4 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,119 +1,118 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset+'px'}">
|
||||
<el-row>
|
||||
<span class="display-score" v-if="countTime">试用时间:{{ countTime }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<div>
|
||||
<div class="display-card" :style="{top: offset+'px'}">
|
||||
<el-row>
|
||||
<span v-if="countTime" class="display-score">试用时间:{{ countTime }}</span>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getGoodsTryUse } from '@/api/management/goods'
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { getCountTime } from '@/utils/index';
|
||||
import { runDiagramIsStart, runDiagramGetTime, runDiagramStart } from '@/api/simulation';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { getCountTime } from '@/utils/index';
|
||||
import { runDiagramIsStart, runDiagramGetTime, runDiagramStart } from '@/api/simulation';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'MenuScreen',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tryTime: 0, // 进入页面多少秒
|
||||
timeNow: 0, // 进入页面 相对时间
|
||||
time: null, // 定时器
|
||||
countTime: 0, // 显示 倒计时
|
||||
remainingTime: 0,
|
||||
goodsId: this.$route.query.goodsId,
|
||||
try: this.$route.query.try, // 是否是试用权限
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.subscribeCount': function () {
|
||||
this.group && this.initLoadPage();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.time) {
|
||||
this.setTryTime();
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
if (this.try != '0') {
|
||||
const data = {
|
||||
productType: PermissionType.SCREEN
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'MenuScreen',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tryTime: 0, // 进入页面多少秒
|
||||
timeNow: 0, // 进入页面 相对时间
|
||||
time: null, // 定时器
|
||||
countTime: 0, // 显示 倒计时
|
||||
remainingTime: 0,
|
||||
goodsId: this.$route.query.goodsId,
|
||||
try: this.$route.query.try, // 是否是试用权限
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.subscribeCount': function () {
|
||||
this.group && this.initLoadPage()
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.time) {
|
||||
this.setTryTime();
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
try {
|
||||
if (this.try != '0') {
|
||||
let data = {
|
||||
productType: PermissionType.SCREEN
|
||||
};
|
||||
const resr = await getGoodsTryUse(data);
|
||||
if (resr && resr.code == 200) {
|
||||
this.remainingTime = resr.data.tryTime;
|
||||
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
|
||||
if (this.try) {
|
||||
this.time = setInterval(() => {
|
||||
this.tryTime += 1;
|
||||
this.countTime = getCountTime(this.timeNow);
|
||||
if (this.countTime == -1) {
|
||||
this.back();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(`获取时间失败`);
|
||||
}
|
||||
}
|
||||
|
||||
let resr = await getGoodsTryUse(data);
|
||||
if (resr && resr.code == 200) {
|
||||
this.remainingTime = resr.data.tryTime;
|
||||
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
|
||||
if (this.try) {
|
||||
this.time = setInterval(() => {
|
||||
this.tryTime += 1;
|
||||
this.countTime = getCountTime(this.timeNow);
|
||||
if (this.countTime == -1) {
|
||||
this.back();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(`获取时间失败`);
|
||||
}
|
||||
}
|
||||
const initTime = this.$route.query.initTime;
|
||||
const retp = await runDiagramIsStart(this.group);
|
||||
if (retp && !retp.data) {
|
||||
await runDiagramStart({ initTime: initTime }, this.group);
|
||||
}
|
||||
|
||||
let initTime = this.$route.query.initTime;
|
||||
let retp = await runDiagramIsStart(this.group);
|
||||
if (retp && !retp.data) {
|
||||
await runDiagramStart({ initTime: initTime }, this.group);
|
||||
}
|
||||
|
||||
await this.$store.dispatch('training/simulationStart');
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
let rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
setTryTime() {
|
||||
if (this.try) {
|
||||
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
Notification.closeAll();
|
||||
history.go(-1);
|
||||
exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
await this.$store.dispatch('training/simulationStart');
|
||||
await this.loadSystemTime();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async loadSystemTime() {
|
||||
const rest = await runDiagramGetTime(this.group);
|
||||
if (rest && rest.code == 200) {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
|
||||
}
|
||||
},
|
||||
setTryTime() {
|
||||
if (this.try) {
|
||||
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
Notification.closeAll();
|
||||
history.go(-1);
|
||||
exitFullscreen();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -123,9 +122,7 @@
|
||||
display: inline;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
float: left;
|
||||
left: 30px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.display-card .el-row {
|
||||
@ -153,4 +150,4 @@
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,42 +1,50 @@
|
||||
<template>
|
||||
<div class="display-card" :style="{top: offset+'px'}" v-if="isShowSystemTime">
|
||||
<system-time class="time" v-if="isShowSystemTime" :time="time" :zoom="1.3" :width="110" :height="32" :fine="2"
|
||||
:top="2"></system-time>
|
||||
</div>
|
||||
<div v-if="isShowSystemTime" class="display-card" :style="{top: offset+'px'}">
|
||||
<system-time
|
||||
v-if="isShowSystemTime"
|
||||
class="time"
|
||||
:time="time"
|
||||
:zoom="1.3"
|
||||
:width="110"
|
||||
:height="32"
|
||||
:fine="2"
|
||||
:top="2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { prefixIntrger } from '@/utils/date';
|
||||
import SystemTime from '@/views/components/systemTime/index';
|
||||
import { prefixIntrger } from '@/utils/date';
|
||||
import SystemTime from '@/views/components/systemTime/index';
|
||||
|
||||
export default {
|
||||
name: 'MenuSystemTime',
|
||||
props: {
|
||||
offset: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SystemTime
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
time: '00:0000',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.initTime': function (initTime) {
|
||||
let date = new Date(initTime);
|
||||
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowSystemTime() {
|
||||
return this.$route.params.mode == 'demon' || this.$route.params.mode == 'dp' || this.$route.params.mode == 'plan' || !this.$route.params.mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'MenuSystemTime',
|
||||
components: {
|
||||
SystemTime
|
||||
},
|
||||
props: {
|
||||
offset: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
time: '00:0000'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isShowSystemTime() {
|
||||
return this.$route.params.mode == 'demon' || this.$route.params.mode == 'dp' || this.$route.params.mode == 'plan' || !this.$route.params.mode;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.training.initTime': function (initTime) {
|
||||
const date = new Date(initTime);
|
||||
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -75,4 +83,4 @@
|
||||
right: 40px;
|
||||
bottom: 28px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,272 +1,277 @@
|
||||
<template>
|
||||
<div class="reminder-drag" v-drag>
|
||||
<div class="reminder-box" ref="drapBox">
|
||||
<div class="tip-title">
|
||||
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
|
||||
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
|
||||
<p style="color: #fff;" v-if="!isShrink">
|
||||
<span class="time-label">考试计时:</span>
|
||||
<span class="time-elem">{{formatExamUsedTime}}</span>
|
||||
</p>
|
||||
<p style="color: #fff;" v-if="isShrink">
|
||||
<span>{{examName}}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body" v-show="detailShow">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<el-tree ref="treeQuestion" :data="trainingList" node-key="id" highlight-current
|
||||
@node-click="getTrainDetail">
|
||||
<span slot-scope="{ node, data }">
|
||||
<span :style="{color: data.usedTime !== undefined ? 'green':''}"> {{trainingList.indexOf(data)+1}}.{{
|
||||
data.trainingName}}
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="tip-body" v-show="!detailShow">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">本题名称:</span>
|
||||
<span class="list-elem">{{ courseModel.name }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最佳用时:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最大用时:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label"> 实训说明:</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="tip-foot">
|
||||
<div class="foot-detail" v-show="!detailShow">
|
||||
<el-button class="btn" @click="backList">查看试题</el-button>
|
||||
<el-button class="btn" type="primary" @click="lastExam" v-if="!isFirst">上一题</el-button>
|
||||
<el-button class="btn" type="primary" @click="nextExam" v-if="!isLast">下一题</el-button>
|
||||
<el-button class="btn" type="primary" @click="overExam" v-if="isLast">提交试卷</el-button>
|
||||
</div>
|
||||
<div class="foot-submit" v-show="detailShow">
|
||||
<el-button class="btn" type="primary" @click="overExam">提交试卷</el-button>
|
||||
</div>
|
||||
<p style="color: #000; float: left;">
|
||||
<span class="time-label">考试计时:</span>
|
||||
<span class="time-elem">{{formatExamUsedTime}}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="drag-right"></div>
|
||||
<div class="drag-left"></div>
|
||||
<div class="drag-bottom"></div>
|
||||
<div class="drag-top"></div>
|
||||
</div>
|
||||
<div v-drag class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="!isShrink" style="color: #fff;">
|
||||
<span class="time-label">考试计时:</span>
|
||||
<span class="time-elem">{{ formatExamUsedTime }}</span>
|
||||
</p>
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ examName }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div v-show="detailShow" class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-tree
|
||||
ref="treeQuestion"
|
||||
:data="trainingList"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
@node-click="getTrainDetail"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span :style="{color: data.usedTime !== undefined ? 'green':''}"> {{ trainingList.indexOf(data)+1 }}.{{
|
||||
data.trainingName }}
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div v-show="!detailShow" class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">本题名称:</span>
|
||||
<span class="list-elem">{{ courseModel.name }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最佳用时:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最大用时:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label"> 实训说明:</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="tip-foot">
|
||||
<div v-show="!detailShow" class="foot-detail">
|
||||
<el-button class="btn" @click="backList">查看试题</el-button>
|
||||
<el-button v-if="!isFirst" class="btn" type="primary" @click="lastExam">上一题</el-button>
|
||||
<el-button v-if="!isLast" class="btn" type="primary" @click="nextExam">下一题</el-button>
|
||||
<el-button v-if="isLast" class="btn" type="primary" @click="overExam">提交试卷</el-button>
|
||||
</div>
|
||||
<div v-show="detailShow" class="foot-submit">
|
||||
<el-button class="btn" type="primary" @click="overExam">提交试卷</el-button>
|
||||
</div>
|
||||
<p style="color: #000; float: left;">
|
||||
<span class="time-label">考试计时:</span>
|
||||
<span class="time-elem">{{ formatExamUsedTime }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="drag-right" />
|
||||
<div class="drag-left" />
|
||||
<div class="drag-bottom" />
|
||||
<div class="drag-top" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList } from '@/api/management/userexam';
|
||||
import { getTrainingDetail } from '@/api/jmap/training';
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList } from '@/api/management/userexam';
|
||||
import { getTrainingDetail } from '@/api/jmap/training';
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
|
||||
export default {
|
||||
name: 'TipExamList',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
isShrink: false,
|
||||
examName: '',
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
},
|
||||
detailShow: false,
|
||||
examIndex: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('trainingList', [
|
||||
'trainingList',
|
||||
]),
|
||||
formatExamUsedTime() {
|
||||
return timeFormat(this.$store.state.exam.usedTime);
|
||||
},
|
||||
isFirst() {
|
||||
return this.examIndex == 0;
|
||||
},
|
||||
isLast() {
|
||||
return this.examIndex == this.trainingList.length - 1;
|
||||
},
|
||||
export default {
|
||||
name: 'TipExamList',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
isShrink: false,
|
||||
examName: '',
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
},
|
||||
detailShow: false,
|
||||
examIndex: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('trainingList', [
|
||||
'trainingList'
|
||||
]),
|
||||
formatExamUsedTime() {
|
||||
return timeFormat(this.$store.state.exam.usedTime);
|
||||
},
|
||||
isFirst() {
|
||||
return this.examIndex == 0;
|
||||
},
|
||||
isLast() {
|
||||
return this.examIndex == this.trainingList.length - 1;
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
backList() {
|
||||
this.detailShow = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value 绑定的node-key
|
||||
});
|
||||
},
|
||||
// 获取试题详情
|
||||
selectedTraining(obj) {
|
||||
this.trainingList.forEach((item, index) => {
|
||||
if (item.id == obj.id) {
|
||||
this.examIndex = index;
|
||||
return;
|
||||
}
|
||||
})
|
||||
if (obj) {
|
||||
let that = this;
|
||||
let data = { id: obj.trainingId };
|
||||
getTrainingDetail(data).then(res => {
|
||||
that.courseModel = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
maxDuration: res.data.maxDuration,
|
||||
remarks: res.data.remarks,
|
||||
minDuration: res.data.minDuration,
|
||||
updateTime: res.data.updateTime,
|
||||
};
|
||||
}).catch(error => {
|
||||
that.$message.error('获取试题息失败:' + error.message)
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
backList() {
|
||||
this.detailShow = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value 绑定的node-key
|
||||
});
|
||||
},
|
||||
// 获取试题详情
|
||||
selectedTraining(obj) {
|
||||
this.trainingList.forEach((item, index) => {
|
||||
if (item.id == obj.id) {
|
||||
this.examIndex = index;
|
||||
return;
|
||||
}
|
||||
});
|
||||
if (obj) {
|
||||
const that = this;
|
||||
const data = { id: obj.trainingId };
|
||||
getTrainingDetail(data).then(res => {
|
||||
that.courseModel = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
maxDuration: res.data.maxDuration,
|
||||
remarks: res.data.remarks,
|
||||
minDuration: res.data.minDuration,
|
||||
updateTime: res.data.updateTime
|
||||
};
|
||||
}).catch(error => {
|
||||
that.$message.error('获取试题息失败:' + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
this.jump(obj);
|
||||
},
|
||||
getTrainDetail(obj) {
|
||||
this.selectedTraining(obj);
|
||||
this.detailShow = false;
|
||||
},
|
||||
// 获取试题列表
|
||||
loadInitData() {
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.examName = response.data.examName;
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
let obj = {
|
||||
trainingId: '',
|
||||
id: '',
|
||||
}
|
||||
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
|
||||
obj.trainingId = this.$route.query.trainingId;
|
||||
obj.id = this.$route.query.examQuestionId;
|
||||
} else {
|
||||
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
|
||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||
}
|
||||
this.selectedTraining(obj);
|
||||
}).catch(error => {
|
||||
//如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
|
||||
} else {
|
||||
this.$messageBox(`刷新列表失败`);
|
||||
}
|
||||
});
|
||||
this.jump(obj);
|
||||
},
|
||||
getTrainDetail(obj) {
|
||||
this.selectedTraining(obj);
|
||||
this.detailShow = false;
|
||||
},
|
||||
// 获取试题列表
|
||||
loadInitData() {
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.examName = response.data.examName;
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
id: ''
|
||||
};
|
||||
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
|
||||
obj.trainingId = this.$route.query.trainingId;
|
||||
obj.id = this.$route.query.examQuestionId;
|
||||
} else {
|
||||
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
|
||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||
}
|
||||
this.selectedTraining(obj);
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
|
||||
} else {
|
||||
this.$messageBox(`刷新列表失败`);
|
||||
}
|
||||
});
|
||||
|
||||
this.shrink();
|
||||
},
|
||||
nextExam() {
|
||||
let obj = {
|
||||
trainingId: '',
|
||||
id: '',
|
||||
}
|
||||
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
|
||||
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
|
||||
obj.id = this.trainingList[this.examIndex + 1].id;
|
||||
this.examIndex = this.examIndex + 1;
|
||||
}
|
||||
if (obj.trainingId && obj.id) {
|
||||
this.selectedTraining(obj);
|
||||
}
|
||||
},
|
||||
lastExam() {
|
||||
let obj = {
|
||||
trainingId: '',
|
||||
id: '',
|
||||
}
|
||||
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
|
||||
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
|
||||
obj.id = this.trainingList[this.examIndex - 1].id;
|
||||
this.examIndex = this.examIndex - 1;
|
||||
}
|
||||
if (obj.trainingId && obj.id) {
|
||||
this.selectedTraining(obj);
|
||||
}
|
||||
},
|
||||
jump(obj) {
|
||||
let query = {
|
||||
group: this.$route.query.group,
|
||||
userExamId: this.$route.query.userExamId,
|
||||
trainingId: obj.trainingId,
|
||||
examQuestionId: obj.id
|
||||
}
|
||||
this.$router.push({ path: '/display/exam', query: query });
|
||||
this.$emit('refresh');
|
||||
launchFullscreen();
|
||||
},
|
||||
overExam() {
|
||||
this.$store.dispatch('exam/isOver').then(isOver => {
|
||||
if (isOver) {
|
||||
this.submit();
|
||||
} else {
|
||||
this.$confirm('考试未完成,是否确认退出?', '提示', {
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
this.submit();
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
exitFullscreen();
|
||||
this.$store.dispatch('exam/over').then(() => {
|
||||
this.$store.dispatch('trainingList/clearTrainingList');
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.query.userExamId}` });
|
||||
});
|
||||
},
|
||||
shrink() {
|
||||
let height = this.$refs.dragBody.offsetHeight + 40;
|
||||
let top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.shrink();
|
||||
},
|
||||
nextExam() {
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
id: ''
|
||||
};
|
||||
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
|
||||
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
|
||||
obj.id = this.trainingList[this.examIndex + 1].id;
|
||||
this.examIndex = this.examIndex + 1;
|
||||
}
|
||||
if (obj.trainingId && obj.id) {
|
||||
this.selectedTraining(obj);
|
||||
}
|
||||
},
|
||||
lastExam() {
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
id: ''
|
||||
};
|
||||
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
|
||||
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
|
||||
obj.id = this.trainingList[this.examIndex - 1].id;
|
||||
this.examIndex = this.examIndex - 1;
|
||||
}
|
||||
if (obj.trainingId && obj.id) {
|
||||
this.selectedTraining(obj);
|
||||
}
|
||||
},
|
||||
jump(obj) {
|
||||
const query = {
|
||||
group: this.$route.query.group,
|
||||
userExamId: this.$route.query.userExamId,
|
||||
trainingId: obj.trainingId,
|
||||
examQuestionId: obj.id
|
||||
};
|
||||
this.$router.push({ path: '/display/exam', query: query });
|
||||
this.$emit('refresh');
|
||||
launchFullscreen();
|
||||
},
|
||||
overExam() {
|
||||
this.$store.dispatch('exam/isOver').then(isOver => {
|
||||
if (isOver) {
|
||||
this.submit();
|
||||
} else {
|
||||
this.$confirm('考试未完成,是否确认退出?', '提示', {
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
this.submit();
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
exitFullscreen();
|
||||
this.$store.dispatch('exam/over').then(() => {
|
||||
this.$store.dispatch('trainingList/clearTrainingList');
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.query.userExamId}` });
|
||||
});
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -388,4 +393,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,129 +1,127 @@
|
||||
<template>
|
||||
<div class="reminder-drag">
|
||||
<div class="reminder-box" ref="drapBox">
|
||||
<div class="tip-title">
|
||||
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
|
||||
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
|
||||
<p style="color: #fff;" v-if="isShrink">
|
||||
<span>{{ title }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group"></get-action>
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
|
||||
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ title }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group" />
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
<el-button type="primary" @click="saveMaplocation">{{ $t('scriptRecord.saveMaplocation') }}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
|
||||
<el-button type="success" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,updateMapLocation} from '@/api/simulation';
|
||||
import Vue from 'vue';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
GetAction,
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title:"剧本编制",
|
||||
isShrink: false,
|
||||
mapLocation:{},
|
||||
// isSaveStage: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted(){
|
||||
this.shrink();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
let height = this.$refs.dragBody.offsetHeight + 40;
|
||||
let top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$message.success('保存背景成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
})
|
||||
},
|
||||
saveScenesData() {
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
})
|
||||
},
|
||||
dumpScenesData() {
|
||||
let group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
// this.isSaveStage = true;
|
||||
this.$message.success('清除数据成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox('清除数据失败!');
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
let data=Vue.prototype.$jlmap.$options;
|
||||
let group=this.$route.query.group;
|
||||
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
|
||||
updateMapLocation(group,dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
components: {
|
||||
GetAction
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title: '剧本编制',
|
||||
isShrink: false,
|
||||
mapLocation: {}
|
||||
// isSaveStage: true,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.shrink();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$message.success('保存背景成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
});
|
||||
},
|
||||
saveScenesData() {
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
});
|
||||
},
|
||||
dumpScenesData() {
|
||||
const group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
// this.isSaveStage = true;
|
||||
this.$message.success('清除数据成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('清除数据失败!');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
saveMaplocation() {
|
||||
const data=Vue.prototype.$jlmap.$options;
|
||||
const group=this.$route.query.group;
|
||||
const dataZoom={scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
|
||||
updateMapLocation(group, dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -212,4 +210,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,149 +1,150 @@
|
||||
<template>
|
||||
<div class="reminder-drag" v-drag>
|
||||
<div class="reminder-box" ref="drapBox">
|
||||
<div class="tip-title">
|
||||
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
|
||||
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
|
||||
<p style="color: #fff;" v-if="isShrink">
|
||||
<span>{{lessonName}}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">实训名称:</span>
|
||||
<span class="list-elem">{{ courseModel.name }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最佳用时:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最大用时:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label"> 实训说明:</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="drag-right"></div>
|
||||
<div class="drag-left"></div>
|
||||
<div class="drag-bottom"></div>
|
||||
<div class="drag-top"></div>
|
||||
</div>
|
||||
<div v-drag class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ lessonName }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">实训名称:</span>
|
||||
<span class="list-elem">{{ courseModel.name }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最佳用时:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">最大用时:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }}秒 </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label"> 实训说明:</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="drag-right" />
|
||||
<div class="drag-left" />
|
||||
<div class="drag-bottom" />
|
||||
<div class="drag-top" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { getTrainingDetail, trainingNotify } from '@/api/jmap/training';
|
||||
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
|
||||
export default {
|
||||
name: 'TipTrainingDetail',
|
||||
props: {
|
||||
trainingObj: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
isShrink: false,
|
||||
lessonName: '',
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
skinCode: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
},
|
||||
showSumbit: false,
|
||||
lessonIndex: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('trainingList', [
|
||||
'trainingList',
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'trainingObj': function (val) {
|
||||
if (val) {
|
||||
this.courseModel = {
|
||||
id: val.id,
|
||||
name: val.name,
|
||||
skinCode: val.skinCode,
|
||||
maxDuration: val.maxDuration,
|
||||
minDuration: val.minDuration,
|
||||
remarks: val.remarks,
|
||||
updateTime: val.updateTime
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
this.showSumbit = false;
|
||||
this.lessonName = '';
|
||||
this.courseModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
};
|
||||
export default {
|
||||
name: 'TipTrainingDetail',
|
||||
props: {
|
||||
trainingObj: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
isShrink: false,
|
||||
lessonName: '',
|
||||
courseModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
skinCode: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
},
|
||||
showSumbit: false,
|
||||
lessonIndex: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('trainingList', [
|
||||
'trainingList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'trainingObj': function (val) {
|
||||
if (val) {
|
||||
this.courseModel = {
|
||||
id: val.id,
|
||||
name: val.name,
|
||||
skinCode: val.skinCode,
|
||||
maxDuration: val.maxDuration,
|
||||
minDuration: val.minDuration,
|
||||
remarks: val.remarks,
|
||||
updateTime: val.updateTime
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
this.showSumbit = false;
|
||||
this.lessonName = '';
|
||||
this.courseModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
maxDuration: '',
|
||||
minDuration: '',
|
||||
remarks: '',
|
||||
updateTime: ''
|
||||
};
|
||||
|
||||
if (parseInt(obj.lessonId)) {
|
||||
getPublishLessonDetail({ id: obj.lessonId }).then(response => {
|
||||
this.lessonName = response.data.name;
|
||||
}).catch(error => {
|
||||
that.$message.error("获取课程信息失败:" + error.message);
|
||||
});
|
||||
}
|
||||
if (parseInt(obj.lessonId)) {
|
||||
getPublishLessonDetail({ id: obj.lessonId }).then(response => {
|
||||
this.lessonName = response.data.name;
|
||||
}).catch(error => {
|
||||
this.$message.error('获取课程信息失败:' + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
this.shrink();
|
||||
},
|
||||
jump(obj) {
|
||||
let query = {
|
||||
group: this.$route.query.group,
|
||||
trainingId: this.$route.query.trainingId,
|
||||
lessonId: this.$route.query.lessonId
|
||||
}
|
||||
this.$router.push({ path: `/display/${this.$route.params.mode}`, query: query })
|
||||
launchFullscreen();
|
||||
},
|
||||
shrink() {
|
||||
let height = this.$refs.dragBody.offsetHeight + 40;
|
||||
let top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.shrink();
|
||||
},
|
||||
jump(obj) {
|
||||
const query = {
|
||||
group: this.$route.query.group,
|
||||
trainingId: this.$route.query.trainingId,
|
||||
lessonId: this.$route.query.lessonId
|
||||
};
|
||||
this.$router.push({ path: `/display/${this.$route.params.mode}`, query: query });
|
||||
launchFullscreen();
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -265,4 +266,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user