king
2023-09-18 11b6387d74467f81e33eba8f882bff610f240115
Merge branch 'master' into positec
59个文件已修改
2个文件已添加
1552 ■■■■ 已修改文件
src/api/index.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/pastebasetable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/searchcomponent/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/header/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/header/index.scss 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/picturecontroller/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/replaceField/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/sysinterface/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/tablenodes/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/versions/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/searchconfig/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardItem/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/utils.jsx 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/treesettingcomponent/settingform/utils.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/unattended/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -1051,6 +1051,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)
    }
    console.info(`/* sql 验证 */\n${sql.replace(/\n\s{6,20}/ig, '\n')}`)
    sql = sql.replace(/\n/ig, ' ')
    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)
      })
    }, 20000)
    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/components/header/index.jsx
@@ -192,6 +192,10 @@
      if (_menu) {
        this.openTab(_menu, 0)
      }
      setTimeout(() => {
        this.getwork()
      }, 100)
    })
    
    // 获取角色权限, edition_type 接口版本控制 ''、'Y'、'A'
@@ -210,7 +214,7 @@
              _permAction[menu.MenuID] = true
            })
          }
        } else {
        } else if (!/PRIMARY KEY/ig.test(result.message)) {
          notification.error({
            top: 92,
            message: result.message,
@@ -223,6 +227,23 @@
    }, 50)
  }
  getwork = () => {
    if (sessionStorage.getItem('work_grade')) return
    Api.genericInterface({func: 's_get_local_my_worker_v1'}).then(result => {
      sessionStorage.setItem('work_grade', result.work_grade || 0)
      sessionStorage.setItem('work_group', result.work_group || '')
      if (!result.status && sessionStorage.getItem('debug') === 'true') {
        notification.error({
          top: 92,
          message: /s_get_local_my_worker_v1/.test(result.message) ? '职员信息获取失败,请联系管理员。' : result.message,
          duration: 10
        })
      }
    })
  }
  openTab = (menu, times) => {
    if (times > 50) return
    times++
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,26 +436,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              editform: null,
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,26 +538,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              editform: null,
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,26 +543,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              editform: null,
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,25 +255,16 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              visible: false
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -647,7 +647,7 @@
      type: 'select',
      key: 'popClose',
      label: '关闭后',
      initVal: card.popClose || 'never',
      initVal: card.popClose || 'grid',
      required: true,
      options: [{
        value: 'never',
@@ -1756,7 +1756,7 @@
      type: 'select',
      key: 'popClose',
      label: '关闭后',
      initVal: card.popClose || 'never',
      initVal: card.popClose || 'grid',
      required: true,
      options: [{
        value: 'never',
src/menu/components/share/pastebasetable/index.jsx
@@ -95,7 +95,7 @@
    const { visible } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        {type === 'page' ? <Button icon="snippets" style={{color: '#1890ff', borderColor: '#1890ff'}} onClick={() => {this.setState({visible: true})}} >粘贴</Button> : <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />}
        <Modal
          title="粘贴"
@@ -108,7 +108,7 @@
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
        </Modal>
      </div>
      </>
    )
  }
}
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,25 +202,16 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              searchlist: _searchlist,
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,26 +449,18 @@
            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 => {
            if (result.status) {
          Api.sDebug(sql, rduri).then(result => {
            if (result.status || result.ErrCode === '-2') {
              this.setState({visible: false, loading: false, formlist: null})
              this.props.submitCol(values)
              this.record = null
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,8 +210,8 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
            if (res.status) {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
                editItem: null
src/menu/datasource/index.jsx
@@ -20,14 +20,7 @@
    mainSearch: [],
    visible: false,
    loading: false,
    setting: null,
    record: {}
  }
  UNSAFE_componentWillMount () {
    const { config } = this.props
    this.setState({setting: fromJS(config.setting).toJS()})
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -227,6 +220,13 @@
      }
      this.setState({loading: false, visible: false})
      if (res.cols) {
        res.cols = [...config.cols, ...res.cols]
      } else {
        delete res.cols
      }
      this.props.updateConfig({...config, ...res})
    }, () => {
      this.setState({loading: false})
src/menu/datasource/verifycard/customscript/index.jsx
@@ -19,7 +19,8 @@
    searches: PropTypes.array,      // 搜索条件
    systemScripts: PropTypes.array, // 系统脚本
    scriptSubmit: PropTypes.func,   // 脚本验证后提交
    scriptsChange: PropTypes.func   // 脚本验证
    scriptsChange: PropTypes.func,
    addProcess: PropTypes.func
  }
  state = {
@@ -40,9 +41,19 @@
        _usefulFields.push(item.field)
        _usefulFields.push(item.datefield)
        _usefulFields.push(item.datefield + '1')
      } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) {
      } else if (['dateweek', 'datemonth'].includes(item.type)) {
        _usefulFields.push(item.field)
        _usefulFields.push(item.field + '1')
      } else if (item.type === 'daterange') {
        let _skey = item.field
        let _ekey = item.field + '1'
        if (/,/.test(item.field)) {
          _skey = item.field.split(',')[0]
          _ekey = item.field.split(',')[1]
        }
        _usefulFields.push(_skey)
        _usefulFields.push(_ekey)
      } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
        _usefulFields.push(item.field + '1')
      } else {
@@ -66,9 +77,19 @@
          _usefulFields.push(item.field)
          _usefulFields.push(item.datefield)
          _usefulFields.push(item.datefield + '1')
        } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) {
        } else if (['dateweek', 'datemonth'].includes(item.type)) {
          _usefulFields.push(item.field)
          _usefulFields.push(item.field + '1')
        } else if (item.type === 'daterange') {
          let _skey = item.field
          let _ekey = item.field + '1'
          if (/,/.test(item.field)) {
            _skey = item.field.split(',')[0]
            _ekey = item.field.split(',')[1]
          }
          _usefulFields.push(_skey)
          _usefulFields.push(_ekey)
        } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
          _usefulFields.push(item.field + '1')
        } else {
@@ -220,6 +241,9 @@
    if (value === 'defaultsql') {
      value = this.props.defaultsql
    } else if (value === 'flowsql') {
      value = `/* select a.*,w.remark as remark_w,w.statusname as statusname_w,w.status as status_w,w.works_flow_param from (数据源) a inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */`
      this.props.addProcess()
    }
    _sql = _sql.replace(/\s{6}$/, '')
@@ -341,6 +365,7 @@
                onSelect={this.selectScript}
              >
                <Select.Option style={{whiteSpace: 'normal'}} key="default" value="defaultsql">默认sql</Select.Option>
                {window.GLOB.process ? <Select.Option style={{whiteSpace: 'normal'}} key="default" value="flowsql">默认sql(工作流)</Select.Option> : null}
                <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='测试断点' goto aaa`}>
                  测试断点
                </Select.Option>
src/menu/datasource/verifycard/index.jsx
@@ -22,6 +22,7 @@
const { TabPane } = Tabs
const { Paragraph } = Typography
const { Search } = Input
const { confirm } = Modal
const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror'))
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
@@ -51,6 +52,7 @@
    reload: false,
    script: null,
    scriptValue: '',
    cols: null,
    colColumns: [
      {
        title: '名称',
@@ -383,7 +385,7 @@
    }
    return new Promise((resolve, reject) => {
      this.sqlverify(resolve, reject, false, scripts)
      this.sqlverify(resolve, reject, 'script', scripts)
    })
  }
@@ -447,7 +449,7 @@
              loading: false
            })
            this.getdefaultSql()
          }, true)
          }, 'change')
        })
      }, () => {
        this.setState({loading: false})
@@ -579,7 +581,7 @@
  submitDataSource = () => {
    const { config, mainSearch } = this.props
    const { activeKey, setting, columns, subColumns, scripts } = this.state
    const { activeKey, setting, columns, subColumns, scripts, cols } = this.state
    if (config.subtype === 'dualdatacard') {
      let arr = columns.map(col => col.field.toLowerCase())
@@ -620,7 +622,7 @@
            defaultSearch: _search,
            setting: res
          }, () => {
            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts }) }, reject, false)
            this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols }) }, reject, 'submit')
          })
        }, () => {
          reject()
@@ -635,7 +637,7 @@
          reject()
          return
        }
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false)
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
      } else if (activeKey === 'subcolumns') {
        if (this.subdatasource && this.subdatasource.state.editingKey) {
          notification.warning({
@@ -646,7 +648,7 @@
          reject()
          return
        }
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false)
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
      } else if (activeKey === 'scripts') {
        let _loading = false
        if (this.scriptsForm && this.scriptsForm.state.editItem) {
@@ -665,12 +667,12 @@
          return
        }
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false)
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
      }
    })
  }
  sqlverify = (resolve, reject, change = false, testScripts) => {
  sqlverify = (resolve, reject, type, testScripts) => {
    const { config } = this.props
    const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state
@@ -679,7 +681,7 @@
    if (testScripts) {
      _scripts = testScripts.filter(item => item.status !== 'false')
    }
    if (!change && setting.interType === 'system' && setting.execute === 'false' && _scripts.length === 0) {
    if (type !== 'change' && setting.interType === 'system' && setting.execute === 'false' && _scripts.length === 0) {
      notification.warning({
        top: 92,
        message: '不执行默认sql时,请添加自定义脚本!',
@@ -689,14 +691,13 @@
      return
    }
    if (change && columns.length === 0) {
    if (type === 'change' && columns.length === 0) {
      reject()
      return
    }
    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)
@@ -713,52 +714,31 @@
        })
      }
      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 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 => {
        if (result.status) {
          if (sumParam) {
            Api.genericInterface(sumParam).then(res => {
              if (res.status) {
      Api.sDebug(r.sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
                this.setState({debugId: _debugId}, () => {
                  resolve()
                })
              } else {
          if (type === 'submit') {
            Modal.confirm({
              title: result.message,
              okText: '知道了',
              cancelText: '强制保存',
              onOk: () => {
                reject()
                Modal.error({
                  title: res.message
                })
              }
            })
          } else {
            this.setState({debugId: _debugId}, () => {
              },
              onCancel() {
              resolve()
            })
          }
            })
        } else {
          reject()
          Modal.error({
            title: result.message
              title: result.message,
              okText: '知道了'
          })
          }
        }
      })
    } else {
@@ -799,7 +779,7 @@
    this.setState({loading: true})
    this.sqlverify(() => {this.setState({scripts: _scripts, script: null, scriptValue: '', loading: false})}, () => {this.setState({loading: false})}, false, _scripts)
    this.sqlverify(() => {this.setState({scripts: _scripts, script: null, scriptValue: '', loading: false})}, () => {this.setState({loading: false})}, 'script', _scripts)
  }
  updatefields = (columns) => {
@@ -965,6 +945,49 @@
    message.success('复制成功。')
  }
  addProcess = () => {
    const { config } = this.props
    const { columns } = this.state
    if (config.subtype === 'dualdatacard') return
    let fields = []
    let cols = []
    let _cols = columns.map(item => item.field.toLowerCase())
    if (!_cols.includes('remark_w')) {
      fields.push({ uuid: Utils.getuuid(), label: '备注', field: 'remark_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' })
      cols.push({ uuid: Utils.getuuid(), Width: 120, label: '备注', field: 'remark_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 })
    }
    if (!_cols.includes('statusname_w')) {
      fields.push({ uuid: Utils.getuuid(), label: '状态', field: 'statusname_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' })
      cols.push({ uuid: Utils.getuuid(), Width: 120, label: '状态', field: 'statusname_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 })
    }
    if (!_cols.includes('works_flow_param')) {
      fields.push({ uuid: Utils.getuuid(), label: '流程参数', field: 'works_flow_param', datatype: 'Nvarchar(512)', fieldlength: 512, type: 'text' })
      cols.push({ uuid: Utils.getuuid(), Width: 120, label: '流程参数', field: 'works_flow_param', type: 'text', Hide: 'true', IsSort: 'false', fieldlength: 512 })
    }
    if (fields.length === 0) return
    const that = this
    if (config.subtype !== 'basetable') {
      cols = null
    }
    confirm({
      content: cols ? '显示列中是否添加工作流字段?' : '字段集中是否添加工作流字段?',
      onOk() {
        that.setState({
          cols: cols,
          columns: [...fields, ...columns]
        })
      },
      onCancel() {}
    })
  }
  /**
   * @description 组件销毁,清除state更新
   */
@@ -995,6 +1018,7 @@
              setting={setting}
              scripts={scripts}
              updateStatus={this.updateStatus}
              addProcess={this.addProcess}
              wrappedComponentRef={(inst) => this.settingForm = inst}
            /> : null}
          </TabPane>
@@ -1058,6 +1082,7 @@
              systemScripts={this.state.systemScripts}
              scriptsChange={this.scriptsChange}
              scriptSubmit={this.scriptSubmit}
              addProcess={this.addProcess}
              wrappedComponentRef={(inst) => this.scriptsForm = inst}
            />
            <EditTable actions={['move']} data={scripts} columns={scriptsColumns} onChange={this.changeScripts}/>
src/menu/datasource/verifycard/settingform/index.jsx
@@ -16,6 +16,7 @@
class SettingForm extends Component {
  static propTpyes = {
    updateStatus: PropTypes.func,
    addProcess: PropTypes.func,
    config: PropTypes.object,     // 组件配置
    setting: PropTypes.object,    // 数据源配置
    columns: PropTypes.array,     // 列设置
@@ -183,11 +184,13 @@
  addProcess = () => {
    let _sql = this.props.form.getFieldValue('dataresource')
    _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname  as statusname_w,w.status as status_w  from 数据源 a inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */`
    _sql = _sql + `\n/* select a.*,w.remark as remark_w,w.statusname as statusname_w,w.status as status_w,w.works_flow_param from (数据源) a inner join (select * from  s_my_works_flow  where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */`
    this.props.form.setFieldsValue({
      dataresource: _sql
    })
    this.props.addProcess()
  }
  render() {
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, '')
@@ -103,46 +103,53 @@
      if (!item.field) return
      if (item.datefield) {
        _regoptions.push({
          var: new RegExp('@' + item.datefield, 'ig'),
          reg: new RegExp('@' + item.datefield + '@', 'ig')
        })
        _regoptions.push({
          var: new RegExp('@' + item.datefield + '1', 'ig'),
          reg: new RegExp('@' + item.datefield + '1@', 'ig')
        })
      }
      if (['dateweek', 'datemonth', 'daterange', 'range'].includes(item.type)) {
      if (['dateweek', 'datemonth', 'range'].includes(item.type)) {
        _regoptions.push({
          var: new RegExp('@' + item.field, 'ig'),
          reg: new RegExp('@' + item.field + '@', 'ig')
        })
        _regoptions.push({
          var: new RegExp('@' + item.field + '1', 'ig'),
          reg: new RegExp('@' + item.field + '1@', 'ig')
        })
      } else if (item.type === 'daterange') {
        let _skey = item.field
        let _ekey = item.field + '1'
        if (/,/.test(item.field)) {
          _skey = item.field.split(',')[0]
          _ekey = item.field.split(',')[1]
        }
        _regoptions.push({
          reg: new RegExp('@' + _skey + '@', 'ig')
        })
        _regoptions.push({
          reg: new RegExp('@' + _ekey + '@', 'ig')
        })
      } else if (item.type === 'date') {
        if (_fields.includes(item.field)) {
          _regoptions.push({
            var: new RegExp('@' + item.field + '1', 'ig'),
            reg: new RegExp('@' + item.field + '1@', 'ig')
          })
        } else {
          _fields.push(item.field)
          _regoptions.push({
            var: new RegExp('@' + item.field, 'ig'),
            reg: new RegExp('@' + item.field + '@', 'ig')
          })
        }
      } else if (item.type === 'text' || item.type === 'select') {
        item.field.split(',').forEach(field => {
          _regoptions.push({
            var: new RegExp('@' + field, 'ig'),
            reg: new RegExp('@' + field + '@', 'ig')
          })
        })
      } else {
        _regoptions.push({
          var: new RegExp('@' + item.field, 'ig'),
          reg: new RegExp('@' + item.field + '@', 'ig')
        })
      }
@@ -184,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 = []
@@ -253,8 +254,6 @@
        })
      })
    }
    sql = sql.replace(/\n/g, ' ')
    return { error, sql, errors: errors.join(';') }
  }
