Commit 82464089 authored by 前端-许佳敏's avatar 前端-许佳敏

fix:注册页面筛选

parent 7ce0b7cc
...@@ -2,11 +2,12 @@ import React from 'react'; ...@@ -2,11 +2,12 @@ import React from 'react';
import { Radio, Tooltip } from 'antd'; import { Radio, Tooltip } from 'antd';
const CustomCheckbox = props => { const CustomCheckbox = props => {
const { layout } = props const { layout, value, dataSource } = props
return ( 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> </Radio.Group>
) )
......
...@@ -266,8 +266,20 @@ const UserRegistry = () => { ...@@ -266,8 +266,20 @@ const UserRegistry = () => {
components={{ components={{
CustomInput CustomInput
}} }}
effects={() => { effects={($, actions) => {
useLinkageValidateEffects() 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={{ expressionScope={{
current: false, current: false,
...@@ -281,7 +293,6 @@ const UserRegistry = () => { ...@@ -281,7 +293,6 @@ const UserRegistry = () => {
</span>, </span>,
memberTypeTitle: <span className={'commonPanelTitle'}>请选择您的身份</span>, memberTypeTitle: <span className={'commonPanelTitle'}>请选择您的身份</span>,
businessTypeTitle: <span className={'commonPanelTitle'}>请选择您要开展的业务</span>, businessTypeTitle: <span className={'commonPanelTitle'}>请选择您要开展的业务</span>,
memberChooseList: []
}} }}
/> />
<div className={cx('registerForm', 'global-block-center')}> <div className={cx('registerForm', 'global-block-center')}>
......
...@@ -42,7 +42,7 @@ export const registerStep0Schema: ISchema = { ...@@ -42,7 +42,7 @@ export const registerStep0Schema: ISchema = {
} }
], ],
"x-component-props": { "x-component-props": {
size: 'large', size: 'large'
} }
}, },
password: { password: {
...@@ -127,10 +127,10 @@ export const registerStep1Schema: ISchema = { ...@@ -127,10 +127,10 @@ export const registerStep1Schema: ISchema = {
"x-component-props": { "x-component-props": {
layout: 'column' layout: 'column'
}, },
enum: GlobalConfig.userRegister.useType.memberType.map(v => { enum: GlobalConfig.userRegister.useType.map(v => {
return { return {
value: v.id, value: v.memberTypeId,
label: v.typeName label: v.memberTypeName
} }
}) })
}, },
...@@ -146,17 +146,17 @@ export const registerStep1Schema: ISchema = { ...@@ -146,17 +146,17 @@ export const registerStep1Schema: ISchema = {
properties: { properties: {
businessTypeId: { businessTypeId: {
type: 'string', type: 'string',
required: true,
"x-component": 'CustomRadio', "x-component": 'CustomRadio',
"x-component-props": { "x-component-props": {
layout: 'row' layout: 'row'
}, },
enum: GlobalConfig.userRegister.useType.businessType.map(v => { enum: [],
return { "x-rules": [
value: v.id, {
label: v.typeName required: true,
message: '请选择业务'
} }
}) ]
}, },
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment