fix: 由于 多路径字段获取值处理 造成的 set value值为0||''时不成功的情况

pull/12/head
xingyu 2023-05-16 14:40:10 +08:00
parent d86015cafc
commit ce1236d141
24 changed files with 1 additions and 33 deletions

View File

@ -105,7 +105,7 @@ export function useFormEvents({
fields.forEach((key) => { fields.forEach((key) => {
const schema = unref(getSchema).find((item) => item.field === key) const schema = unref(getSchema).find((item) => item.field === key)
let value = get(values, key) let value = get(values, key)
const hasKey = !!get(values, key) const hasKey = Reflect.has(values, key)
value = handleInputNumberValue(schema?.component, value) value = handleInputNumberValue(schema?.component, value)
const { componentProps } = schema || {} const { componentProps } = schema || {}

View File

@ -127,7 +127,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -167,7 +167,6 @@ export const formSchema: FormSchema[] = [
label: '流程分类', label: '流程分类',
field: 'category', field: 'category',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY) options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)
} }

View File

@ -102,7 +102,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }
@ -132,7 +131,6 @@ export const importTableSearchFormSchema: FormSchema[] = [
label: '数据源', label: '数据源',
field: 'dataSourceConfigId', field: 'dataSourceConfigId',
component: 'ApiSelect', component: 'ApiSelect',
defaultValue: 0,
componentProps: { componentProps: {
api: () => getDataSourceConfigList(), api: () => getDataSourceConfigList(),
labelField: 'name', labelField: 'name',

View File

@ -123,7 +123,6 @@ export const formSchema: FormSchema[] = [
label: '是否可见', label: '是否可见',
field: 'visible', field: 'visible',
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: 0,
componentProps: { componentProps: {
options: [ options: [
{ key: true, label: '是', value: true }, { key: true, label: '是', value: true },

View File

@ -54,7 +54,6 @@ export const searchFormSchema: FormSchema[] = [
label: '公众号', label: '公众号',
field: 'accountId', field: 'accountId',
component: 'ApiSelect', component: 'ApiSelect',
defaultValue: 0,
componentProps: { componentProps: {
api: () => getSimpleAccounts(), api: () => getSimpleAccounts(),
labelField: 'name', labelField: 'name',

View File

@ -182,7 +182,6 @@ export const formSchema: FormSchema[] = [
label: '开启状态', label: '开启状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }
@ -230,7 +229,6 @@ export const aliPayFormSchema: FormSchema[] = [
label: '渠道状态', label: '渠道状态',
field: 'status', field: 'status',
required: true, required: true,
defaultValue: 0,
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
@ -335,7 +333,6 @@ export const weChatFormSchema: FormSchema[] = [
label: '渠道状态', label: '渠道状态',
field: 'status', field: 'status',
required: true, required: true,
defaultValue: 0,
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)

View File

@ -95,7 +95,6 @@ export const formSchema: FormSchema[] = [
label: '商品', label: '商品',
field: 'spuId', field: 'spuId',
component: 'Select', component: 'Select',
defaultValue: 0,
required: true, required: true,
componentProps: { componentProps: {
options: [ options: [

View File

@ -138,7 +138,6 @@ export const formSchema: FormSchema[] = [
label: '开启状态', label: '开启状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -86,7 +86,6 @@ export const formSchema: FormSchema[] = [
label: '上级部门', label: '上级部门',
field: 'parentId', field: 'parentId',
required: true, required: true,
defaultValue: 0,
component: 'ApiTreeSelect', component: 'ApiTreeSelect',
componentProps: { componentProps: {
api: () => listSimpleDept(), api: () => listSimpleDept(),
@ -145,7 +144,6 @@ export const formSchema: FormSchema[] = [
label: '部门状态', label: '部门状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -110,7 +110,6 @@ export const dataFormSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -76,7 +76,6 @@ export const typeFormSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -80,7 +80,6 @@ export const formSchema: FormSchema[] = [
label: '上级菜单', label: '上级菜单',
field: 'parentId', field: 'parentId',
required: true, required: true,
defaultValue: 0,
component: 'ApiTreeSelect', component: 'ApiTreeSelect',
componentProps: { componentProps: {
api: () => listSimpleMenus(), api: () => listSimpleMenus(),
@ -157,7 +156,6 @@ export const formSchema: FormSchema[] = [
field: 'status', field: 'status',
required: true, required: true,
component: 'RadioButtonGroup', component: 'RadioButtonGroup',
defaultValue: 0,
helpMessage: '选择停用时,路由将不会出现在侧边栏,也不能被访问', helpMessage: '选择停用时,路由将不会出现在侧边栏,也不能被访问',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)

View File

@ -73,7 +73,6 @@ export const formSchema: FormSchema[] = [
label: '公告类型', label: '公告类型',
field: 'type', field: 'type',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE) options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE)
} }
@ -82,7 +81,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -91,7 +91,6 @@ export const formSchema: FormSchema[] = [
label: '类型', label: '类型',
field: 'type', field: 'type',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE) options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
} }
@ -100,7 +99,6 @@ export const formSchema: FormSchema[] = [
label: '开启状态', label: '开启状态',
field: 'status', field: 'status',
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -118,7 +118,6 @@ export const formSchema: FormSchema[] = [
label: '类型', label: '类型',
field: 'type', field: 'type',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE) options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
} }
@ -127,7 +126,6 @@ export const formSchema: FormSchema[] = [
label: '开启状态', label: '开启状态',
field: 'status', field: 'status',
component: 'RadioGroup', component: 'RadioGroup',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -129,7 +129,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -99,7 +99,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -109,7 +109,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -90,7 +90,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -126,7 +126,6 @@ export const formSchema: FormSchema[] = [
label: '短信类型', label: '短信类型',
field: 'type', field: 'type',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE) options: getDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)
} }
@ -153,7 +152,6 @@ export const formSchema: FormSchema[] = [
label: '开启状态', label: '开启状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -183,7 +183,6 @@ export const formSchema: FormSchema[] = [
label: '租户状态', label: '租户状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -82,7 +82,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }

View File

@ -192,7 +192,6 @@ export const formSchema: FormSchema[] = [
label: '状态', label: '状态',
field: 'status', field: 'status',
component: 'Select', component: 'Select',
defaultValue: 0,
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS) options: getDictOptions(DICT_TYPE.COMMON_STATUS)
} }