dev_202412
yujialong 2 months ago
parent 04c306898f
commit db23e62753
  1. 20
      src/views/course/content/index.vue
  2. 19
      src/views/course/content/source.vue
  3. 5
      src/views/order/AddOrder.vue
  4. 11
      src/views/resourse/upload.vue

@ -96,8 +96,8 @@
: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="资源添加">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" @beforeUpload="beforeUpload" <Upload :max-size="100000" :limit="10000" :file-list="uploadList" :on-remove="handleRemove"
@onSuccess="uploadSuccess"> @beforeUpload="beforeUpload" @onSuccess="uploadSuccess">
<template slot="tip"> <template slot="tip">
<p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p> <p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p>
</template> </template>
@ -117,8 +117,8 @@
<el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false" <el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false"
@close="closeSwitch"> @close="closeSwitch">
<div style="text-align: center"> <div style="text-align: center">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" @beforeUpload="beforeUpload" <Upload :max-size="100000" :limit="10000" :file-list="uploadList" :on-remove="handleRemove"
@onSuccess="uploadSuccess"> @beforeUpload="beforeUpload" @onSuccess="uploadSuccess">
<div slot="tip"></div> <div slot="tip"></div>
</Upload> </Upload>
</div> </div>
@ -387,6 +387,10 @@ export default {
this.fileType = file.format this.fileType = file.format
this.fileUrl = file.url this.fileUrl = file.url
this.fileName = file.name this.fileName = file.name
this.uploadList = [{
name: file.name,
url: file.url,
}]
}, },
uploadError (err, file, fileList) { uploadError (err, file, fileList) {
this.$message({ this.$message({
@ -584,9 +588,13 @@ export default {
}, },
// //
editSection () { editSection () {
this.sectionForm.sectionName = this.curSection.name const row = this.curSection
this.sectionForm.sectionName = row.name
this.fileUrl = '' this.fileUrl = ''
this.uploadList = [] this.uploadList = [{
name: row.originalFileName,
url: row.fileUrl,
}]
this.isAddSection = false this.isAddSection = false
this.sectionVisible = true this.sectionVisible = true
}, },

@ -63,9 +63,8 @@
<span>资源类型</span> <span>资源类型</span>
</div> </div>
<ul class="lines"> <ul class="lines">
<li v-for="(item, i) in sourceType" :key="i" class="line"> <li v-for="(item, i) in sourceType" :key="i" :class="['line', { active: curType === item.name }]"
<el-checkbox v-model="item.check" :label="item.name" @change="getCourse"></el-checkbox> @click="checkType(item)">{{ item.name }}</li>
</li>
</ul> </ul>
</div> </div>
@ -144,6 +143,7 @@ export default {
tab3: '文件素材', tab3: '文件素材',
}, },
sourceType: SourceConst.types, sourceType: SourceConst.types,
curType: '',
sources: [], sources: [],
checkAll: false, checkAll: false,
keyword: '', keyword: '',
@ -193,7 +193,7 @@ export default {
platformId: Setting.platformId, platformId: Setting.platformId,
type: 2, type: 2,
keyword: this.keyword, keyword: this.keyword,
displayFileType: this.sourceType.filter(e => e.check).map(e => e.name), displayFileType: this.curType ? [this.curType] : [],
}) })
const list = page.records const list = page.records
list.forEach(e => { list.forEach(e => {
@ -316,6 +316,11 @@ export default {
this.sourceChange(e) this.sourceChange(e)
}) })
}, },
//
checkType ({ name }) {
this.curType = name
this.getCourse()
},
// //
sourceChange (row) { sourceChange (row) {
const { check } = row const { check } = row
@ -576,6 +581,12 @@ export default {
.line { .line {
margin-bottom: 10px; margin-bottom: 10px;
cursor: pointer;
&.active {
font-weight: 600;
color: #062c87;
}
} }
} }

@ -431,11 +431,11 @@
<template v-if="viewDisabled || isEdit">使用期限</template> <template v-if="viewDisabled || isEdit">使用期限</template>
<template v-else> <template v-else>
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" <el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4"
@change="batchDeadlineChange(1)" @change="batchDeadlineChange(6)"
@input="productProps[6].deadline = productProps[6].deadline.replace(/[^0-9.]/g, '')" @input="productProps[6].deadline = productProps[6].deadline.replace(/[^0-9.]/g, '')"
v-model="productProps[6].deadline" placeholder="批量输入时间" /> v-model="productProps[6].deadline" placeholder="批量输入时间" />
<el-select class="batch-unit" v-model="productProps[6].unit" :disabled="viewDisabled || isEdit" <el-select class="batch-unit" v-model="productProps[6].unit" :disabled="viewDisabled || isEdit"
placeholder="请选择" @change="batchUnitChange(1)"> placeholder="请选择" @change="batchUnitChange(6)">
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</template> </template>
@ -2756,6 +2756,7 @@ export default {
addCourseJurisdiction (type) { addCourseJurisdiction (type) {
if (!this.form.customerId) return this.$message.warning("请先选择客户"); if (!this.form.customerId) return this.$message.warning("请先选择客户");
this.classificationId = type this.classificationId = type
this.practicalCourseName = ''
this.practicalCourseVisible = true; this.practicalCourseVisible = true;
this.initCourses(); this.initCourses();
}, },

@ -3,9 +3,9 @@
custom-class="source-dia" @closed="closeDia"> custom-class="source-dia" @closed="closeDia">
<el-form label-width="80px" style="padding: 20px"> <el-form label-width="80px" style="padding: 20px">
<el-form-item prop="userName"> <el-form-item prop="userName">
<el-upload name="file" ref="upload" class="import-file" drag :before-upload="beforeUpload" <el-upload name="file" ref="upload" class="import-file" drag :limit="10000" :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :before-remove="beforeRemove" :limit="1" :on-remove="handleRemove" :on-error="uploadError" :before-remove="beforeRemove" :disabled="uploading"
:disabled="uploading" v-loading="uploading" :on-exceed="handleExceed" :file-list="uploadList" action="" v-loading="uploading" :on-exceed="handleExceed" :file-list="uploadList" action=""
:http-request="handleRequest"> :http-request="handleRequest">
<!-- <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> --> <!-- <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> -->
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
@ -105,6 +105,11 @@ export default {
this.form.fileUrl = res.url this.form.fileUrl = res.url
this.form.fileName = res.name this.form.fileName = res.name
this.handleType(res.format) this.handleType(res.format)
this.uploadList = [{
name: res.name,
url: res.url
}]
}) })
}, },
uploadError () { uploadError () {

Loading…
Cancel
Save