mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
去掉无用的代码
This commit is contained in:
@@ -107,8 +107,7 @@
|
|||||||
:action="uploadImgUrl"
|
:action="uploadImgUrl"
|
||||||
:on-success="handleUploadSuccess"
|
:on-success="handleUploadSuccess"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:limit="1"
|
:limit="1">
|
||||||
:on-exceed="handleExceed">
|
|
||||||
<el-button type="text">点击上传图片</el-button>
|
<el-button type="text">点击上传图片</el-button>
|
||||||
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -130,12 +129,10 @@
|
|||||||
class="upload-demo Optionsimage"
|
class="upload-demo Optionsimage"
|
||||||
:action="uploadImgUrl"
|
:action="uploadImgUrl"
|
||||||
:data="opt"
|
:data="opt"
|
||||||
:before-upload="handleBeforeUploadOption"
|
|
||||||
:on-success="(response)=>handleUploadOptionsSuccess(i,response)"
|
:on-success="(response)=>handleUploadOptionsSuccess(i,response)"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:before-remove="beforeRemove"
|
:before-remove="beforeRemove"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:on-exceed="handleExceed"
|
|
||||||
:file-list="opt.imgList"
|
:file-list="opt.imgList"
|
||||||
list-type="picture">
|
list-type="picture">
|
||||||
<el-button style="padding-top:0;" type="text">点击上传图片</el-button>
|
<el-button style="padding-top:0;" type="text">点击上传图片</el-button>
|
||||||
@@ -198,8 +195,7 @@
|
|||||||
:action="uploadImgUrl"
|
:action="uploadImgUrl"
|
||||||
:on-success="handleUploadSuccess"
|
:on-success="handleUploadSuccess"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:limit="1"
|
:limit="1">
|
||||||
:on-exceed="handleExceed">
|
|
||||||
<el-button type="text">点击上传图片</el-button>
|
<el-button type="text">点击上传图片</el-button>
|
||||||
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
<div slot="tip" class="el-upload__tip">jpg/png文件不超过500kb</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -376,33 +372,26 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleBeforeUploadOption(file){
|
|
||||||
//上传前的处理,与data关联
|
|
||||||
console.log(file);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
handleUploadOptionsSuccess(optIdx,res){
|
handleUploadOptionsSuccess(optIdx,res){
|
||||||
console.log(optIdx,'optIdx');
|
//console.log(optIdx,'optIdx');
|
||||||
console.log(res,'res');
|
//console.log(res,'res');
|
||||||
this.question.optionList[optIdx].images=res.result.filePath;
|
this.question.optionList[optIdx].images=res.result.filePath;
|
||||||
this.question.optionList[optIdx].imgList=[
|
this.question.optionList[optIdx].imgList=[
|
||||||
{url:res.result.httpPath},
|
{url:res.result.httpPath},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
console.log(res.result.filePath);
|
//console.log(res.result.filePath);
|
||||||
this.question.images=res.result.filePath;
|
this.question.images=res.result.filePath;
|
||||||
|
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
console.log(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(){
|
downloadTemplate(){
|
||||||
let fileName = "试题导入模板.xls";
|
let fileName = "试题导入模板.xls";
|
||||||
let link = document.createElement('a'); //创建a标签
|
let link = document.createElement('a'); //创建a标签
|
||||||
|
|||||||
Reference in New Issue
Block a user