king
2020-12-18 106263ec10e60ce6c406e4fd5eb76d195772d0f0
src/tabviews/custom/components/card/data-card/index.jsx
@@ -4,6 +4,7 @@
import { Spin, Empty, notification, Col, Pagination } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import preImg from '@/assets/img/prev.png'
import nextImg from '@/assets/img/next.png'
@@ -13,6 +14,7 @@
const CardItem = asyncComponent(() => import('../cardItem'))
const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList'))
const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader'))
class DataCard extends Component {
  static propTpyes = {
@@ -27,6 +29,7 @@
    BID: '',                   // 上级ID
    BData: '',                 // 上级行数据
    config: null,              // 图表配置信息
    search: null,              // 搜索条件
    pageIndex: 1,              // 页码
    activeKey: '',             // 选中卡
    selectKeys: [],            // 多选时选中卡片
@@ -87,6 +90,7 @@
      BID: BID || '',
      config: _config,
      card: _card,
      search: Utils.initMainSearch(_config.search),
      arr_field: _config.columns.map(col => col.field).join(','),
    }, () => {
      if (_config.setting.sync !== 'true' && _config.setting.onload === 'true') {
@@ -163,7 +167,7 @@
  async loadData () {
    const { mainSearch, menuType } = this.props
    const { config, arr_field, pageIndex, BID } = this.state
    const { config, arr_field, pageIndex, search, BID } = this.state
    if (config.setting.supModule && !BID) { // BID 不存在时,不做查询
      this.setState({
@@ -178,7 +182,7 @@
      return
    }
    let searches = []
    let searches = fromJS(search).toJS()
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      let keys = searches.map(item => item.key)
      mainSearch.forEach(item => {
@@ -268,6 +272,15 @@
      this.loadData()
    })
  }
  refreshSearch = (list) => {
    this.setState({
      search: list,
      pageIndex: 1
    }, () => {
      this.loadData()
    })
  }
  
  changeCard = (index, item) => {
    const { config, selectKeys, selectedData, activeKey } = this.state
@@ -337,6 +350,7 @@
            <Spin />
          </div> : null
        }
        <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} />
        {config.action && config.action.length > 0 ?
          <MainAction
            BID={BID}