From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 八月 2022 11:42:43 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/custom/components/timeline/normal-timeline/index.jsx |   84 +++++++++++++++++++++++++++++++++---------
 1 files changed, 66 insertions(+), 18 deletions(-)

diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
index 2a62ef0..13127d8 100644
--- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
+++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -19,7 +19,6 @@
     data: PropTypes.array,           // 缁熶竴鏌ヨ鏁版嵁
     config: PropTypes.object,        // 缁勪欢閰嶇疆淇℃伅
     mainSearch: PropTypes.any,       // 澶栧眰鎼滅储鏉′欢
-    menuType: PropTypes.any,         // 鑿滃崟绫诲瀷
   }
 
   state = {
@@ -158,20 +157,10 @@
 
     if (config.uuid !== menuId) return
 
-    let supModule = config.setting.supModule
-
-    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
-
-    if (!btn.syncComponentId || btn.syncComponentId !== supModule) {
-      if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠�
-        if (supModule && BID) {
-          MKEmitter.emit('reloadData', supModule, BID)
-        } else {
-          this.loadData()
-        }
-      } else {
-        this.loadData()
-      }
+    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠�
+      MKEmitter.emit('reloadData', config.setting.supModule, BID)
+    } else {
+      this.loadData()
     }
 
     if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」
@@ -226,7 +215,7 @@
   }
 
   async loadData () {
-    const { mainSearch, menuType } = this.props
+    const { mainSearch } = this.props
     const { config, arr_field, BID, BData } = this.state
 
     if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
@@ -256,7 +245,7 @@
     })
 
     let _orderBy = config.setting.order || ''
-    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, config.setting.pageSize, BID, menuType)
+    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, config.setting.pageSize, BID)
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -314,6 +303,62 @@
     </Timeline.Item>)
   }
 
+  getMknodes = (data) => {
+    const { config, card } = this.state
+
+    let color = config.wrap.color
+    let dot = ''
+    let linebg = {}
+    if (config.wrap.node && card.nodes && card.nodes.length > 0) {
+      let sign = data[config.wrap.node]
+      card.nodes.some(item => {
+        if (sign === item.sign) {
+          color = item.color
+
+          if (item.icon) {
+            dot = <MkIcon type={item.icon}/>
+          }
+
+          if (item.linecolor) {
+            linebg = {borderColor: item.linecolor}
+          }
+          return true
+        }
+        return false
+      })
+    }
+
+    if (config.wrap.mode === 'down') {
+      return (<div className="mk-time-line-item" key={data.$Index}>
+        <div className="mk-timeline-item-content">
+          <div className="card-item-box" style={card.style}>
+            <CardCellComponent data={data} cards={config} cardCell={card} elements={card.elements}/>
+          </div>
+        </div>
+        <div className="mk-timeline-item-head">
+          <div className="mk-timeline-item-tail" style={linebg}></div>
+          <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color}}>
+            {dot}
+          </div>
+        </div>
+      </div>)
+    } else {
+      return (<div className="mk-time-line-item" key={data.$Index}>
+        <div className="mk-timeline-item-head">
+          <div className="mk-timeline-item-tail" style={linebg}></div>
+          <div className={'mk-dot ' + (dot ? 'mk-dot-icon' : '')} style={{background: color}}>
+            {dot}
+          </div>
+        </div>
+        <div className="mk-timeline-item-content">
+          <div className="card-item-box" style={card.style}>
+            <CardCellComponent data={data} cards={config} cardCell={card} elements={card.elements}/>
+          </div>
+        </div>
+      </div>)
+    }
+  }
+
   render() {
     const { config, loading, data } = this.state
 
@@ -326,9 +371,12 @@
           </div> : null
         }
         <NormalHeader config={config} />
-        {data && data.length > 0 ? <Timeline mode={config.wrap.mode} reverse={config.wrap.reverse === 'true'} className={'card-row-list ' + (config.wrap.line || '')} style={{height: config.wrap.contentHeight}}>
+        {config.wrap.direction !== 'horizontal' && data && data.length > 0 ? <Timeline mode={config.wrap.mode} className={'card-row-list ' + (config.wrap.line || '')} style={{height: config.wrap.contentHeight}}>
           {data.map(item => this.getnodes(item))}
         </Timeline> : null}
+        {config.wrap.direction === 'horizontal' && data && data.length > 0 ? <div className={'mk-time-line-wrap card-row-list ' + (config.wrap.line || '')} style={{height: config.wrap.contentHeight}}>
+          {data.map(item => this.getMknodes(item))}
+        </div> : null}
         {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}>
           <Empty description={false}/>
         </div> : null}

--
Gitblit v1.8.0