dev_202412
yujialong 2 months ago
parent ae9e964d61
commit b1d17d3fa9
  1. 2
      src/layouts/navbar/index.vue
  2. 78
      src/pages/lesson/detail/index.vue
  3. 2
      src/pages/lesson/list/index.vue

@ -158,7 +158,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.menus { .menus {
z-index: 1000; z-index: 2000;
position: sticky; position: sticky;
top: 0; top: 0;
display: flex; display: flex;

@ -41,7 +41,7 @@
</el-form-item> </el-form-item>
<el-form-item class="req" label="适用专业" required> <el-form-item class="req" label="适用专业" required>
<div class="subject"> <div v-if="form.curriculumDisciplines && form.curriculumDisciplines.length" class="subject">
<div v-for="(item, i) in form.curriculumDisciplines" :key="i" class="line"> <div v-for="(item, i) in form.curriculumDisciplines" :key="i" class="line">
<el-form-item label="学科类别"> <el-form-item label="学科类别">
<el-select v-model="item.categoryId" @change="getProfessionalClass(item)"> <el-select v-model="item.categoryId" @change="getProfessionalClass(item)">
@ -380,7 +380,6 @@ export default {
multiplePractice: [], multiplePractice: [],
submiting: false, // submiting: false, //
loadIns: null,
updateTime: 0, updateTime: 0,
systemAll: [], systemAll: [],
systems: [], systems: [],
@ -425,6 +424,7 @@ export default {
methods: { methods: {
getInfoData () { getInfoData () {
this.$post(`${this.api.curriculumDetail}?cid=${this.cid}`).then(({ data }) => { this.$post(`${this.api.curriculumDetail}?cid=${this.cid}`).then(({ data }) => {
if (!data.coverUrl) data.coverUrl = 'https://izhixinyun.com/images/course-cover.png'
this.form = data this.form = data
this.practiceData = data.practiceConfig this.practiceData = data.practiceConfig
this.assessmentData = data.assessmentConfig this.assessmentData = data.assessmentConfig
@ -781,16 +781,16 @@ export default {
this.step-- this.step--
}, },
async save (next) { async save (next) {
if (this.submiting) return false
const { step, cid } = this const { step, cid } = this
// //
if (step === 1) { if (step === 1) {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
form.platformId = Setting.platformId form.platformId = Setting.platformId
this.submiting = true this.submiting = true
this.loadIns = this.$loading({ const load = this.$loading({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
@ -798,7 +798,6 @@ export default {
}) })
try { try {
const res = await this.$post(this.api[cid && !this.isCopy ? 'modifyCourse' : 'createCurriculum'], form) const res = await this.$post(this.api[cid && !this.isCopy ? 'modifyCourse' : 'createCurriculum'], form)
this.loadIns.close()
if (next) { if (next) {
this.step = 2 this.step = 2
if (!cid) { if (!cid) {
@ -810,7 +809,7 @@ export default {
} }
} finally { } finally {
this.submiting = false this.submiting = false
this.loadIns.close() load.close()
} }
} }
}) })
@ -819,25 +818,36 @@ export default {
if (!this.practiceData.length) { if (!this.practiceData.length) {
return this.$message.warning("请添加练习项目配置") return this.$message.warning("请添加练习项目配置")
} else { } else {
this.submiting = true
const load = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const list = this.practiceData.map(i => { const list = this.practiceData.map(i => {
let obj = { return {
isShow: i.isShow, isShow: i.isShow,
projectId: i.projectId || '', projectId: i.projectId || '',
paperId: i.paperId || '', paperId: i.paperId || '',
sort: Number(i.sort), sort: Number(i.sort),
systemId: i.systemId systemId: i.systemId
} }
return obj
});
list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByPractice: list
}) })
if (next) { list.sort((a, b) => a.sort - b.sort)
this.step = 3 try {
} else { await this.$post(this.api.configureCourseProject, {
this.back() cid: this.cid,
systemIdByPractice: list
})
if (next) {
this.step = 3
} else {
this.back()
}
} finally {
this.submiting = false
load.close()
} }
} }
} else if (step === 3) { } else if (step === 3) {
@ -845,28 +855,38 @@ export default {
if (!this.assessmentData.length) { if (!this.assessmentData.length) {
return this.$message.warning("请添加考核项目配置") return this.$message.warning("请添加考核项目配置")
} else { } else {
this.submiting = true
const load = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const list = this.assessmentData.map(i => { const list = this.assessmentData.map(i => {
let obj = { return {
isShow: i.isShow, isShow: i.isShow,
projectId: i.projectId, projectId: i.projectId,
paperId: i.paperId || '', paperId: i.paperId || '',
sort: Number(i.sort), sort: Number(i.sort),
systemId: i.systemId systemId: i.systemId
}; }
return obj;
});
list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByAssessment: list
}) })
this.step = 4 list.sort((a, b) => a.sort - b.sort)
try {
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByAssessment: list
})
this.step = 4
} finally {
this.submiting = false
load.close()
}
} }
} }
}, },
// //
back () { back () {
this.loadIns && this.loadIns.close()
this.$router.push(this.$store.state.lesson.referrer || 'list') this.$router.push(this.$store.state.lesson.referrer || 'list')
} }
} }
@ -1150,7 +1170,7 @@ export default {
} }
.lines { .lines {
height: calc(100vh - 186px); height: calc(100vh - 239px);
padding-right: 10px; padding-right: 10px;
margin-top: 10px; margin-top: 10px;
overflow: auto; overflow: auto;

@ -79,7 +79,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="expectedCourse" label="预计课时" width="90" align="center"></el-table-column> <el-table-column prop="expectedCourse" label="预计课时" width="90" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="上架范围" width="90" align="center"></el-table-column> <el-table-column prop="className" label="上架范围" align="center"></el-table-column>
<el-table-column prop="userName" label="创建人" width="120" align="center"></el-table-column> <el-table-column prop="userName" label="创建人" width="120" align="center"></el-table-column>
<el-table-column label="上架/下架" width="90" align="center"> <el-table-column label="上架/下架" width="90" align="center">
<template slot-scope="scope"> <template slot-scope="scope">

Loading…
Cancel
Save