wip fix
This commit is contained in:
parent
f5c50fde9a
commit
eabbdb1f16
|
|
@ -129,6 +129,10 @@ export const EdPopComp = () => {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropping {
|
||||||
|
background: #efefff;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
@ -150,13 +154,38 @@ export const EdPopComp = () => {
|
||||||
tree={tree}
|
tree={tree}
|
||||||
initialOpen={true}
|
initialOpen={true}
|
||||||
rootId={"comp-root"}
|
rootId={"comp-root"}
|
||||||
onDrop={() => {}}
|
onDrop={async (newTree, opt) => {
|
||||||
|
compPicker.tree = newTree;
|
||||||
|
p.render();
|
||||||
|
|
||||||
|
if (
|
||||||
|
typeof opt.dragSourceId === "string" &&
|
||||||
|
typeof opt.dropTargetId === "string"
|
||||||
|
) {
|
||||||
|
db.component.update({
|
||||||
|
where: {
|
||||||
|
id: opt.dragSourceId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
id_component_group: opt.dropTargetId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
dragPreviewRender={() => <></>}
|
dragPreviewRender={() => <></>}
|
||||||
canDrag={() => true}
|
canDrag={() => true}
|
||||||
|
canDrop={(tree, opt) => {
|
||||||
|
if (opt.dropTarget?.data?.type === "component")
|
||||||
|
return false;
|
||||||
|
if (opt.dropTargetId === "comp-root")
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}}
|
||||||
classes={{
|
classes={{
|
||||||
root: "tree-root flex-1",
|
root: "tree-root flex-1",
|
||||||
listItem: "listitem",
|
listItem: "listitem",
|
||||||
container: "container",
|
container: "container",
|
||||||
|
dropTarget: "dropping",
|
||||||
}}
|
}}
|
||||||
render={edPageTreeRender}
|
render={edPageTreeRender}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue