Commit 875e074c authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复 区域选择器 没有回调的问题

parent 8476337b
......@@ -10,9 +10,9 @@ import NiceForm from '@/components/NiceForm';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { PublicApi } from '@/services/api';
import { GetMemberAbilitySubGetResponse, GetMemberMainpageDetailGetResponse } from '@/services/MemberV2Api';
import { initDetailSchema } from './schema';
import { getAuth, setAuth } from '@/utils/auth';
import { initDetailSchema } from './schema';
import AreaSelect from '../../../components/AreaSelect';
const formActions = createFormActions();
const {
......@@ -559,6 +559,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
components={{
RadioGroup: Radio.Group,
CheckboxGroup: Checkbox.Group,
AreaSelect,
}}
effects={($, actions) => {
useAsyncInitSelect(
......
......@@ -94,7 +94,7 @@ export function coverColFiltersItem(
}
};
type FieldType = 'string' | 'long' | 'upload' | 'radio' | 'select' | 'checkbox' | 'area';
export type FieldType = 'string' | 'long' | 'upload' | 'radio' | 'select' | 'checkbox' | 'area';
// 字段校验规则枚举:0-无校验规则,1-邮箱规则,2-手机号码规则,3-身份证规则,4-电话号码规则
const RULE_REG_MAP = {
......@@ -154,7 +154,6 @@ const getFieldType = (field: ElementType) => {
'x-component': 'RadioGroup',
enum: field.fieldEnum,
'x-component-props': {
showDesc: false,
disabled: !!field.disabled,
},
};
......@@ -163,6 +162,9 @@ const getFieldType = (field: ElementType) => {
case 'select': {
description = {
enum: field.fieldEnum,
'x-component-props': {
disabled: !!field.disabled,
},
};
break;
}
......@@ -170,12 +172,18 @@ const getFieldType = (field: ElementType) => {
description = {
'x-component': 'CheckboxGroup',
enum: field.fieldEnum,
'x-component-props': {
disabled: !!field.disabled,
},
};
break;
}
case 'area': {
description = {
'x-component': 'AreaSelect',
'x-component-props': {
disabled: !!field.disabled,
},
};
break;
}
......@@ -206,7 +214,7 @@ export function renderFieldTypeContent(fieldType: FieldType, fieldValue: any): R
case 'upload':
node = (
<PicWrap
pics={[fieldValue.fieldValue]}
pics={[fieldValue]}
/>
);
break;
......
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