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
26738ceb
Commit
26738ceb
authored
Aug 10, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复现有地址无法点击确认的问题
parent
aeb13370
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
index.tsx
src/components/AddressSelect/index.tsx
+6
-3
schema.ts
src/components/AddressSelect/schema.ts
+1
-7
No files found.
src/components/AddressSelect/index.tsx
View file @
26738ceb
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-
09 16:52:37
* @LastEditTime: 2021-08-
10 10:20:55
* @Description: 地址选择 FormItem
*/
import
React
,
{
useState
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
...
...
@@ -204,6 +204,8 @@ const AddressSelect: React.FC<IProps> = (props) => {
const
handleSubmit
=
async
(
values
:
SubmitValuesType
)
=>
{
let
next
=
values
.
address
;
// 有值表示是新增 或 修改操作
if
(
values
.
name
)
{
const
originData
=
formActions
.
getFieldState
(
'provinceCode'
,
(
fieldState
)
=>
{
return
fieldState
.
originData
;
});
...
...
@@ -230,7 +232,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
};
// 新增地址
if
(
values
.
name
&&
!
editAddressId
.
current
)
{
if
(
!
editAddressId
.
current
)
{
try
{
setSubmitLoading
(
true
);
const
addRes
=
addressType
===
2
...
...
@@ -265,7 +267,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
}
}
// 编辑地址
if
(
values
.
name
&&
editAddressId
.
current
)
{
if
(
editAddressId
.
current
)
{
try
{
setSubmitLoading
(
true
);
const
addRes
=
addressType
===
2
...
...
@@ -299,6 +301,7 @@ const AddressSelect: React.FC<IProps> = (props) => {
console
.
warn
(
error
)
}
}
}
if
(
!
(
'value'
in
props
))
{
setInternalValue
(
next
);
}
...
...
src/components/AddressSelect/schema.ts
View file @
26738ceb
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 14:02:46
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-
06 14:46:35
* @LastEditTime: 2021-08-
10 14:05:13
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -35,12 +35,6 @@ export const createSchema = (addressType = 2): ISchema => {
'x-component-props'
:
{
onClickEdit
:
'{{ handleEditAddress }}'
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择地址'
,
},
],
},
},
},
...
...
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