Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
5a6dde76
Commit
5a6dde76
authored
Jun 16, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'chore-v2-220618-as' into 'v2-220618'
chore: 处理动态电话号码长度 See merge request linkseeks-design/pro-platform!1089
parents
225943f3
288fbfe0
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
128 additions
and
35 deletions
+128
-35
customerAbility.ts
src/locales/en-US/customerAbility.ts
+1
-0
member.ts
src/locales/en-US/member.ts
+1
-0
supplier.ts
src/locales/en-US/supplier.ts
+5
-1
customerAbility.ts
src/locales/ko-KR/customerAbility.ts
+1
-0
member.ts
src/locales/ko-KR/member.ts
+1
-0
supplier.ts
src/locales/ko-KR/supplier.ts
+5
-1
customerAbility.ts
src/locales/zh-CN/customerAbility.ts
+1
-0
member.ts
src/locales/zh-CN/member.ts
+1
-0
supplier.ts
src/locales/zh-CN/supplier.ts
+5
-1
index.tsx
...tomerAbility/memberImport/components/MemberForm/index.tsx
+35
-5
index.ts
...bility/memberImport/components/MemberForm/schema/index.ts
+0
-5
index.tsx
...pages/member/memberImport/components/MemberForm/index.tsx
+35
-5
index.ts
...member/memberImport/components/MemberForm/schema/index.ts
+0
-5
index.tsx
...ges/supplier/memberImport/components/MemberForm/index.tsx
+35
-5
index.ts
...pplier/memberImport/components/MemberForm/schema/index.ts
+2
-7
No files found.
src/locales/en-US/customerAbility.ts
View file @
5a6dde76
...
...
@@ -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'
,
...
...
src/locales/en-US/member.ts
View file @
5a6dde76
...
...
@@ -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'
,
...
...
src/locales/en-US/supplier.ts
View file @
5a6dde76
...
...
@@ -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'
,
};
src/locales/ko-KR/customerAbility.ts
View file @
5a6dde76
...
...
@@ -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'
:
'채널 정보'
,
...
...
src/locales/ko-KR/member.ts
View file @
5a6dde76
...
...
@@ -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'
:
'채널 정보'
,
...
...
src/locales/ko-KR/supplier.ts
View file @
5a6dde76
...
...
@@ -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}자리 이상의 등록된 휴대폰 번호'
,
};
src/locales/zh-CN/customerAbility.ts
View file @
5a6dde76
...
...
@@ -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'
:
'渠道信息'
,
...
...
src/locales/zh-CN/member.ts
View file @
5a6dde76
...
...
@@ -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'
:
'渠道信息'
,
...
...
src/locales/zh-CN/supplier.ts
View file @
5a6dde76
...
...
@@ -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}位数'
,
};
src/pages/customerAbility/memberImport/components/MemberForm/index.tsx
View file @
5a6dde76
...
...
@@ -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
(
...
...
src/pages/customerAbility/memberImport/components/MemberForm/schema/index.ts
View file @
5a6dde76
...
...
@@ -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'
}),
},
],
},
},
...
...
src/pages/member/memberImport/components/MemberForm/index.tsx
View file @
5a6dde76
...
...
@@ -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
(
...
...
src/pages/member/memberImport/components/MemberForm/schema/index.ts
View file @
5a6dde76
...
...
@@ -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'
}),
},
],
},
},
...
...
src/pages/supplier/memberImport/components/MemberForm/index.tsx
View file @
5a6dde76
...
...
@@ -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
(
...
...
src/pages/supplier/memberImport/components/MemberForm/schema/index.ts
View file @
5a6dde76
...
...
@@ -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'
})
},
],
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment