king
2021-05-12 cf804e19634ff953bb132af1b2f46905d80c1e3a
2021-05-12
21个文件已修改
2个文件已添加
1077 ■■■■ 已修改文件
src/assets/css/viewstyle.scss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/settingform/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/wrapsetting/settingform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/calendar/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/data-card/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/dategroup/index.jsx 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/advanceform/index.jsx 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/advanceform/index.scss 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 480 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.scss 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/datasource/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/viewstyle.scss
@@ -205,7 +205,7 @@
  .top-search {
    >.ant-row {
      .ant-col.search-button {
        .ant-btn:not(.ant-btn-primary):active, .ant-btn:not(.ant-btn-primary).active, .ant-btn:not(.ant-btn-primary):hover, .ant-btn:not(.ant-btn-primary):focus {
        .ant-btn:not(.ant-btn-primary):not(.ant-btn-link):active, .ant-btn:not(.ant-btn-primary):not(.ant-btn-link).active, .ant-btn:not(.ant-btn-primary):not(.ant-btn-link):hover, .ant-btn:not(.ant-btn-primary):not(.ant-btn-link):focus {
          color: $color7;
          border-color: $color7;
        }
@@ -213,6 +213,14 @@
          background-color: $color6;
          border-color: $color6;
        }
        .ant-btn-link {
          color: $color6;
        }
      }
    }
    .advanced-list {
      .advance-value {
        color: $color6;
      }
    }
  }
