Selaa lähdekoodia

各字符限制

zhouna 3 vuotta sitten
vanhempi
commit
8653a023a0

+ 3 - 3
src/components/BlockLossManage/editBlock.js

@@ -194,10 +194,10 @@ function EditBlock(props) {
                         name="lossCause"
                         label="丢失原因"
                         wrapperCol={{ span: 18 }}
+						rules={[{ max: 200,message:'丢失原因不能超过200个字符' }]}
                     >
                         <TextArea
                             autoSize={{ minRows: 5, maxRows: 5 }}
-                            maxLength='200'
                         />
                     </Form.Item>
                 </Col>
@@ -215,8 +215,8 @@ function EditBlock(props) {
                         : ''}
                 </Col>
                 <Col span={24} hidden={type == 3} style={{ marginTop: 15 }}>
-                    <Form.Item label="住院序号" name="behospitalCode">
-                        <Input placeholder="请输入" autoComplete='off' onChange={change} maxLength='30'/>
+                    <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30,message:'住院序号不能超过30个字符' }]}>
+                        <Input placeholder="请输入" autoComplete='off' onChange={change} />
                     </Form.Item>
                 </Col>
                 {

+ 6 - 6
src/components/BlockLossManage/index.js

@@ -182,18 +182,18 @@ function BlockLossManage() {
                             </Form.Item>
                         </Col>
                         <Col span={5} key={1}>
-                            <Form.Item label="住院序号" name="behospitalCode">
-                                <Input placeholder="住院序号" autoComplete='off' maxLength='30' />
+                            <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30,message:'住院序号不能超过30个字符' }]}>
+                                <Input placeholder="住院序号" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={2}>
-                            <Form.Item label="文书编号" name="recId">
-                                <Input placeholder="文书编号" autoComplete='off' maxLength='30' />
+                            <Form.Item label="文书编号" name="recId" rules={[{ max: 30,message:'文书编号不能超过30个字符' }]}>
+                                <Input placeholder="文书编号" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={3}>
-                            <Form.Item label="文书标题" name="recTitle">
-                                <Input placeholder="文书标题" autoComplete='off' maxLength='30' />
+                            <Form.Item label="文书标题" name="recTitle" rules={[{ max: 30,message:'文书标题不能超过30个字符' }]}>
+                                <Input placeholder="文书标题" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={4}>

+ 3 - 3
src/components/FieldProblem/editProblem.js

