king
2020-06-09 f448bd7b318f7696c97b392a263bc364700bc8a0
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
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    permRoles: state.permRoles,
    dataManager: state.dataManager
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(MainAction)