From 3d023fb3e418480d2db8db154f154587b2538ac2 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 16 Aug 2021 15:07:02 +0800 Subject: [PATCH] feat: add maxLevel and changeOnSelect props for the china region field --- .../database-field/interfaces/chinaRegion.ts | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/client/src/schemas/database-field/interfaces/chinaRegion.ts b/packages/client/src/schemas/database-field/interfaces/chinaRegion.ts index a3308908b..5568b5cdc 100644 --- a/packages/client/src/schemas/database-field/interfaces/chinaRegion.ts +++ b/packages/client/src/schemas/database-field/interfaces/chinaRegion.ts @@ -34,8 +34,26 @@ export const chinaRegion: FieldOptions = { }, properties: { ...defaultProps, + 'uiSchema.x-component-props.maxLevel': { + type: 'number', + 'x-component': 'Radio.Group', + 'x-decorator': 'FormItem', + title: '层级', + default: 3, + enum: [ + { value: 1, label: '省' }, + { value: 2, label: '市' }, + { value: 3, label: '区/县' }, + { value: 4, label: '乡镇/街道' }, + { value: 5, label: '村/居委会' }, + ], + }, + 'uiSchema.x-component-props.changeOnSelect': { + type: 'boolean', + 'x-component': 'Checkbox', + 'x-content': '无需选到最后一级', + 'x-decorator': 'FormItem', + }, }, - operations: [ - { label: '等于', value: 'code.in' }, - ], + operations: [{ label: '等于', value: 'code.in' }], };