Commit 08656ee0708b116204610c318a7c73fb176e051b
1 parent
f606bfb1
fix: form inputnumber
Showing
4 changed files
with
11 additions
and
10 deletions
yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts
| ... | ... | @@ -227,9 +227,13 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { |
| 227 | 227 | if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { |
| 228 | 228 | // 默认为 input |
| 229 | 229 | let component = schemaItem?.form?.component || 'Input' |
| 230 | - const options: ComponentOptions[] = [] | |
| 230 | + let defaultValue: any = '' | |
| 231 | + if (component === 'InputNumber') { | |
| 232 | + defaultValue = 0 | |
| 233 | + } | |
| 231 | 234 | let comonentProps = {} |
| 232 | 235 | if (schemaItem.dictType) { |
| 236 | + const options: ComponentOptions[] = [] | |
| 233 | 237 | if (schemaItem.dictData && schemaItem.dictData === 'number') { |
| 234 | 238 | getIntDictOptions(schemaItem.dictType).forEach((dict) => { |
| 235 | 239 | options.push(dict) |
| ... | ... | @@ -253,7 +257,8 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { |
| 253 | 257 | field: schemaItem.field, |
| 254 | 258 | label: schemaItem.form?.label || schemaItem.title, |
| 255 | 259 | component: component, |
| 256 | - componentProps: comonentProps | |
| 260 | + componentProps: comonentProps, | |
| 261 | + value: defaultValue | |
| 257 | 262 | } |
| 258 | 263 | |
| 259 | 264 | formSchema.push(formSchemaItem) | ... | ... |
yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts
yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts
| ... | ... | @@ -52,8 +52,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 52 | 52 | title: '访问令牌的有效期', |
| 53 | 53 | field: 'accessTokenValiditySeconds', |
| 54 | 54 | form: { |
| 55 | - component: 'InputNumber', | |
| 56 | - value: 0 | |
| 55 | + component: 'InputNumber' | |
| 57 | 56 | }, |
| 58 | 57 | table: { |
| 59 | 58 | slots: { |
| ... | ... | @@ -65,8 +64,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ |
| 65 | 64 | title: '刷新令牌的有效期', |
| 66 | 65 | field: 'refreshTokenValiditySeconds', |
| 67 | 66 | form: { |
| 68 | - component: 'InputNumber', | |
| 69 | - value: 0 | |
| 67 | + component: 'InputNumber' | |
| 70 | 68 | }, |
| 71 | 69 | table: { |
| 72 | 70 | slots: { | ... | ... |
yudao-ui-admin-vue3/src/views/system/tenant/tenant.data.ts