!3085 修复: 打开图纸时图层特性与图层面板的当前图层指向不一致

pull/2976/MERGE
张子涵 3 weeks ago committed by ChenX
parent 6a87b46403
commit d3f3f7d6cb

@ -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) =>

@ -87,6 +87,8 @@ export class DataToViewForLayer
if (layerTable.Current === layer.Id)
{
node.isCurrent = true;
layerStore.currentLayer = node;
layerTopStore.setCurrentLayerValue(node.name);
layerTopStore.featureMatchOptions[0].colorIndex = node.colorIndex;
}
nodes.push(node);

Loading…
Cancel
Save