king
2024-05-20 8f9f9322f32e0553cb58068b39ae57e3d997ec65
2024-05-20
6个文件已修改
105 ■■■■ 已修改文件
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/index.jsx 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -371,6 +371,20 @@
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: '必填',
      initVal: card.required || 'false',
      required: false,
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'text',
      key: 'initval',
      label: '默认值',
@@ -668,20 +682,6 @@
      }, {
        value: 'fixed',
        text: '定宽'
      }]
    },
    {
      type: 'radio',
      key: 'required',
      label: '必填',
      initVal: card.required || 'false',
      required: false,
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'true',
        text: '是'
      }]
    },
    {
src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -66,6 +66,8 @@
  getOptions = () => {
    let _options = fromJS(columnTypeOptions[this.record.type]).toJS()
    let reLabel = {}
    if (['number', 'text'].includes(this.record.type) && this.record.editable === 'true') {
      _options.push('ctrlField')
      if (this.record.ctrlField) {
@@ -91,8 +93,12 @@
        } else {
          _options.push('required', 'enter')
        }
        reLabel.required = '必填'
      } else if (this.record.type === 'number') {
        _options.push('max', 'min', 'enter', 'clearField')
        _options.push('max', 'min', 'required', 'enter', 'clearField')
        reLabel.required = '不等于0'
      }
    } else if (this.record.type === 'extend') {
      if (this.record.colUnit === 'day') {
@@ -115,7 +121,7 @@
      }
    }
    return _options
    return {options: _options, reLabel}
  }
  editColumn = (column) => {
@@ -131,12 +137,16 @@
      this.record[item.key] = item.initVal
    })
    
    let _options = this.getOptions()
    let { options, reLabel } = this.getOptions()
    this.setState({
      visible: true,
      formlist: formlist.map(item => {
        item.hidden = !_options.includes(item.key)
        item.hidden = !options.includes(item.key)
        if (reLabel[item.key]) {
          item.label = reLabel[item.key]
        }
        if (item.key === 'formula') {
          item.fields = this.props.fields.map(col => col.field)
@@ -166,7 +176,7 @@
        this.record.IsSort = 'false'
      }
      let _options = this.getOptions()
      let { options, reLabel } = this.getOptions()
      let _field = ''
      if (value === 'formula') {
@@ -180,7 +190,10 @@
          }
          item.initVal = this.record[item.key]
          item.hidden = !_options.includes(item.key)
          item.hidden = !options.includes(item.key)
          if (reLabel[item.key]) {
            item.label = reLabel[item.key]
          }
          return item
        })
@@ -212,12 +225,15 @@
      this.record.type = values.type
      if (values.type !== _type) {
        let _options = this.getOptions()
        let { options, reLabel } = this.getOptions()
        this.setState({
          formlist: this.state.formlist.map(item => {
            item.initVal = this.record[item.key]
            item.hidden = !_options.includes(item.key)
            item.hidden = !options.includes(item.key)
            if (reLabel[item.key]) {
              item.label = reLabel[item.key]
            }
            return item
          })
@@ -230,7 +246,7 @@
    } else if (key === 'format' && value === 'percent') {
      this.props.form.setFieldsValue({postfix: '%'})
    } else if (key === 'editType') {
      let _options = this.getOptions()
      let { options, reLabel } = this.getOptions()
      this.setState({
        formlist: this.state.formlist.map(item => {
@@ -239,18 +255,24 @@
          }
          item.initVal = this.record[item.key]
          item.hidden = !_options.includes(item.key)
          item.hidden = !options.includes(item.key)
          if (reLabel[item.key]) {
            item.label = reLabel[item.key]
          }
          return item
        })
      })
    } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort', 'textFormat'].includes(key)) {
      let _options = this.getOptions()
      let { options, reLabel } = this.getOptions()
      this.setState({
        formlist: this.state.formlist.map(item => {
          item.initVal = this.record[item.key]
          item.hidden = !_options.includes(item.key)
          item.hidden = !options.includes(item.key)
          if (reLabel[item.key]) {
            item.label = reLabel[item.key]
          }
          return item
        })
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -562,6 +562,10 @@
      if (config.noValue === 'hide' && !value) {
        value = 0
      }
      if (config.required === 'true' && !value) {
        err = `${config.label}不可为${config.noValue === 'hide' ? '空' : '0'}`
      } else {
        if (typeof(config.max) === 'number' && value > config.max) {
          err = config.label + '最大为' + config.max
@@ -1662,7 +1666,9 @@
      } else if (col.type === 'number') {
        let val = record[col.field]
        if (col.noValue === 'hide' && !val) {
        if (col.required === 'true' && !val) {
          err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}`
        } else if (col.noValue === 'hide' && !val) {
          if (col.clearField && checkForms.includes(col.clearField) && !record[col.clearField]) {
            err = `请填写 ${col.label} 或 ${col.clearName}`
          }
@@ -2279,7 +2285,9 @@
          item[col.field] = val
        } else if (col.type === 'number') {
          let val = item[col.field]
          if (col.noValue === 'hide' && !val) {
          if (col.required === 'true' && !val) {
            err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}`
          } else if (col.noValue === 'hide' && !val) {
            if (col.clearField && checkForms.includes(col.clearField) && !item[col.clearField]) {
              let msg = `请填写 ${col.label} 或 ${col.clearName}`
              if (!line.includes(msg)) {
src/tabviews/zshare/mutilform/index.jsx
@@ -393,11 +393,13 @@
          message: item.label + '不可为空!'
        }]
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number') {
        if (typeof(item.min) === 'number' || typeof(item.max) === 'number' || item.notZero === 'true') {
          item.rules.push({
            validator: (rule, value, callback) => {
              if (isNaN(value)) {
                callback()
              } else if (item.notZero === 'true' && value === 0) {
                callback(item.label + '不可为0')
              } else if (typeof(item.min) === 'number' && value < item.min) {
                if (item.min < 1e-6) {
                  if (item.min === 1e-6) {
src/templates/zshare/formconfig.jsx
@@ -1794,6 +1794,19 @@
    },
    {
      type: 'radio',
      key: 'notZero',
      label: "不可为0",
      initVal: card.notZero || 'false',
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'database',
      label: '数据库',
      initVal: card.database || 'local',
src/templates/zshare/modalform/index.jsx
@@ -21,7 +21,7 @@
const modalTypeOptions = {
  text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType', 'constant', 'mkfocus'],
  number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom', 'mkfocus', 'format'],
  number: ['initval', 'readonly', 'notZero', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom', 'mkfocus', 'format'],
  select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'],
  checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'],
  radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'],