From 1637a24e160f87e171fc4978a8c9cb8875cdcabb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 20 五月 2022 01:12:51 +0800 Subject: [PATCH] 2022-05-20 --- src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 13 +-- src/tabviews/custom/components/card/cardcellList/index.jsx | 19 +++--- src/tabviews/zshare/actionList/tabbutton/index.jsx | 17 +---- src/tabviews/custom/components/share/normalTable/index.jsx | 2 src/tabviews/zshare/actionList/newpagebutton/index.jsx | 17 +---- src/tabviews/zshare/actionList/popupbutton/index.jsx | 17 +---- src/tabviews/zshare/normalTable/index.jsx | 10 +- src/tabviews/zshare/actionList/normalbutton/index.jsx | 17 +---- src/tabviews/zshare/actionList/funcMegvii/index.jsx | 16 +--- src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 17 +---- src/tabviews/zshare/actionList/excelInbutton/index.jsx | 17 +---- src/tabviews/zshare/actionList/printbutton/index.jsx | 17 +---- 12 files changed, 61 insertions(+), 118 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 34c8fe2..291a589 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -762,13 +762,13 @@ BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} columns={cards.columns} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -779,12 +779,12 @@ BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -794,12 +794,13 @@ <ExcelOutButton BID={data.$$BID} BData={data.$$BData || ''} - lineId={data.$$key || ''} disabled={_disabled} btn={card} show={card.show} style={card.style} setting={cards.setting} + selectedData={_data} + lineBtn={true} /> </Col> ) @@ -810,12 +811,12 @@ BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -825,12 +826,12 @@ <TabButton BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -840,12 +841,12 @@ <NewPageButton BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -857,12 +858,12 @@ BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -873,12 +874,12 @@ BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) @@ -888,12 +889,12 @@ <FuncMegvii BID={data.$$BID} disabled={_disabled} - lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} setting={cards.setting} selectedData={_data} + lineBtn={true} /> </Col> ) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index c058330..0946175 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -843,7 +843,7 @@ if (!setting.doubleClick) return if (record.$disabled) return - MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) + MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn') } render() { diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 5f0839b..34280db 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -22,7 +22,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -115,16 +115,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { setting, selectedData, btn, MenuID } = this.props + const { setting, selectedData, btn, MenuID, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (btn.funcType === 'closetab') { MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) @@ -133,10 +128,8 @@ MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') } return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index b535cfc..e51530e 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -25,7 +25,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -120,16 +120,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { setting, Tab, BID, btn, selectedData } = this.props + const { setting, Tab, BID, btn, selectedData, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -138,10 +133,8 @@ duration: 5 }) return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 3648ac6..8864983 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -25,7 +25,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 updateStatus: PropTypes.func, // 鎸夐挳鐘舵�佹洿鏂� disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -117,17 +117,12 @@ /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ - actionTrigger = (triggerId, record) => { + actionTrigger = (triggerId, record, type) => { const { setting, Tab, BID, btn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -136,6 +131,8 @@ duration: 5 }) return + } else if (type === 'linkbtn' && this.props.lineBtn && !is(fromJS(this.props.selectedData || []), fromJS(record))) { + return } if (!btn.verify || !btn.verify.columns || btn.verify.columns.length === 0) { diff --git a/src/tabviews/zshare/actionList/funcMegvii/index.jsx b/src/tabviews/zshare/actionList/funcMegvii/index.jsx index 0c80f56..a5ba61a 100644 --- a/src/tabviews/zshare/actionList/funcMegvii/index.jsx +++ b/src/tabviews/zshare/actionList/funcMegvii/index.jsx @@ -20,6 +20,7 @@ static propTpyes = { btn: PropTypes.object, // 鎸夐挳 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -94,16 +95,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { Tab, BID, btn, selectedData, setting } = this.props + const { Tab, BID, btn, selectedData, setting, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -112,10 +108,8 @@ duration: 5 }) return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index cb1f797..718d640 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -19,7 +19,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -112,21 +112,14 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { setting, btn, selectedData } = this.props + const { setting, btn, selectedData, lineBtn } = this.props const { disabled } = this.state if (disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return - if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 9a98d78..45f7dd7 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -33,7 +33,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -230,16 +230,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { Tab, BID, btn, selectedData, setting } = this.props + const { Tab, BID, btn, selectedData, setting, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -248,10 +243,8 @@ duration: 5 }) return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } this.setState({autoMatic: type === 'autoMatic'}) diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index 02ce0db..efef9c1 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -24,7 +24,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -154,16 +154,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { setting, Tab, BID, btn, selectedData } = this.props + const { setting, Tab, BID, btn, selectedData, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -172,10 +167,8 @@ duration: 5 }) return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 6c14dd2..54676fb 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -32,7 +32,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -146,16 +146,11 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { Tab, BID, btn, selectedData, setting } = this.props + const { Tab, BID, btn, selectedData, setting, lineBtn } = this.props const { loading, disabled } = this.state if (loading || disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ @@ -164,10 +159,8 @@ duration: 5 }) return - } else if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + } else if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } this.setState({autoMatic: type === 'autoMatic'}) diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index 353a566..529f46b 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -19,7 +19,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� - lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� + lineBtn: PropTypes.any, // 鏄惁涓鸿绾ф寜閽� } state = { @@ -112,21 +112,14 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { setting, btn, selectedData } = this.props + const { setting, btn, selectedData, lineBtn } = this.props const { disabled } = this.state if (disabled) return - if (triggerId) { - if (btn.uuid !== triggerId) return - if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { - return - } - } + if (triggerId && btn.uuid !== triggerId) return - if (type === 'linkbtn' && selectedData && selectedData.length === 1) { - if (record[0].$Index !== selectedData[0].$Index) { - return - } + if (type === 'linkbtn' && lineBtn && !is(fromJS(selectedData || []), fromJS(record))) { + return } let data = record || selectedData || [] diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 9c42ac2..dbe02b5 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -749,12 +749,12 @@ btn={btn} BID={record.$$BID} disabled={record.$disabled} - lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} columns={this.props.fields || this.props.columns} ContainerId={this.props.ContainerId} + lineBtn={true} /> ) } else if (btn.OpenType === 'popview') { @@ -764,10 +764,10 @@ btn={btn} BID={record.$$BID} disabled={record.$disabled} - lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} + lineBtn={true} /> ) } else if (btn.OpenType === 'tab') { @@ -776,11 +776,11 @@ key={btn.uuid} btn={btn} disabled={record.$disabled} - lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} MenuID={this.props.MenuID} setting={this.props.setting} + lineBtn={true} /> ) } else if (btn.OpenType === 'innerpage' || btn.OpenType === 'outerpage') { @@ -789,10 +789,10 @@ key={btn.uuid} btn={btn} disabled={record.$disabled} - lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} + lineBtn={true} /> ) } @@ -1210,7 +1210,7 @@ if (!setting.doubleClick) return if (record.$disabled) return - MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) + MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn') } render() { -- Gitblit v1.8.0