king
2021-01-26 68f84129b685aa9539ac38ca1cf1f164c4d58074
2021-01-26
8个文件已修改
493 ■■■■ 已修改文件
src/tabviews/commontable/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.jsx 308 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx
@@ -343,19 +343,13 @@
      let valid = true // 搜索条件必填验证, 初始搜索条件, 如通过上级透视,写入搜索条件
      let hasReqFields = false
      let initSearch = config.search.map(item => {
        let _item = fromJS(item).toJS()
        if (_item.required === 'true' && !_item.initval) {
      config.search.forEach(item => {
        if (item.required !== 'true') return
        if (!item.initval) {
          valid = false
        }
        if (_item.required === 'true') {
          hasReqFields = true
        }
        return _item
      })
      initSearch = Utils.initMainSearch(initSearch)
      this.setState({
        loadingview: false,
@@ -370,7 +364,7 @@
        columns: _columns,
        arr_field: _arrField.join(','),
        BID: param && param.BID ? param.BID : '',
        search: Utils.initMainSearch(initSearch), // 搜索条件初始化(含有时间格式,需要转化)
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        hasReqFields
      }, () => {
        if (config.setting.onload !== 'false' && valid) { // 初始化可加载
@@ -433,8 +427,12 @@
  }
  loadData = () => {
    const { setting, search, BIDs, loadCustomApi } = this.state
    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    const { setting, search, BIDs, loadCustomApi, hasReqFields } = this.state
    let requireFields = []
    if (hasReqFields) {
      requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    }
    this.setState({
      selectedData: [],
@@ -544,7 +542,7 @@
        let error = '未知的返回结果!'
        if (typeof(res) === 'string') {
          error = res
          error = res.replace(/'/ig, '"')
        }
        let _result = {
src/tabviews/subtable/index.jsx
@@ -70,21 +70,19 @@
   * @description 上级菜单id变化时,刷新数据
   */
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (this.state.config && this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) {
    const { config, setting } = this.state
    if (config && setting && this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) {
      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid) // 列表重置
      this.setState({
        pageIndex: 1
      }, () => {
        if (this.state.setting) {
          this.loadmaindata()
        }
        this.loadData()
      })
    } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      if (this.state.setting) {
    } else if (setting && !this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
        this.setState({}, () => {
          this.loadmaindata()
        this.loadData()
        })
      }
    }
  }
@@ -266,11 +264,10 @@
      let valid = true // 搜索条件必填验证
      let hasReqFields = false
      config.search.forEach(field => {
        if (field.required === 'true' && !field.initval) {
          valid = false
        }
        if (field.required === 'true') {
        if (field.required !== 'true') return
          hasReqFields = true
        if (!field.initval) {
          valid = false
        }
      })
@@ -327,7 +324,7 @@
        hasReqFields
      }, () => {
        if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode) && valid) { // 初始化可加载
          this.loadmaindata()
          this.loadData()
        }
      })
    } else {
@@ -347,17 +344,20 @@
  
  loadData = () => {
    const { mainSearch, BID } = this.props
    const { setting, search, loadCustomApi } = this.state
    const { setting, search, loadCustomApi, hasReqFields } = this.state
    let searches = fromJS(search).toJS()
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...searches]
    }
    let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
    let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
    let requireFields = []
    if (hasReqFields) {
      requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
    }
    if (requireFields.length > 0) {
      let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
      let labels = requireFields.map(item => item.label)
      labels = Array.from(new Set(labels))
@@ -374,6 +374,7 @@
        statFValue: [],
        total: 0
      })
      this.handleTableId()
      return
    } else if (window.GLOB.systemType === 'production' && setting.interType === 'custom' && !setting.proInterface) {
      notification.warning({
@@ -384,12 +385,17 @@
      return
    }
    this.setState({
      selectedData: []
    })
    this.handleTableId()
    if (setting.interType === 'custom' && loadCustomApi) {
      if (setting.execTime === 'once') {
        this.setState({loadCustomApi: false})
      }
      this.loadOutResource()
      this.loadOutResource(searches)
      if (setting.execType === 'async') {
        this.loadmaindata()
      }
@@ -398,10 +404,11 @@
    }
  }
  loadOutResource = () => {
    const { setting, search, BID } = this.state
  loadOutResource = (searches) => {
    const { BID } = this.props
    const { setting } = this.state
    let param = UtilsDM.getPrevQueryParams(setting, search, BID, this.props.menuType)
    let param = UtilsDM.getPrevQueryParams(setting, searches, BID, this.props.menuType)
    if (setting.execType === 'sync') {
      this.setState({
@@ -464,7 +471,7 @@
        let error = '未知的返回结果!'
        if (typeof(res) === 'string') {
          error = res
          error = res.replace(/'/ig, '"')
        }
        let _result = {
@@ -569,8 +576,8 @@
      
      param = UtilsDM.getCallBackQueryParams(setting, sql, errSql)
      if (this.state.BID) {
        param.BID = this.state.BID
      if (this.props.BID) {
        param.BID = this.props.BID
      }
      if (this.props.menuType === 'HS') { // 函数 sPC_TableData_InUpDe 云端验证
@@ -579,8 +586,8 @@
    } else {
      param.func = 's_ex_result_back'
      param.s_ex_result = [...lineMap.values()].map((item, index) => ({
        MenuID: this.state.config.MenuID,
        MenuName: this.state.config.MenuName,
        MenuID: this.props.MenuID,
        MenuName: this.props.Tab.label,
        TableName: item.table,
        LongText: window.btoa(window.encodeURIComponent(`${item.insert}  ${item.selects.join(` union all `)}`)),
        Sort: index + 1
@@ -629,39 +636,12 @@
      searches = [...mainSearch, ...searches]
    }
    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
    if (requireFields.length > 0) {
      let labels = requireFields.map(item => item.label)
      labels = Array.from(new Set(labels))
      notification.warning({
        top: 92,
        message: prex + this.state.dict['form.required.input'] + labels.join('、') + ' !',
        duration: 3
      })
      return
    }
    if (this.props.Tab.supMenu && !BID) { // 主表ID不存在时,不查询子表
      this.setState({
        data: [],
        selectedData: [],
        statFValue: [],
        total: 0
      })
      return
    }
    this.setState({
      loading: true
    })
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
    this.handleTableId()
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.Tab.label || ''
@@ -836,7 +816,7 @@
      pageIndex: 1,
      search: searches,
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
@@ -857,7 +837,7 @@
      pageSize: pagination.pageSize,
      orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
@@ -870,11 +850,11 @@
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadmaindata()
        this.loadData()
      })
    } else {
      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid, 'false') // 列表重置
      this.loadmaindata()
      this.loadData()
    }
  }
src/tabviews/subtabtable/index.jsx
@@ -8,6 +8,7 @@
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import UtilsUpdate from '@/utils/utils-update.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -57,6 +58,8 @@
    statFields: [],       // 合计字段
    statFValue: [],       // 合计值
    absFields: [],        // 绝对值字段
    loadCustomApi: true,  // 加载外部资源
    hasReqFields: false
  }
  /**
@@ -233,8 +236,11 @@
      }
      let valid = true // 搜索条件必填验证
      let hasReqFields = false
      config.search.forEach(field => {
        if (field.required === 'true' && !field.initval) {
        if (field.required !== 'true') return
        hasReqFields = true
        if (!field.initval) {
          valid = false
        }
      })
@@ -288,10 +294,11 @@
        actions: _actions,
        columns: _columns,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化)
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        hasReqFields
      }, () => {
        if (config.setting.onload !== 'false' && valid) { // 初始化可加载
          this.loadmaindata()
          this.loadData()
        }
      })
    } else {
@@ -307,6 +314,278 @@
    }
  }
  loadData = () => {
    const { mainSearch } = this.props
    const { setting, search, hasReqFields, loadCustomApi } = this.state
    let searches = fromJS(search).toJS()
    if (mainSearch && mainSearch.length > 0) { // 主表搜索条件
      searches = [...mainSearch, ...searches]
    }
    let requireFields = []
    if (hasReqFields) {
      requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
    }
    if (requireFields.length > 0) {
      let labels = requireFields.map(item => item.label)
      labels = Array.from(new Set(labels))
      notification.warning({
        top: 92,
        message: this.state.dict['form.required.input'] + labels.join('、') + ' !',
        duration: 3
      })
      return
    } else if (window.GLOB.systemType === 'production' && setting.interType === 'custom' && !setting.proInterface) {
      notification.warning({
        top: 92,
        message: '未设置正式系统地址!',
        duration: 3
      })
      return
    }
    this.setState({
      selectedData: []
    })
    if (setting.interType === 'custom' && loadCustomApi) {
      if (setting.execTime === 'once') {
        this.setState({loadCustomApi: false})
      }
      this.loadOutResource(searches)
      if (setting.execType === 'async') {
        this.loadmaindata()
      }
    } else {
      this.loadmaindata()
    }
  }
  loadOutResource = (searches) => {
    const { setting } = this.state
    let param = UtilsDM.getPrevQueryParams(setting, searches, this.props.BID, this.props.menuType)
    if (setting.execType === 'sync') {
      this.setState({
        loading: true
      })
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
        if (res.mk_ex_invoke === 'false') {
          this.loadmaindata()
        } else {
          this.customOuterRequest(res)
        }
      } else {
        this.setState({
          loading: false
        })
        notification.error({
          top: 92,
          message: res.message,
          duration: 10
        })
      }
    }, () => {
      this.setState({
        loading: false
      })
    })
  }
  customOuterRequest = (result) => {
    const { setting } = this.state
    let url = ''
    if (window.GLOB.systemType === 'production') {
      url = setting.proInterface
    } else {
      url = setting.interface
    }
    let mkey = result.mk_api_key || ''
    delete result.mk_ex_invoke
    delete result.status
    delete result.message
    delete result.ErrCode
    delete result.ErrMesg
    delete result.mk_api_key
    let param = {}
    Object.keys(result).forEach(key => {
      key = key.replace(/^mk_/ig, '')
      param[key] = result[key]
    })
    Api.directRequest(url, setting.method, param).then(res => {
      if (typeof(res) !== 'object' || Array.isArray(res)) {
        let error = '未知的返回结果!'
        if (typeof(res) === 'string') {
          error = res.replace(/'/ig, '"')
        }
        let _result = {
          mk_api_key: mkey,
          $ErrCode: 'E',
          $ErrMesg: error
        }
        this.customCallbackRequest(_result)
      } else {
        res.mk_api_key = mkey
        this.customCallbackRequest(res)
      }
    }, () => {
      this.setState({
        loading: false
      })
    })
  }
  customCallbackRequest = (result) => {
    const { setting } = this.state
    let lines = []
    let pre = setting.callbackType === 'script' ? '@' : ''
    let errSql = ''
    if (result.$ErrCode === 'E') {
      errSql = `
        set @ErrorCode='E'
        set @retmsg='${result.$ErrMesg}'
      `
      delete result.$ErrCode
      delete result.$ErrMesg
    }
    let getDefaultSql = (obj, tb, bid, level) => {
      let keys = []
      let vals = []
      let subObjs = []
      let id = Utils.getuuid()
      delete obj.$$key
      Object.keys(obj).forEach(key => {
        let val = obj[key]
        if (typeof(val) === 'object') {
          if (Array.isArray(val)) {
            val.forEach(item => {
              if (typeof(item) !== 'object' || Array.isArray(item)) return
              if (Object.keys(item).length > 0) {
                item.$$key = tb + '_' + key
                subObjs.push(item)
              }
            })
          } else if (Object.keys(val).length > 0) {
            val.$$key = tb + '_' + key
            subObjs.push(val)
          }
        } else if (val !== null && val !== undefined) {
          keys.push(key)
          vals.push(`'${val}'`)
        }
      })
      lines.push({
        table: tb,
        insert: `Insert into ${pre}${tb} (${keys.join(',')},mk_level,mk_id,mk_bid)`,
        select: `Select ${vals.join(',')},'${level}','${id}','${bid}'`
      })
      subObjs.forEach(item => {
        getDefaultSql(item, item.$$key, id, level + 1)
      })
    }
    getDefaultSql(result, setting.cbTable, '', 1)
    let lineMap = new Map()
    lines.forEach(line => {
      if (lineMap.has(line.table)) {
        let _line = lineMap.get(line.table)
        _line.selects.push(line.select)
        lineMap.set(line.table, _line)
      } else {
        lineMap.set(line.table, {
          table: line.table,
          insert: line.insert,
          selects: [line.select]
        })
      }
    })
    let param = {}
    if (setting.callbackType === 'script') { // 使用自定义脚本
      let sql = [...lineMap.values()].map(item => (`
        ${item.insert}
        ${item.selects.join(` union all
        `)}
      `))
      sql = sql.join('')
      param = UtilsDM.getCallBackQueryParams(setting, sql, errSql)
      if (this.state.BID) {
        param.BID = this.state.BID
      }
      if (this.props.menuType === 'HS') { // 函数 sPC_TableData_InUpDe 云端验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
    } else {
      let name = this.props.Tab ? (this.props.Tab.label || '') : ''
      param.func = 's_ex_result_back'
      param.s_ex_result = [...lineMap.values()].map((item, index) => ({
        MenuID: this.props.MenuID,
        MenuName: name,
        TableName: item.table,
        LongText: window.btoa(window.encodeURIComponent(`${item.insert}  ${item.selects.join(` union all `)}`)),
        Sort: index + 1
      }))
      if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
        let sql = [...lineMap.values()].map(item => (`
          ${item.insert}
          ${item.selects.join(` union all
          `)}
        `))
        sql = sql.join('')
        console.info(sql.replace(/\n\s{10}/ig, '\n'))
      }
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
        this.loadmaindata()
      } else {
        this.setState({
          loading: false
        })
        notification.error({
          top: 92,
          message: res.message,
          duration: 10
        })
      }
    }, () => {
      this.setState({
        loading: false
      })
    })
  }
  /**
   * @description 子表数据加载
   */
@@ -319,22 +598,7 @@
      searches = [...mainSearch, ...searches]
    }
    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    if (requireFields.length > 0) {
      let labels = requireFields.map(item => item.label)
      labels = Array.from(new Set(labels))
      notification.warning({
        top: 92,
        message: this.state.dict['form.required.input'] + labels.join('、') + ' !',
        duration: 3
      })
      return
    }
    this.setState({
      selectedData: [],
      loading: true
    })
@@ -440,7 +704,7 @@
      pageIndex: 1,
      search: searches
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
@@ -461,7 +725,7 @@
      pageSize: pagination.pageSize,
      orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
    }, () => {
      this.loadmaindata()
      this.loadData()
    })
  }
@@ -474,11 +738,11 @@
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadmaindata()
        this.loadData()
      })
    } else {
      MKEmitter.emit('resetTable', this.props.MenuID + this.props.Tab.uuid, 'false') // 列表重置
      this.loadmaindata()
      this.loadData()
    }
    
  }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -853,6 +853,9 @@
        }
      })
      _backCustomScript += `
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
      let sql = [...lineMap.values()].map(item => (`
        ${item.insert}
        ${item.selects.join(` union all
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -171,7 +171,7 @@
        message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!',
        duration: 5
      })
      return
      return Promise.reject()
    }
    if (trigger) {
src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography, Modal } from 'antd'
import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography, Modal, Radio } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
@@ -34,7 +34,7 @@
      {
        title: 'SQL',
        dataIndex: 'sql',
        width: '73%',
        width: '60%',
        render: (text) => {
          let title = text.match(/^\s*\/\*.+\*\//)
          title = title && title[0] ? title[0] : ''
@@ -46,6 +46,18 @@
              <Paragraph copyable ellipsis={{ rows: 4, expandable: true }}>{text}</Paragraph>
            </div>
          )
        }
      },
      {
        title: '执行位置',
        dataIndex: 'position',
        width: '13%',
        render: (text, record) => {
          if (record.position === 'front') {
            return 'sql前'
          } else {
            return 'sql后'
          }
        }
      },
      {
@@ -91,6 +103,7 @@
    const { searches, scripts } = this.props
    let _usefulFields = []
    let scriptsColumns = fromJS(this.state.scriptsColumns).toJS()
    if (searches) {
      searches.forEach(item => {
@@ -111,13 +124,20 @@
        }
      })
      _usefulFields = _usefulFields.join(', ')
      scriptsColumns = scriptsColumns.filter(item => {
        if (item.dataIndex === 'sql') {
          item.width = '70%'
        }
        return item.dataIndex !== 'position'
      })
    } else {
      _usefulFields = null
    }
    this.setState({
      usefulFields: _usefulFields,
      scripts: fromJS(scripts).toJS()
      scripts: fromJS(scripts).toJS(),
      scriptsColumns
    })
  }
@@ -196,7 +216,11 @@
    let values = {
      uuid: editItem && editItem.uuid ? editItem.uuid : Utils.getuuid(),
      sql: _sql
      sql: _sql,
    }
    if (this.props.form.getFieldValue('position')) {
      values.position = this.props.form.getFieldValue('position')
    }
    let _quot = values.sql.match(/'{1}/g)
@@ -307,13 +331,21 @@
  }
  handleEdit = (record) => {
    const { usefulFields } = this.state
    this.setState({
      editItem: record
    })
    if (usefulFields) {
    this.props.form.setFieldsValue({
      sql: record.sql
    })
    } else {
      this.props.form.setFieldsValue({
        sql: record.sql,
        position: record.position || 'back'
      })
    }
    this.scrolltop()
  }
@@ -398,6 +430,18 @@
                id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id{usefulFields ? ', ' + usefulFields : ''}
              </Form.Item>
            </Col> : null}
            {!usefulFields ? <Col span={8} style={{whiteSpace: 'nowrap'}}>
              <Form.Item style={{marginBottom: 0}} label="执行位置">
                {getFieldDecorator('position', {
                  initialValue: 'front'
                })(
                  <Radio.Group>
                    <Radio value="front">sql前</Radio>
                    <Radio value="back">sql后</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            <Col span={10} className="quick-add">
              <Form.Item label={'快捷添加'} style={{marginBottom: 0}}>
                <Select
@@ -406,7 +450,7 @@
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  onChange={this.selectScript}
                >
                  {!usefulFields ? <Select.Option key="default" value={`declare @${setting.cbTable} table (mk_api_key nvarchar(100))`}>默认sql</Select.Option> : null}
                  {!usefulFields ? <Select.Option key="default" value={`declare @${setting.cbTable} table (mk_api_key nvarchar(100))\n/*@${setting.cbTable}_data table (mk_level nvarchar(10),mk_id nvarchar(50),mk_bid nvarchar(50))*/`}>默认sql</Select.Option> : null}
                  {systemScripts.map((option, i) =>
                    <Select.Option style={{whiteSpace: 'normal'}} key={i} value={option.value}>{option.name}</Select.Option>
                  )}
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -236,7 +236,7 @@
                onChange={this.selectScript}
                getPopupContainer={() => document.getElementById('verify-custom-callback-scripts')}
              >
                <Select.Option key="default" value={`declare @${btn.cbTable} table (mk_api_key nvarchar(100))`}>默认sql</Select.Option>
                <Select.Option key="default" value={`declare @${btn.cbTable} table (mk_api_key nvarchar(100))\n/*@${btn.cbTable}_data table (mk_level nvarchar(10),mk_id nvarchar(50),mk_bid nvarchar(50))*/`}>默认sql</Select.Option>
                {systemScripts.map((option, i) =>
                  <Select.Option key={i} value={option.value}>{option.name}</Select.Option>
                )}
src/utils/utils-datamanage.js
@@ -409,7 +409,7 @@
      // 测试系统打印查询语句
      if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
        console.info(sql)
        console.info(sql.replace(/\n\s{8}/ig, '\n'))
      }
    }
@@ -445,7 +445,8 @@
      Select @ErrorCode='',@retmsg=''
      ${errSql}
    `
    let _backCustomScript = ''
    let _backCustomScript = `
    `
    setting.cbScripts.forEach(script => {
      if (script.status === 'false') return
@@ -463,6 +464,9 @@
      }
    })
    _backCustomScript += `
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    sql = _prevCustomScript + sql
    sql = sql + _backCustomScript