|
|
|
|
@ -393,7 +393,7 @@ const Market: React.FC<MarketProps> = ({ updateProjectComp }) => {
|
|
|
|
|
const addInitState = (componentData) => {
|
|
|
|
|
// 当前工程下已添加的组件ID列表
|
|
|
|
|
const projectComponent = projectComponentData[info.id];
|
|
|
|
|
const compListByProject = projectComponent.compIds.concat(projectComponent.flowIds);
|
|
|
|
|
const compListByProject = projectComponent ? projectComponent.compIds.concat(projectComponent.flowIds) : [];
|
|
|
|
|
const objectKeys = Object.keys(componentData);
|
|
|
|
|
/*
|
|
|
|
|
* 账号下的组件列表分两种结构:
|
|
|
|
|
@ -402,12 +402,12 @@ const Market: React.FC<MarketProps> = ({ updateProjectComp }) => {
|
|
|
|
|
* */
|
|
|
|
|
objectKeys.forEach(key => {
|
|
|
|
|
if (key === 'pubFlow' || key === 'myFlow') {
|
|
|
|
|
componentData[key].forEach(item => {
|
|
|
|
|
componentData[key] && componentData[key].forEach(item => {
|
|
|
|
|
item.isAdd = compListByProject.includes(item.id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else if (key === 'myLibs' || key === 'pubLibs' || key === 'teamLibs') {
|
|
|
|
|
componentData[key].length && componentData[key].forEach(item => {
|
|
|
|
|
componentData[key] && componentData[key].forEach(item => {
|
|
|
|
|
item.children.forEach(v => {
|
|
|
|
|
v.isAdd = compListByProject.includes(v.comp.id);
|
|
|
|
|
});
|
|
|
|
|
|