<el-upload
class="upload-demo"
:show-file-list="false"
action="123"
:http-request="
(file) => {
uploadExcel(file);
}
"
>
<button class="_confirm">
<span><i class="el-icon-download" /></span>
<span>导入</span>
</button>
</el-upload>
---------------------------------------------------------
uploadExcel(file) {
if (file.file) {
const fd = new FormData();
// const id = this.$store.getters.miningAreaId
const id = this.params.workingFaceId;
fd.append("file", file.file);
// fd.append('miningAreaId ', id)
importExcel({ fd, id }).then((res) => {
console.log(res);
if (res.code === 200) {
this.$message.success("导入成功!");
this.fetchData();
}
});
}
},
el-upload上传下载
最新推荐文章于 2024-05-01 00:54:42 发布