king
2024-02-19 1e4a7720c748bc0206b02b30f4a2e0b3dafb54f3
2024-02-19
28个文件已修改
2个文件已添加
520 ■■■■ 已修改文件
src/menu/components/search/main-search/dragsearch/card.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/dragsearch/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/index.scss 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/colsControl/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/colsControl/markform/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/searchcomponent/dragsearch/card.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/searchcomponent/dragsearch/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/searchcomponent/index.scss 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modulecell/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.scss 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/advanceform/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/mkNumber/index.jsx 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/mkNumber/index.scss 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.scss 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createinterface/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/customscript/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/source.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/dragsearch/card.jsx
@@ -123,6 +123,13 @@
    </Radio.Group>)
  } else if (card.type === 'check') {
    formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox>
  } else if (card.type === 'range') {
    let vals = card.initval.split(',')
    formItem = (<>
      <Input style={{marginTop: '4px'}} value={vals[0] || ''} />
      至
      <Input style={{marginTop: '4px'}} value={vals[1] || ''} />
    </>)
  }
  return (
src/menu/components/search/main-search/dragsearch/index.jsx
@@ -98,11 +98,11 @@
      newcard.orderType = 'asc'
      
      let _match = 'like'
      if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') {
      if (['select', 'link', 'checkcard'].includes(item.subType)) {
        _match = '='
      } else if (item.subType === 'date' || item.subType === 'datemonth') {
      } else if (['date', 'datemonth'].includes(item.subType)) {
        _match = '>='
      } else if (item.subType === 'dateweek' || item.subType === 'daterange') {
      } else if (['dateweek', 'daterange', 'range'].includes(item.subType)) {
        _match = 'between'
      } else if (item.subType === 'group') {
        _match = 'between'
src/menu/components/search/main-search/index.scss
@@ -89,6 +89,22 @@
      color: orange;
    }
  }
  .page-card.range {
    .ant-form-item-control-wrapper {
      .ant-form-item-control {
        .ant-form-item-children {
          display: flex;
          line-height: 40px;
          .ant-input:first-child {
            margin-right: 5px;
          }
          .ant-input:last-child {
            margin-left: 5px;
          }
        }
      }
    }
  }
  .page-card.no-query {
    .ant-form-explain {
      color: #13c2c2;
src/menu/components/share/colsControl/index.jsx
@@ -35,6 +35,9 @@
        title: '对比方式',
        dataIndex: 'match',
        width: '18%',
        render: text => {
          return text === 'regexp' ? '正则表达式' : text
        }
      },
      {
        title: '对比值',
src/menu/components/share/colsControl/markform/index.jsx
@@ -96,6 +96,7 @@
                  <Select.Option value="!="> != </Select.Option>
                  <Select.Option value=">"> &gt; </Select.Option>
                  <Select.Option value="<"> &lt; </Select.Option>
                  <Select.Option value="regexp"> 正则表达式 </Select.Option>
                </Select>
              )}
            </Form.Item>
src/menu/components/share/searchcomponent/dragsearch/card.jsx
@@ -67,6 +67,7 @@
  }
  let formItem = null
  let type = ''
  if (card.type === 'text') {
    if (card.inputType !== 'search') {
      formItem = <Input placeholder={card.label} value={card.initval} />
@@ -113,6 +114,14 @@
    formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} checked={card.initval === card.openVal}/>)
  } else if (card.type === 'check') {
    formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox>
  } else if (card.type === 'range') {
    type = 'range-wrap'
    let vals = card.initval.split(',')
    formItem = (<>
      <Input style={{marginTop: '4px'}} value={vals[0] || ''} />
      至
      <Input style={{marginTop: '4px'}} value={vals[1] || ''} />
    </>)
  }
  let labelwidth = card.labelwidth || 33.3
@@ -128,7 +137,7 @@
        <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} />
      </div>
    } trigger="hover">
      <div className={'page-card ' + (card.labelShow || '')} style={{ opacity: opacity}}>
      <div className={`page-card ${type} ${card.labelShow || ''}`} style={{ opacity: opacity}}>
        <div ref={node => drag(drop(node))}>
          <Form.Item
            labelCol={{style: {width: labelwidth + '%'}}}
