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

@ -41,7 +41,7 @@
</el-form-item>
<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">
<el-form-item label="学科类别">
<el-select v-model="item.categoryId" @change="getProfessionalClass(item)">
@ -222,7 +222,8 @@
</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="item system">
<div class="title-wrap flex-center">
@ -267,37 +268,39 @@
<p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span>
</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>
<el-table :data="checkeds" class="table" header-align="center" max-height="470">
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="projectName" width="80" label="系统类型" align="center">
<template slot-scope="scope">
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="55">
<template slot-scope="scope">
<i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]"
@click="delProject(scope.$index, scope.row)"></i>
</template>
</el-table-column>
</el-table>
<div class="systems">
<el-table :data="checkeds" class="table" header-align="center">
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="projectName" width="80" label="系统类型" align="center">
<template slot-scope="scope">
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center">
<template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="55">
<template slot-scope="scope">
<i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]"
@click="delProject(scope.$index, scope.row)"></i>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<div class="btns">
<el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button>
</span>
</el-dialog>
</div>
</el-drawer>
</div>
</template>
@ -382,7 +385,6 @@ export default {
multiplePractice: [],
submiting: false, //
loadIns: null,
updateTime: 0,
systems: [],
systemsAll: [],
@ -442,6 +444,7 @@ export default {
methods: {
getInfoData () {
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)
this.form = data
this.$nextTick(() => {
@ -807,17 +810,17 @@ export default {
this.step--
},
async save (next) {
if (this.submiting) return false
const { step, cid } = this
//
if (step === 1) {
this.$refs.form.validate(async (valid) => {
if (valid) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form))
form.supplier = form.supplier.join()
form.platformId = Setting.platformId
this.submiting = true
this.loadIns = this.$loading({
const load = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
@ -825,7 +828,6 @@ export default {
})
try {
const res = await this.$post(this.api[cid ? 'modifyCourse' : 'createCurriculum'], form)
this.loadIns.close()
if (next) {
this.step = 2
if (!cid) {
@ -837,7 +839,7 @@ export default {
}
} finally {
this.submiting = false
this.loadIns.close()
load.close()
}
}
})
@ -846,6 +848,13 @@ export default {
if (!this.practiceData.length) {
return this.$message.warning("请添加练习项目配置")
} 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 => {
let obj = {
isShow: i.isShow,
@ -857,14 +866,19 @@ export default {
return obj
});
list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByPractice: list
})
if (next) {
this.step = 3
} else {
this.back()
try {
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByPractice: list
})
if (next) {
this.step = 3
} else {
this.back()
}
} finally {
this.submiting = false
load.close()
}
}
} else if (step === 3) {
@ -872,6 +886,13 @@ export default {
if (!this.assessmentData.length) {
return this.$message.warning("请添加考核项目配置")
} 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 => {
let obj = {
isShow: i.isShow,
@ -883,11 +904,16 @@ export default {
return obj;
});
list.sort((a, b) => a.sort - b.sort)
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByAssessment: list
})
this.step = 4
try {
await this.$post(this.api.configureCourseProject, {
cid: this.cid,
systemIdByAssessment: list
})
this.step = 4
} finally {
this.submiting = false
load.close()
}
}
}
},
@ -1068,8 +1094,16 @@ export default {
}
/deep/.config-dia {
.el-drawer__header {
padding-bottom: 20px;
margin-bottom: 0;
border-bottom: 1px solid #eee;
}
.config-wrap {
display: flex;
padding: 15px;
gap: 20px;
}
.title-wrap {
@ -1078,9 +1112,8 @@ export default {
.item {
width: 250px;
max-height: 600px;
height: calc(100vh - 161px);
padding: 10px;
margin-right: 20px;
overflow: hidden;
}
@ -1089,8 +1122,8 @@ export default {
}
.systems {
max-height: calc(100vh - 230px);
margin-top: 10px;
max-height: 520px;
overflow: auto;
li {

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

@ -902,16 +902,18 @@ export default {
this.selectedProduct = true
form.classificationIds = !data.curriculumType ? 2 : data.curriculumType
form.mallDisciplines = data.curriculumDisciplines
form.mallDisciplines.forEach(e => {
this.$set(e, 'professionalClassList', [])
this.$set(e, 'professionalList', [])
e.categoryId && this.getProfessionalClassData(e)
e.professionalCategoryId && this.getProfessionalData(e)
if (!e.categoryId) this.$set(e, 'categoryId', '')
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '')
if (!e.professionalId) this.$set(e, 'professionalId', '')
})
if (data.curriculumDisciplines && data.curriculumDisciplines.length) {
form.mallDisciplines = data.curriculumDisciplines
form.mallDisciplines.forEach(e => {
this.$set(e, 'professionalClassList', [])
this.$set(e, 'professionalList', [])
e.categoryId && this.getProfessionalClassData(e)
e.professionalCategoryId && this.getProfessionalData(e)
if (!e.categoryId) this.$set(e, 'categoryId', '')
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

Loading…
Cancel
Save