Commit 22748c5aa841632e4a4cd8b3030bdfa14e46befa

Authored by xingyu4j
1 parent fdfdd823

fix: crud

yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts
@@ -120,7 +120,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => { @@ -120,7 +120,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
120 const filterTableSchema = (crudSchema: CrudSchema[]): TableColumn[] => { 120 const filterTableSchema = (crudSchema: CrudSchema[]): TableColumn[] => {
121 const tableColumns = treeMap<CrudSchema>(crudSchema, { 121 const tableColumns = treeMap<CrudSchema>(crudSchema, {
122 conversion: (schema: CrudSchema) => { 122 conversion: (schema: CrudSchema) => {
123 - if (schema?.isTable !== false || schema?.table?.show !== false) { 123 + if (schema?.isTable !== false && schema?.table?.show !== false) {
124 return { 124 return {
125 ...schema.table, 125 ...schema.table,
126 ...schema 126 ...schema
@@ -144,7 +144,7 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] =&gt; { @@ -144,7 +144,7 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] =&gt; {
144 144
145 eachTree(crudSchema, (schemaItem: CrudSchema) => { 145 eachTree(crudSchema, (schemaItem: CrudSchema) => {
146 // 判断是否显示 146 // 判断是否显示
147 - if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { 147 + if (schemaItem?.isForm !== false && schemaItem?.form?.show !== false) {
148 let component = schemaItem?.form?.component || 'Input' 148 let component = schemaItem?.form?.component || 'Input'
149 let defaultValue: any = '' 149 let defaultValue: any = ''
150 if (schemaItem.form?.value) { 150 if (schemaItem.form?.value) {
@@ -201,7 +201,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[ @@ -201,7 +201,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
201 201
202 eachTree(crudSchema, (schemaItem: CrudSchema) => { 202 eachTree(crudSchema, (schemaItem: CrudSchema) => {
203 // 判断是否显示 203 // 判断是否显示
204 - if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) { 204 + if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) {
205 const descriptionsSchemaItem = { 205 const descriptionsSchemaItem = {
206 ...schemaItem.detail, 206 ...schemaItem.detail,
207 field: schemaItem.field, 207 field: schemaItem.field,
yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts
@@ -233,7 +233,7 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] =&gt; { @@ -233,7 +233,7 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] =&gt; {
233 233
234 eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => { 234 eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => {
235 // 判断是否显示 235 // 判断是否显示
236 - if (schemaItem?.isForm !== false || schemaItem?.form?.show == true) { 236 + if (schemaItem?.isForm !== false && schemaItem?.form?.show !== false) {
237 // 默认为 input 237 // 默认为 input
238 let component = schemaItem?.form?.component || 'Input' 238 let component = schemaItem?.form?.component || 'Input'
239 let defaultValue: any = '' 239 let defaultValue: any = ''
@@ -287,7 +287,7 @@ const filterDescriptionsSchema = (crudSchema: VxeCrudSchema): DescriptionsSchema @@ -287,7 +287,7 @@ const filterDescriptionsSchema = (crudSchema: VxeCrudSchema): DescriptionsSchema
287 287
288 eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => { 288 eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => {
289 // 判断是否显示 289 // 判断是否显示
290 - if (schemaItem?.isDetail !== false || schemaItem.detail?.show !== false) { 290 + if (schemaItem?.isDetail !== false && schemaItem.detail?.show !== false) {
291 const descriptionsSchemaItem = { 291 const descriptionsSchemaItem = {
292 ...schemaItem.detail, 292 ...schemaItem.detail,
293 field: schemaItem.field, 293 field: schemaItem.field,