From f34de4f0017e136e688e13d5ed1f4b1d8906f5f4 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 26 Mar 2020 18:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/training.js | 150 +++++++++++++++--- src/api/simulation.js | 8 +- src/scripts/cmdPlugin/Handler.js | 4 +- src/scripts/plugin/OperateHandler.js | 1 + src/utils/baseUrl.js | 4 +- src/views/designPlatform/demonList.vue | 2 +- src/views/lesson/details.vue | 6 +- src/views/lesson/home.vue | 4 +- .../lessoncategory/edit/chapter/index.vue | 2 +- .../lessoncategory/edit/chapter/list.vue | 9 +- src/views/lesson/trainingmanage/draft.vue | 25 ++- src/views/lesson/trainingmanage/index.vue | 8 +- src/views/newMap/displayNew/index.vue | 6 +- src/views/newMap/displayNew/menuExam.vue | 4 +- src/views/newMap/displayNew/menuLesson.vue | 6 +- src/views/newMap/displayNew/tipExamList.vue | 4 +- src/views/system/userTraining/add.vue | 4 +- src/views/system/userTraining/edit.vue | 4 +- src/views/system/userTraining/index.vue | 6 +- src/views/teach/detail/index.vue | 46 ++++-- 20 files changed, 230 insertions(+), 73 deletions(-) diff --git a/src/api/jmap/training.js b/src/api/jmap/training.js index 276859659..18b81b80c 100644 --- a/src/api/jmap/training.js +++ b/src/api/jmap/training.js @@ -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' + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index 16e57f8ab..9a8ad28c3 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -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 diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index 3cc5fc08d..500c3f4b7 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -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) { diff --git a/src/scripts/plugin/OperateHandler.js b/src/scripts/plugin/OperateHandler.js index b9f4be7c5..fe9ee36fe 100644 --- a/src/scripts/plugin/OperateHandler.js +++ b/src/scripts/plugin/OperateHandler.js @@ -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); } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 506eafc22..4a0fe9bcf 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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'; // 张赛 diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index d2225381f..5aece4aac 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -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': { diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index 974dfbf9e..84345d936 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -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') { diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 5ed1aaa65..5d4212c25 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -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}}); } } }; diff --git a/src/views/lesson/lessoncategory/edit/chapter/index.vue b/src/views/lesson/lessoncategory/edit/chapter/index.vue index 2e00a96f7..8c4c57753 100644 --- a/src/views/lesson/lessoncategory/edit/chapter/index.vue +++ b/src/views/lesson/lessoncategory/edit/chapter/index.vue @@ -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} }); } } }; diff --git a/src/views/lesson/lessoncategory/edit/chapter/list.vue b/src/views/lesson/lessoncategory/edit/chapter/list.vue index 9c52bfb4f..5f217377a 100644 --- a/src/views/lesson/lessoncategory/edit/chapter/list.vue +++ b/src/views/lesson/lessoncategory/edit/chapter/list.vue @@ -15,7 +15,7 @@