king
2024-06-11 2015e978c64c2517d273b9d76d4134a1f623d389
2024-06-11
5个文件已修改
102 ■■■■ 已修改文件
src/menu/components/form/simple-form/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx
@@ -340,6 +340,8 @@
    card.subcards[0].fields = card.subcards[0].fields.filter(item => !item.focus)
    this.setState({card, visible: false, editform: null})
    this.updateComponent(card)
  }
  /**
src/menu/datasource/verifycard/index.jsx
@@ -4,7 +4,6 @@
import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button, Input } from 'antd'
import { StopOutlined, CheckCircleOutlined, TableOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons'
import moment from 'moment'
import md5 from 'md5'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -683,8 +682,6 @@
      let r = SettingUtils.getDebugSql(setting, _scripts, _columns, searches, config.subtype, config.hasExtend)
      let _debugId = md5(r.sql)
      if (r.custompage && setting.laypage === 'true' && _columns.findIndex(col => col.field === 'mk_total') === -1) {
        if (config.subtype !== 'basetable') {
          Modal.warning({
@@ -704,7 +701,7 @@
        }
      }
      if (debugId === _debugId) {
      if (debugId === r.debugId) {
        resolve()
        return
      }
@@ -719,7 +716,7 @@
      Api.sDebug(r.sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          this.setState({debugId: _debugId}, () => {
          this.setState({debugId: r.debugId}, () => {
            resolve()
          })
        } else {
src/menu/datasource/verifycard/utils.jsx
@@ -1,4 +1,5 @@
import md5 from 'md5'
import { getSearchRegs, joinMainSearchkey } from '@/utils/utils-custom.js'
export default class SettingUtils {
@@ -49,21 +50,10 @@
      })
    }
    let getuuid = () => {
      let uuid = []
      let timestamp = new Date().getTime()
      let _options = '0123456789abcdefghigklmnopqrstuv'
      for (let i = 0; i < 19; i++) {
        uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
      }
      uuid = timestamp + uuid.join('')
      return uuid
    }
    let regs = [
      {reg: /@time_id@/ig, value: `'${getuuid()}'`},
      {reg: /@BID@/ig, value: `'${getuuid()}'`},
      {reg: /@upid@/ig, value: `'${getuuid()}'`},
      // {reg: /@time_id@/ig, value: `'${getuuid()}'`}, // 计算md5后替换
      // {reg: /@BID@/ig, value: `'${getuuid()}'`},
      // {reg: /@upid@/ig, value: `'${getuuid()}'`},
      {reg: /@typename@/ig, value: `'debug'`},
      {reg: /@datam@/ig, value: `''`},
      {reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID')}'`},
@@ -77,7 +67,7 @@
    ]
    if (window.GLOB.process && type !== 'invoice') {
      regs.push({reg: /@works_flow_code@/ig, value: `'${getuuid()}'`})
      regs.push({reg: /@works_flow_code@/ig, value: `'mk_flow_code'`})
    }
    if (hasExtend) {
@@ -183,6 +173,29 @@
        ${_dataresource}`
    }
    let debugId = md5(sql + window.GLOB.appkey)
    let getuuid = () => {
      let uuid = []
      let timestamp = new Date().getTime()
      let _options = '0123456789abcdefghigklmnopqrstuv'
      for (let i = 0; i < 19; i++) {
        uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
      }
      uuid = timestamp + uuid.join('')
      return uuid
    }
    let _regs = [
      {reg: /@time_id@/ig, value: `'${getuuid()}'`},
      {reg: /@BID@/ig, value: `'${getuuid()}'`},
      {reg: /@upid@/ig, value: `'${getuuid()}'`},
    ]
    _regs.forEach(item => {
      sql = sql.replace(item.reg, item.value)
    })
    let errors = []
    if (/@[0-9a-zA-Z_]+@/ig.test(sql)) {
@@ -215,8 +228,6 @@
      })
      arr.forEach(item => {
        if (/@time_id@/ig.test(item)) return
        let reg = new RegExp(item, 'i')
        if (reg.test(_dataresource)) {
          errors.push(`数据源中存在未替换值${item}`)
@@ -233,6 +244,6 @@
      })
    }
    return { error, sql, errors: errors.join(';'), custompage }
    return { error, sql, errors: errors.join(';'), custompage, debugId }
  }
}
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2273,6 +2273,17 @@
    }
    let sign = ''
    let focusField = ''
    if (/@focus:[a-z0-9_]+@/i.test(res.message)) {
      let val = res.message.match(/@focus:[a-z0-9_]+@/i)
      res.message = res.message.replace(/@focus:[a-z0-9_]+@/i, '')
      focusField = val ? val[0].replace(/@focus:|@/ig, '') : ''
      if (!res.message) {
        res.ErrCode = '-1'
      }
    }
    if (/^@speak@/i.test(res.message)) {
      res.message = res.message.replace(/^@speak@/i, '')
      let val = res.message.match(/<<.*>>/)
@@ -2288,7 +2299,8 @@
      if (!res.message) {
        res.ErrCode = '-1'
      }
    } else if (/@close_tab@|@close_popup@|@goback@|@no_target_menu@/i.test(res.message)) {
    }
    if (/@close_tab@|@close_popup@|@goback@|@no_target_menu@/i.test(res.message)) {
      sign = res.message.match(/@close_tab@|@close_popup@|@goback@|@no_target_menu@/i)[0].toLowerCase()
      res.message = res.message.replace(/@close_tab@|@close_popup@|@goback@|@no_target_menu@/i, '')
    }
@@ -2321,7 +2333,7 @@
      Modal.success({
        title: msg,
        onOk: () => {
          this.successContinue(sign, id, res)
          this.successContinue(sign, id, res, focusField)
        }
      })
      return
@@ -2329,13 +2341,17 @@
    }
    this.successContinue(sign, id, res)
    this.successContinue(sign, id, res, focusField)
  }
  successContinue = (sign, id, res) => {
  successContinue = (sign, id, res, focusField) => {
    const { btn } = this.props
    const { btnconfig } = this.state
    if (focusField) {
      MKEmitter.emit('resetFocus', btn.uuid, focusField)
    }
    this.setState({
      loadingNumber: '',
      loadingTotal: '',
src/tabviews/zshare/mutilform/index.jsx
@@ -748,6 +748,7 @@
    if (action.subButton && action.subButton.resetForms) {
      MKEmitter.addListener('resetForms', this.resetForms)
    }
    MKEmitter.addListener('resetFocus', this.resetFocus)
  }
  componentWillUnmount () {
@@ -755,6 +756,27 @@
      return
    }
    MKEmitter.removeListener('resetForms', this.resetForms)
    MKEmitter.removeListener('resetFocus', this.resetFocus)
  }
  resetFocus = (id, field) => {
    const { action } = this.props
    if (id !== action.uuid) return
    let focusId = ''
    this.state.formlist.forEach(item => {
      if (item.field === field) {
        focusId = item.uuid
      }
    })
    if (!focusId) return
    setTimeout(() => {
      MKEmitter.emit('mkFC', 'focus', focusId)
    }, 20)
  }
  resetForms = (id, data) => {