king
2023-10-04 6c1db2f9b6888796731bcee0966ec3f374574791
2023-10-04
5个文件已修改
75 ■■■■ 已修改文件
src/tabviews/zshare/actionList/normalbutton/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2882,7 +2882,19 @@
        _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
        if (item.interception !== 'false') {                    // 去除首尾空格
          _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
          if (item.interception === 'func') {
            try {
              // eslint-disable-next-line
              let func = new Function('value', 'data', item.func)
              _item.value = func(_item.value, _data)
            } catch (e) {
              if (window.GLOB.debugger === true) {
                console.warn(e)
              }
            }
          } else {
            _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
          }
        }
        if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换
          _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || ''))
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2148,7 +2148,19 @@
        _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
        if (item.interception !== 'false') {                    // 去除首尾空格
          _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
          if (item.interception === 'func') {
            try {
              // eslint-disable-next-line
              let func = new Function('value', 'data', item.func)
              _item.value = func(_item.value, _data)
            } catch (e) {
              if (window.GLOB.debugger === true) {
                console.warn(e)
              }
            }
          } else {
            _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
          }
        }
        if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换
          _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || ''))
src/tabviews/zshare/mutilform/index.jsx
@@ -1218,7 +1218,19 @@
            _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
    
            if (item.interception !== 'false') {                    // 去除首尾空格
              _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
              if (item.interception === 'func') {
                try {
                  // eslint-disable-next-line
                  let func = new Function('value', 'data', item.func)
                  _item.value = func(_item.value, record)
                } catch (e) {
                  if (window.GLOB.debugger === true) {
                    console.warn(e)
                  }
                }
              } else {
                _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
              }
            }
            if (item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换
              _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || ''))
src/templates/zshare/formconfig.jsx
@@ -3615,19 +3615,31 @@
    {
      type: 'radio',
      key: 'interception',
      label: '截取空格',
      label: '截取方式',
      initVal: card.interception || 'true',
      tooltip: '提交时,是否截取首尾的空白字符。',
      tooltip: '提交时的文本处理方式,空白字符指开头或结尾的空白字符。',
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
        text: '无'
      }, {
        value: 'true',
        text: '空白字符'
      }, {
        value: 'func',
        text: '自定义函数'
      }]
    },
    {
      type: 'textarea',
      key: 'func',
      label: '函数',
      initVal: card.func || '',
      tooltip: '函数有两个入参(value, data),第一个为当前表单值,第二个为表单所有字段-值的对象,请返回处理后的值。',
      rows: 2,
      required: true
    },
    {
      type: 'textarea',
      key: 'formula',
      label: '公式',
      initVal: card.formula || '',
src/templates/zshare/modalform/index.jsx
@@ -147,6 +147,9 @@
          shows.push('regularExtra')
        }
      }
      if (this.record.interception === 'func') {
        shows.push('func')
      }
    } else if (type === 'number') {
      reTypes.initval = 'number'
      reRequired.initval = true
@@ -165,6 +168,9 @@
        shows.push('fieldlength')
      } else if (this.record.declare === 'decimal') {
        shows.push('decimal')
      }
      if (this.record.interception === 'func') {
        shows.push('func')
      }
    } else if (['multiselect', 'select', 'link', 'radio', 'checkbox'].includes(type)) {
      if (this.record.resourceType === '0') {        // 自定义资源
@@ -278,6 +284,9 @@
      if (this.record.encryption === 'false') {
        shows.push('enterReplace')
      }
      if (this.record.interception === 'func') {
        shows.push('func')
      }
    }
    if (['multiselect', 'select', 'link', 'radio', 'checkbox', 'checkcard', 'cascader'].includes(type)) {