src/menu/debug/index.jsx
New file
@@ -0,0 +1,203 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { fromJS } from 'immutable'
import { Modal, Button } from 'antd'
// import moment from 'moment'
// import Api from '@/api'
// import Utils from '@/utils/utils.js'
import './index.scss'
class DebugSql extends Component {
  static propTpyes = {
    config: PropTypes.object
  }
  state = {
    visible: false,
    confirming: false,
  }
  trigger = () => {
    // const { config } = this.props
    // let list = []
    // let mainSearch = []
  }
  // formatSearch (config) {
  //   if (!config.search) return []
  //   let values = []
  //   config.search.forEach(item => {
  //     item.hidden = item.Hide === 'true'
  //     item.required = !item.hidden && item.required === 'true'
  //     item.advanced = item.advanced === 'true'
  //     item.$forbid = item.query === 'false'
  //     item.precision = item.precision || 'day'
  //     if (item.type === 'date') { // 时间搜索
  //       let format = 'YYYY-MM-DD'
  //       if (item.precision === 'day') {
  //       } else if (item.precision === 'hour') {
  //         format = 'YYYY-MM-DD HH'
  //       } else if (item.precision === 'minute') {
  //         format = 'YYYY-MM-DD HH:mm'
  //       } else if (item.precision === 'second') {
  //         format = 'YYYY-MM-DD HH:mm:ss'
  //       }
  //       item.initval = item.initval ? moment().subtract(item.initval, 'days').format(format) : ''
  //     } else if (item.type === 'datemonth') {
  //       item.initval = item.initval ? moment().subtract(item.initval, 'month').format('YYYY-MM') : ''
  //     } else if (item.type === 'dateweek') {
  //       item.initval = item.initval ? moment().subtract(item.initval * 7, 'days').format('YYYY-MM-DD') : ''
  //     } else if (item.type === 'daterange') {
  //       let format = 'YYYY-MM-DD'
  //       if (item.precision === 'day') {
  //       } else if (item.precision === 'hour') {
  //         format = 'YYYY-MM-DD HH'
  //       } else if (item.precision === 'minute') {
  //         format = 'YYYY-MM-DD HH:mm'
  //       } else if (item.precision === 'second') {
  //         format = 'YYYY-MM-DD HH:mm:ss'
  //       }
  //       if (item.initval === 'week') {
  //         item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',')
  //       } else if (item.initval === 'month') {
  //         item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',')
  //       } else if (item.initval === 'lastMonth') {
  //         item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',')
  //       } else if (item.initval) {
  //         try {
  //           let _initval = JSON.parse(item.initval)
  //           let _vals = [moment().subtract(_initval[0], 'days').format(format), moment().subtract(_initval[1], 'days').format(format)]
  //           item.initval = _vals.join(',')
  //         } catch (e) {
  //           item.initval = ''
  //         }
  //       }
  //     } else if (item.type === 'group') {
  //       if (item.initval && item.initval[0]) {
  //         let _type = item.initval[0]
  //         let _val = item.initval[1]
  //         let _dateRange = ''
  //         if (_type === 'day') {
  //           _dateRange = [moment().subtract(_val, 'days').format('YYYY-MM-DD'),
  //             moment().subtract(_val, 'days').format('YYYY-MM-DD')]
  //         } else if (_type === 'week') {
  //           _dateRange = [moment().subtract(_val * 7, 'days').startOf('week').format('YYYY-MM-DD'),
  //             moment().subtract(_val * 7, 'days').endOf('week').format('YYYY-MM-DD')]
  //         } else if (_type === 'month') {
  //           _dateRange = [moment().subtract(_val, 'month').startOf('month').format('YYYY-MM-DD'),
  //             moment().subtract(_val, 'month').endOf('month').format('YYYY-MM-DD')]
  //         } else if (_type === 'quarter') {
  //           let _differ = parseInt(moment().format('MM')) % 3
  //           let _pdiffer = 0
  //           let _ndiffer = 0
  //           // 差值计算
  //           switch(_differ) {
  //             case 0:
  //               _pdiffer = 2
  //               _ndiffer = 0
  //               break
  //             case 1:
  //               _pdiffer = 0
  //               _ndiffer = -2
  //               break
  //             case 2:
  //               _pdiffer = 1
  //               _ndiffer = -1
  //               break
  //             default:
  //           }
  //           _dateRange = [moment().subtract(_pdiffer + _val * 3, 'month').startOf('month').format('YYYY-MM-DD'),
  //             moment().subtract(_ndiffer + _val * 3, 'month').endOf('month').format('YYYY-MM-DD')]
  //         } else if (_type === 'year') {
  //           let _year = parseInt(moment().format('YYYY')) - _val
  //           _dateRange = [_year + '-01-01', _year + '-12-31']
  //         } else if (_type === 'customized') {
  //           try {
  //             _val = JSON.parse(_val)
  //           } catch (e) {
  //             _val = [0, 0]
  //           }
  //           _dateRange = [moment().subtract(_val[0], 'days').format('YYYY-MM-DD'),
  //             moment().subtract(_val[1], 'days').format('YYYY-MM-DD')]
  //         }
  //         item.initval = _dateRange.join(',')
  //         item.initType = _type
  //       } else {
  //         item.initval = ''
  //         item.initType = ''
  //       }
  //     }
  //     item.oriInitval = item.initval
  //     if (values) {
  //       item.initval = values[item.field] || ''
  //     }
  //     if (item.blacklist && item.blacklist.length > 0 && !item.hidden) {
  //       if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
  //         item.hidden = true
  //         item.required = false
  //       }
  //     }
  //     if (item.required) {
  //       required = true
  //     }
  //     if (item.type === 'text' || item.type === 'select') {
  //       if (/,/.test(item.field)) {
  //         item.field.split(',').forEach(field => {
  //           keys.push(field.toLowerCase())
  //         })
  //       } else {
  //         keys.push(item.field.toLowerCase())
  //       }
  //     } else if (item.type === 'group') {
  //       keys.push(item.field.toLowerCase())
  //       keys.push(item.datefield.toLowerCase())
  //     }
  //     return item
  //   })
  //   config.$s_keys = keys
  //   config.$s_req = required
  // }
  render() {
    const { visible, confirming } = this.state
    return (
      <>
        <Button className="mk-border-yellow" icon="bug" onClick={this.trigger}>调试</Button>
        <Modal
          title="SQL验证"
          wrapClassName="debug-modal"
          visible={visible}
          width={600}
          maskClosable={false}
          onOk={this.submit}
          onCancel={() => { this.setState({ visible: false })}}
          confirmLoading={confirming}
          destroyOnClose
        >
        </Modal>
      </>
    )
  }
}
export default DebugSql
src/menu/debug/index.scss
New file
@@ -0,0 +1,9 @@
.replace-field-modal {
  .ant-modal {
    top: 70px;
  }
  .ant-modal-body {
    min-height: 150px;
    padding-top: 40px;
  }
}
src/menu/header/index.jsx
@@ -1,5 +1,4 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import avatar from '@/assets/img/avatar.jpg'
import MainLogo from '@/assets/img/main-logo.png'
@@ -11,15 +10,13 @@
    userName: sessionStorage.getItem('CloudUserName')
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  render () {
    const { menuName } = this.props
    return (
      <header className="menu-header-container">
        <div className="header-logo"><img src={MainLogo} alt=""/></div>
        <div className="menu-name">{menuName}</div>
          <div className="header-setting">
            <img src={this.state.avatar} alt=""/>
            <span>
src/menu/header/index.scss
@@ -10,7 +10,7 @@
  border-bottom: 1px solid #000;
  .header-logo {
    float: left;
    position: absolute;
    width: 180px;
    line-height: 48px;
    text-align: center;
@@ -22,8 +22,17 @@
      max-height: 40px;
    }
  }
  .menu-name {
    text-align: center;
    color: #ffffff;
    line-height: 45px;
    font-size: 16px;
    margin-left: 40px;
  }
  .header-setting {
    float: right;
    position: absolute;
    right: 0px;
    top: 0px;
    line-height: 48px;
    margin-right: 10px;
    img {
@@ -43,44 +52,6 @@
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
  >.ant-menu {
    float: left;
    width: unset;
    .ant-menu-item {
      margin-bottom: 0;
      float: left;
      width: unset;
      cursor: default;
      .anticon-arrow-left {
        height: 24px;
        cursor: pointer;
      }
      .ant-btn {
        color: #fff;
        width: unset;
        cursor: pointer;
        height: 37px;
        background: transparent;
        border: 0;
        .anticon-save {
          margin-right: 0;
        }
      }
      .ant-btn[ant-click-animating-without-extra-node="true"]::after {
        display: none!important;
      }
      .ant-btn::before {
        display: none!important;
      }
    }
    .ant-menu-item.ant-menu-item-selected {
      background-color: transparent;
    }
    .ant-menu-item:not(:last-child) {
      border-right: 1px solid #353535;
    }
  }
}
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,26 +262,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              config: _config,
src/menu/pastecontroller/index.jsx
@@ -94,7 +94,7 @@
    const { visible } = this.state
    return (
      <div className="mk-view-paste" style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => {this.setState({visible: true})}}><SnippetsOutlined />粘贴</Button>
        <Modal
          title="粘贴"
@@ -107,7 +107,7 @@
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/picturecontroller/index.jsx
@@ -261,7 +261,7 @@
    const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex, colorlist, iconlist } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-purple" onClick={this.trigger}><PictureOutlined /> 资源管理</Button>
        <Modal
          wrapClassName="mk-pop-modal picture-control-model"
@@ -389,7 +389,7 @@
        >
          <EditForm card={card} wrappedComponentRef={(inst) => this.editFormRef = inst} inputSubmit={this.save}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/replaceField/index.jsx
@@ -636,7 +636,7 @@
    const { visible, loadingTable, tables, confirming } = this.state
    return (
      <div className="mk-replace-field" style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-yellow" icon="swap" loading={loadingTable} onClick={this.trigger}>字段替换</Button>
        <Modal
          title="字段替换"
@@ -651,7 +651,7 @@
        >
          <SettingForm tables={tables} wrappedComponentRef={(inst) => this.settingRef = inst}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/sysinterface/index.jsx
@@ -253,7 +253,7 @@
    const { visible, columns, interfaces } = this.state
    return (
      <div className="mk-sys-interface" style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-danger" onClick={this.trigger}><DatabaseOutlined /> 公共数据源</Button>
        <Modal
          title="公共数据源"
@@ -272,7 +272,7 @@
          <PlusOutlined key="add-interface" onClick={this.addInterface}/>
          <EditTable key="manage-interface" actions={['copy']} type="interface" data={interfaces} columns={columns} onChange={this.changeScripts}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/tablenodes/index.jsx
@@ -800,7 +800,7 @@
    const { visible, loading, empty } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#8E44AD', color: '#8E44AD'}} onClick={this.trigger}><ForkOutlined /> 表关系图</Button>
        <Modal
          title=""
@@ -824,7 +824,7 @@
            <span className="tip">注:点击表名(右侧)可展开/收起菜单,左侧橙色标注为接口或函数名。</span>
          </div>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/versions/index.jsx
@@ -128,7 +128,7 @@
    const { visible, preconfirming, nextconfirming } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={this.trigger}><CalendarOutlined /> 版本管理</Button>
        <Modal
          title=""
@@ -148,7 +148,7 @@
            <Button key="cancel" onClick={() => { this.setState({ visible: false })}}>取消</Button>
          </div>
        </Modal>
      </div>
      </>
    )
  }
}
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,26 +259,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              config: _config,
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,25 +228,16 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              group: _group,
src/tabviews/basetable/index.jsx
@@ -190,6 +190,10 @@
        })
      }
      if (config.flow_code) {
        regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code })
      }
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true')
      let autoMatic = null