@@ -198,10 +198,10 @@ function EditBlock(props) {
                         name="description"
                         label="备注"
                         wrapperCol={{ span: 18 }}
+						rules={[{ max: 200,message:'备注不能超过200个字符' }]}
                     >
                         <TextArea
                             autoSize={{ minRows: 5, maxRows: 5 }}
-                            maxLength='200'
                         />
                     </Form.Item>
                 </Col>
@@ -217,8 +217,8 @@ function EditBlock(props) {
                         : ''}
                 </Col>
                 <Col span={24} hidden={type == 3} style={{ marginTop: 15 }}>
-                    <Form.Item label="住院序号" name="behospitalCode">
-                        <Input placeholder="请输入" autoComplete='off' onChange={change} maxLength='30'/>
+                    <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30,message:'住院序号不能超过30个字符' }]}>
+                        <Input placeholder="请输入" autoComplete='off' onChange={change}/>
                     </Form.Item>
                 </Col>
                 {

+ 8 - 8
src/components/FieldProblem/index.js

@@ -184,23 +184,23 @@ function FieldProblem() {
                             </Form.Item>
                         </Col>
                         <Col span={5} key={1}>
-                            <Form.Item label="住院序号" name="behospitalCode">
-                                <Input placeholder="住院序号" autoComplete='off' maxLength='30' />
+                            <Form.Item label="住院序号" name="behospitalCode" rules={[{ max: 30,message:'住院序号不能超过30个字符' }]}>
+                                <Input placeholder="住院序号" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={2}>
-                            <Form.Item label="文书编号" name="recId">
-                                <Input placeholder="文书编号" autoComplete='off' maxLength='30' />
+                            <Form.Item label="文书编号" name="recId" rules={[{ max: 30,message:'文书编号不能超过30个字符' }]}>
+                                <Input placeholder="文书编号" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={3}>
-                            <Form.Item label="文书标题" name="recTitle">
-                                <Input placeholder="文书标题" autoComplete='off' maxLength='30' />
+                            <Form.Item label="文书标题" name="recTitle" rules={[{ max: 30,message:'文书标题不能超过30个字符' }]}>
+                                <Input placeholder="文书标题" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={4}>
-                            <Form.Item label="质控模块名称" name="modeName">
-                                <Input placeholder="质控模块名称" autoComplete='off' maxLength='30' />
+                            <Form.Item label="质控模块名称" name="modeName" rules={[{ max: 30,message:'质控模块名称不能超过30个字符' }]}>
+                                <Input placeholder="质控模块名称" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={5}>

+ 2 - 2
src/components/FieldRules/addRules.js

@@ -291,7 +291,7 @@ function ContentForm(props) {
                         <Radio value={0}>否</Radio>
                     </Radio.Group>
                 </Form.Item>
-                <Form.Item label="标准值维护">
+                <Form.Item label="标准值维护" rules={[{ max: 30,message:'标准值不能超过30个字符' }]}>
                     {
                         standardValueList.map((it, i) => {
                             return (
@@ -319,7 +319,7 @@ function ContentForm(props) {
                 <Form.Item hidden={true} name="regularId" noStyle>
                     <Input />
                 </Form.Item>
-                <Form.Item label="说明" name="description">
+                <Form.Item label="说明" name="description" rules={[{ max: 200,message:'说明不能超过200个字符' }]}>
                     <TextArea
                         autoSize={{ minRows: 3, maxRows: 5 }}
                     />

+ 2 - 2
src/components/FieldRules/index.js

@@ -323,8 +323,8 @@ function FieldRules() {
                             </Form.Item>
                         </Col>
                         <Col span={5} key={5}>
-                            <Form.Item label="标准值" name="standardValue">
-                                <Input placeholder="标准值" autoComplete='off' maxLength='30' />
+                            <Form.Item label="标准值" name="standardValue" rules={[{ max: 30,message:'标准值不能超过30个字符' }]}>
+                                <Input placeholder="标准值" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>
                         <Col span={5} key={6}>

+ 3 - 4
src/components/RegularManage/addRegular.js

@@ -54,18 +54,17 @@ function EditBlock(props) {
                 onFinish={onFinish}
                 initialValues={initialValues}
             >
-                <Form.Item label="正则式名称" name="name" rules={[{ required: true }]}>
-                    <Input placeholder="请输入" autoComplete='off' maxLength='30'/>
+                <Form.Item label="正则式名称" name="name" rules={[{ required: true,message:'请输入正则式名称'},{ max: 30,message:'正则式名称不能超过30个字符' }]}>
+                    <Input placeholder="请输入" autoComplete='off'/>
                 </Form.Item>
                 <Form.Item label="正则式值" name="val" rules={[{ required: true }]}>
                     <TextArea
                         autoSize={{ minRows: 5, maxRows: 5 }}
                     />
                 </Form.Item>
-                <Form.Item label="说明" name="description">
+                <Form.Item label="说明" name="description" rules={[{ max: 200,message:'说明不能超过200个字符' }]}>
                     <TextArea
                         autoSize={{ minRows: 5, maxRows: 5 }}
-                        maxLength='200'
                     />
                 </Form.Item>
                 <Form.Item wrapperCol={{ offset: 8, span: 16 }} style={{ marginTop: 15 }}>

+ 2 - 2
src/components/RegularManage/index.js

@@ -163,8 +163,8 @@ function RegularManage() {
                 >
                     <Row gutter={24}>
                         <Col span={5} key={0}>
-                            <Form.Item label="正则式名称" name="name">
-                                <Input placeholder="正则式名称" autoComplete='off' maxLength='30' />
+                            <Form.Item label="正则式名称" name="name" rules={[{ max: 30,message:'正则式名称不能超过30个字符' }]}>
+                                <Input placeholder="正则式名称" autoComplete='off' allowClear/>
                             </Form.Item>
                         </Col>