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,9 +227,13 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
227 if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { 227 if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) {
228 // 默认为 input 228 // 默认为 input
229 let component = schemaItem?.form?.component || 'Input' 229 let component = schemaItem?.form?.component || 'Input'
230 - const options: ComponentOptions[] = [] 230 + let defaultValue: any = ''
  231 + if (component === 'InputNumber') {
  232 + defaultValue = 0
  233 + }
231 let comonentProps = {} 234 let comonentProps = {}
232 if (schemaItem.dictType) { 235 if (schemaItem.dictType) {
  236 + const options: ComponentOptions[] = []
233 if (schemaItem.dictData && schemaItem.dictData === 'number') { 237 if (schemaItem.dictData && schemaItem.dictData === 'number') {
234 getIntDictOptions(schemaItem.dictType).forEach((dict) => { 238 getIntDictOptions(schemaItem.dictType).forEach((dict) => {
235 options.push(dict) 239 options.push(dict)
@@ -253,7 +257,8 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { @@ -253,7 +257,8 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
253 field: schemaItem.field, 257 field: schemaItem.field,
254 label: schemaItem.form?.label || schemaItem.title, 258 label: schemaItem.form?.label || schemaItem.title,
255 component: component, 259 component: component,
256 - componentProps: comonentProps 260 + componentProps: comonentProps,
  261 + value: defaultValue
257 } 262 }
258 263
259 formSchema.push(formSchemaItem) 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,8 +49,7 @@ export const modelSchema = reactive<FormSchema[]>([
49 { 49 {
50 label: '显示排序', 50 label: '显示排序',
51 field: 'sort', 51 field: 'sort',
52 - component: 'InputNumber',  
53 - value: 0 52 + component: 'InputNumber'
54 }, 53 },
55 { 54 {
56 label: '状态', 55 label: '状态',
yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts
@@ -52,8 +52,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ @@ -52,8 +52,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
52 title: '访问令牌的有效期', 52 title: '访问令牌的有效期',
53 field: 'accessTokenValiditySeconds', 53 field: 'accessTokenValiditySeconds',
54 form: { 54 form: {
55 - component: 'InputNumber',  
56 - value: 0 55 + component: 'InputNumber'
57 }, 56 },
58 table: { 57 table: {
59 slots: { 58 slots: {
@@ -65,8 +64,7 @@ const crudSchemas = reactive<VxeCrudSchema>({ @@ -65,8 +64,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
65 title: '刷新令牌的有效期', 64 title: '刷新令牌的有效期',
66 field: 'refreshTokenValiditySeconds', 65 field: 'refreshTokenValiditySeconds',
67 form: { 66 form: {
68 - component: 'InputNumber',  
69 - value: 0 67 + component: 'InputNumber'
70 }, 68 },
71 table: { 69 table: {
72 slots: { 70 slots: {
yudao-ui-admin-vue3/src/views/system/tenant/tenant.data.ts
@@ -82,8 +82,7 @@ const crudSchemas = reactive<CrudSchema[]>([ @@ -82,8 +82,7 @@ const crudSchemas = reactive<CrudSchema[]>([
82 label: '账号额度', 82 label: '账号额度',
83 field: 'accountCount', 83 field: 'accountCount',
84 form: { 84 form: {
85 - component: 'InputNumber',  
86 - value: 0 85 + component: 'InputNumber'
87 } 86 }
88 }, 87 },
89 { 88 {