mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
去掉无用的代码
This commit is contained in:
@@ -107,8 +107,7 @@
|
||||
:action="uploadImgUrl"
|
||||
:on-success="handleUploadSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed">
|
||||
:limit="1">
|
||||
<el-button type="text">点击上传图片</el-button>
|
||||
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
||||
</el-upload>
|
||||
@@ -130,12 +129,10 @@
|
||||
class="upload-demo Optionsimage"
|
||||
:action="uploadImgUrl"
|
||||
:data="opt"
|
||||
:before-upload="handleBeforeUploadOption"
|
||||
:on-success="(response)=>handleUploadOptionsSuccess(i,response)"
|
||||
:on-remove="handleRemove"
|
||||
:before-remove="beforeRemove"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:file-list="opt.imgList"
|
||||
list-type="picture">
|
||||
<el-button style="padding-top:0;" type="text">点击上传图片</el-button>
|
||||
@@ -198,8 +195,7 @@
|
||||
:action="uploadImgUrl"
|
||||
:on-success="handleUploadSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed">
|
||||
:limit="1">
|
||||
<el-button type="text">点击上传图片</el-button>
|
||||
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
||||
</el-upload>
|
||||
@@ -376,33 +372,26 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handleBeforeUploadOption(file){
|
||||
//上传前的处理,与data关联
|
||||
console.log(file);
|
||||
return true;
|
||||
},
|
||||
|
||||
handleUploadOptionsSuccess(optIdx,res){
|
||||
console.log(optIdx,'optIdx');
|
||||
console.log(res,'res');
|
||||
//console.log(optIdx,'optIdx');
|
||||
//console.log(res,'res');
|
||||
this.question.optionList[optIdx].images=res.result.filePath;
|
||||
this.question.optionList[optIdx].imgList=[
|
||||
{url:res.result.httpPath},
|
||||
]
|
||||
},
|
||||
handleUploadSuccess(res) {
|
||||
console.log(res.result.filePath);
|
||||
//console.log(res.result.filePath);
|
||||
this.question.images=res.result.filePath;
|
||||
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`您确定移除图片吗?`);
|
||||
},
|
||||
//需要同时删除已上传的图片,后续完善要加上
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`您确定移除图片吗?`);
|
||||
},
|
||||
downloadTemplate(){
|
||||
let fileName = "试题导入模板.xls";
|
||||
let link = document.createElement('a'); //创建a标签
|
||||
|
||||
Reference in New Issue
Block a user