king
2020-12-31 eebe63a6727e6495321d1433ebd2779b5a36d45a
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx
@@ -9,7 +9,7 @@
   */
  static getDebugSql (setting, scripts, arr_field, regoptions, search) {
    let sql = ''
    let _dataresource = setting.dataresource
    let _dataresource = setting.dataresource || ''
    let _customScript = ''
    scripts && scripts.forEach(script => {
      _customScript += `
@@ -18,7 +18,7 @@
    })
    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}
      `
    }
@@ -33,12 +33,17 @@
    if (_customScript) {
      _customScript = _customScript.replace(/@\$|\$@/ig, '')
    }
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    
    // 正则替换
    let _regoptions = regoptions.map(item => {
      return {
        reg: new RegExp('@' + item.key + '@', 'ig'),
        value: `'${item.value}'`
        value: `'0'`
      }
    })