From 1a11f7115e61c548f9ffc77d0a9e504307ca71b2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 24 八月 2021 18:37:20 +0800 Subject: [PATCH] 2021-08-24 --- src/tabviews/custom/components/group/normal-group/index.jsx | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 0122473..05c8ba6 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -25,6 +25,7 @@ const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) const SandBox = asyncComponent(() => import('@/tabviews/custom/components/code/sand-box')) const NormalForm = asyncComponent(() => import('@/tabviews/custom/components/form/normal-form')) +const TabForm = asyncComponent(() => import('@/tabviews/custom/components/form/tab-form')) const NormalTree = asyncComponent(() => import('@/tabviews/custom/components/tree/antd-tree')) const CarouselDataCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/data-card')) const CarouselPropCard = asyncComponent(() => import('@/tabviews/custom/components/carousel/prop-card')) @@ -91,7 +92,9 @@ UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { - this.setState({mainSearch: fromJS(nextProps.mainSearch).toJS()}) + this.setState({mainSearch: null}, () => { + this.setState({mainSearch: fromJS(nextProps.mainSearch).toJS()}) + }) } } @@ -131,11 +134,9 @@ if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) return config.components.map(item => { - let _bid = '' - if (bids && item.setting && item.setting.supModule) { - _bid = bids[item.setting.supModule] || '' - } else if (!bids && BID && (!item.setting || !item.setting.supModule)) { - _bid = BID + let _bid = BID || '' + if (item.setting && item.setting.supModule) { + _bid = bids ? bids[item.setting.supModule] || '' : '' } if (item.type === 'bar' || item.type === 'line') { @@ -156,12 +157,18 @@ <AntvDashboard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) - } else if (item.type === 'form') { + } else if (item.type === 'form' && item.subtype === 'stepform') { return ( <Col span={item.width} key={item.uuid}> <NormalForm config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> </Col> ) + } else if (item.type === 'form' && item.subtype === 'tabform') { + return ( + <Col span={item.width} key={item.uuid}> + <TabForm config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> + </Col> + ) } else if (item.type === 'scatter') { return ( <Col span={item.width} key={item.uuid}> -- Gitblit v1.8.0