From be1ee97189120705aa681e1f521a0a2efde135de Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Mon, 6 Jan 2025 11:48:37 +0800
Subject: [PATCH] fix
---
src/setting.js | 2 +-
src/utils/api.js | 1 +
src/views/course/content/index.vue | 16 ++++++++--------
src/views/course/content/source.vue | 14 +++++++++++---
src/views/course/detail.vue | 17 +++++++++++++----
src/views/course/list.vue | 10 ++++++++++
6 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/src/setting.js b/src/setting.js
index 5760b63..5f131f8 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -6,7 +6,7 @@ const isDev = process.env.NODE_ENV === 'development' // 开发环境
const isPro = url.includes('huorantech.cn') //正式服
let jumpPath = `${location.origin}/panfen/`
-let sandPath = `http://121.37.12.51/sandbox` // 沙盘地址
+let sandPath = `https://www.occupationlab.com/sandbox` // 沙盘地址
let host = `${location.origin}/`
if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
diff --git a/src/utils/api.js b/src/utils/api.js
index e9e8e9a..820a603 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -172,6 +172,7 @@ export default {
courseLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/courseLearningProgress',
deleteLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/delete',
curriculumGetSubsection: `nakadai/nakadai/curriculum/subsection/getSubsection`,
+ copySelfBuildCourse: `nakadai/nakadai/curriculum/copySelfBuildCourse`,
// 课程笔记
addNote: `nakadai/curriculumNotes/addNote`,
curriculumNoteList: `nakadai/curriculumNotes/curriculumNoteList`,
diff --git a/src/views/course/content/index.vue b/src/views/course/content/index.vue
index 7c24e9d..d80090c 100644
--- a/src/views/course/content/index.vue
+++ b/src/views/course/content/index.vue
@@ -83,7 +83,7 @@
:close-on-click-modal="false">
-
+
-
+
-
@@ -247,7 +247,7 @@ export default {
rules: {
sectionName: [
- { required: true, message: "请输入小节名称", trigger: "blur" }
+ { required: true, message: "请输入资源名称", trigger: "blur" }
],
},
sectionForm: {
@@ -620,7 +620,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 = {
@@ -790,7 +790,7 @@ export default {
}
},
sectionNameSubmit () {
- if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称");
+ if (!this.sectionForm.sectionName) return this.$message.warning("请填写资源名称");
let data = {
id: this.sectionId,
cid: this.id,
diff --git a/src/views/course/content/source.vue b/src/views/course/content/source.vue
index e75e175..c858418 100644
--- a/src/views/course/content/source.vue
+++ b/src/views/course/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/views/course/detail.vue b/src/views/course/detail.vue
index 0204f87..5edce43 100644
--- a/src/views/course/detail.vue
+++ b/src/views/course/detail.vue
@@ -143,7 +143,7 @@
+ @change="practiceSortChange(scope.row, scope.$index)">
@@ -317,7 +317,7 @@ export default {
},
data () {
return {
- cid: this.$route.query.cid,
+ cid: this.$route.query.cid || '',
isCopy: this.$route.query.copy,
isAdd: true,
editorConfig,
@@ -818,6 +818,7 @@ export default {
});
},
practiceSortChange (row, index) { // 处理排序
+ // debugger
this.practiceData.splice(index, 1, row);
},
@@ -832,7 +833,7 @@ export default {
if (step === 1) {
this.$refs.form.validate(async (valid) => {
if (valid) {
- const form = JSON.parse(JSON.stringify(this.form))
+ const form = _.cloneDeep(this.form)
form.supplier = form.supplier.join()
form.platformId = Setting.platformId
this.submiting = true
@@ -843,7 +844,15 @@ export default {
background: 'rgba(0, 0, 0, 0.7)'
})
try {
- const res = await this.$post(this.api[cid && !this.isCopy ? 'modifyCourse' : 'createCurriculum'], form)
+ let res
+ if (this.isCopy) {
+ const res1 = await this.$post(`${this.api.copySelfBuildCourse}?cid=${cid}`)
+ form.cid = res1.cid
+ res = await this.$post(this.api.modifyCourse, form)
+ } else {
+ form.cid = cid
+ res = await this.$post(this.api[cid ? 'modifyCourse' : 'createCurriculum'], form)
+ }
if (next) {
this.step = 2
if (!cid) {
diff --git a/src/views/course/list.vue b/src/views/course/list.vue
index 1bfe369..3204db3 100644
--- a/src/views/course/list.vue
+++ b/src/views/course/list.vue
@@ -109,6 +109,7 @@