From d7534812c8199bf1e9faa0279b63e434737d6374 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 四月 2021 16:06:27 +0800 Subject: [PATCH] 2021-04-16 --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 24 ++++++++++-------------- 1 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 076f844..3d98f95 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -99,7 +99,7 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record) => { - const { setting, Tab, BID, btn, selectedData } = this.props + const { Tab, BID, btn, selectedData } = this.props const { loading } = this.state if ((triggerId && btn.uuid !== triggerId) || loading) return @@ -129,14 +129,6 @@ notification.warning({ top: 92, message: this.state.dict['main.action.confirm.selectSingleLine'], - duration: 5 - }) - return - } else if (btn.OpenType !== 'formSubmit' && !setting.primaryKey) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿� - notification.warning({ - top: 92, - message: '鏈缃富閿紒', duration: 5 }) return @@ -258,7 +250,7 @@ let primaryId = '' - if (btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { + if ((btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') && setting.primaryKey) { let ids = data.map(d => { return d[setting.primaryKey] || ''}) ids = ids.filter(Boolean) primaryId = ids.join(',') @@ -512,13 +504,15 @@ let primaryId = '' - if (btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { + if ((btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') && setting.primaryKey) { let ids = data.map(d => { return d[setting.primaryKey] || ''}) ids = ids.filter(Boolean) primaryId = ids.join(',') } - param[setting.primaryKey] = primaryId // 璁剧疆涓婚敭鍙傛暟 + if (setting.primaryKey) { + param[setting.primaryKey] = primaryId // 璁剧疆涓婚敭鍙傛暟 + } if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') { // 琛ㄥ崟 formdata.forEach(_data => { @@ -559,7 +553,9 @@ param[_data.key] = _data.value }) } - param[setting.primaryKey] = primaryId + if (setting.primaryKey) { + param[setting.primaryKey] = primaryId + } if (this.props.menuType === 'HS' && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') @@ -1687,7 +1683,7 @@ type="link" title={show === 'icon' ? btn.label : ''} loading={loading} - style={btn.btnstyle || style} + style={btn.style || style} icon={show === 'text' ? '' : (btn.icon || '')} onClick={() => {this.actionTrigger()}} >{show === 'icon' && btn.icon ? '' : btn.label}</Button> -- Gitblit v1.8.0