From 22748c5aa841632e4a4cd8b3030bdfa14e46befa Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Tue, 22 Nov 2022 13:51:22 +0800 Subject: [PATCH] fix: crud --- yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts | 6 +++--- yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts index 402973247..35acbfcce 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts @@ -120,7 +120,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => { const filterTableSchema = (crudSchema: CrudSchema[]): TableColumn[] => { const tableColumns = treeMap(crudSchema, { conversion: (schema: CrudSchema) => { - if (schema?.isTable !== false || schema?.table?.show !== false) { + if (schema?.isTable !== false && schema?.table?.show !== false) { return { ...schema.table, ...schema @@ -144,7 +144,7 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] => { eachTree(crudSchema, (schemaItem: CrudSchema) => { // 判断是否显示 - if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { + if (schemaItem?.isForm !== false && schemaItem?.form?.show !== false) { let component = schemaItem?.form?.component || 'Input' let defaultValue: any = '' if (schemaItem.form?.value) { @@ -201,7 +201,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[ eachTree(crudSchema, (schemaItem: CrudSchema) => { // 判断是否显示 - if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) { + if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) { const descriptionsSchemaItem = { ...schemaItem.detail, field: schemaItem.field, diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts index c2164ead9..8b5a01158 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts @@ -233,7 +233,7 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => { // 判断是否显示 - if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { + if (schemaItem?.isForm !== false && schemaItem?.form?.show !== false) { // 默认为 input let component = schemaItem?.form?.component || 'Input' let defaultValue: any = '' @@ -287,7 +287,7 @@ const filterDescriptionsSchema = (crudSchema: VxeCrudSchema): DescriptionsSchema eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => { // 判断是否显示 - if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) { + if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) { const descriptionsSchemaItem = { ...schemaItem.detail, field: schemaItem.field,