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
陈智峰
jinfa-platform
Commits
82464089
Commit
82464089
authored
Oct 13, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:注册页面筛选
parent
7ce0b7cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
CustomRadio.tsx
src/components/NiceForm/components/CustomRadio.tsx
+4
-3
register.tsx
src/pages/user/register.tsx
+13
-2
index.ts
src/pages/user/schema/index.ts
+10
-10
No files found.
src/components/NiceForm/components/CustomRadio.tsx
View file @
82464089
...
...
@@ -2,11 +2,12 @@ import React from 'react';
import
{
Radio
,
Tooltip
}
from
'antd'
;
const
CustomCheckbox
=
props
=>
{
const
{
layout
}
=
props
const
{
layout
,
value
,
dataSource
}
=
props
return
(
<
Radio
.
Group
value=
{
props
.
value
}
onChange=
{
props
.
onChange
}
className=
{
layout
===
'column'
?
'identityRadio'
:
'businessRadio'
}
name=
{
props
.
name
}
>
<
Radio
.
Group
value=
{
value
}
onChange=
{
props
.
onChange
}
className=
{
layout
===
'column'
?
'identityRadio'
:
'businessRadio'
}
name=
{
props
.
name
}
>
{
props
.
dataSource
&&
props
.
dataSource
.
map
((
v
,
i
)
=>
<
Tooltip
title=
{
v
.
label
}
placement=
'leftTop'
key=
{
v
.
value
+
i
}
><
Radio
.
Button
value=
{
v
.
value
}
>
{
v
.
label
}
</
Radio
.
Button
></
Tooltip
>)
dataSource
&&
dataSource
.
map
((
v
,
i
)
=>
<
Tooltip
title=
{
v
.
label
}
placement=
'leftTop'
key=
{
v
.
value
}
><
Radio
.
Button
value=
{
v
.
value
}
>
{
v
.
label
}
</
Radio
.
Button
></
Tooltip
>)
}
</
Radio
.
Group
>
)
...
...
src/pages/user/register.tsx
View file @
82464089
...
...
@@ -266,8 +266,20 @@ const UserRegistry = () => {
components=
{
{
CustomInput
}
}
effects=
{
()
=>
{
effects=
{
(
$
,
actions
)
=>
{
useLinkageValidateEffects
()
$
(
'onFieldInputChange'
,
'typeId'
).
subscribe
(({
value
})
=>
{
const
businessTypeId
=
GlobalConfig
.
userRegister
.
useType
.
find
(
v
=>
v
.
memberTypeId
===
value
)?.
businessTypes
||
[]
if
(
businessTypeId
.
length
>
0
)
{
actions
.
setFieldValue
(
'businessTypeId'
,
businessTypeId
[
0
].
businessTypeId
)
}
actions
.
setFieldState
(
'businessTypeId'
,
state
=>
{
state
.
props
.
enum
=
businessTypeId
.
map
(
v
=>
({
label
:
v
.
businessTypeName
,
value
:
v
.
businessTypeId
}))
})
})
}
}
expressionScope=
{
{
current
:
false
,
...
...
@@ -281,7 +293,6 @@ const UserRegistry = () => {
</
span
>,
memberTypeTitle
:
<
span
className=
{
'commonPanelTitle'
}
>
请选择您的身份
</
span
>,
businessTypeTitle
:
<
span
className=
{
'commonPanelTitle'
}
>
请选择您要开展的业务
</
span
>,
memberChooseList
:
[]
}
}
/>
<
div
className=
{
cx
(
'registerForm'
,
'global-block-center'
)
}
>
...
...
src/pages/user/schema/index.ts
View file @
82464089
...
...
@@ -42,7 +42,7 @@ export const registerStep0Schema: ISchema = {
}
],
"x-component-props"
:
{
size
:
'large'
,
size
:
'large'
}
},
password
:
{
...
...
@@ -127,10 +127,10 @@ export const registerStep1Schema: ISchema = {
"x-component-props"
:
{
layout
:
'column'
},
enum
:
GlobalConfig
.
userRegister
.
useType
.
m
emberType
.
m
ap
(
v
=>
{
enum
:
GlobalConfig
.
userRegister
.
useType
.
map
(
v
=>
{
return
{
value
:
v
.
i
d
,
label
:
v
.
t
ypeName
value
:
v
.
memberTypeI
d
,
label
:
v
.
memberT
ypeName
}
})
},
...
...
@@ -146,17 +146,17 @@ export const registerStep1Schema: ISchema = {
properties
:
{
businessTypeId
:
{
type
:
'string'
,
required
:
true
,
"x-component"
:
'CustomRadio'
,
"x-component-props"
:
{
layout
:
'row'
},
enum
:
GlobalConfig
.
userRegister
.
useType
.
businessType
.
map
(
v
=>
{
return
{
value
:
v
.
id
,
label
:
v
.
typeName
enum
:
[],
"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