diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index c195aa2c..38eb626c 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -105,7 +105,7 @@ export function useFormEvents({ fields.forEach((key) => { const schema = unref(getSchema).find((item) => item.field === key) let value = get(values, key) - const hasKey = !!get(values, key) + const hasKey = Reflect.has(values, key) value = handleInputNumberValue(schema?.component, value) const { componentProps } = schema || {} diff --git a/src/views/bpm/group/group.data.ts b/src/views/bpm/group/group.data.ts index 047b5d75..1e08fcdf 100644 --- a/src/views/bpm/group/group.data.ts +++ b/src/views/bpm/group/group.data.ts @@ -127,7 +127,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/bpm/model/model.data.ts b/src/views/bpm/model/model.data.ts index 1988260e..dd4fc608 100644 --- a/src/views/bpm/model/model.data.ts +++ b/src/views/bpm/model/model.data.ts @@ -167,7 +167,6 @@ export const formSchema: FormSchema[] = [ label: '流程分类', field: 'category', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY) } diff --git a/src/views/infra/codegen/codegen.data.ts b/src/views/infra/codegen/codegen.data.ts index 8945041e..b2460368 100644 --- a/src/views/infra/codegen/codegen.data.ts +++ b/src/views/infra/codegen/codegen.data.ts @@ -102,7 +102,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } @@ -132,7 +131,6 @@ export const importTableSearchFormSchema: FormSchema[] = [ label: '数据源', field: 'dataSourceConfigId', component: 'ApiSelect', - defaultValue: 0, componentProps: { api: () => getDataSourceConfigList(), labelField: 'name', diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts index c3a8a022..b36114f1 100644 --- a/src/views/infra/config/config.data.ts +++ b/src/views/infra/config/config.data.ts @@ -123,7 +123,6 @@ export const formSchema: FormSchema[] = [ label: '是否可见', field: 'visible', component: 'RadioGroup', - defaultValue: 0, componentProps: { options: [ { key: true, label: '是', value: true }, diff --git a/src/views/mp/user/mpuser.data.ts b/src/views/mp/user/mpuser.data.ts index ec7b5f5b..8a5872ee 100644 --- a/src/views/mp/user/mpuser.data.ts +++ b/src/views/mp/user/mpuser.data.ts @@ -54,7 +54,6 @@ export const searchFormSchema: FormSchema[] = [ label: '公众号', field: 'accountId', component: 'ApiSelect', - defaultValue: 0, componentProps: { api: () => getSimpleAccounts(), labelField: 'name', diff --git a/src/views/pay/app/app.data.ts b/src/views/pay/app/app.data.ts index b4204436..d097789a 100644 --- a/src/views/pay/app/app.data.ts +++ b/src/views/pay/app/app.data.ts @@ -182,7 +182,6 @@ export const formSchema: FormSchema[] = [ label: '开启状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } @@ -230,7 +229,6 @@ export const aliPayFormSchema: FormSchema[] = [ label: '渠道状态', field: 'status', required: true, - defaultValue: 0, component: 'RadioGroup', componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) @@ -335,7 +333,6 @@ export const weChatFormSchema: FormSchema[] = [ label: '渠道状态', field: 'status', required: true, - defaultValue: 0, component: 'RadioGroup', componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) diff --git a/src/views/pay/demo/demo.data.ts b/src/views/pay/demo/demo.data.ts index 42826fd9..ff9e06f1 100644 --- a/src/views/pay/demo/demo.data.ts +++ b/src/views/pay/demo/demo.data.ts @@ -95,7 +95,6 @@ export const formSchema: FormSchema[] = [ label: '商品', field: 'spuId', component: 'Select', - defaultValue: 0, required: true, componentProps: { options: [ diff --git a/src/views/pay/merchant/merchant.data.ts b/src/views/pay/merchant/merchant.data.ts index 0ead293f..c14db6e9 100644 --- a/src/views/pay/merchant/merchant.data.ts +++ b/src/views/pay/merchant/merchant.data.ts @@ -138,7 +138,6 @@ export const formSchema: FormSchema[] = [ label: '开启状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/dept/dept.data.ts b/src/views/system/dept/dept.data.ts index 684b88b4..321255dc 100644 --- a/src/views/system/dept/dept.data.ts +++ b/src/views/system/dept/dept.data.ts @@ -86,7 +86,6 @@ export const formSchema: FormSchema[] = [ label: '上级部门', field: 'parentId', required: true, - defaultValue: 0, component: 'ApiTreeSelect', componentProps: { api: () => listSimpleDept(), @@ -145,7 +144,6 @@ export const formSchema: FormSchema[] = [ label: '部门状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/dict/dict.data.ts b/src/views/system/dict/dict.data.ts index e65731a4..b1173b99 100644 --- a/src/views/system/dict/dict.data.ts +++ b/src/views/system/dict/dict.data.ts @@ -110,7 +110,6 @@ export const dataFormSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/dict/dict.type.ts b/src/views/system/dict/dict.type.ts index b5b0c793..481eb6bb 100644 --- a/src/views/system/dict/dict.type.ts +++ b/src/views/system/dict/dict.type.ts @@ -76,7 +76,6 @@ export const typeFormSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/menu/menu.data.ts b/src/views/system/menu/menu.data.ts index 1077f6f2..cf1fdd23 100644 --- a/src/views/system/menu/menu.data.ts +++ b/src/views/system/menu/menu.data.ts @@ -80,7 +80,6 @@ export const formSchema: FormSchema[] = [ label: '上级菜单', field: 'parentId', required: true, - defaultValue: 0, component: 'ApiTreeSelect', componentProps: { api: () => listSimpleMenus(), @@ -157,7 +156,6 @@ export const formSchema: FormSchema[] = [ field: 'status', required: true, component: 'RadioButtonGroup', - defaultValue: 0, helpMessage: '选择停用时,路由将不会出现在侧边栏,也不能被访问', componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) diff --git a/src/views/system/notice/notice.data.ts b/src/views/system/notice/notice.data.ts index 7fb433a2..cc475d79 100644 --- a/src/views/system/notice/notice.data.ts +++ b/src/views/system/notice/notice.data.ts @@ -73,7 +73,6 @@ export const formSchema: FormSchema[] = [ label: '公告类型', field: 'type', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE) } @@ -82,7 +81,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/notify/my/my.data.ts b/src/views/system/notify/my/my.data.ts index 3831dbd8..c9533f6e 100644 --- a/src/views/system/notify/my/my.data.ts +++ b/src/views/system/notify/my/my.data.ts @@ -91,7 +91,6 @@ export const formSchema: FormSchema[] = [ label: '类型', field: 'type', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE) } @@ -100,7 +99,6 @@ export const formSchema: FormSchema[] = [ label: '开启状态', field: 'status', component: 'RadioGroup', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/notify/template/template.data.ts b/src/views/system/notify/template/template.data.ts index 82dede8e..75a1e23c 100644 --- a/src/views/system/notify/template/template.data.ts +++ b/src/views/system/notify/template/template.data.ts @@ -118,7 +118,6 @@ export const formSchema: FormSchema[] = [ label: '类型', field: 'type', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE) } @@ -127,7 +126,6 @@ export const formSchema: FormSchema[] = [ label: '开启状态', field: 'status', component: 'RadioGroup', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/oauth2/client/client.data.ts b/src/views/system/oauth2/client/client.data.ts index 4060c006..d9d59a5e 100644 --- a/src/views/system/oauth2/client/client.data.ts +++ b/src/views/system/oauth2/client/client.data.ts @@ -129,7 +129,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/post/post.data.ts b/src/views/system/post/post.data.ts index d549eac5..6c5daba2 100644 --- a/src/views/system/post/post.data.ts +++ b/src/views/system/post/post.data.ts @@ -99,7 +99,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/role/role.data.ts b/src/views/system/role/role.data.ts index 2237df19..c24abdfa 100644 --- a/src/views/system/role/role.data.ts +++ b/src/views/system/role/role.data.ts @@ -109,7 +109,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/sensitiveWord/sensitiveWord.data.ts b/src/views/system/sensitiveWord/sensitiveWord.data.ts index 7bb643f3..18f09fb2 100644 --- a/src/views/system/sensitiveWord/sensitiveWord.data.ts +++ b/src/views/system/sensitiveWord/sensitiveWord.data.ts @@ -90,7 +90,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/sms/template/smsTemplate.data.ts b/src/views/system/sms/template/smsTemplate.data.ts index 487fa7a2..2279c442 100644 --- a/src/views/system/sms/template/smsTemplate.data.ts +++ b/src/views/system/sms/template/smsTemplate.data.ts @@ -126,7 +126,6 @@ export const formSchema: FormSchema[] = [ label: '短信类型', field: 'type', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE) } @@ -153,7 +152,6 @@ export const formSchema: FormSchema[] = [ label: '开启状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts index 42e8ed76..65c749bd 100644 --- a/src/views/system/tenant/tenant.data.ts +++ b/src/views/system/tenant/tenant.data.ts @@ -183,7 +183,6 @@ export const formSchema: FormSchema[] = [ label: '租户状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/tenantPackage/tenantPackage.data.ts b/src/views/system/tenantPackage/tenantPackage.data.ts index 737c92cf..0797bd07 100644 --- a/src/views/system/tenantPackage/tenantPackage.data.ts +++ b/src/views/system/tenantPackage/tenantPackage.data.ts @@ -82,7 +82,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) } diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index f5d30c73..b8c231ca 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -192,7 +192,6 @@ export const formSchema: FormSchema[] = [ label: '状态', field: 'status', component: 'Select', - defaultValue: 0, componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS) }