From 6467e4115c5284a15f393e3dd2ffb07ebd2a96d6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 28 十二月 2020 18:31:48 +0800 Subject: [PATCH] 2020-12-28 --- src/templates/sharecomponent/settingcomponent/settingform/utils.jsx | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx index c5bb301..b58ffb7 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx @@ -12,20 +12,18 @@ let _dataresource = setting.dataresource let _customScript = '' scripts && scripts.forEach(script => { - if (script.status !== 'false') { - _customScript += ` - ${script.sql} - ` - } + _customScript += ` + ${script.sql} + ` }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } - if (setting.interType === 'system' && setting.default === 'false') { + if (setting.default === 'false') { _dataresource = '' } @@ -40,7 +38,7 @@ let _regoptions = regoptions.map(item => { return { reg: new RegExp('@' + item.key + '@', 'ig'), - value: `'${item.value}'` + value: `'0'` } }) @@ -80,16 +78,20 @@ } if (_customScript) { - sql = `${_customScript} + sql = `/* sql 楠岃瘉 */ + ${_customScript} ${_dataresource} aaa: if @ErrorCode!='' insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { - sql = _dataresource + sql = `/* sql 楠岃瘉 */ + ${_dataresource}` } - + sql = sql.replace(/\n\s{8}/ig, '\n') + console.info(sql) + return sql } } \ No newline at end of file -- Gitblit v1.8.0