From ad97697406cafc97d02e50827aa6317d790d0797 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 31 Oct 2019 15:56:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/lessondraft.js | 10 +- src/router/index.js | 2 +- src/views/lesson/home.vue | 43 +--- .../lessoncategory/category/operateMenu.vue | 114 ----------- .../lesson/lessoncategory/category/tree.vue | 188 ------------------ .../lessoncategory/edit/lesson/index.vue | 31 ++- 6 files changed, 28 insertions(+), 360 deletions(-) delete mode 100644 src/views/lesson/lessoncategory/category/operateMenu.vue delete mode 100644 src/views/lesson/lessoncategory/category/tree.vue 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/router/index.js b/src/router/index.js index fbdf03a01..a5c2ddafa 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -374,7 +374,7 @@ export const asyncRouter = [ component: TrainingRuleEdit }, { - path: 'lesson/trainingManage/:skinCode', + path: 'lesson/trainingManage', component: Trainingmanage, hidden: true }, diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index 32c97532b..7b0097233 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -24,7 +24,7 @@ import { getLessonDrftList } from '@/api/jmap/lessondraft'; import { UrlConfig } from '@/router/index'; import PublishCreate from './lessoncategory/edit/create'; import PublishLesson from './lessoncategory/edit/lesson/publish'; -import { delLesson, getLessonTree } from '@/api/jmap/lessondraft'; +import { delLesson } from '@/api/jmap/lessondraft'; import LessonDetail from '@/views/approval/lesson/detail'; import ConstConfig from '@/scripts/ConstConfig'; @@ -37,9 +37,7 @@ export default { }, data() { return { - tableData: [], loading: false, - showEdit: false, pagerConfig: { pageSize: 'pageSize', pageIndex: 'pageNum' @@ -48,7 +46,7 @@ export default { show: false }, queryList: { - query: getLessonDrftList, + query: this.queryFunction, selectCheckShow: false, indexShow: true, columns: [ @@ -158,35 +156,8 @@ export default { mounted() { }, methods: { - loadInitData() { - this.loading = true; - getLessonTree(this.$route.params.skinCode).then(response=> { - response.data.forEach(elem => { - if (elem.children) { - elem.children.forEach( it => { - it.parentId = elem.id; - } ); - } - }); - this.tableData = response.data; - this.loading = false; - }).catch(( ) => { - this.$messageBox(this.$t('error.getDraftCourseDataFailed')); - }); - }, - refuse() { - this.loading = true; - getLessonTree(this.$route.params.skinCode).then(response=> { - response.data.forEach(elem => { - if (elem.children) { - elem.children.forEach( it => { - it.parentId = elem.id; - } ); - } - }); - this.tableData = response.data; - this.loading = false; - }); + queryFunction(params) { + return getLessonDrftList(this.$route.params.mapId, params); }, handlerStatus(row) { let lessonStatus = ''; @@ -236,13 +207,13 @@ export default { this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: {id: row.id}}); }, taskManage() { - this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}}); + this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId}}); }, trainingManage() { - this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}}); + this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId}}); }, operationManage() { - this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}}); + this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId}}); }, revertLesson(index, row) { this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), { diff --git a/src/views/lesson/lessoncategory/category/operateMenu.vue b/src/views/lesson/lessoncategory/category/operateMenu.vue deleted file mode 100644 index 1179feb97..000000000 --- a/src/views/lesson/lessoncategory/category/operateMenu.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/src/views/lesson/lessoncategory/category/tree.vue b/src/views/lesson/lessoncategory/category/tree.vue deleted file mode 100644 index e715d3a8f..000000000 --- a/src/views/lesson/lessoncategory/category/tree.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - diff --git a/src/views/lesson/lessoncategory/edit/lesson/index.vue b/src/views/lesson/lessoncategory/edit/lesson/index.vue index e233494a9..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 @@