From 106263ec10e60ce6c406e4fd5eb76d195772d0f0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 18 十二月 2020 18:07:05 +0800
Subject: [PATCH] 2020-12-18

---
 src/tabviews/custom/components/share/normalTable/index.jsx |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index 584b7c0..b227d1d 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -22,7 +22,7 @@
   }
 
   render() {
-    let { lineMarks, data, className, ...resProps } = this.props
+    let { lineMarks, onDoubleClick, data, className, ...resProps } = this.props
     let style = {}
 
     if (lineMarks && lineMarks.length > 0) {
@@ -89,7 +89,7 @@
       })
     }
 
-    return <tr {...resProps} className={className} style={style}/>
+    return <tr {...resProps} onDoubleClick={onDoubleClick} className={className} style={style}/>
   }
 }
 
@@ -205,7 +205,7 @@
       if (col.linkThdMenu || col.linkurl) {
         content = (
           <div>
-            <div className="link-menu" onDoubleClick={() => this.triggerLink(col, record)}></div>
+            <div className="link-menu" onDoubleClick={(e) => this.triggerLink(e, col, record)}></div>
             {content}
           </div>
         )
@@ -251,7 +251,7 @@
       if (col.linkThdMenu || col.linkurl) {
         content = (
           <div>
-            <div className="link-menu" onDoubleClick={() => this.triggerLink(col, record)}></div>
+            <div className="link-menu" onDoubleClick={(e) => this.triggerLink(e, col, record)}></div>
             {content}
           </div>
         )
@@ -344,7 +344,13 @@
           {content && _href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null }
         </div>
       )
-    } else if (col.type === 'custom' || col.type === 'action') {
+    } else if (col.type === 'custom') {
+      style.padding = '0px'
+      resProps.children = (
+        <CardCellComponent data={record} cards={config} elements={col.elements} updateStatus={this.props.updateStatus}/>
+      )
+    } else if (col.type === 'action') {
+      style.padding = '0px 5px'
       resProps.children = (
         <CardCellComponent data={record} cards={config} elements={col.elements} updateStatus={this.props.updateStatus}/>
       )
@@ -502,8 +508,9 @@
   }
 
   // 瀛楁閫忚
-  triggerLink = (item, record) => {
+  triggerLink = (e, item, record) => {
     const { tabviews, MenuID } = this.props
+    e.stopPropagation()
 
     if (item.linkThdMenu) {
       let tabmenu = item.linkThdMenu
@@ -730,6 +737,14 @@
     })
   }
 
+  doubleClickLine = (record) => {
+    const { setting } = this.props
+
+    if (!setting.doubleClick) return
+
+    MKEmitter.emit('triggerBtnId', setting.doubleClick, [record])
+  }
+
   render() {
     const { setting, statFValue, lineMarks, data } = this.props
     const { selectedRowKeys, activeIndex, pickup } = this.state
@@ -797,7 +812,8 @@
               lineMarks,
               data: record,
               className: index === activeIndex ? ' mk-row-active ' : '',
-              onClick: () => {this.changeRow(record, index)}
+              onClick: () => {this.changeRow(record, index)},
+              onDoubleClick: () => {this.doubleClickLine(record)}
             }
           }}
           onChange={this.changeTable}

--
Gitblit v1.8.0