<el-upload action="#" :show-file-list="false" class="upload-demo" :http-request="requestUpload">
<el-button size="small" type="info" icon="el-icon-upload2">导入</el-button>
</el-upload>
requestUpload(value) {
const loading = this.$loading({
lock: true,
text: '正在导入',//等待提示文字
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'//背景
});
let data = new FormData();
data.append('file', value.file);
data.append('tbId', this.tbId);
importMiddleData(data).then(res => {
this.$message({
message: res.msg,
type: 'success'
});
loading.close();
}).catch(err => {
loading.close();
});
},