fix: fix useCrudSchemas not work
This commit is contained in:
parent
f01c261647
commit
0a855b93e2
|
@ -31,7 +31,8 @@ const props = defineProps({
|
||||||
// 是否显示伸缩
|
// 是否显示伸缩
|
||||||
expand: propTypes.bool.def(false),
|
expand: propTypes.bool.def(false),
|
||||||
// 伸缩的界限字段
|
// 伸缩的界限字段
|
||||||
expandField: propTypes.string.def('')
|
expandField: propTypes.string.def(''),
|
||||||
|
inline: propTypes.bool.def(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['search', 'reset'])
|
const emit = defineEmits(['search', 'reset'])
|
||||||
|
@ -96,7 +97,7 @@ const setVisible = () => {
|
||||||
:is-custom="false"
|
:is-custom="false"
|
||||||
:label-width="labelWidth"
|
:label-width="labelWidth"
|
||||||
hide-required-asterisk
|
hide-required-asterisk
|
||||||
inline
|
:inline="inline"
|
||||||
:is-col="isCol"
|
:is-col="isCol"
|
||||||
:schema="newSchema"
|
:schema="newSchema"
|
||||||
@register="register"
|
@register="register"
|
||||||
|
|
|
@ -169,10 +169,10 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
||||||
|
|
||||||
eachTree(crudSchema, (schemaItem: CrudSchema) => {
|
eachTree(crudSchema, (schemaItem: CrudSchema) => {
|
||||||
// 判断是否显示
|
// 判断是否显示
|
||||||
if (schemaItem?.form?.show) {
|
if (schemaItem?.form?.show !== false) {
|
||||||
const formSchemaItem = {
|
const formSchemaItem = {
|
||||||
// 默认为 input
|
// 默认为 input
|
||||||
component: schemaItem.form.component || 'Input',
|
component: schemaItem?.form?.component || 'Input',
|
||||||
componentProps: {},
|
componentProps: {},
|
||||||
...schemaItem.form,
|
...schemaItem.form,
|
||||||
field: schemaItem.field,
|
field: schemaItem.field,
|
||||||
|
@ -211,7 +211,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
|
||||||
for (const task of formRequestTask) {
|
for (const task of formRequestTask) {
|
||||||
task()
|
task()
|
||||||
}
|
}
|
||||||
|
console.log(formSchema)
|
||||||
return formSchema
|
return formSchema
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,9 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||||
form: {
|
form: {
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
style: {
|
||||||
|
width: '100%'
|
||||||
|
},
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: '重要',
|
label: '重要',
|
||||||
|
|
Loading…
Reference in New Issue