|
|
|
@ -86,8 +86,8 @@ |
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<div class="cover-wrap"> |
|
|
|
|
<el-upload name="file" accept=".jpg,.png,.jpeg,.gif" ref="upload" drag :on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" action="" |
|
|
|
|
:http-request="handleRequest"> |
|
|
|
|
:on-error="uploadError" :before-remove="beforeRemove" :limit="10000" :file-list="fileList" |
|
|
|
|
:on-exceed="handleExceed" action="" :http-request="handleRequest"> |
|
|
|
|
<i class="el-icon-upload"></i> |
|
|
|
|
<div class="el-upload__text"> |
|
|
|
|
<p>将图片拖到此处,或<em>点击上传</em></p> |
|
|
|
@ -322,6 +322,7 @@ export default { |
|
|
|
|
isAdd: true, |
|
|
|
|
editorConfig, |
|
|
|
|
step: 1, |
|
|
|
|
defaultCover: 'https://izhixinyun.com/images/course-cover.png', |
|
|
|
|
form: { |
|
|
|
|
curriculumName: "", |
|
|
|
|
curriculumType: '', |
|
|
|
@ -335,7 +336,7 @@ export default { |
|
|
|
|
systemIdByAssessment: [], |
|
|
|
|
systemIdByPractice: [], |
|
|
|
|
supplier: [], |
|
|
|
|
coverUrl: 'https://izhixinyun.com/images/course-cover.png', |
|
|
|
|
coverUrl: '', |
|
|
|
|
curriculumDisciplines: [ |
|
|
|
|
{ |
|
|
|
|
professionalClassList: [], |
|
|
|
@ -346,6 +347,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
fileList: [], |
|
|
|
|
rules: { |
|
|
|
|
curriculumName: [ |
|
|
|
|
{ required: true, message: "请输入课程名称", trigger: "blur" } |
|
|
|
@ -432,12 +434,10 @@ export default { |
|
|
|
|
this.filterChecked(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
if (this.cid) this.isAdd = false |
|
|
|
|
this.form.coverUrl = this.defaultCover |
|
|
|
|
this.getSubject() |
|
|
|
|
this.getConfig() |
|
|
|
|
this.getSystem() |
|
|
|
@ -447,7 +447,16 @@ 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' |
|
|
|
|
const cover = data.coverUrl |
|
|
|
|
if (!cover) { |
|
|
|
|
data.coverUrl = this.defaultCover |
|
|
|
|
} else if (!cover.includes('course-cover')) { |
|
|
|
|
this.fileList = [{ |
|
|
|
|
name: cover, |
|
|
|
|
url: cover, |
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (data.supplier) data.supplier = data.supplier.split(',').map(e => +e) |
|
|
|
|
this.form = data |
|
|
|
|
this.$nextTick(() => { |
|
|
|
@ -569,6 +578,10 @@ export default { |
|
|
|
|
async handleRequest ({ file }) { |
|
|
|
|
Oss.upload(file).then(res => { |
|
|
|
|
this.form.coverUrl = res.url |
|
|
|
|
this.fileList = [{ |
|
|
|
|
name: res.url, |
|
|
|
|
url: res.url |
|
|
|
|
}] |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
@ -583,7 +596,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleRemove () { |
|
|
|
|
Oss.del(this.form.coverUrl) |
|
|
|
|
this.form.coverUrl = '' |
|
|
|
|
this.form.coverUrl = this.defaultCover |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取系统 |
|
|
|
|