From aac1d5cb50be5071b9c241a9cc0ebbfaae90a21e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 29 六月 2023 01:05:49 +0800 Subject: [PATCH] 2023-06-29 --- src/tabviews/custom/components/share/tabtransfer/index.jsx | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index f7bbac1..f2be4a6 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -39,6 +39,7 @@ const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table')) const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) class TabTransfer extends Component { static propTpyes = { @@ -174,13 +175,10 @@ }) } - getComponents = () => { - const { config } = this.props + getComponents = (components) => { const { mainSearch, data } = this.state - if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) - - return config.components.map(item => { + return components.map(item => { let style = null if (item.style && item.style.clear === 'left') { @@ -348,6 +346,12 @@ <AntvG6 config={item} data={data} mainSearch={mainSearch}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else { return null } @@ -355,8 +359,12 @@ } render() { + const { config } = this.props + + if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) + return ( - <Row className="component-wrap" gutter={8}>{this.getComponents()}</Row> + <Row className="component-wrap" id={'anchor' + config.uuid} gutter={8}>{this.getComponents(config.components)}</Row> ) } } -- Gitblit v1.8.0