diff --git a/src/router/index.js b/src/router/index.js index ebf2f5efb..410be165d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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'; @@ -484,56 +483,56 @@ export const asyncRouter = [ 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, 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/planMonitor/index.vue b/src/views/planMonitor/index.vue deleted file mode 100644 index 79c18c59f..000000000 --- a/src/views/planMonitor/index.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 14603be37..f8387f326 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -1,12 +1,12 @@