src/menu/components/card/cardcomponent/settingform/index.jsx
@@ -17,15 +17,15 @@
  state = {
    type: this.props.setting.type || 'simple',
    click: this.props.setting.click || '',
    isApp: sessionStorage.getItem('appType') === 'pc',
    appType: sessionStorage.getItem('appType'),
    menulist: []
  }
  UNSAFE_componentWillMount() {
    const { isApp } = this.state
    const { appType } = this.state
    let menulist = null
    if (isApp) {
    if (appType) {
      menulist = sessionStorage.getItem('appMenus')
    } else {
      menulist = sessionStorage.getItem('fstMenuList')
@@ -67,7 +67,7 @@
  render() {
    const { setting, cards } = this.props
    const { getFieldDecorator } = this.props.form
    const { menulist, click, isApp } = this.state
    const { menulist, click, appType } = this.state
    const formItemLayout = {
      labelCol: {
@@ -102,7 +102,7 @@
                })(<InputNumber min={1} max={24} precision={0} onPressEnter={this.handleSubmit}/>)}
              </Form.Item>
            </Col>
            <Col span={12}>
            {appType !== 'mob' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="选择复式卡时,可配置鼠标悬浮时的显示信息。">
                  <Icon type="question-circle" />
@@ -118,7 +118,7 @@
                  </Radio.Group>
                )}
              </Form.Item>
            </Col>
            </Col> : null}
            {this.state.type === 'multi' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="复式卡片鼠标悬浮信息的动画效果。">
@@ -167,7 +167,7 @@
                )}
              </Form.Item>
            </Col>
            {!isApp && click === 'menu' ? <Col span={12}>
            {!appType && click === 'menu' ? <Col span={12}>
              <Form.Item label="菜单">
                {getFieldDecorator('menu', {
                  initialValue: setting.menu || [],
@@ -182,7 +182,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {isApp && click === 'menu' ? <Col span={12}>
            {appType && click === 'menu' ? <Col span={12}>
              <Form.Item label="关联菜单">
                {getFieldDecorator('menu', {
                  initialValue: setting.menu || '',
@@ -217,7 +217,7 @@
                })( <TextArea rows={2}/> )}
              </Form.Item>
            </Col> : null}
            {isApp ? <Col span={12}>
            {appType === 'pc' ? <Col span={12}>
              <Form.Item label="打开方式">
                {getFieldDecorator('open', {
                  initialValue: setting.open || 'blank'
src/menu/components/search/main-search/wrapsetting/settingform/index.jsx
@@ -110,6 +110,18 @@
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。">
                  <Icon type="question-circle" />
                  高级搜索
                </Tooltip>
              }>
                {getFieldDecorator('advanceWidth', {
                  initialValue: wrap.advanceWidth || 1000
                })(<InputNumber min={10} max={3000} precision={0}/>)}
              </Form.Item>
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="右对齐时,隐藏搜索按钮。">
                  <Icon type="question-circle" />
                  对齐
src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx
@@ -215,6 +215,18 @@
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。">
                  <Icon type="question-circle" />
                  高级搜索
                </Tooltip>
              }>
                {getFieldDecorator('advanceWidth', {
                  initialValue: wrap.advanceWidth || 1000
                })(<InputNumber min={10} max={3000} precision={0} onPressEnter={this.handleSubmit}/>)}
              </Form.Item>
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="双击表格中行,触发的按钮。">
                  <Icon type="question-circle" />
                  双击事件
src/tabviews/calendar/index.jsx
@@ -515,13 +515,13 @@
  render() {
    const { menuType } = this.props
    const { BID, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state
    const { BID, setting, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state
    return (
      <div className="calendar-page" id={this.state.ContainerId}>
        {loadingview && <Spin size="large" />}
        {searchlist && searchlist.length > 0 ?
          <MainSearch BID={BID} searchlist={searchlist} menuType={menuType} refreshdata={this.refreshbysearch}/> : null
          <MainSearch BID={BID} searchlist={searchlist} setting={setting} menuType={menuType} refreshdata={this.refreshbysearch}/> : null
        }
        {config && config.calendar ? <CalendarComponent calendar={config.calendar} loading={loading} data={data} triggerDate={this.triggerDate} changeDate={this.changeDate}/> : null}
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
src/tabviews/commontable/index.jsx
@@ -1048,7 +1048,7 @@
      <div className="commontable" id={this.state.ContainerId}>
        {loadingview ? <Spin size="large" /> : null}
        {searchlist && searchlist.length ?
          <MainSearch BID={BID} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
          <MainSearch BID={BID} searchlist={searchlist} setting={setting} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
        }
        {setting ? <Row className="chart-view" gutter={16}>
          {/* 视图组 */}
src/tabviews/custom/components/card/data-card/index.jsx
@@ -131,7 +131,7 @@
      this.setState({sync: false, data: _data})
    } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      if (config.setting.syncRefresh === 'true') {
        this.setState({}, () => {
        this.setState({pageIndex: 1}, () => {
          this.loadData()
        })
      }
@@ -541,7 +541,7 @@
    }
    return (
      <div className="custom-data-card-box" style={{...config.style, minHeight: config.wrap.minHeight}}>
      <div className="custom-data-card-box" style={config.style}>
        {loading ?
          <div className="loading-mask">
            {data ? <div className="ant-spin-blur"></div> : null}
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -425,7 +425,7 @@
    const { config, loading, data, activeKey } = this.state
    return (
      <div className="custom-prop-card-box" style={{...config.style, minHeight: config.wrap.minHeight}}>
      <div className="custom-prop-card-box" style={config.style}>
        {loading ?
          <div className="loading-mask">
            <div className="ant-spin-blur"></div>
src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -315,7 +315,7 @@
    const { config, loading, data, card } = this.state
    return (
      <div className="custom-data-carousel-box" style={{...config.style, minHeight: config.wrap.minHeight}}>
      <div className="custom-data-carousel-box" style={config.style}>
        {loading ?
          <div className="loading-mask">
            {data ? <div className="ant-spin-blur"></div> : null}
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -517,7 +517,7 @@
      this.setState({sync: false, data: _data})
    } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      if (config.setting.syncRefresh === 'true') {
        this.setState({}, () => {
        this.setState({pageIndex: 1}, () => {
          this.reloadtable()
        })
      }
@@ -555,7 +555,7 @@
      <div className="custom-normal-table" style={config.style}>
        <NormalHeader config={config}/>
        {searchlist && searchlist.length ?
          <MainSearch BID={BID} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
          <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
        }
        <MainAction
          BID={BID}
src/tabviews/subtable/index.jsx
@@ -944,7 +944,7 @@
      <div className="subtable" id={'subtable' + this.props.MenuID}>
        {loadingview && <Spin />}
        {searchlist && searchlist.length ?
          <SubSearch BID={this.props.BID} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
          <SubSearch BID={this.props.BID} setting={setting} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
        }
        {config ? <Row className="chart-view" gutter={16}>
          {/* 视图组 */}
src/tabviews/subtabtable/index.jsx
@@ -776,7 +776,7 @@
      <div className="subtabtable" id={'subtabtable' + this.props.MenuID}>
        {loadingview && <Spin />}
        {searchlist && searchlist.length ?
          <SubSearch BID={this.props.BID} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
          <SubSearch BID={this.props.BID} setting={setting} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
        }
        {config ? <Row className="chart-view" gutter={16}>
          {/* 视图组 */}
src/tabviews/zshare/dategroup/index.jsx
@@ -88,7 +88,14 @@
    }
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (this.props.reset !== nextProps.reset) {
      this.reset()
    }
  }
  onChange = (date, type) => {
    const { card } = this.props
    let values = []
    if (type === 'day') {
      values = [moment(date).format('YYYY-MM-DD'), moment(date).format('YYYY-MM-DD')]
@@ -110,16 +117,17 @@
      active: type,
      dateRange: values
    }, () => {
      this.props.onGroupChange()
      this.props.onGroupChange({[card.datefield]: values, [card.field]: type})
    })
  }
  clearTime = () => {
    const { card } = this.props
    this.setState({
      active: '',
      dateRange: ''
    }, () => {
      this.props.onGroupChange()
      this.props.onGroupChange({[card.datefield]: '', [card.field]: ''})
    })
  }
@@ -130,35 +138,6 @@
      active: initType,
      dateRange: initDateRange
    })
  }
  getSearchItems = () => {
    const { card } = this.props
    const { dateRange, active } = this.state
    let items = []
    items.push({
      type: 'daterange',
      key: card.datefield,
      value: dateRange,
      label: card.label,
      match: 'between',
      required: card.required === 'true'
    })
    if (card.transfer === 'true') {
      items.push({
        type: card.type,
        key: card.field,
        value: active,
        label: card.label,
        match: '=',
        forbid: true,
        required: card.required === 'true'
      })
    }
    return items
  }
  render() {
@@ -220,7 +199,7 @@
          {dateRange.join(' ~ ')}
          <Icon type="close-circle" onClick={this.clearTime} className="ant-calendar-picker-clear" />
        </div> : null}
        {!dateRange && card.required === 'true' ? <div className="ant-form-explain">请选择{card.label}!</div> : null}
        {!dateRange && card.required ? <div className="ant-form-explain">请选择{card.label}!</div> : null}
      </div>
    )
  }
src/tabviews/zshare/topSearch/advanceform/index.jsx
New file
@@ -0,0 +1,286 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, DatePicker } from 'antd'
import Utils from '@/utils/utils.js'
import './index.scss'
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
class AdvanceSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object,         // 字典
    searchValues: PropTypes.object, // 搜索条件值
    searchlist: PropTypes.array,    // 搜索条件列表
    handleSearch: PropTypes.func    // 搜索条件提交
  }
  state = {
    dict: this.props.dict,
    formId: Utils.getuuid(), // 搜索表单Id
    searchlist: fromJS(this.props.searchlist).toJS()
  }
  resetform = (formlist, supfields, index, fieldsvalue) => {
    index++
    let subfields = []
    supfields.forEach(supfield => {
      formlist = formlist.map(item => {
        if (item.type === 'link' && item.linkField === supfield.field) {
          item.options = item.oriOptions.filter(option => option.ParentID === supfield.initval || option.Value === '')
          item.initval = item.options[0] ? item.options[0].Value : ''
          if (this.props.form.getFieldValue(item.field) !== undefined) {
            fieldsvalue[item.field] = item.initval
          }
          subfields.push(item)
        }
        return item
      })
    })
    if (subfields.length === 0 || index > 6) {
      return formlist
    } else {
      return this.resetform(formlist, subfields, index, fieldsvalue)
    }
  }
  selectChange = (_field, value) => {
    let formlist = fromJS(this.state.searchlist).toJS()
    let subfields = []
    let fieldsvalue = {}
    formlist = formlist.map(item => {
      if (item.type === 'link' && item.linkField === _field.field) {
        item.options = item.oriOptions.filter(option => option.ParentID === value || option.Value === '')
        item.initval = item.options[0] ? item.options[0].Value : ''
        if (this.props.form.getFieldValue(item.field) !== undefined) {
          fieldsvalue[item.field] = item.initval
        }
        subfields.push(item)
      }
      return item
    })
    if (subfields.length === 0) {
      return
    }
    formlist = this.resetform(formlist, subfields, 0, fieldsvalue)
    if (Object.keys(fieldsvalue).length > 0) {
      this.props.form.setFieldsValue(fieldsvalue)
    }
    this.setState({
      searchlist: formlist
    })
  }
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { searchValues } = this.props
    const { dict, formId } = this.state
    const fields = []
    this.state.searchlist.forEach((item, index) => {
      if (item.advanced !== 'true' || item.Hide === 'true') return
      let initval = searchValues[item.field] || ''
      if (item.type === 'text') { // 文本搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.input'] + item.label + '!'
                  }
                ]
              })(<Input placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onPressEnter={this.props.handleSearch} />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select' || item.type === 'link') { // 下拉搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Select
                  showSearch
                  onChange={(value) => {this.selectChange(item, value)}}
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 || option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  getPopupContainer={() => formId ? document.getElementById(formId) : document.body}
                >
                  {item.options.map((option, i) =>
                    <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'multiselect') { // 下拉多选
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Select
                  showSearch
                  mode="multiple"
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  getPopupContainer={() => formId ? document.getElementById(formId) : document.body}
                >
                  {item.options.map((option, i) =>
                    <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'date') { // 时间搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval || null,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <DatePicker getCalendarContainer={() => formId ? document.getElementById(formId) : document.body} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'datemonth') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval || null,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <MonthPicker getCalendarContainer={() => formId ? document.getElementById(formId) : document.body} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'dateweek') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field, {
                initialValue: initval || null,
                rules: [
                  {
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <WeekPicker getCalendarContainer={() => formId ? document.getElementById(formId) : document.body} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'daterange') {
        let _defaultValue = initval
        if (!initval) {
          _defaultValue = [null, null]
        }
        fields.push(
          <Col className="daterange" span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
              {getFieldDecorator(item.field,
                {
                  initialValue: _defaultValue,
                  rules: [
                    {
                      required: item.required,
                      message: dict['form.required.select'] + item.label + '!'
                    }
                  ]
                })(
                <RangePicker
                  placeholder={['开始日期', '结束日期']}
                  renderExtraFooter={() => 'extra footer'}
                  getCalendarContainer={() => formId ? document.getElementById(formId) : document.body}
                />
              )}
            </Form.Item>
          </Col>
        )
      }
    })
    return fields
  }
  handleConfirm = () => {
    // 回车或点击搜索
    return new Promise((resolve, reject) => {
      this.props.form.validateFields((err, values) => {
        if (!err) {
          resolve(values)
        }
      })
    })
  }
  render() {
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    return (
      <Form {...formItemLayout} className="advance-search" id={this.state.formId}>
        <Row gutter={24}>{this.getFields()}</Row>
      </Form>
    )
  }
}
export default Form.create()(AdvanceSearch)
src/tabviews/zshare/topSearch/advanceform/index.scss
New file
@@ -0,0 +1,28 @@
.advance-search {
  background: #ffffff;
  .ant-form-item {
    display: flex;
    margin-bottom: 0px;
    min-height: 60px;
    .ant-form-explain {
      white-space: nowrap;
    }
  }
  .ant-form-item-control-wrapper {
    flex: 1;
    width: calc(100% - 100px);
  }
  .ant-form-item-label {
    text-overflow: ellipsis;
  }
  .daterange .ant-calendar-picker-input {
    padding: 4px 20px 4px 5px;
    font-size: 13px;
  }
  .ant-select-dropdown {
    z-index: 10 !important;
  }
  .ant-calendar-picker-container {
    z-index: 10 !important;
  }
}
src/tabviews/zshare/topSearch/index.jsx
@@ -1,12 +1,13 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Button, Select, DatePicker, notification } from 'antd'
import { Form, Row, Col, Input, Button, Select, DatePicker, notification, Modal, Icon } from 'antd'
import moment from 'moment'
import Api from '@/api'
import options from '@/store/options.js'
import DateGroup from '@/tabviews/zshare/dategroup'
import asyncSpinComponent from '@/utils/asyncSpinComponent'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
@@ -14,12 +15,15 @@
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
const MutilForm = asyncSpinComponent(() => import('./advanceform'))
class MainSearch extends Component {
  static propTpyes = {
    BID: PropTypes.any,          // 父级Id,用于查询下拉选择项
    menuType: PropTypes.any,     // 菜单权限,是否为HS
    searchlist: PropTypes.array, // 搜索条件列表
    config: PropTypes.object,    // 组件配置信息(自定义页面)
    setting: PropTypes.object,   // 组件配置信息(自定义页面)
    refreshdata: PropTypes.func  // 刷新数据
  }
@@ -27,25 +31,22 @@
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    oriId: Utils.getuuid(),  // 搜索表单Id
    formId: '',              // 搜索表单Id
    match: null,             // 搜索条件匹配规则
    style: null,             // 搜索条件类型
    label: null,             // 提示文字
    required: null,          // 是否必填
    searchlist: null,        // 搜索项
    groups: null,            // 组合搜索项
    reset: true,             // 控制组合搜索项重置
    float: '',               // 浮动
    showButton: true,        // 是否显示搜索按钮
    searchStyle: null        // 搜索条件样式
    showAdvanced: false,     // 是否显示高级搜索
    searchStyle: null,       // 搜索条件样式
    searchValues: {},        // 搜索条件保存值
    advanceValues: [],       // 高级搜索条件保存值
    visible: false,
    adModelWidth: '1000px',
  }
  UNSAFE_componentWillMount () {
    const { config, menuType, searchlist } = this.props
    const { config, menuType, searchlist, setting } = this.props
    let _searchlist = []
    let match = {}
    let label = {}
    let style = {}
    let required = {}
    let _list = []
    let fieldMap = new Map()
    let mainItems = []  // 云端或单点数据
@@ -54,7 +55,23 @@
    let float = ''
    let showButton = true
    let searchStyle = null
    let searchValues = {}
    let advanceValues = []
    let showAdvanced = false
    let adModelWidth = 1000
    let formId = Utils.getuuid()
    if (setting && setting.advanceWidth) {
      adModelWidth = setting.advanceWidth
    } else if (config && config.wrap && config.wrap.advanceWidth) {
      adModelWidth = config.wrap.advanceWidth
    }
    if (adModelWidth < 100) {
      adModelWidth = adModelWidth + 'vw'
    } else {
      adModelWidth = adModelWidth + 'px'
    }
    if (searchlist) {
      _searchlist = fromJS(searchlist).toJS()
@@ -77,10 +94,7 @@
      }
      fieldMap.set(item.field, item)
      match[item.field] = item.match
      label[item.field] = item.label
      style[item.field] = item.type
      required[item.field] = item.required === 'true'
      item.required = item.required === 'true'
      if (['select', 'link', 'multiselect'].includes(item.type)) {
        if (item.setAll === 'true' && item.type !== 'multiselect') {
@@ -120,8 +134,23 @@
      _list.push(item)
    })
    let _groups = []
    _list = _list.map(item => {
      if (item.Hide === 'true') {
        searchValues[item.field] = this.getInitValue(item)
      } else if (showButton && item.advanced === 'true') {
        showAdvanced = true
        let _value = this.getInitValue(item)
        searchValues[item.field] = _value
        let _val = this.getAdvanceValue(item, _value)
        if (_val) {
          advanceValues.push({field: item.field, type: item.type, label: item.label, value: _val})
        }
      } else if (item.type === 'group') {
        searchValues[item.datefield] = this.getInitValue(item)
        searchValues[item.field] = item.initval && item.initval[0] ? item.initval[0] : ''
      }
      if (item.type === 'link') {
        let supItem = fieldMap.get(item.linkField)
        
@@ -136,24 +165,21 @@
          item.supInitVal = supItem.initval
          item.options = item.oriOptions.filter(option => option.ParentID === supItem.initval || option.Value === '')
        }
      } else if (item.type === 'group' && item.Hide !== 'true') {
        _groups.push(fromJS(item).toJS())
      }
      return item
    })
    this.setState({
      match,
      label,
      style,
      float,
      formId,
      required,
      showButton,
      searchStyle,
      searchlist: _list,
      groups: _groups
      searchValues,
      showAdvanced,
      adModelWidth,
      advanceValues,
      searchlist: _list
    }, () => {
      if (menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) {
        this.improveSimpleSearch(deForms)
@@ -161,6 +187,98 @@
        this.improveSearch(mainItems, localItems)
      }
    })
  }
  getInitValue = (item) => {
    let value = item.initval || ''
    if (item.type === 'multiselect') { // 下拉多选
      value = item.initval ? item.initval.split(',').filter(Boolean) : []
    } else if (item.type === 'date') { // 时间搜索
      value = item.initval ? moment().subtract(item.initval, 'days') : ''
    } else if (item.type === 'datemonth') {
      value = item.initval ? moment().subtract(item.initval, 'month') : ''
    } else if (item.type === 'dateweek') {
      value = item.initval ? moment().subtract(item.initval * 7, 'days') : ''
    } else if (item.type === 'daterange') {
      if (item.initval) {
        try {
          let _initval = JSON.parse(item.initval)
          value = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
        } catch {
          value = ''
        }
      }
    } else if (item.type === 'group' && item.initval && item.initval.length > 0) {
      let _type = item.initval[0]
      let _val = item.initval[1]
      if (_type === 'day') {
        value = [moment().subtract(_val, 'days').format('YYYY-MM-DD'), moment().subtract(_val, 'days').format('YYYY-MM-DD')]
      } else if (_type === 'week') {
        value = [moment().subtract(_val * 7, 'days').startOf('week').format('YYYY-MM-DD'), moment().subtract(_val * 7, 'days').endOf('week').format('YYYY-MM-DD')]
      } else if (_type === 'month') {
        value = [moment().subtract(_val, 'month').startOf('month').format('YYYY-MM-DD'), moment().subtract(_val, 'month').endOf('month').format('YYYY-MM-DD')]
      } else if (_type === 'quarter') {
        let _differ = parseInt(moment().format('MM')) % 3
        let _pdiffer = 0
        let _ndiffer = 0
        // 差值计算
        switch(_differ) {
          case 0:
            _pdiffer = 2
            _ndiffer = 0
            break
          case 1:
            _pdiffer = 0
            _ndiffer = -2
            break
          case 2:
            _pdiffer = 1
            _ndiffer = -1
            break
          default:
        }
        value = [moment().subtract(_pdiffer + _val * 3, 'month').startOf('month').format('YYYY-MM-DD'), moment().subtract(_ndiffer + _val * 3, 'month').endOf('month').format('YYYY-MM-DD')]
      } else if (_type === 'year') {
        let _year = parseInt(moment().format('YYYY')) - _val
        value = [_year + '-01-01', _year + '-12-31']
      } else if (_type === 'customized') {
        try {
          _val = JSON.parse(_val)
        } catch {
          _val = [0, 0]
        }
        value = [moment().subtract(_val[0], 'days').format('YYYY-MM-DD'), moment().subtract(_val[1], 'days').format('YYYY-MM-DD')]
      }
    }
    return value
  }
  getAdvanceValue = (item, value) => {
    if (!value || (Array.isArray(value) && value.length === 0)) return ''
    let val = ''
    if (item.type === 'multiselect') {
      val = value.join(', ')
    } else if (item.type === 'daterange') {
      if (value[0] && value[1]) {
        val = `${moment(value[0]).format('YYYY-MM-DD')} ~ ${moment(value[1]).format('YYYY-MM-DD')}`
      }
    } else if (item.type === 'dateweek') {
      val = `${moment(value).startOf('week').format('YYYY-MM-DD')} ~ ${moment(value).endOf('week').format('YYYY-MM-DD')}`
    } else if (item.type === 'date') {
      val = moment(value).format('YYYY-MM-DD')
    } else if (item.type === 'datemonth') {
      val = moment(value).format('YYYY-MM')
    } else {
      val = value.replace(/(^\s*|\s*$)/ig, '')
    }
    return val
  }
  // 查询下拉菜单
@@ -455,11 +573,11 @@
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { dict, showButton, formId } = this.state
    const { dict, showButton, formId, showAdvanced } = this.state
    const fields = []
    this.state.searchlist.forEach((item, index) => {
      if (item.Hide === 'true') return
      if (item.Hide === 'true' || (showAdvanced && item.advanced === 'true')) return
      
      if (item.type === 'text') { // 文本搜索
        fields.push(
@@ -469,7 +587,7 @@
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.input'] + item.label + '!'
                  }
                ]
@@ -477,7 +595,7 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
      } else if (item.type === 'select' || item.type === 'link') { // 下拉搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''}>
@@ -485,7 +603,7 @@
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
@@ -513,7 +631,7 @@
                initialValue: _initval,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
@@ -541,7 +659,7 @@
                initialValue: item.initval ? moment().subtract(item.initval, 'days') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
@@ -559,7 +677,7 @@
                initialValue: item.initval ? moment().subtract(item.initval, 'month') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
@@ -577,7 +695,7 @@
                initialValue: item.initval ? moment().subtract(item.initval * 7, 'days') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    required: item.required,
                    message: dict['form.required.select'] + item.label + '!'
                  }
                ]
@@ -607,7 +725,7 @@
                  initialValue: _defaultValue,
                  rules: [
                    {
                      required: item.required === 'true',
                      required: item.required,
                      message: dict['form.required.select'] + item.label + '!'
                    }
                  ]
@@ -625,8 +743,8 @@
      } else if (item.type === 'group') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''} className={item.required === 'true' ? 'group-required' : ''}>
              <DateGroup ref={item.uuid} position={index} card={item} onGroupChange={this.searchChange} />
            <Form.Item label={item.labelShow !== 'false' ? item.label : ''} className={item.required ? 'group-required' : ''}>
              <DateGroup reset={this.state.reset} position={index} card={item} onGroupChange={this.onGroupChange} />
            </Form.Item>
          </Col>
        )
@@ -643,6 +761,9 @@
            <Button style={{ marginLeft: 8 }} onClick={this.handleReset}>
              {dict['main.reset']}
            </Button>
            {showAdvanced ? <Button type="link" onClick={this.handleAdvance}>
              高级
            </Button> : null}
          </Form.Item>
        </Col>
      )
@@ -651,47 +772,14 @@
    return fields
  }
  addHideFieldValue = (values) => {
    const { searchlist } = this.state
    let hideValue = {}
    searchlist.forEach(item => {
      if (item.Hide === 'true') {
        let value = ''
        if (item.type === 'multiselect') { // 下拉多选
          value = item.initval ? item.initval.split(',').filter(Boolean) : []
        } else if (item.type === 'date') { // 时间搜索
          value = item.initval ? moment().subtract(item.initval, 'days') : ''
        } else if (item.type === 'datemonth') {
          value = item.initval ? moment().subtract(item.initval, 'month') : ''
        } else if (item.type === 'dateweek') {
          value = item.initval ? moment().subtract(item.initval * 7, 'days') : ''
        } else if (item.type === 'daterange') {
          if (item.initval) {
            try {
              let _initval = JSON.parse(item.initval)
              value = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
            } catch {
              value = ''
            }
          }
        } else if (item.type !== 'group') {
          value = item.initval
        }
        hideValue[item.field] = value
      }
    })
    return {...hideValue, ...values}
  handleAdvance = () => {
    this.setState({visible: true})
  }
  handleSearch = (e) => {
  handleSearch = () => {
    // 回车或点击搜索
    e.preventDefault()
    this.props.form.validateFields((err, values) => {
      if (!err) {
        values = this.addHideFieldValue(values)
        let searches = this.getFieldsValues(values)
        let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
@@ -712,11 +800,19 @@
    })
  }
  onGroupChange = (values) => {
    const { searchValues } = this.state
    this.setState({
      searchValues: {...searchValues, ...values}
    })
    this.searchChange()
  }
  searchChange = () => {
    this.setState({}, () => {
      this.props.form.validateFields((err, values) => {
        if (!err) {
          values = this.addHideFieldValue(values)
          let searches = this.getFieldsValues(values)
          let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
@@ -734,101 +830,162 @@
   * @description 搜索条件重置
   */
  handleReset = () => {
    const { groups } = this.state
    const { showAdvanced } = this.state
    if (groups.length > 0) {
      groups.forEach(item => {
        this.refs[item.uuid].reset()
      })
    }
    let searchValues = {}
    let advanceValues = []
    let searchlist = this.state.searchlist.map(item => {
      item.initval = item.oriInitval
      if (item.Hide === 'true') {
        searchValues[item.field] = this.getInitValue(item)
      } else if (showAdvanced && item.advanced === 'true') {
        let _value = this.getInitValue(item)
        searchValues[item.field] = _value
        let _val = this.getAdvanceValue(item, _value)
        if (_val) {
          advanceValues.push({field: item.field, type: item.type, label: item.label, value: _val})
        }
      } else if (item.type === 'group') {
        searchValues[item.datefield] = this.getInitValue(item)
        searchValues[item.field] = item.initval && item.initval[0] ? item.initval[0] : ''
      }
      return item
    })
    this.setState({searchlist}, () => {
    this.setState({searchlist, searchValues, advanceValues, reset: !this.state.reset}, () => {
      this.props.form.resetFields()
      this.props.form.validateFields((err, values) => {
        if (!err) {
          // 异步获取更新后的时间组
          this.setState({}, () => {
            values = this.addHideFieldValue(values)
            let searches = this.getFieldsValues(values)
          let searches = this.getFieldsValues(values)
            let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
            if (requireFields.length > 0) {
              let labels = requireFields.map(item => item.label)
              labels = Array.from(new Set(labels))
              notification.warning({
                top: 92,
                message: this.state.dict['form.required.input'] + labels.join('、') + ' !',
                duration: 3
              })
              return
            }
          let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
          if (requireFields.length > 0) {
            let labels = requireFields.map(item => item.label)
            labels = Array.from(new Set(labels))
            notification.warning({
              top: 92,
              message: this.state.dict['form.required.input'] + labels.join('、') + ' !',
              duration: 3
            })
            return
          }
            this.props.refreshdata(searches)
          })
          this.props.refreshdata(searches)
        }
      })
    })
  }
  getFieldsValues = (values) => {
    const { groups } = this.state
    const { searchValues, searchlist } = this.state
    // 获取搜索条件值
    let search = []
    Object.keys(values).forEach(key => {
      let _value = ''
      if (this.state.style[key] === 'daterange') {
        if (values[key].length > 0 && values[key][0] && values[key][1]) {
          _value = [moment(values[key][0]).format('YYYY-MM-DD'), moment(values[key][1]).format('YYYY-MM-DD')]
        }
      } else if (this.state.style[key] === 'dateweek') {
        if (values[key]) {
          _value = [moment(values[key]).startOf('week').format('YYYY-MM-DD'), moment(values[key]).endOf('week').format('YYYY-MM-DD')]
        }
      } else if (this.state.style[key] === 'date') {
        if (values[key]) {
          _value = moment(values[key]).format('YYYY-MM-DD')
        }
      } else if (this.state.style[key] === 'datemonth') {
        if (values[key]) {
          _value = moment(values[key]).format('YYYY-MM')
        }
      } else if (this.state.style[key] === 'multiselect') {
        _value = values[key] || []
      } else {
        _value = (values[key] || values[key] === 0) ? values[key] : ''
        _value = _value.replace(/(^\s*|\s*$)/ig, '')
    searchlist.forEach(item => {
      let cell = {
        type: item.type,
        key: item.field.replace(/@tail@$/, ''),
        label: item.label,
        match: item.match || '=',
        required: item.required,
        value: ''
      }
      if ((item.Hide === 'true' || item.advanced === 'true')) {
        cell.value = searchValues[item.field] || ''
      }
      search.push({
        type: this.state.style[key],
        key: key.replace(/@tail@$/, ''),
        value: _value,
        label: this.state.label[key],
        match: this.state.match[key],
        required: this.state.required[key]
      })
    })
      if (item.type === 'group') {
        cell.type = 'daterange'
        cell.key = item.datefield
        cell.value = searchValues[item.datefield] || ''
        cell.match = 'between'
    if (groups.length > 0) {
      groups.forEach(item => {
        let items = this.refs[item.uuid].getSearchItems()
        search.push(...items)
      })
    }
        search.push(cell)
        if (item.transfer === 'true') {
          let copy = fromJS(cell).toJS()
          copy.type = 'group'
          copy.key = item.field.replace(/@tail@$/, '')
          copy.value = searchValues[item.field] || ''
          copy.match = '='
          copy.forbid = true
          search.push(copy)
        }
      } else {
        let _value = values[item.field] || cell.value || ''
        if (!_value) {
          if (item.type === 'multiselect') {
            cell.value = []
          }
          search.push(cell)
        } else {
          if (item.type === 'daterange') {
            if (_value[0] && _value[1]) {
              _value = [moment(_value[0]).format('YYYY-MM-DD'), moment(_value[1]).format('YYYY-MM-DD')]
            } else {
              _value = ''
            }
          } else if (item.type === 'dateweek') {
            _value = [moment(_value).startOf('week').format('YYYY-MM-DD'), moment(_value).endOf('week').format('YYYY-MM-DD')]
          } else if (item.type === 'date') {
            _value = moment(_value).format('YYYY-MM-DD')
          } else if (item.type === 'datemonth') {
            _value = moment(_value).format('YYYY-MM')
          } else if (item.type === 'multiselect') {
          } else {
            _value = _value.replace(/(^\s*|\s*$)/ig, '')
          }
          cell.value = _value
          search.push(cell)
        }
      }
    })
    return search
  }
  handleOk = () => {
    const { searchValues, searchlist } = this.state
    this.formRef.handleConfirm().then(res => {
      let values = {}
      let advanceValues = []
      searchlist.forEach(item => {
        if (item.advanced === 'true' && item.Hide !== 'true') {
          let _value = res[item.field] || ''
          if (!_value && item.type === 'multiselect') {
            _value = []
          } else if (typeof(_value) === 'string') {
            _value = _value.replace(/(^\s*|\s*$)/ig, '')
          }
          values[item.field] = _value
          let _val = this.getAdvanceValue(item, _value)
          if (_val) {
            advanceValues.push({field: item.field, type: item.type, label: item.label, value: _val})
          }
        }
      })
      this.setState({searchValues: {...searchValues, ...values}, advanceValues, visible: false}, () => {
        this.handleSearch()
      })
    })
  }
  closeAdvanceForm = (cell) => {
    const { searchValues, advanceValues } = this.state
    this.setState({searchValues: {...searchValues, [cell.field]: ''}, advanceValues: advanceValues.filter(item => item.field !== cell.field)}, () => {
      this.handleSearch()
    })
  }
  render() {
    const { float, searchStyle } = this.state
    const { float, searchStyle, visible, searchlist, searchValues, showAdvanced, advanceValues, adModelWidth } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -841,9 +998,42 @@
    }
    return (
      <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId || this.state.oriId}>
        <Row gutter={24}>{this.getFields()}</Row>
      </Form>
      <>
        <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId || this.state.oriId}>
          <Row gutter={24}>{this.getFields()}</Row>
          <Row gutter={24}>
            {showAdvanced ? <div className="advanced-list">
              {advanceValues.map((item, index) => {
                return (
                  <div key={index}>
                    <span>{item.label}: </span>
                    <span className="advance-value">{item.value}</span>
                    <Icon type="close" onClick={() => this.closeAdvanceForm(item)} />
                  </div>)
              })}
            </div> : null}
          </Row>
        </Form>
        <Modal
          title="高级搜索"
          maskClosable={false}
          visible={visible}
          width={adModelWidth}
          closable={false}
          onOk={this.handleOk}
          cancelText={'关闭'}
          onCancel={() => this.setState({visible: false})}
          destroyOnClose
        >
          <MutilForm
            dict={this.state.dict}
            searchlist={searchlist}
            searchValues={searchValues}
            handleSearch={this.handleOk}
            wrappedComponentRef={(inst) => this.formRef = inst}
          />
        </Modal>
      </>
    )
  }
}
src/tabviews/zshare/topSearch/index.scss
@@ -36,6 +36,33 @@
      content: '*';
    }
  }
  .search-button {
    .ant-btn-link, .ant-btn-link:hover, .ant-btn-link:active{
      border-color: transparent;
      span {
        position: relative;
        top: 5px;
      }
    }
  }
  .advanced-list {
    font-size: 13px;
    > div {
      display: inline-block;
      margin-right: 10px;
      border: 1px solid #dddddd;
      padding: 0 4px 0 4px;
      background: rgba(0, 0, 0, 0.02);
      .anticon-close {
        margin-left: 5px;
        cursor: pointer;
        color: #bcbcbc;
        font-size: 12px;
        padding: 2px;
      }
    }
  }
}
.top-search.right {
  >.ant-row {
@@ -43,4 +70,4 @@
      float: right;
    }
  }
}
}
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Checkbox, Cascader } from 'antd'
import { dateOptions, matchReg, formRule } from '@/utils/option.js'
import EditTable from '../searcheditable'
@@ -80,6 +81,18 @@
  },
]
const searchTypeOptions = {
  text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  select: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll'],
  multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll'],
  date: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  dateweek: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  datemonth: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  daterange: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced'],
  group: ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'transfer', 'labelShow']
}
class MainSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object,     // 字典项
@@ -106,23 +119,8 @@
    let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    let _items = formlist.filter(cell => cell.key === 'items')[0].initVal
    let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal
    let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow']                // 默认显示项
    if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
      _options = [..._options, 'resourceType', 'options', 'display']
    } else if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
      _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display', 'database']
    } else if (type === 'group') {
      _options = ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'transfer', 'labelShow']
    }
    if (type === 'select' || type === 'link') {
      _options.push('setAll')
    }
    if (type === 'link') { // 关联类型、增加关联上级的字段名
      _options = [..._options, 'linkField']
    }
    let _options = this.getOptions(type, resourceType)
    
    this.setState({
      openType: type,
@@ -174,6 +172,18 @@
    }
  }
  getOptions = (type, resourceType) => {
    let _options = fromJS(searchTypeOptions[type]).toJS() // 选项列表
    if (['multiselect', 'select', 'link'].includes(type) && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
      _options.push('options')
    } else if (['multiselect', 'select', 'link'].includes(type) && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
      _options.push('dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database')
    }
    return _options
  }
  /**
   * @description 搜索条件类型切换
   */
@@ -182,24 +192,7 @@
    const { resourceType, items } = this.state
    if (key === 'type') {
      let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow']
      if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
        _options = [..._options, 'resourceType', 'options', 'display']
      } else if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
        _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display', 'database']
      } else if (value === 'group') {
        _options = ['label', 'type', 'field', 'datefield', 'initval', 'items', 'ratio', 'blacklist', 'required', 'transfer', 'labelShow']
      }
      if (value === 'select' || value === 'link') {
        _options.push('setAll')
      }
      if (value === 'link') {
        _options = [..._options, 'linkField']
      }
      let _options = this.getOptions(value, resourceType)
      let matchs = []
      this.setState({
@@ -263,22 +256,8 @@
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow']
      let _options = this.getOptions(openType, value)
      if (value === '0') {
        _options = [..._options, 'options']
      } else if (value === '1') {
        _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'database']
      }
      if (openType === 'select' || openType === 'link') {
        _options.push('setAll')
      }
      if (openType === 'link') {
        _options = [..._options, 'linkField']
      }
      this.setState({
        resourceType: value,
        formlist: this.state.formlist.map(form => {
src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification } from 'antd'
import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification, InputNumber } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -312,6 +312,18 @@
                </Radio.Group>)}
              </Form.Item>
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。">
                  <Icon type="question-circle" />
                  高级搜索
                </Tooltip>
              }>
                {getFieldDecorator('advanceWidth', {
                  initialValue: setting.advanceWidth || 1000
                })(<InputNumber min={10} max={3000} precision={0}/>)}
              </Form.Item>
            </Col>
          </Row>
        </Form>
      </div>
src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification, Select } from 'antd'
import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification, Select, InputNumber } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -616,6 +616,18 @@
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。">
                  <Icon type="question-circle" />
                  高级搜索
                </Tooltip>
              }>
                {getFieldDecorator('advanceWidth', {
                  initialValue: setting.advanceWidth || 1000
                })(<InputNumber min={10} max={3000} precision={0}/>)}
              </Form.Item>
            </Col>
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="双击表格中行,触发的按钮。">
                  <Icon type="question-circle" />
                  双击事件
