From 9b6ce1a5778c6e1a813237e87588c0052aae1bbb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 29 四月 2020 17:26:15 +0800 Subject: [PATCH] 2020-04-29 --- src/templates/zshare/createinterface/index.jsx | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/templates/zshare/createinterface/index.jsx b/src/templates/zshare/createinterface/index.jsx index 1b3d1e2..568bd34 100644 --- a/src/templates/zshare/createinterface/index.jsx +++ b/src/templates/zshare/createinterface/index.jsx @@ -23,11 +23,17 @@ btn: null } + /** + * @description 瑙﹀彂鍒涘缓璇绘暟鎹帴鍙� + * @param { object } menu 鑿滃崟绫诲瀷锛堜笁绾ц彍鍗曟垨鏍囩椤碉級銆佽彍鍗旾D銆佽彍鍗曞弬鏁般�佽彍鍗曞悕绉� + * @param { object } config 鑿滃崟閰嶇疆淇℃伅 + */ triggerOutInterface = (menu, config) => { let _search = [] let _index = 1 if (menu.type !== 'main') { + // 瀛愯〃椤甸潰澧炲姞BID瀛楁锛屾暟鎹簮涓娇鐢ㄤ簡@BID@鏃讹紝BID绫诲瀷涓哄繀浼� if (config.setting.dataresource && /@BID@/ig.test(config.setting.dataresource)) { _search.push(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'' as defaultvalue,'required' as DefaultType`) } else { @@ -283,7 +289,26 @@ }) } + /** + * @description 瑙﹀彂鍒涘缓鍐欏叆鎺ュ彛锛堟寜閽級 + */ triggerInInterface = (btn, config, menu) => { + if (!['pop', 'exec', 'prompt'].includes(btn.OpenType) || btn.funcType || btn.intertype !== 'inner' || btn.innerFunc ) { + notification.warning({ + top: 92, + message: '鎵撳紑鏂瑰紡涓� 寮圭獥锛堣〃鍗曪級銆佹彁绀烘鎴栫洿鎺ユ墽琛岋紝涓斾娇鐢ㄧ郴缁熷嚱鏁版椂锛屾墠鍙互鍒涘缓鎺ュ彛锛�', + duration: 5 + }) + return + } else if (btn.Ot === 'requiredOnce') { + notification.warning({ + top: 92, + message: '澶氳鎷兼帴鏃讹紝涓嶆敮鎸佸垱寤烘帴鍙o紒', + duration: 5 + }) + return + } + let param = { func: 's_get_para_for_in', Menuid: btn.uuid, @@ -343,6 +368,9 @@ }) } + /** + * @description 鎵ц鎺ュ彛鍒涘缓 + */ createBtnInterfaceExec = (param, config, btn) => { let formlist = [] let receipt = param.Return === 'Y' @@ -448,9 +476,14 @@ }) if (param.menuType !== 'main' && !_keys.includes('bid')) { + _keys.push('bid') param.Ltexttableparam.unshift(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`) } + if (btn.Ot !== 'notRequired' && !_keys.includes(config.setting.primaryKey.toLowerCase())) { + param.Ltexttableparam.unshift(`select '${config.setting.primaryKey}' as searchfield,'${config.setting.primaryKey}' as label,'1' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`) + } + param.Ltexttableparam = param.Ltexttableparam.join(' union all ') if (receipt) { -- Gitblit v1.8.0