king
2020-03-17 5c8860f3cd8921e7eb0da7749628e9dc669b3203
src/templates/tableshare/searchform/index.jsx
@@ -32,7 +32,7 @@
    let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal
    let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio']                // 默认显示项
    let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist']                // 默认显示项
    if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
      _options = [..._options, 'resourceType', 'options', 'display', 'quick']
@@ -104,7 +104,7 @@
    const { resourceType } = this.state
    if (key === 'type') {
      let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio']
      let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist']
      if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
        _options = [..._options, 'resourceType', 'options', 'display', 'quick']
@@ -189,7 +189,7 @@
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio']
      let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio', 'blacklist']
      if (value === '0') {
        _options = [..._options, 'options', 'quick']
@@ -365,6 +365,26 @@
            <EditTable data={item.initVal} type={this.state.openType} ref="editTable"/>
          </Col>
        )
      } else if (item.type === 'multiselect') { // 多选
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || []
              })(
                <Select
                  showSearch
                  mode="multiple"
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {item.options.map((option, i) =>
                    <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      }
    })