king
2024-01-15 9d3c77a83bc4e7febbfb8fd05de2f90100c5af6c
2024-01-15
4个文件已修改
90 ■■■■ 已修改文件
src/menu/components/form/formaction/formconfig.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/simple-form/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/formconfig.jsx
@@ -127,10 +127,17 @@
  fields.forEach(item => {
    if (item.type !== 'text' && item.type !== 'number') return
    resets.push({
      value: item.field,
      text: item.label
    })
    if (item.label !== item.field) {
      resets.push({
        value: item.field,
        text: item.label + ' (' + item.field + ')'
      })
    } else {
      resets.push({
        value: item.field,
        text: item.label
      })
    }
  })
  return [
src/tabviews/custom/components/form/simple-form/index.jsx
@@ -70,6 +70,10 @@
    let _group = _config.subcards[0]
    if (_config.wrap.refocus) {
      _group.setting.refocus = _config.wrap.refocus
    }
    if (_group.subButton.enable === 'false' && (!_group.closeButton || _group.closeButton.enable !== 'true') && (!_group.resetButton || _group.resetButton.enable !== 'true')) {
      _group.subButton.style.display = 'none'
      _group.$button = 'no-button'
@@ -213,15 +217,27 @@
  /**
   * @description 按钮执行完成后页面刷新
   * @param {*} menuId     // 菜单Id
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn, id) => {
  refreshByButtonResult = (menuId, position, btn, id, lines, res) => {
    const { config, group, BID } = this.state
    if (config.uuid !== menuId) return
    if (position === 'resetData') {
      let _data = fromJS(this.state.data || {}).toJS()
      Object.keys(_data).forEach(key => {
        let _key = key.toLowerCase()
        if (typeof(res[_key]) !== 'undefined') {
          _data[key] = res[_key]
        }
      })
      this.setState({
        data: _data
      })
      return
    }
    if (position === 'grid' && config.wrap.refocus) {
      let _group = fromJS(group).toJS()
      _group.setting.focus = config.wrap.refocus
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2226,7 +2226,19 @@
    const { autoMatic } = this.state
    if (btn.resetForms) {
      MKEmitter.emit('resetForms', btn.uuid)
      let data = {}
      Object.keys(res).forEach(key => {
        data[key.toLowerCase()] = res[key]
      })
      delete data.errcode
      delete data.errmesg
      delete data.message
      delete data.status
      MKEmitter.emit('resetForms', btn.uuid, data)
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'resetData', btn, null, null, data)
    }
    if (this.preCallback) {
src/tabviews/zshare/mutilform/index.jsx
@@ -47,7 +47,8 @@
    send_type: '',
    timestamp: '',
    n_id: '',
    focusId: ''
    focusId: '',
    reFocusId: ''
  }
  record = {}
@@ -680,14 +681,24 @@
      focusItem = fieldMap.get(action.setting.focus)
    }
    this.setState({ formlist, ID, focusId: focusItem ? focusItem.uuid : '' }, () => {
    let reFocusItem = null
    if (action.setting.refocus && fieldMap.has(action.setting.refocus)) {
      reFocusItem = fieldMap.get(action.setting.refocus)
    }
    this.setState({
      formlist,
      ID,
      focusId: focusItem ? focusItem.uuid : '',
      reFocusId: reFocusItem ? reFocusItem.uuid : ''
    }, () => {
      if (unload) return
      
      if (focusItem) {
        if (focusItem.type === 'text' || focusItem.type === 'number') {
          setTimeout(() => {
            MKEmitter.emit('mkFC', 'focus', focusItem.uuid)
          }, 50)
          }, 20)
        } else {
          setTimeout(() => {
            MKEmitter.emit('mkFC', 'focus', focusItem.uuid)
@@ -722,9 +733,9 @@
    MKEmitter.removeListener('resetForms', this.resetForms)
  }
  resetForms = (id) => {
  resetForms = (id, data) => {
    const { action } = this.props
    const { focusId } = this.state
    const { focusId, reFocusId } = this.state
    if (id !== action.uuid) return
@@ -735,8 +746,14 @@
      if (item.type !== 'text' && item.type !== 'number') return item
      if (resetForms.includes(item.field)) {
        item.initval = item.orgval
        this.record[item.field] = item.orgval
        let key = item.field.toLowerCase()
        if (typeof(data[key]) !== 'undefined') {
          item.initval = data[key]
          this.record[item.field] = data[key]
        } else {
          item.initval = item.orgval
          this.record[item.field] = item.orgval
        }
      }
      return item
@@ -760,10 +777,10 @@
      })
    })
    if (focusId || this.submitId) {
    if (reFocusId || focusId || this.submitId) {
      setTimeout(() => {
        MKEmitter.emit('mkFC', 'focus', this.submitId || focusId)
      }, 50)
        MKEmitter.emit('mkFC', 'focus', this.submitId || reFocusId || focusId)
      }, 20)
    }
  }