| | |
| | | * @description 添加或修改图表 |
| | | */ |
| | | handleChart = (item) => { |
| | | const { config } = this.props |
| | | |
| | | let _type = 'editChart' |
| | | if (!item) { |
| | | _type = 'addChart' |
| | |
| | | } |
| | | } |
| | | |
| | | let _columns = config.columns.filter(col => ['text', 'number'].includes(col.type) && col.marks && col.marks.filter(_mark => _mark.signType === 'card').length > 0) |
| | | _columns = _columns.map(col => { |
| | | return { |
| | | uuid: col.uuid, |
| | | value: col.field, |
| | | text: col.label |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | card: item, |
| | | modaltype: _type, |
| | | formlist: getChartViewForm(item, this.props.sysRoles) |
| | | formlist: getChartViewForm(item, this.props.sysRoles, _columns) |
| | | }) |
| | | } |
| | | |