修改代码

This commit is contained in:
ival 2019-08-19 10:31:11 +08:00
parent 00f0fd84a3
commit d083482b10
10 changed files with 1018 additions and 1014 deletions

View File

@ -3,8 +3,8 @@ 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.4:9000' // 琰培 // BASE_API = 'http://192.168.3.4:9000' // 琰培
} else { } else {

View File

@ -43,10 +43,8 @@
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div> </div>
<Jl3d-Simulation v-show="simulationShow" :panelShow="simulationShow" ref="Jl3dSimulation" @showpanel="showpanel"> <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" />
</Jl3d-Simulation> <Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<Jl3d-Drive v-show="drivingShow" :panelShow="drivingShow" ref="Jl3dDrive" @showdriving="showdriving">
</Jl3d-Drive>
<fault-choose ref="faultChoose" :group="group" /> <fault-choose ref="faultChoose" :group="group" />
<run-plan-Load ref="runPlanLoad" :group="group" /> <run-plan-Load ref="runPlanLoad" :group="group" />
@ -195,13 +193,6 @@ export default {
}, },
async created() { async created() {
this.group = this.$route.query.group || ''; 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() { async mounted() {
this.mode = this.$route.params.mode; this.mode = this.$route.params.mode;

View File

@ -40,7 +40,7 @@ export default {
name: 'MenuDemon', name: 'MenuDemon',
components: { components: {
// ChartView, // ChartView,
SetTime, SetTime
}, },
props: { props: {
group: { group: {
@ -167,7 +167,7 @@ export default {
}); });
}, },
handleQuitQuest() { handleQuitQuest() {
quitScript(this.group).then(resp => { quitScript(this.group).then(resp => {
this.$emit('quitQuest'); this.$emit('quitQuest');
}).catch(() => { }).catch(() => {
this.$messageBox('退出任务失败'); this.$messageBox('退出任务失败');

View File

@ -1,159 +1,158 @@
<template> <template>
<div> <div>
<div class="display-card" :style="{top: offset + 'px'}"> <div class="display-card" :style="{top: offset + 'px'}">
<el-row style="vertical-align:middle; "> <el-row style="vertical-align:middle; ">
<span class="display-time">{{formatTrainingUsedTime}}</span> <span class="display-time">{{ formatTrainingUsedTime }}</span>
</el-row> </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>
<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> </template>
<script> <script>
import TipExamList from './tipExamList'; import TipExamList from './tipExamList';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import { startTraining } from '@/api/jmap/training'; import { startTraining } from '@/api/jmap/training';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic'; import { exitFullscreen } from '@/utils/screen';
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 { getTrainingDetail } from '@/api/jmap/training';
import { launchFullscreen } from '@/utils/screen';
export default { export default {
name: 'MenuExam', name: 'MenuExam',
components: { components: {
TipExamList TipExamList
}, },
props: { props: {
group: { group: {
type: String, type: String,
required: true required: true
}, },
offset: { offset: {
type: Number type: Number,
} required: true
}, }
data() { },
return { data() {
isDisable: false, return {
startLoading: false, isDisable: false,
training: { startLoading: false,
id: '', training: {
name: '', id: '',
remarks: '' name: '',
}, remarks: ''
} }
}, };
computed: { },
...mapGetters('map', [ computed: {
'mapDeviceStatus' ...mapGetters('map', [
]), 'mapDeviceStatus'
formatTrainingUsedTime() { ]),
return timeFormat(this.$store.state.training.usedTime); formatTrainingUsedTime() {
} return timeFormat(this.$store.state.training.usedTime);
}, }
methods: { },
tipInfo(opt) { methods: {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { tipInfo(opt) {
const h = this.$createElement; if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
this.$notify({ const h = this.$createElement;
title: '提示', this.$notify({
message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作') title: '提示',
}); message: h('i', { style: 'color:' + opt.color }, '请点击开始考试操作')
} });
}, }
start() { },
this.$store.dispatch('menuOperation/setButtonOperation', null); start() {
this.startLoading = true; this.$store.dispatch('menuOperation/setButtonOperation', null);
if (this.$route.query.trainingId) { this.startLoading = true;
this.isDisable = true; if (this.$route.query.trainingId) {
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => { this.isDisable = true;
this.$store.dispatch('training/examModeStart'); startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('map/clearJlmapTrainView').then(() => { this.$store.dispatch('training/examModeStart');
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/setMapDefaultState').then(() => {
}) this.$store.dispatch('training/emitTipFresh');
}) });
this.startLoading = false; });
}).catch(error => { this.startLoading = false;
this.isDisable = false; }).catch(() => {
this.startLoading = false; this.isDisable = false;
}) this.startLoading = false;
} else { });
this.startLoading = true; } else {
this.$messageBox(`请选择试题`); this.startLoading = true;
} this.$messageBox(`请选择试题`);
}, }
end() { },
if (this.$route.query.trainingId) { end() {
this.isDisable = false; if (this.$route.query.trainingId) {
if (this.$store.state.training.started) { this.isDisable = false;
let model = { if (this.$store.state.training.started) {
id: this.$route.query.examQuestionId, const model = {
usedTime: this.$store.state.training.usedTime, id: this.$route.query.examQuestionId,
group: this.group usedTime: this.$store.state.training.usedTime,
} group: this.group
};
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
finishOneExamQuestion(model).then(response => { finishOneExamQuestion(model).then(response => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.init(); this.init();
}).catch(error => { }).catch(() => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
this.$messageBox(`结束实训错误`); this.$messageBox(`结束实训错误`);
}); });
} else { } else {
this.isDisable = true; this.isDisable = true;
this.$messageBox(`请先开始考试`); this.$messageBox(`请先开始考试`);
} }
} }
}, },
back() { back() {
this.$confirm('是否放弃本次考试?', '提示', { this.$confirm('是否放弃本次考试?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$emit('quit'); this.$emit('quit');
this.$router.push({ path: `/exam/home` }); this.$router.push({ path: `/exam/home` });
Notification.closeAll(); Notification.closeAll();
exitFullscreen(); exitFullscreen();
}).catch(() => { }).catch(() => {
}) });
}, },
init() { init() {
this.$store.dispatch('exam/countUsedTime'); this.$store.dispatch('exam/countUsedTime');
launchFullscreen(); launchFullscreen();
// //
refreshExamList(this.$route.query.userExamId).then(response => { refreshExamList(this.$route.query.userExamId).then(response => {
this.$store.dispatch('exam/setUsedTime', response.data.usedTime); this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration); this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { }); this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
}).catch(error => { }).catch(error => {
//50009y // 50009y
if (error.code === 500009) { if (error.code === 500009) {
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` }); this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
} else { } else {
this.$messageBox(`刷新列表失败`); this.$messageBox(`刷新列表失败`);
} }
}); });
}, },
refresh() { refresh() {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,197 +1,202 @@
<template> <template>
<div> <div>
<div class="display-card" :style="{top: offset + 'px'}"> <div class="display-card" :style="{top: offset + 'px'}">
<el-row> <el-row>
<el-radio-group class="mode" size="small" v-model="demoMode"> <el-radio-group v-model="demoMode" class="mode" size="small">
<el-radio-button :label="TrainingMode.TEACH">教学模式</el-radio-button> <el-radio-button :label="TrainingMode.TEACH">教学模式</el-radio-button>
<el-radio-button :label="TrainingMode.PRACTICE">练习模式</el-radio-button> <el-radio-button :label="TrainingMode.PRACTICE">练习模式</el-radio-button>
<el-radio-button :label="TrainingMode.TEST">测验模式</el-radio-button> <el-radio-button :label="TrainingMode.TEST">测验模式</el-radio-button>
</el-radio-group> </el-radio-group>
<span class="display-time">{{formatUsedTime}}</span> <span class="display-time">{{ formatUsedTime }}</span>
<span class="display-score" v-if="demoMode === TrainingMode.TEST">得分{{formatScore}}</span> <span v-if="demoMode === TrainingMode.TEST" class="display-score">得分{{ formatScore }}</span>
</el-row> </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>
<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> </template>
<script> <script>
import TipTrainingDetail from './tipTrainingDetail'; import TipTrainingDetail from './tipTrainingDetail';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { Notification } from 'element-ui'; import { Notification } from 'element-ui';
import { startTraining, endTraining } from '@/api/jmap/training'; import { startTraining, endTraining } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation'; import { trainingNotify } from '@/api/simulation';
import { TrainingMode, OperateMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen'; import { exitFullscreen } from '@/utils/screen';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
name: 'MenuLesson', name: 'MenuLesson',
props: { components: {
group: { TipTrainingDetail
type: String, },
required: true props: {
}, group: {
trainingObj: { type: String,
type: Object required: true
}, },
offset: { trainingObj: {
type: Number type: Object,
} default() {
}, return null;
components: { }
TipTrainingDetail },
}, offset: {
data() { type: Number,
return { required: true
timeInterval: null, }
TrainingMode: TrainingMode, },
demoMode: TrainingMode.TEACH, data() {
isDisable: false, return {
backDisable: false, timeInterval: null,
startLoading: false TrainingMode: TrainingMode,
} demoMode: TrainingMode.TEACH,
}, isDisable: false,
computed: { backDisable: false,
...mapGetters('map', [ startLoading: false
'mapDeviceStatus' };
]), },
...mapGetters('training', [ computed: {
'score', ...mapGetters('map', [
'started', 'mapDeviceStatus'
'usedTime', ]),
'basicInfo' ...mapGetters('training', [
]), 'score',
formatScore() { 'started',
return this.score; 'usedTime',
}, 'basicInfo'
formatUsedTime() { ]),
return timeFormat(this.usedTime); formatScore() {
} return this.score;
}, },
watch: { formatUsedTime() {
demoMode: function (val) { return timeFormat(this.usedTime);
this.$store.dispatch('training/end', null); }
this.$store.dispatch('training/reset'); },
this.$store.dispatch('training/emitTipFresh'); watch: {
this.$store.dispatch('menuOperation/setButtonOperation', null); 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; this.isDisable = false;
}, },
'$store.state.training.operateErrMsg': function (val) { '$store.state.training.operateErrMsg': function (val) {
this.tipInfo({ color: val.color, message: val.errMsg }); this.tipInfo({ color: val.color, message: val.errMsg });
} }
}, },
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) { if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
const h = this.$createElement; const h = this.$createElement;
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: h('i', { style: 'color:' + opt.color }, opt.message) message: h('i', { style: 'color:' + opt.color }, opt.message)
}); });
} }
}, },
start() { start() {
// //
this.$store.dispatch('menuOperation/setButtonOperation', null); this.$store.dispatch('menuOperation/setButtonOperation', null);
this.startLoading = true; this.startLoading = true;
if (this.trainingObj && this.trainingObj.id) { if (this.trainingObj && this.trainingObj.id) {
this.isDisable = true; this.isDisable = true;
startTraining(this.trainingObj, this.group).then(response => { startTraining(this.trainingObj, this.group).then(response => {
this.$store.dispatch('map/clearJlmapTrainView').then(() => { debugger;
this.$store.dispatch('training/teachModeStart', this.demoMode); this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => { this.$store.dispatch('training/teachModeStart', this.demoMode);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/setMapDefaultState').then(() => {
this.tipInfo({ color: 'green', message: '请开始操作' }); this.$store.dispatch('training/emitTipFresh');
}); this.tipInfo({ color: 'green', message: '请开始操作' });
}); });
this.startLoading = false; });
}).catch(error => { this.startLoading = false;
this.isDisable = false; }).catch(() => {
this.startLoading = false; this.isDisable = false;
}) this.startLoading = false;
} else { });
this.startLoading = false; } else {
this.$messageBox(`请选择实训`); this.startLoading = false;
} this.$messageBox(`请选择实训`);
}, }
endCommit() { },
this.$store.dispatch('training/setStopCountTime'); endCommit() {
let mode = { this.$store.dispatch('training/setStopCountTime');
mode: this.demoMode, const mode = {
id: this.trainingObj.id, mode: this.demoMode,
lessonId: this.$route.query.lessonId, id: this.trainingObj.id,
usedTime: this.usedTime lessonId: this.$route.query.lessonId,
} usedTime: this.usedTime
};
endTraining(mode, this.group).then(response => { endTraining(mode, this.group).then(response => {
let data = response.data; const data = response.data;
this.$store.dispatch('training/judgeFinish', data).then(rsp => { this.$store.dispatch('training/judgeFinish', data).then(rsp => {
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}); });
}).catch(error => { }).catch(() => {
this.$messageBox(`结束实训错误`); this.$messageBox(`结束实训错误`);
}); });
}, },
end() { end() {
// //
if (this.trainingObj && this.trainingObj.id) { if (this.trainingObj && this.trainingObj.id) {
if (this.started) { if (this.started) {
this.isDisable = false; this.isDisable = false;
this.$store.dispatch('training/isStepOver').then((rnt) => { this.$store.dispatch('training/isStepOver').then((rnt) => {
if (rnt) { if (rnt) {
this.endCommit(); this.endCommit();
} else { } else {
this.backDisable = true; this.backDisable = true;
this.$confirm('操作未完成,是否确认结束?', '提示', { this.$confirm('操作未完成,是否确认结束?', '提示', {
cancelButtonText: '取消', cancelButtonText: '取消',
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning', type: 'warning',
center: true, center: true,
zIndex: 9999 zIndex: 9999
}).then(() => { }).then(() => {
this.backDisable = false; this.backDisable = false;
this.$store.dispatch('training/end', null); this.$store.dispatch('training/end', null);
this.$store.dispatch('training/setScore', 0); this.$store.dispatch('training/setScore', 0);
this.$store.dispatch('training/emitTipFresh'); this.$store.dispatch('training/emitTipFresh');
}).catch(() => { }).catch(() => {
this.isDisable = true; this.isDisable = true;
this.backDisable = false; this.backDisable = false;
}); });
} }
}) });
} else { } else {
this.$messageBox(`请先开始实训`); this.$messageBox(`请先开始实训`);
} }
} }
}, },
back() { back() {
this.$emit('quit'); this.$emit('quit');
Notification.closeAll(); Notification.closeAll();
exitFullscreen(); exitFullscreen();
if (this.$route.params.mode == 'record') { if (this.$route.params.mode == 'record') {
/** 如果是演示返回时,需要重新创建仿真*/ /** 如果是演示返回时,需要重新创建仿真*/
trainingNotify({ trainingId: this.$route.query.trainingId }).then(resp => { 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 } }); this.$router.push({ path: `${UrlConfig.lesson.record}/${this.$route.query.trainingId}/${this.$route.query.trainingName}`, query: { group: resp.data } });
}).catch(error => { }).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`); this.$messageBox(`创建仿真失败: ${error.message}`);
}) });
} else { } else {
history.go(-1); history.go(-1);
} }
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,119 +1,118 @@
<template> <template>
<div> <div>
<div class="display-card" :style="{top: offset+'px'}"> <div class="display-card" :style="{top: offset+'px'}">
<el-row> <el-row>
<span class="display-score" v-if="countTime">试用时间{{ countTime }}</span> <span v-if="countTime" class="display-score">试用时间{{ countTime }}</span>
</el-row> </el-row>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { getGoodsTryUse } from '@/api/management/goods';
import { getGoodsTryUse } from '@/api/management/goods' import { PermissionType } from '@/scripts/ConstDic';
import { PermissionType } from '@/scripts/ConstDic'; import { exitFullscreen } from '@/utils/screen';
import { exitFullscreen } from '@/utils/screen'; import { getCountTime } from '@/utils/index';
import { getCountTime } from '@/utils/index'; import { runDiagramIsStart, runDiagramGetTime, runDiagramStart } from '@/api/simulation';
import { runDiagramIsStart, runDiagramGetTime, runDiagramStart } from '@/api/simulation'; import { timeFormat } from '@/utils/date';
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 { const resr = await getGoodsTryUse(data);
name: 'MenuScreen', if (resr && resr.code == 200) {
props: { this.remainingTime = resr.data.tryTime;
group: { this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime;
type: String, if (this.try) {
required: true this.time = setInterval(() => {
}, this.tryTime += 1;
offset: { this.countTime = getCountTime(this.timeNow);
type: Number if (this.countTime == -1) {
} this.back();
}, }
data() { }, 1000);
return { }
tryTime: 0, // } else {
timeNow: 0, // this.$messageBox(`获取时间失败`);
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
};
let resr = await getGoodsTryUse(data); const initTime = this.$route.query.initTime;
if (resr && resr.code == 200) { const retp = await runDiagramIsStart(this.group);
this.remainingTime = resr.data.tryTime; if (retp && !retp.data) {
this.timeNow = Date.parse(new Date()) / 1000 + this.remainingTime; await runDiagramStart({ initTime: initTime }, this.group);
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 initTime = this.$route.query.initTime; await this.$store.dispatch('training/simulationStart');
let retp = await runDiagramIsStart(this.group); await this.loadSystemTime();
if (retp && !retp.data) { } catch (error) {
await runDiagramStart({ initTime: initTime }, this.group); console.log(error);
} }
},
await this.$store.dispatch('training/simulationStart'); async loadSystemTime() {
await this.loadSystemTime(); const rest = await runDiagramGetTime(this.group);
} catch (error) { if (rest && rest.code == 200) {
console.log(error); this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`));
} }
}, },
async loadSystemTime() { setTryTime() {
let rest = await runDiagramGetTime(this.group); if (this.try) {
if (rest && rest.code == 200) { this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId });
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().getFullYear()} ${timeFormat(rest.data)}`)); }
} },
}, back() {
setTryTime() { this.$store.dispatch('training/over').then(() => {
if (this.try) { Notification.closeAll();
this.$emit('tryTime', { time: this.tryTime, goodsId: this.goodsId }); history.go(-1);
} exitFullscreen();
}, });
back() { }
this.$store.dispatch('training/over').then(() => { }
Notification.closeAll(); };
history.go(-1);
exitFullscreen();
});
}
}
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
@ -123,9 +122,7 @@
display: inline; display: inline;
position: absolute; position: absolute;
top: 17px; top: 17px;
float: left;
left: 30px; left: 30px;
height: 32px;
} }
.display-card .el-row { .display-card .el-row {

View File

@ -1,42 +1,50 @@
<template> <template>
<div class="display-card" :style="{top: offset+'px'}" v-if="isShowSystemTime"> <div v-if="isShowSystemTime" class="display-card" :style="{top: offset+'px'}">
<system-time class="time" v-if="isShowSystemTime" :time="time" :zoom="1.3" :width="110" :height="32" :fine="2" <system-time
:top="2"></system-time> v-if="isShowSystemTime"
</div> class="time"
:time="time"
:zoom="1.3"
:width="110"
:height="32"
:fine="2"
:top="2"
/>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { prefixIntrger } from '@/utils/date';
import { prefixIntrger } from '@/utils/date'; import SystemTime from '@/views/components/systemTime/index';
import SystemTime from '@/views/components/systemTime/index';
export default { export default {
name: 'MenuSystemTime', name: 'MenuSystemTime',
props: { components: {
offset: { SystemTime
type: Number },
} props: {
}, offset: {
components: { type: Number,
SystemTime required: true
}, }
data() { },
return { data() {
time: '00:0000', return {
} time: '00:0000'
}, };
watch: { },
'$store.state.training.initTime': function (initTime) { computed: {
let date = new Date(initTime); isShowSystemTime() {
this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}` return this.$route.params.mode == 'demon' || this.$route.params.mode == 'dp' || this.$route.params.mode == 'plan' || !this.$route.params.mode;
} }
}, },
computed: { watch: {
isShowSystemTime() { '$store.state.training.initTime': function (initTime) {
return this.$route.params.mode == 'demon' || this.$route.params.mode == 'dp' || this.$route.params.mode == 'plan' || !this.$route.params.mode; const date = new Date(initTime);
} this.time = `${prefixIntrger(date.getHours(), 2)}:${prefixIntrger(date.getMinutes(), 2)}${prefixIntrger(date.getSeconds(), 2)}`;
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,272 +1,277 @@
<template> <template>
<div class="reminder-drag" v-drag> <div v-drag class="reminder-drag">
<div class="reminder-box" ref="drapBox"> <div ref="drapBox" class="reminder-box">
<div class="tip-title"> <div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i> <i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i> <i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p style="color: #fff;" v-if="!isShrink"> <p v-if="!isShrink" style="color: #fff;">
<span class="time-label">考试计时</span> <span class="time-label">考试计时</span>
<span class="time-elem">{{formatExamUsedTime}}</span> <span class="time-elem">{{ formatExamUsedTime }}</span>
</p> </p>
<p style="color: #fff;" v-if="isShrink"> <p v-if="isShrink" style="color: #fff;">
<span>{{examName}}</span> <span>{{ examName }}</span>
</p> </p>
</div> </div>
<div class="tip-body-box" ref="dragBody"> <div ref="dragBody" class="tip-body-box">
<div class="tip-body" v-show="detailShow"> <div v-show="detailShow" class="tip-body">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-tree ref="treeQuestion" :data="trainingList" node-key="id" highlight-current <el-tree
@node-click="getTrainDetail"> ref="treeQuestion"
<span slot-scope="{ node, data }"> :data="trainingList"
<span :style="{color: data.usedTime !== undefined ? 'green':''}">&nbsp;{{trainingList.indexOf(data)+1}}.{{ node-key="id"
data.trainingName}} highlight-current
</span> @node-click="getTrainDetail"
</span> >
</el-tree> <span slot-scope="{ node, data }">
</el-scrollbar> <span :style="{color: data.usedTime !== undefined ? 'green':''}">&nbsp;{{ trainingList.indexOf(data)+1 }}.{{
</div> data.trainingName }}
<div class="tip-body" v-show="!detailShow"> </span>
<el-scrollbar wrapClass="scrollbar-wrapper"> </span>
<p class="list-item"> </el-tree>
<span class="list-label">本题名称</span> </el-scrollbar>
<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> </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>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { refreshExamList } from '@/api/management/userexam'; import { refreshExamList } from '@/api/management/userexam';
import { getTrainingDetail } from '@/api/jmap/training'; import { getTrainingDetail } from '@/api/jmap/training';
import { launchFullscreen, exitFullscreen } from '@/utils/screen'; import { launchFullscreen, exitFullscreen } from '@/utils/screen';
export default { export default {
name: 'TipExamList', name: 'TipExamList',
components: { components: {
}, },
data() { data() {
return { return {
training: { training: {
id: '', id: '',
name: '', name: '',
remarks: '' remarks: ''
}, },
isShrink: false, isShrink: false,
examName: '', examName: '',
courseModel: { courseModel: {
id: '', id: '',
name: '', name: '',
maxDuration: '', maxDuration: '',
minDuration: '', minDuration: '',
remarks: '', remarks: '',
updateTime: '' updateTime: ''
}, },
detailShow: false, detailShow: false,
examIndex: 0, examIndex: 0
} };
}, },
computed: { computed: {
...mapGetters('trainingList', [ ...mapGetters('trainingList', [
'trainingList', 'trainingList'
]), ]),
formatExamUsedTime() { formatExamUsedTime() {
return timeFormat(this.$store.state.exam.usedTime); return timeFormat(this.$store.state.exam.usedTime);
}, },
isFirst() { isFirst() {
return this.examIndex == 0; return this.examIndex == 0;
}, },
isLast() { isLast() {
return this.examIndex == this.trainingList.length - 1; return this.examIndex == this.trainingList.length - 1;
}, }
}, },
mounted() { mounted() {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
backList() { backList() {
this.detailShow = true; this.detailShow = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key
}); });
}, },
// //
selectedTraining(obj) { selectedTraining(obj) {
this.trainingList.forEach((item, index) => { this.trainingList.forEach((item, index) => {
if (item.id == obj.id) { if (item.id == obj.id) {
this.examIndex = index; this.examIndex = index;
return; return;
} }
}) });
if (obj) { if (obj) {
let that = this; const that = this;
let data = { id: obj.trainingId }; const data = { id: obj.trainingId };
getTrainingDetail(data).then(res => { getTrainingDetail(data).then(res => {
that.courseModel = { that.courseModel = {
id: res.data.id, id: res.data.id,
name: res.data.name, name: res.data.name,
maxDuration: res.data.maxDuration, maxDuration: res.data.maxDuration,
remarks: res.data.remarks, remarks: res.data.remarks,
minDuration: res.data.minDuration, minDuration: res.data.minDuration,
updateTime: res.data.updateTime, updateTime: res.data.updateTime
}; };
}).catch(error => { }).catch(error => {
that.$message.error('获取试题息失败:' + error.message) that.$message.error('获取试题息失败:' + error.message);
}); });
} }
this.jump(obj); this.jump(obj);
}, },
getTrainDetail(obj) { getTrainDetail(obj) {
this.selectedTraining(obj); this.selectedTraining(obj);
this.detailShow = false; this.detailShow = false;
}, },
// //
loadInitData() { loadInitData() {
this.$store.dispatch('exam/countUsedTime'); this.$store.dispatch('exam/countUsedTime');
// //
refreshExamList(this.$route.query.userExamId).then(response => { refreshExamList(this.$route.query.userExamId).then(response => {
this.examName = response.data.examName; this.examName = response.data.examName;
this.$store.dispatch('exam/setUsedTime', response.data.usedTime); this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration); this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { }); this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
let obj = { const obj = {
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;
} else { } else {
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId; obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
obj.id = response.data.userExamQuestionsVOs[0].id; obj.id = response.data.userExamQuestionsVOs[0].id;
} }
this.selectedTraining(obj); this.selectedTraining(obj);
}).catch(error => { }).catch(error => {
//50009y // 50009y
if (error.code === 500009) { if (error.code === 500009) {
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` }); this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
} else { } else {
this.$messageBox(`刷新列表失败`); this.$messageBox(`刷新列表失败`);
} }
}); });
this.shrink(); this.shrink();
}, },
nextExam() { nextExam() {
let obj = { const obj = {
trainingId: '', trainingId: '',
id: '', id: ''
} };
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) { if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId; obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
obj.id = this.trainingList[this.examIndex + 1].id; obj.id = this.trainingList[this.examIndex + 1].id;
this.examIndex = this.examIndex + 1; this.examIndex = this.examIndex + 1;
} }
if (obj.trainingId && obj.id) { if (obj.trainingId && obj.id) {
this.selectedTraining(obj); this.selectedTraining(obj);
} }
}, },
lastExam() { lastExam() {
let obj = { const obj = {
trainingId: '', trainingId: '',
id: '', id: ''
} };
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) { if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId; obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
obj.id = this.trainingList[this.examIndex - 1].id; obj.id = this.trainingList[this.examIndex - 1].id;
this.examIndex = this.examIndex - 1; this.examIndex = this.examIndex - 1;
} }
if (obj.trainingId && obj.id) { if (obj.trainingId && obj.id) {
this.selectedTraining(obj); this.selectedTraining(obj);
} }
}, },
jump(obj) { jump(obj) {
let query = { const query = {
group: this.$route.query.group, group: this.$route.query.group,
userExamId: this.$route.query.userExamId, userExamId: this.$route.query.userExamId,
trainingId: obj.trainingId, trainingId: obj.trainingId,
examQuestionId: obj.id examQuestionId: obj.id
} };
this.$router.push({ path: '/display/exam', query: query }); this.$router.push({ path: '/display/exam', query: query });
this.$emit('refresh'); this.$emit('refresh');
launchFullscreen(); launchFullscreen();
}, },
overExam() { overExam() {
this.$store.dispatch('exam/isOver').then(isOver => { this.$store.dispatch('exam/isOver').then(isOver => {
if (isOver) { if (isOver) {
this.submit(); this.submit();
} else { } else {
this.$confirm('考试未完成,是否确认退出?', '提示', { this.$confirm('考试未完成,是否确认退出?', '提示', {
cancelButtonText: '取消', cancelButtonText: '取消',
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning', type: 'warning',
center: true center: true
}).then(() => { }).then(() => {
this.submit(); this.submit();
}).catch(() => { }).catch(() => {
}); });
} }
}); });
}, },
submit() { submit() {
exitFullscreen(); 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: `/exam/result/${this.$route.query.userExamId}` }); this.$router.replace({ path: `/exam/result/${this.$route.query.userExamId}` });
}); });
}, },
shrink() { shrink() {
let height = this.$refs.dragBody.offsetHeight + 40; const height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top; const top = this.$refs.drapBox.style.top;
if (this.isShrink) { if (this.isShrink) {
this.$refs.drapBox.style.height = '40px'; this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = ''; this.$refs.drapBox.style.top = '';
this.isShrink = false; this.isShrink = false;
} else { } else {
this.$refs.drapBox.style.height = height + 'px'; this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top; this.$refs.drapBox.style.top = top;
this.isShrink = true; this.isShrink = true;
} }
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,129 +1,127 @@
<template> <template>
<div class="reminder-drag"> <div class="reminder-drag">
<div class="reminder-box" ref="drapBox"> <div ref="drapBox" class="reminder-box">
<div class="tip-title"> <div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i> <i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i> <i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p style="color: #fff;" v-if="isShrink"> <p v-if="isShrink" style="color: #fff;">
<span>{{ title }}</span> <span>{{ title }}</span>
</p> </p>
</div> </div>
<div class="tip-body-box" ref="dragBody"> <div ref="dragBody" class="tip-body-box">
<div class="tip-body"> <div class="tip-body">
<div> <div>
<get-action ref="getAction" :group="group"></get-action> <get-action ref="getAction" :group="group" />
</div> </div>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button> <el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</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="primary" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
<el-button type="success" @click="saveScenesData">{{$t('scriptRecord.saveData')}}</el-button> <el-button type="success" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
</el-button-group> </el-button-group>
</div>
</div>
</div> </div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import GetAction from './scriptRecord/getAction'; import GetAction from './scriptRecord/getAction';
import { launchFullscreen, exitFullscreen } from '@/utils/screen'; import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation} from '@/api/simulation';
import {saveScriptScenes, saveScriptData, dumpScriptData,updateMapLocation} from '@/api/simulation';
export default { export default {
name: 'TipScriptRecord', name: 'TipScriptRecord',
props: { components: {
group: { GetAction
type: String, },
required: true props: {
}, group: {
}, type: String,
components: { required: true
GetAction, }
}, },
// this.$t('scriptRecord.scriptTitle') // this.$t('scriptRecord.scriptTitle')
data() { data() {
return { return {
title:"剧本编制", title: '剧本编制',
isShrink: false, isShrink: false,
mapLocation:{}, mapLocation: {}
// isSaveStage: true, // isSaveStage: true,
} };
}, },
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation); Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
} }
}, },
created() { created() {
}, },
mounted(){ mounted() {
this.shrink(); this.shrink();
}, },
methods: { methods: {
jump(obj) { jump(obj) {
}, },
shrink() { shrink() {
let height = this.$refs.dragBody.offsetHeight + 40; const height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top; const top = this.$refs.drapBox.style.top;
if (this.isShrink) { if (this.isShrink) {
this.$refs.drapBox.style.height = '40px'; this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = ''; this.$refs.drapBox.style.top = '';
this.isShrink = false; this.isShrink = false;
} else { } else {
this.$refs.drapBox.style.height = height + 'px'; this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top; this.$refs.drapBox.style.top = top;
this.isShrink = true; this.isShrink = true;
} }
}, },
// getActions(row){ // getActions(row){
// this.displayType="action"; // this.displayType="action";
// this.behaviorId=row.id; // this.behaviorId=row.id;
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description); // this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
// }, // },
saveScenesStage() { saveScenesStage() {
saveScriptScenes(this.group).then(resp => { saveScriptScenes(this.group).then(resp => {
// this.isSaveStage = false; // this.isSaveStage = false;
this.$message.success('保存背景成功'); this.$message.success('保存背景成功');
}).catch(error => { }).catch(() => {
this.$messageBox('保存背景失败!'); this.$messageBox('保存背景失败!');
}) });
}, },
saveScenesData() { saveScenesData() {
saveScriptData(this.group).then(resp => { saveScriptData(this.group).then(resp => {
this.$message.success('保存数据成功'); this.$message.success('保存数据成功');
}).catch(error => { }).catch(error => {
this.$messageBox(`保存数据失败!: ${error.message}`); this.$messageBox(`保存数据失败!: ${error.message}`);
}) });
}, },
dumpScenesData() { dumpScenesData() {
let group=this.group; const group=this.group;
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', { this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dumpScriptData(group).then(resp => { dumpScriptData(group).then(resp => {
// this.isSaveStage = true; // this.isSaveStage = true;
this.$message.success('清除数据成功'); this.$message.success('清除数据成功');
}).catch(error => { }).catch(() => {
this.$messageBox('清除数据失败!'); this.$messageBox('清除数据失败!');
}) });
}).catch(error => { }) }).catch(() => { });
}, },
saveMaplocation() saveMaplocation() {
{ const data=Vue.prototype.$jlmap.$options;
let data=Vue.prototype.$jlmap.$options; const group=this.$route.query.group;
let group=this.$route.query.group; const dataZoom={scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY}; updateMapLocation(group, dataZoom).then(response=>{
updateMapLocation(group,dataZoom).then(response=>{ this.$message.success('更新定位成功');
this.$message.success('更新定位成功'); }).catch(error => {
}).catch(error => { this.$messageBox(`更新定位失败: ${error.message}`);
this.$messageBox(`更新定位失败: ${error.message}`); });
}); }
} }
} };
}
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,149 +1,150 @@
<template> <template>
<div class="reminder-drag" v-drag> <div v-drag class="reminder-drag">
<div class="reminder-box" ref="drapBox"> <div ref="drapBox" class="reminder-box">
<div class="tip-title"> <div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i> <i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i> <i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p style="color: #fff;" v-if="isShrink"> <p v-if="isShrink" style="color: #fff;">
<span>{{lessonName}}</span> <span>{{ lessonName }}</span>
</p> </p>
</div> </div>
<div class="tip-body-box" ref="dragBody"> <div ref="dragBody" class="tip-body-box">
<div class="tip-body"> <div class="tip-body">
<el-scrollbar wrapClass="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<p class="list-item"> <p class="list-item">
<span class="list-label">实训名称</span> <span class="list-label">实训名称</span>
<span class="list-elem">{{ courseModel.name }}</span> <span class="list-elem">{{ courseModel.name }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">最佳用时</span> <span class="list-label">最佳用时</span>
<span class="list-elem">{{ courseModel.minDuration }} </span> <span class="list-elem">{{ courseModel.minDuration }} </span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">最大用时</span> <span class="list-label">最大用时</span>
<span class="list-elem">{{ courseModel.maxDuration }} </span> <span class="list-elem">{{ courseModel.maxDuration }} </span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label"> 实训说明</span> <span class="list-label"> 实训说明</span>
<span class="list-elem">{{ courseModel.remarks }}</span> <span class="list-elem">{{ courseModel.remarks }}</span>
</p> </p>
</el-scrollbar> </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> </div>
<div class="drag-right" />
<div class="drag-left" />
<div class="drag-bottom" />
<div class="drag-top" />
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date'; import { getPublishLessonDetail } from '@/api/jmap/lesson';
import { getTrainingDetail, trainingNotify } from '@/api/jmap/training'; import { launchFullscreen } from '@/utils/screen';
import { getPublishLessonDetail } from '@/api/jmap/lesson';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
export default { export default {
name: 'TipTrainingDetail', name: 'TipTrainingDetail',
props: { props: {
trainingObj: { trainingObj: {
type: Object type: Object,
} default() {
}, return null;
data() { }
return { }
training: { },
id: '', data() {
name: '', return {
remarks: '' training: {
}, id: '',
isShrink: false, name: '',
lessonName: '', remarks: ''
courseModel: { },
id: '', isShrink: false,
name: '', lessonName: '',
skinCode: '', courseModel: {
maxDuration: '', id: '',
minDuration: '', name: '',
remarks: '', skinCode: '',
updateTime: '' maxDuration: '',
}, minDuration: '',
showSumbit: false, remarks: '',
lessonIndex: 0, updateTime: ''
} },
}, showSumbit: false,
computed: { lessonIndex: 0
...mapGetters('trainingList', [ };
'trainingList', },
]) computed: {
}, ...mapGetters('trainingList', [
watch: { 'trainingList'
'trainingObj': function (val) { ])
if (val) { },
this.courseModel = { watch: {
id: val.id, 'trainingObj': function (val) {
name: val.name, if (val) {
skinCode: val.skinCode, this.courseModel = {
maxDuration: val.maxDuration, id: val.id,
minDuration: val.minDuration, name: val.name,
remarks: val.remarks, skinCode: val.skinCode,
updateTime: val.updateTime maxDuration: val.maxDuration,
}; minDuration: val.minDuration,
} remarks: val.remarks,
} updateTime: val.updateTime
}, };
mounted() { }
this.loadInitData(this.$route.query); }
}, },
methods: { mounted() {
loadInitData(obj) { this.loadInitData(this.$route.query);
this.showSumbit = false; },
this.lessonName = ''; methods: {
this.courseModel = { loadInitData(obj) {
id: '', this.showSumbit = false;
name: '', this.lessonName = '';
maxDuration: '', this.courseModel = {
minDuration: '', id: '',
remarks: '', name: '',
updateTime: '' maxDuration: '',
}; minDuration: '',
remarks: '',
updateTime: ''
};
if (parseInt(obj.lessonId)) { if (parseInt(obj.lessonId)) {
getPublishLessonDetail({ id: obj.lessonId }).then(response => { getPublishLessonDetail({ id: obj.lessonId }).then(response => {
this.lessonName = response.data.name; this.lessonName = response.data.name;
}).catch(error => { }).catch(error => {
that.$message.error("获取课程信息失败:" + error.message); this.$message.error('获取课程信息失败:' + error.message);
}); });
} }
this.shrink(); this.shrink();
}, },
jump(obj) { jump(obj) {
let query = { const query = {
group: this.$route.query.group, group: this.$route.query.group,
trainingId: this.$route.query.trainingId, trainingId: this.$route.query.trainingId,
lessonId: this.$route.query.lessonId lessonId: this.$route.query.lessonId
} };
this.$router.push({ path: `/display/${this.$route.params.mode}`, query: query }) this.$router.push({ path: `/display/${this.$route.params.mode}`, query: query });
launchFullscreen(); launchFullscreen();
}, },
shrink() { shrink() {
let height = this.$refs.dragBody.offsetHeight + 40; const height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top; const top = this.$refs.drapBox.style.top;
if (this.isShrink) { if (this.isShrink) {
this.$refs.drapBox.style.height = '40px'; this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = ''; this.$refs.drapBox.style.top = '';
this.isShrink = false; this.isShrink = false;
} else { } else {
this.$refs.drapBox.style.height = height + 'px'; this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top; this.$refs.drapBox.style.top = top;
this.isShrink = true; this.isShrink = true;
} }
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";