king
2023-08-27 5e1d4d5155c57c43739d61914e2d29a64f9bb683
Merge branch 'develop'
86个文件已修改
1个文件已添加
3536 ■■■■ 已修改文件
package-lock.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/calendar/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/dragaction/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/double-data-card/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/carousel/data-card/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/chart-custom/chartcompile/formconfig.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/code/sandbox/options.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/timeline/normal-timeline/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tree/antd-tree/options.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/calendar/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/balcony/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/table-card/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/data-card/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/prop-card/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-G6/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-dashboard/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-pie/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-scatter/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/custom-chart/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/code/sand-box/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/tabtransfer/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/base-table/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/timeline/normal-timeline/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tree/antd-tree/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/index.jsx 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tablecomponent/index.jsx 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createfunc/index.jsx 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createfunc/utils.js 454 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 819 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemfunc/index.jsx 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemproc/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemproc/proc/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -5490,9 +5490,9 @@
      }
    },
    "caniuse-lite": {
      "version": "1.0.30001464",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001464.tgz",
      "integrity": "sha512-oww27MtUmusatpRpCGSOneQk2/l5czXANDSFvsc7VuOQ86s3ANhZetpwXNf1zY/zdfP63Xvjz325DAdAoES13g=="
      "version": "1.0.30001523",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001523.tgz",
      "integrity": "sha512-I5q5cisATTPZ1mc588Z//pj/Ox80ERYDfR71YnvY7raS/NOk8xXlZcB0sF7JdqaV//kOaa6aus7lRfpdnt1eBA=="
    },
    "canvg": {
      "version": "3.0.10",
src/api/index.js
@@ -7,6 +7,7 @@
import moment from 'moment'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import CacheUtils from './cacheutils'
window.GLOB.IndexDB = null
@@ -329,21 +330,21 @@
    CacheUtils.delIndexDBCacheConfig(date, type)
  }
  writeCacheConfig (menuid, data) {
  writeCacheConfig (menuid, data, BID = '', id = '') {
    if (!menuid) return
    let date = moment().format('YYYY-MM-DD HH:mm:ss')
    let _data = data ? JSON.stringify(data) : ''
    let userid = sessionStorage.getItem('UserID') || ''
    CacheUtils.writeCacheInIndexDB({menuid: md5(menuid + userid), CreateDate: date, LongParam: _data})
    CacheUtils.writeCacheInIndexDB({menuid: md5(menuid + userid + BID + id), BID: BID, id: id, CreateDate: date, LongParam: _data})
  }
  getLCacheConfig (menuid, minutes) {
  getLCacheConfig (menuid, minutes, BID = '', id = '') {
    return new Promise((resolve, reject) => {
      let limit = minutes ? moment().subtract(minutes, 'minutes').format('YYYY-MM-DD HH:mm:ss') : ''
      let userid = sessionStorage.getItem('UserID') || ''
      CacheUtils.getIndexDBCacheConfig(md5(menuid + userid)).then(res => {
      CacheUtils.getIndexDBCacheConfig(md5(menuid + userid + BID + id)).then(res => {
        if (res && res.LongParam) {
          resolve({data: JSON.parse(res.LongParam), valid: !limit || res.CreateDate > limit})
        } else {
@@ -369,6 +370,11 @@
        let param = {
          func: 's_get_app_version',
          modifydate: msg.createDate
        }
        if (window.GLOB.initVersion && sessionStorage.getItem('visitorUserID')) {
          param.userid = sessionStorage.getItem('visitorUserID')
          param.LoginUID = sessionStorage.getItem('visitorLoginUID')
        }
        param.TypeCharOne = ''
@@ -413,6 +419,7 @@
            let clear = false
            let _appkey = window.GLOB.appkey.substr(-10)
            let reg = new RegExp(_appkey + '$', 'i')
            let reHome = list.includes('home_page_id')
            list.forEach(mid => {
              if (reg.test(mid)) {
@@ -424,6 +431,10 @@
            }
            CacheUtils.delIndexDBConfig(list)
            this.delCacheConfig('all')
            if (reHome) {
              MKEmitter.emit('reloadMenuView', 'home_page_id')
            }
          }
          CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime})
src/menu/components/calendar/options.jsx
@@ -110,7 +110,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/card/balcony/options.jsx
@@ -210,7 +210,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/card/cardcellcomponent/dragaction/index.scss
@@ -214,6 +214,7 @@
    background-repeat: no-repeat;
    background-size: cover;
    position: unset!important;
    vertical-align: top;
  }
  .sort-wrap {
    position: relative;
src/menu/components/card/cardcellcomponent/index.jsx
@@ -7,7 +7,6 @@
import asyncComponent from '@/utils/asyncComponent'
import { getCardCellForm } from './formconfig'
import { getActionForm, getBaseTableActionForm } from '@/menu/components/share/actioncomponent/formconfig'
import Utils, { FuncUtils } from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/utils/utils-custom.js'
import ElementForm from './elementform'
@@ -660,47 +659,47 @@
   * @description 创建按钮存储过程
   */
  creatFunc = () => {
    const { cards } = this.props
    const menu = window.GLOB.customMenu
    let _config = fromJS(this.props.cards).toJS()
    this.actionFormRef.handleConfirm().then(res => {
      let btn = res         // 按钮信息
      let newLText = ''     // 创建存储过程sql
      let DelText = ''      // 删除存储过程sql
    return new Promise((resolve) => {
      this.actionFormRef.handleConfirm().then(res => {
        let btn = fromJS(res).toJS()
        let _config = fromJS(cards).toJS()
      if (btn.intertype !== 'inner') return
        if (btn.OpenType === 'excelIn') {
          btn.func = btn.innerFunc
          btn.menuNo = menu.MenuNo
          btn.MenuName = menu.MenuName + _config.name
          btn.$type = 'excelIn'
      if (btn.OpenType === 'pop') {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: btn.modal ? btn.modal.fields : [],
          menuNo: menu.MenuNo
          resolve(btn)
        } else if (btn.OpenType === 'excelOut') {
          _config.MenuName = menu.MenuName + '-' + _config.name
          _config.menuNo = menu.MenuNo
          _config.MenuID = menu.MenuID
          _config.func = btn.innerFunc
          _config.$type = 'table'
          resolve(_config)
        } else {
          btn.func = btn.innerFunc
          btn.name = _config.setting.tableName || ''
          btn.menuNo = menu.MenuNo
          btn.MenuID = menu.MenuID
          btn.MenuName = menu.MenuName + _config.name
          btn.fields = []
          btn.columns = _config.columns
          btn.primaryKey = _config.setting.primaryKey || 'ID'
          btn.$type = 'btn'
          if (btn.OpenType === 'pop') {
            btn.fields = btn.modal ? btn.modal.fields : []
          }
          resolve(btn)
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelIn') {
        let _param = {
          funcName: btn.innerFunc,
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelOut') {
        newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: '',
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      }
      this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText)
      })
    })
  }
@@ -787,7 +786,7 @@
            maskClosable={false}
            onCancel={this.editModalCancel}
            footer={[
              record && record.intertype === 'inner' && cards.subtype === 'dualdatacard' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
              record && record.intertype === 'inner' && cards.subtype === 'dualdatacard' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null,
              <Button key="cancel" onClick={this.editModalCancel}>取消</Button>,
              <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>确定</Button>
            ]}
src/menu/components/card/data-card/options.jsx
@@ -549,7 +549,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/card/double-data-card/options.jsx
@@ -236,7 +236,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/carousel/data-card/options.jsx
@@ -209,7 +209,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx
@@ -90,6 +90,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -90,6 +90,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      key: 'cacheLocal',
      label: '本地缓存',
      initVal: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'false', text: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
@@ -64,6 +64,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      key: 'cacheLocal',
      label: '本地缓存',
      initVal: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'false', text: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -122,6 +122,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      key: 'cacheLocal',
      label: '本地缓存',
      initVal: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'false', text: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx
@@ -64,6 +64,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      key: 'cacheLocal',
      label: '本地缓存',
      initVal: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'false', text: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
src/menu/components/chart/chart-custom/chartcompile/formconfig.jsx
@@ -75,6 +75,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      key: 'cacheLocal',
      label: '本地缓存',
      initVal: card.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', text: '继承菜单'},
        {value: 'false', text: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
src/menu/components/code/sandbox/options.jsx
@@ -74,6 +74,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -214,7 +214,7 @@
          shows.push('exInterface', 'exProInterface')
        }
      } else if (intertype === 'inner') {
        shows.push('innerFunc', 'output')
        shows.push('innerFunc', 'output', 'recordUser')
        if (Ot === 'requiredOnce') { // 前置函数
          shows.push('preFunc')
        }
@@ -295,7 +295,7 @@
          shows.push('exInterface', 'exProInterface')
        }
      } else if (intertype === 'inner') {
        shows.push('innerFunc')
        shows.push('innerFunc', 'recordUser')
        reRequired.innerFunc = true
      } else {
        shows.push('sql', 'sqlType')
@@ -346,7 +346,7 @@
          shows.push('exInterface', 'exProInterface')
        }
      } else if (this.record.intertype === 'inner') {
        shows.push('innerFunc')
        shows.push('innerFunc', 'recordUser')
        reRequired.innerFunc = true
      }
      if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
@@ -381,7 +381,7 @@
          shows.push('exInterface', 'exProInterface')
        }
      } else if (this.record.intertype === 'inner') {
        shows.push('innerFunc')
        shows.push('innerFunc', 'recordUser')
        reRequired.innerFunc = true
      }
      if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
@@ -459,7 +459,7 @@
            shows.push('exInterface', 'exProInterface')
          }
        } else if (this.record.intertype === 'inner') {
          shows.push('innerFunc')
          shows.push('innerFunc', 'recordUser')
          reRequired.innerFunc = true
        }
        if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') {
@@ -980,11 +980,12 @@
          values.$fixed = card.$fixed || false
          if (card.OpenType === 'excelOut' && values.OpenType === 'excelIn') {
            if (values.verify && values.verify.columns && values.verify.columns.length > 0) {
              values.verify.columns = values.verify.columns.map(col => {
            values.verify = {columns: [], scripts: [], sheet: 'Sheet1', default: 'true', range: 1, uniques: []}
            if (card.verify && card.verify.columns) {
              values.verify.columns = card.verify.columns.map(col => {
                col.required = col.required || 'true'
                col.type = col.type || 'Nvarchar(50)'
                col.import = col.import || 'true'
                col.import = 'true'
          
                if (col.type === 'text' || col.type === 'image') {
                  col.type = 'Nvarchar(50)'
@@ -1007,15 +1008,12 @@
                return col
              })
              values.verify.sheet = values.verify.sheet || 'Sheet1'
            }
            if (values.verify) {
              values.verify.scripts = []
              values.verify.sheet = card.verify.sheet || 'Sheet1'
            }
          } else if (card.OpenType === 'excelIn' && values.OpenType === 'excelOut') {
            if (values.verify && values.verify.columns && values.verify.columns.length > 0) {
              values.verify.columns = values.verify.columns.map(col => {
            values.verify = {columns: [], scripts: [], dataType: 'default'}
            if (card.verify && card.verify.columns) {
              values.verify.columns = card.verify.columns.map(col => {
                col.type = col.type || 'text'
                col.output = col.output || 'true'
                col.required = col.required || 'false'
@@ -1033,10 +1031,6 @@
          
                return col
              })
            }
            if (values.verify) {
              values.verify.scripts = []
            }
          }
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1061,6 +1061,21 @@
    },
    {
      type: 'radio',
      key: 'recordUser',
      label: '记录用户',
      initVal: card.recordUser || 'false',
      tooltip: '当选择“是”时,内部函数的传参会增加 username 与 fullname。',
      required: false,
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'radio',
      key: 'control',
      label: '按钮控制',
      initVal: card.control || (card.controlField ? 'disabled' : ''),
@@ -2007,6 +2022,21 @@
    },
    {
      type: 'radio',
      key: 'recordUser',
      label: '记录用户',
      initVal: card.recordUser || 'false',
      tooltip: '当选择“是”时,内部函数的传参会增加 username 与 fullname。',
      required: false,
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'radio',
      key: 'control',
      label: '按钮控制',
      initVal: card.control || (card.controlField ? 'disabled' : ''),
src/menu/components/share/actioncomponent/index.jsx
@@ -4,7 +4,7 @@
import { Modal, notification, Button } from 'antd'
import moment from 'moment'
import Utils, { FuncUtils } from '@/utils/utils.js'
import Utils from '@/utils/utils.js'
import { getActionForm, getBaseTableActionForm } from './formconfig'
import asyncSpinComponent from '@/utils/asyncSpinComponent'
import MKEmitter from '@/utils/events.js'
@@ -526,55 +526,47 @@
   * @description 创建按钮存储过程
   */
  creatFunc = () => {
    const { config } = this.props
    const menu = window.GLOB.customMenu
    let _config = fromJS(this.props.config).toJS()
    this.actionFormRef.handleConfirm().then(res => {
      let btn = res         // 按钮信息
      let newLText = ''     // 创建存储过程sql
      let DelText = ''      // 删除存储过程sql
    return new Promise((resolve) => {
      this.actionFormRef.handleConfirm().then(res => {
        let btn = fromJS(res).toJS()
        let _config = fromJS(config).toJS()
      // 创建存储过程,必须填写内部函数名
      if (btn.intertype !== 'inner') {
        notification.warning({
          top: 92,
          message: '使用内部函数时,才可以创建存储过程!',
          duration: 5
        })
        return
      }
        if (btn.OpenType === 'excelIn') {
          btn.func = btn.innerFunc
          btn.menuNo = menu.MenuNo
          btn.MenuName = menu.MenuName + _config.name
          btn.$type = 'excelIn'
      if (btn.OpenType === 'pop') {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: btn.modal ? btn.modal.fields : [],
          menuNo: menu.MenuNo
          resolve(btn)
        } else if (btn.OpenType === 'excelOut') {
          _config.MenuName = menu.MenuName + '-' + _config.name
          _config.menuNo = menu.MenuNo
          _config.MenuID = menu.MenuID
          _config.func = btn.innerFunc
          _config.$type = 'table'
          resolve(_config)
        } else {
          btn.func = btn.innerFunc
          btn.name = _config.setting.tableName || ''
          btn.menuNo = menu.MenuNo
          btn.MenuID = menu.MenuID
          btn.MenuName = menu.MenuName + _config.name
          btn.fields = []
          btn.columns = _config.columns
          btn.primaryKey = _config.setting.primaryKey || 'ID'
          btn.$type = 'btn'
          if (btn.OpenType === 'pop') {
            btn.fields = btn.modal ? btn.modal.fields : []
          }
          resolve(btn)
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelIn') {
        let _param = {
          funcName: btn.innerFunc,
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelOut') {
        newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: '',
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      }
      this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText)
      })
    })
  }
@@ -710,7 +702,7 @@
          maskClosable={false}
          onCancel={this.editModalCancel}
          footer={[
            record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
            record && record.intertype === 'inner' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null,
            <Button key="cancel" onClick={this.editModalCancel}>取消</Button>,
            <Button key="confirm" type="primary" onClick={this.handleSubmit}>确定</Button>
          ]}
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -271,7 +271,7 @@
      key: 'dataSource',
      label: '数据源',
      initVal: card.dataSource || '',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值@BID@。',
      required: true,
    },
    {
src/menu/components/table/edit-table/columns/index.jsx
@@ -722,7 +722,7 @@
        <Modal
          wrapClassName="mk-pop-modal"
          visible={visible}
          width={'80vw'}
          width={'90vw'}
          maskClosable={false}
          onOk={this.verifySubmit}
          onCancel={() => { this.setState({ visible: false }) }}
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -36,7 +36,8 @@
    fields.push('jskey')
    let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.field + ' ' + item.type).join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50))
    let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
    let _sql = `create table #${sheet} (${usefulfields.map(item => item.field + ' ' + item.type).join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50))
      Declare @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),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512)
      Select @ErrorCode='', @retmsg=''
    `
@@ -67,7 +68,7 @@
  }
  handleConfirm = () => {
    const { type } = this.props
    const { type, btn } = this.props
    const { editItem, skip } = this.state
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
@@ -144,8 +145,10 @@
          return
        }
        let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
        let tail = `
          aaa:
          drop table #${sheet}
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg
        `
        let _initCustomScript = '' // 初始化脚本
@@ -272,7 +275,7 @@
      database = database ? (database[0] || '') : ''
      _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From @${sheet}`
      _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}`
    } else {
      _value = value
    }
@@ -317,17 +320,17 @@
      <Form {...formItemLayout} className="verify-form" id="verify-excelin-custom-scripts">
        <Row gutter={24}>
          {!type && btn.sheet ? <Col span={8}>
            <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.sheet}
            <Form.Item label="表名" style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.sheet}(表变量请使用#{btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')})
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={10}>
            <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}>
            <Form.Item label="报错字段" style={{margin: 0, whiteSpace: 'nowrap'}}>
              ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
            <Form.Item label="可用字段">
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
              {usefulfields},data_type(注:jskey为主键值,新增时前端生成;data_type为操作类型,新增 - add、修改 - upt、删除 - del)
@@ -335,7 +338,7 @@
          </Col> : null}
          {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}>
            <Form.Item style={{marginBottom: 0}} label={
              <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}>
              <Tooltip placement="bottomLeft" title="自定义脚本与默认sql位置关系。">
                <QuestionCircleOutlined className="mk-form-tip" />
                执行位置
              </Tooltip>
@@ -352,7 +355,7 @@
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={8}>
            <Form.Item style={{marginBottom: 0}} label={'快捷添加'}>
            <Form.Item style={{marginBottom: 0}} label="快捷添加">
              <Select
                showSearch
                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
@@ -386,7 +389,7 @@
            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
          </Col>
          <Col span={24} className="sql">
            <Form.Item label={'sql'}>
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
                initialValue: '',
                rules: [
src/menu/components/table/edit-table/columns/tableIn/index.jsx
@@ -535,8 +535,16 @@
                    <Input value={verify.innerFunc} placeholder="" autoComplete="off" onChange={(e) => this.onOptionChange(e.target.value, 'innerFunc')}/>
                  </Form.Item>
                </Col> : null}
                {verify.intertype === 'inner' ? <Col span={8}>
                  <Form.Item required label="记录用户">
                    <Radio.Group value={verify.recordUser || 'false'} onChange={(e) => this.onOptionChange(e.target.value, 'recordUser')}>
                      <Radio value="false">否</Radio>
                      <Radio value="true">是</Radio>
                    </Radio.Group>
                  </Form.Item>
                </Col> : null}
                {verify.intertype === 'system' ? <Col span={8}>
                  <Form.Item required label={'默认sql'}>
                  <Form.Item required label="默认sql">
                    <Radio.Group value={verify.default} onChange={(e) => this.onOptionChange(e.target.value, 'default')}>
                      <Radio value="true">执行</Radio>
                      <Radio value="false">不执行</Radio>
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -224,22 +224,6 @@
      }]
    },
    {
      type: 'radio',
      key: 'sum',
      label: '显示合计',
      initVal: card.sum || 'false',
      tooltip: '合计信息只在使用系统数据源时有效。',
      required: false,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }],
      forbid: card.isSub || card.sum !== 'true'
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
src/menu/components/table/normal-table/columns/index.jsx
@@ -563,7 +563,6 @@
      } else {
        cell.type = 'number'
        cell.format = 'none'
        cell.sum = 'false'
        cell.decimal = item.decimal || 0
        cell.Width = 80
      }
src/menu/components/table/normal-table/options.jsx
@@ -272,7 +272,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/timeline/normal-timeline/options.jsx
@@ -168,7 +168,19 @@
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
src/menu/components/tree/antd-tree/options.jsx
@@ -134,6 +134,18 @@
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/datasource/index.jsx
@@ -1,10 +1,11 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal } from 'antd'
import { Modal, Button } from 'antd'
import { SettingOutlined } from '@ant-design/icons'
import VerifyCard from './verifycard'
import CreateFunc from '@/templates/zshare/createfunc'
import './index.scss'
class DataSource extends Component {
@@ -19,7 +20,8 @@
    mainSearch: [],
    visible: false,
    loading: false,
    setting: null
    setting: null,
    record: {}
  }
  UNSAFE_componentWillMount () {
@@ -100,44 +102,42 @@
        })
      }
    } else {
      let _search = null
      let filterComponent = (box) => {
      let filterComponent = (box, mainSearch) => {
        box.components.forEach(item => {
          if (_search) return
          if (item.type === 'search') {
            box.slist = [...box.slist, item.search]
          } else if (item.uuid === config.uuid) {
            _search = box.slist.pop()
          if (item.type !== 'search') return
          mainSearch = item.search
        })
        let has = false
        box.components.forEach(item => {
          if (item.uuid === config.uuid) {
            has = true
          } else if (item.type === 'group') {
            item.components.forEach(m => {
              if (m.uuid !== config.uuid) return
              _search = box.slist.pop()
            })
          } else if (item.type === 'tabs') {
            item.subtabs.forEach(tab => {
              tab.slist = [...box.slist]
              filterComponent(tab)
              has = true
            })
          }
        })
      }
      menu.slist = []
      filterComponent(menu)
      if (_search) {
        search = _search
      } else {
        menu.components.forEach(item => {
          if (item.type !== 'search') return
          search = item.search
        })
        if (has) {
          search = mainSearch || []
        } else {
          box.components.forEach(item => {
            if (item.type !== 'tabs') return
            item.subtabs.forEach(tab => {
              filterComponent(tab, mainSearch)
            })
          })
        }
      }
      filterComponent(menu, null)
    }
    this.setState({
      visible: true,
      mainSearch: search
      mainSearch: search,
      record: {...config.setting}
    })
  }
@@ -227,9 +227,34 @@
    })
  }
  creatFunc = () => {
    const { config } = this.props
    const { mainSearch } = this.state
    const menu = window.GLOB.customMenu
    return new Promise((resolve) => {
      this.verifyRef.submitDataSource().then(res => {
        let _config = fromJS(config).toJS()
        _config.MenuName = menu.MenuName + '-' + _config.name
        _config.menuNo = menu.MenuNo
        _config.MenuID = menu.MenuID
        _config.setting = res.setting
        _config.columns = res.columns
        _config.func = res.setting.innerFunc
        _config.$type = 'table'
        if (res.setting.useMSearch === 'true') { // 使用主搜索条件
          _config.search = [..._config.search, ...mainSearch]
        }
        resolve(_config)
      })
    })
  }
  render () {
    const { config } = this.props
    const { visible, loading, mainSearch } = this.state
    const { visible, loading, mainSearch, record } = this.state
    return (
      <div className="model-datasource">
@@ -241,14 +266,18 @@
          width={'75vw'}
          maskClosable={false}
          okText="提交"
          onOk={this.verifySubmit}
          confirmLoading={loading}
          onCancel={() => {this.setState({ visible: false }) }}
          onCancel={() => {this.setState({ visible: false, loading: false }) }}
          footer={[
            config.subtype !== 'dualdatacard' && record.interType === 'inner' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null,
            <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>取消</Button>,
            <Button key="confirm" type="primary" loading={loading} onClick={this.verifySubmit}>确定</Button>
          ]}
          destroyOnClose
        >
          <VerifyCard
            mainSearch={mainSearch}
            config={config}
            updRecord={(record) => this.setState({record: record})}
            wrappedComponentRef={(inst) => this.verifyRef = inst}
          />
        </Modal>
src/menu/datasource/verifycard/customscript/index.jsx
@@ -312,7 +312,7 @@
            <Form.Item label="可用字段" className="field-able">
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}</Tooltip>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@或@orderBy@代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}</Tooltip>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip>
            </Form.Item>
          </Col>
