king
2021-09-01 31ec63f0419895876cbaba99637a884a32d33d0d
src/mob/searchconfig/settingform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select } from 'antd'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
@@ -21,7 +21,7 @@
    if (roleList) {
      try {
        roleList = JSON.parse(roleList)
      } catch {
      } catch (e) {
        roleList = []
      }
    } else {
@@ -69,7 +69,7 @@
    }
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form modal-setting-form">
      <Form {...formItemLayout} className="mob-search-setting-form">
        <Row gutter={24}>
          <Col span={12}>
            <Form.Item label="顶部样式">
@@ -83,8 +83,13 @@
              )}
            </Form.Item>
          </Col>
          {type === 'title' ? <Col span={12}>
            <Form.Item label="标题">
          <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="使用搜索栏时,标题用于搜索条件隐藏时显示。">
                <Icon type="question-circle" />
                标题
              </Tooltip>
            }>
              {getFieldDecorator('title', {
                initialValue: config.setting.title,
                rules: [
@@ -95,7 +100,7 @@
                ]
              })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col> : null}
          </Col>
          {type === 'search' ? <Col span={12}>
            <Form.Item label="搜索字段">
              {getFieldDecorator('field', {
@@ -131,9 +136,34 @@
            </Form.Item>
          </Col> : null}
          {type === 'search' ? <Col span={12}>
            <Form.Item label="匹配方式">
              {getFieldDecorator('match', {
                initialValue: config.setting.match || 'like'
              })(
                <Radio.Group>
                  <Radio value="like">like</Radio>
                  <Radio value="not like">not like</Radio>
                  <Radio value="=">=</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          {type === 'search' ? <Col span={12}>
            <Form.Item label="必填">
              {getFieldDecorator('required', {
                initialValue: config.setting.required || 'false'
              })(
                <Radio.Group>
                  <Radio value="true">是</Radio>
                  <Radio value="false">否</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          {type === 'search' ? <Col span={12}>
            <Form.Item label="隐藏">
              {getFieldDecorator('Hide', {
                initialValue: config.setting.Hide || 'false'
              })(
                <Radio.Group>
                  <Radio value="true">是</Radio>
@@ -167,6 +197,18 @@
            </Form.Item>
          </Col>
          {type === 'search' ? <Col span={12}>
            <Form.Item label="扫码">
              {getFieldDecorator('scan', {
                initialValue: config.setting.scan || 'false'
              })(
                <Radio.Group>
                  <Radio value="true">开启</Radio>
                  <Radio value="false">关闭</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          {type === 'search' ? <Col span={12}>
            <Form.Item label="黑名单">
              {getFieldDecorator('blacklist', {
                initialValue: config.setting.blacklist || []