dev_202412
yujialong 2 months ago
parent b4b748d3ca
commit 1d800d91b2
  1. 31
      src/views/course/content/source.vue
  2. 129
      src/views/course/detail.vue
  3. 31
      src/views/match/add/set.vue
  4. 22
      src/views/shop/add.vue

@ -34,18 +34,17 @@
<!-- 小节 --> <!-- 小节 -->
<div v-if="chapter.shrink" class="sections"> <div v-if="chapter.shrink" class="sections">
<div v-for="(section, k) in chapter.subsections" :key="k" class="line"> <div v-for="(section, k) in chapter.subsections" :key="k" class="line">
<img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt=""> <el-checkbox class="check" v-model="section.check" @change="checkSection(section, chapter)">
<img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt=""> <img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt="">
<img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'" <img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt="">
src="@/assets/img/exts/word.png" alt=""> <img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'"
<img v-else-if="section.fileType === 'xlsx' || section.fileType === 'xls'" src="@/assets/img/exts/word.png" alt="">
src="@/assets/img/exts/excel.png" alt=""> <img v-else-if="section.fileType === 'xlsx' || section.fileType === 'xls'"
<img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt=""> src="@/assets/img/exts/excel.png" alt="">
<img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt=""> <img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt="">
<img v-else src="@/assets/img/exts/pic.png" alt=""> <img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt="">
<el-checkbox class="check" v-model="section.check" @change="checkSection(section, chapter)">{{ <img v-else src="@/assets/img/exts/pic.png" alt="">
section.name {{ section.name }}</el-checkbox>
}}</el-checkbox>
</div> </div>
</div> </div>
</div> </div>
@ -376,6 +375,10 @@ export default {
.check { .check {
margin: 0 10px; margin: 0 10px;
img {
vertical-align: middle;
}
} }
.cover { .cover {
@ -391,7 +394,7 @@ export default {
} }
.chapters { .chapters {
padding-left: 21px; padding-left: 26px;
margin-top: 10px; margin-top: 10px;
.line { .line {
@ -405,7 +408,7 @@ export default {
} }
.sections { .sections {
padding-left: 26px; padding-left: 43px;
} }
} }

@ -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)">
@ -222,7 +222,8 @@
</div> </div>
<!-- 配置弹窗 --> <!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia"> <el-drawer title="添加系统资源" :visible.sync="configVisible" size="1200px" :close-on-click-modal="false"
custom-class="config-dia">
<div class="config-wrap"> <div class="config-wrap">
<div class="item system"> <div class="item system">
<div class="title-wrap flex-center"> <div class="title-wrap flex-center">
@ -267,37 +268,39 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span> <span>已选择项目{{ checkeds.length }}</span>
</div> </div>
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" <el-input style="width: 200px;" placeholder="请输入项目名称" prefix-icon="el-icon-search"
v-model.trim="checkedKeyword" clearable></el-input> v-model.trim="checkedKeyword" clearable></el-input>
<el-table :data="checkeds" class="table" header-align="center" max-height="470"> <div class="systems">
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column> <el-table :data="checkeds" class="table" header-align="center">
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> <el-table-column type="index" width="55" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" width="80" label="系统类型" align="center"> <el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
<template slot-scope="scope"> <el-table-column prop="projectName" width="80" label="系统类型" align="center">
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }} <template slot-scope="scope">
</template> {{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }}
</el-table-column> </template>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"> <el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<template slot-scope="scope"> <el-table-column prop="projectName" label="项目名称" align="center">
{{ scope.row.projectName || scope.row.paperName }} <template slot-scope="scope">
</template> {{ scope.row.projectName || scope.row.paperName }}
</el-table-column> </template>
<el-table-column label="操作" align="center" width="55"> </el-table-column>
<template slot-scope="scope"> <el-table-column label="操作" align="center" width="55">
<i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]" <template slot-scope="scope">
@click="delProject(scope.$index, scope.row)"></i> <i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]"
</template> @click="delProject(scope.$index, scope.row)"></i>
</el-table-column> </template>
</el-table> </el-table-column>
</el-table>
</div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <div class="btns">
<el-button @click="configVisible = false"> </el-button> <el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button> <el-button type="primary" @click="handleConfirm"> </el-button>
</span> </div>
</el-dialog> </el-drawer>
</div> </div>
</template> </template>
@ -382,7 +385,6 @@ export default {
multiplePractice: [], multiplePractice: [],
submiting: false, // submiting: false, //
loadIns: null,
updateTime: 0, updateTime: 0,
systems: [], systems: [],
systemsAll: [], systemsAll: [],
@ -442,6 +444,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'
if (data.supplier) data.supplier = data.supplier.split(',').map(e => +e) if (data.supplier) data.supplier = data.supplier.split(',').map(e => +e)
this.form = data this.form = data
this.$nextTick(() => { this.$nextTick(() => {
@ -807,17 +810,17 @@ 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.supplier = form.supplier.join() form.supplier = form.supplier.join()
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',
@ -825,7 +828,6 @@ export default {
}) })
try { try {
const res = await this.$post(this.api[cid ? 'modifyCourse' : 'createCurriculum'], form) const res = await this.$post(this.api[cid ? 'modifyCourse' : 'createCurriculum'], form)
this.loadIns.close()
if (next) { if (next) {
this.step = 2 this.step = 2
if (!cid) { if (!cid) {
@ -837,7 +839,7 @@ export default {
} }
} finally { } finally {
this.submiting = false this.submiting = false
this.loadIns.close() load.close()
} }
} }
}) })
@ -846,6 +848,13 @@ 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 = { let obj = {
isShow: i.isShow, isShow: i.isShow,
@ -857,14 +866,19 @@ export default {
return obj return obj
}); });
list.sort((a, b) => a.sort - b.sort) list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, { try {
cid: this.cid, await this.$post(this.api.configureCourseProject, {
systemIdByPractice: list cid: this.cid,
}) systemIdByPractice: list
if (next) { })
this.step = 3 if (next) {
} else { this.step = 3
this.back() } else {
this.back()
}
} finally {
this.submiting = false
load.close()
} }
} }
} else if (step === 3) { } else if (step === 3) {
@ -872,6 +886,13 @@ 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 = { let obj = {
isShow: i.isShow, isShow: i.isShow,
@ -883,11 +904,16 @@ export default {
return obj; return obj;
}); });
list.sort((a, b) => a.sort - b.sort) list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, { try {
cid: this.cid, await this.$post(this.api.configureCourseProject, {
systemIdByAssessment: list cid: this.cid,
}) systemIdByAssessment: list
this.step = 4 })
this.step = 4
} finally {
this.submiting = false
load.close()
}
} }
} }
}, },
@ -1068,8 +1094,16 @@ export default {
} }
/deep/.config-dia { /deep/.config-dia {
.el-drawer__header {
padding-bottom: 20px;
margin-bottom: 0;
border-bottom: 1px solid #eee;
}
.config-wrap { .config-wrap {
display: flex; display: flex;
padding: 15px;
gap: 20px;
} }
.title-wrap { .title-wrap {
@ -1078,9 +1112,8 @@ export default {
.item { .item {
width: 250px; width: 250px;
max-height: 600px; height: calc(100vh - 161px);
padding: 10px; padding: 10px;
margin-right: 20px;
overflow: hidden; overflow: hidden;
} }
@ -1089,8 +1122,8 @@ export default {
} }
.systems { .systems {
max-height: calc(100vh - 230px);
margin-top: 10px; margin-top: 10px;
max-height: 520px;
overflow: auto; overflow: auto;
li { li {

@ -25,21 +25,25 @@
</div> </div>
</el-card> </el-card>
<!-- 理论系统 --> <!-- 理论系统选择试卷库非理论则选择系统 -->
<template v-if="isTheory"> <el-card shadow="hover" class="m-b-20">
<!-- 理论系统选择试卷库非理论则选择系统 --> <div>
<el-card shadow="hover" class="mgr20 m-b-20"> <el-radio-group class="m-b-20" v-model="courseSystem">
<div> <el-radio :label="0">从课程中选择</el-radio>
<p class="m-b-20">试卷库</p> <el-radio :label="1">从系统中选择</el-radio>
<div class="inline-input"> </el-radio-group>
<el-select v-model="libraryId" placeholder="请选择试卷库" @change="getProject">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId"> <div class="inline-input">
</el-option> <el-select v-model="libraryId" placeholder="请选择试卷库" @change="getProject">
</el-select> <el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId">
</div> </el-option>
</el-select>
</div> </div>
</el-card> </div>
</el-card>
<!-- 理论系统 -->
<template v-if="isTheory">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<span>理论试卷</span> <span>理论试卷</span>
@ -179,6 +183,7 @@ export default {
paperName: '', paperName: '',
permissionsKeys: ['练习', '考核', '竞赛'], permissionsKeys: ['练习', '考核', '竞赛'],
timeInvalid: false, timeInvalid: false,
courseSystem: 1,
}; };
}, },
computed: { computed: {

@ -902,16 +902,18 @@ export default {
this.selectedProduct = true this.selectedProduct = true
form.classificationIds = !data.curriculumType ? 2 : data.curriculumType form.classificationIds = !data.curriculumType ? 2 : data.curriculumType
form.mallDisciplines = data.curriculumDisciplines if (data.curriculumDisciplines && data.curriculumDisciplines.length) {
form.mallDisciplines.forEach(e => { form.mallDisciplines = data.curriculumDisciplines
this.$set(e, 'professionalClassList', []) form.mallDisciplines.forEach(e => {
this.$set(e, 'professionalList', []) this.$set(e, 'professionalClassList', [])
e.categoryId && this.getProfessionalClassData(e) this.$set(e, 'professionalList', [])
e.professionalCategoryId && this.getProfessionalData(e) e.categoryId && this.getProfessionalClassData(e)
if (!e.categoryId) this.$set(e, 'categoryId', '') e.professionalCategoryId && this.getProfessionalData(e)
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '') if (!e.categoryId) this.$set(e, 'categoryId', '')
if (!e.professionalId) this.$set(e, 'professionalId', '') if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '')
}) if (!e.professionalId) this.$set(e, 'professionalId', '')
})
}
form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = data.settlementPrice form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = data.settlementPrice

Loading…
Cancel
Save