From ce1236d141efcb0086c793850592b0c679a184ae Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 16 May 2023 14:40:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=B1=E4=BA=8E=20=E5=A4=9A=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=AD=97=E6=AE=B5=E8=8E=B7=E5=8F=96=E5=80=BC=E5=A4=84?= =?UTF-8?q?=E7=90=86=20=E9=80=A0=E6=88=90=E7=9A=84=20set=20value=E5=80=BC?= =?UTF-8?q?=E4=B8=BA0||''=E6=97=B6=E4=B8=8D=E6=88=90=E5=8A=9F=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/hooks/useFormEvents.ts | 2 +- src/views/bpm/group/group.data.ts | 1 - src/views/bpm/model/model.data.ts | 1 - src/views/infra/codegen/codegen.data.ts | 2 -- src/views/infra/config/config.data.ts | 1 - src/views/mp/user/mpuser.data.ts | 1 - src/views/pay/app/app.data.ts | 3 --- src/views/pay/demo/demo.data.ts | 1 - src/views/pay/merchant/merchant.data.ts | 1 - src/views/system/dept/dept.data.ts | 2 -- src/views/system/dict/dict.data.ts | 1 - src/views/system/dict/dict.type.ts | 1 - src/views/system/menu/menu.data.ts | 2 -- src/views/system/notice/notice.data.ts | 2 -- src/views/system/notify/my/my.data.ts | 2 -- src/views/system/notify/template/template.data.ts | 2 -- src/views/system/oauth2/client/client.data.ts | 1 - src/views/system/post/post.data.ts | 1 - src/views/system/role/role.data.ts | 1 - src/views/system/sensitiveWord/sensitiveWord.data.ts | 1 - src/views/system/sms/template/smsTemplate.data.ts | 2 -- src/views/system/tenant/tenant.data.ts | 1 - src/views/system/tenantPackage/tenantPackage.data.ts | 1 - src/views/system/user/user.data.ts | 1 - 24 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index c195aa2..38eb626 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 047b5d7..1e08fcd 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 1988260..dd4fc60 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 8945041..b246036 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 c3a8a02..b36114f 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 ec7b5f5..8a5872e 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 b420443..d097789 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 42826fd..ff9e06f 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 0ead293..c14db6e 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 684b88b..321255d 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 e65731a..b1173b9 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 b5b0c79..481eb6b 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 1077f6f..cf1fdd2 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 7fb433a..cc475d7 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 3831dbd..c9533f6 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 82dede8..75a1e23 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 4060c00..d9d59a5 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 d549eac..6c5daba 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 2237df1..c24abdf 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 7bb643f..18f09fb 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 487fa7a..2279c44 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 42e8ed7..65c749b 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 737c92c..0797bd0 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 f5d30c7..b8c231c 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) }