fix: form inputnumber
This commit is contained in:
parent
f606bfb12b
commit
08656ee070
@ -227,9 +227,13 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
|
||||
if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) {
|
||||
// 默认为 input
|
||||
let component = schemaItem?.form?.component || 'Input'
|
||||
const options: ComponentOptions[] = []
|
||||
let defaultValue: any = ''
|
||||
if (component === 'InputNumber') {
|
||||
defaultValue = 0
|
||||
}
|
||||
let comonentProps = {}
|
||||
if (schemaItem.dictType) {
|
||||
const options: ComponentOptions[] = []
|
||||
if (schemaItem.dictData && schemaItem.dictData === 'number') {
|
||||
getIntDictOptions(schemaItem.dictType).forEach((dict) => {
|
||||
options.push(dict)
|
||||
@ -253,7 +257,8 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
|
||||
field: schemaItem.field,
|
||||
label: schemaItem.form?.label || schemaItem.title,
|
||||
component: component,
|
||||
componentProps: comonentProps
|
||||
componentProps: comonentProps,
|
||||
value: defaultValue
|
||||
}
|
||||
|
||||
formSchema.push(formSchemaItem)
|
||||
|
@ -49,8 +49,7 @@ export const modelSchema = reactive<FormSchema[]>([
|
||||
{
|
||||
label: '显示排序',
|
||||
field: 'sort',
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
component: 'InputNumber'
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
|
@ -52,8 +52,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
||||
title: '访问令牌的有效期',
|
||||
field: 'accessTokenValiditySeconds',
|
||||
form: {
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
component: 'InputNumber'
|
||||
},
|
||||
table: {
|
||||
slots: {
|
||||
@ -65,8 +64,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
||||
title: '刷新令牌的有效期',
|
||||
field: 'refreshTokenValiditySeconds',
|
||||
form: {
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
component: 'InputNumber'
|
||||
},
|
||||
table: {
|
||||
slots: {
|
||||
|
@ -82,8 +82,7 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
label: '账号额度',
|
||||
field: 'accountCount',
|
||||
form: {
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
component: 'InputNumber'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user