-
@@ -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)