Browse Source

Merge branch 'dev' of http://192.168.0.115:3000/bill/traffic-laser into dev

xzw 1 năm trước cách đây
mục cha
commit
6bd95def6c

+ 14 - 6
src/views/scene/covers/cover.vue

@@ -105,22 +105,30 @@ const downHandler = (sev: MouseEvent | TouchEvent) => {
 
 const clickHandler = (ev) => {
   if (
-    dom.value &&
-    !dom.value.contains(ev.target as HTMLElement) &&
-    ev.target !== dom.value
+    !(
+      dom.value &&
+      !dom.value.contains(ev.target as HTMLElement) &&
+      ev.target !== dom.value
+    )
   ) {
-    emit("blur");
+    return;
   }
+
+  let startTime = Date.now();
+  document.documentElement.addEventListener("touchend", function up() {
+    if (Date.now() - startTime <= 300) {
+      emit("blur");
+    }
+    document.documentElement.removeEventListener("touchend", up);
+  });
 };
 
 watchEffect((onCleanup) => {
   if (props.focus) {
-    console.log("载入点击");
     document.documentElement.addEventListener("touchstart", clickHandler, {
       passive: true,
     });
     onCleanup(() => {
-      console.log("清除载入点击");
       document.documentElement.removeEventListener("touchstart", clickHandler);
     });
   }

+ 0 - 2
src/views/scene/covers/fixPoints.vue

@@ -75,10 +75,8 @@ const selectMeasure = ref(false);
 const select = (point: FixPoint, onMeasure: boolean = false, onRaw: boolean = false) => {
   selectMeasure.value = onMeasure;
   customMap.activeFixPoint = point;
-
   if (!onRaw) {
     fixPoints.value.forEach((item) => {
-      console.log("select", toRaw(item) === toRaw(point));
       selectFix3d(item, toRaw(item) === toRaw(point));
     });
   }

+ 2 - 4
src/views/scene/fixManage.ts

@@ -124,7 +124,6 @@ const fixJoinBase = (data: FixPoint, fix3d: FixPoint3D) => {
       return basePoint ? { ...basePoint.pos } : null;
     },
     (basePos) => {
-      console.error(basePos);
       if (!basePos) {
         stopBasePosWatch();
       } else {
@@ -172,7 +171,6 @@ export const getFix3d = (data: FixPoint) => {
 
   if (data.measure) {
     fix3d.bus.on("measureChange", (p) => {
-      console.log(p);
       Object.assign(data, {
         lines: p.map((item) => ({ points: item?.line, dis: item?.dis })),
       });
@@ -181,7 +179,6 @@ export const getFix3d = (data: FixPoint) => {
 
   if (args.graph) {
     fix3d.bus.on("graphChange", (p) => {
-      console.log(data);
       Object.assign(data, { points: p?.path, pos: p?.center });
     });
   }
@@ -206,7 +203,6 @@ export const quitMeasure = (data: FixPoint) => {
 export const selectFix3d = (data: FixPoint, selected: boolean) => {
   const fix3d = fix3ds[data.id];
   if (fix3d) {
-    console.error(selected, "select", data.id);
     fix3d.selected(selected);
   }
 };
@@ -221,7 +217,9 @@ export const changePos = (data: FixPoint, pos: FixPoint["pos"]) => {
 
 export const delFix3d = (data) => {
   const fix3d = fix3ds[data.id];
+  console.error(data.id);
   if (fix3d) {
+    console.error("fix3d.destroy");
     fix3d.destroy();
     let index = drawingFix3d.value.indexOf(fix3d);
     if (~index) {

+ 10 - 8
src/views/scene/linkage/cover.ts

@@ -1,13 +1,15 @@
-import {useSDK} from "@/hook";
-import {CoordType, Pos, Pos3D} from "@/sdk";
-
+import { useSDK } from "@/hook";
+import { CoordType, Pos, Pos3D } from "@/sdk";
 
 export const getCoverPos = (onComplete: (pos: Pos3D) => void) => {
   const sdk = useSDK();
-  const result = sdk.scene.trackScenePos()
-  result.promise.then(onComplete)
+  const result = sdk.scene.trackScenePos();
+  result.promise.then((data) => {
+    console.log("点点点");
+    onComplete(data);
+  });
   return () => {
-    result.quit()
+    result.quit();
     // onComplete(null)
-  }
-}
+  };
+};