src/menu/datasource/verifycard/index.jsx
@@ -29,7 +29,8 @@
class VerifyCard extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 组件配置信息
    config: PropTypes.object,
    updRecord: PropTypes.func
  }
  state = {
@@ -137,7 +138,7 @@
        width: '10%',
        render: (text, record) => {
          if (record.position === 'back') {
            return <span style={{color: 'orange'}}>后置</span>
            return <span style={{color: '#1890ff'}}>后置</span>
          } else {
            return <span style={{color: '#26C281'}}>前置</span>
          }
@@ -911,7 +912,14 @@
          this.setState({reload: false})
        })
      }
      this.props.updRecord({...res.data.setting})
    })
  }
  updateStatus = (res) => {
    this.setState({median: {...res}})
    this.props.updRecord({...res})
  }
  copyColumns = () => {
@@ -985,7 +993,7 @@
              subColumns={subColumns}
              setting={setting}
              scripts={scripts}
              updateStatus={(res) => this.setState({median: {...res}})}
              updateStatus={this.updateStatus}
              wrappedComponentRef={(inst) => this.settingForm = inst}
            /> : null}
          </TabPane>
src/menu/datasource/verifycard/settingform/index.jsx
@@ -406,7 +406,12 @@
            </Col>
            {/* 数组数据,需设置排序规则 */}
            {config.format === 'array' ? <Col span={8}>
              <Form.Item label="默认排序">
              <Form.Item label={
                <Tooltip placement="topLeft" title="如果在自定义脚本中使用了@pageSize@或@orderBy@,请在数据源中单独写排序语句。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  默认排序
                </Tooltip>
              }>
                {getFieldDecorator('order', {
                  initialValue: setting.order || 'ID desc',
                  rules: [
@@ -479,6 +484,22 @@
                })(<InputNumber min={1} max={500} precision={0} />)}
              </Form.Item>
            </Col> : null}
            {setting.interType === 'inner' ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="当选择“是”时,内部函数的传参会增加 username 与 fullname。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  记录用户
                </Tooltip>
              }>
                {getFieldDecorator('recordUser', {
                  initialValue: setting.recordUser || 'false'
                })(
                <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'recordUser')}}>
                  <Radio value="false">否</Radio>
                  <Radio value="true">是</Radio>
                </Radio.Group>)}
              </Form.Item>
            </Col> : null}
            {/* 1、不分页且不存在上级模块 */}
            {!['navbar', 'interface', 'calendar'].includes(config.type) && !['editable', 'basetable', 'dualdatacard'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}>
              <Form.Item label={
src/menu/datasource/verifycard/utils.jsx
@@ -11,13 +11,20 @@
    let sql = ''
    let error = ''
    let _dataresource = ''
    let _customScript = ''
    let arr_field = columns.map(item => item.field).join(',')
    scripts.forEach(item => {
      _customScript += `
        ${item.sql}
      `
    let _customScript = ''
    let _tailScript = ''
    scripts && scripts.forEach(script => {
      if (script.status === 'false') return
      if (script.position !== 'back') {
        _customScript += `
        ${script.sql}
        `
      } else {
        _tailScript += `
        ${script.sql}
        `
      }
    })
    if (!arr_field) {
@@ -26,6 +33,10 @@
    if (setting.interType === 'system' && setting.execute !== 'false') {
      _dataresource = setting.dataresource || ''
    }
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    
    if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
@@ -38,16 +49,17 @@
    _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(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
    _customScript = _customScript.replace(/@select\$|\$select@/ig, '')
    // _dataresource = _dataresource.replace(/@sum\$|\$sum@/ig, '')
    _customScript = _customScript.replace(/@sum\$|\$sum@/ig, '')
    _dataresource = _dataresource.replace(/\$sum@/ig, '/*$sum@')
    _dataresource = _dataresource.replace(/@sum\$/ig, '@sum$*/')
    _dataresource = _dataresource.replace(/\$sum@/ig, '/*')
    _dataresource = _dataresource.replace(/@sum\$/ig, '*/')
    if (type === 'calendar') {
      _dataresource = _dataresource.replace(/@mk_year@/ig, '')
@@ -64,6 +76,7 @@
    if (window.GLOB.externalDatabase !== null) {
      _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
      _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    if (window.GLOB.urlFields) {
@@ -71,12 +84,14 @@
        let reg = new RegExp('@' + field + '@', 'ig')
        _dataresource = _dataresource.replace(reg, `'0'`)
        _customScript = _customScript.replace(reg, `'0'`)
        _tailScript = _tailScript.replace(reg, `'0'`)
      })
    }
    // 正则替换
    let _regoptions = []
    let _fields = []
    let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript)
    searches.forEach(item => {
      if (!item.field) return
@@ -142,6 +157,7 @@
    _regoptions.forEach(item => {
      _dataresource = _dataresource.replace(item.reg, '0')
      _customScript = _customScript.replace(item.reg, '0')
      _tailScript = _tailScript.replace(item.reg, '0')
    })
    let _search = defSearch
@@ -150,36 +166,14 @@
      _search = ''
    }
    let sumSql = ''
    if (_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 (_dataresource) {
      if (/\s/.test(_dataresource)) {
        _dataresource = '(' + _dataresource + ') tb'
      }
      if (setting.order) {
      if (custompage) {
        _dataresource = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search}`
      } else if (setting.order) {
        _dataresource = `/*system_query*/select${setting.laypage === 'true' ?  ' top 10' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable ${setting.laypage === 'true' ?  'where rows > 0' : ''} order by tmptable.rows`
      } else {
        _dataresource = `/*system_query*/select${setting.laypage === 'true' ?  ' top 10' : ''} ${arr_field} from ${_dataresource} ${_search}`
        _dataresource = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search}`
      }
    }
@@ -187,9 +181,19 @@
      sql = `/* sql 验证 */
        ${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
      `
    } 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 =''
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}'
      `
    } else {
      sql = `/* sql 验证 */
@@ -244,14 +248,8 @@
      })
    }
    if (sumSql) {
      sumSql = sumSql.replace(/\n\s{10}/ig, '\n')
      console.info(sumSql)
      sumSql = sumSql.replace(/\n/g, ' ')
    }
    sql = sql.replace(/\n/g, ' ')
    return { error, sql, sumSql, errors: errors.join(';') }
    return { error, sql, errors: errors.join(';') }
  }
}
src/tabviews/basetable/index.jsx
@@ -505,9 +505,15 @@
      }
      let _customScript = ''
      let _tailScript = ''
      component.scripts && component.scripts.forEach(script => {
        if (script.status !== 'false') {
        if (script.status === 'false') return
        if (script.position !== 'back') {
          _customScript += `
          ${script.sql}
          `
        } else {
          _tailScript += `
          ${script.sql}
          `
        }
@@ -527,22 +533,28 @@
      if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
        component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
        _customScript = _customScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
        _tailScript = _tailScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
      } else {
        component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
        _customScript = _customScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
        _tailScript = _tailScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
      }
      regs.forEach(cell => {
        component.setting.dataresource = component.setting.dataresource.replace(cell.reg, cell.value)
        _customScript = _customScript.replace(cell.reg, cell.value)
        _tailScript = _tailScript.replace(cell.reg, cell.value)
      })
      component.setting.customScript = _customScript // 整理后自定义脚本
      component.setting.tailScript = _tailScript     // 后置自定义脚本
      if (component.setting.laypage) {
        component.setting.custompage = /@pageSize@/i.test(component.setting.dataresource + component.setting.customScript)
      component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
      if (!component.setting.execute || component.setting.custompage) {
        component.forbidLine = true
      }
      component.setting.delay = delay
      delay += 20
src/tabviews/custom/components/calendar/index.jsx
@@ -100,11 +100,11 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
        Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
          if (!res.valid && config.setting.onload === 'true') {
            setTimeout(() => {
              this.loadData('init')
@@ -128,7 +128,7 @@
          this.setState({data: _data})
        })
      } else {
        Api.getLCacheConfig(config.uuid, 0).then(res => {
        Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
          if (!res.data || this.loaded) return
  
          let _data = []
@@ -243,7 +243,7 @@
    if (result.status) {
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      let data = []
src/tabviews/custom/components/card/balcony/index.jsx
@@ -55,7 +55,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
        _config.setting.sync = 'false'
@@ -171,12 +171,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -193,7 +193,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            let _data = res.data[0] || {$$empty: true}
@@ -226,7 +226,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data[0] || {$$empty: true}
@@ -389,7 +389,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (!result.data || !result.data[0]) {
src/tabviews/custom/components/card/data-card/index.jsx
@@ -157,7 +157,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -252,14 +252,14 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    this.loaded && this.prevCheck()
    if (config.$cache) {
      if (config.$time && !config.setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('', 'init')
@@ -282,12 +282,14 @@
              return item
            })
    
            this.setState({data: _data})
            this.setState({data: _data}, () => {
              this.prevCheck()
            })
          })
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            let _data = res.data.map((item, index) => {
@@ -331,7 +333,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data.map((item, index) => {
@@ -762,7 +764,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (selected !== 'false' || (id && config.wrap.selected !== 'false')) {
@@ -869,6 +871,15 @@
  async loadLinedata (id) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData()
      })
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -243,7 +243,7 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      let getData = (res) => {
@@ -286,7 +286,7 @@
      }
      
      if (config.$time && !config.setting.laypage) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
        Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
          if (!res.valid) {
            setTimeout(() => {
              this.loadData('', 'init')
@@ -298,7 +298,7 @@
          this.setState({data: getData(res.data)})
        })
      } else {
        Api.getLCacheConfig(config.uuid, 0).then(res => {
        Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
          if (!res.data || this.loaded) return
  
          this.setState({data: getData(res.data)})
@@ -608,7 +608,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (selected !== 'false' || (id && config.wrap.selected !== 'false')) {
@@ -772,6 +772,15 @@
  async loadLinedata (id) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
      this.setState({
        pageIndex: 1
      }, () => {
        this.loadData()
      })
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -55,7 +55,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
        _config.setting.sync = 'false'
@@ -172,13 +172,13 @@
  }
  initExec = () => {
    const { config, selected, data } = this.state
    const { config, selected, data, BID } = this.state
    if (config.wrap.datatype === 'dynamic') {
      if (config.$cache) {
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData('init')
@@ -190,7 +190,11 @@
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
              this.setState({data: _data}, () => {
                if (selected !== 'false') {
                  this.checkTopLine()
                }
              })
            })
          } else {
            if (config.wrap.goback === 'true' && data.$$empty) {
@@ -208,7 +212,7 @@
          }
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
            Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
              if (!res.data || this.loaded) return
      
              let _data = res.data[0] || {$$empty: true}
@@ -276,12 +280,12 @@
      }
      if (config.$cache && config.$time && config.wrap.autoExec) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
        Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
          if (res.valid) return
          
          this.autoExec()
          
          Api.writeCacheConfig(config.uuid, [])
          Api.writeCacheConfig(config.uuid, [], BID)
        })
      } else {
        this.autoExec()
@@ -299,7 +303,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data[0] || {$$empty: true}
@@ -533,7 +537,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (!result.data || !result.data[0]) {
src/tabviews/custom/components/card/table-card/index.jsx
@@ -74,7 +74,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -154,12 +154,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time && !config.setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -180,7 +180,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            let _data = res.data.map((item, index) => {
@@ -217,7 +217,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data.map((item, index) => {
@@ -374,7 +374,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      let data = []
src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -56,7 +56,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -141,12 +141,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -170,7 +170,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            let _data = res.data.map((item, index) => {
@@ -212,7 +212,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data.map((item, index) => {
@@ -354,7 +354,7 @@
    if (result.status) {
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      let data = result.data.map((item, index) => {
src/tabviews/custom/components/carousel/prop-card/index.jsx
@@ -55,7 +55,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
        _config.setting.sync = 'false'
@@ -139,13 +139,13 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.wrap.datatype === 'dynamic') {
      if (config.$cache) {
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData('init')
@@ -164,7 +164,7 @@
          }
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
            Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
              if (!res.data || this.loaded) return
      
              let _data = res.data[0] || {$$empty: true}
@@ -204,7 +204,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data[0] || {$$empty: true}
@@ -356,7 +356,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (!result.data || !result.data[0]) {
src/tabviews/custom/components/chart/antv-G6/index.jsx
@@ -837,7 +837,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -1024,12 +1024,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -1046,7 +1046,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -1072,14 +1072,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    if (!is(fromJS(this.data), fromJS(_data))) {
@@ -1154,7 +1154,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -328,7 +328,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -398,12 +398,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -420,7 +420,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -446,14 +446,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    this.data = _data
@@ -581,7 +581,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -91,7 +91,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -168,12 +168,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -198,7 +198,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -232,14 +232,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    if (config.subtype !== 'ratioboard') {
@@ -340,7 +340,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -76,7 +76,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -140,12 +140,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -162,7 +162,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -188,14 +188,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    this.data = _data
@@ -297,7 +297,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
src/tabviews/custom/components/chart/antv-scatter/index.jsx
@@ -68,7 +68,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -136,12 +136,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -160,7 +160,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -188,14 +188,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    this.data = _data
@@ -327,7 +327,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
      
src/tabviews/custom/components/chart/custom-chart/index.jsx
@@ -57,7 +57,7 @@
        this.data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -125,12 +125,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -149,7 +149,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.data = res.data
@@ -177,14 +177,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    if (!is(fromJS(this.data), fromJS(_data))) {
@@ -320,7 +320,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.loaded = true
src/tabviews/custom/components/code/sand-box/index.jsx
@@ -48,7 +48,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -106,13 +106,13 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.wrap.datatype !== 'static') {
      if (config.$cache) {
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData('init')
@@ -130,7 +130,7 @@
          }
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
            Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
              if (!res.data || this.loaded) return
      
              this.setState({data: res.data}, () => {
@@ -160,14 +160,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    if (!is(fromJS(this.state.data), fromJS(_data))) {
@@ -243,7 +243,7 @@
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (!is(fromJS(this.state.data), fromJS(_data))) {
src/tabviews/custom/components/module/voucher/index.jsx
@@ -609,7 +609,7 @@
          sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`)
        })
      }
      return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.debit ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`
      return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit},'${direct}','${curr ? item.exratecode : ''}','${curr ? item.exratename : ''}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.debit ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`
    })
    if (type === 'createVoucher') {
@@ -625,7 +625,7 @@
      let curr = item.foreign_currency_type === 'Y'
      let direct = item.debit ? 'debit' : 'credit'
      subject_data.push(`'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.debit ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},1,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`)
      subject_data.push(`'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit},'${direct}','${curr ? item.exratecode : ''}','${curr ? item.exratename : ''}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.debit ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},1,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`)
    })
    supMap.forEach(n => {
@@ -902,7 +902,7 @@
          sup_data.push(`'${n.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${n.voucher_sup_lp || ''}','${item.subject_code}','${item.subject_name}','${n.sup_voucher_text || ''}','${direct}',${item.debit || item.credit || 0},'${n.customercode || ''}','${n.customername || ''}','${n.suppliercode || ''}','${n.suppliername || ''}','${n.co_pro_code || ''}','${n.co_pro_name || ''}','${n.workercode || ''}','${n.workername || ''}','${n.project_code || ''}','${n.project_name || ''}','${n.productcode || ''}','${n.productname || ''}','${n.cash_flow_code || ''}','${n.cash_flow_name || ''}','${n.sup_acc_code || ''}','${n.sup_acc_name || ''}','${n.sup_acc_type || ''}','${item.uuid}',0,'${n.lessor_code || ''}','${n.lessor_name || ''}','${n.logistics_code || ''}','${n.logistics_name || ''}'`)
        })
      }
      return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit || 0},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.direct ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`
      return `'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit || 0},'${direct}','${curr ? item.exratecode : ''}','${curr ? item.exratename : ''}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.direct ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},0,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`
    })
    voucherMap.forEach(item => {
@@ -910,7 +910,7 @@
      let curr = item.foreign_currency_type === 'Y'
      let direct = !item.credit ? 'debit' : 'credit'
      subject_data.push(`'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit || 0},'${direct}','${curr ? item.exratecode : '01010001'}','${curr ? item.exratename : 'CNY'}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.direct ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},1,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`)
      subject_data.push(`'${item.uuid}','${item.subject_voucher_code || ''}','${item.voucher_lp || ''}','${item.subject_code}','${item.subject_name}','${item.subject_voucher_text || ''}',${count ? item.fcc_count || 0 : 0},${count ? item.net_unitprice || 0 : 0},'${item.unit}',${item.debit || item.credit || 0},'${direct}','${curr ? item.exratecode : ''}','${curr ? item.exratename : ''}',${curr ? item.unitratio || 0 : 0},'${item.sup_accounting}',${item.direct ? 1 : -1},${curr ? item.foreign_amount || 0 : 0},1,'${item.local_currency || ''}','${count ? 'Y' : ''}','${curr ? 'Y' : ''}','${item.closing_foreign_exchange || ''}'`)
    })
    supMap.forEach(n => {
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -128,7 +128,7 @@
    let param = getStructuredParams(params, config, BID)
    if (config.$cache && config.$time) {
      Api.getLCacheConfig(params[0].uuid, config.$time).then(res => {
      Api.getLCacheConfig(params[0].uuid, config.$time, BID).then(res => {
        if (!res.valid) {
          this.getMainData(param, params, config.uuid)
        }
src/tabviews/custom/components/table/base-table/index.jsx
@@ -264,6 +264,11 @@
  async loadmainLinedata (id) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
src/tabviews/custom/components/table/edit-table/index.jsx
@@ -303,6 +303,11 @@
  async loadmainLinedata (id) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1674,12 +1674,12 @@
    if (submit.intertype === 'system') { // 系统存储过程
      param.func = 'sPC_TableData_InUpDe'
      
      param.excel_in_type = 'true'
      param.LText1 = Utils.formatOptions(result.insert)
      param.LText2 = Utils.formatOptions(result.bottom)
      delete param.excel_in
      param.exec_type = 'y'
      param.LText = Utils.formatOptions(result.sql)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      param.secretkey = Utils.encrypt('', param.timestamp)
      param.menuname = submit.logLabel
@@ -1701,6 +1701,11 @@
    } else if (submit.intertype === 'inner' && submit.innerFunc) { // 自定义存储过程
      param.func = submit.innerFunc
      if (submit.recordUser === 'true') {
        param.username = sessionStorage.getItem('User_Name') || ''
        param.fullname = sessionStorage.getItem('Full_Name') || ''
      }
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -87,7 +87,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -180,7 +180,6 @@
          pageIndex: 1
        }, () => {
          this.loadmaindata(true, 'true', '', 'timer')
          this.getStatFieldsValue()
        })
      })
    }
@@ -207,12 +206,12 @@
  }
  initExec = () => {
    const { config, setting } = this.state
    const { config, setting, BID } = this.state
    if (config.$cache) {
      if (config.$time && !setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadmaindata(false, 'true', '', 'init')
@@ -247,7 +246,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.setState({data: res.data.map((item, index) => {
@@ -278,14 +277,12 @@
        if (config.setting.onload === 'true') {
          setTimeout(() => {
            this.loadmaindata(false, 'true', '', 'init')
            this.getStatFieldsValue()
          }, config.setting.delay || 0)
        }
      }
    } else if (config.setting.onload === 'true') {
      setTimeout(() => {
        this.loadmaindata()
        this.getStatFieldsValue()
      }, config.setting.delay || 0)
    }
  }
@@ -300,7 +297,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data.map((item, index) => {
@@ -399,7 +396,7 @@
    if (result.status) {
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
@@ -524,6 +521,11 @@
  async loadmainLinedata (id) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
      this.reloadtable()
      return
    }
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
@@ -639,72 +641,6 @@
  }
  /**
   * @description 获取合计字段值
   */
  getStatFieldsValue = () => {
    const { setting, config, search, BID, orderBy } = this.state
    if (setting.supModule && !BID && setting.supKey !== 'false') { // BID 不存在时,不做查询
      this.setState({
        statFValue: []
      })
      return
    }
    if (config.statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch) { // 主表搜索条件
      let mainSearch = window.GLOB.SearchBox.get(config.$searchId) || []
      let keys = config.$s_keys || []
      mainSearch.forEach(item => {
        if (keys.includes(item.key.toLowerCase())) return
        searches.push(item)
      })
    }
    if (config.$s_req && searches.filter(item => item.required && item.value === '').length > 0) {
      return
    }
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID)
    Api.genericInterface(param).then(res => {
      if (res.status) {
        let _data = res.data[0]
        let values = []
        if (_data) {
          config.statFields.forEach(item => {
            if (_data[item.field] || _data[item.field] === 0) {
              let val = +_data[item.field]
              if (isNaN(val)) {
                val = 0
              }
              val = val.toFixed(item.decimal)
              values.push({label: item.label, value: val})
            }
          })
        }
        this.setState({
          statFValue: values
        })
      } else {
        this.setState({
          statFValue: []
        })
        notification.error({
          top: 92,
          message: res.message,
          duration: 10
        })
      }
    })
  }
  /**
   * @description 搜索条件改变时,重置表格数据
   * 含有初始不加载的页面,修改设置
   */
@@ -714,7 +650,6 @@
      search: searches
    }, () => {
      this.loadmaindata(true, 'true')
      this.getStatFieldsValue()
    })
  }
@@ -748,11 +683,9 @@
        pageIndex: 1
      }, () => {
        this.loadmaindata(true, 'true', id)
        this.getStatFieldsValue()
      })
    } else {
      this.loadmaindata(true, 'false', id)
      this.getStatFieldsValue()
    }
  }
@@ -805,7 +738,6 @@
        BData: data
      }, () => {
        this.loadmaindata(true, 'true')
        this.getStatFieldsValue()
      })
    }
  }
src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -59,7 +59,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -149,12 +149,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -174,7 +174,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.setState({data: res.data.map((item, index) => {
@@ -210,7 +210,7 @@
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    _data = _data.map((item, index) => {
@@ -353,7 +353,7 @@
    if (result.status) {
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      let data = result.data.map((item, index) => {
src/tabviews/custom/components/tree/antd-tree/index.jsx
@@ -60,7 +60,7 @@
        _data = window.GLOB.SyncData.get(_config.dataName) || []
  
        if (_config.$cache) {
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
        }
  
        _config.setting.sync = 'false'
@@ -129,12 +129,12 @@
  }
  initExec = () => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$cache) {
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData('init')
@@ -152,7 +152,7 @@
        }
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
            if (!res.data || this.loaded) return
    
            this.setState({data: res.data}, () => {
@@ -179,14 +179,14 @@
  }
  transferSyncData = (syncId) => {
    const { config } = this.state
    const { config, BID } = this.state
    if (config.$syncId !== syncId) return
    let _data = window.GLOB.SyncData.get(config.dataName) || []
    if (config.$cache) {
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
    }
    this.loaded = true
@@ -304,7 +304,7 @@
    if (result.status) {
      this.loaded = true
      if (config.$cache && type === 'init') {
        Api.writeCacheConfig(config.uuid, result.data || [])
        Api.writeCacheConfig(config.uuid, result.data || [], BID)
      }
      this.setState({
src/tabviews/custom/index.jsx
@@ -328,11 +328,24 @@
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) => {
    return components.filter(item => {
      item.$pageId = pageId
      item.$cache = cache
      item.$time = time
      item.$searchId = searchId
      item.$syncId = syncId
      
      if (cache) {
        item.$cache = cache
        item.$time = time
        if (item.wrap && item.wrap.cacheLocal === 'false') {
          item.$cache = false
        } else if (item.plot && item.plot.cacheLocal === 'false') {
          item.$cache = false
        }
        if (!item.$cache && item.setting && item.setting.sync === 'true') {
          item.setting.sync = 'false'
        }
      }
      if (item.style && item.style.boxShadow) {
        delete item.style.hShadow
        delete item.style.vShadow
@@ -530,7 +543,6 @@
      }
      if (item.type === 'table') {
        let statFields = []
        let getCols = (cols) => {
          return cols.filter(col => {
            if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
@@ -542,9 +554,6 @@
            }
            
            if (col.type === 'number') {
              if (col.sum === 'true' && !statFields.includes(col.field)) {
                statFields.push(col)
              }
              if (typeof(col.decimal) === 'number') {
                col.round = Math.pow(10, col.decimal)
                if (col.format === 'percent') {
@@ -595,7 +604,6 @@
        }
        
        item.cols = getCols(item.cols)
        item.statFields = statFields
        if (item.subtype === 'editable') {
          item.submit.logLabel = item.$menuname + '-提交'
@@ -713,6 +721,11 @@
            group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
          }
          if (item.$cache && item.$time) {
            group.$cache = item.$cache
            group.$time = item.$time
          }
          group.subButton.syncComponentId = group.subButton.syncComponent ? (group.subButton.syncComponent.pop() || '') : ''
          if (group.subButton.syncComponentId && group.subButton.syncComponentId === item.setting.supModule) {
@@ -826,6 +839,10 @@
          cell.errorType = 'error2'
        }
      }
    } else if (cell.OpenType === 'pop' && item.$cache && item.$time && cell.modal) {
      cell.modal.$cache = item.$cache
      cell.modal.$time = item.$time
      cell.modal.uuid = cell.uuid + 'pop'
    }
    if (cell.syncComponentId) {
@@ -859,6 +876,11 @@
  resetElement = (cell) => {
    cell.style = cell.style || {}
    if (cell.style.display === 'inline-block') {
      cell.style.verticalAlign = 'top'
    }
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
      if (!cell.height) {
        cell.innerHeight = 'auto'
@@ -1007,8 +1029,10 @@
      component.setting.customScript = _customScript // 整理后自定义脚本
      component.setting.tailScript = _tailScript     // 后置自定义脚本
      if (component.setting.laypage) {
        component.setting.custompage = /@pageSize@/i.test(component.setting.dataresource + component.setting.customScript)
      component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
      if (!component.setting.execute || component.setting.custompage) {
        component.forbidLine = true
      }
      if (component.setting.sync === 'true') {
@@ -1143,6 +1167,8 @@
      inter.setting.customScript = _customScript // 整理后自定义脚本
      inter.setting.tailScript = _tailScript     // 后置自定义脚本
      inter.setting.custompage = /@pageSize@|@orderBy@/i.test(inter.setting.dataresource + inter.setting.customScript)
      return inter
    })
  }
@@ -1151,13 +1177,13 @@
   * @description 主表数据加载
   */ 
  loadmaindata = (params) => {
    const { config } = this.state
    let param = getStructuredParams(params, config, this.state.BID || '')
    const { config, BID } = this.state
    let param = getStructuredParams(params, config, BID || '')
    this.setState({loading: true, loadingview: false})
    if (config.$cache && config.$time) {
      Api.getLCacheConfig(params[0].uuid, config.$time).then(res => {
      Api.getLCacheConfig(params[0].uuid, config.$time, BID).then(res => {
        if (!res.valid) {
          this.getMainData(param, params, config.MenuID)
        } else {
src/tabviews/custom/popview/index.jsx
@@ -344,7 +344,6 @@
      }
      if (item.type === 'table') {
        let statFields = []
        let getCols = (cols) => {
          return cols.filter(col => {
            if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
@@ -356,9 +355,6 @@
            }
            
            if (col.type === 'number') {
              if (col.sum === 'true' && !statFields.includes(col.field)) {
                statFields.push(col)
              }
              if (typeof(col.decimal) === 'number') {
                col.round = Math.pow(10, col.decimal)
                if (col.format === 'percent') {
@@ -404,7 +400,6 @@
        }
        
        item.cols = getCols(item.cols)
        item.statFields = statFields
        if (item.subtype === 'editable') {
          item.submit.logLabel = item.$menuname + '-提交'
@@ -649,6 +644,11 @@
  resetElement = (cell) => {
    cell.style = cell.style || {}
    if (cell.style.display === 'inline-block') {
      cell.style.verticalAlign = 'top'
    }
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
      if (!cell.height) {
        cell.innerHeight = 'auto'
@@ -748,9 +748,15 @@
      }
      let _customScript = ''
      let _tailScript = ''
      component.scripts && component.scripts.forEach(script => {
        if (script.status !== 'false') {
        if (script.status === 'false') return
        if (script.position !== 'back') {
          _customScript += `
          ${script.sql}
          `
        } else {
          _tailScript += `
          ${script.sql}
          `
        }
@@ -770,20 +776,26 @@
      if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
        component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
        _customScript = _customScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
        _tailScript = _tailScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
      } else {
        component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
        _customScript = _customScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
        _tailScript = _tailScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
      }
      regs.forEach(cell => {
        component.setting.dataresource = component.setting.dataresource.replace(cell.reg, cell.value)
        _customScript = _customScript.replace(cell.reg, cell.value)
        _tailScript = _tailScript.replace(cell.reg, cell.value)
      })
      component.setting.customScript = _customScript // 整理后自定义脚本
      component.setting.tailScript = _tailScript     // 后置自定义脚本
      if (component.setting.laypage) {
        component.setting.custompage = /@pageSize@/i.test(component.setting.dataresource + component.setting.customScript)
      component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
      if (!component.setting.execute || component.setting.custompage) {
        component.forbidLine = true
      }
      if (component.setting.sync === 'true') {
src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
@@ -27,7 +27,8 @@
  onImportExcel = file => {
    const { btn } = this.props
    let columns = btn.verify.columns.map(option => option.Column)
    let btnColumns = btn.verify.columns.filter(option => option.import !== 'init')
    let columns = btnColumns.map(option => option.Column)
    let range = btn.verify.range || 0
    // excel数据处理
@@ -58,7 +59,7 @@
            errors = 'empty'
          } else {
            let iserror = false
            btn.verify.columns.forEach(op => {
            btnColumns.forEach(op => {
              let _name = typeof(header[op.Column]) === 'string' ? header[op.Column].replace(/(^\s*|\s*$)/g, '') : header[op.Column]
              let _text = op.Text ? op.Text.replace(/(^\s*|\s*$)/g, '') : op.Text
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -271,7 +271,7 @@
   * @description Excel 导入
   */
  getexceldata = (data, errors, sheetName, errDetail) => {
    const { btn } = this.props
    const { btn, BID } = this.props
    if (errors) {
      if (errors === 'notexit') {
@@ -314,7 +314,7 @@
      })
    }
    let result = getExcelInSql(btn, data, (this.props.BID || ''), this.state.primaryId)
    let result = getExcelInSql(btn, data, (BID || ''), this.state.primaryId)
    if (result.errors) {
      notification.warning({
@@ -331,30 +331,29 @@
      excel_in: result.lines
    }
    if (this.props.BID) {
      param.BID = this.props.BID
    if (BID) {
      param.BID = BID
    }
    if (btn.intertype === 'system') { // 系统存储过程
      param.func = 'sPC_TableData_InUpDe'
      param.excel_in_type = 'true'
      param.LText1 = Utils.formatOptions(result.insert)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.LText2 = result.bottom
      delete param.excel_in
      // param.excel_in_type = 'true'
      param.exec_type = 'y'
      param.LText = result.sql
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let unCheckParam = null
      if (/\$check@|@check\$/ig.test(param.LText2) || /\$check@|@check\$/ig.test(param.LText)) {
      if (/\$check@|@check\$/ig.test(param.LText)) {
        unCheckParam = fromJS(param).toJS()
        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
        param.LText2 = param.LText2.replace(/\$check@|@check\$/ig, '')
      }
      param.LText2 = Utils.formatOptions(param.LText2)
      param.LText = Utils.formatOptions(param.LText)
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      param.secretkey = Utils.encrypt('', param.timestamp)
      if (window.GLOB.mkHS && param.timestamp) { // 云端验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
@@ -368,11 +367,7 @@
      if (unCheckParam) {
        unCheckParam.LText = unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
        unCheckParam.LText = Utils.formatOptions(unCheckParam.LText)
        unCheckParam.LText2 = unCheckParam.LText2.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
        unCheckParam.LText2 = Utils.formatOptions(unCheckParam.LText2)
        unCheckParam.secretkey = Utils.encrypt(unCheckParam.LText, unCheckParam.timestamp)
        unCheckParam.secretkey = Utils.encrypt('', unCheckParam.timestamp)
        unCheckParam.menuname = btn.logLabel
        if (window.GLOB.probation) {
@@ -424,6 +419,11 @@
      }
    } else if (btn.intertype === 'inner' && btn.innerFunc) { // 自定义存储过程
      param.func = btn.innerFunc
      if (btn.recordUser === 'true') {
        param.username = sessionStorage.getItem('User_Name') || ''
        param.fullname = sessionStorage.getItem('Full_Name') || ''
      }
      Api.genericInterface(param).then((res) => {
        if (res.status) {
@@ -515,7 +515,8 @@
        }
        
        if (window.GLOB.mkHS && res.func === 's_sDataDictb_excelIn') { // s_sDataDictb_excelIn 云端验证
          param.LText = Utils.formatOptions(result.sql)
          let sql = `Declare @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),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)`
          param.LText = Utils.formatOptions(sql)
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -168,7 +168,7 @@
        Api.genericInterface(param).then(result => {
          if (result.status) {
            this.exportExcel(result.data)
            this.exportExcel(result.data, result.ErrCode, result.message)
          } else {
            this.execError(result)
          }
@@ -180,9 +180,14 @@
        let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search)
        param.func = btn.innerFunc
        if (btn.recordUser === 'true') {
          param.username = sessionStorage.getItem('User_Name') || ''
          param.fullname = sessionStorage.getItem('Full_Name') || ''
        }
        Api.genericInterface(param).then(result => {
          if (result.status) {
            this.exportExcel(result.data)
            this.exportExcel(result.data, result.ErrCode, result.message)
          } else {
            this.execError(result)
          }
@@ -235,7 +240,7 @@
        Api.genericInterface(param).then(result => {
          if (result.status) {
            this.exportExcel(result.data)
            this.exportExcel(result.data, result.ErrCode, result.message)
          } else {
            this.execError(result)
          }
@@ -296,7 +301,7 @@
      
            Api.genericInterface(res).then(result => {
              if (result.status) {
                this.exportExcel(result.data)
                this.exportExcel(result.data, result.ErrCode, result.message)
              } else {
                this.execError(result)
              }
@@ -390,7 +395,7 @@
              this.getExcelOutDoubleData(viewParam, pageIndex, pageSize, data)
            } else {
              data = data.concat(result.data)
              this.exportExcel(data)
              this.exportExcel(data, result.ErrCode, result.message)
            }
          } else {
            this.execError(result)
@@ -419,6 +424,11 @@
    } else if (btn.intertype === 'inner') { // 使用内部函数
      param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search, true, pageIndex, pageSize)
      param.func = btn.innerFunc
      if (btn.recordUser === 'true') {
        param.username = sessionStorage.getItem('User_Name') || ''
        param.fullname = sessionStorage.getItem('Full_Name') || ''
      }
    } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数
      param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search, true, pageIndex, pageSize)
@@ -475,7 +485,7 @@
          this.getExcelOutData(viewParam, pageIndex, pageSize, data)
        } else {
          data = data.concat(result.data)
          this.exportExcel(data)
          this.exportExcel(data, result.ErrCode, result.message)
        }
      } else {
        this.execError(result)
@@ -489,7 +499,7 @@
  /**
   * @description Excel 生成
   */
  exportExcel = (data) => {
  exportExcel = (data, ErrCode, message) => {
    const { btn } = this.props
    
    let imgCol = false
@@ -573,7 +583,7 @@
        this.table2excel(column, table)
        this.execSuccess({ErrCode: 'S', message: '导出成功!'})
        this.execSuccess({ErrCode: ErrCode || 'S', message: message || '导出成功!'})
      } else {
        let letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        let cols = []
@@ -710,7 +720,7 @@
  
        XLSX.writeFile(wb, `${btn.$menuName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`)
  
        this.execSuccess({ErrCode: 'S', message: '导出成功!'})
        this.execSuccess({ErrCode: ErrCode || 'S', message: message || '导出成功!'})
      }
    } catch (e) {
      this.execError({ErrCode: 'N', message: 'Excel生成失败!'})
@@ -818,6 +828,10 @@
        _setting.dataresource = ''
      }
      if (/\s/.test(_setting.dataresource)) {
        _setting.dataresource = '(' + _setting.dataresource + ') tb'
      }
      let _customScript = ''
      let _tailScript = ''
      btn.verify.scripts && btn.verify.scripts.forEach(script => {
@@ -847,10 +861,7 @@
      _setting.tailScript = _tailScript     // 后置自定义脚本
      _setting.laypage = pagination
      if (_setting.laypage) {
        _setting.custompage = /@pageSize@/i.test(_setting.dataresource + _setting.customScript)
      }
      _setting.custompage = /@pageSize@|@orderBy@/i.test(_setting.dataresource + _setting.customScript)
      _setting.queryType = btn.verify.queryType
      _setting.$name = btn.logLabel
@@ -891,18 +902,18 @@
   * 4、模态框执行成功后是否关闭
   * 5、通知主列表刷新
   */
  execSuccess = (res = {}) => {
  execSuccess = (res) => {
    const { btn } = this.props
    if (res.ErrCode === 'S' || !res.ErrCode) { // 执行成功
    if (res.ErrCode === 'S') { // 执行成功
      notification.success({
        top: 92,
        message: res.message || '执行成功!',
        message: res.message,
        duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2
      })
    } else if (res.ErrCode === 'Y') { // 执行成功
      Modal.success({
        title: res.message || '执行成功!'
        title: res.message
      })
    } else if (res.ErrCode === '-1') { // 完成后不提示
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -740,6 +740,11 @@
      if (this.props.BID) {
        param.BID = this.props.BID
      }
      if (btn.recordUser === 'true') {
        param.username = sessionStorage.getItem('User_Name') || ''
        param.fullname = sessionStorage.getItem('Full_Name') || ''
      }
      
      let primaryId = ''
@@ -778,6 +783,11 @@
          param.BID = this.props.BID
        }
        if (btn.recordUser === 'true') {
          param.username = sessionStorage.getItem('User_Name') || ''
          param.fullname = sessionStorage.getItem('Full_Name') || ''
        }
        let primaryId = setting.primaryKey ? cell[setting.primaryKey] || '' : ''
        if (btn.OpenType === 'pop') { // 表单
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -903,6 +903,11 @@
        if (btn.intertype === 'inner') {
          params = params.map(_param => {
            _param.func = btn.innerFunc
            if (btn.recordUser === 'true') {
              _param.username = sessionStorage.getItem('User_Name') || ''
              _param.fullname = sessionStorage.getItem('Full_Name') || ''
            }
  
            return _param
          })
src/tabviews/zshare/mutilform/index.jsx
@@ -610,8 +610,9 @@
    }
    this.record = record
    let ID = this.props.data ? this.props.data.$$uuid || '' : ''
    this.setState({ formlist, ID: this.props.data ? this.props.data.$$uuid || '' : '' }, () => {
    this.setState({ formlist, ID }, () => {
      if (unload) return
      
      if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) {
@@ -629,13 +630,29 @@
      }
      if (deForms.length > 0) {
        if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') {
          this.improveSimpleActionForm(deForms)
        if (action.$cache && action.setting.cache !== 'false') {
          Api.getLCacheConfig(action.uuid, action.$time, this.props.BID, ID).then(res => {
            if (!res.valid) {
              this.getFormData(deForms)
            } else {
              this.resetFormList(res.data, true)
            }
          })
        } else {
          this.improveActionForm(deForms)
          this.getFormData(deForms)
        }
      }
    })
  }
  getFormData = (deForms) => {
    if (deForms.length === 1) {
      this.improveSimpleActionForm(deForms)
    } else if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') {
      this.improveSimpleActionForm(deForms)
    } else {
      this.improveActionForm(deForms)
    }
  }
  /**
@@ -647,8 +664,8 @@
    let deffers = []
    let mainItems = []  // 云端或单点数据
    let localItems = [] // 本地数据
    let cache = action.setting.cache !== 'false'
    let debug = window.GLOB.debugger === true
    let cache = action.setting.cache !== 'false' && !action.$cache
    let skip = false
    let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)  select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n`
    let _sso = _sql
@@ -661,7 +678,7 @@
        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
        sql = sql.replace(/@BID@/ig, `'${BID}'`)
        if (debug) {
        if (window.GLOB.debugger === true) {
          console.info(sql)
        }
@@ -675,7 +692,7 @@
        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
        sql = sql.replace(/@BID@/ig, `'${BID}'`)
        if (debug) {
        if (window.GLOB.debugger === true) {
          console.info(sql)
        }
@@ -712,6 +729,7 @@
                message: res.message,
                duration: 5
              })
              skip = true
            }
            resolve(res)
          })
@@ -753,6 +771,7 @@
                message: res.message,
                duration: 5
              })
              skip = true
            }
            resolve(res)
          })
@@ -768,7 +787,7 @@
      delete result.message
      delete result.status
      this.resetFormList(result)
      this.resetFormList(result, skip)
    })
  }
@@ -776,8 +795,11 @@
   * @description 测试系统获取下拉表单选项信息
   */
  improveSimpleActionForm = (deForms) => {
    let cache = this.props.action.setting.cache !== 'false'
    const { action } = this.props
    let cache = this.props.action.setting.cache !== 'false' && !action.$cache
    let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)  select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n`
    let skip = false
    let deffers = deForms.map((form, index) => {
      let param = {
@@ -812,6 +834,7 @@
                  message: res.message,
                  duration: 5
                })
                skip = true
              }
              resolve(res)
            })
@@ -822,6 +845,7 @@
    Promise.all(deffers).then(response => {
      let result = {}
      response.forEach(res => {
        result = {...result, ...res}
      })
@@ -831,11 +855,17 @@
      delete result.message
      delete result.status
      this.resetFormList(result)
      this.resetFormList(result, skip)
    })
  }
  resetFormList = (result) => {
  resetFormList = (result, skip) => {
    const { BID, action } = this.props
    if (action.$cache && action.setting.cache !== 'false' && !skip) {
      Api.writeCacheConfig(action.uuid, fromJS(result).toJS(), BID, this.state.ID)
    }
    let reFieldsVal = null
    let _formlist = fromJS(this.state.formlist).toJS().map(item => {
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx
@@ -46,16 +46,9 @@
        }
        this.props.columnChange(values)
        this.setState({
          locked: false,
          type: 'Nvarchar(50)'
        })
        this.props.form.setFieldsValue({
          Column: '',
          Text: '',
          required: 'true',
          import: 'true',
          type: 'Nvarchar(50)'
          Text: ''
        })
      }
    })
@@ -148,6 +141,7 @@
                <Radio.Group>
                  <Radio value="true">是</Radio>
                  <Radio value="false">否</Radio>
                  <Radio value="init">初始化</Radio>
                </Radio.Group>
              )}
            </Form.Item>
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -45,12 +45,13 @@
    fields.push('jskey')
    let _dec = columns.map(item => item.Column + ' ' + item.type).join(',')
    let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
    if (_dec) {
      _dec += ','
    }
    let _sql = `Declare @${btn.sheet.replace(/@db@/ig, '')} table (${_dec}jskey nvarchar(50) )
    let _sql = `create table #${sheet} (${_dec}jskey nvarchar(50),BID nvarchar(50) )
      Declare @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),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512)
      Select @ErrorCode='', @retmsg=''
    `
@@ -81,7 +82,7 @@
  }
  handleConfirm = () => {
    const { type } = this.props
    const { type, btn } = this.props
    const { editItem, skip } = this.state
    // 表单提交时检查输入值是否正确
@@ -161,8 +162,10 @@
          return
        }
        let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
        let tail = `
          aaa:
          drop table #${sheet}
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg
        `
        let _initCustomScript = '' // 初始化脚本
@@ -290,7 +293,7 @@
      database = database ? (database[0] || '') : ''
      _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From @${sheet}`
      _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}`
    } else {
      _value = value
    }
@@ -335,17 +338,17 @@
      <Form {...formItemLayout} className="verify-form" id="verify-excelin-custom-scripts">
        <Row gutter={24}>
          {!type && btn.sheet ? <Col span={8}>
            <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.sheet}
            <Form.Item label="表名" style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.sheet}(表变量请使用#{btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')})
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={10}>
            <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}>
            <Form.Item label="报错字段" style={{margin: 0, whiteSpace: 'nowrap'}}>
              ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT、CNT、-2NT), retmsg
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
            <Form.Item label="可用字段">
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
              {usefulfields}
@@ -353,7 +356,7 @@
          </Col> : null}
          {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}>
            <Form.Item style={{marginBottom: 0}} label={
              <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}>
              <Tooltip placement="bottomLeft" title="自定义脚本与默认sql位置关系。">
                <QuestionCircleOutlined className="mk-form-tip" />
                执行位置
              </Tooltip>
@@ -370,7 +373,7 @@
            </Form.Item>
          </Col> : null}
          {!type ? <Col span={8}>
            <Form.Item style={{marginBottom: 0}} label={'快捷添加'}>
            <Form.Item style={{marginBottom: 0}} label="快捷添加">
              <Select
                showSearch
                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
@@ -404,7 +407,7 @@
            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
          </Col>
          <Col span={24} className="sql">
            <Form.Item label={'sql'}>
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
                initialValue: '',
                rules: [
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -38,6 +38,7 @@
        width: '14%',
        inputType: 'input',
        unique: true,
        strict: true,
        editable: true
      },
      {
@@ -72,20 +73,32 @@
        ]
      },
      {
        title: '导入',
        dataIndex: 'import',
        width: '10%',
        editable: true,
        inputType: 'radio',
        render: (text, record) => {
          if (record.import === 'init') {
            return '初始化'
          } else if (record.import === 'false') {
            return '否'
          }
          return '是'
        },
        options: [
          { value: 'true', text: '是' },
          { value: 'false', text: '否' },
          { value: 'init', text: '初始化' }
        ]
      },
      {
        title: '必填',
        dataIndex: 'required',
        width: '10%',
        editable: true,
        inputType: 'switch',
        render: (text, record) => record.required === 'true' ? '是' : '否'
      },
      {
        title: '导入',
        dataIndex: 'import',
        width: '10%',
        editable: true,
        inputType: 'switch',
        render: (text, record) => record.import !== 'false' ? '是' : '否'
      },
      {
        title: '最小值',
@@ -253,8 +266,6 @@
    const { card } = this.props
    let _verify = fromJS(card.verify || {}).toJS()
    let _columns = _verify.columns || []
    delete _verify.dataresource
    // 旧数据兼容
    _columns = _columns.map(col => {
@@ -638,7 +649,7 @@
        if (!err) {
          let _verify = {...verify, ...values}
          let cols = _verify.columns.map(col => col.Column)
          let cols = _verify.columns.map(col => col.Column.toLowerCase())
          cols = Array.from(new Set(cols))
          if (_verify.columns.length === 0) {
@@ -666,6 +677,15 @@
              return
            }
          }
          _verify.columns.sort((a, b) => {
            if (a.import === 'init' && b.import !== 'init') {
              return 1
            } else if (a.import !== 'init' && b.import === 'init') {
              return -1
            }
            return 0
          })
          let _loading = false
          if (this.scriptsForm && this.scriptsForm.state.editItem) {
@@ -838,7 +858,7 @@
            <Button className="excel-col-add mk-red" title="清空Excel列" onClick={this.clearField}>
              清空Excel列
            </Button>
            <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:数值类型(int 或 decimal),内容为必填;最大值和最小值在类型为数值时有效。</Col>
            <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:数值类型(int 或 decimal),内容为必填;最大值和最小值在类型为数值时有效。导入-初始化:用于excel中不存在,导入时需要初始化的字段</Col>
            <EditTable actions={['edit', 'move', 'copy', 'del', 'extra:required:是否必填']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/>
          </TabPane>
          {card.intertype === 'system' ? <TabPane tab={
src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
@@ -229,7 +229,12 @@
              </Form.Item>
            </Col> : null}
            {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}>
              <Form.Item label="排序方式">
              <Form.Item label={
                <Tooltip placement="topLeft" title="如果在自定义脚本中使用了@pageSize@或@orderBy@,请在数据源中单独写排序语句。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  排序方式
                </Tooltip>
              }>
                {getFieldDecorator('order', {
                  initialValue: setting.order || '',
                  rules: [
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -164,7 +164,7 @@
        width: '10%',
        render: (text, record) => {
          if (record.position === 'back') {
            return <span style={{color: 'orange'}}>后置</span>
            return <span style={{color: '#1890ff'}}>后置</span>
          } else {
            return <span style={{color: '#26C281'}}>前置</span>
          }
@@ -300,54 +300,47 @@
      searches = search
    } else {
      let search = []
      searches = fromJS(config.search || []).toJS()
      if (config.setting && config.setting.useMSearch === 'true' && window.GLOB.customMenu) {
        let menu = fromJS(window.GLOB.customMenu).toJS()
        let _search = null
        let filterComponent = (box) => {
        let filterComponent = (box, mainSearch) => {
          box.components.forEach(item => {
            if (_search) return
            if (item.type === 'search') {
              box.slist = [...box.slist, item.search]
            } else if (item.uuid === config.uuid) {
              _search = box.slist.pop()
            if (item.type !== 'search') return
            mainSearch = item.search
          })
          let has = false
          box.components.forEach(item => {
            if (item.uuid === config.uuid) {
              has = true
            } else if (item.type === 'group') {
              item.components.forEach(m => {
                if (m.uuid !== config.uuid) return
                _search = box.slist.pop()
              })
            } else if (item.type === 'tabs') {
              item.subtabs.forEach(tab => {
                tab.slist = [...box.slist]
                filterComponent(tab)
                has = true
              })
            }
          })
        }
        menu.slist = []
        filterComponent(menu)
        if (_search) {
          search = _search
        } else {
          menu.components.forEach(item => {
            if (item.type !== 'search') return
            search = item.search
          })
        }
      }
      searches = fromJS(config.search || []).toJS()
      if (search.length > 0) {
        let keys = searches.map(item => (item.field ? item.field.toLowerCase() : ''))
        search.forEach(item => {
          if (item.field && !keys.includes(item.field.toLowerCase())) {
            searches.push(item)
          if (has) {
            if (mainSearch) {
              let keys = searches.map(item => (item.field ? item.field.toLowerCase() : ''))
              mainSearch.forEach(item => {
                if (item.field && !keys.includes(item.field.toLowerCase())) {
                  searches.push(item)
                }
              })
            }
          } else {
            box.components.forEach(item => {
              if (item.type !== 'tabs') return
              item.subtabs.forEach(tab => {
                filterComponent(tab, mainSearch)
              })
            })
          }
        })
        }
        filterComponent(menu, null)
      }
    }
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
@@ -28,33 +28,45 @@
    }
    let _customScript = ''
    let _tailScript = ''
    scripts && scripts.forEach(script => {
      if (script.status === 'false') return
      _customScript += `
      ${script.sql}
      `
      if (script.position !== 'back') {
        _customScript += `
        ${script.sql}
        `
      } else {
        _tailScript += `
        ${script.sql}
        `
      }
    })
    if (_customScript) {
      _customScript = `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 =''
        ${_customScript}
      `
    }
    let declare = `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 =''`
    if (verify.defaultSql === 'false') {
      _dataresource = ''
    }
    if (/\s/.test(_dataresource)) {
      _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(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
      _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript)
    
    // 正则替换
    let _regoptions = regoptions.map(item => {
@@ -78,36 +90,43 @@
    _regoptions.forEach(item => {
      _dataresource = _dataresource.replace(item.reg, item.value)
      _customScript = _customScript.replace(item.reg, item.value)
      _tailScript = _tailScript.replace(item.reg, item.value)
    })
    if (verify.queryType === 'statistics' && _dataresource) {
      _search = ''
    }
    // 数据源处理, 存在显示列时
    // 数据源处理, 存在显示列时
    if (_dataresource) {
      if (/\s/.test(_dataresource)) {
        _dataresource = '(' + _dataresource + ') tb'
      }
      if (verify.order) {
        _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${verify.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
      } else {
      if (custompage || !verify.order) {
        _dataresource = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search}`
      } else {
        _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${verify.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
      }
    }
    if (_customScript) {
      sql = `/* sql 验证 */
        ${declare}
        ${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
      `
    } else if (_tailScript) {
      sql = `${declare}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
      `
    } 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 =''
        ${declare}
        ${_dataresource}`
    }
    sql = sql.replace(/\n\s{8}/ig, '\n')
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
@@ -67,7 +67,7 @@
        width: '10%',
        render: (text, record) => {
          if (record.position === 'back') {
            return <span style={{color: 'orange'}}>后置</span>
            return <span style={{color: '#1890ff'}}>后置</span>
          } else {
            return <span style={{color: '#26C281'}}>前置</span>
          }
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx
@@ -5,11 +5,18 @@
    let _dataresource = setting.dataresource || ''
    let _customScript = ''
    let _tailScript = ''
    scripts && scripts.forEach(script => {
      if (script.status === 'false') return
      _customScript += `
      ${script.sql}
      `
      if (script.position !== 'back') {
        _customScript += `
        ${script.sql}
        `
      } else {
        _tailScript += `
        ${script.sql}
        `
      }
    })
    if (_customScript) {
@@ -22,16 +29,22 @@
    if (setting.defaultSql === 'false') {
      _dataresource = ''
    }
    if (/\s/.test(_dataresource)) {
      _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(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
    _tailScript = _tailScript.replace(/@\$|\$@/ig, '')
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
      _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
      _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    let arr_field = columns.map(col => col.field)
@@ -43,10 +56,6 @@
    // 数据源处理, 存在显示列时 
    if (_dataresource) {
      if (/\s/.test(_dataresource)) {
        _dataresource = '(' + _dataresource + ') tb'
      }
      if (setting.order) {
        _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows`
      } else {
@@ -58,10 +67,21 @@
      sql = `/* sql 验证 */
        ${_customScript}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
      `
    } 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 =''
        ${declareSql}
        ${_dataresource}
        ${_tailScript}
        aaa:
        if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@
      `
    } 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 =''
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -3,6 +3,7 @@
import { is, fromJS } from 'immutable'
import { Button, Modal, Empty, notification } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import EditCard from './editcard'
@@ -11,8 +12,8 @@
class FieldsComponent extends Component {
  static propTpyes = {
    type: PropTypes.string,          // 搜索条件添加、显示列添加
    config: PropTypes.object,        // 容器Id
    type: PropTypes.string,
    config: PropTypes.object,
    updatefield: PropTypes.func
  }
@@ -23,10 +24,8 @@
    selectCards: []
  }
  queryField = () => {
    const { type, config } = this.props
    // 判断是否已选择表名
    if (!window.GLOB.tableFields || window.GLOB.tableFields.length === 0) {
  checkField = () => {
    if (!window.GLOB.publicTables || window.GLOB.publicTables.length === 0) {
      notification.warning({
        top: 92,
        message: '请选择表名!',
@@ -35,9 +34,101 @@
      return
    }
    window.GLOB.tableFields = window.GLOB.tableFields || []
    let index = 0
    let deffers = window.GLOB.publicTables.map(item => {
      let tb = window.GLOB.tableFields.filter(tab => tab.tableName === item.TbName)[0]
      if (tb) {
        return Promise.resolve(fromJS(tb).toJS())
      }
      return new Promise(resolve => {
        setTimeout(() => {
          Api.getCloudConfig({func: 'sPC_Get_FieldName', TBName: item.TbName}).then(res => {
            let tabmsg = {
              status: res.status,
              message: res.message,
              tableName: item.TbName,
              columns: []
            }
            if (res.FDName && res.FDName.length > 0) {
              tabmsg.columns = res.FDName.map(item => {
                let _type = item.FieldType.toLowerCase()
                let _decimal = 0
                let _length = 50
                if (/^nvarchar/.test(_type)) {
                  try { // 存在max
                    _length = +_type.match(/\d+/)[0] || 50
                  } catch (e) {
                    _length = 2048
                  }
                  _type = 'text'
                } else if (/^int/.test(_type)) {
                  _type = 'number'
                } else if (/^decimal/.test(_type)) {
                  _decimal = _type.split(',')[1]
                  _decimal = parseInt(_decimal)
                  _type = 'number'
                } else if (/^datetime/.test(_type)) {
                  _type = 'datetime'
                } else if (/^date/.test(_type)) {
                  _type = 'date'
                } else {
                  _type = 'text'
                }
                return {
                  field: item.FieldName || '',
                  label: item.FieldDec,
                  type: _type,
                  datatype: _type,
                  decimal: _decimal,
                  length: _length,
                  $datatype: item.FieldType.toLowerCase()
                }
              })
            }
            resolve(tabmsg)
          })
        }, index * 50)
        index++
      })
    })
    Promise.all(deffers).then(response => {
      let error = false
      let _columns = response
      response.forEach(item => {
        if (!item.status) {
          error = item.message || '字段查询失败!'
        }
      })
      if (error) {
        notification.warning({
          top: 92,
          message: error,
          duration: 5
        })
      } else {
        window.GLOB.tableFields = _columns
        this.queryField(_columns)
      }
    })
  }
  queryField = (tableFields) => {
    const { type, config } = this.props
    // 表字段集转为map数据
    let columns = new Map()
    window.GLOB.tableFields.forEach(table => {
    tableFields.forEach(table => {
      table.columns.forEach(column => {
        columns.set(column.field.toLowerCase(), column)
      })
@@ -281,7 +372,7 @@
    return (
      <div className="quickly-add">
        <Button type="primary" block onClick={this.queryField}>{label}</Button>
        <Button type="primary" block onClick={this.checkField}>{label}</Button>
        {/* 根据字段名添加显示列及搜索条件 */}
        <Modal
          wrapClassName="model-table-fieldmanage-modal"
src/templates/sharecomponent/settingcomponent/index.jsx
@@ -4,10 +4,7 @@
import { Modal, Button } from 'antd'
import { SettingOutlined } from '@ant-design/icons'
import Utils, { FuncUtils } from '@/utils/utils.js'
import SettingForm from './settingform'
import CreateFunc from '@/templates/zshare/createfunc'
import CreateInterface from '@/templates/zshare/createinterface'
// import './index.scss'
@@ -73,43 +70,26 @@
    })
  }
  /**
   * @description 创建表格存储过程
   */
  tableCreatFunc = () => {
    const { config } = this.props
    const { menu } = this.state
  // /**
  //  * @description 创建表格接口(读出)
  //  */
  // tableCreatInterface = () => {
  //   const { config } = this.props
  //   const { menu } = this.state
    this.settingRef.handleConfirm('loading').then(setting => {
      let res = this.resetSetting(setting, config.setting)
      let _config = {...config, setting: res}
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
  //   this.settingRef.handleConfirm('loading').then(setting => {
  //     let res = this.resetSetting(setting, config.setting)
  //     let _config = {...config, setting: res}
  //     let _menu = {
  //       type: config.Template === 'CommonTable' ? 'main' : 'subtable',
  //       MenuID: menu.MenuID,
  //       menuName: menu.MenuName,
  //       menuNo: menu.MenuNo
  //     }
      this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText)
    })
  }
  /**
   * @description 创建表格接口(读出)
   */
  tableCreatInterface = () => {
    const { config } = this.props
    const { menu } = this.state
    this.settingRef.handleConfirm('loading').then(setting => {
      let res = this.resetSetting(setting, config.setting)
      let _config = {...config, setting: res}
      let _menu = {
        type: config.Template === 'CommonTable' ? 'main' : 'subtable',
        MenuID: menu.MenuID,
        menuName: menu.MenuName,
        menuNo: menu.MenuNo
      }
      this.refs.tableCreatInterface.triggerOutInterface(_menu, _config)
    })
  }
  //     this.refs.tableCreatInterface.triggerOutInterface(_menu, _config)
  //   })
  // }
  resetSetting = (s, ori) => {
    let setting = fromJS(s).toJS()
@@ -179,7 +159,7 @@
  render() {
    const { config } = this.props
    const { visible, search, menu, record } = this.state
    const { visible, search, menu } = this.state
    return (
      <>
@@ -192,8 +172,6 @@
          maskClosable={false}
          onCancel={() => { this.setState({ visible: false, loading: false })}}
          footer={[
            record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null,
            record && record.interType === 'inner' ? <CreateFunc key="create" ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null,
            <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>取消</Button>,
            <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>确定</Button>
          ]}
@@ -203,7 +181,7 @@
            menu={menu}
            config={config}
            search={search}
            updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
            updRecord={() => {}}
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
        </Modal>
src/templates/sharecomponent/tablecomponent/index.jsx
@@ -23,7 +23,6 @@
  state = {
    tables: [],          // 系统表
    tableFields: [],     // 已选表字段集
    selectedTables: [],  // 已选表
  }
@@ -39,8 +38,6 @@
    this.setState({
      selectedTables: tables
    }, () => {
      this.gettableFields()
    })
  }
@@ -96,163 +93,28 @@
    })
  }
  gettableFields = () => {
    let deffers = this.state.selectedTables.map((item, i) => {
      return new Promise(resolve => {
        let param = {func: 'sPC_Get_FieldName', TBName: item.TbName}
        if (window.GLOB.cloudServiceApi) { // 且存在云端地址
          param.rduri = window.GLOB.cloudServiceApi
          param.userid = sessionStorage.getItem('CloudUserID') || ''
          param.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
        }
        setTimeout(() => {
          Api.getSystemCacheConfig(param).then(res => {
            res.TBName = item.TbName
            resolve(res)
          })
        }, (i + 1) * 100)
      })
    })
    Promise.all(deffers).then(response => {
      let _columns = []
      response.forEach(res => {
        if (res.status) {
          let tabmsg = {
            tableName: res.TBName,
            columns: res.FDName.map(item => {
              let _type = item.FieldType.toLowerCase()
              let _decimal = 0
              let _length = 50
              if (/^nvarchar/.test(_type)) {
                try { // 存在max
                  _length = +_type.match(/\d+/)[0] || 50
                } catch (e) {
                  _length = 2048
                }
                _type = 'text'
              } else if (/^int/.test(_type)) {
                _type = 'number'
              } else if (/^decimal/.test(_type)) {
                _decimal = _type.split(',')[1]
                _decimal = parseInt(_decimal)
                _type = 'number'
              } else if (/^datetime/.test(_type)) {
                _type = 'datetime'
              } else if (/^date/.test(_type)) {
                _type = 'date'
              } else {
                _type = 'text'
              }
              return {
                field: item.FieldName || '',
                label: item.FieldDec,
                type: _type,
                datatype: _type,
                decimal: _decimal,
                length: _length,
                $datatype: item.FieldType.toLowerCase()
              }
            })
          }
          _columns.push(tabmsg)
        } else {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 5
          })
        }
      })
      this.setState({
        tableFields: _columns
      })
      window.GLOB.tableFields = _columns
    })
  }
  /**
   * @description 添加表名
   */
  onTableChange = (value) => {
    const { config } = this.props
    const { tables, tableFields, selectedTables } = this.state
    const { tables, selectedTables } = this.state
    let _table = tables.filter(item => item.TbName === value)[0]
    let isSelected = !!selectedTables.filter(cell => cell.TbName === value)[0]
    if (!isSelected) {
      let _tables = [...selectedTables, _table]
      window.GLOB.publicTables = _tables
    if (selectedTables.findIndex(cell => cell.TbName === value) > -1) return
      this.setState({
        selectedTables: _tables
      })
    let _tables = [...selectedTables, _table]
      let _config = {...config, tables: _tables}
      Api.getCloudConfig({func: 'sPC_Get_FieldName', TBName: value}).then(res => {
        if (res.status) {
          let tabmsg = {
            tableName: _table.TbName,
            columns: res.FDName.map(item => {
              let _type = item.FieldType.toLowerCase()
              let _decimal = 0
              let _length = 50
    window.GLOB.publicTables = _tables
              if (/^nvarchar/.test(_type)) {
                try { // 存在max
                  _length = +_type.match(/\d+/)[0] || 50
                } catch (e) {
                  _length = 2048
                }
                _type = 'text'
              } else if (/^int/.test(_type)) {
                _type = 'number'
              } else if (/^decimal/.test(_type)) {
                _decimal = _type.split(',')[1]
                _decimal = parseInt(_decimal)
                _type = 'number'
              } else if (/^datetime/.test(_type)) {
                _type = 'datetime'
              } else if (/^date/.test(_type)) {
                _type = 'date'
              } else {
                _type = 'text'
              }
    this.setState({
      selectedTables: _tables
    })
              return {
                field: item.FieldName,
                label: item.FieldDec,
                type: _type,
                datatype: _type,
                decimal: _decimal,
                length: _length,
                $datatype: item.FieldType.toLowerCase()
              }
            })
          }
          let _columns = [...tableFields, tabmsg]
          this.setState({
            tableFields: _columns
          })
          window.GLOB.tableFields = _columns
          this.props.updatetable(_config)
        } else {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 5
          })
        }
      })
    }
    let _config = {...config, tables: _tables}
    this.props.updatetable(_config)
  }
  /**
@@ -260,19 +122,15 @@
   */
  deleteTable = (table) => {
    const { config } = this.props
    const { selectedTables, tableFields } = this.state
    const { selectedTables } = this.state
    let _tables = selectedTables.filter(item => item.TbName !== table.TbName)
    let _fields = tableFields.filter(item => item.tableName !== table.TbName)
    window.GLOB.publicTables = _tables
    this.setState({
      selectedTables: _tables,
      tableFields: _fields
    })
    window.GLOB.tableFields = _fields
    this.props.updatetable({...config, tables: _tables})
  }
src/templates/zshare/createfunc/index.jsx
@@ -4,203 +4,125 @@
import moment from 'moment'
import Utils from '@/utils/utils.js'
import FuncUtils from './utils.js'
import Api from '@/api'
// import './index.scss'
class CreateFunc extends Component {
  static propTypes = {
    trigger: PropTypes.func
    getMsg: PropTypes.func
  }
  state = {
    loading: false,
    loading: false
  }
  exec = (innerFunc, newLText, DelText) => {
  trigger = () => {
    this.props.getMsg().then(config => {
      let newLText = ''
      let func = ''
      if (config.$type === 'table') {
        func = config.func
        newLText = FuncUtils.getTableFunc(config)
      } else if (config.$type === 'excelIn') {
        func = config.func
        newLText = FuncUtils.getexcelInfunc(config)
      } else if (config.$type === 'btn') {
        func = config.func
        newLText = FuncUtils.getfunc(config)
      }
      if (!newLText || !func) return
      this.createExec(func, newLText)
    })
  }
  createExec = (func, newLText) => {
    let dropfunc = `IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('${func}') AND type in (N'P', N'PC'))  mdrpk PROCEDURE ${func}`
    // 删除存储过程
    let droparam = {
      func: 'sPC_TableData_InUpDe',
      LText: Utils.formatOptions(dropfunc),
      TypeCharOne: 'proc' // 删除或创建存储过程标志
    }
    droparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    droparam.secretkey = Utils.encrypt(droparam.LText, droparam.timestamp)
    droparam.open_key = Utils.encryptOpenKey(droparam.secretkey, droparam.timestamp)
    // 新建存储过程
    let _param = {
      func: 'sPC_TableData_InUpDe',
      LText: Utils.formatOptions(newLText),
      TypeCharOne: 'proc'
    }
    _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
    _param.open_key = Utils.encryptOpenKey(_param.secretkey, _param.timestamp)
    let saveParam = {
      func: 's_proc_save',
      sql_script: window.btoa(window.encodeURIComponent(newLText)),
      proc_name: func,
      save_type: 'auto'
    }
    this.setState({
      loading: true
    })
    this.createExec(innerFunc, newLText, DelText)
  }
  createExec = (innerFunc, newLText, DelText) => {
    let isExist = false // 存储过程是否存在
    let cloudText = ''  // 云端存储结果
    let localfunc = ''  // 本地存储过程
    new Promise(resolve => {
      // 获取云端存储过程信息
      Api.getCloudConfig({
        func: 'sPC_Get_TVP',
        TVPName: innerFunc
      }).then(result => {
    Api.genericInterface(droparam).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        this.setState({
          loading: false
        })
        return
      }
      Api.genericInterface(_param).then(result => {
        if (!result.status) {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
          })
          resolve(false)
        } else {
          cloudText = result.TVPText
          resolve(true)
        }
      })
    }).then(res => {
      if (!res) return res
      // 获取本地存储过程信息
      let _param = {
        func: 's_get_userproc',
        LText: innerFunc
      }
      _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
      return Api.genericInterface(_param)
    }).then(res => {
      if (!res) return res
      // 处理本地结果
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        return false
      } else {
        isExist = true
        localfunc = Utils.formatOptions(res.Ltext)
        return true
      }
    }).then(res => {
      if (!res) return res
      // 根据本地及远端结果判断执行动作
      if ((newLText === localfunc) && (newLText === cloudText)) {
        return 'drop'
      } else if (!localfunc || (cloudText === localfunc)) {
        // 本地存储过程不存在,或云端和本地存储过程一致时,将新的存储过程更新至云端
        return Api.getCloudConfig({
          func: 'sPC_TVP_InUp',
          TVPName: innerFunc,
          TVPText: newLText,
          TypeName: 'P'
        })
      } else {
        return new Promise(resolve => {
          Api.getCloudConfig({ // 添加现有的本地存储过程至云端
            func: 'sPC_TVP_InUp',
            TVPName: innerFunc,
            TVPText: localfunc,
            TypeName: 'P'
          }).then(result => {
            if (result.status) {
              Api.getCloudConfig({
                func: 'sPC_TVP_InUp', // 添加最新的存储过程至云端
                TVPName: innerFunc,
                TVPText: newLText,
                TypeName: 'P'
              }).then(response => {
                resolve(response)
              })
            } else {
              resolve(result)
            }
          this.setState({
            loading: false
          })
          return
        }
        Api.genericInterface(saveParam).then(response => {
          this.setState({loading: false})
          if (!response.status) {
            notification.warning({
              top: 92,
              message: response.message,
              duration: 5
            })
          } else {
            notification.success({
              top: 92,
              message: '创建成功。',
              duration: 5
            })
          }
        })
      }
    }).then(res => {
      if (!res || res === 'drop') return res
      // 处理云端更新结果
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        return false
      } else if (isExist) {
        return 'drop'
      } else {
        return 'create'
      }
    }).then(res => {
      if (!res || res === 'create') return res
      // 删除存储过程
      let _param = {
        func: 'sPC_TableData_InUpDe',
        LText: DelText,
        TypeCharOne: 'proc' // 删除或创建存储过程标志
      }
      _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
      _param.open_key = Utils.encryptOpenKey(_param.secretkey, _param.timestamp)
      return Api.genericInterface(_param)
    }).then(res => {
      if (!res || res === 'create') return res
      // 删除结果处理
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
        return false
      } else {
        return true
      }
    }).then(res => {
      if (!res) return res
      // 新建存储过程
      let _param = {
        func: 'sPC_TableData_InUpDe',
        LText: newLText,
        TypeCharOne: 'proc'
      }
      _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
      _param.open_key = Utils.encryptOpenKey(_param.secretkey, _param.timestamp)
      return Api.genericInterface(_param)
    }).then(res => {
      this.setState({
        loading: false
      })
      if (!res) return res
      // 处理新建结果
      if (!res.status) {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
      } else {
        notification.success({
          top: 92,
          message: '创建成功',
          duration: 2
        })
      }
    })
  }
  render() {
    return (
      <Button
        className="mk-btn mk-purple"
        onClick={this.props.trigger}
        onClick={this.trigger}
        loading={this.state.loading}
      >
        创建存储过程
src/templates/zshare/createfunc/utils.js
New file
@@ -0,0 +1,454 @@
/**
 * @description 创建存储过程类
 */
export default class FuncUtils {
  /**
   * @description 创建页面存储过程
   * @return {String}
   */
  static getTableFunc (config) {
    let form = ''
    let formParam = ''
    let _vars = ['bid', 'pageindex', 'pagesize', 'ordercol', 'ordertype', 'exceltype', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg']
    let _columns = []
    let primaryKey = config.setting.primaryKey || 'ID'
    if (!_vars.includes(primaryKey.toLowerCase())) {
      _vars.push(primaryKey.toLowerCase())
      formParam = `mchr13k@${primaryKey} nvarchar(50)='',`
    }
    if (config.search && config.search.length > 0) {
      let _fields = new Map()
      config.search.forEach(item => {
        if (item.field) {
          let type = ''
          if (item.type.match(/date/ig)) {
            type = 'datetime=null'
          } else {
            type = 'nvarchar(50)=\'\''
          }
          item.field.split(',').forEach(cell => {
            let _f = cell
            if (_fields.has(cell)) {
              _f = _f + '1'
            }
            _fields.set(cell, true)
            if (!_vars.includes(_f.toLowerCase())) {
              _vars.push(_f.toLowerCase())
              formParam = formParam + `mchr13k@${_f} ${type},`
            }
          })
        }
      })
    }
    if (config.columns && config.columns.length > 0) {
      config.columns.forEach(item => {
        if (item.field) {
          _columns.push(`${item.field} as ${item.label}`)
        }
      })
      form = `
        declare @dc table (${_columns.join(',')})
        @tableid ='${config.MenuID}'
      `
    }
    let Ltext = `create proc ${config.func}
    ( /*${config.MenuName}*/
    @appkey nvarchar(50)='',
    @BID nvarchar(50)='',
    @UserName nvarchar(50)='',
    @FullName nvarchar(50)='',${formParam}
    @PageIndex nvarchar(50)='',
    @PageSize nvarchar(50)='',
    @OrderCol nvarchar(50)='',
    @OrderType nvarchar(50)='',
    @exceltype nvarchar(50)='',
    @sEPTMenuNo nvarchar(50)='${config.menuNo}',
    @lang nvarchar(50)='',
    @debug nvarchar(50)='',
    @LoginUID nvarchar(50)='',
    @SessionUid nvarchar(50)='',
    @UserID nvarchar(50),
    @dataM nvarchar(50),
    @ErrorCode nvarchar(50) out,
    @retmsg nvarchar(4000) out
    )
    as
    begin
    declare @BegindateTest datetime,@EnddateTest datetime
    select @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        /*
        select top 10 * from sProcExcep order by id desc
        ${form}
        if 1=2
        begin
          set @ErrorCode='E'
          set @retmsg='在此写报错'
          goto GOTO_RETURN
        end
        insert into sNote (remark,createuserid,CreateUser,CreateStaff)
        select '在此写日志',@UserID,@UserName,@FullName
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /*-- Message text.*/
        @ErrorSeverity, /*-- Severity.*/
        @ErrorState  /*-- State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
  /**
   * @description 创建存储过程
   * @return {String}
   */
  static getfunc (btn) {
    let form = ''
    let formParam = ''
    let _vars = ['bid', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg']
    let columns = btn.columns
    let primaryKey = btn.primaryKey
    if (!_vars.includes(primaryKey.toLowerCase())) {
      _vars.push(primaryKey.toLowerCase())
      let _type = '50'
      if (btn.Ot === 'requiredOnce') { // 多行拼接时,主键设为max
        _type = 'max'
      }
      formParam = `mchr13k@${primaryKey} nvarchar(${_type})='',`
    }
    if (btn.fields && btn.fields.length > 0) {
      let _fields = []
      btn.fields.forEach(item => {
        if (item.field) {
          let type = ''
          if (item.type.match(/date/ig)) {
            type = 'datetime=null'
          } else if (item.type === 'number') {
            type = `decimal(18,${item.decimal})=0`
          } else if (item.type === 'rate') {
            type = `decimal(18,2)=0`
          } else {
            type = 'nvarchar(50)=\'\''
          }
          if (!_vars.includes(item.field.toLowerCase())) {
            _vars.push(item.field.toLowerCase())
            formParam = formParam + `mchr13k@${item.field} ${type},`
          }
          _fields.push(item.field)
        }
      })
      let field1 = _fields.join(',')
      let field2 = _fields.join(',@')
      let field3 = _fields.map(cell => {
        return cell + '=@' + cell
      })
      field2 = field2 ? '@' + field2 : ''
      field3 = field3.join(',')
      form = `
        insert into ${btn.name} (${field1},createuserid) select ${field2},@UserID
        update ${btn.name} set ${field3},modifydate=getdate(),modifyuser=@username,modifyuserid=@UserID
      `
    } else if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') {
      form = `
        update ${btn.name} set ModifyDate=getdate(),ModifyUserID=@UserID where ${primaryKey}=@${primaryKey}
      `
    }
    if (columns) {
      let _col = []
      let _field = []
      columns.forEach(col => {
        if (col.field) {
          if (col.type === 'number') {
            _col.push(col.field + ' decimal(18,2)')
          } else {
            _col.push(col.field + ' nvarchar(50)')
          }
          _field.push(col.field)
        }
      })
      _col = _col.join(',')
      _field = _field.join(',')
      form = form + `
        declare @dc table (${_col})
        insert into @dc (${_field})
        @tableid ='${btn.MenuID}'
      `
    }
    // 打印自定义模板字段提示
    let _printRemark = ''
    if (btn.funcType === 'print') {
      _printRemark = '/* 自定义数据打印模板时,请使用TemplateID字段 */'
    }
    let Ltext = `create proc ${btn.func}
    ( /*${btn.MenuName}  ${btn.label}*/
    @appkey nvarchar(50)='',
    @BID nvarchar(50)='',
    @UserName nvarchar(50)='',
    @FullName nvarchar(50)='',${formParam}
    @sEPTMenuNo nvarchar(50)='${btn.menuNo}',
    @lang nvarchar(50)='',
    @debug nvarchar(50)='',
    @LoginUID nvarchar(50)='',
    @SessionUid nvarchar(50)='',
    @UserID nvarchar(50),
    @ErrorCode nvarchar(50) out,
    @retmsg nvarchar(4000) out
    )
    as
    begin
    declare  @BegindateTest datetime,@EnddateTest datetime
    select  @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        ${_printRemark}
        /*
        select top 10 * from sProcExcep order by id desc
        ${form}
        if 1=2
        begin
          set @ErrorCode='E'
          set @retmsg='在此写报错'
          goto GOTO_RETURN
        end
        insert into sNote (remark,createuserid,CreateUser,CreateStaff)
        select '在此写日志',@UserID,@UserName,@FullName
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /* Message text.*/
        @ErrorSeverity, /* Severity.*/
        @ErrorState  /* State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
  /**
   * @description 创建导入存储过程
   * @return {String}
   */
  static getexcelInfunc (btn) {
    let _verify = btn.verify
    let _uniquesql = ''
    if (_verify.uniques && _verify.uniques.length > 0) {
      _verify.uniques.forEach(unique => {
        if (unique.status === 'false') return
        let _fields = unique.field.split(',')
        let _fields_ = _fields.map(_field => {
          return `a.${_field}=b.${_field}`
        })
        _fields_ = _fields_.join(' and ')
        if (unique.verifyType !== 'physical') {
          _fields_ += ' and b.deleted=0'
        }
        _uniquesql += `
        Set @tbid=''
        Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from @${btn.sheet} ) a group by ${unique.field} having sum(n)>1
        If @tbid!=''
        Begin
          select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 重复'
          goto aaa
        end
        Set @tbid=''
        Select top 1 @tbid=${_fields.join('+\' \'+')} from  @${btn.sheet} a
        Inner join ${btn.sheet} b on ${_fields_}
        If @tbid!=''
        Begin
          select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 与已有数据重复'
          goto aaa
        end
        `
      })
      if (_uniquesql) {
        _uniquesql = `
        Declare @tbid Nvarchar(512)
        ${_uniquesql}`
      }
    }
    let declarefields = []
    let fields = []
    _verify.columns.forEach(col => {
      declarefields.push(`${col.Column} ${col.type}`)
      fields.push(col.Column)
    })
    fields = fields.join(',')
    let _sql = `declare @${btn.sheet} table (${declarefields.join(',')},jskey nvarchar(50),BID nvarchar(50))
      Insert into @${btn.sheet} (${fields},jskey,BID)
      select @LText=dbo.urldecode(dbo.base64decode(@LText))
      ${_uniquesql}
      Insert into ${btn.sheet} (${fields},createuserid,createuser,createstaff,bid)
      Select ${fields},@userid,@username,@fullname,@BID From @${btn.sheet}
      Delete @${btn.sheet}`
    let Ltext = `create proc ${btn.func}
    ( /*${btn.MenuName}  ${btn.label}*/
      @appkey nvarchar(50)='',
      @ID nvarchar(50)='',
      @BID nvarchar(50)='',
      @UserName nvarchar(50)='',
      @FullName nvarchar(50)='',
      @Ltext nvarchar(max)='',
      @sEPTMenuNo nvarchar(50)='${btn.menuNo}',
      @secretkey nvarchar(50)='',
      @timestamp nvarchar(50)='',
      @lang nvarchar(50)='',
      @LoginUID nvarchar(50)='',
      @SessionUid nvarchar(50)='',
      @UserID nvarchar(50),
      @ErrorCode nvarchar(50) out,
      @retmsg nvarchar(4000) out
    )
    as
    begin
    declare @BegindateTest datetime,@EnddateTest datetime
    select @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        /*
        ${_sql}
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /* Message text.*/
        @ErrorSeverity, /* Severity.*/
        @ErrorState  /* State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
}
src/templates/zshare/formconfig.jsx
@@ -2924,7 +2924,7 @@
      key: 'dataSource',
      label: '数据源',
      initVal: card.dataSource || '',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值:@ID@、@BID@。',
      required: true,
      readonly: false
    },
src/templates/zshare/modalform/index.jsx
@@ -416,6 +416,8 @@
          this.record.resourceType = '0'
          _fieldval.resourceType = '0'
        }
      } else if (this.record.type === 'funcvar' && value !== 'funcvar') {
        this.record.readonly = 'false'
      }
      if (this.record.options.length > 0) {
src/utils/utils-datamanage.js
@@ -54,6 +54,11 @@
    if (setting.interType === 'inner') {
      param.func = setting.innerFunc
      if (setting.recordUser === 'true') {
        param.username = sessionStorage.getItem('User_Name') || ''
        param.fullname = sessionStorage.getItem('Full_Name') || ''
      }
    } else {
      if (window.GLOB.mkHS) {
        if (setting.sysInterface === 'true' && window.GLOB.cloudServiceApi) {
@@ -201,16 +206,14 @@
    let arr_field = setting.all_field || setting.arr_field
    if (_dataresource) {
      if (setting.laypage && orderBy) {
        if (setting.custompage) {
          LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} `
      if (setting.custompage) {
        LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} `
      } else if (setting.laypage && orderBy) {
        LText = `/*system_query*/select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows `
        if (setting.sub_field) {
          DateCount = `/*system_query*/select count(1) as total from (select distinct ${setting.primaryKey} from ${_dataresource} ${_search})a`
        } else {
          LText = `/*system_query*/select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows `
          if (setting.sub_field) {
            DateCount = `/*system_query*/select count(1) as total from (select distinct ${setting.primaryKey} from ${_dataresource} ${_search})a`
          } else {
            DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}`
          }
          DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}`
        }
      } else if (orderBy) {
        LText = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
src/utils/utils.js
@@ -33,7 +33,8 @@
  { key: 'TRAN', value: ' mtrnk ' },
  { key: 'goto', value: ' mgtk ' },
  { key: 'set', value: ' mstk ' },
  { key: 'ROLLBACK', value: ' mrlbkk ' }
  { key: 'ROLLBACK', value: ' mrlbkk ' },
  { key: 'drop', value: ' mdrpk ' },
]
export default class Utils {
@@ -921,37 +922,6 @@
  let _topline = btn.range || 0
  let upId = getuuid()
  let _initCustomScript = '' // 初始化脚本
  let _prevCustomScript = '' // 默认sql前执行脚本
  let _backCustomScript = '' // 默认sql后执行脚本
  if (btn.scripts) {
    btn.scripts.forEach(script => {
      if (script.status === 'false') return
      let _sql = script.sql
      if (script.position === 'init') {
        _initCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else if (script.position === 'front') {
        _prevCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else {
        _backCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      }
    })
  }
  // 控制台打印数据
  let conLtext = []
  let cols = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
  for (let i = 0; i < 26; i++) {
    cols.push('A' + cols[i])
@@ -959,7 +929,6 @@
  let _Ltext = data.map((item, lindex) => {
    let vals = []
    let convals = []
    btn.columns.forEach((col, cindex) => {
      if (col.import === 'false') return
@@ -967,7 +936,15 @@
      let _colindex = cols[cindex] || (cindex + 1)
      let _position = (_topline + lindex + 1) + '行 ' + _colindex + '列 '
      if (/^Nvarchar/ig.test(col.type)) {
      if (col.import === 'init') {
        if (/^Nvarchar/ig.test(col.type)) {
          val = ''
        } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
          val = 0
        } else if (col.type === 'date') {
          val = '1949-10-01'
        }
      } else if (/^Nvarchar/ig.test(col.type)) {
        val = val + ''
        if (/'/.test(val)) {
@@ -1021,10 +998,6 @@
      }
      vals.push(`'${val}'`)
      if (lindex < 40) {
        convals.push(`'${val}' as ${col.Column}`)
      }
    })
    let _lineIndex = '0000' + (lindex + 1) + '0'
@@ -1032,26 +1005,60 @@
    vals.push(`'${upId + _lineIndex}'`)
    vals.push(`'${BID}'`)
    if (lindex < 40) {
      convals.push(`'${upId + _lineIndex}' as jskey`)
      convals.push(`'${BID}' as BID`)
      conLtext.push(`Select ${convals.join(',')}`)
    }
    return `Select ${vals.join(',')}`
  })
  let result = []
  for(let i = 0; i < _Ltext.length; i += 20) {
    result.push(_Ltext.slice(i, i + 20))
  }
  let _sql = ''
  let _sqlInsert = ''
  let _sqlBottom = ''
  let sql = ''
  if (item.intertype === 'system') {
    let _initCustomScript = '' // 初始化脚本
    let _prevCustomScript = '' // 默认sql前执行脚本
    let _backCustomScript = '' // 默认sql后执行脚本
    let isDM = sessionStorage.getItem('dataM') === 'true'
    let regs = [
      {reg: new RegExp('(^|\\s)@' + sheet + '(\\s|$)', 'ig'), value: `#${sheet} `},
      {reg: new RegExp('(^|\\s)@' + sheet + '\\(', 'ig'), value: `#${sheet}(`},
      {reg: new RegExp('(^|\\s)@' + sheet + '\\)', 'ig'), value: `#${sheet})`},
      {reg: /@BID@/ig, value: `'${BID}'`},
      {reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`},
      {reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`},
      {reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`},
      {reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`},
      {reg: /@typename@/ig, value: `'admin'`},
      {reg: /\$@/ig, value: isDM ? '/*' : ''},
      {reg: /@\$/ig, value: isDM ? '*/' : ''},
      {reg: /@datam@/ig, value: isDM ? `'Y'` : `''`},
    ]
    btn.scripts && btn.scripts.forEach(script => {
      if (script.status === 'false') return
      let _sql = script.sql
      regs.forEach(item => {
        _sql = _sql.replace(item.reg, item.value)
      })
      if (script.position === 'init') {
        _initCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else if (script.position === 'front') {
        _prevCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else {
        _backCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      }
    })
    let _uniquesql = ''
    if (btn.uniques && btn.uniques.length > 0) {
      btn.uniques.forEach(unique => {
@@ -1069,7 +1076,7 @@
        _uniquesql += `
      /* 重复性验证 */
      Set @tbid=''
      Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from @${sheet} ) a group by ${unique.field} having sum(n)>1
      Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from #${sheet} ) a group by ${unique.field} having sum(n)>1
      
      If @tbid!=''
      Begin
@@ -1078,7 +1085,7 @@
      end
      
      ${unique.verifyType.indexOf('temp') === -1 ? `Set @tbid=''
      Select top 1 @tbid=${_afields.join('+\' \'+')} from  @${sheet} a Inner join ${sheet} b on ${_fields_}
      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${sheet} b on ${_fields_}
      
      If @tbid!=''
      Begin
@@ -1110,88 +1117,51 @@
      _insert = `
      /* 默认sql */
      Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) 
      Select ${fields},@userid@,@username,@fullname,@BID@ From @${sheet}
      Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet}
      `
    }
    _sql = `
    sql = `
      /* 系统生成 */
      declare @${sheet} table (${declarefields.join(',')},jskey nvarchar(50),BID nvarchar(50) )
      create table #${sheet} (${declarefields.join(',')},jskey nvarchar(50),BID nvarchar(50) )
      Declare @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),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
      
      Select  @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
      ${_initCustomScript}
      `
    _sqlInsert = `Insert into @${sheet} (${fields},jskey,BID)`
    _sqlBottom = `
      /* 默认sql */
      delete tmp_excel_in where upid=@upid@
      
      delete tmp_excel_in where datediff(day,createdate,getdate())>15
      Insert into #${sheet} (${fields},jskey,BID)
      /* excel数据*/
      ${_Ltext.join(' Union all ')}
      ${_uniquesql}
      ${_prevCustomScript}
      ${_insert}
      ${_backCustomScript}
      Delete @${sheet}
      drop table #${sheet}
      
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    _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'`)
    _sqlBottom = _sqlBottom.replace(/@ID@/ig, `'${primaryId || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@BID@/ig, `'${BID}'`)
    _sqlBottom = _sqlBottom.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@typename@/ig, `'admin'`)
    if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
      _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
      _sqlBottom = _sqlBottom.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
    } else {
      _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
      _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
    }
    sql = sql.replace(/\n\s{6}/ig, '\n')
    if (window.GLOB.debugger === true) {
      let fsql = `
      ${_sql}
      ${_sqlInsert}
      /* excel数据(前40条) */
      ${conLtext.join(' Union all ')}
      ${_sqlBottom}
      `
      fsql = fsql.replace(/\n\s{8}/ig, '\n')
      console.info(fsql)
      console.info(sql)
    }
  } else { // s_sDataDictb_excelIn 云端密钥验证参数
    _sql = `
      /* 系统生成 */
      declare @${sheet} table (jskey nvarchar(50))
      Declare @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),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
      Select  @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
      `
  } else {
    for(let i = 0; i < _Ltext.length; i += 20) {
      result.push(_Ltext.slice(i, i + 20))
    }
  }
  return {
    sql: _sql,
    sql: sql,
    lines: result.map((list, index) => {
      return {
        Ltext: window.btoa(window.encodeURIComponent(list.join(' Union all '))),
        Sort: (index + 1) * 10
      }
    }),
    insert: _sqlInsert,
    bottom: _sqlBottom,
    errors: errors.join('; ')
  }
}
@@ -1227,44 +1197,12 @@
  
  database = database ? (database[0] || '') : ''
  let _initCustomScript = '' // 初始化脚本
  let _prevCustomScript = '' // 默认sql前执行脚本
  let _backCustomScript = '' // 默认sql后执行脚本
  if (btn.scripts && btn.intertype === 'system') {
    btn.scripts.forEach(script => {
      if (script.status === 'false') return
      if (script.position === 'init') {
        _initCustomScript += `
      /* 自定义脚本 */
      ${script.sql}
      `
      } else if (script.position === 'front') {
        _prevCustomScript += `
      /* 自定义脚本 */
      ${script.sql}
      `
      } else {
        _backCustomScript += `
      /* 自定义脚本 */
      ${script.sql}
      `
      }
    })
  }
  // 控制台打印数据
  let conLtext = []
  let _Ltext = data.map(item => {
    let vals = []
    let convals = []
    columns.forEach(col => {
      let val = item[col.field]
      vals.push(`'${val}'`)
      convals.push(`'${val}' as ${col.field}`)
    })
    let key = item.$$uuid
@@ -1274,24 +1212,59 @@
    vals.push(`'${type}'`)
    vals.push(`'${BID}'`)
    convals.push(`'${key}' as jskey`)
    convals.push(`'${type}' as data_type`)
    convals.push(`'${BID}' as BID`)
    conLtext.push(`Select ${convals.join(',')}`)
    return `Select ${vals.join(',')}`
  })
  let result = []
  for(let i = 0; i < _Ltext.length; i += 20) {
    result.push(_Ltext.slice(i, i + 20))
  }
  let _sql = ''
  let _sqlInsert = ''
  let _sqlBottom = ''
  let sql = ''
  if (btn.intertype === 'system') {
    let _initCustomScript = '' // 初始化脚本
    let _prevCustomScript = '' // 默认sql前执行脚本
    let _backCustomScript = '' // 默认sql后执行脚本
    let isDM = sessionStorage.getItem('dataM') === 'true'
    let regs = [
      {reg: new RegExp('(^|\\s)@' + sheet + '(\\s|$)', 'ig'), value: `#${sheet} `},
      {reg: new RegExp('(^|\\s)@' + sheet + '\\(', 'ig'), value: `#${sheet}(`},
      {reg: new RegExp('(^|\\s)@' + sheet + '\\)', 'ig'), value: `#${sheet})`},
      {reg: /@BID@/ig, value: `'${BID}'`},
      {reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`},
      {reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`},
      {reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`},
      {reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`},
      {reg: /@typename@/ig, value: `'admin'`},
      {reg: /\$@/ig, value: isDM ? '/*' : ''},
      {reg: /@\$/ig, value: isDM ? '*/' : ''},
      {reg: /@datam@/ig, value: isDM ? `'Y'` : `''`},
    ]
    btn.scripts && btn.scripts.forEach(script => {
      if (script.status === 'false') return
      let _sql = script.sql
      regs.forEach(item => {
        _sql = _sql.replace(item.reg, item.value)
      })
      if (script.position === 'init') {
        _initCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else if (script.position === 'front') {
        _prevCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      } else {
        _backCustomScript += `
      /* 自定义脚本 */
      ${_sql}
      `
      }
    })
    let _uniquesql = ''
    if (btn.uniques && btn.uniques.length > 0) {
      btn.uniques.forEach(unique => {
@@ -1309,7 +1282,7 @@
        _uniquesql += `
      /* 重复性验证 */
      Set @tbid=''
      Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from @${sheet} ) a group by ${unique.field} having sum(n)>1
      Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from #${sheet} ) a group by ${unique.field} having sum(n)>1
      
      If @tbid!=''
      Begin
@@ -1318,7 +1291,7 @@
      end
      
      ${unique.verifyType.indexOf('temp') === -1 ? `Set @tbid=''
      Select top 1 @tbid=${_afields.join('+\' \'+')} from  @${sheet} a Inner join ${sheet} b on ${_fields_}
      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${sheet} b on ${_fields_}
      
      If @tbid!=''
      Begin
@@ -1347,86 +1320,50 @@
      _insert = `
      /* 默认sql */
      Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) 
      Select ${fields},@userid@,@username,@fullname,@BID@ From @${sheet}
      Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet}
      `
    }
    _sql = `
    sql = `
      /* 系统生成 */
      declare @${sheet} table (${declarefields.join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50) )
      create table #${sheet} (${declarefields.join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50) )
      Declare @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),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
      
      Select  @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
      ${_initCustomScript}
      `
    _sqlInsert = `Insert into @${sheet} (${fields},jskey,data_type,BID)`
    _sqlBottom = `
      /* 默认sql */
      delete tmp_excel_in where upid=@upid@
      delete tmp_excel_in where datediff(day,createdate,getdate())>15
      Insert into #${sheet} (${fields},jskey,data_type,BID)
      /* excel数据*/
      ${_Ltext.join(' Union all ')}
      ${_uniquesql}
      ${_prevCustomScript}
      ${_insert}
      ${_backCustomScript}
      Delete @${sheet}
      drop table #${sheet}
      
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    _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'`)
    _sqlBottom = _sqlBottom.replace(/@BID@/ig, `'${BID}'`)
    _sqlBottom = _sqlBottom.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _sqlBottom = _sqlBottom.replace(/@typename@/ig, `'admin'`)
    if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
      _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
      _sqlBottom = _sqlBottom.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
    } else {
      _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
      _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
    }
    sql = sql.replace(/\n\s{6}/ig, '\n')
    if (window.GLOB.debugger === true) {
      let fsql = `
      ${_sql}
      ${_sqlInsert}
      /* table数据 */
      ${conLtext.join(' Union all \n')}
      ${_sqlBottom}
      `
      fsql = fsql.replace(/\n\s{8}/ig, '\n')
      console.info(fsql)
      console.info(sql)
    }
  } else { // s_sDataDictb_excelIn 云端密钥验证参数
    _sql = `
      /* 系统生成 */
      declare @${sheet} table (jskey nvarchar(50))
      Declare @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),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@tbid Nvarchar(512)
      Select  @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}'
      `
  } else {
    for(let i = 0; i < _Ltext.length; i += 20) {
      result.push(_Ltext.slice(i, i + 20))
    }
  }
  return {
    sql: _sql,
    sql: sql,
    lines: result.map((list, index) => {
      return {
        Ltext: window.btoa(window.encodeURIComponent(list.join(' Union all '))),
        Sort: (index + 1) * 10
      }
    }),
    insert: _sqlInsert,
    bottom: _sqlBottom
    })
  }
}
@@ -2318,471 +2255,5 @@
      })
      cursor.continue()
    }
  }
}
/**
 * @description 创建存储过程类
 */
export class FuncUtils {
  /**
   * @description 删除存储过程sql
   * @return {String} name 存储过程名称
   */
  static dropfunc (name) {
    return `IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('${name}') AND type in (N'P', N'PC'))  mdrpk PROCEDURE ${name}`
  }
  /**
   * @description 创建页面存储过程
   * @return {String}
   */
  static getTableFunc (func = 'func', menu, config) {
    let form = ''
    let formParam = ''
    let _vars = ['bid', 'pageindex', 'pagesize', 'ordercol', 'ordertype', 'exceltype', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg']
    let _columns = []
    let primaryKey = config.setting.primaryKey || 'ID'
    if (!_vars.includes(primaryKey.toLowerCase())) {
      _vars.push(primaryKey.toLowerCase())
      formParam = `mchr13k@${primaryKey} nvarchar(50)='',`
    }
    if (config.search && config.search.length > 0) {
      let _fields = new Map()
      config.search.forEach(item => {
        if (item.field) {
          let type = ''
          if (item.type.match(/date/ig)) {
            type = 'datetime=null'
          } else {
            type = 'nvarchar(50)=\'\''
          }
          item.field.split(',').forEach(cell => {
            let _f = cell
            if (_fields.has(cell)) {
              _f = _f + '1'
            }
            _fields.set(cell, true)
            if (!_vars.includes(_f.toLowerCase())) {
              _vars.push(_f.toLowerCase())
              formParam = formParam + `mchr13k@${_f} ${type},`
            }
          })
        }
      })
    }
    if (config.columns && config.columns.length > 0) {
      config.columns.forEach(item => {
        if (item.field) {
          _columns.push(`${item.field} as ${item.label}`)
        }
      })
      form = `
        declare @dc table (${_columns.join(',')})
        @tableid ='${menu.MenuID}'
      `
    }
    let Ltext = `create proc ${func}
    ( /*${menu.MenuName}*/
    @appkey nvarchar(50)='',
    @BID nvarchar(50)='',${formParam}
    @PageIndex nvarchar(50)='',
    @PageSize nvarchar(50)='',
    @OrderCol nvarchar(50)='',
    @OrderType nvarchar(50)='',
    @exceltype nvarchar(50)='',
    @sEPTMenuNo nvarchar(50)='${menu.MenuNo}',
    @lang nvarchar(50)='',
    @debug nvarchar(50)='',
    @LoginUID nvarchar(50)='',
    @SessionUid nvarchar(50)='',
    @UserID nvarchar(50),
    @dataM nvarchar(50),
    @ErrorCode nvarchar(50) out,
    @retmsg nvarchar(4000) out
    )
    as
    begin
    declare  @BegindateTest datetime,@EnddateTest datetime
    select  @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        /*
        select top 10 * from sProcExcep order by id desc
        declare @UserName  nvarchar(50),@FullName nvarchar(50)
        select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID
        ${form}
        if 1=2
        begin
          set @ErrorCode='E'
          set @retmsg='在此写报错'
          goto GOTO_RETURN
        end
        insert into sNote (remark,createuserid,CreateUser,CreateStaff)
        select '在此写日志',@UserID,@UserName,@FullName
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /*-- Message text.*/
        @ErrorSeverity, /*-- Severity.*/
        @ErrorState  /*-- State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
  /**
   * @description 创建存储过程
   * @return {String}
   */
  static getfunc (param, btn, menu, config) {
    let form = ''
    let formParam = ''
    let _vars = ['bid', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg']
    let columns = config.columns
    let primaryKey = config.setting.primaryKey || 'ID'
    if (!_vars.includes(primaryKey.toLowerCase())) {
      _vars.push(primaryKey.toLowerCase())
      let _type = '50'
      if (btn.Ot === 'requiredOnce') { // 多行拼接时,主键设为max
        _type = 'max'
      }
      formParam = `mchr13k@${primaryKey} nvarchar(${_type})='',`
    }
    if (param.fields && param.fields.length > 0) {
      let _fields = []
      param.fields.forEach(item => {
        if (item.field) {
          let type = ''
          if (item.type.match(/date/ig)) {
            type = 'datetime=null'
          } else if (item.type === 'number') {
            type = `decimal(18,${item.decimal})=0`
          } else if (item.type === 'rate') {
            type = `decimal(18,2)=0`
          } else {
            type = 'nvarchar(50)=\'\''
          }
          if (!_vars.includes(item.field.toLowerCase())) {
            _vars.push(item.field.toLowerCase())
            formParam = formParam + `mchr13k@${item.field} ${type},`
          }
          _fields.push(item.field)
        }
      })
      let field1 = _fields.join(',')
      let field2 = _fields.join(',@')
      let field3 = _fields.map(cell => {
        return cell + '=@' + cell
      })
      field2 = field2 ? '@' + field2 : ''
      field3 = field3.join(',')
      form = `
        insert into ${param.name} (${field1},createuserid) select ${field2},@UserID
        update ${param.name} set ${field3},modifydate=getdate(),modifyuser=@username,modifyuserid=@UserID
      `
    } else if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') {
      form = `
        update ${param.name} set ModifyDate=getdate(),ModifyUserID=@UserID where ${primaryKey}=@${primaryKey}
      `
    }
    if (columns) {
      let _col = []
      let _field = []
      columns.forEach(col => {
        if (col.field) {
          if (col.type === 'number') {
            _col.push(col.field + ' decimal(18,2)')
          } else {
            _col.push(col.field + ' nvarchar(50)')
          }
          _field.push(col.field)
        }
      })
      _col = _col.join(',')
      _field = _field.join(',')
      form = form + `
        declare @dc table (${_col})
        insert into @dc (${_field})
        @tableid ='${menu.MenuID}'
      `
    }
    // 打印自定义模板字段提示
    let _printRemark = ''
    if (btn.funcType === 'print') {
      _printRemark = '/* 自定义数据打印模板时,请使用TemplateID字段 */'
    }
    let Ltext = `create proc ${param.funcName}
    ( /*${menu.MenuName}  ${btn.label}*/
    @appkey nvarchar(50)='',
    @BID nvarchar(50)='',${formParam}
    @sEPTMenuNo nvarchar(50)='${param.menuNo}',
    @lang nvarchar(50)='',
    @debug nvarchar(50)='',
    @LoginUID nvarchar(50)='',
    @SessionUid nvarchar(50)='',
    @UserID nvarchar(50),
    @ErrorCode nvarchar(50) out,
    @retmsg nvarchar(4000) out
    )
    as
    begin
    declare  @BegindateTest datetime,@EnddateTest datetime
    select  @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        ${_printRemark}
        /*
        select top 10 * from sProcExcep order by id desc
        declare @UserName  nvarchar(50),@FullName nvarchar(50)
        select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID
        ${form}
        if 1=2
        begin
          set @ErrorCode='E'
          set @retmsg='在此写报错'
          goto GOTO_RETURN
        end
        insert into sNote (remark,createuserid,CreateUser,CreateStaff)
        select '在此写日志',@UserID,@UserName,@FullName
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /* Message text.*/
        @ErrorSeverity, /* Severity.*/
        @ErrorState  /* State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
  /**
   * @description 创建导入存储过程
   * @return {String}
   */
  static getexcelInfunc (param, btn, menu) {
    let _verify = btn.verify
    let _uniquesql = ''
    if (_verify.uniques && _verify.uniques.length > 0) {
      _verify.uniques.forEach(unique => {
        if (unique.status === 'false') return
        let _fields = unique.field.split(',')
        let _fields_ = _fields.map(_field => {
          return `a.${_field}=b.${_field}`
        })
        _fields_ = _fields_.join(' and ')
        if (unique.verifyType !== 'physical') {
          _fields_ += ' and b.deleted=0'
        }
        _uniquesql += `
        Set @tbid=''
        Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from @${btn.sheet} ) a group by ${unique.field} having sum(n)>1
        If @tbid!=''
        Begin
          select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 重复'
          goto aaa
        end
        Set @tbid=''
        Select top 1 @tbid=${_fields.join('+\' \'+')} from  @${btn.sheet} a
        Inner join ${btn.sheet} b on ${_fields_}
        If @tbid!=''
        Begin
          select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 与已有数据重复'
          goto aaa
        end
        `
      })
      if (_uniquesql) {
        _uniquesql = `
        Declare @tbid Nvarchar(512)
        ${_uniquesql}`
      }
    }
    let declarefields = []
    let fields = []
    _verify.columns.forEach(col => {
      declarefields.push(`${col.Column} ${col.type}`)
      fields.push(col.Column)
    })
    fields = fields.join(',')
    let _sql = `declare @${btn.sheet} table (${declarefields.join(',')},jskey nvarchar(50))
      Declare @UserName nvarchar(50),@FullName nvarchar(50)
      select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID
      Insert into @${btn.sheet} (${fields},jskey)
      exec s_KeyWords_Replace
      @LText=@LText, @BID=@BID,@LoginUID=@LoginUID,@SessionUid=@SessionUid,@UserID=@UserID,@ID=@ID
      ${_uniquesql}
      Insert into ${btn.sheet} (${fields},createuserid,createuser,createstaff,bid)
      Select ${fields},@userid,@username,@fullname,@BID From @${btn.sheet}
      Delete @${btn.sheet}`
    let Ltext = `create proc ${param.funcName}
    ( /*${menu.MenuName}  ${btn.label}*/
      @appkey nvarchar(50)='',
      @ID nvarchar(50)='',
      @BID nvarchar(50)='',
      @Ltext nvarchar(max)='',
      @sEPTMenuNo nvarchar(50)='${param.menuNo}',
      @secretkey nvarchar(50)='',
      @timestamp nvarchar(50)='',
      @lang nvarchar(50)='',
      @LoginUID nvarchar(50)='',
      @SessionUid nvarchar(50)='',
      @UserID nvarchar(50),
      @ErrorCode nvarchar(50) out,
      @retmsg nvarchar(4000) out
    )
    as
    begin
    declare @BegindateTest datetime,@EnddateTest datetime
    select @BegindateTest=getdate()
    set @ErrorCode=''
    set @retmsg=''
    BEGIN TRY
      /*事务操作*/
      BEGIN TRAN
        /*具体业务操作*/
        /*
        ${_sql}
        */
      COMMIT TRAN
      SET NOCOUNT ON
      RETURN
    END TRY
    BEGIN CATCH
      /*错误处理*/
      ROLLBACK TRAN
      DECLARE @ErrorMessage NVARCHAR(4000);
      DECLARE @ErrorSeverity INT;
      DECLARE @ErrorState INT;
      /*把自定义的友好的错误信息提示加上*/
      set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50))
      SET @retmsg=ERROR_MESSAGE();
      SELECT @ErrorMessage=ERROR_MESSAGE(),
        @ErrorSeverity=ERROR_SEVERITY(),
        @ErrorState=ERROR_STATE();
      RAISERROR(@ErrorMessage, /* Message text.*/
        @ErrorSeverity, /* Severity.*/
        @ErrorState  /* State.*/
      );
    END CATCH
    GOTO_RETURN:
      ROLLBACK TRAN
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
}
src/views/billprint/index.jsx
@@ -582,6 +582,11 @@
  resetElement = (cell) => {
    cell.style = cell.style || {}
    if (cell.style.display === 'inline-block') {
      cell.style.verticalAlign = 'top'
    }
    if (['text', 'number', 'formula'].includes(cell.eleType)) {
      cell.innerHeight = cell.innerHeight || 'auto'
      cell.alignItems = cell.height > 1 ? cell.alignItems : ''
src/views/design/index.jsx
@@ -15,10 +15,16 @@
  state = {
    editLevel: false,
    mainMenu: null,
    unvalid: !sessionStorage.getItem('UserID'),
    menuTree: []
  }
  componentDidMount() {
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
      return
    }
    if (sessionStorage.getItem('isEditState') === 'true') {
      sessionStorage.removeItem('isEditState')
      this.props.history.replace('/main')
@@ -45,7 +51,9 @@
  }
  
  render () {
    const { editLevel, menuTree, mainMenu } = this.state
    const { editLevel, menuTree, mainMenu, unvalid } = this.state
    if (unvalid) return null
    return (
      <div className={'mk-main-view ' + (window.GLOB.systemType || '')}>
src/views/systemfunc/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import { ConfigProvider } from 'antd'
import { withRouter } from 'react-router-dom'
import zhCN from 'antd/es/locale/zh_CN'
import asyncComponent from '@/utils/asyncComponent'
@@ -11,25 +12,29 @@
const Tabview = asyncComponent(() => import('@/components/tabview'))
class Design extends Component {
class MkHS extends Component {
  UNSAFE_componentWillMount() {
    sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id'))
    sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM'))
    sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName'))
    sessionStorage.setItem('Full_Name', sessionStorage.getItem('CloudFullName'))
    document.body.className = 'mk-blue-black'
    window.GLOB.dataFormat = false // 去除水印
    window.GLOB.mkHS = true
    // HS下不可开启断点调试
    window.GLOB.breakpoint = false
    sessionStorage.removeItem('breakpoint')
    Object.defineProperty(window, 'debugger', {
      writable: false,
      value: false
    })
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
    } else {
      sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id'))
      sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM'))
      sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName'))
      sessionStorage.setItem('Full_Name', sessionStorage.getItem('CloudFullName'))
      document.body.className = 'mk-blue-black'
      window.GLOB.dataFormat = false // 去除水印
      window.GLOB.mkHS = true
      // HS下不可开启断点调试
      window.GLOB.breakpoint = false
      sessionStorage.removeItem('breakpoint')
      Object.defineProperty(window, 'debugger', {
        writable: false,
        value: false
      })
    }
  }
  componentDidMount () {
@@ -57,4 +62,4 @@
  }
}
export default Design
export default withRouter(MkHS)
src/views/systemproc/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import { ConfigProvider } from 'antd'
import { withRouter } from 'react-router-dom'
import zhCN from 'antd/es/locale/zh_CN'
import Header from '../systemfunc/header'
@@ -7,6 +8,12 @@
import './index.scss'
class SysProc extends Component {
  componentDidMount() {
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
    }
  }
  render () {
    const { params } = this.props.match
    let func = params && params.func ? params.func : ''
@@ -22,4 +29,4 @@
  }
}
export default SysProc
export default withRouter(SysProc)
src/views/systemproc/proc/index.jsx
@@ -29,7 +29,7 @@
    
    if (sessionStorage.getItem('permFuncField')) {
      this.setState({permFuncs: JSON.parse(sessionStorage.getItem('permFuncField'))})
    } else {
    } else if (sessionStorage.getItem('UserID')) {
      Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
        if (res.status) {
          let _permFuncs = []
@@ -58,7 +58,7 @@
      })
    }
    if (this.props.func) {
    if (this.props.func && sessionStorage.getItem('UserID')) {
      setTimeout(() => {
        this.search(this.props.func)
      }, 500)