king
2020-11-03 37a134bd23ec4b227a0e010b08a1a89c2bbaaa0d
src/tabviews/custom/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Row, Col, Button, message } from 'antd'
import moment from 'moment'
@@ -22,6 +22,7 @@
const AntvTabs = asyncSpinComponent(() => import('./components/tabs/antv-tabs'))
const DataCard = asyncSpinComponent(() => import('./components/card/data-card'))
const PropCard = asyncSpinComponent(() => import('./components/card/prop-card'))
const MainSearch = asyncSpinComponent(() => import('./components/search/main-search'))
class CustomPage extends Component {
  static propTpyes = {
@@ -365,27 +366,6 @@
    })
  }
  /**
   * @description 搜索条件改变时,重置表格数据
   * 含有初始不加载的页面,修改设置
   */
  refreshbysearch = (searches) => {
    this.setState({
      mainSearch: searches
    })
  }
  /**
   * @description 页面刷新,重新获取配置
   */
  reloadview = () => {
    this.setState({ loadingview: true, viewlost: false, lostmsg: '', data: null, loading: false, search: ''
    }, () => {
      this.loadconfig()
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
@@ -413,12 +393,7 @@
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) {
      if (nextProps.refreshTab.position === 'view') {
        this.reloadview()
      }
      this.props.refreshTabView('')
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -432,6 +407,10 @@
    this.setState = () => {
      return
    }
  }
  resetSearch = (search) => {
    this.setState({mainSearch: search})
  }
  getComponents = () => {
@@ -453,10 +432,16 @@
            <AntvPie config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
          </Col>
        )
      } else if (item.type === 'search') {
        return (
          <Col span={item.width} key={item.uuid}>
            <MainSearch config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} refreshdata={this.resetSearch} />
          </Col>
        )
      } else if (item.type === 'tabs') {
        return (
          <Col span={item.width} key={item.uuid}>
            <AntvTabs config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
            <AntvTabs config={item} BID={BID} mainSearch={mainSearch} />
          </Col>
        )
      } else if (item.type === 'card') {