src/templates/sharecomponent/settingcomponent/settingform/datasource/index.scss
@@ -17,6 +17,9 @@
      color: #c49f47;
      margin-right: 3px;
    }
    .ant-input-number {
      width: 100%;
    }
  }
}
src/templates/zshare/editTable/index.jsx
@@ -354,7 +354,7 @@
  
          if (!unique) return
  
          data.unshift(cell)
          data.push(cell)
        })
        this.setState({ data, editingKey: '', visible: false }, () => {
src/templates/zshare/formconfig.jsx
@@ -506,20 +506,6 @@
        text: '>='
      }]
    },
    // {
    //   type: 'select',
    //   key: 'display',
    //   label: Formdict['header.form.display'],
    //   initVal: card.display || 'dropdown',
    //   required: true,
    //   options: [{
    //     value: 'dropdown',
    //     text: Formdict['header.form.dropdown']
    //   // }, {
    //   //   value: 'button',
    //   //   text: Formdict['header.form.button']
    //   }]
    // },
    {
      type: 'radio',
      key: 'database',
@@ -597,6 +583,19 @@
      }]
    },
    {
      type: 'radio',
      key: 'advanced',
      label: '高级搜索',
      initVal: card.advanced || 'false',
      options: [{
        value: 'true',
        text: Formdict['model.true']
      }, {
        value: 'false',
        text: Formdict['model.false']
      }]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: Formdict['header.form.blacklist'],