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
a886a859
Commit
a886a859
authored
Oct 22, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
0c6212d1
dc62a437
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
184 additions
and
118 deletions
+184
-118
proxy.ts
config/proxy.ts
+1
-1
authConfigRoute.ts
config/routes/authConfigRoute.ts
+27
-5
SliderValidate.tsx
src/components/NiceForm/components/SliderValidate.tsx
+28
-0
index.tsx
src/components/NiceForm/index.tsx
+2
-0
useAsyncSelect.ts
src/formSchema/effects/useAsyncSelect.ts
+3
-2
index.tsx
src/pages/accountSetting/components/TypeVerify/index.tsx
+1
-1
editAccount.tsx
src/pages/accountSetting/editAccount.tsx
+5
-1
index.tsx
src/pages/member/memberMaintain/index.tsx
+1
-1
index.tsx
src/pages/member/memberPr1/index.tsx
+1
-1
index.tsx
src/pages/member/memberPr2/index.tsx
+1
-1
index.tsx
src/pages/member/memberPrConfirm/index.tsx
+6
-3
index.tsx
src/pages/member/memberPrSubmit/index.tsx
+1
-1
index.ts
src/pages/member/memberPrSubmit/schema/index.ts
+1
-6
index.tsx
...s/transaction/components/orderHandReceivedModal/index.tsx
+2
-3
index.tsx
...nsaction/purchaseOrder/readyReceiveOrder/detail/index.tsx
+1
-1
index.tsx
...ction/saleOrder/readyConfirmDelevedOrder/detail/index.tsx
+1
-1
useBusinessEffects.ts
...kSellStorage/bills/addBills/effects/useBusinessEffects.ts
+60
-5
index.tsx
...ges/transaction/stockSellStorage/bills/addBills/index.tsx
+1
-1
index.tsx
...ansaction/supplierEvaluation/unevaluated/schema/index.tsx
+1
-1
forgetPwd.tsx
src/pages/user/forgetPwd.tsx
+23
-80
index.ts
src/pages/user/schema/index.ts
+17
-3
No files found.
config/proxy.ts
View file @
a886a859
export
default
{
'/api'
:
{
'target'
:
'http://10.0.0.
25
:8100/'
,
'target'
:
'http://10.0.0.
10
:8100/'
,
'changeOrigin'
:
true
,
'pathRewrite'
:
{
'^/api'
:
''
},
}
...
...
config/routes/authConfigRoute.ts
View file @
a886a859
/*
* @Author: Xujiamin
* @Date: 2020-08-26 21:02:23
* @LastEditors:
XieZhiXiong
* @LastEditTime: 2020-10-
14 14:34:28
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2020-10-
21 19:00:05
* @Description: 系统能力路由相关
*/
import
{
RouterChild
}
from
'../utils'
;
...
...
@@ -91,13 +91,35 @@ const AuthConfigRoute: RouterChild = {
name
:
'accountSetting'
,
component
:
'@/pages/accountSetting'
},
//
账号
修改
//
密码
修改
{
path
:
'/memberCenter/systemSetting/accountSetting/
edit
'
,
path
:
'/memberCenter/systemSetting/accountSetting/
loginPwd
'
,
name
:
'editAccount'
,
component
:
'@/pages/accountSetting/editAccount'
,
hideInMenu
:
true
,
}
},
// 邮箱修改
{
path
:
'/memberCenter/systemSetting/accountSetting/email'
,
name
:
'editAccount'
,
component
:
'@/pages/accountSetting/editAccount'
,
hideInMenu
:
true
,
},
// 手机修改
{
path
:
'/memberCenter/systemSetting/accountSetting/phone'
,
name
:
'editAccount'
,
component
:
'@/pages/accountSetting/editAccount'
,
hideInMenu
:
true
,
},
// 支付密码
{
path
:
'/memberCenter/systemSetting/accountSetting/paycode'
,
name
:
'editAccount'
,
component
:
'@/pages/accountSetting/editAccount'
,
hideInMenu
:
true
,
},
//
],
}
...
...
src/components/NiceForm/components/SliderValidate.tsx
0 → 100644
View file @
a886a859
import
React
,
{
useState
}
from
'react'
import
{
Tag
,
Row
}
from
'antd'
import
{
useFormEffects
,
ISchemaFieldComponentProps
}
from
'@formily/antd'
import
{
RiskCheck
}
from
'god'
const
SliderValidate
=
(
props
:
ISchemaFieldComponentProps
)
=>
{
const
{
value
=
[],
mutators
}
=
props
const
xPoint
=
80
const
yPoint
=
30
const
imgUrl
=
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603280613858&di=b810f23b7c17affe6a2be8a28cecd857&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F14%2F75%2F01300000164186121366756803686.jpg'
const
componentProps
=
{
xPoint
,
yPoint
,
imgUrl
}
return
(
<
div
>
<
RiskCheck
{
...
componentProps
}
imgWidth=
{
300
}
/>
</
div
>
)
}
SliderValidate
.
defaultProps
=
{}
SliderValidate
.
isFieldComponent
=
true
;
export
default
SliderValidate
\ No newline at end of file
src/components/NiceForm/index.tsx
View file @
a886a859
...
...
@@ -26,6 +26,7 @@ import { Checkbox, Radio } from '@formily/antd-components';
import
DateSelect
from
'./components/DateSelect'
;
import
VirtualChildren
from
'./components/VirtualChildren'
;
import
SmilingFace
from
'./components/SmilingFace'
;
import
SliderValidate
from
'./components/SliderValidate'
;
import
{
useLinkComponentProps
}
from
'./linkages/linkComponentProps'
;
import
Loading
from
'../Loading'
;
...
...
@@ -98,6 +99,7 @@ export const componentExport = {
DateSelect
,
VirtualChildren
,
SmilingFace
,
SliderValidate
,
RadioGroup
:
Radio
.
Group
}
const
NiceForm
:
React
.
FC
<
NiceFormProps
>
=
props
=>
{
...
...
src/formSchema/effects/useAsyncSelect.ts
View file @
a886a859
...
...
@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
linkage
.
loading
(
name
)
service
().
then
(
res
=>
{
let
enums
=
[]
if
(
format
)
{
const
[
labelString
,
valueString
]
=
format
re
s
=
res
.
map
(
v
=>
({
enum
s
=
res
.
map
(
v
=>
({
label
:
v
[
labelString
],
value
:
v
[
valueString
]
}))
...
...
@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
linkage
.
loaded
(
name
)
linkage
.
enum
(
name
,
re
s
)
linkage
.
enum
(
name
,
enum
s
)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch
(
'requestAsyncSelect'
,
{
name
,
...
...
src/pages/accountSetting/components/TypeVerify/index.tsx
View file @
a886a859
...
...
@@ -51,7 +51,7 @@ const TypeVerify: React.FC<IProps> = (props) => {
}
else
if
(
type
==
'paycode'
)
{
title
=
paycode
==
0
?
"设置支付密码"
:
"重置支付密码"
}
return
<
Link
to=
{
`/memberCenter/systemSetting/
editAccount?type=
${type}`
}
>
{
title
}
</
Link
>
return
<
Link
to=
{
`/memberCenter/systemSetting/
accountSetting/
${type}`
}
>
{
title
}
</
Link
>
}
return
(
...
...
src/pages/accountSetting/editAccount.tsx
View file @
a886a859
...
...
@@ -23,7 +23,11 @@ interface accountProps {
}
const
EditAccount
=
(
props
)
=>
{
const
{
type
=
'loginPwd'
}
=
props
.
location
.
query
const
pathnameSplit
=
props
.
location
.
pathname
.
split
(
"/"
)
const
length
=
pathnameSplit
.
length
;
const
type
=
pathnameSplit
[
length
-
1
]
||
"loginPwd"
;
console
.
log
(
type
);
// const { type = 'loginPwd' } = props.location.query
const
[
account
,
setAccount
]
=
useState
<
accountProps
>
({})
const
MAP
=
{
...
...
src/pages/member/memberMaintain/index.tsx
View file @
a886a859
...
...
@@ -230,7 +230,7 @@ const MemberMaintain: React.FC<[]> = () => {
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
member
Id'
,
rowKey
:
'
validate
Id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
...
...
src/pages/member/memberPr1/index.tsx
View file @
a886a859
...
...
@@ -222,7 +222,7 @@ const MemberPr1: React.FC<{}> = props => {
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
member
Id'
,
rowKey
:
'
validate
Id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
...
...
src/pages/member/memberPr2/index.tsx
View file @
a886a859
...
...
@@ -222,7 +222,7 @@ const MemberPr2: React.FC<{}> = props => {
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
member
Id'
,
rowKey
:
'
validate
Id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
...
...
src/pages/member/memberPrConfirm/index.tsx
View file @
a886a859
...
...
@@ -12,7 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
MEMBER_INNER_STATUS_
SUCCESS
}
from
'@/constants'
;
import
{
MEMBER_INNER_STATUS_
FAILED
}
from
'@/constants'
;
import
{
auditSchema
}
from
'../schema/auditSchema'
;
import
{
MEMBER_STATUS_TAG_MAP
,
...
...
@@ -126,7 +126,10 @@ const MemberPrConfirm: React.FC<{}> = props => {
setSelectedRowKeys
(
keys
);
setSelectList
(
rows
);
},
selectedRowKeys
:
selectedRowKeys
,
selectedRowKeys
:
selectedRowKeys
,
getCheckboxProps
:
record
=>
({
disabled
:
record
.
innerStatus
===
MEMBER_INNER_STATUS_FAILED
,
}),
};
const
fetchListData
=
async
(
params
:
any
)
=>
{
...
...
@@ -225,7 +228,7 @@ const MemberPrConfirm: React.FC<{}> = props => {
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
member
Id'
,
rowKey
:
'
validate
Id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
...
...
src/pages/member/memberPrSubmit/index.tsx
View file @
a886a859
...
...
@@ -222,7 +222,7 @@ const MemberPrSubmit: React.FC<{}> = props => {
<
Card
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
member
Id'
,
rowKey
:
'
validate
Id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
...
...
src/pages/member/memberPrSubmit/schema/index.ts
View file @
a886a859
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-07 16:33:12
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-
09-23 19:44:2
4
* @LastEditTime: 2020-
10-21 17:39:4
4
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -70,17 +70,12 @@ export const channelSchema: ISchema = {
remark
:
{
type
:
'string'
,
title
:
'渠道描述'
,
required
:
true
,
'x-component'
:
'TextArea'
,
'x-component-props'
:
{
rows
:
5
,
placeholder
:
'最大200个字符,100个汉字'
,
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请填写渠道描述'
},
{
limitByte
:
true
,
// 自定义校验规则
maxByte
:
200
,
...
...
src/pages/transaction/components/orderHandReceivedModal/index.tsx
View file @
a886a859
...
...
@@ -12,12 +12,11 @@ export interface OrderHandReceivedModalProps {
const
OrderHandReceivedModal
:
React
.
FC
<
OrderHandReceivedModalProps
>
=
({
currentRef
})
=>
{
const
{
formContext
}
=
useContext
(
OrderDetailContext
)
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
const
formData
=
formContext
.
data
||
{}
const
formData
=
data
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderManualConfirmReceipt
)
const
handleConfirm
=
async
()
=>
{
console
.
log
(
'确认收货'
)
const
{
code
}
=
await
run
({
orderId
:
formData
.
id
})
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/detail/index.tsx
View file @
a886a859
...
...
@@ -18,7 +18,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
const
approvedRef
=
useRef
<
any
>
({})
// 是否是手工收货
const
isHeadReceipt
=
formContext
&&
formContext
.
data
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
const
isHeadReceipt
=
formContext
.
data
&&
formContext
.
data
.
interiorState
===
PurchaseOrderInsideWorkState
.
HAND_RECEIPT_ORDER
const
handleClick
=
useCallback
(()
=>
{
if
(
isHeadReceipt
)
{
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/detail/index.tsx
View file @
a886a859
...
...
@@ -16,7 +16,7 @@ const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
// 是否是手工发货
const
isHandDeleved
=
formContext
&&
formContext
.
data
&&
formContext
.
data
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
const
isHandDeleved
=
formContext
.
data
&&
formContext
.
data
.
purchaseOrderInteriorState
===
SaleOrderInsideWorkState
.
HAND_DELEVED_ORDER
// 所有发货单都是否已经发货了
const
isShowBtn
=
formContext
.
data
?.
orderDeliveryDetailsResponses
?.
some
(
v
=>
v
.
interiorState
===
DeliverySideState
.
ADD_LOGISTICS_ORDER
)
...
...
src/pages/transaction/stockSellStorage/bills/addBills/effects/useBusinessEffects.ts
View file @
a886a859
...
...
@@ -2,9 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-
09-29 09:48:52
* @LastEditTime: 2020-
10-22 09:25:26
* @Description: 联动逻辑相关
*/
import
{
Modal
}
from
'antd'
;
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons'
;
import
{
FormEffectHooks
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
...
...
@@ -392,6 +394,50 @@ export const useBusinessEffects = (context, actions) => {
const
{
name
,
originAsyncData
,
value
}
=
fieldState
;
const
current
=
originAsyncData
.
find
(
item
=>
item
.
productId
===
value
);
// 取消选择
if
(
!
value
)
{
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.productId`
}),
state
=>
{
state
.
value
=
''
;
}
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.productName`
}),
state
=>
{
state
.
value
=
''
;
}
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.price`
}),
state
=>
{
state
.
value
=
''
;
}
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.productCount`
}),
state
=>
{
state
.
value
=
''
;
}
);
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
`¥0.00`
;
}
);
}
if
(
!
current
)
{
return
;
}
...
...
@@ -417,7 +463,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.price`
}),
state
=>
{
state
.
value
=
current
.
price
;
state
.
value
=
(
current
.
price
/
current
.
purchaseCount
).
toFixed
(
2
)
;
}
);
setFieldState
(
...
...
@@ -425,7 +471,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.productCount`
}),
state
=>
{
state
.
value
=
1
;
state
.
value
=
current
.
purchaseCount
;
}
);
setFieldState
(
...
...
@@ -433,7 +479,7 @@ export const useBusinessEffects = (context, actions) => {
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
`¥
${(
1
*
current
.
price
).
toFixed
(
2
)}
`
;
state
.
value
=
`¥
${(
1
*
(
current
.
price
/
current
.
purchaseCount
)
).
toFixed
(
2
)}
`
;
}
);
});
...
...
@@ -458,13 +504,22 @@ export const useBusinessEffects = (context, actions) => {
if
(
!
current
||
isNaN
(
+
value
))
{
return
;
}
if
(
value
>
current
.
purchaseCount
)
{
Modal
.
confirm
({
title
:
'提示'
,
content
:
'单据数量已超过商品数量'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
});
}
setFieldState
(
FormPath
.
transform
(
name
,
/
\d
/
,
$1
=>
{
return
`invoicesDetailsRequests.
${
$1
}
.amount`
}),
state
=>
{
state
.
value
=
`¥
${(
+
value
*
current
.
price
).
toFixed
(
2
)}
`
;
state
.
value
=
`¥
${(
+
value
*
(
current
.
price
/
current
.
purchaseCount
)
).
toFixed
(
2
)}
`
;
}
);
});
...
...
src/pages/transaction/stockSellStorage/bills/addBills/index.tsx
View file @
a886a859
...
...
@@ -527,7 +527,7 @@ const AddBills: React.FC<{}> = (props: any) => {
product
:
undefined
,
productName
:
item
.
productName
,
productId
:
''
,
price
:
0
,
price
:
''
,
productCount
:
0
,
amount
:
''
,
}));
...
...
src/pages/transaction/supplierEvaluation/unevaluated/schema/index.tsx
View file @
a886a859
...
...
@@ -38,7 +38,7 @@ export const listSearchSchema: ISchema = {
columns
:
6
,
},
properties
:
{
m
embersName
:
{
supplyM
embersName
:
{
type
:
'string'
,
default
:
undefined
,
'x-component-props'
:
{
...
...
src/pages/user/forgetPwd.tsx
View file @
a886a859
import
React
,
{
useState
,
Fragment
}
from
'react'
;
import
cx
from
'classnames'
;
import
{
Row
}
from
'antd'
;
import
{
Link
,
Helmet
}
from
'umi'
import
{
Row
,
Button
}
from
'antd'
;
import
{
Link
,
Helmet
,
history
}
from
'umi'
import
{
FormPage
,
RiskCheck
}
from
'god'
import
{
IFormControllers
,
IFormButtonTypes
}
from
'god/dist/src/form-page'
import
'./index.less'
...
...
@@ -9,90 +9,25 @@ import NiceForm from '@/components/NiceForm';
import
{
forgetPwdSchema
}
from
'./schema'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
omit
}
from
'@/utils'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
actions
=
createFormActions
()
const
GetBack
:
React
.
FC
=
()
=>
{
const
[
validButton
,
setValidButton
]
=
useState
(
true
)
const
finish
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'finish'
)
}
const
handleSubmit
=
(
value
:
any
)
=>
{
const
handleSubmit
=
async
(
value
:
any
)
=>
{
const
{
account
}
=
value
const
accountParams
=
PATTERN_MAPS
.
email
.
test
(
account
)
?
{
email
:
account
,
...
omit
(
value
,
[
'account'
])}
:
{
phone
:
account
,
...
omit
(
value
,
[
'account'
])
}
console
.
log
(
accountParams
)
}
const
getBcakForm
:
IFormControllers
[]
=
[
{
type
:
'Input'
,
name
:
'phonemail'
,
span
:
24
,
inputProps
:
{
type
:
'phonemail'
,
placeholder
:
'请输入您的邮箱/手机'
,
},
rules
:
[
{
required
:
true
,
message
:
'邮箱/手机为必填项!'
}
]
},
// {
// span: 24,
// // @ts-ignore
// custom: () => <RiskCheck />
// },
{
type
:
'Verification'
,
name
:
'smsCode'
,
span
:
24
,
inputProps
:
{
const
isEmail
=
PATTERN_MAPS
.
email
.
test
(
account
)
const
accountParams
=
isEmail
?
{
email
:
account
,
...
omit
(
value
,
[
'account'
,
'confirmPassword'
])}
:
{
phone
:
account
,
...
omit
(
value
,
[
'account'
,
'confirmPassword'
])
}
const
submitFn
=
isEmail
?
PublicApi
.
postMemberRegisterResetEmail
:
PublicApi
.
postMemberRegisterResetSms
}
},
{
type
:
'Input'
,
name
:
'password'
,
span
:
24
,
inputProps
:
{
type
:
'password'
,
placeholder
:
'设置你的密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'密码为必填项!'
},
{
pattern
:
/^
(?=
.*
[
a-z
])(?=
.*
[
A-Z
])(?=
.*
\d)[^]{8,20}
$/
,
message
:
'密码长度8-20个字符,必须包含大小写字母和数字!'
}
],
},
{
type
:
'Input'
,
name
:
'confirm'
,
span
:
24
,
dependencies
:
[
'password'
],
inputProps
:
{
type
:
'password'
,
placeholder
:
'请再次输入密码'
,
},
rules
:
[
{
required
:
true
,
message
:
'请再次确认密码!'
},
({
getFieldValue
})
=>
({
validator
(
rule
,
value
)
{
if
(
!
value
||
getFieldValue
(
'password'
)
===
value
)
{
return
Promise
.
resolve
();
}
return
Promise
.
reject
(
'两次的密码输入不一致!'
);
},
}),
]
},
]
const
getBackButtons
:
IFormButtonTypes
[]
=
[
{
text
:
'提交'
,
type
:
'primary'
,
htmlType
:
'submit'
,
block
:
true
,
disabled
:
false
,
const
{
code
}
=
await
submitFn
(
accountParams
)
if
(
code
===
1000
)
{
history
.
replace
(
'/user/login'
)
}
]
}
const
SubmitBtn
=
<
Button
type=
'primary'
block
htmlType=
'submit'
>
提交
</
Button
>
return
(
<
Fragment
>
...
...
@@ -105,6 +40,10 @@ const GetBack: React.FC = () => {
<
NiceForm
schema=
{
forgetPwdSchema
}
onSubmit=
{
handleSubmit
}
actions=
{
actions
}
expressionScope=
{
{
SubmitBtn
}
}
effects=
{
(
$
,
{
setFieldState
,
getFieldState
})
=>
{
$
(
'onFieldValueChange'
,
'*(password,confirmPassword)'
).
subscribe
(
fieldState
=>
{
const
selfName
=
fieldState
.
name
...
...
@@ -128,6 +67,10 @@ const GetBack: React.FC = () => {
})
}
}
/>
<
p
className=
{
'formBox'
}
>
<
Link
className=
'back'
to=
{
'/user/login'
}
>
返回登录页
</
Link
>
</
p
>
</
div
>
</
Row
>
</
Fragment
>
...
...
src/pages/user/schema/index.ts
View file @
a886a859
...
...
@@ -202,12 +202,19 @@ export const forgetPwdSchema: ISchema = {
size
:
'large'
}
},
SliderValidate
:
{
type
:
'object'
,
"x-component"
:
"SliderValidate"
},
smsCode
:
{
type
:
'string'
,
"x-component"
:
'Phone'
,
required
:
true
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请输入验证码'
},
{
pattern
:
PATTERN_MAPS
.
smsCode
,
message
:
'请输入正确的6位验证码'
}
...
...
@@ -229,6 +236,8 @@ export const forgetPwdSchema: ISchema = {
if
(
res
.
code
===
1000
)
{
callback
()
}
}).
finally
(()
=>
{
setLoading
(
false
)
})
}
...
...
@@ -240,6 +249,8 @@ export const forgetPwdSchema: ISchema = {
if
(
res
.
code
===
1000
)
{
callback
()
}
}).
finally
(()
=>
{
setLoading
(
false
)
})
}
})
...
...
@@ -282,9 +293,12 @@ export const forgetPwdSchema: ISchema = {
size
:
'large'
,
}
},
submit
:
{
VirtualChildren
:
{
type
:
'string'
,
"x-component"
:
'Submit'
"x-component"
:
'VirtualChildren'
,
"x-component-props"
:
{
children
:
"{{SubmitBtn}}"
}
}
}
}
...
...
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