Commit 4e48c5f9 authored by 张冬's avatar 张冬

上传文件优化

parent 842be083
......@@ -71,7 +71,7 @@ export default {
},
max: {
type: Number,
default: 99
default: 100
}
},
data() {
......@@ -98,7 +98,7 @@ export default {
this.$emit('input', value);
},
beforeUpload(file) {
this.loading=true
const max = this.max;
const isLt2M = file.size / 1024 / 1024 < max;
if (!isLt2M) {
......@@ -109,6 +109,7 @@ export default {
this.$message.warning(`每次只能上传 ${this.limit} 个文件`);
return;
}
this.loading=true
// 生成的文件名称
let objName = getFileNameUUID();
// 调用 ali-oss 中的方法
......
......@@ -12,7 +12,7 @@
action
multiple
>
<el-button size="small" type="primary">点击上传</el-button>
<el-button size="small" type="primary" v-loading.fullscreen.lock="loading">点击上传</el-button>
<div slot="tip" class="el-upload__tip">{{ tip }}</div>
</el-upload>
</div>
......@@ -92,7 +92,7 @@ export default {
},
max: {
type: Number,
default: 99
default: 100
},
fileList: {
type: Array,
......@@ -101,6 +101,7 @@ export default {
},
data() {
return {
loading: false,
tableData: [],
columns: [
{
......@@ -151,6 +152,7 @@ export default {
this.$message.warning(`每次只能上传 ${this.limit} 个文件`);
return;
}
this.loading=true
// 生成的文件名称
let objName = getFileNameUUID();
// 调用 ali-oss 中的方法
......@@ -165,6 +167,7 @@ export default {
res.fileUrl = res.url;
this.fileList.push(res);
this.$emit('input', this.fileList);
this.loading=false
});
},
handleRemove(file, fileList, index) {
......
......@@ -98,4 +98,7 @@ export default {
.sidebar > ul {
height: 100%;
}
.el-menu-item i {
color: #AFB0B3;
}
</style>
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