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

fix:注册页面筛选

parent 7ce0b7cc
......@@ -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>
)
......
......@@ -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')}>
......
......@@ -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.memberType.map(v => {
enum: GlobalConfig.userRegister.useType.map(v => {
return {
value: v.id,
label: v.typeName
value: v.memberTypeId,
label: v.memberTypeName
}
})
},
......@@ -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: '请选择业务'
}
})
]
},
}
}
......
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