king
2022-11-23 a898abd9e42a4b428d6daf1d34fa400ed18e8689
src/menu/components/card/cardcellcomponent/elementform/index.jsx
@@ -16,10 +16,10 @@
const cardTypeOptions = {
  sequence: ['eleType', 'width'],
  text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable'],
  number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'],
  picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'],
  number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'],
  picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'backgroundSize', 'maxWidth', 'link', 'noValue'],
  video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop', 'startTime', 'noValue', 'posterType'],
  icon: ['eleType', 'icon', 'datatype', 'width'],
  icon: ['eleType', 'datatype', 'width', 'tooltip'],
  slider: ['eleType', 'datatype', 'width', 'color', 'maxValue', 'showInfo', 'showType', 'strokeWidth', 'strokeLinecap', 'trailColor'],
  splitline: ['eleType', 'color', 'width', 'borderWidth'],
  barcode: ['eleType', 'datatype', 'width', 'barHeight', 'displayValue', 'interval', 'noValue'],
@@ -30,7 +30,6 @@
class MainSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object,      // 字典项
    config: PropTypes.object,    // 组件信息
    formlist: PropTypes.any,     // 表单信息
    card: PropTypes.any,         // 按钮信息
@@ -66,7 +65,7 @@
          item.options = []
          config.columns.forEach(col => {
            let label = col.label
            if (label !== col.field) {
            if (label.toLowerCase() !== col.field.toLowerCase()) {
              label = col.field + ' ' + col.label
            }
            if (/^(Int|Decimal)/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) {
@@ -112,7 +111,7 @@
      if (datatype === 'dynamic') {
        _options.push('field')
        if (eleType === 'number') {
          _options.push('decimal')
          _options.push('decimal', 'format')
        }
      } else if (eleType === 'picture' || eleType === 'video') {
        _options.push('url')
@@ -145,7 +144,7 @@
      if (datatype === 'dynamic') {
        _options.push('field')
      } else {
        _options.push('tooltip')
        _options.push('icon')
      }
    }
    if (_options.includes('fixStyle') && fixStyle === 'alone') {
@@ -175,7 +174,7 @@
          item.options = []
          config.columns.forEach(col => {
            let label = col.label
            if (label !== col.field) {
            if (label.toLowerCase() !== col.field.toLowerCase()) {
              label = col.field + ' ' + col.label
            }
@@ -216,6 +215,10 @@
          item.initVal = posterType
        } else if (item.key === 'fixStyle') {
          item.initVal = fixStyle
        } else if (item.key === 'color') {
          if (value === 'splitline') {
            item.initVal = '#EBE9E9'
          }
        }
        return item
@@ -227,7 +230,9 @@
        showType: card.showType || 'line',
        formlist: _formlist
      }, () => {
        if (value === 'slider') {
        if (value === 'splitline') {
          this.props.form.setFieldsValue({width: 24, color: '#EBE9E9'})
        } else if (value === 'slider') {
          this.props.form.setFieldsValue({width: 24, color: '#1890ff'})
        } else if (value === 'qrcode') {
          this.props.form.setFieldsValue({color: '#000000'})
@@ -361,7 +366,7 @@
                rules: [
                  {
                    required: item.readonly ? false : !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                    message: '请输入' + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
@@ -386,7 +391,7 @@
                rules: [
                  {
                    required: item.readonly ? false : !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                    message: '请输入' + item.label + '!'
                  }
                ]
              })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)}
@@ -406,7 +411,7 @@
                initialValue: item.initVal,
                rules: [{
                  required: item.readonly ? false : !!item.required,
                  message: this.props.dict['form.required.input'] + item.label + '!'
                  message: '请输入' + item.label + '!'
                }]
              })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)}
            </Form.Item>
@@ -425,7 +430,7 @@
                initialValue: item.initVal || '',
                rules: [{
                  required: !!item.required,
                  message: this.props.dict['form.required.select'] + item.label + '!'
                  message: '请选择' + item.label + '!'
                }]
              })(
                <Select
@@ -458,7 +463,7 @@
                initialValue: item.initVal || '',
                rules: [{
                  required: !!item.required,
                  message: this.props.dict['form.required.select'] + item.label + '!'
                  message: '请选择' + item.label + '!'
                }]
              })(
                <MkEditIcon />
@@ -479,7 +484,7 @@
                initialValue: item.initVal,
                rules: [{
                  required: !!item.required,
                  message: this.props.dict['form.required.select'] + item.label + '!'
                  message: '请选择' + item.label + '!'
                }]
              })(
                <Radio.Group onChange={(e) => {this.onChange(e, item.key)}} disabled={item.readonly}>
@@ -502,7 +507,7 @@
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.select'] + item.label + '!'
                    message: '请选择' + item.label + '!'
                  }
                ]
              })(
@@ -529,7 +534,7 @@
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.select'] + item.label + '!'
                    message: '请选择' + item.label + '!'
                  }
                ]
              })(
@@ -552,7 +557,7 @@
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.select'] + item.label + '!'
                    message: '请选择' + item.label + '!'
                  }
                ]
              })(