wip fix recursive
This commit is contained in:
parent
812bb40b31
commit
92de71ecdd
|
|
@ -84,7 +84,10 @@ export const serverWalkMap = (
|
||||||
parent_ids: string[];
|
parent_ids: string[];
|
||||||
parent_item: EdMeta["parent_item"];
|
parent_item: EdMeta["parent_item"];
|
||||||
is_prop?: boolean;
|
is_prop?: boolean;
|
||||||
parent_mcomp?: EdMeta["parent_mcomp"] & { id: string };
|
parent_mcomp?: EdMeta["parent_mcomp"] & {
|
||||||
|
id: string;
|
||||||
|
parent_ids: string[];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
const { mitem, parent_item, parent_mcomp } = arg;
|
const { mitem, parent_item, parent_mcomp } = arg;
|
||||||
|
|
@ -184,11 +187,12 @@ export const serverWalkMap = (
|
||||||
scope,
|
scope,
|
||||||
mcontent(mcontent) {
|
mcontent(mcontent) {
|
||||||
serverWalkMap(p, {
|
serverWalkMap(p, {
|
||||||
parent_ids: ["root", item.id],
|
parent_ids: [...arg.parent_ids, item.id],
|
||||||
mitem: mcontent,
|
mitem: mcontent,
|
||||||
parent_item: { id: item.id, mitem: mitem as MItem },
|
parent_item: { id: item.id, mitem: mitem as MItem },
|
||||||
is_prop: true,
|
is_prop: true,
|
||||||
parent_mcomp: {
|
parent_mcomp: {
|
||||||
|
parent_ids: ["root", item.id],
|
||||||
id: item_comp.id,
|
id: item_comp.id,
|
||||||
mitem: mitem as MItem,
|
mitem: mitem as MItem,
|
||||||
mcomp,
|
mcomp,
|
||||||
|
|
@ -225,12 +229,13 @@ export const serverWalkMap = (
|
||||||
for (const e of childs) {
|
for (const e of childs) {
|
||||||
serverWalkMap(p, {
|
serverWalkMap(p, {
|
||||||
mitem: e,
|
mitem: e,
|
||||||
parent_ids: ["root", item.id],
|
parent_ids: [...arg.parent_ids, item.id],
|
||||||
parent_item: {
|
parent_item: {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
mitem: mitem as MItem,
|
mitem: mitem as MItem,
|
||||||
},
|
},
|
||||||
parent_mcomp: {
|
parent_mcomp: {
|
||||||
|
parent_ids: ["root", item.id],
|
||||||
id: item_comp.id,
|
id: item_comp.id,
|
||||||
mitem: mitem as MItem,
|
mitem: mitem as MItem,
|
||||||
mcomp,
|
mcomp,
|
||||||
|
|
@ -247,7 +252,7 @@ export const serverWalkMap = (
|
||||||
let id = item.originalId || item.id;
|
let id = item.originalId || item.id;
|
||||||
const pcomp = p.scope_comps[arg.parent_mcomp.id];
|
const pcomp = p.scope_comps[arg.parent_mcomp.id];
|
||||||
pcomp.scope[id] = {
|
pcomp.scope[id] = {
|
||||||
p: arg.parent_ids,
|
p: arg.parent_mcomp.parent_ids,
|
||||||
n: item.name,
|
n: item.name,
|
||||||
s: null,
|
s: null,
|
||||||
};
|
};
|
||||||
|
|
@ -273,7 +278,12 @@ export const serverWalkMap = (
|
||||||
mitem: e,
|
mitem: e,
|
||||||
is_prop: arg.is_prop,
|
is_prop: arg.is_prop,
|
||||||
parent_item: { id: item.id, mitem: mitem as MItem },
|
parent_item: { id: item.id, mitem: mitem as MItem },
|
||||||
parent_mcomp: arg.parent_mcomp,
|
parent_mcomp: arg.parent_mcomp
|
||||||
|
? {
|
||||||
|
...arg.parent_mcomp,
|
||||||
|
parent_ids: [...(arg.parent_mcomp?.parent_ids || []), item.id],
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
parent_ids: [...arg.parent_ids, item.id],
|
parent_ids: [...arg.parent_ids, item.id],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ export const EdTreeName = ({
|
||||||
|
|
||||||
const isRenaming = p.ui.tree.rename_id === item.id;
|
const isRenaming = p.ui.tree.rename_id === item.id;
|
||||||
return (
|
return (
|
||||||
<div className="text-[14px] relative flex items-center cursor-pointer flex-1">
|
<div className="text-[14px] relative flex flex-col justify-center cursor-pointer flex-1">
|
||||||
|
<div className="text-[10px]">{item.id}</div>
|
||||||
|
|
||||||
{isRenaming ? (
|
{isRenaming ? (
|
||||||
<input
|
<input
|
||||||
className={cx(
|
className={cx(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue