king
2020-12-03 753ac5f57b10588e225c1d82203b13a81bc9c9a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import PropTypes from 'prop-types'
 
import { mobOptions } from './option'
import SourceWrap from './dragsource'
import './index.scss'
 
class CardChart extends Component {
  static propTpyes = {
    appType: PropTypes.string  // 应用类型
  }
 
  state = {}
 
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
 
  render() {
    const { appType } = this.props
 
    return (
      <div className="mob-card-source-box">
        {appType === 'mob' && mobOptions.map((item, index) => (
          <div key={index}>
            <p>{item.title}</p>
            {item.options.map((cell, i) => (<SourceWrap key={i} content={cell} />))}
          </div>
        ))}
      </div>
    )
  }
}
 
export default CardChart