版权声明:本文为QQ帝国原创博客,非经本人同意,且勿转载。。 https://blog.csdn.net/QQ_Empire/article/details/84677219
<el-upload
class="upload-demo"
action="http://192.168.0.134:8080/uploadingImg"
:on-change="handleChange"
:on-success="success"
:file-list="fileList3">
<el-button size="small" type="primary" >点击上传</el-button>
</el-upload><br>
<Button type="primary" @click="download()">导出表格</Button>
//上传
handleChange(file, fileList) {
// this.fileList3 = fileList.slice(-3);
const loading = this.$loading({
lock: true,
text: 'Uploading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
success(response, file, fileList) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
//console.log(response)
this.sort = response.gsu;
this.massage = response.msg;
this.sort2 = response.gsu;
var that = this;
axios({
method: "post",
url: "http://106.14.173.50:8080/sort",
params: {
GSU: that.sort
}
})
.then(function(data) {
loading.close();
// setTimeout(() => {
//
// }, 2000);
console.log(data.data)
that.sort2 = data.data.gsu
console.log(that.sort2)
if(data.data.msg == "SUCCESS") {
alert("上传成功")
}
})
},
download() {// var aaa = 201810231859311860006;
var bbb = this.sort2;
window.location.href="http://106.14.173.50:8080/download?GSU="+bbb;
// window.location.href="http://192.168.0.134:8080/exportEXL?mid=1?id=1";
},