From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/tabviews/custom/components/group/normal-group/index.jsx |   60 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx
index 0ffbce3..99486fe 100644
--- a/src/tabviews/custom/components/group/normal-group/index.jsx
+++ b/src/tabviews/custom/components/group/normal-group/index.jsx
@@ -21,13 +21,17 @@
 const DataCard = asyncComponent(() => import('@/tabviews/custom/components/card/data-card'))
 const TableCard = asyncComponent(() => import('@/tabviews/custom/components/card/table-card'))
 const NormalTable = asyncComponent(() => import('@/tabviews/custom/components/table/normal-table'))
+const EditTable = asyncComponent(() => import('@/tabviews/custom/components/table/edit-table'))
 const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card'))
 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'))
+const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony'))
+const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart'))
 
 class TabTransfer extends Component {
   static propTpyes = {
@@ -74,7 +78,7 @@
           item.setting.sync = 'false'
           item.setting.onload = 'false'
         } else {
-          params.push(getStructDefaultParam(item, searchlist))
+          params.push(getStructDefaultParam(item, searchlist, params.length === 0))
         }
       } else {
         item.setting.sync = 'false'
@@ -90,7 +94,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()})
+      })
     }
   }
 
@@ -98,7 +104,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) {
@@ -130,11 +136,11 @@
     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 || ''
+      let BData = ''
+      if (item.setting && item.setting.supModule) {
+        _bid = bids ? bids[item.setting.supModule] || '' : ''
+        BData = bids ? bids[item.setting.supModule + '_data'] || '' : ''
       }
 
       if (item.type === 'bar' || item.type === 'line') {
@@ -155,10 +161,16 @@
             <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') {
@@ -170,37 +182,43 @@
       } else if (item.type === 'carousel' && item.subtype === 'datacard') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <CarouselDataCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <CarouselDataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'carousel' && item.subtype === 'propcard') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <CarouselPropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <CarouselPropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'card' && item.subtype === 'datacard') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <DataCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <DataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'card' && item.subtype === 'propcard') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <PropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <PropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'table' && item.subtype === 'tablecard') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <TableCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <TableCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'table' && item.subtype === 'normaltable') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+            <NormalTable config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
+      } else if (item.type === 'table' && item.subtype === 'editable') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <EditTable config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'tree') {
@@ -221,6 +239,18 @@
             <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
+      } else if (item.type === 'balcony') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <Balcony config={item} data={data} BID={_bid} menuType={menuType} />
+          </Col>
+        )
+      } else if (item.type === 'chart') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
       } else {
         return null
       }

--
Gitblit v1.8.0