From 33787eadf15b1e4913c954cce4cef07b414ce7b7 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 6 Jan 2025 11:47:46 +0800 Subject: [PATCH] fix --- src/api/index.js | 1 + src/pages/achievement/list/index.vue | 5 +- src/pages/achievement/list/project.vue | 3 +- src/pages/lesson/content/index.vue | 16 ++--- src/pages/lesson/content/source.vue | 14 ++++- src/pages/lesson/detail/index.vue | 85 +++++--------------------- src/pages/lesson/list/index.vue | 9 +++ src/pages/project/add/index.vue | 2 +- src/pages/project/list/index.vue | 2 +- 9 files changed, 52 insertions(+), 85 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index c5f5a51..1e2f242 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -548,6 +548,7 @@ export default { editSubsectionCurriculm: `nakadai/nakadai/curriculum/subsection/editSubsection`, deleteSubsectionCurriculm: `nakadai/nakadai/curriculum/subsection/deleteSubsection`, schoolCourseShelf: `nakadai/nakadai/curriculum/schoolCourseShelf`, + copySelfBuildCourse: `nakadai/nakadai/curriculum/copySelfBuildCourse`, resourceLibrary: `nakadai/resourceLibrary/resourceLibrary`, resourceDel: `nakadai/resourceLibrary/batchDeletion`, diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index 4c87dae..617a164 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -53,7 +53,10 @@ export default { this.active = i const el = this.$refs.project - el && el.getCourse && el.getCourse() + if (el && el.getCourse) { + el.form.curriculumId = '' + el.getCourse() + } }, initTabs () { const { btns } = this diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue index 023398c..ea21a07 100644 --- a/src/pages/achievement/list/project.vue +++ b/src/pages/achievement/list/project.vue @@ -210,12 +210,13 @@ export default { ...this.form, mallId: cur.mallId || '', systemId: cur.systemId || '', + courseType: this.$parent.active === 'tab2' ? 1 : 0, pageNum: this.page, pageSize: this.pageSize, }; this.$post(this.api.getAchievementInfo, data).then(res => { let list = [] - if (permissions == 0) { + if (this.$parent.active === 'tab3' && !permissions) { list = res.page this.total = res.total } else { diff --git a/src/pages/lesson/content/index.vue b/src/pages/lesson/content/index.vue index 4489420..65252ed 100644 --- a/src/pages/lesson/content/index.vue +++ b/src/pages/lesson/content/index.vue @@ -83,7 +83,7 @@ :close-on-click-modal="false"> - + @@ -103,8 +103,8 @@ - - + @@ -128,10 +128,10 @@ - + - @@ -248,7 +248,7 @@ export default { rules: { sectionName: [ - { required: true, message: "请输入小节名称", trigger: "blur" } + { required: true, message: "请输入资源名称", trigger: "blur" } ], }, sectionForm: { @@ -622,7 +622,7 @@ export default { } }, async sectionSubmit (e) { - if (!this.sectionForm.sectionName) return this.$message.warning('请填写小节名称') + if (!this.sectionForm.sectionName) return this.$message.warning('请填写资源名称') if (this.uploading) return this.$message.warning('资源正在上传中,请稍候') if (!this.fileUrl && !this.fileId) return this.$message.warning('请上传资源') const data = { @@ -792,7 +792,7 @@ export default { } }, sectionNameSubmit () { - if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称") + if (!this.sectionForm.sectionName) return this.$message.warning("请填写资源名称") this.$put(this.api.editSubsectionCurriculm, { id: this.sectionId, cid: this.id, diff --git a/src/pages/lesson/content/source.vue b/src/pages/lesson/content/source.vue index e44718d..26a6789 100644 --- a/src/pages/lesson/content/source.vue +++ b/src/pages/lesson/content/source.vue @@ -142,8 +142,8 @@ export default { tab2: '精品课程', tab3: '文件素材', }, - sourceType: SourceConst.types, - curType: '', + sourceType: [], + curType: '全部', sources: [], checkAll: false, keyword: '', @@ -176,6 +176,14 @@ export default { init () { this.getCourse() this.checked = [] + this.curType = '全部' + this.sourceType = [ + { + id: '', + name: '全部' + }, + ...SourceConst.types + ] this.sourceType.forEach(e => { e.check = false }) @@ -193,7 +201,7 @@ export default { platformId: Setting.platformId, type: 2, keyword: this.keyword, - displayFileType: this.curType ? [this.curType] : [], + displayFileType: this.curType === '全部' ? [] : [this.curType], }) const list = page.records list.forEach(e => { diff --git a/src/pages/lesson/detail/index.vue b/src/pages/lesson/detail/index.vue index 9634b7b..7067258 100644 --- a/src/pages/lesson/detail/index.vue +++ b/src/pages/lesson/detail/index.vue @@ -222,28 +222,11 @@
课程系统列表
-
    -
  • -
    - -
    - {{ item.label }} - -
    -
    - -
    -
    - -
    - {{ system.systemName }} - -
    -
    -
    -
  • -
+
+ +
@@ -464,6 +447,10 @@ export default { e.label = e.curriculumName e.check = false e.systemInfo && e.systemInfo.map(n => { + n.cid = e.cid || '' + n.mallId = e.mallId || '' + n.id = +n.systemId + n.label = n.systemName n.check = false }) }) @@ -560,58 +547,17 @@ export default { this.form.coverUrl = this.defaultCover }, - // 课程选择回调 - courseChange (val, item) { - item.systemInfo && item.systemInfo.map(e => e.check = val) - this.systemChange(val, { - systemId: item.systemInfo ? item.systemInfo.map(e => e.systemId).join() : '' - }, item) - }, - // 系统选择回调 - async systemChange (val, system, course) { - // 项目列表选中状态同步 - const { projects, checkeds } = this - if (projects.length && projects[0].systemId == system.systemId) { - projects.map(e => { - e.check = val - }) - } - this.projectKeyword = '' - const res = await this.$post(this.api.configureCourseProjectBySchool, { - projectName: this.projectKeyword, - permissions: this.permissions, - cid: course.cid, - systemId: system.systemId - }) - const list = res.projectManages - list.forEach(e => { - const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId)) - if (val) { - i === -1 && checkeds.push(e) - } else if (i !== -1) { - checkeds.splice(i, 1) - } - }) - this.checkedAll = _.cloneDeep(checkeds) // 全部已选项目,另外保存 - }, // 获取项目列表 - async getProject (item, system) { + async getProject (row) { const checked = this.checkeds - if (system) { - this.curCourse = item.cid - this.curSystem = +system.systemId - this.curSystemIds = '' - } else if (item) { - this.curCourse = item.cid - this.curSystem = '' - this.curSystemIds = item.systemInfo ? item.systemInfo.map(e => e.systemId).join() : '' - } - + let systemId = row.systemId || '' + if (row.systemInfo) systemId = row.systemInfo.map(e => e.systemId).join() const res = await this.$post(this.api.configureCourseProjectBySchool, { projectName: this.projectKeyword, permissions: this.permissions, - cid: this.curCourse, - systemId: this.curSystem || this.curSystemIds, + cid: row.cid || '', + systemId, + mallId: row.mallId || '', }) const list = res.projectManages list.map(e => { @@ -1120,7 +1066,6 @@ export default { .system { width: 350px; - background-color: #f9f9f9; } .systems { diff --git a/src/pages/lesson/list/index.vue b/src/pages/lesson/list/index.vue index 1b3fe3d..c93aeef 100644 --- a/src/pages/lesson/list/index.vue +++ b/src/pages/lesson/list/index.vue @@ -251,6 +251,15 @@ export default { }, // 复制 async copy (row) { + this.$confirm('确定要复制吗', "提示", { + type: "warning" + }).then(async () => { + await this.$post(`${this.api.copySelfBuildCourse}?cid=${row.cid}`) + Util.successMsg('复制成功') + this.initData() + }).catch(() => { }) + + return this.$router.push(`detail?cid=${row.cid}©=1`) }, // 内容设置 diff --git a/src/pages/project/add/index.vue b/src/pages/project/add/index.vue index 35d285d..da83edf 100644 --- a/src/pages/project/add/index.vue +++ b/src/pages/project/add/index.vue @@ -362,7 +362,7 @@ export default { res.data.map(e => { e.id = e.mallId e.label = e.curriculumName - e.children = data.filter(n => e.systemId.split(',').includes(n.id + '') && n.id !== 21) // 筛选出该课程下的系统 + if (e.systemId) e.children = data.filter(n => e.systemId.split(',').includes(n.id + '') && n.id !== 21) // 筛选出该课程下的系统 }) this.curs = res.data } diff --git a/src/pages/project/list/index.vue b/src/pages/project/list/index.vue index 716781b..a369005 100644 --- a/src/pages/project/list/index.vue +++ b/src/pages/project/list/index.vue @@ -307,7 +307,7 @@ export default { data.map(e => { e.id = e.mallId e.label = e.curriculumName - e.children = all.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 + if (e.systemId) e.children = all.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 }) this.curs = data this.curChange(this.cid, 1)