king
2025-01-24 e1cee96b38805bcccf48e7bcb9d296f2bc54c720
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Input } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
 
const { TextArea } = Input
 
class MainSearch extends Component {
  static propTpyes = {
    config: PropTypes.object,
    updatemenu: PropTypes.func
  }
 
  changeName = (e) => {
    let value = e.target.value || ''
    if (value.length > 100) return
 
    this.setState({}, () => {
      this.props.updatemenu({...this.props.config, tabName: value})
    })
  }
 
  changeNo = (e) => {
    let value = e.target.value || ''
    if (value.length > 100) return
    this.setState({}, () => {
      this.props.updatemenu({...this.props.config, tabNo: value})
    })
  }
 
  changeRemark = (e) => {
    let value = e.target.value || ''
    if (value.length > 100) return
    this.setState({}, () => {
      this.props.updatemenu({...this.props.config, Remark: value})
    })
  }
 
  shouldComponentUpdate (nextProps, nextState) {
    return is(fromJS(this.props), fromJS(nextProps))
  }
 
  render() {
    const { config } = this.props
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 24 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 24 }
      }
    }
 
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form" id="subqazxcvbn">
        <Row gutter={24}>
          <Col span={24}>
            <Form.Item label="页面名称">
              {getFieldDecorator('tabName', {
                initialValue: config.tabName,
                rules: [
                  {
                    required: true,
                    message: '请输入页面名称!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="菜单参数">
              {getFieldDecorator('tabNo', {
                initialValue: config.tabNo,
                rules: [
                  {
                    required: true,
                    message: '请输入菜单参数!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="备注">
              {getFieldDecorator('Remark', {
                initialValue: config.Remark,
                rules: [
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<TextArea rows={2} placeholder="" autoComplete="off" onChange={this.changeRemark}/>)}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )
  }
}
 
export default Form.create()(MainSearch)