dev_202412
yujialong 2 months ago
parent 59f018f18c
commit 6beec3d7e7
  1. 3
      src/components/Navbar.vue
  2. 3
      src/components/Sidebar.vue
  3. 1
      src/utils/api.js
  4. 8
      src/views/Home.vue
  5. 139
      src/views/course/content/index.vue
  6. 18
      src/views/course/content/source.vue
  7. 21
      src/views/course/detail.vue
  8. 10
      src/views/course/list.vue
  9. 482
      src/views/shop/add.vue
  10. 20
      src/views/shop/list.vue

@ -124,6 +124,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.menus { .menus {
z-index: 1000;
position: sticky;
top: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
background-color: #062c87; background-color: #062c87;

@ -148,7 +148,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.sidebar { .sidebar {
width: 200px; min-width: 200px;
max-width: 200px;
height: calc(100vh - 116px); height: calc(100vh - 116px);
overflow: auto; overflow: auto;
transition: .5s; transition: .5s;

@ -167,6 +167,7 @@ export default {
checkConfig: `nakadai/nakadai/curriculum/checkConfig`, checkConfig: `nakadai/nakadai/curriculum/checkConfig`,
deleteCoursePrompt: `nakadai/nakadai/curriculum/deleteCoursePrompt`, deleteCoursePrompt: `nakadai/nakadai/curriculum/deleteCoursePrompt`,
combinationResource: `nakadai/nakadai/curriculum/combinationResource`, combinationResource: `nakadai/nakadai/curriculum/combinationResource`,
replaceResource: `nakadai/nakadai/curriculum/subsection/replaceResource`,
// 课程章节管理 // 课程章节管理
addChapter: `nakadai/nakadai/curriculum/chapter/addChapter`, //添加章节 addChapter: `nakadai/nakadai/curriculum/chapter/addChapter`, //添加章节
editChapter: `nakadai/nakadai/curriculum/chapter/editChapter`, //修改章节 editChapter: `nakadai/nakadai/curriculum/chapter/editChapter`, //修改章节

@ -77,17 +77,19 @@ export default {
background: #f5f7fa; background: #f5f7fa;
.content-box { .content-box {
flex: 1; width: calc(100vw - 208px);
height: calc(100vh - 116px);
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
-webkit-transition: left 0.3s ease-in-out; -webkit-transition: left 0.3s ease-in-out;
transition: left 0.3s ease-in-out; transition: left 0.3s ease-in-out;
overflow: auto;
} }
.sidebar:not(.show) { .sidebar:not(.show) {
margin-left: -200px; margin-left: -200px;
&+.content-box {
width: 100%;
}
} }
} }
</style> </style>

@ -86,7 +86,7 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" <el-dialog title="本地上传资源" :visible.sync="sectionVisible" width="540px" @close="closeSection"
:close-on-click-modal="false"> :close-on-click-modal="false">
<el-form ref="form" :model="sectionForm" label-width="80px" @submit.native.prevent> <el-form ref="form" :model="sectionForm" label-width="80px" @submit.native.prevent>
<el-form-item label="资源添加"> <el-form-item label="资源添加">
@ -199,6 +199,13 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="更换内容资源" :visible.sync="switchTypeVisible" width="400px">
<ul class="source-list">
<li @click="sourceVisible = true">系统资源</li>
<li @click="editSection">本地上传</li>
</ul>
</el-dialog>
<Source :visible.sync="sourceVisible" /> <Source :visible.sync="sourceVisible" />
</div> </div>
</template> </template>
@ -224,11 +231,11 @@ export default {
uploading: false, uploading: false,
uploadList: [], uploadList: [],
chapterVisible: false, chapterVisible: false,
chapterId: "", chapterId: '',
chapterName: "", chapterName: '',
sectionVisible: false, sectionVisible: false,
sectionName: "", sectionName: '',
sectionId: "", sectionId: '',
switchVisible: false, switchVisible: false,
sectionNameVisible: false, sectionNameVisible: false,
@ -242,16 +249,16 @@ export default {
}, },
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
fileId: "", fileId: '',
fileName: "", fileName: '',
fileUrl: "", fileUrl: '',
originalFileName: "", originalFileName: '',
fileType: "", fileType: '',
videoSrc: '', videoSrc: '',
playAuth: "", playAuth: '',
player: null, player: null,
previewImg: "", previewImg: '',
iframeSrc: "", iframeSrc: '',
curSection: {}, curSection: {},
isAddSection: false, isAddSection: false,
isWord: false, isWord: false,
@ -262,7 +269,7 @@ export default {
showMask2: false, showMask2: false,
loadIns: null, loadIns: null,
pdfVisible: false, pdfVisible: false,
pdfSrc: "", pdfSrc: '',
previewing: false, previewing: false,
showProgress: false, showProgress: false,
progressPercent: 0, progressPercent: 0,
@ -284,6 +291,8 @@ export default {
}, },
sourceVisible: false, sourceVisible: false,
sections: [], sections: [],
switchTypeVisible: false,
}; };
}, },
mounted () { mounted () {
@ -443,8 +452,8 @@ export default {
// //
batchDelSection () { batchDelSection () {
const list = this.sections.filter(e => e.check) const list = this.sections.filter(e => e.check)
this.$confirm(list.length ? '此删除操作不可逆,是否确认删除选中项?' : '此删除操作不可逆,是否确认全部资源?', "提示", { this.$confirm(list.length ? '此删除操作不可逆,是否确认删除选中项?' : '此删除操作不可逆,是否确认删除全部资源?', "提示", {
type: "warning" type: 'warning'
}).then(async () => { }).then(async () => {
await this.$post(this.api.deleteSubsectionBatch, { await this.$post(this.api.deleteSubsectionBatch, {
chapterId: this.chapterId, chapterId: this.chapterId,
@ -556,7 +565,7 @@ export default {
}).catch(() => { }) }).catch(() => { })
}, },
closeSection () { closeSection () {
this.isAddSection = false; this.isAddSection = false
this.progressPercent = 0 this.progressPercent = 0
}, },
@ -565,7 +574,8 @@ export default {
this.curSection = {} this.curSection = {}
this.sourceVisible = true this.sourceVisible = true
}, },
addSection (id) { //
addSection () {
this.sectionForm.sectionName = '' this.sectionForm.sectionName = ''
this.fileUrl = '' this.fileUrl = ''
this.uploadList = [] this.uploadList = []
@ -573,14 +583,22 @@ export default {
this.isAddSection = true this.isAddSection = true
this.sectionVisible = true this.sectionVisible = true
}, },
//
editSection () {
this.sectionForm.sectionName = this.curSection.name
this.fileUrl = ''
this.uploadList = []
this.isAddSection = false
this.sectionVisible = true
},
chapterSubmit () { chapterSubmit () {
if (!this.chapterName) return this.$message.warning("请填写章节名称"); if (!this.chapterName) return this.$message.warning("请填写章节名称");
let data = { const data = {
cid: this.id, cid: this.id,
name: this.chapterName name: this.chapterName
} }
if (this.chapterId) { if (this.chapterId) {
data.id = this.chapterId; data.id = this.chapterId
this.$put(this.api.editChapter, data).then(res => { this.$put(this.api.editChapter, data).then(res => {
this.$message.success("修改成功") this.$message.success("修改成功")
this.chapterVisible = false this.chapterVisible = false
@ -594,11 +612,11 @@ export default {
}).catch(err => { }) }).catch(err => { })
} }
}, },
sectionSubmit (e) { 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.uploading) return this.$message.warning('资源正在上传中,请稍候')
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源") if (!this.fileUrl && !this.fileId) return this.$message.warning('请上传资源')
let data = { const data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
@ -609,11 +627,16 @@ export default {
fileType: this.fileType, fileType: this.fileType,
originalFileName: this.originalFileName originalFileName: this.originalFileName
} }
this.$post(this.api.addSubsection, data).then(res => { if (this.sectionId) {
this.$message.success("添加成功") await this.$put(this.api.editSubsection, data)
this.sectionVisible = false } else {
this.getData() await this.$post(this.api.addSubsection, data)
}).catch(err => { }) }
this.$message.success('添加成功')
this.sectionVisible = false
this.switchTypeVisible = false
this.getData()
}, },
closeSwitch () { closeSwitch () {
this.fileId = '' this.fileId = ''
@ -713,10 +736,10 @@ export default {
switchFile (row) { switchFile (row) {
this.curSection = row this.curSection = row
this.sectionId = row.id this.sectionId = row.id
this.sourceVisible = true this.switchTypeVisible = true
}, },
switchSubmitFile () { switchSubmitFile () {
let data = { this.$put(this.api.editSubsection, {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
@ -726,30 +749,27 @@ export default {
fileType: this.fileType, fileType: this.fileType,
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
originalFileName: this.originalFileName originalFileName: this.originalFileName
}; }).then(res => {
this.$put(this.api.editSubsection, data).then(res => { this.$message.success("更换成功")
this.$message.success("更换成功"); this.switchVisible = false
this.switchVisible = false; this.getData()
this.getData();
}).catch(err => { }) }).catch(err => { })
}, },
switchSubmit () { switchSubmit () {
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); if (this.uploading) return this.$message.warning("资源正在上传中,请稍候")
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源")
this.switchSubmitFile(); this.switchSubmitFile()
}, },
delSection (row) { delSection (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { row.fileUrl && Oss.del(row.fileUrl)
row.fileUrl && Oss.del(row.fileUrl) this.$message.success("删除成功")
this.$message.success("删除成功"); this.getData()
this.getData(); }).catch(res => { })
}).catch(res => { }).catch(() => { })
});
}).catch(() => { })
}, },
sortChapter (row, type, disabled, index) { sortChapter (row, type, disabled, index) {
if (!disabled) { if (!disabled) {
@ -1016,4 +1036,25 @@ export default {
} }
} }
} }
/deep/.source-list {
display: flex;
gap: 10px;
li {
flex: 1;
line-height: 80px;
font-size: 16px;
text-align: center;
color: #333;
border-radius: 8px;
background-color: #f6f8fa;
border: 1px solid transparent;
cursor: pointer;
&:hover {
border-color: #062c87;
}
}
}
</style> </style>

@ -270,8 +270,24 @@ export default {
type: e.cid ? 0 : 1, type: e.cid ? 0 : 1,
} }
}) })
await this.$post(this.api.combinationResource, result)
const old = this.$parent.curSection //
if (old.id) {
//
await this.$post(this.api.replaceResource, {
chapterId: old.chapterId,
cid: +id,
subsectionId: old.id,
newResource: result
})
} else {
//
await this.$post(this.api.combinationResource, result)
}
this.sourceVisible = false this.sourceVisible = false
this.$parent.switchTypeVisible = false
this.$parent.getData() this.$parent.getData()
this.submiting = false this.submiting = false
} else { } else {

@ -307,6 +307,7 @@ import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor' import editorConfig from '@/utils/editor'
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import _ from 'lodash'
export default { export default {
components: { components: {
Editor, Editor,
@ -383,7 +384,6 @@ export default {
submiting: false, // submiting: false, //
loadIns: null, loadIns: null,
updateTime: 0, updateTime: 0,
systemAll: [],
systems: [], systems: [],
systemsAll: [], systemsAll: [],
systemChecked: [], systemChecked: [],
@ -458,7 +458,6 @@ export default {
}) })
this.assessmentData = aList this.assessmentData = aList
this.form.curriculumDisciplines.forEach(e => { this.form.curriculumDisciplines.forEach(e => {
this.$set(e, 'professionalClassList', []) this.$set(e, 'professionalClassList', [])
this.$set(e, 'professionalList', []) this.$set(e, 'professionalList', [])
@ -468,9 +467,8 @@ export default {
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '') if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '')
if (!e.professionalId) this.$set(e, 'professionalId', '') if (!e.professionalId) this.$set(e, 'professionalId', '')
}) })
}); })
}).catch(err => { }).catch(err => { })
});
}, },
// //
getSupplier () { getSupplier () {
@ -597,7 +595,6 @@ export default {
supplierId: sid ? sid.supplierId : '' supplierId: sid ? sid.supplierId : ''
}).then(res => { }).then(res => {
const list = res.serviceList.records const list = res.serviceList.records
this.systemAll = JSON.parse(JSON.stringify(list)) //
const result = [] const result = []
list.map(e => { list.map(e => {
// //
@ -749,12 +746,12 @@ export default {
this.systemKeyword = '' this.systemKeyword = ''
this.projectKeyword = '' this.projectKeyword = ''
this.checkedKeyword = '' this.checkedKeyword = ''
this.permissions = type; this.permissions = type
this.configVisible = true; this.configVisible = true
this.pageNo = 1; this.pageNo = 1
this.getConfig(); this.getConfig()
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData)) this.checkeds = _.cloneDeep(type == 1 ? this.assessmentData : this.practiceData)
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) this.checkedAll = _.cloneDeep(this.checkeds)
}, },
handleBatchDelete (type) { // handleBatchDelete (type) { //
if (type == 1 && !this.multipleAssessment.length) { if (type == 1 && !this.multipleAssessment.length) {

@ -37,8 +37,7 @@
<el-col :span="4"> <el-col :span="4">
<el-form-item label="课程类别"> <el-form-item label="课程类别">
<el-select v-model="form.curriculumType" clearable @change="getData()"> <el-select v-model="form.curriculumType" clearable @change="getData()">
<el-option label="理论课程" :value="0"></el-option> <el-option v-for="(item, i) in courseTypeStatus" :key="i" :label="item" :value="i"></el-option>
<el-option label="实训课程" :value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -112,8 +111,9 @@ export default {
data () { data () {
return { return {
courseTypeStatus: { courseTypeStatus: {
0: "理论课程", 0: '理论课程',
1: "实训课程" 1: '实训课程',
2: '理实课程',
}, },
name: localStorage.getItem("ms_username"), name: localStorage.getItem("ms_username"),
courseData: [], courseData: [],
@ -121,7 +121,7 @@ export default {
categoryId: +this.$route.query.categoryId || '', categoryId: +this.$route.query.categoryId || '',
professionalCategoryId: +this.$route.query.professionalCategoryId || '', professionalCategoryId: +this.$route.query.professionalCategoryId || '',
professionalId: +this.$route.query.professionalId || '', professionalId: +this.$route.query.professionalId || '',
curriculumType: this.$route.query.curriculumType ? +this.$route.query.curriculumType : '', curriculumType: this.$route.query.curriculumType || '',
curriculumName: this.$route.query.curriculumName || '' curriculumName: this.$route.query.curriculumName || ''
}, },
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,

@ -6,7 +6,7 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover">
<el-form class="model" ref="form" label-width="110px" :disabled="isDetail"> <el-form class="model" ref="form" label-width="110px" :disabled="isDetail">
<el-row> <el-row>
<el-col :span="14" :offset="5"> <el-col :span="14" :offset="5">
@ -308,8 +308,57 @@
</template> </template>
</div> </div>
</el-form-item> </el-form-item>
<!-- 大赛项目配置 -->
<div v-if="form.classificationIds == 3" class="mgb20">
<div class="mgb20 flex-between">
<div class="flex-center ">
<p class="addhr_tag"></p>
<span>大赛项目配置</span>
</div>
<div>
<el-button @click="handleBatchDelete">批量移除</el-button>
<el-button @click="handleConfig" icon="el-icon-plus" circle></el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<el-table :data="matches" class="table" header-align="center" max-height="400"
@selection-change="handleSelectionMatch">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" 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 prop="systemName" label="系统名称" align="center"></el-table-column>
<el-table-column label="排序" align="center" width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShow" :active-value="0" :inactive-value="1"
:disabled="scope.row.disabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-form-item class="req" label="产品简介" prop="briefIntroduction"> <el-form-item class="req" label="产品简介" prop="briefIntroduction">
<el-input v-model="form.mall.productIntroduction" type="textarea" maxlength="200"></el-input> <Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mall.productIntroduction"
:init="editorConfig" :disabled="isDetail" />
</el-form-item> </el-form-item>
<el-form-item class="req" label="详情介绍" prop="briefIntroduction"> <el-form-item class="req" label="详情介绍" prop="briefIntroduction">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' <Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
@ -433,16 +482,97 @@
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber" <Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber"
:autoCropWidth="autoCropWidth" :autoCropHeight="autoCropHeight" @upload="customUpload" /> :autoCropWidth="autoCropWidth" :autoCropHeight="autoCropHeight" @upload="customUpload" />
</el-dialog> </el-dialog>
<!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia">
<div class="config-wrap">
<div class="item system">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>系统列表</span>
</div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword"
clearable></el-input>
<ul class="systems">
<li v-for="(item, i) in systems" :key="i" :title="item.systemName">
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox>
<div :class="['name', { active: curSystem == item.systemId }]" @click="getProject(item)">
<span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i>
</div>
</li>
</ul>
</div>
<div class="item project">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>项目列表</span>
</div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword"
clearable></el-input>
<ul class="systems">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选"
@change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName">
<el-checkbox v-model="item.check"
:label="item.remark ? item.remark + '(' + item.projectName + ')' : (item.projectName || item.paperName)"
@change="val => projectChange(val, item)"></el-checkbox>
</li>
</ul>
</div>
<div class="item checked">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span>
</div>
<el-input style="width: 200px;margin-bottom: 20px;" 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>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="submitConfig"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Util from "@/libs/util"; import Setting from '@/setting'
import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor' import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper' import Cropper from '@/components/img-upload/Cropper'
import Upload from '@/components/upload'; import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import _ from 'lodash'
export default { export default {
data () { data () {
return { return {
@ -513,7 +643,7 @@ export default {
], ],
}, },
productVisible: false, productVisible: false,
tabs: ['理论课程', '实训课程', '数据前瞻', '职站增值应用'], tabs: ['理论课程', '实训课程', '理实课程', '数据前瞻', '职站增值应用'],
products: [], products: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: 1,
@ -560,7 +690,20 @@ export default {
autoCropWidth: 484, autoCropWidth: 484,
autoCropHeight: 278, autoCropHeight: 278,
file: {}, // file: {}, //
picType: 1 picType: 1,
matches: [],
matcheTotal: 0,
multipleMatch: [],
configVisible: false,
systemKeyword: '',
systems: [],
systemChecked: [],
curSystem: '',
projects: [],
projectKeyword: '',
checkedKeyword: '',
checkeds: [],
}; };
}, },
watch: { watch: {
@ -628,6 +771,9 @@ export default {
url: e.mall.appletIcon url: e.mall.appletIcon
} }
] ]
this.matches = e.mallProjectConfig
this.form = e this.form = e
this.getOp() this.getOp()
this.$nextTick(() => { this.$nextTick(() => {
@ -680,8 +826,8 @@ export default {
getProduct () { getProduct () {
const active = this.productActive const active = this.productActive
const keyword = this.productKeyword const keyword = this.productKeyword
// //
if (!active || active == 1) { if (active < 3) {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$post(this.api.curriculumList, { this.$post(this.api.curriculumList, {
curriculumName: keyword, curriculumName: keyword,
@ -689,12 +835,13 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '', supplierId: sid ? sid.supplierId : '',
isShelves: 1 isShelves: 1,
platformId: Setting.platformId
}).then(({ page }) => { }).then(({ page }) => {
this.products = page.records this.products = page.records
this.total = page.total this.total = page.total
}).catch(err => { }) }).catch(err => { })
} else if (active == 2) { // } else if (active == 3) { //
this.$post(this.api.listByEntity, { this.$post(this.api.listByEntity, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -748,26 +895,31 @@ export default {
this.selectedProduct = false this.selectedProduct = false
this.isData = false this.isData = false
this.isPython = false this.isPython = false
// //
if (!active || active == 1) { if (active < 3) {
this.$post(`${this.api.curriculumDetail}?cid=${id}`).then(({ data }) => { this.$post(`${this.api.curriculumDetail}?cid=${id}`).then(({ data }) => {
form.supplierIds = data.supplier.split(',').map(e => +e) form.supplierIds = data.supplier.split(',').map(e => +e)
this.selectedProduct = true this.selectedProduct = true
form.classificationIds = !data.curriculumType ? 2 : data.curriculumType form.classificationIds = !data.curriculumType ? 2 : data.curriculumType
form.mallDisciplines = [{
professionalClassList: [], form.mallDisciplines = data.curriculumDisciplines
professionalList: [], form.mallDisciplines.forEach(e => {
categoryId: data.categoryId, this.$set(e, 'professionalClassList', [])
professionalId: data.professionalId, this.$set(e, 'professionalList', [])
professionalCategoryId: data.professionalCategoryId, 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 form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice = data.settlementPrice
this.getProfessionalClassData(form.mallDisciplines[0])
this.getProfessionalData(form.mallDisciplines[0])
if (data.expectedCourse) mall.courseHours = data.expectedCourse if (data.expectedCourse) mall.courseHours = data.expectedCourse
if (data.coverUrl) mall.coverDrawing = data.coverUrl if (data.coverUrl) mall.coverDrawing = data.coverUrl
if (data.miniProgramPictureAddress) mall.appletIcon = data.miniProgramPictureAddress if (data.miniProgramPictureAddress) mall.appletIcon = data.miniProgramPictureAddress
if (data.briefIntroduction) mall.productIntroduction = data.briefIntroduction if (data.briefIntroduction) mall.productIntroduction = data.briefIntroduction
if (data.teachingObjectives) mall.detailedIntroduction = data.teachingObjectives
if (data.marketPrice) mall.marketUnitPrice = data.marketPrice if (data.marketPrice) mall.marketUnitPrice = data.marketPrice
// python // python
const systemIds = data.systemIds.split(',') const systemIds = data.systemIds.split(',')
@ -775,9 +927,9 @@ export default {
this.calcAllSettlement() this.calcAllSettlement()
}).catch(err => { }) }).catch(err => { })
} else { } else {
form.classificationIds = active == 2 ? 5 : 3 form.classificationIds = active == 3 ? 5 : 3
// //
if (active == 2) { if (active == 3) {
const item = this.products.find(e => e.cid == id) const item = this.products.find(e => e.cid == id)
if (item) { if (item) {
form.supplierIds = [+item.supplier] form.supplierIds = [+item.supplier]
@ -1213,8 +1365,196 @@ export default {
return false return false
} }
}, },
//
handleConfig () {
this.systemKeyword = ''
this.projectKeyword = ''
this.checkedKeyword = ''
this.configVisible = true
this.pageNo = 1
this.getConfig()
this.checkeds = _.cloneDeep(this.matches)
this.checkedAll = _.cloneDeep(this.checkeds)
},
handleSelectionMatch (val) {
this.multipleMatch = val
},
//
handleBatchDelete () {
if (!this.multipleMatch.length) return this.$message.warning("请勾选竞赛项目!")
this.$confirm("此操作将批量移除项目, 是否继续?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleMatch.map(i => i.projectId);
let tempArr = [];
for (let i = 0; i < this.matches.length; i++) {
if (!ids.includes(this.matches[i].projectId)) {
tempArr.push(this.matches[i])
}
}
this.matches = tempArr;
this.$message.success("批量移除成功")
}).catch(() => { })
},
handleDelete (index, data) { //
this.$confirm("此操作将移除该项目, 是否继续?", "提示", {
type: "warning"
}).then(() => {
data.splice(index, 1);
this.$message.success("移除成功");
}).catch(() => {
this.$message.info("已取消移除");
});
},
//
getConfig () {
const checked = this.matches
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$post(this.api.queryServiceConfig, {
systemName: this.systemKeyword,
pageNum: 1,
pageSize: 1000,
supplierId: sid ? sid.supplierId : ''
}).then(res => {
const list = res.serviceList.records
const result = []
list.map(e => {
//
// if (!checked.find(n => n.systemId == e.systemId)) {
// e.check = !!checked.find(n => n.systemId == e.systemId)
e.check = false
result.push(e)
// }
})
this.systems = result
this.checkAll = !!checked.find(n => n.systemId == result[0].systemId) //
result.length && this.getProject(result[0])
}).catch(err => { })
},
//
async getProject (item, fromSystemChange) {
const checked = this.checkeds
if (item) this.curSystem = item.systemId
let res
if (!fromSystemChange) {
res = await this.$get(`${this.api.getInternalProjectBySystemId}?permissions=2&systemId=${this.curSystem}&keyword=${this.projectKeyword}`)
}
const result = []
const projects = fromSystemChange ? this.projects : res
projects.map(e => {
//
const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId))
e.check = include
result.push(e)
})
this.checkAll = !result.filter(e => !e.check).length
this.projects = result
},
//
systemChange (val, item) {
//
const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) {
projects.map(e => {
e.check = val
})
}
this.projectKeyword = ''
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=2&systemId=${item.systemId}&keyword=${this.projectKeyword}`).then(res => {
if (val) {
//
if (!this.mulSystem) {
this.systems.map(e => e.check = false)
item.check = true
}
res.map(e => {
if (!checkeds.find(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))) {
checkeds.push(e)
}
})
} else {
res.map(e => {
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))
i === -1 || checkeds.splice(i, 1)
})
}
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
this.getProject(item, 1)
}).catch(err => { })
},
//
checkAllChange (val, systemId) {
this.systemChange(val, { systemId })
this.systems.map(e => {
if (e.systemId == systemId) e.check = val
})
},
//
projectChange (val, item) {
const { systemId, paperId } = item
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId))
// push
if (val) {
this.checkeds.push(item)
} else if (i !== -1) {
this.checkeds.splice(i, 1)
}
//
this.systems.map(e => {
if (e.systemId == systemId) e.check = !this.projects.filter(n => !n.check).length
})
this.checkAll = !this.projects.find(e => !e.check) //
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
},
//
filterChecked () {
const val = this.checkedKeyword
this.checkeds = this.checkedAll.filter(e => (e.projectName && e.projectName.includes(val)) || (e.paperName && e.paperName.includes(val)))
},
//
delProject (i, e) {
if (e.disabled) return
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.checkeds.splice(i, 1)
// checkdisabled
if (e.systemId == this.curSystem) {
const { projectId, paperId } = e
this.projects.map(n => {
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) {
n.check = false
}
})
this.checkAll = !this.projects.find(e => !e.check)
}
this.systems.map(n => {
if (n.systemId == e.systemId) n.check = false
})
}).catch(() => { })
},
//
submitConfig () {
const list = this.checkeds
if (!list.length) {
this.$message.warning("请选择系统!")
} else {
this.configVisible = false
list.map((e, i) => {
e.isShow = 0 // isShow(0: 1:)
e.sort = i + 1 //
})
this.matches = JSON.parse(JSON.stringify(list))
this.matchTotal = this.matches.length;
}
},
submit (state, next) { submit (state, next) {
const form = JSON.parse(JSON.stringify(this.form)) const form = _.cloneDeep(this.form)
const { mall } = form const { mall } = form
if (!mall.productName) return Util.errorMsg('请输入产品名称!') if (!mall.productName) return Util.errorMsg('请输入产品名称!')
if (!state) { if (!state) {
@ -1239,6 +1579,7 @@ export default {
} }
} }
if (priceInvalid) return if (priceInvalid) return
if (this.form.classificationIds == 3 && !this.matches.length) return Util.errorMsg('请选择大赛项目!')
if (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!') if (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!')
if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!') if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!')
} }
@ -1252,6 +1593,20 @@ export default {
form.mallNonAssociatedLinks = links form.mallNonAssociatedLinks = links
form.mall.state = state form.mall.state = state
form.mall.isShelves = state form.mall.isShelves = state
//
form.systemIdByCompetition = this.matches.map(i => {
let obj = {
isShow: i.isShow,
projectId: i.projectId,
paperId: i.paperId || '',
sort: +i.sort,
systemId: i.systemId
};
return obj
})
form.systemIdByCompetition.sort((a, b) => a.sort - b.sort)
if (this.submiting) return false if (this.submiting) return false
this.submiting = true this.submiting = true
if (form.mall.mallId) { if (form.mall.mallId) {
@ -1310,7 +1665,7 @@ export default {
} }
.model { .model {
height: calc(100vh - 350px); height: calc(100vh - 317px);
overflow: auto; overflow: auto;
} }
@ -1571,4 +1926,83 @@ $avatar-width: 104px;
} }
} }
} }
/deep/.config-dia {
.config-wrap {
display: flex;
}
.title-wrap {
margin-bottom: 15px;
}
.item {
width: 250px;
max-height: 600px;
padding: 10px;
margin-right: 20px;
overflow: hidden;
}
.system {
background-color: #f9f9f9;
}
.systems {
margin-top: 10px;
max-height: 520px;
overflow: auto;
li {
display: flex;
align-items: center;
margin: 10px 0;
}
.name {
display: inline-flex;
flex: 1;
justify-content: space-between;
align-items: center;
margin-left: 5px;
cursor: pointer;
&.active,
&:hover {
color: #062c87;
}
span {
max-width: 200px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
}
.checked {
flex: 1;
width: auto;
.el-table .cell {
font-size: 12px;
}
}
.rm {
font-size: 14px;
cursor: pointer;
&.disabled {
color: #ccc;
cursor: not-allowed;
}
&:hover {
color: #17161f;
}
}
}
</style> </style>

@ -45,25 +45,25 @@
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" <el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange"
row-key="id" @sort-change="sortChange"> row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="60" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="70" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="产品名称" min-width="150" align="center"></el-table-column> <el-table-column prop="productName" label="产品名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="supplierName" label="厂商" min-width="150" align="center"></el-table-column> <el-table-column prop="supplierName" label="厂商" min-width="100" align="center"></el-table-column>
<el-table-column prop="classificationName" label="产品分类" min-width="150" align="center"></el-table-column> <el-table-column prop="classificationName" label="产品分类" min-width="100" align="center"></el-table-column>
<el-table-column prop="typeName" label="产品类型" min-width="150" align="center"></el-table-column> <el-table-column prop="typeName" label="产品类型" min-width="100" align="center"></el-table-column>
<el-table-column prop="associatedProductName" label="关联产品" min-width="140" align="center"></el-table-column> <el-table-column prop="associatedProductName" label="关联产品" min-width="110" align="center"></el-table-column>
<el-table-column prop="courseName" label="状态" min-width="140" align="center"> <el-table-column prop="courseName" label="状态" width="70" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isShelves ? '下架' : '上架' }} {{ scope.row.isShelves ? '下架' : '上架' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="orderQuantity" label="订单量" min-width="150" align="center"></el-table-column> <el-table-column prop="orderQuantity" label="订单量" width="80" align="center"></el-table-column>
<el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column> <el-table-column prop="userName" label="最近编辑人" width="120" align="center"></el-table-column>
<el-table-column prop="selected" label="精选" min-width="150" align="center" sortable="custom"> <el-table-column prop="selected" label="精选" width="80" align="center" sortable="custom">
<template slot-scope="scope"> <template slot-scope="scope">
<i v-auth="'/shop:产品管理:精选'" :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" <i v-auth="'/shop:产品管理:精选'" :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']"
@click="selected(scope.row)"></i> @click="selected(scope.row)"></i>

Loading…
Cancel
Save