src/menu/components/share/searchcomponent/dragsearch/index.jsx
@@ -98,11 +98,11 @@
      newcard.orderType = 'asc'
      
      let _match = 'like'
      if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') {
      if (['select', 'link', 'checkcard'].includes(item.subType)) {
        _match = '='
      } else if (item.subType === 'date' || item.subType === 'datemonth') {
      } else if (['date', 'datemonth'].includes(item.subType)) {
        _match = '>='
      } else if (item.subType === 'dateweek' || item.subType === 'daterange') {
      } else if (['dateweek', 'daterange', 'range'].includes(item.subType)) {
        _match = 'between'
      } else if (item.subType === 'group') {
        _match = 'between'
src/menu/components/share/searchcomponent/index.scss
@@ -56,6 +56,22 @@
      float: left;
    }
  }
  .page-card.range-wrap {
    .ant-form-item-control-wrapper {
      .ant-form-item-control {
        .ant-form-item-children {
          display: flex;
          line-height: 40px;
          .ant-input:first-child {
            margin-right: 5px;
          }
          .ant-input:last-child {
            margin-left: 5px;
          }
        }
      }
    }
  }
  .page-card.false {
    .ant-form-item-label {
      display: none;
src/menu/datasource/verifycard/customscript/index.jsx
@@ -6,7 +6,7 @@
import Toast from 'antd-mobile/es/components/toast'
import Dialog from 'antd-mobile/es/components/dialog'
import { checkSQL } from '@/utils/utils-custom.js'
import { checkSQL, getSearchFields } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
import MKEmitter from '@/utils/events.js'
import './index.scss'
@@ -33,48 +33,17 @@
  UNSAFE_componentWillMount() {
    const { searches } = this.props
    this.getSearchField(searches)
    this.setState({
      usefulfields: getSearchFields(searches)
    })
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (!is(fromJS(this.props.searches), fromJS(nextProps.searches))) {
      this.getSearchField(nextProps.searches)
      this.setState({
        usefulfields: getSearchFields(nextProps.searches)
      })
    }
  }
  getSearchField = (searches) => {
    let _usefulFields = []
    searches.forEach(item => {
      if (item.type === 'dateweek') {
        _usefulFields.push(item.key)
        _usefulFields.push(item.key + '1')
      } else if (item.type === 'datemonth') {
        if (item.match === '=') {
          _usefulFields.push(item.key)
        } else {
          _usefulFields.push(item.key)
          _usefulFields.push(item.key + '1')
        }
      } else if (item.type === 'daterange') {
        let _skey = item.key
        let _ekey = item.key + '1'
        if (/,/.test(item.key)) {
          _skey = item.key.split(',')[0]
          _ekey = item.key.split(',')[1]
        }
        _usefulFields.push(_skey)
        _usefulFields.push(_ekey)
      } else if (item.type === 'date' && _usefulFields.includes(item.key)) {
        _usefulFields.push(item.key + '1')
      } else {
        _usefulFields.push(item.key)
      }
    })
    this.setState({
      usefulFields: _usefulFields.join(', ')
    })
  }
  edit = (record) => {
src/menu/modulecell/index.jsx
@@ -85,7 +85,11 @@
          { subType: 'dateweek', text: '日期(周)', type: 'search' },
          { subType: 'datemonth', text: '日期(月)', type: 'search' },
          { subType: 'daterange', text: '日期(区间)', type: 'search' },
          { subType: 'group', text: '日期(组合)', type: 'search' }
          { subType: 'group', text: '日期(组合)', type: 'search' },
          { subType: 'range', text: '数值(区间)', type: 'search' },
          { subType: 'switch', text: '开关', type: 'search' },
          { subType: 'radio', text: '单选框', type: 'search' },
          { subType: 'check', text: '勾选框', type: 'search' },
        ]
      },
      {
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -651,6 +651,9 @@
        result = originVal === contrastVal
      } else if (item.match === '!=') {
        result = originVal !== contrastVal
      } else if (item.match === 'regexp') {
        let reg = new RegExp(item.contrastValue, 'ig')
        result = reg.test(originVal)
      } else {
        originVal = isNaN(originVal) ? originVal : +originVal
        contrastVal = isNaN(contrastVal) ? contrastVal : +contrastVal
src/tabviews/custom/components/share/normalTable/index.scss
@@ -13,7 +13,9 @@
    top: -22px;
    z-index: 2;
  }
  .ant-table-placeholder {
    border-top-color: var(--mk-table-border-color);
  }
  .normal-table-footer {
    padding: 10px 0px;
    color: rgba(0, 0, 0, 0.65);
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1700,6 +1700,9 @@
        result = originVal === contrastVal
      } else if (item.match === '!=') {
        result = originVal !== contrastVal
      } else if (item.match === 'regexp') {
        let reg = new RegExp(item.contrastValue, 'ig')
        result = reg.test(originVal)
      } else {
        originVal = isNaN(originVal) ? originVal : +originVal
        contrastVal = isNaN(contrastVal) ? contrastVal : +contrastVal
src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -11,6 +11,9 @@
    position: relative;
    // z-index: 1;
  }
  .ant-table-placeholder {
    border-top-color: var(--mk-table-border-color);
  }
  .ant-table {
    color: inherit;
    font-size: inherit;
src/tabviews/zshare/topSearch/advanceform/index.jsx
@@ -12,6 +12,7 @@
const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch'))
const MKRadio = asyncComponent(() => import('../mkRadio'))
const MKDatePicker = asyncComponent(() => import('../mkDatePicker'))
const MKNumber = asyncComponent(() => import('../mkNumber'))
class AdvanceSearch extends Component {
  static propTpyes = {
@@ -57,6 +58,8 @@
        content = <MKCheck config={item}/>
      } else if (item.type === 'switch') {
        content = <MKSwitch config={item}/>
      } else if (item.type === 'range') {
        content = <MKNumber config={item} onInputSubmit={this.handleSubmit} />
      }
      if (content) {
@@ -86,7 +89,9 @@
    this.props.form.validateFields((err, values) => {
      if (err) return
        
      this.props.advanceSubmit(values)
      setTimeout(() => {
        this.props.advanceSubmit(values)
      }, 10)
    })
  }
src/tabviews/zshare/topSearch/index.jsx
@@ -22,6 +22,7 @@
const MKSelect = asyncComponent(() => import('./mkSelect'))
const DateGroup = asyncComponent(() => import('./dategroup'))
const MKDatePicker = asyncComponent(() => import('./mkDatePicker'))
const MKNumber = asyncComponent(() => import('./mkNumber'))
class MainSearch extends Component {
  static propTpyes = {
@@ -712,6 +713,8 @@
        content = <MKCheck config={item} onChange={(val) => this.recordChange(val, false, item)} />
      } else if (item.type === 'switch') {
        content = <MKSwitch config={item} onChange={(val) => this.recordChange(val, false, item)} />
      } else if (item.type === 'range') {
        content = <MKNumber config={item} onInputSubmit={this.handleSubmit} />
      }
      if (content) {
@@ -885,7 +888,7 @@
    let searchlist = this.state.searchlist.map(item => {
      item.initval = item.oriInitval
      if (setting.resetContrl === 'clear' && ['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) {
      if (setting.resetContrl === 'clear' && ['text', 'date', 'datemonth', 'dateweek', 'daterange', 'range'].includes(item.type)) {
        item.initval = ''
      }
src/tabviews/zshare/topSearch/mkNumber/index.jsx
New file
@@ -0,0 +1,79 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import { InputNumber } from 'antd'
import './index.scss'
class MKNumber extends Component {
  constructor(props) {
    super(props)
    const config = props.config
    let vals = config.initval.split(',')
    this.state = {
      minValue: vals[0] !== undefined && vals[0] !== '' ? +vals[0] : '',
      maxValue: vals[1] !== undefined && vals[1] !== '' ? +vals[1] : ''
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  componentWillUnmount () {
    this.setState = () => {
      return
    }
  }
  minChange = (val) => {
    this.setState({minValue: val}, () => {
      this.onChange()
    })
  }
  maxChange = (val) => {
    this.setState({maxValue: val}, () => {
      this.onChange()
    })
  }
  onChange = () => {
    const { minValue, maxValue } = this.state
    let vals = []
    if ((!minValue && minValue !== 0) || isNaN(minValue)) {
      vals.push('')
    } else {
      vals.push(minValue)
    }
    if ((!maxValue && maxValue !== 0) || isNaN(maxValue)) {
      vals.push('')
    } else {
      vals.push(maxValue)
    }
    vals = vals.join(',')
    if (vals === ',') {
      vals = ''
    }
    this.props.onChange(vals)
  }
  render() {
    const { minValue, maxValue } = this.state
    return (
      <div className="range-wrap">
        <InputNumber defaultValue={minValue} onPressEnter={this.props.onInputSubmit} onChange={this.minChange}/>
        至
        <InputNumber defaultValue={maxValue} onPressEnter={this.props.onInputSubmit} onChange={this.maxChange}/>
      </div>
    )
  }
}
export default MKNumber
src/tabviews/zshare/topSearch/mkNumber/index.scss
New file
@@ -0,0 +1,16 @@
.range-wrap {
  display: flex;
  line-height: 32px;
  .ant-input-number:first-child {
    margin-right: 5px;
    .ant-input-number-handler-wrap {
      display: none;
    }
  }
  .ant-input-number:last-child {
    margin-left: 5px;
    .ant-input-number-handler-wrap {
      display: none;
    }
  }
}
src/templates/comtableconfig/source.jsx
@@ -245,6 +245,12 @@
    },
    {
      type: 'search',
      label: '数值(区间)',
      subType: 'range',
      url: ''
    },
    {
      type: 'search',
      label: '日期(组合)',
      subType: 'group',
      url: ''
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -7,7 +7,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { checkSQL } from '@/utils/utils-custom.js'
import { checkSQL, getSearchFields } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
// import './index.scss'
@@ -27,12 +27,16 @@
  }
  UNSAFE_componentWillMount () {
    this.resetfield(this.props.searches)
    this.setState({
      usefulfields: getSearchFields(this.props.searches)
    })
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (!is(fromJS(this.props.searches), fromJS(nextProps.searches))) {
      this.resetfield(nextProps.searches)
      this.setState({
        usefulfields: getSearchFields(nextProps.searches)
      })
    }
  }
@@ -85,47 +89,6 @@
          duration: 5
        })
      }
    })
  }
  resetfield = (searches) => {
    let _usefulFields = []
    searches.forEach(item => {
      if (!item.field) return
      if (item.type === 'group') {
        _usefulFields.push(item.field)
        _usefulFields.push(item.datefield)
        _usefulFields.push(item.datefield + '1')
      } else if (item.type === 'dateweek') {
        _usefulFields.push(item.field)
        _usefulFields.push(item.field + '1')
      } else if (item.type === 'datemonth') {
        if (item.match === '=') {
          _usefulFields.push(item.field)
        } else {
          _usefulFields.push(item.field)
          _usefulFields.push(item.field + '1')
        }
      } else if (item.type === 'daterange') {
        let _skey = item.field
        let _ekey = item.field + '1'
        if (/,/.test(item.field)) {
          _skey = item.field.split(',')[0]
          _ekey = item.field.split(',')[1]
        }
        _usefulFields.push(_skey)
        _usefulFields.push(_ekey)
      } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
        _usefulFields.push(item.field + '1')
      } else {
        _usefulFields.push(item.field)
      }
    })
    this.setState({
      usefulfields: _usefulFields.join(', ')
    })
  }
src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx
@@ -125,6 +125,14 @@
    </Radio.Group>)
  } else if (card.type === 'check') {
    formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox>
  } else if (card.type === 'range') {
    type = 'range-wrap'
    let vals = card.initval.split(',')
    formItem = (<>
      <Input style={{marginTop: '4px'}} value={vals[0] || ''} />
      至
      <Input style={{marginTop: '4px'}} value={vals[1] || ''} />
    </>)
  }
  let labelwidth = card.labelwidth || 33.3
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx
@@ -101,11 +101,11 @@
      newcard.orderType = 'asc'
      
      let _match = 'like'
      if (item.subType === 'select' || item.subType === 'link' || item.subType === 'checkcard') {
      if (['select', 'link', 'checkcard'].includes(item.subType)) {
        _match = '='
      } else if (item.subType === 'date' || item.subType === 'datemonth') {
      } else if (['date', 'datemonth'].includes(item.subType)) {
        _match = '>='
      } else if (item.subType === 'dateweek' || item.subType === 'daterange') {
      } else if (['dateweek', 'daterange', 'range'].includes(item.subType)) {
        _match = 'between'
      } else if (item.subType === 'group') {
        _match = 'between'
src/templates/sharecomponent/searchcomponent/index.scss
@@ -99,6 +99,21 @@
      }
    }
  }
  .page-card.range-wrap {
    .ant-form-item-control-wrapper {
      .ant-form-item-control {
        .ant-form-item-children {
          display: flex;
          .ant-input:first-child {
            margin-right: 5px;
          }
          .ant-input:last-child {
            margin-left: 5px;
          }
        }
      }
    }
  }
  .page-card.advanced {
    .ant-form-item-label label {
      color: orange;
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -110,7 +110,7 @@
  group: ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'labelShow', 'query', 'labelwidth'],
  switch: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'openVal', 'closeVal', 'openText', 'closeText', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'],
  check: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'openVal', 'closeVal', 'checkTip', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'],
  range: ['label', 'type', 'field', 'initval', 'match', 'blacklist', 'Hide', 'required', 'maxValue', 'minValue', 'step', 'labelShow', 'query', 'labelwidth']
  range: ['label', 'type', 'field', 'initval', 'match', 'ratio', 'blacklist', 'Hide', 'required', 'maxValue', 'minValue', 'step', 'labelShow', 'query', 'labelwidth', 'advanced']
}
class MainSearch extends Component {
@@ -831,35 +831,45 @@
          if (values.type === 'range') {
            let error = ''
            if (values.maxValue <= values.minValue) {
              error = '最大值必须大于最小值'
            } else if (values.step <= 0) {
              error = '步长必须大于0'
            } else {
              let s = (values.maxValue - values.minValue) / values.step
              if (s !== parseInt(s)) {
                error = '步长必须被 (max - min) 整除'
            if (sessionStorage.getItem('appType') === 'mob') {
              if (values.maxValue <= values.minValue) {
                error = '最大值必须大于最小值'
              } else if (values.step <= 0) {
                error = '步长必须大于0'
              } else {
                let s = (values.maxValue - values.minValue) / values.step
                if (s !== parseInt(s)) {
                  error = '步长必须被 (max - min) 整除'
                }
              }
            }
            if (!error && values.initval) {
              if (!error && values.initval) {
                let vals = values.initval.split(',')
                if (vals.length !== 2) {
                  error = '初始值设置错误!'
                } else if (isNaN(parseFloat(vals[0])) || isNaN(parseFloat(vals[1]))) {
                  error = '初始值设置错误!'
                } else {
                  let start = parseFloat(vals[0])
                  let end = parseFloat(vals[1])
                  let s = (values.maxValue - start) / values.step
                  let e = (values.maxValue - end) / values.step
                  if (start > end || start < values.minValue || end > values.maxValue) {
                    error = '初始值设置错误!'
                  } else if (s !== parseInt(s) || e !== parseInt(e)) {
                    error = '初始值设置错误!'
                  }
                }
              }
            } else if (values.initval) {
              let vals = values.initval.split(',')
              if (vals.length !== 2) {
                error = '初始值设置错误!'
              } else if (isNaN(parseFloat(vals[0])) || isNaN(parseFloat(vals[1]))) {
                error = '初始值设置错误!'
              } else {
                let start = parseFloat(vals[0])
                let end = parseFloat(vals[1])
                let s = (values.maxValue - start) / values.step
                let e = (values.maxValue - end) / values.step
                if (start > end || start < values.minValue || end > values.maxValue) {
                  error = '初始值设置错误!'
                } else if (s !== parseInt(s) || e !== parseInt(e)) {
                  error = '初始值设置错误!'
                }
              }
            }
            if (error) {
              notification.warning({
                top: 92,
src/templates/zshare/createinterface/index.jsx
@@ -55,7 +55,7 @@
        _val = ''
      }
      if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'daterange') {
      if (['datemonth', 'dateweek', 'daterange', 'range'].includes(item.type)) {
        fields = [item.field, item.field]
      }
@@ -103,9 +103,12 @@
        _fieldMap.set(item.field, true)
        searchText.push(item.field + ' ' + item.match + ' @' + _field + '@')
      } else if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'daterange') {
      } else if (['datemonth', 'dateweek', 'daterange'].includes(item.type)) {
        searchText.push('(' + item.field + ' >= @' + item.field + '@ AND ' + item.field + ' < @' + item.field + '1@)')
      } else if (item.type === 'range') {
        searchText.push('(' + item.field + ' >= @' + item.field + '@ AND ' + item.field + ' <= @' + item.field + '1@)')
      } else {
        searchText.push(item.field + ' ' + item.match + ' @' + item.field + '@')
      }
src/templates/zshare/customscript/index.jsx
@@ -7,7 +7,7 @@
import Utils from '@/utils/utils.js'
import Api from '@/api'
import { checkSQL } from '@/utils/utils-custom.js'
import { checkSQL, getSearchFields } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
import asyncComponent from '@/utils/asyncComponent'
import MKEmitter from '@/utils/events.js'
@@ -93,31 +93,9 @@
  UNSAFE_componentWillMount() {
    const { searches, scripts, urlFields } = this.props
    let _usefulFields = []
    searches.forEach(item => {
      if (['dateweek', 'datemonth'].includes(item.type)) {
        _usefulFields.push(item.key)
        _usefulFields.push(item.key + '1')
      } else if (item.type === 'daterange') {
        let _skey = item.key
        let _ekey = item.key + '1'
        if (/,/.test(item.key)) {
          _skey = item.key.split(',')[0]
          _ekey = item.key.split(',')[1]
        }
        _usefulFields.push(_skey)
        _usefulFields.push(_ekey)
      } else if (item.type === 'date' && _usefulFields.includes(item.key)) {
        _usefulFields.push(item.key + '1')
      } else {
        _usefulFields.push(item.key.replace(/,/ig, ', '))
      }
    })
    this.setState({
      urlFields: urlFields ? urlFields.join(', ') : '',
      usefulFields: _usefulFields.join(', '),
      usefulFields: getSearchFields(searches),
      scripts: fromJS(scripts).toJS()
    })
  }
src/templates/zshare/formconfig.jsx
@@ -74,6 +74,9 @@
      value: 'group',
      text: '日期(组合)'
    }, {
      value: 'range',
      text: '数值(区间)'
    }, {
      value: 'switch',
      text: '开关'
    }, {
src/utils/utils-custom.js
@@ -993,7 +993,7 @@
        forbid: item.query === 'false'
      })
    } else {
      let value = item.initval
      let value = '0'
      let type = item.type
      if (item.type === 'date') {
@@ -1009,13 +1009,11 @@
      } else if (item.type === 'daterange') {
        value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000'
      } else if (item.type === 'range') {
        value = `${item.minValue},${item.maxValue}`
        value = item.initval || `${item.minValue || '-999999'},${item.maxValue || '999999'}`
      } else if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) {
        type = 'multi'
        value = '0'
      } else {
        value = '0'
      }
      newsearches.push({
        key: item.field,
        match: item.match,
@@ -1055,9 +1053,12 @@
      searchText.push(`('${item.value}' ${item.match} '%'+${item.key}+'%')`)
    } else if (item.type === 'date') {
      searchText.push('(' + item.key + ' ' + item.match + ' \'' + item.value + '\')')
    } else if (item.type === 'dateweek' || item.type === 'range') {
    } else if (item.type === 'dateweek') {
      let val = item.value.split(',')
      searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')')
    } else if (item.type === 'range') {
      let val = item.value.split(',')
      searchText.push('(' + item.key + ' >= ' + (val[0] || -999999) + ' AND ' + item.key + ' <= ' + (val[1] || 999999) + ')')
    } else if (item.type === 'datemonth') {
      if (item.match === '=') {
        searchText.push('(' + item.key + ' = \'' + item.value + '\')')
@@ -1108,7 +1109,7 @@
        })
      }
      
    } else if (['dateweek', 'range'].includes(item.type)) {
    } else if (item.type === 'dateweek') {
      let val = item.value.split(',')
      options.push({
        reg: new RegExp('@' + item.key + '@', 'ig'),
@@ -1116,6 +1117,15 @@
      }, {
        reg: new RegExp('@' + item.key + '1@', 'ig'),
        value: `'${val[1]}'`
      })
    } else if (item.type === 'range') {
      let val = item.value.split(',')
      options.push({
        reg: new RegExp('@' + item.key + '@', 'ig'),
        value: `${val[0] || -999999}`
      }, {
        reg: new RegExp('@' + item.key + '1@', 'ig'),
        value: `${val[1] || 999999}`
      })
    } else if (item.type === 'datemonth') {
      if (item.match === '=') {
@@ -1169,6 +1179,53 @@
}
/**
 * @description 获取搜索字段
 */
export function getSearchFields (searches) {
  if (!searches) return ''
  let _usefulFields = []
  searches.forEach(item => {
    if (!item.field) return
    if (item.type === 'group') {
      _usefulFields.push(item.field)
      _usefulFields.push(item.datefield)
      _usefulFields.push(item.datefield + '1')
    } else if (item.type === 'dateweek') {
      _usefulFields.push(item.field)
      _usefulFields.push(item.field + '1')
    } else if (item.type === 'datemonth') {
      if (item.match === '=') {
        _usefulFields.push(item.field)
      } else {
        _usefulFields.push(item.field)
        _usefulFields.push(item.field + '1')
      }
    } else if (item.type === 'range') {
      _usefulFields.push(item.field)
      _usefulFields.push(item.field + '1')
    } else if (item.type === 'daterange') {
      let _skey = item.field
      let _ekey = item.field + '1'
      if (/,/.test(item.field)) {
        _skey = item.field.split(',')[0]
        _ekey = item.field.split(',')[1]
      }
      _usefulFields.push(_skey)
      _usefulFields.push(_ekey)
    } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
      _usefulFields.push(item.field + '1')
    } else {
      _usefulFields.push(item.field)
    }
  })
  return _usefulFields.join(', ')
}
/**
 * @description 重置移动端style
 * @return {Object}  style
 */
