Commit 5a6dde76 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'chore-v2-220618-as' into 'v2-220618'

chore: 处理动态电话号码长度 See merge request linkseeks-design/pro-platform!1089
parents 225943f3 288fbfe0
......@@ -30,6 +30,7 @@ export default {
'customerAbility.management.import.query.form.basic.phone': 'Registered phone',
'customerAbility.management.import.query.form.basic.phone.placeholder': 'Please enter your mobile phone number',
'customerAbility.management.import.query.form.basic.phone.rules-fact': 'Please enter the phone number in the correct format',
'customerAbility.management.import.query.form.basic.phone.max': 'The registered mobile number exceeds {len} digits',
'customerAbility.management.import.query.form.basic.email': 'Mailbox',
'customerAbility.management.import.query.form.basic.email.rules-fact': 'Please enter the correct email format',
'customerAbility.management.import.query.form.channel': 'Channel Information',
......
......@@ -32,6 +32,7 @@ export default {
'member.management.import.query.form.basic.phone':'Registered phone',
'member.management.import.query.form.basic.phone.placeholder':'Please enter your mobile phone number',
'member.management.import.query.form.basic.phone.rules-fact':'Please enter the phone number in the correct format',
'member.management.import.query.form.basic.phone.max': 'The registered mobile number exceeds {len} digits',
'member.management.import.query.form.basic.email':'Mailbox',
'member.management.import.query.form.basic.email.rules-fact':'Please enter the correct email format',
'member.management.import.query.form.channel':'Channel Information',
......
......@@ -167,5 +167,9 @@ export default {
// 导入会员弹窗
'supplier.memberImport.component.MemberRolesModal.title': 'Select import Roles',
'supplier.memberImport.component.MemberRolesModal.next.step': 'Next step'
'supplier.memberImport.component.MemberRolesModal.next.step': 'Next step',
// 供应商管理 - 供应商导入
'supplier.management.import.query.form.basic.phone.placeholder': 'Please enter your mobile phone number',
'supplier.management.import.query.form.basic.phone.max': 'The registered mobile number exceeds {len} digits',
};
......@@ -31,6 +31,7 @@ export default {
'customerAbility.management.import.query.form.basic.phone': '휴대폰 등록',
'customerAbility.management.import.query.form.basic.phone.placeholder': '핸드폰 번호를 입력하세요.',
'customerAbility.management.import.query.form.basic.phone.rules-fact': '정확한 형식의 핸드폰 번호를 입력하세요',
'customerAbility.management.import.query.form.basic.phone.max': '{len}자리 이상의 등록된 휴대폰 번호',
'customerAbility.management.import.query.form.basic.email': '우편함',
'customerAbility.management.import.query.form.basic.email.rules-fact': '올바른 형식의 메일박스를 입력하십시오',
'customerAbility.management.import.query.form.channel': '채널 정보',
......
......@@ -32,6 +32,7 @@ export default {
'member.management.import.query.form.basic.phone': '휴대폰 등록',
'member.management.import.query.form.basic.phone.placeholder': '핸드폰 번호를 입력하세요.',
'member.management.import.query.form.basic.phone.rules-fact': '정확한 형식의 핸드폰 번호를 입력하세요',
'member.management.import.query.form.basic.phone.max': '{len}자리 이상의 등록된 휴대폰 번호',
'member.management.import.query.form.basic.email': '우편함',
'member.management.import.query.form.basic.email.rules-fact': '올바른 형식의 메일박스를 입력하십시오',
'member.management.import.query.form.channel': '채널 정보',
......
......@@ -161,5 +161,9 @@ export default {
// 导入会员弹窗
'supplier.memberImport.component.MemberRolesModal.title': '가져올 역할 선택',
'supplier.memberImport.component.MemberRolesModal.next.step': '다음 단계'
'supplier.memberImport.component.MemberRolesModal.next.step': '다음 단계',
// 供应商管理 - 供应商导入
'supplier.management.import.query.form.basic.phone.placeholder': '핸드폰 번호를 입력하세요.',
'supplier.management.import.query.form.basic.phone.max': '{len}자리 이상의 등록된 휴대폰 번호',
};
......@@ -32,6 +32,7 @@ export default {
'customerAbility.management.import.query.form.basic.phone': '注册手机',
'customerAbility.management.import.query.form.basic.phone.placeholder': '请输入你的手机号码',
'customerAbility.management.import.query.form.basic.phone.rules-fact': '请输入正确格式的手机号',
'customerAbility.management.import.query.form.basic.phone.max': '注册手机号超出{len}位数',
'customerAbility.management.import.query.form.basic.email': '邮箱',
'customerAbility.management.import.query.form.basic.email.rules-fact': '请输入正确格式的邮箱',
'customerAbility.management.import.query.form.channel': '渠道信息',
......
......@@ -32,6 +32,7 @@ export default {
'member.management.import.query.form.basic.phone': '注册手机',
'member.management.import.query.form.basic.phone.placeholder': '请输入你的手机号码',
'member.management.import.query.form.basic.phone.rules-fact': '请输入正确格式的手机号',
'member.management.import.query.form.basic.phone.max': '注册手机号超出{len}位数',
'member.management.import.query.form.basic.email': '邮箱',
'member.management.import.query.form.basic.email.rules-fact': '请输入正确格式的邮箱',
'member.management.import.query.form.channel': '渠道信息',
......
......@@ -252,5 +252,9 @@ export default {
// 导入会员弹窗
'supplier.memberImport.component.MemberRolesModal.title': '选择角色导入',
'supplier.memberImport.component.MemberRolesModal.next.step': '下一步'
'supplier.memberImport.component.MemberRolesModal.next.step': '下一步',
// 供应商管理 - 供应商导入
'supplier.management.import.query.form.basic.phone.placeholder': '请输入你的手机号码',
'supplier.management.import.query.form.basic.phone.max': '注册手机号超出{len}位数',
};
......@@ -341,15 +341,15 @@ const MemberForm: React.FC<MemberFormProps> = ({
const res = await getMemberAbilitySubPageitemsBasic();
if (res.code === 1000) {
const { data = {} }: any = res;
const { data } = res;
const {
memberTypes = [],
countryCodes = [],
memberTypes,
countryCodes,
} = data;
return {
memberTypeId: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes.map(item => ({ label: item.text, value: item.id })),
memberTypeId: memberTypes?.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes?.map(item => ({ label: item.text, value: item.id, phoneLength: item.phoneLength })),
};
}
return {};
......@@ -577,6 +577,36 @@ const MemberForm: React.FC<MemberFormProps> = ({
);
});
});
// 国家区号改变,触发电话号码校验
onFieldInputChange$('countryCodeId').subscribe(() => {
const phoneValue = formActions.getFieldValue('phone');
if (phoneValue) {
formActions.setFieldState('phone', (state) => {
state.value = '';
});
}
});
// 国家区号改变,触发电话号码校验
onFieldValueChange$('countryCodeId').subscribe((fieldState) => {
const current = fieldState.props.enum?.find((item) => item.value === fieldState.value);
if (current && current.phoneLength) {
formActions.setFieldState('phone', (state) => {
state.rules = [
{
required: true,
message: intl.formatMessage({ id: 'customerAbility.management.import.query.form.basic.phone.placeholder' }),
},
{
validator: (value) => {
return value?.length > current.phoneLength ? intl.formatMessage({ id: 'customerAbility.management.import.query.form.basic.phone.max' }, { len: current.phoneLength }) : '';
},
},
];
});
}
});
}
return (
......
......@@ -97,17 +97,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
'x-component-props': {
placeholder: intl.formatMessage({ id: 'customerAbility.management.import.query.form.basic.phone.placeholder' }),
maxLength: 11,
},
'x-rules': [
{
required: true,
message: intl.formatMessage({ id: 'customerAbility.management.import.query.form.basic.phone.placeholder' })
},
{
pattern: PATTERN_MAPS.phone,
message: intl.formatMessage({ id: 'customerAbility.management.import.query.form.basic.phone.rules-fact' }),
},
],
},
},
......
......@@ -341,15 +341,15 @@ const MemberForm: React.FC<MemberFormProps> = ({
const res = await getMemberAbilitySubPageitemsBasic();
if (res.code === 1000) {
const { data = {} }: any = res;
const { data } = res;
const {
memberTypes = [],
countryCodes = [],
memberTypes,
countryCodes,
} = data;
return {
memberTypeId: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes.map(item => ({ label: item.text, value: item.id })),
memberTypeId: memberTypes?.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes?.map(item => ({ label: item.text, value: item.id, phoneLength: item.phoneLength })),
};
}
return {};
......@@ -576,6 +576,36 @@ const MemberForm: React.FC<MemberFormProps> = ({
);
});
});
// 国家区号改变,触发电话号码校验
onFieldInputChange$('countryCodeId').subscribe(() => {
const phoneValue = formActions.getFieldValue('phone');
if (phoneValue) {
formActions.setFieldState('phone', (state) => {
state.value = '';
});
}
});
// 国家区号改变,触发电话号码校验
onFieldValueChange$('countryCodeId').subscribe((fieldState) => {
const current = fieldState.props.enum?.find((item) => item.value === fieldState.value);
if (current && current.phoneLength) {
formActions.setFieldState('phone', (state) => {
state.rules = [
{
required: true,
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' }),
},
{
validator: (value) => {
return value?.length > current.phoneLength ? intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.max' }, { len: current.phoneLength }) : '';
},
},
];
});
}
});
}
return (
......
......@@ -98,17 +98,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
'x-component-props': {
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' }),
maxLength: 11,
},
'x-rules': [
{
required: true,
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' })
},
{
pattern: PATTERN_MAPS.phone,
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.rules-fact' }),
},
],
},
},
......
......@@ -341,15 +341,15 @@ const MemberForm: React.FC<MemberFormProps> = ({
const res = await getMemberAbilitySubPageitemsBasic();
if (res.code === 1000) {
const { data = {} }: any = res;
const { data } = res;
const {
memberTypes = [],
countryCodes = [],
memberTypes,
countryCodes,
} = data;
return {
memberTypeId: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes.map(item => ({ label: item.text, value: item.id })),
memberTypeId: memberTypes?.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
countryCodeId: countryCodes?.map(item => ({ label: item.text, value: item.id, phoneLength: item.phoneLength })),
};
}
return {};
......@@ -576,6 +576,36 @@ const MemberForm: React.FC<MemberFormProps> = ({
);
});
});
// 国家区号改变,触发电话号码校验
onFieldInputChange$('countryCodeId').subscribe(() => {
const phoneValue = formActions.getFieldValue('phone');
if (phoneValue) {
formActions.setFieldState('phone', (state) => {
state.value = '';
});
}
});
// 国家区号改变,触发电话号码校验
onFieldValueChange$('countryCodeId').subscribe((fieldState) => {
const current = fieldState.props.enum?.find((item) => item.value === fieldState.value);
if (current && current.phoneLength) {
formActions.setFieldState('phone', (state) => {
state.rules = [
{
required: true,
message: intl.formatMessage({ id: 'supplier.management.import.query.form.basic.phone.placeholder' }),
},
{
validator: (value) => {
return value?.length > current.phoneLength ? intl.formatMessage({ id: 'supplier.management.import.query.form.basic.phone.max' }, { len: current.phoneLength }) : '';
},
},
];
});
}
});
}
return (
......
......@@ -96,17 +96,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
span: 2,
},
'x-component-props': {
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' }),
maxLength: 11,
placeholder: intl.formatMessage({ id: 'supplier.management.import.query.form.basic.phone.placeholder' }),
},
'x-rules': [
{
required: true,
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' })
},
{
pattern: PATTERN_MAPS.phone,
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.rules-fact' }),
message: intl.formatMessage({ id: 'supplier.management.import.query.form.basic.phone.placeholder' })
},
],
},
......
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