From f267d04e0561a0a20d1f2a9f558a273558ece90d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 24 五月 2021 17:50:19 +0800
Subject: [PATCH] 2021-05-24

---
 src/tabviews/zshare/actionList/excelInbutton/index.jsx |   53 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
index 33ecd5d..988d6f9 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -6,7 +6,7 @@
 import { Button, Modal, notification, message } from 'antd'
 
 import ExcelIn from './excelin'
-import Utils from '@/utils/utils.js'
+import Utils, { getExcelInSql } from '@/utils/utils.js'
 import options from '@/store/options.js'
 import Api from '@/api'
 import zhCN from '@/locales/zh-CN/main.js'
@@ -93,25 +93,28 @@
         duration: 5
       })
       return
-    }
-
-    if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) {
-      let primaryId = '' // 瀵煎叆鏃惰Id
-      if (btn.Ot === 'requiredSgl') {
-        primaryId = data[0][setting.primaryKey] || ''
-      }
-
-      this.setState({
-        primaryId: primaryId
-      }, () => {
-        this.refs.excelIn.exceltrigger()
-      })
-    } else {
+    } else if (!btn.verify || !btn.verify.sheet || !btn.verify.columns || btn.verify.columns.length === 0) {
       notification.warning({
         top: 92,
         message: 'excel瀵煎叆楠岃瘉淇℃伅鏈缃紒',
         duration: 5
       })
+      return
+    }
+
+    let primaryId = '' // 瀵煎叆鏃惰Id
+    if (btn.Ot === 'requiredSgl' && setting.primaryKey) {
+      primaryId = data[0][setting.primaryKey] || ''
+    }
+
+    this.setState({
+      primaryId: primaryId
+    }, () => {
+      this.refs.excelIn.exceltrigger()
+    })
+
+    if (window.GLOB.systemType === 'production') {
+      MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '瀵煎叆Excel'})
     }
   }
 
@@ -191,7 +194,7 @@
   /**
    * @description Excel 瀵煎叆
    */
-  getexceldata = (data, errors, sheetName) => {
+  getexceldata = (data, errors, sheetName, errDetail) => {
     const { btn } = this.props
 
     if (errors) {
@@ -210,7 +213,7 @@
       } else if (errors === 'headerError') {
         notification.warning({
           top: 92,
-          message: '宸ヤ綔琛ㄣ��' + sheetName + '銆嬭〃澶磋缃敊璇紝璇锋鏌ヨ〃澶翠腑鐨勫悕绉板強椤哄簭锛屼笌鎸夐挳Excel鍒椾俊鎭槸鍚︿竴鑷达紒',
+          message: `宸ヤ綔琛ㄣ��${sheetName}銆嬭〃澶撮敊璇紝${errDetail}`,
           duration: 5
         })
       }
@@ -235,7 +238,7 @@
       })
     }
 
-    let result = Utils.getExcelInSql(btn, data, this.state.dict, (this.props.BID || ''))
+    let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || ''))
 
     if (result.errors) {
       notification.warning({
@@ -342,13 +345,21 @@
           if (btn.sysInterface === 'true' && options.cloudServiceApi) {
             param.rduri = options.cloudServiceApi
           } else if (btn.sysInterface !== 'true') {
-            param.rduri = btn.interface
+            if (window.GLOB.systemType === 'production' && btn.proInterface) {
+              param.rduri = btn.proInterface
+            } else {
+              param.rduri = btn.interface
+            }
           }
         } else {
           if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) {
             param.rduri = window.GLOB.mainSystemApi
           } else if (btn.sysInterface !== 'true') {
-            param.rduri = btn.interface
+            if (window.GLOB.systemType === 'production' && btn.proInterface) {
+              param.rduri = btn.proInterface
+            } else {
+              param.rduri = btn.interface
+            }
           }
         }
 
@@ -415,7 +426,7 @@
           type="link"
           title={show === 'icon' ? btn.label : ''}
           loading={loading}
-          style={btn.btnstyle}
+          style={btn.style}
           icon={show === 'text' ? '' : (show === 'icon' ? (btn.icon || 'upload') : (btn.icon || ''))}
           onClick={() => {this.actionTrigger()}}
         >{show === 'icon' ? '' : btn.label}</Button>

--
Gitblit v1.8.0