From bcef9a2845e6800704fecb3eb60c204f80854a07 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 九月 2020 09:17:24 +0800 Subject: [PATCH] 2020-09-24 --- src/menu/components/card/data-card/index.jsx | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 0082ea5..3c55cab 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -2,20 +2,24 @@ import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' +import { Icon, Popover } from 'antd' import asyncComponent from '@/utils/asyncComponent' +import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import './index.scss' -const SettingComponent = asyncComponent(() => import('@/menu/datasource')) +const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) +const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) const ActionComponent = asyncComponent(() => import('@/menu/actioncomponent')) class antvBarLineChart extends Component { static propTpyes = { card: PropTypes.object, + deletecomponent: PropTypes.func, updateConfig: PropTypes.func, } @@ -46,15 +50,18 @@ tabId: card.tabId || '', parentId: card.parentId || '', format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 - pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� - switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� + pageable: true, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� + switchable: true, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� dataName: dataName, + width: 24, + name: card.name, subtype: card.subtype, - setting: {span: 24, height: 200, interType: 'system', name: card.name}, + setting: { interType: 'system' }, + wrap: { name: card.name, width: 24, height: 200, cardWidth: 6, addable: 'false', switch: 'false' }, columns: [], scripts: [], - search: [], action: [], + elements: [] } this.setState({ card: _card @@ -88,6 +95,10 @@ this.setState({ card: component }) + + component.width = component.wrap.width + component.name = component.wrap.name + this.props.updateConfig(component) } @@ -95,22 +106,25 @@ const { card } = this.state return ( - <div className="menu-data-card-edit-box" style={{height: card.setting.height || 400}}> - <SettingComponent - config={card} - updateConfig={this.updateComponent} - /> - <div className="chart-header"> - <span className="chart-title">{card.setting.title || ''}</span> + <div className="menu-data-card-edit-box"> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <WrapComponent config={card} updateConfig={this.updateComponent} /> + <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> + <SettingComponent config={card} updateConfig={this.updateComponent} /> + </div> + } trigger="hover"> + <Icon type="tool" /> + </Popover> + <div className={'ant-col card-item ant-col-' + (card.wrap.cardWidth || 6)} style={{height: card.wrap.height ? card.wrap.height + 'px' : 'auto'}}> + + <ActionComponent + config={card} + tabs={[]} + // setSubConfig={(_btn) => this.setSubConfig(_btn, 'button')} + updateaction={this.updateComponent} + /> </div> - <ActionComponent - type="chart" - config={card} - tabs={[]} - // setSubConfig={(_btn) => this.setSubConfig(_btn, 'button')} - updateaction={this.updateComponent} - /> - <div className="canvas" id={card.uuid}></div> </div> ) } -- Gitblit v1.8.0