king
2021-06-09 73a5124745890650d0fc91234bdbaa66d9bcbc6a
src/menu/components/chart/antv-bar/index.jsx
@@ -123,9 +123,11 @@
  }
  componentDidMount () {
    this.viewrender()
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('tabsChange', this.handleTabsChange)
    setTimeout(() => {
      this.viewrender()
    }, 1000)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -196,10 +198,14 @@
   */
  linerender = () => {
    const { card } = this.state
    let plot = {...card.plot, height: card.plot.height - 70} // 去除title所占空间
    let plot = {...card.plot} // 去除title所占空间
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    let data = this.getdata(X_axis, Y_axis)
@@ -383,12 +389,16 @@
   */
  customrender = (data) => {
    let card = fromJS(this.state.card).toJS()
    let plot = {...card.plot, height: card.plot.height - 70} // 去除title所占空间
    let plot = {...card.plot} // 去除title所占空间
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let fields = []
    let legends = []
    let transfield = {}
    let Bar_axis = []
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    card.columns.forEach(col => {
      if (col.field) {
@@ -792,10 +802,14 @@
   */
  barrender = () => {
    const { card } = this.state
    let plot = {...card.plot, height: card.plot.height - 70}
    let plot = {...card.plot}
    let color = plot.color || 'rgba(0, 0, 0, 0.65)'
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || ['y']
    if (card.plot.title || card.search.length > 0) {
      plot.height = card.plot.height - 70
    }
    let data = this.getdata(X_axis, Y_axis)
    
@@ -1154,7 +1168,6 @@
    return (
      <div className="menu-line-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}>
        <NormalHeader config={card} updateComponent={this.updateComponent}/>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            {!ismob ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null}
@@ -1172,12 +1185,13 @@
        } trigger="hover">
          <Icon type="tool" />
        </Popover>
        {card.plot.title || card.search.length > 0 ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null}
        <div className="canvas" id={card.uuid + 'canvas'}></div>
        <ActionComponent
          type="chart"
          config={card}
          updateaction={this.updateComponent}
        />
        <div className="canvas" id={card.uuid + 'canvas'}></div>
      </div>
    )
  }