From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/tabviews/custom/components/share/tabtransfer/index.jsx |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx
index ff7f3f2..2754f25 100644
--- a/src/tabviews/custom/components/share/tabtransfer/index.jsx
+++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -23,15 +23,18 @@
 const AntvScatter = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-scatter'))
 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 NormalGroup = asyncComponent(() => import('@/tabviews/custom/components/group/normal-group'))
 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 = {
@@ -65,6 +68,7 @@
     }
 
     let params = []
+    let delay = 20
     config.components.forEach(item => {
       if (item.type === 'tabs' || item.type === 'group') return
 
@@ -89,10 +93,12 @@
           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'
+        item.setting.delay = delay
+        delay += 20
       }
     })
 
@@ -107,7 +113,9 @@
     const { self } = this.state
     
     if (!self && 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()})
+      })
     }
   }
 
@@ -115,7 +123,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) {
@@ -153,9 +161,11 @@
     if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />)
 
     return config.components.map(item => {
-      let BID = ''
+      let BID = this.props.BID || ''
+      let BData = ''
       if (item.setting && item.setting.supModule) {
         BID = bids[item.setting.supModule] || ''
+        BData = bids[item.setting.supModule + '_data'] || ''
       }
 
       if (item.type === 'bar' || item.type === 'line') {
@@ -185,61 +195,73 @@
       } else if (item.type === 'search') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <MainSearch config={item} menuType={menuType} refreshdata={this.resetSearch} />
+            <MainSearch config={item} BID={BID} menuType={menuType} refreshdata={this.resetSearch} />
           </Col>
         )
       } else if (item.type === 'tabs') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <AntvTabs config={item} bids={bids} mainSearch={mainSearch} menuType={menuType} />
+            <AntvTabs config={item} BID={BID} bids={bids} 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 === '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 === '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} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'group' && item.subtype === 'normalgroup') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <NormalGroup config={item} bids={bids} mainSearch={mainSearch} menuType={menuType} />
+            <NormalGroup config={item} BID={BID} bids={bids} 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 === 'tree') {
@@ -266,6 +288,12 @@
             <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
       }
@@ -274,7 +302,7 @@
 
   render() {
     return (
-      <Row gutter={8}>{this.getComponents()}</Row>
+      <Row className="component-wrap" gutter={8}>{this.getComponents()}</Row>
     )
   }
 }

--
Gitblit v1.8.0