bill 1 rok temu
rodzic
commit
2ff2891aef

+ 3 - 0
src/app/liantong/index.ts

@@ -118,6 +118,7 @@ export const createBoard = (
     showPois() {
       if (!board.tree.entrys.pois) return;
       const pois = board.tree.entrys.pois as Entity[];
+      console.log(pois);
       pois.forEach((poi) => poi.visible(true));
     },
     hidenPois() {
@@ -126,10 +127,12 @@ export const createBoard = (
       pois.forEach((poi) => poi.visible(false));
     },
     showPoisId() {
+      if (!board.tree.entrys.pois) return;
       const pois = board.tree.entrys.pois as Poi[];
       pois.forEach((poi) => poi.setShowLabel(true));
     },
     hidePoisId() {
+      if (!board.tree.entrys.pois) return;
       const pois = board.tree.entrys.pois as Poi[];
       pois.forEach((poi) => poi.setShowLabel(false));
     },

+ 10 - 0
src/board/packages/poi/edit-poi.ts

@@ -1,9 +1,19 @@
 import { CopyProps, copyEntityAttrib } from "../../shared";
 import { Poi, PoiAttrib } from "./poi";
 
+let activePoi = null;
 export class EditPoi<T extends PoiAttrib = PoiAttrib> extends Poi<T> {
   mounted(): void {
     super.enableMouseAct(this.actShape);
+    super.enableActive((active) => {
+      if (active) {
+        activePoi = this;
+        this.container.bus.emit("active", this);
+      } else if (activePoi === this) {
+        activePoi = null;
+        this.container.bus.emit("active", null);
+      }
+    });
     super.enableDrag({
       readyHandler: () => {
         this.container.bus.emit("dataChangeBefore");

+ 0 - 2
src/board/shared/act.ts

@@ -78,12 +78,10 @@ export const pathsToActShape = (props: PathsToActShapeProps, test = false) => {
       })
   );
   const common = () => {
-    console.log("common", group.parent);
     paths.forEach((path, ndx) => {
       const attrib = pathAttribs[ndx];
       attrib.fill && path.fill(attrib.fill);
       attrib.stroke && path.stroke(attrib.stroke);
-      console.log(attrib.fill, attrib.stroke);
       attrib.strokeWidth && path.strokeWidth(attrib.strokeWidth);
     });
   };