|
|
|
|
@ -12,6 +12,19 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:type>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
面向对象:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select clearable placeholder="请选择类型" v-model="form.type" style="width: 300px;">
|
|
|
|
|
<el-option v-for="item in types" :value="item.id" :key="item.id" :label="item.value">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:expire_day>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
@ -47,6 +60,21 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:file>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">资料上传:</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload style="width: 620px" accept=".jpg,.png,.mp4" :multiple="true" class="upload-demo" :action="action"
|
|
|
|
|
:before-upload="uploadBeforePic" :on-success="picListSuccessHandler" :on-remove="picListRemoveHandler"
|
|
|
|
|
:file-list="fileList" list-type="picture" multiple>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">
|
|
|
|
|
只能上传jpg/png/mp4文件
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:content>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
@ -62,34 +90,8 @@
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:type>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
面向对象:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select clearable placeholder="请选择类型" v-model="form.type" style="width: 300px;">
|
|
|
|
|
<el-option v-for="item in types" :value="item.id" :key="item.id" :label="item.value">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:file>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">资料上传:</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload style="width: 620px" :multiple="true" class="upload-demo" :action="action"
|
|
|
|
|
:before-upload="uploadBeforePic" :on-success="picListSuccessHandler" :on-remove="picListRemoveHandler"
|
|
|
|
|
:file-list="fileList" list-type="picture" multiple>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<!-- <div slot="tip" class="el-upload__tip">
|
|
|
|
|
只能上传jpg/png/mp4文件,且不超过10M
|
|
|
|
|
</div> -->
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:ask_list>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">测试题库:</div>
|
|
|
|
|
@ -203,8 +205,8 @@ import xyTinymce from "@/components/XyTinymce/index.vue";
|
|
|
|
|
type: "",
|
|
|
|
|
rate: "",
|
|
|
|
|
minute: "",
|
|
|
|
|
content: "",
|
|
|
|
|
file: [],
|
|
|
|
|
content: "",
|
|
|
|
|
ask_list: []
|
|
|
|
|
},
|
|
|
|
|
// 题库
|
|
|
|
|
@ -278,10 +280,26 @@ import xyTinymce from "@/components/XyTinymce/index.vue";
|
|
|
|
|
// },
|
|
|
|
|
//上传
|
|
|
|
|
uploadBeforePic(file) {
|
|
|
|
|
if (file.size / 1000 > 2048) {
|
|
|
|
|
this.$successMessage('上传图片大小超过2M!', '', 'warning')
|
|
|
|
|
return false;
|
|
|
|
|
console.log(file)
|
|
|
|
|
// if (file.size / 1000 > 2048) {
|
|
|
|
|
// this.$successMessage('上传图片大小超过2M!', '', 'warning')
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// 截取上传的文件名后缀
|
|
|
|
|
let fileExtName = file.name.substring(file.name.lastIndexOf(".") + 1);
|
|
|
|
|
console.log(fileExtName)
|
|
|
|
|
if(
|
|
|
|
|
fileExtName === 'jpg' ||
|
|
|
|
|
fileExtName === 'png' ||
|
|
|
|
|
fileExtName === 'mp4'
|
|
|
|
|
){
|
|
|
|
|
//进行上传成功的一些操作;
|
|
|
|
|
console.log('file',file);
|
|
|
|
|
}else{
|
|
|
|
|
this.$successMessage('只能上传.jpg、.png,.mp4类型的文件!', '', 'warning')
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
picListSuccessHandler(res, file, fileList) {
|
|
|
|
|
this.form.file = fileList.map((item) => {
|
|
|
|
|
|