|
|
|
@ -228,9 +228,13 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
|
|
|
|
// 默认为 input
|
|
|
|
// 默认为 input
|
|
|
|
let component = schemaItem?.form?.component || 'Input'
|
|
|
|
let component = schemaItem?.form?.component || 'Input'
|
|
|
|
let defaultValue: any = ''
|
|
|
|
let defaultValue: any = ''
|
|
|
|
|
|
|
|
if (schemaItem.form?.value) {
|
|
|
|
|
|
|
|
defaultValue = schemaItem.form?.value
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (component === 'InputNumber') {
|
|
|
|
if (component === 'InputNumber') {
|
|
|
|
defaultValue = 0
|
|
|
|
defaultValue = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
let comonentProps = {}
|
|
|
|
let comonentProps = {}
|
|
|
|
if (schemaItem.dictType) {
|
|
|
|
if (schemaItem.dictType) {
|
|
|
|
const options: ComponentOptions[] = []
|
|
|
|
const options: ComponentOptions[] = []
|
|
|
|
@ -253,12 +257,12 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
|
|
|
|
if (!(schemaItem.form && schemaItem.form.component)) component = 'Select'
|
|
|
|
if (!(schemaItem.form && schemaItem.form.component)) component = 'Select'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const formSchemaItem = {
|
|
|
|
const formSchemaItem = {
|
|
|
|
...schemaItem.form,
|
|
|
|
|
|
|
|
field: schemaItem.field,
|
|
|
|
|
|
|
|
label: schemaItem.form?.label || schemaItem.title,
|
|
|
|
|
|
|
|
component: component,
|
|
|
|
component: component,
|
|
|
|
componentProps: comonentProps,
|
|
|
|
componentProps: comonentProps,
|
|
|
|
value: defaultValue
|
|
|
|
value: defaultValue,
|
|
|
|
|
|
|
|
...schemaItem.form,
|
|
|
|
|
|
|
|
field: schemaItem.field,
|
|
|
|
|
|
|
|
label: schemaItem.form?.label || schemaItem.title
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
formSchema.push(formSchemaItem)
|
|
|
|
formSchema.push(formSchemaItem)
|
|
|
|
|