Commit 911e9aa3 authored by 沈翠玲's avatar 沈翠玲

优化作业端版本记录上传

parent 0ecfcdb2
......@@ -118,7 +118,7 @@
:headers="headers"
:show-file-list="false"
:limit="1">
<el-button size="small" type="primary">浏览</el-button>
<el-button size="small" type="primary" :loading="loading">浏览</el-button>
</el-upload>
</el-input>
</el-form-item>
......@@ -166,6 +166,7 @@
title: "",
// 是否显示弹出层
open: false,
loading: false,
// 查询参数
queryParams: {
pageNum: 1,
......@@ -189,18 +190,18 @@
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
this.loading = true
// 校检文件后缀名
if(file && file.name && file.name.substring(file.name.lastIndexOf('.') + 1) === 'apk') {
return true;
} else {
this.$message.error('请上传APK安装包');
this.loading = false
return false;
}
console.log('file', file)
return true;
},
handleUploadSuccess(res, file) {
this.loading = false
// 如果上传成功
if (res.code == 200) {
this.form.url = res.url
......@@ -211,6 +212,7 @@
this.$refs.upload.clearFiles();
},
handleUploadError() {
this.loading = false
this.$message.error("文件上传失败");
},
/** 查询作业端版本记录列表 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment