king
2025-01-18 f9f60bb0dd17a764ba03faa8041f5b6e9e071553
2025-01-18
18个文件已修改
252 ■■■■■ 已修改文件
src/menu/components/form/dragtitle/options.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/options.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/formdragelement/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/settingform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/dragtitle/options.jsx
@@ -8,13 +8,13 @@
  if (appType === 'mob') {
    group.fields.forEach(f => {
      if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
        fields.push({...f, label: `${f.label}(${f.field})`})
      }
    })
  } else {
    group.fields.forEach(f => {
      if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
        fields.push({...f, label: `${f.label}(${f.field})`})
      }
    })
  }
src/menu/components/form/simple-form/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -516,6 +516,26 @@
    })
  }
  toLower = () => {
    let card = fromJS(this.state.card).toJS()
    let that = this
    card.subcards[0].fields = card.subcards[0].fields.map(item => {
      if (item.field) {
        item.field = item.field.toLowerCase()
      }
      return item
    })
    confirm({
      content: `确定将字段转为小写吗?`,
      onOk() {
        that.updateComponent(card)
      },
      onCancel() {}
    })
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -564,6 +584,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/>
            <FormFork forms={card.subcards[0].fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
src/menu/components/form/simple-form/options.jsx
@@ -23,13 +23,13 @@
  if (appType === 'mob') {
    config.subcards[0].fields.forEach(f => {
      if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
        fields.push({...f, label: `${f.label}(${f.field})`})
      }
    })
  } else {
    config.subcards[0].fields.forEach(f => {
      if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
        fields.push({...f, label: `${f.label}(${f.field})`})
      }
    })
  }
src/menu/components/form/step-form/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, notification, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -614,6 +614,35 @@
    }
  }
  toLower = () => {
    let group = fromJS(this.state.group).toJS()
    let card = fromJS(this.state.card).toJS()
    let that = this
    group.fields = group.fields.map(item => {
      if (item.field) {
        item.field = item.field.toLowerCase()
      }
      return item
    })
    card.subcards = card.subcards.map(item => {
      if (item.uuid === group.uuid) {
        return group
      }
      return item
    })
    confirm({
      content: `确定将字段转为小写吗?`,
      onOk() {
        that.setState({group})
        that.updateComponent(card)
      },
      onCancel() {}
    })
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -677,6 +706,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/>
            <FormFork forms={group.fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
src/menu/components/form/tab-form/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Modal, Button, Switch, notification, message } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -616,6 +616,35 @@
    }
  }
  toLower = () => {
    let group = fromJS(this.state.group).toJS()
    let card = fromJS(this.state.card).toJS()
    let that = this
    group.fields = group.fields.map(item => {
      if (item.field) {
        item.field = item.field.toLowerCase()
      }
      return item
    })
    card.subcards = card.subcards.map(item => {
      if (item.uuid === group.uuid) {
        return group
      }
      return item
    })
    confirm({
      content: `确定将字段转为小写吗?`,
      onOk() {
        that.setState({group})
        that.updateComponent(card)
      },
      onCancel() {}
    })
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -680,6 +709,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/>
            <FormFork forms={group.fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
src/menu/debug/index.jsx
@@ -783,6 +783,11 @@
            writein: item.writein !== 'false',
            type: item.type
          }
          if (item.type === 'linkMain' && item.verifyVal === 'true') {
            _item.$verify = true
            _item.label = item.label
          }
    
          if (_item.type === 'datemonth') {
            _item.type = 'text'
@@ -832,6 +837,11 @@
            writein: item.writein !== 'false',
            type: item.type
          }
          if (item.type === 'linkMain' && item.verifyVal === 'true') {
            _item.$verify = true
            _item.label = item.label
          }
    
          if (_item.type === 'datemonth') {
            _item.type = 'text'
@@ -869,8 +879,20 @@
        key: 'mk_n_id'
      })
    }
    let verifyValSql = ''
    // 获取字段键值对
    formdata && formdata.forEach(form => {
      if (form.$verify) {
        verifyValSql += `
        if @${form.key}=${form.type === 'number' ? 0 : `''`}
        begin
          select @errorcode='E',@retmsg='${form.label},关联主表失效'
          goto aaa
        end
        `
      }
      let _key = form.key.toLowerCase()
      if (!_initvars.includes(_key)) {
        _initvars.push(_key)
@@ -1512,6 +1534,10 @@
    } else if (_backCustomScript) {
      _sql += _backCustomScript
    }
    if (verifyValSql) {
      _sql += verifyValSql
    }
  
    if (btn.procMode === 'system') {
      _sql += `
src/menu/modalconfig/index.jsx
@@ -4,7 +4,7 @@
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import { Button, Card, Modal, Collapse, Switch, message, Popover } from 'antd'
import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons'
import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined, VerticalRightOutlined } from '@ant-design/icons'
import { getModalForm } from '@/templates/zshare/formconfig'
import SourceElement from '@/templates/modalconfig/dragelement/source'
@@ -334,6 +334,28 @@
    })
  }
  toLower = () => {
    let _config = fromJS(this.state.config).toJS()
    let that = this
    _config.fields = _config.fields.map(item => {
      if (item.field) {
        item.field = item.field.toLowerCase()
      }
      return item
    })
    confirm({
      content: `确定将字段转为小写吗?`,
      onOk() {
        that.setState({
          config: _config
        })
      },
      onCancel() {}
    })
  }
  triggerCopy = () => {
    const { config } = this.state
@@ -413,6 +435,7 @@
                    } trigger="hover">
                      <SwapOutlined />
                    </Popover>
                    <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/>
                    <FormFork forms={config.fields}/>
                    <CopyOutlined title="复制" onClick={this.triggerCopy} />
                    <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
src/mob/components/formdragelement/index.jsx
@@ -97,7 +97,10 @@
      newcard.span = 24
      newcard.focus = true
      if (item.subType === 'textarea') {
      if (item.subType === 'linkMain') {
        newcard.hidden = 'true'
        newcard.verifyVal = 'true'
      } else if (item.subType === 'textarea') {
        newcard.required = 'false'
      }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -846,7 +846,7 @@
      let val = form.value
      if (form.type === 'number' || form.type === 'rate') {
        if (isNaN(val)) {
        if (isNaN(val) || val === '') {
          val = 0
        }
      } else if (['date', 'datemonth'].includes(form.type)) {
@@ -1322,7 +1322,7 @@
        let val = form.value
  
        if (form.type === 'number' || form.type === 'rate') {
          if (isNaN(val)) {
          if (isNaN(val) || val === '') {
            val = 0
          }
          _initFormfields.push(`@${_key}=${val}`)
@@ -3986,6 +3986,10 @@
      let key = item.field.toLowerCase()
      let _readin = item.readin !== 'false'
      if (item.type === 'linkMain' && item.verifyVal === 'true') {
        _item.$verify = true
        _item.label = item.label
      }
      if (_item.type === 'date') { // 时间兼容
        _item.precision = item.precision || 'day'
      } else if (_item.type === 'datetime') {
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1008,7 +1008,7 @@
        let val = form.value
        if (form.type === 'number' || form.type === 'rate') {
          if (isNaN(val)) {
          if (isNaN(val) || val === '') {
            val = 0
          }
        } else if (['date', 'datemonth'].includes(form.type)) {
@@ -1142,7 +1142,7 @@
      if (form.type === 'number' || form.type === 'rate') {
        let val = form.value
        if (isNaN(val)) {
        if (isNaN(val) || val === '') {
          val = 0
        }
        _initvars.push(`@${_key}=${val}`)
@@ -2282,6 +2282,10 @@
      let key = item.field.toLowerCase()
      let _readin = item.readin !== 'false'
      if (item.type === 'linkMain' && item.verifyVal === 'true') {
        _item.$verify = true
        _item.label = item.label
      }
      if (_item.type === 'date') { // 时间兼容
        _item.precision = item.precision || 'day'
      } else if (_item.type === 'datetime') {
src/tabviews/zshare/mutilform/index.jsx
@@ -173,6 +173,7 @@
      } else if (item.type === 'linkMain') {
        readin = false
        item.readin = false
        item.$verify = item.verifyVal === 'true'
      } else if (item.type === 'number') {
        item.decimal = item.decimal || 0
        item.fieldlength = item.decimal
@@ -1534,6 +1535,11 @@
            key: item.field,
            isconst: item.constant === 'true'
          }
          if (item.$verify) {
            _item.$verify = true
            _item.label = item.label
          }
    
          _item.value = record[item.field] !== undefined ? record[item.field] : ''
    
src/templates/modalconfig/dragelement/index.jsx
@@ -98,6 +98,7 @@
      if (item.subType === 'linkMain') {
        newcard.hidden = 'true'
        newcard.verifyVal = 'true'
      } else if (item.subType === 'textarea') {
        newcard.required = 'false'
      }
src/templates/modalconfig/settingform/index.jsx
@@ -161,7 +161,7 @@
                >
                  {fields.map(option =>
                    <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}>
                      {option.label}
                      {`${option.label}(${option.field})`}
                    </Select.Option>
                  )}
                </Select>
@@ -185,7 +185,7 @@
                >
                  {fields.map(option =>
                    <Select.Option key={option.uuid} value={option.uuid}>
                      {option.label}
                      {`${option.label}(${option.field})`}
                    </Select.Option>
                  )}
                </Select>
src/templates/zshare/formconfig.jsx
@@ -1947,6 +1947,20 @@
    },
    {
      type: 'radio',
      key: 'verifyVal',
      label: '空值验证',
      tooltip: '按钮提交时验证字段值是否为空(或数值为0)。',
      initVal: card.verifyVal || 'false',
      options: [{
        value: 'true',
        text: '开启'
      }, {
        value: 'false',
        text: '关闭'
      }]
    },
    {
      type: 'radio',
      key: 'format',
      label: '格式化',
      tooltip: '使用千分位时,数值将以千分位格式显示,提交时为原数值。',
src/templates/zshare/modalform/index.jsx
@@ -43,7 +43,7 @@
  formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'],
  brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'],
  funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'],
  linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'],
  linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom', 'verifyVal'],
  popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'],
  vercode: ['label', 'field', 'type', 'blacklist', 'supField', 'readonly', 'required', 'hidden', 'span', 'labelwidth', 'tooltip', 'marginTop', 'marginBottom', 'placeholder', 'enter', 'smsId', 'phoneField', 'sendType']
}
@@ -426,7 +426,9 @@
      if (value === 'linkMain') {
        this.record.hidden = 'true'
        this.record.verifyVal = 'true'
        _fieldval.hidden = 'true'
        _fieldval.verifyVal = 'true'
      }
      
      if (this.record.type === 'cascader' && value !== 'cascader') {
src/templates/zshare/verifycard/index.jsx
@@ -746,6 +746,10 @@
        _f.writein = _f.writein !== 'false'
        _f.fieldlen = _f.fieldlength || 50
        if (_f.type === 'linkMain' && _f.verifyVal === 'true') {
          _f.$verify = true
        }
        if (_f.type === 'datemonth') {
          _f.type = 'text'
        } else if (_f.type === 'number' || _f.type === 'rate') {
@@ -1034,8 +1038,19 @@
    formdata = formdata.length ? formdata : null
    let verifyValSql = ''
    // 获取字段键值对
    formdata && formdata.forEach(form => {
      if (form.$verify) {
        verifyValSql += `
        if @${form.field}=${form.type === 'number' ? 0 : `''`}
        begin
          select @errorcode='E',@retmsg='${form.label},关联主表失效'
          goto aaa
        end
        `
      }
      let _key = form.field.toLowerCase()
      if (!_initvars.includes(_key)) {
        _initvars.push(_key)
@@ -1698,6 +1713,10 @@
    } else if (_backCustomScript) {
      _sql += _backCustomScript
    }
    if (verifyValSql) {
      _sql += verifyValSql
    }
  
    if (btn.procMode === 'system') {
      _sql += `
src/utils/utils-custom.js
@@ -3533,6 +3533,11 @@
            isconst: item.constant === 'true'
          }
          if (item.type === 'linkMain' && item.verifyVal === 'true') {
            _item.$verify = true
            _item.label = item.label
          }
          if (_item.type === 'datemonth') {
            _item.type = 'text'
          } else if (_item.type === 'number' || _item.type === 'rate') {
@@ -3571,8 +3576,19 @@
      formdata.push(item)
    }
    let verifyValSql = ''
    // 获取字段键值对
    formdata && formdata.forEach(form => {
      if (form.$verify) {
        verifyValSql += `
        if @${form.key}=${form.type === 'number' ? 0 : `''`}
        begin
          select @errorcode='E',@retmsg='${form.label},关联主表失效'
          goto aaa
        end
        `
      }
      let _key = form.key.toLowerCase()
      if (!formkeys.includes(_key)) {
@@ -4281,6 +4297,10 @@
      _sql += _backCustomScript
    }
    if (verifyValSql) {
      _sql += verifyValSql
    }
    if (verify.workFlow === 'true' && process) {
      if (verify.flowType === 'start') {
        _sql = _sql.replace(/@start_type@/ig, `'开始'`)
src/utils/utils.js
@@ -1820,9 +1820,20 @@
  let _initFormfields = []
  let _initColfields = []
  let _declarefields = []
  let verifyValSql = ''
  // 获取字段键值对
  formdata && formdata.forEach(form => {
    if (form.$verify) {
      verifyValSql += `
      if @${form.key}=${form.type === 'number' ? 0 : `''`}
      begin
        select @errorcode='E',@retmsg='${form.label},关联主表失效'
        goto aaa
      end
      `
    }
    let _key = form.key.toLowerCase()
    if (!_initvars.includes(_key)) {
@@ -1830,7 +1841,7 @@
      let val = form.value
      if (form.type === 'number' || form.type === 'rate') {
        if (isNaN(val)) {
        if (isNaN(val) || val === '') {
          val = 0
        }
        _initFormfields.push(`@${_key}=${val}`)
@@ -2879,6 +2890,10 @@
    _sql += _backCustomScript
  }
  if (verifyValSql) {
    _sql += verifyValSql
  }
  if (window.GLOB.breakpoint) {
    let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig')
    let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig')