From a3ac1b4636cf446804bb1947d6a5d2dd6c3bc030 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 13 十二月 2020 17:16:54 +0800 Subject: [PATCH] 2020-12-13 --- src/tabviews/custom/components/share/normalTable/index.jsx | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index e203f3d..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> ) @@ -508,8 +508,9 @@ } // 瀛楁閫忚 - triggerLink = (item, record) => { + triggerLink = (e, item, record) => { const { tabviews, MenuID } = this.props + e.stopPropagation() if (item.linkThdMenu) { let tabmenu = item.linkThdMenu @@ -736,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 @@ -803,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