Browse Source

上传状态

shibei_master
13176889840 4 years ago
parent
commit
7ff2b8c9c0
  1. 8
      src/views/modules/base/resi.vue

8
src/views/modules/base/resi.vue

@ -24,7 +24,7 @@
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
>
<el-button type="danger" size="small">导入人口数据</el-button>
<el-button type="danger" size="small" :loading="importLoading">{{importBtnTitle}}</el-button>
</el-upload>
</div>
@ -233,6 +233,8 @@ export default {
},
data() {
return {
importBtnTitle: '导入人员数据',
importLoading: false,
rowVisible: false,
tableLoading: false,
btnLoading: false,
@ -392,6 +394,8 @@ export default {
return fileType && isLt1M
},
uploadHttpRequest(file) {
this.importLoading = true
this.importBtnTitle = '正在上传中...'
const formData = new FormData() //FormDataappend('key', value)
formData.append('file', file.file) //
this.$http
@ -402,6 +406,8 @@ export default {
// file.onSuccess()
// console.log('res-ooooo---', res)
// }
this.importLoading = false
this.importBtnTitle = '导入人员数据'
console.log('res-ooooo---', res)
this.download(res, 'info.xlsx')
})

Loading…
Cancel
Save