src/utils/utils.js
@@ -538,6 +538,11 @@
          newsearches[item.key] = _startval
          newsearches[item.key + '1'] = _endval
        }
      } else if (item.type === 'range') {
        let val = item.value.split(',')
        newsearches[item.key] = val[0] || -999999
        newsearches[item.key + '1'] = val[1] || 999999
      } else if (item.type === 'dateweek') {
        let _startval = ''
        let _endval = ''
@@ -685,7 +690,7 @@
      } else if (item.type === 'range') {
        let val = item.value.split(',')
        searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')')
        searchText.push('(' + item.key + ' >= ' + (val[0] || -999999) + ' AND ' + item.key + ' <= ' + (val[1] || 999999) + ')')
      } else {
        searchText.push('(' + item.key + ' ' + item.match + ' \'' + item.value + '\')')
      }
@@ -756,6 +761,17 @@
          options.push(item)
          options.push(copy)
        }
      } else if (item.type === 'range') {
        let val = item.value.split(',')
        let copy = JSON.parse(JSON.stringify(item))
        copy.key = copy.key + '1'
        copy.value = val[1] || 999999
        item.value = val[0] || -999999
        options.push(item)
        options.push(copy)
      } else if (item.type === 'dateweek') {
        let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
        let _endval = item.value ? moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'
src/views/tabledesign/source.jsx
@@ -51,6 +51,26 @@
      type: 'search',
      label: '日期(组合)',
      subType: 'group'
    },
    {
      type: 'search',
      label: '数值(区间)',
      subType: 'range'
    },
    {
      type: 'search',
      label: '开关',
      subType: 'switch'
    },
    {
      type: 'search',
      label: '单选框',
      subType: 'radio'
    },
    {
      type: 'search',
      label: '勾选框',
      subType: 'check'
    }
  ],
  actionItems: [