From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/templates/sharecomponent/settingcomponent/settingform/utils.jsx | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx index 09f0df4..2801901 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx @@ -18,7 +18,7 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } @@ -43,11 +43,21 @@ let _regoptions = regoptions.map(item => { return { reg: new RegExp('@' + item.key + '@', 'ig'), - value: `'0'` + value: `'0'`, + type: item.type || '' } }) _regoptions.push({ + reg: new RegExp('@login_city@', 'ig'), + value: `''` + }, { + reg: new RegExp('@userName@', 'ig'), + value: `''` + }, { + reg: new RegExp('@fullName@', 'ig'), + value: `''` + }, { reg: new RegExp('@orderBy@', 'ig'), value: setting.order }, { @@ -65,6 +75,11 @@ _dataresource = _dataresource.replace(item.reg, item.value) }) _search = '' + } else if (_dataresource) { + _regoptions.forEach(item => { + if (item.type !== 'url') return + _dataresource = _dataresource.replace(item.reg, item.value) + }) } if (_customScript) { @@ -118,13 +133,13 @@ }) if (_customScript) { - _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) select @ErrorCode='',@retmsg ='' + _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50) select @ErrorCode='',@retmsg ='' ${_customScript} ` } _customScript = _customScript.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@userName@|@fullName@/ig, `''`) + _customScript = _customScript.replace(/@userName@|@fullName@|@login_city@/ig, `''`) // 澶栬仈鏁版嵁搴撴浛鎹� if (window.GLOB.externalDatabase !== null) { _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) -- Gitblit v1.8.0