feat: 新丰江 回滚表单编辑按钮逻辑

This commit is contained in:
GAOANG
2024-04-28 10:26:39 +08:00
parent b5f640c288
commit 666f211700
3 changed files with 26 additions and 91 deletions

View File

@ -497,37 +497,3 @@ export function changeSchemaDisabled(schemas) {
});
return schemas;
}
// 辅助设置表单可以编辑
export function changeSchemaEnable(schemas) {
const layoutComponents = ['tab', 'grid', 'card'];
schemas?.map((info) => {
if (layoutComponents.includes(info.type!)) {
info.children?.map((childInfo) => {
childInfo.list.map((com) => {
if (layoutComponents.includes(com.type)) {
changeSchemaDisabled(childInfo.list);
} else {
com.dynamicDisabled = false;
}
});
});
} else if (info.type == 'table-layout') {
info.children?.map((childInfo) => {
childInfo.list.map((com) => {
com.children.map((el) => {
if (layoutComponents.includes(el.type) || el.type == 'table-layout') {
changeSchemaDisabled(com.children);
} else {
el.dynamicDisabled = false;
}
});
});
});
} else if (info.type == 'one-for-one') {
changeSchemaDisabled(info.componentProps.childSchemas);
} else {
info.dynamicDisabled = false;
}
});
return schemas;
}