| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Popover, notification } from 'antd' |
| | | import { Popover, notification } from 'antd' |
| | | import { PlusCircleOutlined, PlusSquareOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet from '@antv/data-set' |
| | | |
| | |
| | | _card.plot.name = card.name |
| | | _card.style = config.style |
| | | _card.headerStyle = config.headerStyle |
| | | _card.setting = config.setting |
| | | _card.columns = config.columns |
| | | _card.scripts = config.scripts |
| | | |
| | | _card.action = config.action.map(col => { |
| | | col.uuid = Utils.getuuid() |
| | |
| | | item.name = transfield[item.type] || item.type |
| | | item.chartType = item.shape ? (item.shape[0] || 'bar') : 'bar' |
| | | item.shape = item.shape ? (item.shape[1] || '') : '' |
| | | item.show = item.show || plot.show |
| | | |
| | | if (colors.has(item.name)) { |
| | | item.color = colors.get(item.name) |
| | |
| | | }) |
| | | |
| | | let padding = [10, 30, 30, 30] |
| | | if (plot.mutilBar === 'overlap') { |
| | | if (plot.mutilBar === 'overlap' || Bar_axis.length === 1) { |
| | | Bar_axis = [] |
| | | } |
| | | |
| | |
| | | .color(item.color) |
| | | .shape(item.shape) |
| | | .tooltip(`${item.name}`, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | return { |
| | |
| | | } |
| | | if (item.label !== 'false') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | |
| | |
| | | .color(item.color) |
| | | .shape(item.shape) |
| | | .tooltip(`${item.name}`, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | return { |
| | |
| | | |
| | | if (item.label !== 'false') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | let _color = color |
| | |
| | | newcard.type = 'select' |
| | | newcard.resourceType = '0' |
| | | newcard.options = [] |
| | | newcard.setAll = 'false' |
| | | newcard.orderType = 'asc' |
| | | newcard.match = '=' |
| | | |
| | |
| | | <div className="menu-line-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null} |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> : null} |
| | | {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/> : null} |
| | | {appType !== 'mob' ? <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton}/> : null} |
| | | <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> |
| | | <CopyComponent type="line" card={card}/> |
| | | <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | | <UserComponent config={card}/> |
| | | <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <SettingComponent config={card} updateConfig={this.updateComponent}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | <ToolOutlined/> |
| | | </Popover> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div> |