Commit 749923e4 authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 字段可输入长度控制

parent 26cfc201
......@@ -3,6 +3,7 @@
* @author: Gavin
* @description: 单选状态反馈选择结果, 示例应用场景: 详情页面点击提交, 弹窗选择审核状态, 是否需要填写原因。 ~~~!!!!单选模式,暂为不可异步, 待优化。
*/
import { validatorByte } from '@/utils/regExp';
import { Form, Input, Modal, Radio } from 'antd';
import React, { useEffect, useState } from 'react'
import { ModalCancelText, ModalOkText, ReasonPlaceholder1, ReasonRulesMessage, SelectRadioRulesMessage } from '../translate';
......@@ -126,12 +127,14 @@ const CustomizedModal: React.FC<CustomizedModalProps> = (props) => {
</Radio.Group>
</Form.Item>
{
visibleReason
? <Form.Item
name='reason'
rules={[{ required: true, message: ReasonRulesMessage }]}
visibleReason ?
<Form.Item
label='不确认原因'
name='reason'
rules={[
{ required: true, message: ReasonRulesMessage },
{ validator: (rule, value, callback) => validatorByte(rule, value, callback, 300) }
]}
>
<Input.TextArea allowClear rows={3} maxLength={300} placeholder={ReasonPlaceholder1} />
</Form.Item>
......
......@@ -20,6 +20,7 @@ import moment from 'moment'
import usePrompt from '@/hooks/usePrompt'
import FormProgress, { HandleType } from '@/components/FormProgress'
import { getMemberManageBuyerMember } from '@/services/MemberV2Api'
import { validatorByte } from '@/utils/regExp'
type PropsType = {
type: 'add' | 'edit';
......@@ -360,6 +361,9 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
labelCol={{ span: 0 }}
wrapperCol={{ span: 24 }}
name='remark'
rules={[
{ validator: (rule, value, callback) => validatorByte(rule, value, callback, 600) }
]}
>
<Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' />
</Form.Item>
......
......@@ -23,6 +23,7 @@ import moment from 'moment'
import usePrompt from '@/hooks/usePrompt'
import FormProgress, { HandleType } from '@/components/FormProgress'
import { getMemberManageUpperConsumerMerchantPage } from '@/services/MemberV2Api'
import { validatorByte } from '@/utils/regExp'
type PropsType = {
type: 'add' | 'edit';
......@@ -366,6 +367,9 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
labelCol={{ span: 0 }}
wrapperCol={{ span: 24 }}
name='remark'
rules={[
{ validator: (rule, value, callback) => validatorByte(rule, value, callback, 600) }
]}
>
<Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字' />
</Form.Item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment