Commit 08656ee0708b116204610c318a7c73fb176e051b

Authored by xingyu4j
1 parent f606bfb1

fix: form inputnumber

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
... ... @@ -49,8 +49,7 @@ export const modelSchema = reactive<FormSchema[]>([
49 49 {
50 50 label: '显示排序',
51 51 field: 'sort',
52   - component: 'InputNumber',
53   - value: 0
  52 + component: 'InputNumber'
54 53 },
55 54 {
56 55 label: '状态',
... ...
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
... ... @@ -82,8 +82,7 @@ const crudSchemas = reactive<CrudSchema[]>([
82 82 label: '账号额度',
83 83 field: 'accountCount',
84 84 form: {
85   - component: 'InputNumber',
86   - value: 0
  85 + component: 'InputNumber'
87 86 }
88 87 },
89 88 {
... ...