| | |
| | | */ |
| | | deletechart = (plot) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 ${plot.title} ?`, |
| | | onOk() { |
| | | let _chartlist = fromJS(_this.state.chartlist).toJS() |
| | | let _chartview = _this.state.chartview |
| | | let _chartlist = fromJS(that.state.chartlist).toJS() |
| | | let _chartview = that.state.chartview |
| | | |
| | | _chartlist = _chartlist.filter(item => item.uuid !== plot.uuid) |
| | | |
| | |
| | | _chartview = _chartlist[0].uuid |
| | | } |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | chartlist: _chartlist, |
| | | chartview: _chartview |
| | | }) |
| | | _this.props.updatechartgroup({...config, charts: _chartlist}, _chartview) |
| | | that.props.updatechartgroup({...config, charts: _chartlist}, _chartview) |
| | | }, |
| | | onCancel() {} |
| | | }) |