From 523cec6c87d88b43954a4409a8dfde6aade095a1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 22 五月 2020 11:02:10 +0800 Subject: [PATCH] 2020-05-22 --- src/tabviews/zshare/actionList/index.jsx | 76 +++++++++++++++++++++++--------------- 1 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx index b045b7a..af11741 100644 --- a/src/tabviews/zshare/actionList/index.jsx +++ b/src/tabviews/zshare/actionList/index.jsx @@ -192,7 +192,8 @@ }) } } else if (item.OpenType === 'popview' && this.props.type !== 'subtab') { - this.props.triggerPopview(item, data) + // 寮圭獥鏍囩璁剧疆涓轰笉閫夊垯琛屾椂锛屼笉浼犻�掓暟鎹� + this.props.triggerPopview(item, item.Ot === 'notRequired' ? [] : data) } else if (item.OpenType === 'popview' && this.props.type === 'subtab') { notification.warning({ top: 92, @@ -447,8 +448,10 @@ let _list = [] return new Promise(resolve => { let params = [] - let param = { - BID: this.props.BID + let param = {} + + if (this.props.BID) { + param.BID = this.props.BID } if (btn.Ot === 'notRequired') { @@ -545,7 +548,7 @@ // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID - if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + if (this.props.BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { res.BID = this.props.BID } @@ -1027,8 +1030,11 @@ let _this = this let param = { - BID: this.props.BID, func: 'webapi_ChangeUser' + } + + if (this.props.BID) { + param.BID = this.props.BID } if (window.GLOB.mainSystemApi) { @@ -1114,8 +1120,11 @@ } let param = { // 绯荤粺瀛樺偍杩囩▼ - func: 'sPC_TableData_InUpDe', - BID: this.props.BID + func: 'sPC_TableData_InUpDe' + } + + if (this.props.BID) { + param.BID = this.props.BID } let primaryId = '' @@ -1191,9 +1200,13 @@ let _params = data.map((cell, index) => { let param = { - func: 'sPC_TableData_InUpDe', - BID: this.props.BID + func: 'sPC_TableData_InUpDe' } + + if (this.props.BID) { + param.BID = this.props.BID + } + let primaryId = setting.primaryKey ? cell[setting.primaryKey] : '' if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� @@ -1210,15 +1223,20 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) } } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 + if (index !== 0) { + formdata = formdata.map(_data => { + if (_data.readin && cell.hasOwnProperty(_data.key)) { + _data.value = cell[_data.key] + } + return _data + }) + } + if (btn.innerFunc) { param.func = btn.innerFunc formdata.forEach(_data => { - if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) { - param[_data.key] = cell[_data.key] - } else { - param[_data.key] = _data.value - } + param[_data.key] = _data.value }) if (setting.primaryKey) { @@ -1230,15 +1248,6 @@ param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { - if (index !== 0) { - formdata = formdata.map(_data => { - if (_data.readin && cell.hasOwnProperty(_data.key)) { - _data.value = cell[_data.key] - } - return _data - }) - } - param.ID = primaryId param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns, this.props.Tab)) // 鏁版嵁婧� param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' @@ -1294,8 +1303,10 @@ let _params = [] // 璇锋眰鍙傛暟鏁扮粍 if (btn.Ot === 'notRequired' || btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { - let param = { - BID: this.props.BID + let param = {} + + if (this.props.BID) { + param.BID = this.props.BID } if (btn.OpenType === 'pop' && formdata) { // 琛ㄥ崟 @@ -1318,8 +1329,10 @@ } else if (btn.Ot === 'required') { // 閫夋嫨澶氳锛屽惊鐜皟鐢� _params = data.map((cell, index) => { - let _cell = { - BID: this.props.BID, + let _cell = {} + + if (this.props.BID) { + _cell.BID = this.props.BID } let _formparam = {} @@ -1413,7 +1426,7 @@ // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID - if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + if (this.props.BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { res.BID = this.props.BID } @@ -1848,8 +1861,11 @@ } let param = { - BID: this.props.BID, ID: primaryId + } + + if (this.props.BID) { + param.BID = this.props.BID } param.LText = Utils.formatOptions(result.sql) @@ -1895,7 +1911,7 @@ // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID - if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { + if (this.props.BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { res.BID = this.props.BID } resolve(res) -- Gitblit v1.8.0