Browse Source

导入优化 无文件不显示预览界面

dev_web_online
陈薪名 2 years ago
parent
commit
362e398e62
  1. 8
      fe/PC/src/components/importFile/index.vue

8
fe/PC/src/components/importFile/index.vue

@ -178,6 +178,8 @@ export default {
// this.$emit("isAllowPartImportChange", this.isAllowPartImportValue); // $emit
// },
readerData(rawFile) {
console.log('11111111111',rawFile)
if (rawFile) {
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.onload = e => {
@ -203,6 +205,7 @@ export default {
}
reader.readAsArrayBuffer(rawFile)
})
}
},
getHeaderRow(sheet) {
const headers = []
@ -238,10 +241,15 @@ export default {
this.submiData(val)
} else {
//
//
if (val[1].fields[0].fieldValue[0]) {
this.previewShow = true
this.submitDataLS = val
//
this.readerData(val[1].fields[0].fieldValue[0])
} else {
this.$message.error('请上传文件!');
}
}
},
//

Loading…
Cancel
Save