src/tabviews/custom/components/card/cardItem/index.jsx
@@ -16,7 +16,7 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.data), fromJS(nextProps.data))
    return !is(fromJS(this.props), fromJS(nextProps))
  }
  /**
src/tabviews/custom/index.jsx
@@ -231,6 +231,10 @@
        })
      }
      if (config.flow_code) {
        regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code })
      }
      config.$cache = config.cacheLocal === 'true'
      config.$time = config.localCacheTime || 0
src/tabviews/custom/popview/index.jsx
@@ -123,6 +123,11 @@
      })
    }
    if (Tab.$process && window.GLOB.UserCacheMap.has(Tab.$flowId)) {
      let flow = window.GLOB.UserCacheMap.get(Tab.$flowId)
      regs.push({ reg: /@works_flow_code@/ig, value: flow.flow_code || '' })
    }
    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
    
    // 获取主搜索条件
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -451,12 +451,6 @@
          }
        }
        if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
          param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
        } else {
          param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
        }
        param.exec_type = 'y' // 后台解码
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.secretkey = Utils.encrypt('', param.timestamp)
@@ -493,12 +487,6 @@
            }
          }
          
          if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
            param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
          } else {
            param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
          }
          param.exec_type = 'y' // 后台解码
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt('', param.timestamp)
@@ -523,12 +511,6 @@
            if (btn.output) {
              param.key_back_type = 'Y'
            }
          }
          if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
            param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
          } else {
            param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
          }
          param.exec_type = 'y' // 后台解码
@@ -597,12 +579,6 @@
            }
          }
          
          if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
            param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
          } else {
            param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
          }
          param.exec_type = 'y' // 后台解码
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt('', param.timestamp)
@@ -643,12 +619,6 @@
              }
            }
            
            if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
              param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
            } else {
              param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
            }
            param.exec_type = 'y' // 后台解码
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
            param.secretkey = Utils.encrypt('', param.timestamp)
@@ -673,12 +643,6 @@
              if (btn.output) {
                param.key_back_type = 'Y'
              }
            }
            if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
              param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
            } else {
              param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
            }
            param.exec_type = 'y' // 后台解码
@@ -769,7 +733,7 @@
      }
      if (retmsg) {
        param.$callbacksql = this.getSysDeclareSql(btn, formdata, data[0], columns, primaryId, this.props.BID)
        param.$callbacksql = this.getSysDeclareSql(btn, formdata, data[0], columns, this.props.BID)
      }
      _params.push(param)
@@ -819,7 +783,7 @@
        }
        if (retmsg) {
          param.$callbacksql = this.getSysDeclareSql(btn, formdata, cell, columns, primaryId, this.props.BID)
          param.$callbacksql = this.getSysDeclareSql(btn, formdata, cell, columns, this.props.BID)
        }
        return param
@@ -832,7 +796,7 @@
  /**
   * @description 获取回调脚本的字段定义
   */
  getSysDeclareSql = (btn, formdata, data, columns, primaryId, BID = '') => {
  getSysDeclareSql = (btn, formdata, data, columns, BID = '') => {
    let datavars = {}                 // 声明的变量,表单及显示列
    // 需要声明的变量集
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid']
@@ -999,20 +963,6 @@
        /* 显示列变量赋值 */
        select ${_initColfields.join(',')}
        `
    }
    _sql = _sql.replace(/@ID@/ig, `'${primaryId || ''}'`)
    _sql = _sql.replace(/@BID@/ig, `'${BID}'`)
    _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 || ''}'`)
    _sql = _sql.replace(/@typename@/ig, `'admin'`)
    if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
      _sql = _sql.replace(/@datam@/ig, '\'Y\'')
    } else {
      _sql = _sql.replace(/@datam@/ig, '\'\'')
    }
    return _sql
