|
|
|
@ -6,8 +6,6 @@ import { LayerTableRecord } from "../DatabaseServices/LayerTableRecord";
|
|
|
|
|
import { LayerTable } from "../DatabaseServices/Tables/LayerTable";
|
|
|
|
|
import { ViewportEntity } from "../DatabaseServices/ViewportEntity";
|
|
|
|
|
import { UpdateLayerByViewPoint } from "../UI/Components/ToolBar/Layer/LayerCMD";
|
|
|
|
|
import { LayerTopStore } from "../UI/Components/ToolBar/Layer/LayerPanel";
|
|
|
|
|
import { LayerStore } from "../UI/Components/ToolBar/Layer/State/Store";
|
|
|
|
|
import { DataToViewForLayer } from "../UI/Components/ToolBar/Layer/State/Transform";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -48,17 +46,10 @@ export class LayerReactor
|
|
|
|
|
end(app.Database.hm, app.Database.hm.UndoEvent, ParseUndo);
|
|
|
|
|
|
|
|
|
|
// 新建图纸时初始化图层UI
|
|
|
|
|
const InitLayer = () =>
|
|
|
|
|
{
|
|
|
|
|
const layerStore = LayerStore.GetInstance();
|
|
|
|
|
const layerTopStore = LayerTopStore.GetInstance();
|
|
|
|
|
DataToViewForLayer.UpdateAll();
|
|
|
|
|
layerTopStore.setCurrentLayerValue(layerStore.currentLayer.name);
|
|
|
|
|
};
|
|
|
|
|
end(app, app.CreateDocument, () => InitLayer());
|
|
|
|
|
end(app, app.CreateDocument, () => DataToViewForLayer.UpdateAll());
|
|
|
|
|
|
|
|
|
|
// 打开图纸时加载图层UI
|
|
|
|
|
end(app, app.OpenFile, () => InitLayer());
|
|
|
|
|
end(app, app.OpenFile, () => DataToViewForLayer.UpdateAll());
|
|
|
|
|
|
|
|
|
|
// 插入图纸/插入模板时更新图层UI
|
|
|
|
|
app.CommandReactor.OnCommandEnd((cmdName, changeObjects, createObjects) =>
|
|
|
|
|