From 72419e2f826031a158173f46d723a672064e37cd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 31 八月 2021 22:42:51 +0800 Subject: [PATCH] 2021-08-31 --- src/tabviews/custom/components/group/normal-group/index.jsx | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 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..9fde7b5 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()}) + }) } } @@ -99,7 +102,7 @@ * @description 涓昏〃鏁版嵁鍔犺浇 */ loadmaindata = (params) => { - let param = getStructuredParams(params, this.props.config) + let param = getStructuredParams(params, this.props.config, this.props.BID || '') Api.getLocalConfig(param).then(result => { if (result.status) { @@ -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