@@ -1195,6 +1145,8 @@
   * @description 自定义请求循环执行
   */
  customLoopRequest = (params, _resolve) => {
    const { setting, btn } = this.props
    let param = params.shift()
    this.setState({
@@ -1206,6 +1158,10 @@
      ID: param.ID || '',
      callbacksql: param.$callbacksql || '',
      mk_api_key: ''
    }
    if (!record.ID && btn.Ot !== 'notRequired' && param[setting.primaryKey]) {
      record.ID = param[setting.primaryKey]
    }
    delete param.$callbacksql
@@ -1567,7 +1523,7 @@
      param.func = 'sPC_TableData_InUpDe'
      
      if (record.BID) {
        param.BID = this.props.BID
        param.BID = record.BID
      }
      if (record.ID) {
        param.ID = record.ID
@@ -1597,6 +1553,8 @@
      if (btn.output) {
        _backCustomScript += `
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,${btn.output} as mk_b_id`
        param.key_back_type = 'Y'
      } else {
        _backCustomScript += `
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
@@ -1612,7 +1570,7 @@
      sql = sql + _backCustomScript
      sql = sql.replace(/@ID@/ig, `'${record.ID || ''}'`)
      sql = sql.replace(/@BID@/ig, `'${this.props.BID || ''}'`)
      sql = sql.replace(/@BID@/ig, `'${record.BID || ''}'`)
      sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
      sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
      sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
@@ -1771,7 +1729,7 @@
   * @description 外部请求循环执行
   */
  outerLoopRequest = (params, _resolve) => {
    if (!params && params.length === 0) return
    const { setting, btn } = this.props
    let param = params.shift()
@@ -1785,6 +1743,10 @@
      callbacksql: param.$callbacksql || ''
    }
    if (!record.ID && btn.Ot !== 'notRequired' && param[setting.primaryKey]) {
      record.ID = param[setting.primaryKey]
    }
    delete param.$callbacksql
    if (!param.func) {
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,26 +390,18 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              config: _config,
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,8 +226,8 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
            if (res.status) {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
                editItem: null
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -95,9 +95,19 @@
        _usefulFields.push(item.field)
        _usefulFields.push(item.datefield)
        _usefulFields.push(item.datefield + '1')
      } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) {
      } else if (['dateweek', 'datemonth'].includes(item.type)) {
        _usefulFields.push(item.field)
        _usefulFields.push(item.field + '1')
      } else if (item.type === 'daterange') {
        let _skey = item.field
        let _ekey = item.field + '1'
        if (/,/.test(item.field)) {
          _skey = item.field.split(',')[0]
          _ekey = item.field.split(',')[1]
        }
        _usefulFields.push(_skey)
        _usefulFields.push(_ekey)
      } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
        _usefulFields.push(item.field + '1')
      } else {
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,17 +893,8 @@
      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 => {
      if (result.status) {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({debugId: _debugId})
        _resolve()
      } else {
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
  }
@@ -220,12 +215,29 @@
          value: '0'
        })
        options.push(item)
      } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) {
      } else if (['datemonth', 'dateweek'].includes(search.type)) {
        options.push(item)
        options.push({
          key: item.key + '1',
          value: '0'
        })
      } else if (search.type === 'daterange') {
        let _skey = search.field
        let _ekey = search.field + '1'
        if (/,/.test(search.field)) {
          _skey = search.field.split(',')[0]
          _ekey = search.field.split(',')[1]
        }
        options.push({
          key: _skey,
          value: '0'
        })
        options.push({
          key: _ekey,
          value: '0'
        })
      } else if (search.type === 'text' || search.type === 'select') {
        item.key.split(',').forEach(field => {
          let cell = JSON.parse(JSON.stringify(item))
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,17 +646,8 @@
      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 => {
      if (result.status) {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({debugId: _debugId})
        _resolve()
      } else {
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,25 +209,16 @@
          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 => {
          if (result.status) {
        Api.sDebug(sql, rduri).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
              searchlist: _searchlist,
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -257,6 +257,8 @@
    if (type === 'text' || type === 'select') {
      reTooltip.field = '字段名可以使用逗号分隔,进行综合搜索。'
    } else if (type === 'daterange') {
      reTooltip.field = '字段名可以使用逗号分隔,例如startTime,endTime。'
    } else if (type === 'group') {
      reTooltip.field = '查询数据时(自定义脚本或统计数据源),类型字段将用作替换脚本中的 @字段@ ,类型字段对应值为:日 -> day;周 -> week;月 -> month;季 -> quarter;年 -> year;自定义 -> customized'
      reLabel.field = '类型字段'
@@ -463,7 +465,7 @@
        ]
        if (item.key === 'field' || item.key === 'datefield') {
          rules.push({
            pattern: (type === 'text' || type === 'select') ? formRule.field.multipattern : formRule.field.pattern,
            pattern: (type === 'text' || type === 'select' || type === 'daterange') ? formRule.field.multipattern : formRule.field.pattern,
            message: formRule.field.message
          }, {
            max: formRule.field.max,
@@ -619,6 +621,15 @@
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          values.uuid = this.props.card.uuid
          if (/,/.test(values.field)) {
            values.field = values.field.split(',').filter(Boolean)
            if (values.type === 'daterange' && values.field.length > 2) {
              values.field.length = 2
            }
            values.field = values.field.join(',')
          }
          // 下拉菜单或联动菜单
          if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) {
            if (values.resourceType === '0') {
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -156,10 +156,27 @@
          value: '0'
        })
        options.push(item)
      } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) {
      } else if (['datemonth', 'dateweek'].includes(search.type)) {
        options.push(item)
        options.push({
          key: item.key + '1',
          value: '0'
        })
      } else if (search.type === 'daterange') {
        let _skey = search.field
        let _ekey = search.field + '1'
        if (/,/.test(search.field)) {
          _skey = search.field.split(',')[0]
          _ekey = search.field.split(',')[1]
        }
        options.push({
          key: _skey,
          value: '0'
        })
        options.push({
          key: _ekey,
          value: '0'
        })
      } else if (search.type === 'text' || search.type === 'select') {
@@ -299,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({
@@ -318,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 => {
        if (result.status) {
          if (sumParam) {
            Api.genericInterface(sumParam).then(res => {
              if (res.status) {
      Api.sDebug(r.sql).then(result => {
        if (result.status || result.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,22 +299,12 @@
      _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 => {
      if (result.status) {
    Api.sDebug(sql).then(result => {
      if (result.status || result.ErrCode === '-2') {
        this.setState({
          loading: false,
          scripts: _scripts,
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,19 +132,10 @@
    } 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 => {
        if (result.status) {
      Api.sDebug(sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          _resolve()
        } else {
          _reject()
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/formconfig.jsx
@@ -1417,7 +1417,7 @@
      type: refresh.length === 0 ? 'radio' : 'select',
      key: 'popClose',
      label: '关闭后',
      initVal: card.popClose || 'never',
      initVal: card.popClose || 'grid',
      required: true,
      options: [{
        value: 'never',
src/templates/zshare/modalform/index.jsx
@@ -27,7 +27,7 @@
  checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'place', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom'],
  multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'],
  link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'],
  fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'],
  fileupload: ['readonly', 'required', 'hidden', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'],
  switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'],
  check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'],
  date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'],
src/templates/zshare/unattended/index.jsx
@@ -65,7 +65,7 @@
    const { visible, actions, autoMatic } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-purple" onClick={this.trigger}><UserOutlined/> 无人值守</Button>
        <Modal
          title="无人值守"
@@ -79,7 +79,7 @@
        >
          <SettingForm actions={actions} autoMatic={autoMatic} wrappedComponentRef={(inst) => this.settingRef = inst}/>
        </Modal>
      </div>
      </>
    )
  }
}
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,8 +153,8 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
            if (res.status) {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
                editItem: null
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,30 +123,17 @@
        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 => {
          if (res.status) {
        Api.sDebug(sql).then(res => {
          if (res.status || res.ErrCode === '-2') {
            this.setState({
              loading: false,
              editItem: null
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,44 +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}'`)
          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({
@@ -223,8 +207,8 @@
          })
        } else {
          this.setState({loading: true})
          Api.genericInterface(param).then(res => {
            if (res.status) {
          Api.sDebug(sql).then(res => {
            if (res.status || res.ErrCode === '-2') {
              this.setState({
                loading: false,
                editItem: null
@@ -274,12 +258,15 @@
    if (value === 'flowSql') {
      if (flowType === 'start') {
        value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff)
        select @ID@,@works_flow_code@,@works_flow_param@,'职员分组',@works_flow_detail_id@,'职员等级',@bid@,@UserID@,@UserName,@FullName
        insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,status,statuscharone,statuschartwo,StatusCharThree,StatusCharFour,StatusCharFive,statusname,remark,CreateUserID,CreateUser,CreateStaff,works_flow_detail_id,sort,upid,work_group,work_grade,typecharone,deleted,statusname_suc,statusname_back )`
        value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff)
        select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName
        insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade)
        select @works_flow_id@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@`
      } else {
        value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff)
        select @ID@,@works_flow_code@,@works_flow_param@,'职员分组',@works_flow_detail_id@,'职员等级',@bid@,@UserID@,@UserName,@FullName`
        value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff)
        select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName
        insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade)
        select @works_flow_id@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@`
      }
      value = value.replace(/\n\s{8}/g, '\n')
src/utils/utils.js
@@ -546,8 +546,16 @@
          }
        }
        newsearches[item.key] = _startval
        newsearches[item.key + '1'] = _endval
        let _skey = item.key
        let _ekey = item.key + '1'
        if (/,/.test(item.key)) {
          _skey = item.key.split(',')[0]
          _ekey = item.key.split(',')[1]
        }
        newsearches[_skey] = _startval
        newsearches[_ekey] = _endval
      } else if (item.type === 'text' || item.type === 'select') {
        item.key.split(',').forEach(field => { // 综合搜索,所字段拼接
          newsearches[field] = item.value
@@ -638,7 +646,15 @@
          _endval = val[1] + '.000'
        }
        searchText.push('(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')')
        let _skey = item.key
        let _ekey = item.key
        if (/,/.test(item.key)) {
          _skey = item.key.split(',')[0]
          _ekey = item.key.split(',')[1]
        }
        searchText.push('(' + _skey + ' >= \'' + _startval + '\' AND ' + _ekey + ' < \'' + _endval + '\')')
      } else if (item.type === 'range') {
        let val = item.value.split(',')
@@ -854,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 {
@@ -1539,6 +1557,8 @@
    }
    columns.forEach(col => {
      if (col.field === 'works_flow_param') return
      if (col.type === 'colspan' || col.type === 'old_colspan') {
        col.subcols.forEach(cell => {
          setField(cell)
@@ -2085,6 +2105,62 @@
    `
  }
  if (btn.$process && verify.workFlow === 'true' && window.GLOB.UserCacheMap.has(btn.$flowId)) {
    let flow = window.GLOB.UserCacheMap.get(btn.$flowId)
    let node = null
    let line = null
    let target = null
    let status = 0
    let statusName = ''
    let detailId = ''
    if (verify.flowSql === 'true') {
      if (verify.flowType === 'start') {
        target = flow.cells.filter(cell => cell.mknode === 'start')[0]
        if (target) {
          detailId = target.id
          status = target.mkdata.status
          statusName = target.mkdata.statusName
        }
      } else if (_data.works_flow_param) {
        node = JSON.parse(window.decodeURIComponent(window.atob(_data.works_flow_param)))
        if (node) {
          line = flow.cells.filter(cell => cell.shape === 'edge' && cell.source.cell === node.id)[0]
        }
        if (line) {
          target = flow.cells.filter(cell => cell.id === line.target.cell)[0]
        }
      }
      if (target) {
        _sql += `
      /* 工作流默认sql */
      insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff)
      select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName
      insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade)
      select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@
      `
      }
    }
    _sql = _sql.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`)
    _sql = _sql.replace(/@works_flow_name@/ig, `'${flow.flow_name}'`)
    if (target) {
      let msg = {...target.mkdata, id: target.id}
      _sql = _sql.replace(/@works_flow_param@/ig, `'${window.btoa(window.encodeURIComponent(JSON.stringify(msg)))}'`)
    } else {
      _sql = _sql.replace(/@works_flow_param@/ig, `''`)
    }
    _sql = _sql.replace(/@works_flow_detail_id@/ig, `'${detailId}'`)
    _sql = _sql.replace(/@status@/ig, `'${status}'`)
    _sql = _sql.replace(/@statusname@/ig, `'${statusName}'`)
    _sql = _sql.replace(/@work_group@/ig, `'${sessionStorage.getItem('work_group') || ''}'`)
    _sql = _sql.replace(/@work_grade@/ig, `'${sessionStorage.getItem('work_grade') || 0}'`)
  }
  if (_backCustomScript) {
    _sql += _backCustomScript
  }
@@ -2124,9 +2200,9 @@
  _sql = _sql.replace(/@typename@/ig, `'admin'`)
  if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
    _sql = _sql.replace(/@datam@/ig, '\'Y\'')
    _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`)
  } else {
    _sql = _sql.replace(/@datam@/ig, '\'\'')
    _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`)
  }
  if (window.GLOB.debugger === true) {
@@ -2135,20 +2211,6 @@
  }
  if (retmsg) {
    _callbacksql = _callbacksql.replace(/@ID@/ig, `'${primaryId || ''}'`)
    _callbacksql = _callbacksql.replace(/@BID@/ig, `'${BID}'`)
    _callbacksql = _callbacksql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    _callbacksql = _callbacksql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    _callbacksql = _callbacksql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _callbacksql = _callbacksql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _callbacksql = _callbacksql.replace(/@typename@/ig, `'admin'`)
    if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
      _callbacksql = _callbacksql.replace(/@datam@/ig, '\'Y\'')
    } else {
      _callbacksql = _callbacksql.replace(/@datam@/ig, '\'\'')
    }
    return {
      sql: _sql,
      callbacksql: _callbacksql
src/views/menudesign/index.jsx
@@ -36,6 +36,7 @@
const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
// const Debug = asyncComponent(() => import('@/menu/debug'))
const NormalCss = asyncComponent(() => import('@/menu/normalCss'))
const Versions = asyncComponent(() => import('@/menu/versions'))
const TableNodes = asyncComponent(() => import('@/menu/tablenodes'))
@@ -1108,7 +1109,7 @@
    return (
      <ConfigProvider locale={_locale}>
        <Header />
        <Header menuName={config ? config.MenuName : ''}/>
        <DndProvider backend={HTML5Backend}>
          {view !== 'popview' ? <div className={'pc-menu-view ' + (MenuType || '')}>
            <div className="menu-body">
@@ -1159,8 +1160,9 @@
                </Collapse>
              </div>
              <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}>
                <Card title={config ? config.MenuName : ''} bordered={false} extra={
                <Card bordered={false} extra={
                  <div className="mk-opeartion-list">
                    {/* <Debug config={config}/> */}
                    <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button>
                    <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>
                    <TableNodes config={config} />
src/views/menudesign/index.scss
@@ -189,8 +189,8 @@
            button {
              margin-left: 10px;
            }
            >div >div >button, .style-control-button {
              padding: 0px 7px;
            .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) {
              padding: 0px 10px;
            }
            .ant-switch.big {
              min-width: 60px;
src/views/mobdesign/index.scss
@@ -323,7 +323,7 @@
    }
  }
  .menu-control {
    .back-view, .mk-view-paste, .quote-wrap, .mk-sys-interface, .set-home, .set-login, .mk-replace-field {
    .quote-wrap, .set-home, .set-login {
      display: none!important;
    }
  }
src/views/tabledesign/index.jsx
@@ -34,6 +34,7 @@
const BgController = asyncComponent(() => import('@/pc/bgcontroller'))
const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
// const Debug = asyncComponent(() => import('@/menu/debug'))
const Versions = asyncComponent(() => import('@/menu/versions'))
const Transfer = asyncComponent(() => import('@/menu/transfer'))
const Unattended = asyncComponent(() => import('@/templates/zshare/unattended'))
@@ -822,7 +823,7 @@
    return (
      <ConfigProvider locale={_locale}>
        <Header />
        <Header menuName={config ? config.MenuName : ''}/>
        <DndProvider backend={HTML5Backend}>
        {view !== 'popview' ? <div className="pc-table-view">
            <div className="menu-body">
@@ -869,10 +870,9 @@
                </Collapse>
              </div>
              <div className={'menu-view' + (menuloading ? ' saving' : '')}>
                <Card title={
                  <div style={{paddingLeft: '15px'}}> {config && config.MenuName} </div>
                } bordered={false} extra={
                  <div>
                <Card bordered={false} extra={
                  <div className="mk-opeartion-list">
                    {/* {config ? <Debug config={config}/> : null} */}
                    {config ? <Transfer config={config}/> : null}
                    {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null}
                    <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>
src/views/tabledesign/index.scss
@@ -148,8 +148,8 @@
            button {
              margin-left: 15px;
            }
            >div >div >button, .style-control-button {
              padding: 0px 7px;
            .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) {
              padding: 0px 10px;
            }
            .ant-switch.big {
              min-width: 60px;