diff --git a/src/api/jmap/lessondraft.js b/src/api/jmap/lessondraft.js index a199cbb53..69b47b7c1 100644 --- a/src/api/jmap/lessondraft.js +++ b/src/api/jmap/lessondraft.js @@ -1,9 +1,9 @@ import request from '@/utils/request'; -/** 获取课程树*/ -export function getLessonTree(skinCode) { +// /** 获取课程树*/ +export function getLessonTree(lessonId) { return request({ - url: `/api/lessonDraft/${skinCode}/tree`, + url: `/api/lessonDraft/${lessonId}/tree`, method: 'get' }); } @@ -95,9 +95,9 @@ export function dragSortLessonChapter(data) { }); } -export function getLessonDrftList(params) { +export function getLessonDrftList(mapId, params) { return request({ - url: `/api/lessonDraft`, + url: `/api/lessonDraft/${mapId}/list`, method: 'get', params: params }); diff --git a/src/i18n/langs/en/publish.js b/src/i18n/langs/en/publish.js index 3a40da98d..424d202db 100644 --- a/src/i18n/langs/en/publish.js +++ b/src/i18n/langs/en/publish.js @@ -115,5 +115,9 @@ export default { enterRunPlanName: 'Please enter the name of the diagram', setTheProject: 'Set the project', whetherItBelongsToTheProject: 'Whether it belongs to the project', - belongsProject: 'Belongs project' + belongsProject: 'Belongs project', + theBelongsProjectCannotBeEmpty: 'The belongs project cannot be empty', + pleaseSelectTheBelongsProject: 'Please select the belongs project', + copyMapAs: 'Copy map as', + whetherToCopyData: 'Whether to copy data' }; diff --git a/src/i18n/langs/en/tip.js b/src/i18n/langs/en/tip.js index 734c20a1e..211760601 100644 --- a/src/i18n/langs/en/tip.js +++ b/src/i18n/langs/en/tip.js @@ -215,5 +215,9 @@ export default { applyRunPlanFail:'Submit run plan to publish fail!', cancelRunPlanTips:'This action will revoke the run plan request, whether to continue?', cancelRunPlanSuccess:'Revoke run plan success!', - cancelRunPlanFail:'Revoke run plan fail!' + cancelRunPlanFail:'Revoke run plan fail!', + setProjectSuccess: 'Set belongs project success!', + setProjectFail: 'Set belongs project fail!', + copyMapSuccess: 'Copy map success!', + copyMapFail: 'Copy map fail!' }; diff --git a/src/i18n/langs/zh/publish.js b/src/i18n/langs/zh/publish.js index 57e213ee0..645ea2f94 100644 --- a/src/i18n/langs/zh/publish.js +++ b/src/i18n/langs/zh/publish.js @@ -119,5 +119,9 @@ export default { // refreshFailed 刷新失败 setTheProject: '设置归属项目', whetherItBelongsToTheProject: '是否归属项目', - belongsProject: '归属项目' + belongsProject: '归属项目', + theBelongsProjectCannotBeEmpty: '所属项目不能为空', + pleaseSelectTheBelongsProject: '请选择归属项目', + copyMapAs: '复制地图为', + whetherToCopyData: '是否复制数据' }; diff --git a/src/i18n/langs/zh/tip.js b/src/i18n/langs/zh/tip.js index 74b53796f..b0449577d 100644 --- a/src/i18n/langs/zh/tip.js +++ b/src/i18n/langs/zh/tip.js @@ -215,5 +215,9 @@ export default { applyRunPlanFail:'提交运行图发布申请失败!', cancelRunPlanTips:'此操作将撤销发布运行图申请,是否继续?', cancelRunPlanSuccess:'撤销运行图发布申请成功!', - cancelRunPlanFail:'撤销运行图发布申请失败!' + cancelRunPlanFail:'撤销运行图发布申请失败!', + setProjectSuccess: '设置归属项目成功!', + setProjectFail: '设置归属项目失败!', + copyMapSuccess: '复制地图成功!', + copyMapFail: '复制地图失败!' }; diff --git a/src/router/index.js b/src/router/index.js index 2d88cf724..994aed854 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,7 +19,6 @@ import Error401 from '@/views/error-page/401'; import Errpr404 from '@/views/error-page/404'; import MapProduct from '@/views/system/product/index'; -import ibpDraw from '@/views/system/ibpDraw/index'; import Dictionary from '@/views/system/dictionary/index'; import DictionaryDetail from '@/views/system/dictionaryDetail/index'; import UserControl from '@/views/system/userControl/index'; @@ -28,8 +27,9 @@ import UserExam from '@/views/system/userExam/index'; import UserSimulation from '@/views/system/userSimulation/index'; import ExistingSimulation from '@/views/system/existingSimulation/index'; import CacheControl from '@/views/system/cacheControl/index'; -import SystemGenerate from '@/views/system/systemGenerate/index'; import Trainingrecord from '@/views/system/trainingrecord/index'; +import SystemGenerate from '@/views/system/systemGenerate/index'; +import IbpDraw from '@/views/system/ibpDraw/index'; import Mapedit from '@/views/mapdraft/index'; @@ -48,6 +48,7 @@ import ScriptDisplay from '@/views/scriptManage/display/index'; import TeachDetail from '@/views/teach/detail/index'; import TeachHome from '@/views/teach/index'; import Pay from '@/views/components/pay/index'; + import ExamDetail from '@/views/exam/detail/examDetail'; import ExamHome from '@/views/exam/index'; import ExamCourseDetail from '@/views/exam/detail/courseDetail'; @@ -57,8 +58,6 @@ import DemonstrationDetail from '@/views/demonstration/detail/index'; import PlanMonitorEditTool from '@/views/planMonitor/editTool/index'; import PlanMonitorEditUserTool from '@/views/planMonitor/editTool/userindex'; -// import PlanMonitor from '@/views/planMonitor/index'; -// import PlanMonitorHome from '@/views/planMonitor/home'; import PlanMonitorDetail from '@/views/planMonitor/detail'; import DesignPlatformHome from '@/views/designPlatform/home'; @@ -308,22 +307,12 @@ export const asyncRouter = [ meta: { } }, - { - path: 'map/draw/:mapId/:view', - component: Mapedit, - hidden: true - }, - { - path: 'lesson/edit/:type', - component: LessonEdit, - hidden: true - }, - { + { // 运行图设计 path: 'runPlan/detail/:mapId', component: PlanMonitorDetail, hidden: true }, - { + { // 剧本 path: 'script/home/:mapId', component: ScriptmanageHome, meta: { @@ -331,13 +320,37 @@ export const asyncRouter = [ }, hidden: true }, - { + { // 课程列表 path: 'lesson/home/:mapId', - // /:skinCode component: LessonHome, hidden: true }, - { + { // 操作定义 + path: 'lesson/trainingRule', + component: TrainingRuleList, + hidden: true + }, + { // 操作定义步骤 + path: 'lesson/trainingRule/detail', + hidden: true, + component: TrainingRuleEdit + }, + { // 任务管理 + path: 'lesson/taskManage', + component: Taskmanage, + hidden: true + }, + { // 实训管理 + path: 'lesson/trainingManage', + component: Trainingmanage, + hidden: true + }, + { // 创建课程 + path: 'lesson/edit/:type', + component: LessonEdit, + hidden: true + }, + { // 课程详情 path: 'lesson/details', component: LessonDetail, hidden: true, @@ -354,32 +367,7 @@ export const asyncRouter = [ component: TrainingrecordManage, hidden: true }, - { - path: 'lesson/taskManage', - component: Taskmanage, - hidden: true - }, - { - path: 'lesson/trainingRule', - component: TrainingRuleList, - hidden: true - }, - { - path: 'lesson/trainingRule/detail', - hidden: true, - component: TrainingRuleEdit - }, - { - path: 'lesson/trainingManage/:skinCode', - component: Trainingmanage, - hidden: true - }, - { - path: 'lesson/training/:trainingId/:trainingName', - component: TrainingrecordManage, - hidden: true - }, - { + { // 地图预览 path: 'mapPreview/:mapId', component: MapPreview, hidden: true @@ -412,38 +400,15 @@ export const asyncRouter = [ meta: { } }, - { + { // 地图绘制 path: 'map/draw/:mapId/:view', component: Mapedit, hidden: true }, - { - path: 'lesson/edit/:type', - component: LessonEdit, - hidden: true - }, - { + { // 运行图设计 path: 'runPlan/detail/:mapId', component: PlanMonitorDetail, hidden: true - }, - { - path: 'script/home/:mapId', - component: ScriptmanageHome, - meta: { - i18n: 'router.scriptManage' - }, - hidden: true - }, - { - path: 'lesson/home/:mapId', - component: LessonHome, - hidden: true - }, - { - path: 'lesson/training/:trainingId/:trainingName', - component: TrainingrecordManage, - hidden: true } ] } @@ -503,71 +468,71 @@ export const asyncRouter = [ meta: { }, children: [ - { + { // 仿真详情 path: 'detail/:subSystem', component: DemonstrationDetail, hidden: true }, - { + { // 教学系统 课程列表 path: 'teachHome/:subSystem', component: TeachHome, hidden: true }, - { + { // 课程详情 path: 'teach/:subSystem', component: TeachDetail, hidden: true }, - { - path: 'examHome/:subSystem', - component: ExamHome, - hidden: true - }, - { - path: 'exam/:examId', - component: ExamDetail, - hidden: true - }, - { - path: 'pay/:lessonId', - component: Pay, - hidden: true - }, - { + { // 试卷列表 path: 'course/:subSystem', component: ExamCourseDetail, hidden: true }, - { - path: 'result/:userExamId', - component: ExamResult, + { // 考试系统 课程列表 + path: 'examHome/:subSystem', + component: ExamHome, hidden: true }, - { - path: 'permission/:mapId', - component: Package, + { // 试卷详情 + path: 'exam/:examId', + component: ExamDetail, hidden: true }, - { - path: 'permission/detail/:id', - component: PackageDetail, - hidden: true - }, - { - path: 'draft', - component: PackageDraft, - hidden: true - }, - { + { // 试卷列表 path: 'examRule/manage', component: PublishExamRule, hidden: true }, - { + { // 创建试卷 path: 'examRule/draft/:mode/:ruleId/:lessonId', component: PublishExamRuleDraft, hidden: true }, + { // 购买 + path: 'pay/:lessonId', + component: Pay, + hidden: true + }, + { // 考试结果 + path: 'result/:userExamId', + component: ExamResult, + hidden: true + }, + { // 线路权限列表 + path: 'permission/:mapId', + component: Package, + hidden: true + }, + { // 打包详情 + path: 'permission/detail/:id', + component: PackageDetail, + hidden: true + }, + { // 权限打包 + path: 'draft', + component: PackageDraft, + hidden: true + }, { path: 'runPlan/manage/:mapId', component: PlanMonitorDetail, @@ -772,7 +737,7 @@ export const asyncRouter = [ children: [ { path: 'ibp/edit', - component: ibpDraw, + component: IbpDraw, meta: { i18n: 'router.ibpDraw' } diff --git a/src/views/demonstration/deomonList/index.vue b/src/views/demonstration/deomonList/index.vue index 0f8ed57c8..1818646c9 100644 --- a/src/views/demonstration/deomonList/index.vue +++ b/src/views/demonstration/deomonList/index.vue @@ -42,80 +42,80 @@ import { getPublishMapInfo } from '@/api/jmap/map'; import { launchFullscreen } from '@/utils/screen'; export default { - name: 'DeomonList', - data() { - return { - dialogShow: false, - loading: false, - height: 120, - trainingList: [], - defaultProps: { - label: 'roomName' - }, - group: '', - state: '', - mapId: '' - }; - }, - computed: { - show() { - return this.dialogShow; - }, - title() { - return this.$t('global.synthesisTrainingTitle'); - }, - isWatch() { - return true; - }, - isjoin() { - return true; - } - }, - methods: { - filterNode(value, data) { - if (!value) return true; - return data.label.indexOf(value) !== -1; - }, - clickEvent(obj, node, data) { - this.state = obj.state; - this.group = obj.group; - this.mapId = obj.mapId; - }, - async getList() { - try { - const res = await getjointTrainList(); - this.trainingList = res.data; - } catch (error) { - console.error(error); - } - }, - doShow() { - this.getList(); - this.loading = false; - this.dialogShow = true; - }, - doClose() { - this.loading = false; - this.dialogShow = false; - }, - async handleJoin() { - if (this.group) { - await getjointTraining(this.group); - if (this.state == '02') { - launchFullscreen(); - await putJointTrainingSimulationEntrance(this.group); - const rest = await getPublishMapInfo(this.mapId); - const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem }; - this.$router.push({ path: `/jointTraining`, query: query }); - } else if (this.state == '01') { - const query = { group: this.group }; - this.$router.push({ path: `/trainroom`, query: query }); - } - } else { - this.$message.info(this.$t('global.pleaseChooseRoom')); - } - } - } + name: 'DeomonList', + data() { + return { + dialogShow: false, + loading: false, + height: 120, + trainingList: [], + defaultProps: { + label: 'roomName' + }, + group: '', + state: '', + mapId: '' + }; + }, + computed: { + show() { + return this.dialogShow; + }, + title() { + return this.$t('global.synthesisTrainingTitle'); + }, + isWatch() { + return true; + }, + isjoin() { + return true; + } + }, + methods: { + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + clickEvent(obj, node, data) { + this.state = obj.state; + this.group = obj.group; + this.mapId = obj.mapId; + }, + async getList() { + try { + const res = await getjointTrainList(); + this.trainingList = res.data; + } catch (error) { + console.error(error); + } + }, + doShow() { + this.getList(); + this.loading = false; + this.dialogShow = true; + }, + doClose() { + this.loading = false; + this.dialogShow = false; + }, + async handleJoin() { + if (this.group) { + await getjointTraining(this.group); + if (this.state == '02') { + launchFullscreen(); + await putJointTrainingSimulationEntrance(this.group); + const rest = await getPublishMapInfo(this.mapId); + const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem }; + this.$router.push({ path: `/jointTraining`, query: query }); + } else if (this.state == '01') { + const query = { group: this.group }; + this.$router.push({ path: `/trainroom`, query: query }); + } + } else { + this.$message.info(this.$t('global.pleaseChooseRoom')); + } + } + } }; diff --git a/src/views/demonstration/deomonTopic/index.vue b/src/views/demonstration/deomonTopic/index.vue index 8cfc77656..e75c5e6c3 100644 --- a/src/views/demonstration/deomonTopic/index.vue +++ b/src/views/demonstration/deomonTopic/index.vue @@ -23,52 +23,52 @@ import { getPublishMapInfo } from '@/api/jmap/map'; import { launchFullscreen } from '@/utils/screen'; export default { - name: 'DeomonList', - data() { - return { - dialogShow: false, - group: '', - roomName: '', - state: '', - mapId: '' - }; - }, - computed: { - show() { - return this.dialogShow; - }, - title() { - return this.$t('global.synthesisTrainingTitle'); - } - }, - mounted() { - }, - methods: { - doShow(data) { - this.roomName = data.creator.nickName; - this.group = data.group; - this.state = data.state; - this.mapId = data.mapId; - this.dialogShow = true; - }, - doClose() { - this.dialogShow = false; - }, - async handleJoin() { - if (this.state == '02') { - launchFullscreen(); - await putJointTrainingSimulationEntrance(this.group); - const rest = await getPublishMapInfo(this.mapId); - const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group }; - this.$router.push({ path: `/jointTraining`, query: query }); - } else if (this.state == '01') { - const query = { group: this.group }; - this.$router.push({ path: `/trainroom`, query: query }); - } - this.dialogShow = false; - getjointTraining(this.group); - } - } + name: 'DeomonList', + data() { + return { + dialogShow: false, + group: '', + roomName: '', + state: '', + mapId: '' + }; + }, + computed: { + show() { + return this.dialogShow; + }, + title() { + return this.$t('global.synthesisTrainingTitle'); + } + }, + mounted() { + }, + methods: { + doShow(data) { + this.roomName = data.creator.nickName; + this.group = data.group; + this.state = data.state; + this.mapId = data.mapId; + this.dialogShow = true; + }, + doClose() { + this.dialogShow = false; + }, + async handleJoin() { + if (this.state == '02') { + launchFullscreen(); + await putJointTrainingSimulationEntrance(this.group); + const rest = await getPublishMapInfo(this.mapId); + const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group }; + this.$router.push({ path: `/jointTraining`, query: query }); + } else if (this.state == '01') { + const query = { group: this.group }; + this.$router.push({ path: `/trainroom`, query: query }); + } + this.dialogShow = false; + getjointTraining(this.group); + } + } }; diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index b26865016..0762e2b2a 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -1,9 +1,9 @@ + - - diff --git a/src/views/demonstration/index.vue b/src/views/demonstration/index.vue deleted file mode 100644 index e5f360f13..000000000 --- a/src/views/demonstration/index.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - diff --git a/src/views/demonstration/list/demonList.vue b/src/views/demonstration/list/demonList.vue deleted file mode 100644 index c60d45d40..000000000 --- a/src/views/demonstration/list/demonList.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue index e65b2de98..706485a61 100644 --- a/src/views/exam/detail/examDetail.vue +++ b/src/views/exam/detail/examDetail.vue @@ -1,10 +1,10 @@ diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index caf1cafde..f04d75329 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -40,37 +40,37 @@ import { UrlConfig } from '@/router/index'; import localStore from 'storejs'; export default { - name: 'ExamHome', - data() { - return { - tableData: [], - loading: false - }; - }, - watch: { - '$route.params.subSystem': function(newVal) { - this.loadInitPage(); - } - }, - mounted() { - this.loadInitPage(); - }, - methods: { - loadInitPage() { - if (this.$route.params.subSystem) { - getSubSystemDetail(this.$route.params.subSystem).then(resp =>{ - if (resp.data) { - this.tableData = resp.data.lessonList; - } - }).catch(()=>{ - this.$messageBox(this.$t('error.obtainCourseInformationFailed')); - }); - } - }, - goLesson(row) { - localStore.set('examDetail'+this.$route.params.subSystem, `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}?lessonId=${row.id}`); - this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}`, query: {lessonId: row.id}}); - } - } + name: 'ExamHome', + data() { + return { + tableData: [], + loading: false + }; + }, + watch: { + '$route.params.subSystem': function(newVal) { + this.loadInitPage(); + } + }, + mounted() { + this.loadInitPage(); + }, + methods: { + loadInitPage() { + if (this.$route.params.subSystem) { + getSubSystemDetail(this.$route.params.subSystem).then(resp =>{ + if (resp.data) { + this.tableData = resp.data.lessonList; + } + }).catch(()=>{ + this.$messageBox(this.$t('error.obtainCourseInformationFailed')); + }); + } + }, + goLesson(row) { + localStore.set('examDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}?lessonId=${row.id}`); + this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}`, query: {lessonId: row.id}}); + } + } }; diff --git a/src/views/exam/result.vue b/src/views/exam/result.vue index f277c59db..8c6f93e6c 100644 --- a/src/views/exam/result.vue +++ b/src/views/exam/result.vue @@ -45,82 +45,82 @@ import { submitExam } from '@/api/management/userexam'; import { UrlConfig } from '@/router/index'; export default { - name: 'ExamResult', - props: { - examDetails: { - type: Object, - default: null - } - }, - data() { - return { - resultModel: { - trainingName: '', - score: 0 - }, - loading: true - }; - }, - computed: { - height() { - return this.$store.state.app.height - 50; - } - }, - mounted() { - this.submitExamData(); - }, - methods: { - getSummaries(param) { - const { columns, data } = param; - const sums = []; - columns.forEach((column, index) => { - if (index === 0) { - sums[index] = this.$t('exam.totalScore'); - return; - } - const values = data.map(item => Number(item[column.property])); - if (!values.every(value => isNaN(value))) { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr); - if (!isNaN(value)) { - return prev + curr; - } else { - return prev; - } - }, 0); - sums[index] += this.$t('exam.points'); - } else { - sums[index] = 'N/A'; - } - }); - return sums; - }, - submitExamData() { - this.loading = true; - let count = 3; - const userExamId = this.$route.params.userExamId; - let interval = setInterval(() => { - submitExam(userExamId).then(response => { - this.loading = false; - this.resultModel = response.data; - clearInterval(interval); - interval = null; - }).catch(() => { - if (count-- < 0) { - this.loading = false; - clearInterval(interval); - interval = null; - this.$messageBox(this.$t('error.submitExamFailed')); - } - }); - }, 1000); + name: 'ExamResult', + props: { + examDetails: { + type: Object, + default: null + } + }, + data() { + return { + resultModel: { + trainingName: '', + score: 0 + }, + loading: true + }; + }, + computed: { + height() { + return this.$store.state.app.height - 50; + } + }, + mounted() { + this.submitExamData(); + }, + methods: { + getSummaries(param) { + const { columns, data } = param; + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = this.$t('exam.totalScore'); + return; + } + const values = data.map(item => Number(item[column.property])); + if (!values.every(value => isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] += this.$t('exam.points'); + } else { + sums[index] = 'N/A'; + } + }); + return sums; + }, + submitExamData() { + this.loading = true; + let count = 3; + const userExamId = this.$route.params.userExamId; + let interval = setInterval(() => { + submitExam(userExamId).then(response => { + this.loading = false; + this.resultModel = response.data; + clearInterval(interval); + interval = null; + }).catch(() => { + if (count-- < 0) { + this.loading = false; + clearInterval(interval); + interval = null; + this.$messageBox(this.$t('error.submitExamFailed')); + } + }); + }, 1000); - }, - back() { - const examId = this.resultModel.examId; - this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem }}); - } - } + }, + back() { + const examId = this.resultModel.examId; + this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem }}); + } + } }; diff --git a/src/views/lesson/lessoncategory/edit/lesson/index.vue b/src/views/lesson/lessoncategory/edit/lesson/index.vue index 8dedf6835..bd76ed4f0 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/index.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/index.vue @@ -10,13 +10,13 @@ - - + + @@ -44,7 +44,7 @@