dev_202412
yujialong 2 months ago
parent db23e62753
commit be1ee97189
  1. 2
      src/setting.js
  2. 1
      src/utils/api.js
  3. 16
      src/views/course/content/index.vue
  4. 14
      src/views/course/content/source.vue
  5. 17
      src/views/course/detail.vue
  6. 10
      src/views/course/list.vue

@ -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/' // 本地调试-需要启动本地判分点系统

@ -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`,

@ -83,7 +83,7 @@
:close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input>
<el-input placeholder="请输入章节名称,便于对资源归类" v-model="chapterName" maxlength="50"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -103,8 +103,8 @@
</template>
</Upload>
</el-form-item>
<el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" v-model.trim="sectionForm.sectionName" maxlength="50"
<el-form-item label="资源名称">
<el-input placeholder="请输入资源名称" v-model.trim="sectionForm.sectionName" maxlength="50"
@keyup.enter.native="sectionSubmit()"></el-input>
</el-form-item>
</el-form>
@ -128,10 +128,10 @@
</span>
</el-dialog>
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false">
<el-dialog title="修改资源名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false">
<el-form @submit.native.prevent>
<el-form-item>
<el-input placeholder="请输入小节名称" v-model="sectionForm.sectionName" maxlength="50"
<el-input placeholder="请输入资源名称" v-model="sectionForm.sectionName" maxlength="50"
@keyup.enter.native="sectionNameSubmit()"></el-input>
</el-form-item>
</el-form>
@ -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,

@ -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 => {

@ -143,7 +143,7 @@
<el-table-column label="排序" align="center" width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="practiceSortChange(scope.row, scope.$index)"></el-input>
@change="practiceSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
@ -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) {

@ -109,6 +109,7 @@
<script>
import Setting from '@/setting'
import qs from 'qs'
import Util from '@/libs/util'
export default {
data () {
return {
@ -239,6 +240,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(`/curriculum/detail?cid=${row.cid}&copy=1`)
},
//

Loading…
Cancel
Save