From 79e1455e4ba4f4a7d04a483dda1a354e53921a69 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 04 十一月 2020 19:04:14 +0800 Subject: [PATCH] 2020-11-04 --- src/menu/components/chart/antv-pie/index.jsx | 46 +++++++++++++++++++++++++++------------------- 1 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index f8dff44..5829643 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -33,7 +33,7 @@ } UNSAFE_componentWillMount () { - const { card, menu } = this.props + const { card } = this.props if (card.isNew) { let _plot = { @@ -48,17 +48,6 @@ _plot.innerRadius = 50 } - let dataName = '' - - if (card.floor === 1) { - while (!dataName) { - let _dataName = Utils.getdataName() - if (menu.components.filter(com => com.dataName === _dataName).length === 0) { - dataName = _dataName - } - } - } - let _card = { uuid: card.uuid, type: card.type, @@ -68,16 +57,16 @@ format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� - dataName: dataName, + dataName: card.dataName || '', width: _plot.width, name: _plot.name, subtype: card.subtype, setting: { interType: 'system' }, style: { - fontSize: '16px', borderWidth: '1px', borderColor: 'rgb(217, 217, 217)', marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, + headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: 'rgb(217, 217, 217)' }, columns: [], scripts: [], search: [], @@ -385,18 +374,31 @@ MKEmitter.emit('addSearch', card.uuid, newcard) } + changeTitleStyle = () => { + const { card } = this.state + + MKEmitter.emit('changeStyle', [card.uuid, 'header'], ['font', 'border'], card.headerStyle) + } + changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'border', 'padding', 'margin'], card.style) + MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) } getStyle = (comIds, style) => { const { card } = this.state - if (comIds.length !== 1 || comIds[0] !== card.uuid) return + if (comIds[0] !== card.uuid) return - let _card = {...card, style} + let _card = {} + if (comIds.length === 1) { + _card = {...card, style} + } else if (comIds.length === 2 && comIds[1] === 'header') { + _card = {...card, headerStyle: style} + } else { + return + } this.setState({ card: _card @@ -410,8 +412,14 @@ return ( <div className="menu-pie-chart-edit-box" style={{...card.style, height: card.plot.height || 400}}> - <div className="chart-header"> - <span className="chart-title">{card.plot.title || ''}</span> + <div className="chart-header" style={card.headerStyle}> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeTitleStyle} type="font-colors" /> + </div> + } trigger="hover"> + <span className="chart-title">{card.plot.title || ''}</span> + </Popover> <SearchComponent config={card} updatesearch={this.updateComponent} -- Gitblit v1.8.0