diff --git a/fe/PC/src/components/importFile/index.vue b/fe/PC/src/components/importFile/index.vue index f3c940a36..d3a0218af 100644 --- a/fe/PC/src/components/importFile/index.vue +++ b/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 { // 显示预览页 - this.previewShow = true - this.submitDataLS = val - // 文件数据展示 - this.readerData(val[1].fields[0].fieldValue[0]) + // 没上传文件时 不显示预览界面 + 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('请上传文件!'); + } } }, // 提交数据