mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 20:58:01 +08:00
bugfix
This commit is contained in:
parent
25d9ae8fcc
commit
11f5050fd5
@ -15,7 +15,7 @@ configResponsive({
|
|||||||
middle: 800,
|
middle: 800,
|
||||||
large: 1200,
|
large: 1200,
|
||||||
});
|
});
|
||||||
function toGroups(fields: any[]) {
|
function toGroups(fields: any[], { displayFields = [] }) {
|
||||||
const groups = [];
|
const groups = [];
|
||||||
let group = {
|
let group = {
|
||||||
title: undefined,
|
title: undefined,
|
||||||
@ -23,6 +23,9 @@ function toGroups(fields: any[]) {
|
|||||||
children: [],
|
children: [],
|
||||||
};
|
};
|
||||||
fields.forEach(field => {
|
fields.forEach(field => {
|
||||||
|
if (Array.isArray(displayFields) && displayFields.length && displayFields.indexOf(field.id) === -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (field.interface === 'description' && group.children.length) {
|
if (field.interface === 'description' && group.children.length) {
|
||||||
groups.push(group);
|
groups.push(group);
|
||||||
group = {
|
group = {
|
||||||
@ -72,7 +75,7 @@ export function Details(props: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { displayFields = [] } = activeTab;
|
const { displayFields = [] } = activeTab;
|
||||||
const groups = toGroups(fields);
|
const groups = toGroups(fields, { displayFields });
|
||||||
console.log({groups});
|
console.log({groups});
|
||||||
return (
|
return (
|
||||||
<Card bordered={false}>
|
<Card bordered={false}>
|
||||||
|
Loading…
Reference in New Issue
Block a user