实训调整

This commit is contained in:
fan 2020-03-26 18:42:01 +08:00
parent ead5bd01e6
commit f34de4f001
20 changed files with 230 additions and 73 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request';
/** 开始实训*/
/** 开始实训 0*/
export function startTraining(args, group) {
return request({
url: `/api/training/${args.id}/start`,
@ -35,8 +35,7 @@ export function sendTrainingNextStep(data, group) {
}
});
}
/** 获取章节基本信息*/
/** 获取章节基本信息 0*/
export function getTrainingDetail(trainingId) {
return request({
url: `/api/training/${trainingId}`,
@ -44,7 +43,7 @@ export function getTrainingDetail(trainingId) {
});
}
/** 添加实训*/
/** 添加实训 0*/
export function addTraining(data) {
return request({
url: '/api/training',
@ -53,7 +52,7 @@ export function addTraining(data) {
});
}
/** 获取实训步骤数据*/
/** 获取实训步骤数据 0*/
export function getTrainingStepsDetail(trainingId, params) {
return request({
url: `/api/training/${trainingId}/detail`,
@ -62,7 +61,7 @@ export function getTrainingStepsDetail(trainingId, params) {
});
}
/** 查询实训列表*/
/** 查询实训列表 0*/
export function pageQueryTraining(params) {
return request({
url: `/api/training/pagedQuery`,
@ -70,8 +69,7 @@ export function pageQueryTraining(params) {
params: params
});
}
/** 自动生成实训操作*/
/** 自动生成实训操作 0*/
export function addAutoTraining(data) {
return request({
url: `/api/training/generate`,
@ -80,7 +78,7 @@ export function addAutoTraining(data) {
});
}
/** 修改自动删除实训操作*/
/** 修改自动删除实训操作 0*/
export function updateAutoTraining(data) {
return request({
url: `/api/training/batchUpdateGenerate`,
@ -88,8 +86,7 @@ export function updateAutoTraining(data) {
data: data
});
}
/** 删除自动生成实训*/
/** 删除自动生成实训 0*/
export function deleteAutoTraining(params) {
return request({
url: `/api/training/generate`,
@ -98,7 +95,7 @@ export function deleteAutoTraining(params) {
});
}
/** 获取用户实训列表*/
/** 获取用户实训列表 0*/
export function getTrainingList(data) {
return request({
url: `/api/training/list`,
@ -128,15 +125,7 @@ export function sendCommandNew(group, commandDefinitionId, command) {
data: command
});
}
export function updateLesson(data) {
return request({
url: `/api/training/userTraining/${data.id}`,
method: 'put',
data: data
});
}
// 添加用户实训数据
// 添加用户实训数据 0
export function addUserTraining(data) {
return request({
url: `/api/training/userTraining`,
@ -144,7 +133,7 @@ export function addUserTraining(data) {
data: data
});
}
// 更新用户实训数据
// 更新用户实训数据 0
export function putUserTraining(data) {
return request({
url: `/api/training/userTraining/${data.id}`,
@ -152,10 +141,125 @@ export function putUserTraining(data) {
data: data
});
}
// 清除实训数据
// 清除实训数据 0
export function deleteUserTraining(statsId) {
return request({
url: `/api/training/userTraining/${statsId}`,
method: 'delete'
});
}
/** 开始实训 (新版地图) */
export function startTrainingNew (args, group) {
return request({
url: `/api/v1/training/${args.id}/start`,
method: 'get',
params: {group}
});
}
/** 实训结束(新版地图) */
export function endTrainingNew(args, group) {
return request({
url: `/api/v1/training/${args.lessonId}/${args.id}/end`,
method: 'get',
params: {
mode: args.mode,
usedTime: args.usedTime,
group
}
});
}
/** 发送步骤数据 (新版地图) */
export function sendTrainingNextStepNew(data, group) {
return request({
url: `/api/v1/training/${data.trainingId}/nextStep`,
method: 'post',
data: data.operate,
params: {group}
});
}
/** 获取章节基本信息(新版地图) */
export function getTrainingDetailNew(trainingId) {
return request({
url: `/api/v1/training/${trainingId}`,
method: 'get'
});
}/** 添加实训(新版地图) */
export function addTrainingNew(data) {
return request({
url: '/api/v1/training',
method: 'post',
data: data
});
}
/** 获取实训步骤数据(新版地图) */
export function getTrainingStepsDetailNew(trainingId, params) {
return request({
url: `/api/v1/training/${trainingId}/detail`,
method: 'get',
params: params
});
}
/** 查询实训列表(新版地图)*/
export function pageQueryTrainingNew(params) {
return request({
url: `/api/v1/training/pagedQuery`,
method: 'get',
params: params
});
}
/** 自动生成实训操作(新版地图) */
export function addAutoTrainingNew(data) {
return request({
url: '/api/v1/training/generate',
method: 'post',
data: data
});
}
/** 修改自动删除实训操作(新版地图) */
export function updateAutoTrainingNew(data) {
return request({
url: `/api/v1/training/batchUpdateGenerate`,
method: 'put',
data: data
});
}
/** 删除自动生成实训(新版地图) */
export function deleteAutoTrainingNew(params) {
return request({
url: `/api/v1/training/generate`,
method: 'delete',
params: params
});
}
/** 获取用户实训列表(新版) */
export function getTrainingListNew(data) {
return request({
url: `/api/v1/training/list`,
method: 'get',
params: data
});
}
/** 添加用户实训数据 */
export function addUserTrainingNew(data) {
return request({
url: `/api/v1/training/userTraining`,
method: 'post',
data:data
});
}
/** 更新用户实训数据 */
export function putUserTrainingNew(data) {
return request({
url: `/api/v1/training/userTraining/${data.id}`,
method: 'put',
data: data
});
}
/** 清除实训数据 */
export function deleteUserTrainingNew(statsId) {
return request({
url: `/api/v1/training/userTraining/${statsId}`,
method: 'delete'
});
}

View File

@ -86,7 +86,13 @@ export function trainingNotify({ trainingId }) {
method: 'get'
});
}
/** 实训系统(新版地图) */
export function trainingNotifyNew({ trainingId }) {
return request({
url: `/simulation/training/${trainingId}`,
method: 'get'
});
}
/**
* 考试系统CBTC
* @param {*} data

View File

@ -3,7 +3,7 @@ import router from '@/router';
import CommandHandler from './CommandHandler.js';
import ValidateHandler from './ValidateHandler.js';
import { State2SimulationMap } from './Config.js';
import { sendTrainingNextStep } from '@/api/jmap/training';
import { sendTrainingNextStepNew } from '@/api/jmap/training';
import { getCmdList } from '@/api/management/dictionary';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -36,7 +36,7 @@ class Handler {
const basicInfo = store.getters['training/basicInfo'];
if (basicInfo.id && valid) {
const group = router.currentRoute.query.group;
sendTrainingNextStep({ trainingId: basicInfo.id, operation: operation }, group);
sendTrainingNextStepNew({ trainingId: basicInfo.id, operation: operation }, group);
}
if (!valid) {

View File

@ -93,6 +93,7 @@ OperateHandler.prototype = {
const basicInfo = store.getters['training/basicInfo'];
if (basicInfo.id && valid) {
const group = router.currentRoute.query.group;
console.log('--------------------------');
sendTrainingNextStep({ trainingId: basicInfo.id, operate: operate }, group);
}

View File

@ -3,11 +3,11 @@ 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 = '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.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -95,7 +95,7 @@ export default {
}
case 'lessonDesign': {
setSessionStorage('designType', 'lessonDesign');
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}`, query: {cityCode: obj.cityCode} });
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}`, query: {cityCode: obj.cityCode, drawWay: data.parent.data.drawWay} });
break;
}
case 'runPlanDesign': {

View File

@ -87,13 +87,13 @@ export default {
return data.name.indexOf(value) !== -1;
},
editLesson() {
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}} );
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay}} );
},
createChapte(node) {
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay}});
},
updateChapte(node) {
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay}});
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {

View File

@ -209,7 +209,7 @@ export default {
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId}});
},
trainingManage() {
this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId}});
this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay}});
},
operationManage() {
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId}});
@ -235,7 +235,7 @@ export default {
this.$refs.lessonDetail.show(row.id);
},
goDetail(index, row) {
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId}});
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay}});
}
}
};

View File

@ -217,7 +217,7 @@ export default {
});
},
back() {
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode} });
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode, drawWay: this.$route.query.drawWay} });
}
}
};

View File

@ -15,7 +15,7 @@
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { pageQueryTraining } from '@/api/jmap/training';
import { pageQueryTraining, pageQueryTrainingNew } from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map';
import localStore from 'storejs';
import { EventBus } from '@/scripts/event-bus';
@ -156,7 +156,12 @@ export default {
async queryFunction(params) {
params['mapId'] = this.detail.mapId;
params['prdType'] = this.detail.prdType;
const res = await pageQueryTraining(params);
let res = '';
if (this.$route.query.drawWay == 'true') {
res = await pageQueryTrainingNew(params);
} else {
res = await pageQueryTraining(params);
}
this.trainings.forEach(ele => {
res.data.list.forEach(item => {
if (item.id == ele.trainingId) {

View File

@ -65,7 +65,7 @@
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { addAutoTraining, updateAutoTraining, deleteAutoTraining, addTraining } from '@/api/jmap/training';
import { addAutoTraining, updateAutoTraining, deleteAutoTraining, addTraining, addAutoTrainingNew, updateAutoTrainingNew, deleteAutoTrainingNew, addTrainingNew } from '@/api/jmap/training';
import { getOperateTrainingList } from '@/api/management/operation';
export default {
@ -266,6 +266,21 @@ export default {
},
//
handleDeal() {
let addAutoTrainingFunction = '';
let updateAutoTrainingFunction = '';
let deleteAutoTrainingFunction = '';
let addTrainingFunction = '';
if (this.$route.query.drawWay == 'true') {
addAutoTrainingFunction = addAutoTrainingNew;
updateAutoTrainingFunction = updateAutoTrainingNew;
deleteAutoTrainingFunction = deleteAutoTrainingNew;
addTrainingFunction = addTrainingNew;
} else {
addAutoTrainingFunction = addAutoTraining;
updateAutoTrainingFunction = updateAutoTraining;
deleteAutoTrainingFunction = deleteAutoTraining;
addTrainingFunction = addTraining;
}
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
@ -279,7 +294,7 @@ export default {
operateType: this.operateModel.operateType
};
addAutoTraining(data).then(response => {
addAutoTrainingFunction(data).then(response => {
this.$message.success(this.$t('tip.automaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
@ -300,7 +315,7 @@ export default {
maxDuration: this.operateModel.maxDuration
};
updateAutoTraining(data).then(response => {
updateAutoTrainingFunction(data).then(response => {
this.$message.success(this.$t('tip.updateAutomaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
@ -318,7 +333,7 @@ export default {
operateType: `${this.operateModel.operateType.join(',')}`
};
deleteAutoTraining(data).then(response => {
deleteAutoTrainingFunction(data).then(response => {
this.$message.success(this.$t('tip.deleteAutomaticGenerationTrainingSuccess'));
this.$emit('refresh');
this.close();
@ -337,7 +352,7 @@ export default {
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
addTraining(data).then(response => {
addTrainingFunction(data).then(response => {
this.$message.success(this.$t('tip.addTrainingSuccessfully'));
this.$emit('refresh');
this.close();

View File

@ -19,7 +19,7 @@
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { pageQueryTraining } from '@/api/jmap/training';
import { pageQueryTraining, pageQueryTrainingNew } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import { launchFullscreen } from '@/utils/screen';
import { getPublishMapListOnline } from '@/api/jmap/map';
@ -243,9 +243,13 @@ export default {
},
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
if (this.$route.query.drawWay == 'true') {
return pageQueryTrainingNew(params);
} else {
return pageQueryTraining(params);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -58,7 +58,7 @@ import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
import MenuScript from '@/views/newMap/displayNew/menuScript';
import Scheduling from './demon/scheduling';
import { mapGetters } from 'vuex';
import { getTrainingDetail, getTrainingStepsDetail } from '@/api/jmap/training';
import { getTrainingStepsDetailNew, getTrainingDetailNew } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { clearSimulation, loadScript, getSimulationInfoNew } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
@ -193,7 +193,7 @@ export default {
this.mapBox = document.getElementsByTagName('canvas');
if (this.trainingId) {
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(resp => {
getTrainingStepsDetailNew(this.trainingId, { group: this.group }).then(resp => {
this.trainingObj = resp.data;
this.$store.dispatch('training/setTrainingData', this.trainingObj);
});
@ -367,7 +367,7 @@ export default {
if (parseInt(this.trainingId)) {
//
//
const resp = await getTrainingDetail(this.trainingId);
const resp = await getTrainingDetailNew(this.trainingId);
if (resp && resp.code == 200) {
const detail = resp.data;
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);

View File

@ -19,7 +19,7 @@
<script>
import TipExamList from './tipExamList';
import { Notification } from 'element-ui';
import { startTraining } from '@/api/jmap/training';
import { startTrainingNew } from '@/api/jmap/training';
import { timeFormat } from '@/utils/date';
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
import { launchFullscreen } from '@/utils/screen';
@ -75,7 +75,7 @@ export default {
this.startLoading = true;
if (this.$route.query.trainingId) {
this.isDisable = true;
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
startTrainingNew({ 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(() => {

View File

@ -26,7 +26,7 @@
import TipTrainingDetail from './tipTrainingDetail';
import { mapGetters } from 'vuex';
import { Notification } from 'element-ui';
import { startTraining, endTraining } from '@/api/jmap/training';
import { startTrainingNew, endTrainingNew } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import { TrainingMode } from '@/scripts/ConstDic';
import { timeFormat } from '@/utils/date';
@ -107,7 +107,7 @@ export default {
this.startLoading = true;
if (this.trainingObj && this.trainingObj.id) {
this.isDisable = true;
startTraining(this.trainingObj, this.group).then(response => {
startTrainingNew(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(() => {
@ -134,7 +134,7 @@ export default {
usedTime: this.usedTime
};
endTraining(mode, this.group).then(response => {
endTrainingNew(mode, this.group).then(response => {
const data = response.data;
this.$store.dispatch('training/judgeFinish', data).then(rsp => {
this.$store.dispatch('training/emitTipFresh');

View File

@ -79,7 +79,7 @@
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { refreshExamList } from '@/api/management/userexam';
import { getTrainingDetail } from '@/api/jmap/training';
import { getTrainingDetailNew } from '@/api/jmap/training';
import { launchFullscreen } from '@/utils/screen';
export default {
@ -151,7 +151,7 @@ export default {
}
});
if (obj) {
getTrainingDetail(obj.trainingId).then(res => {
getTrainingDetailNew(obj.trainingId).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,

View File

@ -12,7 +12,7 @@
</template>
<script>
import { addUserTraining } from '@/api/jmap/training';
import { addUserTrainingNew } from '@/api/jmap/training';
import { getPublishLessonList } from '@/api/jmap/lesson';
import { getDimUserList } from '@/api/management/user';
import AddTraining from './addTraining';
@ -149,7 +149,7 @@ export default {
save() {
const self = this;
if (this.formModel.userId) {
addUserTraining(this.formModel).then(response => {
addUserTrainingNew(this.formModel).then(response => {
self.$message.success(this.$t('system.addSuccess'));
self.handleClose();
self.$emit('reloadTable');

View File

@ -9,7 +9,7 @@
</template>
<script>
import { putUserTraining } from '@/api/jmap/training';
import { putUserTrainingNew } from '@/api/jmap/training';
export default {
name: 'UsersTrainingEdit',
props: {
@ -82,7 +82,7 @@ export default {
id: this.formModel.id,
duration: this.formModel.duration
};
putUserTraining(param).then(response => {
putUserTrainingNew(param).then(response => {
self.$message.success(this.$t('system.updateSuccess'));
self.handleClose();
self.$emit('reloadTable');

View File

@ -7,7 +7,7 @@
</template>
<script>
import { getTrainingList, deleteUserTraining } from '@/api/jmap/training';
import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training';
import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add';
export default {
@ -39,7 +39,7 @@ export default {
},
queryList: {
query: getTrainingList,
query: getTrainingListNew,
selectCheckShow: false,
indexShow: true,
columns: [
@ -126,7 +126,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteUserTraining(row.id).then(response => {
deleteUserTrainingNew(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {

View File

@ -50,7 +50,8 @@ import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import LimitList from '@/views/components/limits/index';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import { trainingNotify } from '@/api/simulation';
import { trainingNotify, trainingNotifyNew } from '@/api/simulation';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
@ -75,7 +76,8 @@ export default {
children: 'children',
label: 'name'
},
expandList: []
expandList: [],
drawWay: false
};
},
computed: {
@ -106,6 +108,13 @@ export default {
},
methods: {
initLoadPage() {
getPublishMapInfo(this.$route.query.mapId).then(res => {
if (res.data) {
this.drawWay = res.data.drawWay;
}
}).catch(() => {
this.$message.error(this.$t('error.getMapDataFailed'));
});
getPublishLessonTree(this.$route.query.lessonId).then(response => {
if (response.data.tree && response.data.tree.length > 0) {
this.courseModel = {
@ -135,6 +144,18 @@ export default {
if (obj && obj.type === 'Training') {
if (obj.valid) {
this.disabled = true;
if (this.drawWay) {
trainingNotifyNew({ trainingId: obj.id }).then(resp => {
const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId
};
this.$router.push({ path: `${UrlConfig.displayNew}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
this.disabled = false;
});
} else {
trainingNotify({ trainingId: obj.id }).then(resp => {
const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId
@ -145,6 +166,7 @@ export default {
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
this.disabled = false;
});
}
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),