From f448bd7b318f7696c97b392a263bc364700bc8a0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 09 六月 2020 15:54:45 +0800
Subject: [PATCH] 2020-06-09

---
 src/tabviews/zshare/actionList/index.jsx |   92 +++++++++++++++++++++++++++++++---------------
 1 files changed, 62 insertions(+), 30 deletions(-)

diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx
index b64d801..3db42cd 100644
--- a/src/tabviews/zshare/actionList/index.jsx
+++ b/src/tabviews/zshare/actionList/index.jsx
@@ -1,16 +1,18 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import moment from 'moment'
+import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
 import { Button, Affix, Modal, notification, Spin, message } from 'antd'
 import * as XLSX from 'xlsx'
-import MutilForm from '@/tabviews/zshare/mutilform'
-import ExcelIn from '../excelin'
+import ExcelIn from './excelin'
+import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import Utils from '@/utils/utils.js'
 import options from '@/store/options.js'
 import Api from '@/api'
 import './index.scss'
 
+const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform'))
 const { confirm } = Modal
 let socket = null
 
@@ -31,9 +33,7 @@
     triggerPopview: PropTypes.func,   // 寮圭獥鏍囩椤佃Е鍙�
     getexceloutparam: PropTypes.func, // 鑾峰彇excel瀵煎嚭鏁版嵁
     gettableselected: PropTypes.func, // 鑾峰彇琛ㄦ牸涓暟鎹�
-    permRoles: PropTypes.any,         // 鐢ㄦ埛鏉冮檺鍒楄〃
     triggerBtn: PropTypes.any,
-    dataManager: PropTypes.any        // 鏁版嵁鏉冮檺
   }
 
   state = {
@@ -2612,7 +2612,7 @@
   getModels = () => {
     const { execAction } = this.state
 
-    if (!execAction || !this.state.visible) return
+    if (!execAction || !this.state.visible) return null
 
     let title = ''
     let width = '62vw'
@@ -2668,38 +2668,70 @@
 
     let fixed = this.props.setting.actionfixed && this.props.type === 'main' // 鎸夐挳鏄惁鍥哄畾鍦ㄥご閮�
 
-    let actionlist = <div className="button-list toolbar-button" id={fixed ? this.props.MenuID + 'mainaction' : ''}>
-      {this.props.actions.map((item, index) => {
-        let label = item.label
-        if (loadingUuid === item.uuid && loadingNumber !== '') {
-          label = label + '(' + loadingNumber + ')'
-        }
-
-        return (
-          <Button
-            className={'mk-btn mk-' + item.class}
-            icon={item.icon}
-            key={'action' + index}
-            onClick={() => {this.actionTrigger(item)}}
-            loading={loadingUuid === item.uuid}
-          >{label}</Button>
-        )
-      })}
-      {this.getModels()}
-      {btnloading && <Spin size="large" />}
-      <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" />
-    </div>
-
     if (fixed) {
       return (
         <Affix offsetTop={48}>
-          {actionlist}
+          <div className="button-list toolbar-button" id={fixed ? this.props.MenuID + 'mainaction' : ''}>
+            {this.props.actions.map((item, index) => {
+              let label = item.label
+              if (loadingUuid === item.uuid && loadingNumber !== '') {
+                label = label + '(' + loadingNumber + ')'
+              }
+
+              return (
+                <Button
+                  className={'mk-btn mk-' + item.class}
+                  icon={item.icon}
+                  key={'action' + index}
+                  onClick={() => {this.actionTrigger(item)}}
+                  loading={loadingUuid === item.uuid}
+                >{label}</Button>
+              )
+            })}
+            {this.getModels()}
+            {btnloading && <Spin size="large" />}
+            <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" />
+          </div>
         </Affix>
       )
     } else {
-      return actionlist
+      return (
+        <div className="button-list toolbar-button" id={fixed ? this.props.MenuID + 'mainaction' : ''}>
+          {this.props.actions.map((item, index) => {
+            let label = item.label
+            if (loadingUuid === item.uuid && loadingNumber !== '') {
+              label = label + '(' + loadingNumber + ')'
+            }
+
+            return (
+              <Button
+                className={'mk-btn mk-' + item.class}
+                icon={item.icon}
+                key={'action' + index}
+                onClick={() => {this.actionTrigger(item)}}
+                loading={loadingUuid === item.uuid}
+              >{label}</Button>
+            )
+          })}
+          {this.getModels()}
+          {btnloading && <Spin size="large" />}
+          <ExcelIn MenuID={this.props.MenuID} returndata={this.getexceldata} ref="excelIn" />
+        </div>
+      )
     }
   }
 }
 
-export default MainAction
\ No newline at end of file
+const mapStateToProps = (state) => {
+  return {
+    tabviews: state.tabviews,
+    permRoles: state.permRoles,
+    dataManager: state.dataManager
+  }
+}
+
+const mapDispatchToProps = () => {
+  return {}
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(MainAction)
\ No newline at end of file

--
Gitblit v1.8.0