king
2023-08-17 c7aece35a62b6e91fd98a625bf0e53f64bfbd18d
2023-08-17
6个文件已修改
103 ■■■■ 已修改文件
src/tabviews/zshare/actionList/normalbutton/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkDatePicker/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1226,7 +1226,13 @@
            if (Array.isArray(res.mk_ex_data) && res.mk_ex_data.length > 0) {
              let pices = res.mk_ex_data.map(item => {
                item.$pice = true
                item.$record = record
                item.$record = {...record}
                if (item.hasOwnProperty('mk_api_key')) {
                  item.$record.mk_api_key = item.mk_api_key || record.mk_api_key || ''
                  delete item.mk_api_key
                }
                return item
              })
              params = [...pices, ...params]
src/tabviews/zshare/mutilform/index.jsx
@@ -213,6 +213,35 @@
        if (newval === '$empty' && item.initval) {
          newval = moment().subtract(item.initval, 'days').format(_format)
        }
        if (item.minDate) {
          if (item.minDate === 'custom') {
            if (/^\d{4}-\d{2}-\d{2}$/.test(item.minDateField)) {
              item.minDate = moment(item.minDateField).format('YYYY-MM-DD')
            } else {
              let val = data[item.minDateField.toLowerCase()]
              item.minDate = val ? moment(val).format('YYYY-MM-DD') : ''
            }
            item.minDate = item.minDate === 'Invalid date' ? '' : item.minDate
          } else {
            item.minDate = moment().add(item.minDate, 'days').format('YYYY-MM-DD')
          }
        }
        if (item.maxDate) {
          if (item.maxDate === 'custom') {
            if (/^\d{4}-\d{2}-\d{2}$/.test(item.maxDateField)) {
              item.maxDate = moment(item.maxDateField).format('YYYY-MM-DD')
            } else {
              let val = data[item.maxDateField.toLowerCase()]
              item.maxDate = val ? moment(val).format('YYYY-MM-DD') : ''
            }
            item.maxDate = item.maxDate === 'Invalid date' ? '' : item.maxDate
          } else {
            item.maxDate = moment().add(item.maxDate, 'days').format('YYYY-MM-DD')
          }
        }
      } else if (item.type === 'datemonth') {
        if (newval !== '$empty') {
          newval = moment(newval, 'YYYY-MM').format('YYYY-MM')
src/tabviews/zshare/mutilform/mkDatePicker/index.jsx
@@ -37,8 +37,8 @@
    this.state = {
      value,
      minDate: config.minDate ? moment().add(config.minDate, 'days').startOf('day') : '',
      maxDate: config.maxDate ? moment().add(config.maxDate, 'days').endOf('day') : '',
      minDate: config.minDate ? moment(config.minDate).startOf('day') : '',
      maxDate: config.maxDate ? moment(config.maxDate).endOf('day') : '',
      mode,
      format
    }
src/tabviews/zshare/topSearch/index.jsx
@@ -127,7 +127,9 @@
            val = val + ':00'
          }
        }
        advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) {
          advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        }
      }
      if (item.type === 'group') {
@@ -630,7 +632,9 @@
                val = val + ':00'
              }
            }
            advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
            if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) {
              advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
            }
          }
        })
        this.setState({advanceValues})
@@ -725,7 +729,9 @@
            val = val + ':00'
          }
        }
        advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) {
          advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        }
      }
      return item
@@ -840,7 +846,9 @@
            val = val + ':00'
          }
        }
        advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) {
          advanceValues.push({field: item.field, type: item.type, label: item.label, value: val})
        }
      }
    })
src/templates/zshare/formconfig.jsx
@@ -3068,7 +3068,20 @@
      }, {
        value: '-90',
        text: '前90天'
      }, {
        value: 'custom',
        text: '自定义'
      }]
    },
    {
      type: 'text',
      key: 'minDateField',
      label: '最小值(字段)',
      initVal: card.minDateField || '',
      tooltip: '最小值对应字段,也可自定义固定值,格式为YYYY-MM-DD。',
      required: true,
      readonly: false,
      options: columns
    },
    {
      type: 'select',
@@ -3118,9 +3131,22 @@
      }, {
        value: '-90',
        text: '前90天'
      }, {
        value: 'custom',
        text: '自定义'
      }]
    },
    {
      type: 'text',
      key: 'maxDateField',
      label: '最大值(字段)',
      initVal: card.maxDateField || '',
      tooltip: '最大值对应字段,也可自定义固定值,格式为YYYY-MM-DD。',
      required: true,
      readonly: false,
      options: columns
    },
    {
      type: 'radio',
      key: 'precision',
      label: '精确度',
src/templates/zshare/modalform/index.jsx
@@ -32,7 +32,7 @@
  check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'],
  date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'],
  datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'],
  datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'],
  // datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'],
  textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'place', 'count', 'placeholder', 'marginTop', 'marginBottom'],
  cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'marginTop', 'marginBottom', 'separator'],
  color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'colorType', 'extra', 'marginTop', 'marginBottom'],
@@ -222,7 +222,7 @@
        }
      } else {
        shows.push('fieldlength', 'checkAll')
        reTooltip.initval = '添加多个初始值请使用逗号分隔。'
        reTooltip.initval = '添加多个初始值请使用逗号分隔。'
      }
      shows.push('linkField')
@@ -234,9 +234,17 @@
      if (this.record.readonly === 'true' && this.record.hidden !== 'true') {
        shows.push('unchecked')
      }
    } else if (['date', 'datemonth', 'datetime'].includes(type)) {
    } else if (['date', 'datemonth'].includes(type)) {
      reOptions.initval = dateOptions[type]
      reTypes.initval = 'select'
      if (type === 'date') {
        if (this.record.minDate === 'custom') {
          shows.push('minDateField')
        }
        if (this.record.maxDate === 'custom') {
          shows.push('maxDateField')
        }
      }
    } else if (type === 'switch' || type === 'check') {
      reOptions.initval = [
        {value: true, text: '开'},
@@ -588,7 +596,7 @@
    this.props.form.setFieldsValue({dataSource: resource})
  }
  complete = (key, option) => {
  complete = (option) => {
    let label = option.props.label
    this.props.form.setFieldsValue({label: label})
@@ -642,13 +650,13 @@
          })
        }
        if (item.key === 'field' && item.options && item.options.length > 0) {
        if (['field', 'minDateField', 'maxDateField'].includes(item.key) && item.options && item.options.length > 0) {
          content = <AutoComplete
            dataSource={item.options.map((cell) => <AutoComplete.Option label={cell.label} value={cell.field} key={cell.uuid}>
              {cell.field}
            </AutoComplete.Option>)}
            filterOption={(input, option) => option.props.children.indexOf(input) > -1}
            onSelect={this.complete}
            onSelect={(val, option) => item.key === 'field' && this.complete(option)}
            placeholder=""
          >
            <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />