king
2023-09-15 f19f73d4ca33da392309a4178240584586a41cfd
2023-09-15
30个文件已修改
710 ■■■■■ 已修改文件
src/api/index.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/searchcomponent/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/searchconfig/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -1012,6 +1012,75 @@
      data: qs.stringify(data)
    })
  }
  /**
   * @description sql检验
   */
  sDebug (sql, rduri = null) {
    let param = {
      func: 's_debug_sql',
      exec_type: 'y',
      timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
      userid: sessionStorage.getItem('UserID') || '',
      lang: sessionStorage.getItem('lang') || '',
      SessionUid: localStorage.getItem('SessionUid') || '',
      LoginUID: sessionStorage.getItem('LoginUID') || '',
      appkey: window.GLOB.appkey || ''
    }
    if (window.GLOB.externalDatabase !== null) {
      sql = sql.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    sql = sql.replace(/\n\s{6,20}/ig, ' ')
    console.info(`/* sql 验证 */\n${sql}`)
    param.LText = Utils.formatOptions(sql)
    param.secretkey = Utils.encrypt('', param.timestamp)
    param = this.encryptParam(param)
    let url = '/webapi/dostars'
    if (rduri) {
      url = rduri
    }
    let timer = setTimeout(() => {
      let _param = {
        func: 's_debug_sql_cancel',
        userid: sessionStorage.getItem('UserID') || '',
        lang: sessionStorage.getItem('lang') || '',
        SessionUid: localStorage.getItem('SessionUid') || '',
        LoginUID: sessionStorage.getItem('LoginUID') || '',
        appkey: window.GLOB.appkey || ''
      }
      _param = this.encryptParam(_param)
      axios({
        url: `${url}/s_debug_sql_cancel`,
        method: 'post',
        data: JSON.stringify(_param)
      })
    }, 10000)
    return new Promise(resolve => {
      axios({
        url: `${url}/s_debug_sql`,
        method: 'post',
        data: JSON.stringify(param)
      }).then(res => {
        clearTimeout(timer)
        if (/Shared Memory Provider|会话处于终止状态|当前命令发生了严重错误/.test(res.message)) {
          res.message = '验证失败,请检查SQL中是否存在死循环。'
        }
        resolve(res)
      }, () => {
        clearTimeout(timer)
        resolve({status: false, ErrCode: 'E', message: '验证失败:1请检查SQL中是否存在死循环;2请检查网络连接是否正常。'})
      })
    })
  }
}
export default new Api()
src/menu/components/form/simple-form/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, notification, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import asyncComponent from '@/utils/asyncComponent'
@@ -437,25 +436,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/menu/components/form/step-form/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, notification, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import asyncComponent from '@/utils/asyncComponent'
@@ -539,25 +538,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/menu/components/form/tab-form/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, notification, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import asyncComponent from '@/utils/asyncComponent'
@@ -544,25 +543,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/menu/components/search/main-search/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Modal, notification, Popover, Switch, message } from 'antd'
import { PlusOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -256,24 +255,15 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: res.dataSource
        }
        let sql = res.dataSource
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/menu/components/share/searchcomponent/index.jsx
@@ -2,11 +2,9 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, notification } from 'antd'
import moment from 'moment'
import MKEmitter from '@/utils/events.js'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getSearchForm } from '@/templates/zshare/formconfig'
import SearchForm from '@/templates/sharecomponent/searchcomponent/searchform'
@@ -204,24 +202,15 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: res.dataSource
        }
        let sql = res.dataSource
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Modal, notification, Popover } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -450,25 +449,17 @@
            loading: true
          })
    
          let param = {
            func: 's_debug_sql',
            exec_type: 'y',
            LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
          let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
              ${values.dataSource}`
          }
    
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/\n/g, ' ')
          sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
          
          param.LText = Utils.formatOptions(param.LText)
          param.secretkey = Utils.encrypt('', param.timestamp)
          let rduri = ''
          if (window.GLOB.mainSystemApi && values.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
            rduri = window.GLOB.mainSystemApi
          }
          
          Api.genericInterface(param).then(result => {
          Api.sDebug(sql, rduri).then(result => {
            if (result.status || result.ErrCode === '-2') {
              this.setState({visible: false, loading: false, formlist: null})
              this.props.submitCol(values)
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -2,7 +2,6 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -195,23 +194,9 @@
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        }
        let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        if (skip) {
          this.setState({
@@ -225,7 +210,7 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
src/menu/datasource/verifycard/index.jsx
@@ -697,8 +697,7 @@
    }
    if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) {
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, config.type, '2023-04-20 15:29:37')
      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, config.type)
      let _debugId = md5(r.sql)
@@ -715,16 +714,7 @@
        })
      }
      let param = {
        func: 's_debug_sql',
        exec_type: 'y',
        LText: r.sql
      }
      param.LText = Utils.formatOptions(param.LText)
      param.timestamp = timestamp
      param.secretkey = Utils.encrypt('', timestamp)
      Api.genericInterface(param).then(result => {
      Api.sDebug(r.sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          this.setState({debugId: _debugId}, () => {
            resolve()
src/menu/datasource/verifycard/utils.jsx
@@ -7,7 +7,7 @@
   * @return {Object}  setting       页面设置
   * @return {Array}   columns       显示字段
   */
  static getDebugSql (setting, scripts, columns, searches = [], defSearch, type, timestamp) {
  static getDebugSql (setting, scripts, columns, searches = [], defSearch, type) {
    let sql = ''
    let error = ''
    let _dataresource = ''
@@ -47,18 +47,18 @@
      })
    }
    _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`)
    _tailScript = _tailScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`)
    _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`)
    _tailScript = _tailScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
    if (window.GLOB.process) {
      _dataresource = _dataresource.replace(/@works_flow_code@/ig, `'${timestamp}'`)
      _customScript = _customScript.replace(/@works_flow_code@/ig, `'${timestamp}'`)
      _tailScript = _tailScript.replace(/@works_flow_code@/ig, `'${timestamp}'`)
      _dataresource = _dataresource.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`)
      _customScript = _customScript.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`)
      _tailScript = _tailScript.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`)
    }
    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
@@ -191,31 +191,25 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${_customScript}
      sql = `${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else if (_tailScript) {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    let errors = []
@@ -260,8 +254,6 @@
        })
      })
    }
    sql = sql.replace(/\n/g, ' ')
    return { error, sql, errors: errors.join(';') }
  }
src/menu/modalconfig/index.jsx
@@ -3,12 +3,10 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Card, Modal, Collapse, notification, Switch, message } from 'antd'
import { SettingOutlined, CopyOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getModalForm } from '@/templates/zshare/formconfig'
import SourceElement from '@/templates/modalconfig/dragelement/source'
@@ -264,25 +262,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/mob/modalconfig/index.jsx
@@ -3,12 +3,10 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Modal, Collapse, notification, Switch, message } from 'antd'
import { LeftOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getModalForm } from '@/templates/zshare/formconfig'
import SourceElement from '@/templates/modalconfig/dragelement/source'
@@ -261,25 +259,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/mob/searchconfig/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Modal, Collapse, notification, Switch } from 'antd'
import { SettingOutlined, LeftOutlined, SearchOutlined, PlusOutlined } from '@ant-design/icons'
@@ -229,24 +228,15 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: res.dataSource
        }
        let sql = res.dataSource
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/tabviews/zshare/topSearch/index.jsx
@@ -41,7 +41,7 @@
  sign = ''
  UNSAFE_componentWillMount () {
    const { config } = this.props
    const { config, BID } = this.props
    let _searchlist = []
    let fieldMap = new Map()
@@ -144,6 +144,8 @@
        if (item.resourceType === '1' && item.dataSource) {
          let _option = Utils.getSelectQueryOptions(item)
          _option.sql = _option.sql.replace(/@BID@/ig, `'${BID || ''}'`)
          if (window.GLOB.debugger === true) {
            console.info(_option.sql)
          }
src/templates/modalconfig/index.jsx
@@ -3,12 +3,10 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Card, Modal, Collapse, notification, Switch } from 'antd'
import { SettingOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getModalForm } from '@/templates/zshare/formconfig'
import SourceElement from './dragelement/source'
@@ -392,25 +390,17 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -3,7 +3,6 @@
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -212,23 +211,8 @@
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
        
        if (skip) {
          this.setState({
@@ -242,7 +226,7 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -3,7 +3,6 @@
import { fromJS } from 'immutable'
import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Spin, Typography, Popconfirm } from 'antd'
import { EditOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons'
import moment from 'moment'
import md5 from 'md5'
import Api from '@/api'
@@ -885,8 +884,7 @@
      return
    }
    let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils, '2023-04-20 15:29:37')
    let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils)
    let _debugId = md5(sql)
@@ -895,16 +893,7 @@
      return
    }
    let param = {
      func: 's_debug_sql',
      exec_type: 'y',
      LText: sql
    }
    param.LText = Utils.formatOptions(param.LText)
    param.timestamp = timestamp
    param.secretkey = Utils.encrypt('', timestamp)
    Api.genericInterface(param).then(result => {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({debugId: _debugId})
        _resolve()
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
@@ -5,7 +5,7 @@
  /**
   * @description 生成页面查询语句
   */
  static getDebugSql (verify, scripts, searches, Utils, timestamp) {
  static getDebugSql (verify, scripts, searches, Utils) {
    let sql = ''
    let _dataresource = verify.dataresource || ''
    let regoptions = this.getRegOptions(searches)
@@ -52,9 +52,9 @@
      _dataresource = '(' + _dataresource + ') tb'
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
@@ -107,14 +107,13 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${declare}
      sql = `${declare}
        ${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else if (_tailScript) {
      sql = `${declare}
@@ -122,16 +121,12 @@
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else {
      sql = `/* sql 验证 */
        ${declare}
      sql = `${declare}
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    sql = sql.replace(/\n/g, ' ')
    return sql
  }
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
@@ -637,8 +637,7 @@
  sqlverify = (_resolve, _reject, scripts) => {
    const { verify, declareSql, debugId } = this.state
    let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    let sql = SettingUtils.getDebugSql(verify.setting || {}, verify.columns, scripts, declareSql, '2023-04-20 15:29:37')
    let sql = SettingUtils.getDebugSql(verify.setting || {}, verify.columns, scripts, declareSql)
    let _debugId = md5(sql)
@@ -647,16 +646,7 @@
      return
    }
    let param = {
      func: 's_debug_sql',
      exec_type: 'y',
      LText: sql
    }
    param.LText = Utils.formatOptions(param.LText)
    param.timestamp = timestamp
    param.secretkey = Utils.encrypt('', timestamp)
    Api.genericInterface(param).then(result => {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({debugId: _debugId})
        _resolve()
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx
@@ -1,6 +1,6 @@
export default class SettingUtils {
  static getDebugSql (setting, columns, scripts, declareSql, timestamp) {
  static getDebugSql (setting, columns, scripts, declareSql) {
    let sql = ''
    let _dataresource = setting.dataresource || ''
@@ -33,9 +33,9 @@
      _dataresource = '(' + _dataresource + ') tb'
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
@@ -64,33 +64,27 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${_customScript}
      sql = `${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else if (_tailScript) {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${declareSql}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${declareSql}
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    sql = sql.replace(/\n/g, ' ')
    return sql
  }
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -2,10 +2,8 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, notification, Switch } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getSearchForm } from '@/templates/zshare/formconfig'
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
@@ -211,24 +209,15 @@
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: res.dataSource
        }
        let sql = res.dataSource
        sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.genericInterface(param).then(result => {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -316,16 +316,7 @@
    } else if (type === 'scripts' && _scripts.length === 0) {
      _resolve()
    } else { // type 为 submit 、 verify ,以及其他需要验证的场景
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search, timestamp)
      let param = {
        func: 's_debug_sql',
        exec_type: 'y',
        LText: r.sql
      }
      param.LText = Utils.formatOptions(param.LText)
      param.timestamp = timestamp
      param.secretkey = Utils.encrypt('', timestamp)
      let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search)
      if (r.errors) {
        notification.warning({
@@ -335,34 +326,9 @@
        })
      }
      let sumParam = null
      if (r.sumSql) {
        sumParam = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: r.sumSql
        }
        sumParam.LText = Utils.formatOptions(sumParam.LText)
        sumParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        sumParam.secretkey = Utils.encrypt('', sumParam.timestamp)
      }
      Api.genericInterface(param).then(result => {
      Api.sDebug(r.sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          if (sumParam) {
            Api.genericInterface(sumParam).then(res => {
              if (res.status || res.ErrCode === '-2') {
                _resolve()
              } else {
                _reject()
                Modal.error({
                  title: res.message
                })
              }
            })
          } else {
            _resolve()
          }
        } else {
          _reject()
          Modal.error({
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
@@ -299,21 +299,11 @@
      _scripts.push(values)
    }
    let param = {
      func: 's_debug_sql',
      exec_type: 'y',
      LText: SettingUtils.getCustomDebugSql(_scripts, this.props.regoptions)
    }
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
    param.LText = param.LText.replace(/\n/g, ' ')
    param.LText = Utils.formatOptions(param.LText)
    param.secretkey = Utils.encrypt('', param.timestamp)
    let sql = SettingUtils.getCustomDebugSql(_scripts, this.props.regoptions)
    sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
    
    this.setState({loading: true})
    Api.genericInterface(param).then(result => {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({
          loading: false,
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx
@@ -7,7 +7,7 @@
   * @return {Object}  setting       页面设置
   * @return {Array}   regoptions    搜索条件正则替换
   */
  static getDebugSql (setting, scripts, arr_field, regoptions, search, timestamp) {
  static getDebugSql (setting, scripts, arr_field, regoptions, search) {
    let sql = ''
    let _dataresource = setting.dataresource || ''
    let _customScript = ''
@@ -35,8 +35,8 @@
      })
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'1949-10-01 15:00:00'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'1949-10-01 15:00:00'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
@@ -99,26 +99,6 @@
      })
    }
    let sumSql = ''
    if (arr_field && _dataresource && /\/\*\$sum@/ig.test(_dataresource)) {
      let _sql = _dataresource.replace(/\/\*\$sum@|@sum\$\*\//ig, '')
      _sql = `/*system_query*/${_sql} ${_search}`
      if (_customScript) {
        sumSql = `/* sql sum验证 */
          ${_customScript}
          ${_sql}
          aaa:
          if @ErrorCode!=''
            insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
        `
      } else {
        sumSql = `/* sql sum验证 */
          declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
          ${_sql}`
      }
    }
    // 数据源处理, 存在显示列时 
    if (arr_field && _dataresource) {
      if (/\s/.test(_dataresource)) {
@@ -129,21 +109,16 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${_customScript}
      sql = `${_customScript}
        ${_dataresource}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    let errors = []
@@ -163,14 +138,7 @@
      })
    }
    if (sumSql) {
      sumSql = sumSql.replace(/\n\s{10}/ig, '\n')
      console.info(sumSql)
      sumSql = sumSql.replace(/\n/g, ' ')
    }
    sql = sql.replace(/\n/g, ' ')
    return { sql, sumSql, errors: errors.join(';') }
    return { sql, errors: errors.join(';') }
  }
  /**
@@ -205,10 +173,6 @@
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@userName@|@fullName@/ig, `''`)
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    
    // 正则替换
    if (regoptions) {
@@ -224,15 +188,12 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${_customScript}
      sql = `${_customScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    return sql
  }
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx
@@ -2,10 +2,8 @@
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, notification, Modal, Spin, Tabs } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import SettingUtils from './utils.jsx'
import DataSource from './datasource'
import asyncComponent from '@/utils/asyncComponent'
@@ -134,18 +132,9 @@
    } else if (type === 'scripts' && _scripts.length === 0) {
      _resolve()
    } else { // type 为 submit 、 verify ,以及其他需要验证的场景
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let param = {
        func: 's_debug_sql',
        exec_type: 'y',
        LText: SettingUtils.getDebugSql(setting, _scripts, timestamp)
      }
      param.LText = param.LText.replace(/\n/g, ' ')
      param.LText = Utils.formatOptions(param.LText)
      param.timestamp = timestamp
      param.secretkey = Utils.encrypt('', timestamp)
      let sql = SettingUtils.getDebugSql(setting, _scripts)
      
      Api.genericInterface(param).then(result => {
      Api.sDebug(sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          _resolve()
        } else {
src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx
@@ -5,7 +5,7 @@
   * @return {String}  scripts       自定义脚本
   * @return {Object}  setting       页面设置
   */
  static getDebugSql (setting, scripts, timestamp) {
  static getDebugSql (setting, scripts) {
    let arr_field = `${setting.valueField},${setting.labelField},${setting.parentField}`
    let sql = ''
    let _dataresource = setting.dataresource || ''
@@ -35,16 +35,10 @@
      })
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _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 = [
@@ -68,20 +62,16 @@
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${_customScript}
      sql = `${_customScript}
        ${_dataresource}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '1949-10-01 15:00:00',@ErrorCode, @retmsg,'1949-10-01 15:00:00'
      `
    } else {
      sql = `/* sql 验证 */
        declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
      sql = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg =''
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
    console.info(sql)
    
    return sql
  }
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -2,7 +2,6 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -129,38 +128,18 @@
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: this.props.initsql +  _prevCustomScript + _backCustomScript + tail
        }
        let sql = this.props.initsql +  _prevCustomScript + _backCustomScript + tail
        if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
          window.GLOB.funcs.forEach(item => {
            let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
            param.LText = param.LText.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
            sql = sql.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
          })
        }
        // 数据权限
        param.LText = param.LText.replace(/@\$|\$@/ig, '')
        // check
        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${param.timestamp}'`)
        console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{6,20}/ig, '\n')}`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '')
        sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'1949-10-01 15:00:00'`)
        
        if (skip) {
          this.setState({
@@ -174,7 +153,7 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
src/templates/zshare/verifycard/customform/index.jsx
@@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Button, notification, Modal, Tooltip } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -110,12 +109,7 @@
          return
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
        }
        param.LText = `${this.props.initsql}
        let sql = `${this.props.initsql}
          /* 自定义验证 */
          select @tbid='', @ErrorCode='',@retmsg=''
          select top 1 @tbid='X' from (${values.sql}) a
@@ -129,29 +123,16 @@
        if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
          window.GLOB.funcs.forEach(item => {
            let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
            param.LText = param.LText.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
            sql = sql.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
          })
        }
        
        // 数据权限
        param.LText = param.LText.replace(/@\$|\$@/ig, '')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{10}/ig, '\n')}`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        sql = sql.replace(/@\$|\$@/ig, '')
        sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`)
        
        this.setState({loading: true})
        Api.genericInterface(param).then(res => {
        Api.sDebug(sql).then(res => {
          if (res.status || res.ErrCode === '-2') {
            this.setState({
              loading: false,
src/templates/zshare/verifycard/customscript/index.jsx
@@ -2,7 +2,6 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -172,48 +171,29 @@
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: this.props.initsql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        }
        let sql = this.props.initsql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
          window.GLOB.funcs.forEach(item => {
            let reg = new RegExp('\\$ex@' + item.func_code + '@ex\\$', 'ig')
            param.LText = param.LText.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
            sql = sql.replace(reg, `/*$ex@${item.func_code}-begin*/\n${item.key_sql}\n/*@ex$-end*/`)
          })
        }
        // 数据权限
        param.LText = param.LText.replace(/@\$|\$@/ig, '')
        // check
        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
        // 外联数据库替换
        if (window.GLOB.externalDatabase !== null) {
          param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase)
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'${param.timestamp}'`)
        sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '')
        sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`)
        if (window.GLOB.process && workFlow === 'true') {
          param.LText = param.LText.replace(/@works_flow_code@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@works_flow_name@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@works_flow_param@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@works_flow_detail_id@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@status@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@statusname@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@work_group@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/@work_grade@/ig, `'${param.timestamp}'`)
          sql = sql.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@works_flow_name@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@works_flow_param@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@works_flow_detail_id@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@status@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@statusname@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@work_group@/ig, `'1949-10-01 15:00:00'`)
          sql = sql.replace(/@work_grade@/ig, `'1949-10-01 15:00:00'`)
        }
        console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{6,20}/ig, '\n')}`)
        param.LText = param.LText.replace(/\n/g, ' ')
        param.LText = Utils.formatOptions(param.LText)
        param.secretkey = Utils.encrypt('', param.timestamp)
        
        if (skip) {
          this.setState({
@@ -227,7 +207,7 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
src/utils/utils.js
@@ -870,7 +870,9 @@
      sql = sql.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    return {