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
linweijiong
jinfa-platform
Commits
1b6f110e
Commit
1b6f110e
authored
Oct 22, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
b8d71152
ff556a83
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
91 deletions
+78
-91
proxy.ts
config/proxy.ts
+1
-1
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
...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
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 @
1b6f110e
export
default
{
export
default
{
'/api'
:
{
'/api'
:
{
'target'
:
'http://10.0.0.
25
:8100/'
,
'target'
:
'http://10.0.0.
10
:8100/'
,
'changeOrigin'
:
true
,
'changeOrigin'
:
true
,
'pathRewrite'
:
{
'^/api'
:
''
},
'pathRewrite'
:
{
'^/api'
:
''
},
}
}
...
...
src/components/NiceForm/components/SliderValidate.tsx
0 → 100644
View file @
1b6f110e
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 @
1b6f110e
...
@@ -26,6 +26,7 @@ import { Checkbox, Radio } from '@formily/antd-components';
...
@@ -26,6 +26,7 @@ import { Checkbox, Radio } from '@formily/antd-components';
import
DateSelect
from
'./components/DateSelect'
;
import
DateSelect
from
'./components/DateSelect'
;
import
VirtualChildren
from
'./components/VirtualChildren'
;
import
VirtualChildren
from
'./components/VirtualChildren'
;
import
SmilingFace
from
'./components/SmilingFace'
;
import
SmilingFace
from
'./components/SmilingFace'
;
import
SliderValidate
from
'./components/SliderValidate'
;
import
{
useLinkComponentProps
}
from
'./linkages/linkComponentProps'
;
import
{
useLinkComponentProps
}
from
'./linkages/linkComponentProps'
;
import
Loading
from
'../Loading'
;
import
Loading
from
'../Loading'
;
...
@@ -98,6 +99,7 @@ export const componentExport = {
...
@@ -98,6 +99,7 @@ export const componentExport = {
DateSelect
,
DateSelect
,
VirtualChildren
,
VirtualChildren
,
SmilingFace
,
SmilingFace
,
SliderValidate
,
RadioGroup
:
Radio
.
Group
RadioGroup
:
Radio
.
Group
}
}
const
NiceForm
:
React
.
FC
<
NiceFormProps
>
=
props
=>
{
const
NiceForm
:
React
.
FC
<
NiceFormProps
>
=
props
=>
{
...
...
src/formSchema/effects/useAsyncSelect.ts
View file @
1b6f110e
...
@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
...
@@ -17,9 +17,10 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
})
linkage
.
loading
(
name
)
linkage
.
loading
(
name
)
service
().
then
(
res
=>
{
service
().
then
(
res
=>
{
let
enums
=
[]
if
(
format
)
{
if
(
format
)
{
const
[
labelString
,
valueString
]
=
format
const
[
labelString
,
valueString
]
=
format
re
s
=
res
.
map
(
v
=>
({
enum
s
=
res
.
map
(
v
=>
({
label
:
v
[
labelString
],
label
:
v
[
labelString
],
value
:
v
[
valueString
]
value
:
v
[
valueString
]
}))
}))
...
@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
...
@@ -29,7 +30,7 @@ export const useAsyncSelect = async (name, service: () => Promise<any[]>, format
})
})
linkage
.
loaded
(
name
)
linkage
.
loaded
(
name
)
linkage
.
enum
(
name
,
re
s
)
linkage
.
enum
(
name
,
enum
s
)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch
(
'requestAsyncSelect'
,
{
dispatch
(
'requestAsyncSelect'
,
{
name
,
name
,
...
...
src/pages/transaction/components/orderHandReceivedModal/index.tsx
View file @
1b6f110e
...
@@ -12,12 +12,11 @@ export interface OrderHandReceivedModalProps {
...
@@ -12,12 +12,11 @@ export interface OrderHandReceivedModalProps {
const
OrderHandReceivedModal
:
React
.
FC
<
OrderHandReceivedModalProps
>
=
({
currentRef
})
=>
{
const
OrderHandReceivedModal
:
React
.
FC
<
OrderHandReceivedModalProps
>
=
({
currentRef
})
=>
{
const
{
formContext
}
=
useContext
(
OrderDetailContext
)
const
{
data
}
=
useContext
(
OrderDetailContext
)
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
const
[
confirmVisible
,
setConfirmVisible
]
=
useState
(
false
)
const
formData
=
formContext
.
data
||
{}
const
formData
=
data
||
{}
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderManualConfirmReceipt
)
const
{
run
,
loading
}
=
useHttpRequest
(
PublicApi
.
postOrderManualConfirmReceipt
)
const
handleConfirm
=
async
()
=>
{
const
handleConfirm
=
async
()
=>
{
console
.
log
(
'确认收货'
)
const
{
code
}
=
await
run
({
const
{
code
}
=
await
run
({
orderId
:
formData
.
id
orderId
:
formData
.
id
})
})
...
...
src/pages/transaction/purchaseOrder/readyReceiveOrder/detail/index.tsx
View file @
1b6f110e
...
@@ -18,7 +18,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
...
@@ -18,7 +18,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
const
approvedRef
=
useRef
<
any
>
({})
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
(()
=>
{
const
handleClick
=
useCallback
(()
=>
{
if
(
isHeadReceipt
)
{
if
(
isHeadReceipt
)
{
...
...
src/pages/transaction/saleOrder/readyConfirmDelevedOrder/detail/index.tsx
View file @
1b6f110e
...
@@ -16,7 +16,7 @@ const ReadyConfirmDelevedOrderDetail: React.FC = () => {
...
@@ -16,7 +16,7 @@ const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const
{
formContext
,
id
,
detailList
}
=
useOrderDetail
({
type
:
'saleOrder'
})
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
)
const
isShowBtn
=
formContext
.
data
?.
orderDeliveryDetailsResponses
?.
some
(
v
=>
v
.
interiorState
===
DeliverySideState
.
ADD_LOGISTICS_ORDER
)
...
...
src/pages/user/forgetPwd.tsx
View file @
1b6f110e
import
React
,
{
useState
,
Fragment
}
from
'react'
;
import
React
,
{
useState
,
Fragment
}
from
'react'
;
import
cx
from
'classnames'
;
import
cx
from
'classnames'
;
import
{
Row
}
from
'antd'
;
import
{
Row
,
Button
}
from
'antd'
;
import
{
Link
,
Helmet
}
from
'umi'
import
{
Link
,
Helmet
,
history
}
from
'umi'
import
{
FormPage
,
RiskCheck
}
from
'god'
import
{
FormPage
,
RiskCheck
}
from
'god'
import
{
IFormControllers
,
IFormButtonTypes
}
from
'god/dist/src/form-page'
import
{
IFormControllers
,
IFormButtonTypes
}
from
'god/dist/src/form-page'
import
'./index.less'
import
'./index.less'
...
@@ -9,90 +9,25 @@ import NiceForm from '@/components/NiceForm';
...
@@ -9,90 +9,25 @@ import NiceForm from '@/components/NiceForm';
import
{
forgetPwdSchema
}
from
'./schema'
;
import
{
forgetPwdSchema
}
from
'./schema'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
PATTERN_MAPS
}
from
'@/constants/regExp'
;
import
{
omit
}
from
'@/utils'
;
import
{
omit
}
from
'@/utils'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
actions
=
createFormActions
()
const
GetBack
:
React
.
FC
=
()
=>
{
const
GetBack
:
React
.
FC
=
()
=>
{
const
[
validButton
,
setValidButton
]
=
useState
(
true
)
const
finish
=
(
value
:
any
)
=>
{
const
handleSubmit
=
async
(
value
:
any
)
=>
{
console
.
log
(
value
,
'finish'
)
}
const
handleSubmit
=
(
value
:
any
)
=>
{
const
{
account
}
=
value
const
{
account
}
=
value
const
accountParams
=
PATTERN_MAPS
.
email
.
test
(
account
)
?
{
email
:
account
,
...
omit
(
value
,
[
'account'
])}
:
{
phone
:
account
,
...
omit
(
value
,
[
'account'
])
}
const
isEmail
=
PATTERN_MAPS
.
email
.
test
(
account
)
console
.
log
(
accountParams
)
const
accountParams
=
isEmail
?
{
email
:
account
,
...
omit
(
value
,
[
'account'
,
'confirmPassword'
])}
:
{
phone
:
account
,
...
omit
(
value
,
[
'account'
,
'confirmPassword'
])
}
}
const
submitFn
=
isEmail
?
PublicApi
.
postMemberRegisterResetEmail
:
PublicApi
.
postMemberRegisterResetSms
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
{
code
}
=
await
submitFn
(
accountParams
)
},
if
(
code
===
1000
)
{
{
history
.
replace
(
'/user/login'
)
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
SubmitBtn
=
<
Button
type=
'primary'
block
htmlType=
'submit'
>
提交
</
Button
>
return
(
return
(
<
Fragment
>
<
Fragment
>
...
@@ -105,6 +40,10 @@ const GetBack: React.FC = () => {
...
@@ -105,6 +40,10 @@ const GetBack: React.FC = () => {
<
NiceForm
<
NiceForm
schema=
{
forgetPwdSchema
}
schema=
{
forgetPwdSchema
}
onSubmit=
{
handleSubmit
}
onSubmit=
{
handleSubmit
}
actions=
{
actions
}
expressionScope=
{
{
SubmitBtn
}
}
effects=
{
(
$
,
{
setFieldState
,
getFieldState
})
=>
{
effects=
{
(
$
,
{
setFieldState
,
getFieldState
})
=>
{
$
(
'onFieldValueChange'
,
'*(password,confirmPassword)'
).
subscribe
(
fieldState
=>
{
$
(
'onFieldValueChange'
,
'*(password,confirmPassword)'
).
subscribe
(
fieldState
=>
{
const
selfName
=
fieldState
.
name
const
selfName
=
fieldState
.
name
...
@@ -128,6 +67,10 @@ const GetBack: React.FC = () => {
...
@@ -128,6 +67,10 @@ const GetBack: React.FC = () => {
})
})
}
}
}
}
/>
/>
<
p
className=
{
'formBox'
}
>
<
Link
className=
'back'
to=
{
'/user/login'
}
>
返回登录页
</
Link
>
</
p
>
</
div
>
</
div
>
</
Row
>
</
Row
>
</
Fragment
>
</
Fragment
>
...
...
src/pages/user/schema/index.ts
View file @
1b6f110e
...
@@ -202,12 +202,19 @@ export const forgetPwdSchema: ISchema = {
...
@@ -202,12 +202,19 @@ export const forgetPwdSchema: ISchema = {
size
:
'large'
size
:
'large'
}
}
},
},
SliderValidate
:
{
type
:
'object'
,
"x-component"
:
"SliderValidate"
},
smsCode
:
{
smsCode
:
{
type
:
'string'
,
type
:
'string'
,
"x-component"
:
'Phone'
,
"x-component"
:
'Phone'
,
required
:
true
,
"x-rules"
:
[
"x-rules"
:
[
{
{
required
:
true
,
message
:
'请输入验证码'
},
{
pattern
:
PATTERN_MAPS
.
smsCode
,
pattern
:
PATTERN_MAPS
.
smsCode
,
message
:
'请输入正确的6位验证码'
message
:
'请输入正确的6位验证码'
}
}
...
@@ -229,6 +236,8 @@ export const forgetPwdSchema: ISchema = {
...
@@ -229,6 +236,8 @@ export const forgetPwdSchema: ISchema = {
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
callback
()
callback
()
}
}
}).
finally
(()
=>
{
setLoading
(
false
)
})
})
}
}
...
@@ -240,6 +249,8 @@ export const forgetPwdSchema: ISchema = {
...
@@ -240,6 +249,8 @@ export const forgetPwdSchema: ISchema = {
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
callback
()
callback
()
}
}
}).
finally
(()
=>
{
setLoading
(
false
)
})
})
}
}
})
})
...
@@ -282,9 +293,12 @@ export const forgetPwdSchema: ISchema = {
...
@@ -282,9 +293,12 @@ export const forgetPwdSchema: ISchema = {
size
:
'large'
,
size
:
'large'
,
}
}
},
},
submit
:
{
VirtualChildren
:
{
type
:
'string'
,
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