|
|
@ -151,25 +151,28 @@ export class LayerManager extends React.Component<{}, {}>
|
|
|
|
SelectLayerEntitys(selected);
|
|
|
|
SelectLayerEntitys(selected);
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<MenuItem
|
|
|
|
{
|
|
|
|
icon="inheritance"
|
|
|
|
!selected.children &&
|
|
|
|
text="将选中实体置为该图层"
|
|
|
|
<MenuItem
|
|
|
|
onClick={() =>
|
|
|
|
icon="inheritance"
|
|
|
|
{
|
|
|
|
text="将选中实体置为该图层"
|
|
|
|
this.ClickInnerEvent(e);
|
|
|
|
onClick={() =>
|
|
|
|
const ens = app.Editor.SelectCtrl.SelectSet.SelectEntityList;
|
|
|
|
|
|
|
|
if (ens.length > 0)
|
|
|
|
|
|
|
|
LayerCMD.PutEntitysInLayer(ens, selected);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AppToaster.show({
|
|
|
|
this.ClickInnerEvent(e);
|
|
|
|
message: "请先选中实体",
|
|
|
|
const ens = app.Editor.SelectCtrl.SelectSet.SelectEntityList;
|
|
|
|
timeout: 2000,
|
|
|
|
if (ens.length > 0)
|
|
|
|
intent: Intent.DANGER
|
|
|
|
LayerCMD.PutEntitysInLayer(ens, selected);
|
|
|
|
}, 'openfile');
|
|
|
|
else
|
|
|
|
}
|
|
|
|
{
|
|
|
|
}}
|
|
|
|
AppToaster.show({
|
|
|
|
/>
|
|
|
|
message: "请先选中实体",
|
|
|
|
|
|
|
|
timeout: 2000,
|
|
|
|
|
|
|
|
intent: Intent.DANGER
|
|
|
|
|
|
|
|
}, 'openfile');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
}
|
|
|
|
</Menu>,
|
|
|
|
</Menu>,
|
|
|
|
{ left: e.clientX, top: e.clientY },
|
|
|
|
{ left: e.clientX, top: e.clientY },
|
|
|
|
() => this.setState({ isContextMenuOpen: false }),
|
|
|
|
() => this.setState({ isContextMenuOpen: false }),
|
|
|
@ -219,9 +222,13 @@ export class LayerManager extends React.Component<{}, {}>
|
|
|
|
const line = dom.children[0] as HTMLDivElement;
|
|
|
|
const line = dom.children[0] as HTMLDivElement;
|
|
|
|
const key = dom.getAttribute("data-key");
|
|
|
|
const key = dom.getAttribute("data-key");
|
|
|
|
const node = TreeAction.FindNode(layerStore.data, (node: ILayerNode) => node.name === key);
|
|
|
|
const node = TreeAction.FindNode(layerStore.data, (node: ILayerNode) => node.name === key);
|
|
|
|
|
|
|
|
const isInSelf = data.name === key;
|
|
|
|
|
|
|
|
// 拖拽到文件夹里
|
|
|
|
if (e.clientY > rect.top && e.clientY < rect.bottom && node.children)
|
|
|
|
if (e.clientY > rect.top && e.clientY < rect.bottom && node.children)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!data.children || !TreeAction.FindNode(data.children, (node: ILayerNode) => node.name === key))
|
|
|
|
const isInChildren = data.children && TreeAction.FindNode(node.children, (node: ILayerNode) => node.name === key);
|
|
|
|
|
|
|
|
// 确保不拖拽到自身及其子文件里
|
|
|
|
|
|
|
|
if (!isInSelf && !isInChildren)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const div = dom.children[1] as HTMLDivElement;
|
|
|
|
const div = dom.children[1] as HTMLDivElement;
|
|
|
|
div.style.background = "rgba(150, 180, 210, 0.5)";
|
|
|
|
div.style.background = "rgba(150, 180, 210, 0.5)";
|
|
|
@ -230,11 +237,17 @@ export class LayerManager extends React.Component<{}, {}>
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 拖拽到文件上方
|
|
|
|
if (e.clientY < boundary)
|
|
|
|
if (e.clientY < boundary)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
line.style.height = "5px";
|
|
|
|
const isInChildren = data.children && TreeAction.FindNode(data.children, (node: ILayerNode) => node.name === key);
|
|
|
|
this._ToWhere = key;
|
|
|
|
// 确保不拖拽到自身及其子文件里
|
|
|
|
return;
|
|
|
|
if (!isInSelf && !isInChildren)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
line.style.height = "5px";
|
|
|
|
|
|
|
|
this._ToWhere = key;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this._ToWhere = "--LAST";
|
|
|
|
this._ToWhere = "--LAST";
|
|
|
@ -383,7 +396,7 @@ export class LayerManager extends React.Component<{}, {}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{data.expanded && data.children && this.CreateList(data.children)}
|
|
|
|
{data.expanded && data.children && data.children.length > 0 && this.CreateList(data.children)}
|
|
|
|
</>);
|
|
|
|
</>);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
);
|
|
|
|
);
|
|
|
|