From c5e5a7580632bc39a9e0c78d548f22a8be5f2019 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 18 十月 2023 18:04:51 +0800
Subject: [PATCH] 2023-10-18

---
 src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
index cd65eaa..ee873ec 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
@@ -1,7 +1,7 @@
 import React, { Component } from 'react'
 import PropTypes from 'prop-types'
 import { notification } from 'antd'
-import * as XLSX from 'xlsx'
+import * as XLSX from 'sheetjs-style'
 import Utils from '@/utils/utils.js'
 import './index.scss'
 
@@ -27,7 +27,8 @@
   onImportExcel = file => {
     const { btn } = this.props
 
-    let columns = btn.verify.columns.map(option => option.Column)
+    let btnColumns = btn.verify.columns.filter(option => option.import !== 'init')
+    let columns = btnColumns.map(option => option.Column)
     let range = btn.verify.range || 0
 
     // excel鏁版嵁澶勭悊
@@ -45,7 +46,7 @@
         let sheetName = btn.verify.sheet
         let errDetail = ''
 
-        if (Object.keys(workbook.Sheets).length === 1) {
+        if (sheetName === 'Sheet1' && Object.keys(workbook.Sheets).length === 1) {
           sheetName = Object.keys(workbook.Sheets)[0]
         }
 
@@ -58,7 +59,7 @@
             errors = 'empty'
           } else {
             let iserror = false
-            btn.verify.columns.forEach(op => {
+            btnColumns.forEach(op => {
               let _name = typeof(header[op.Column]) === 'string' ? header[op.Column].replace(/(^\s*|\s*$)/g, '') : header[op.Column]
               let _text = op.Text ? op.Text.replace(/(^\s*|\s*$)/g, '') : op.Text
 

--
Gitblit v1.8.0