bill 5 månader sedan
förälder
incheckning
b95aaea222

+ 16 - 6
src/components/drawing/hook.ts

@@ -275,13 +275,19 @@ export const dragListener = (
   if (!move && !up && !down) return () => {};
 
   let moveHandler: any, endHandler: any;
+  let button: number = -1
   const downHandler = (ev: PointerEvent) => {
+    button = ev.button
     const start = getOffset(ev, dom);
     let prev = start;
     down && down(start, ev);
     props.notPrevent || ev.preventDefault();
 
     moveHandler = (ev: PointerEvent) => {
+      if (ev.buttons <= 0) {
+        endHandler()
+        return;
+      }
       const end = getOffset(ev, dom);
       move!({ start, end, prev, ev });
       prev = end;
@@ -397,7 +403,7 @@ export const useViewer = installGlobalVar(() => {
 
   const init = (dom: HTMLDivElement) => {
     const dragDestroy = dragListener(dom, {
-      move: ({ end, prev }) => {
+      move: ({ end, prev, ev }) => {
         if (cursor.value !== "move") {
           viewer.movePixel({ x: end.x - prev.x, y: 0 });
         }
@@ -532,6 +538,8 @@ export const useDrag = (
 
     shape.draggable(true);
     shape.dragBoundFunc(function (this: any, _: any, ev: MouseEvent) {
+      console.log(ev.buttons)
+      if (ev.buttons <= 0) return upHandler()
       const current = invMat.value.point(getOffset(ev, stage.value!.getNode().container()));
       drag.value = {
         x: current.x - start.x,
@@ -541,13 +549,15 @@ export const useDrag = (
       start = current
       return this.absolutePosition();
     });
+    const upHandler = () => {
+      pop && pop();
+      pop = null;
+      drag.value = undefined;
+      console.error('up')
+    }
 
     return mergeFuns(
-      listener(document.documentElement, "pointerup", () => {
-        pop && pop();
-        pop = null;
-        drag.value = undefined;
-      }),
+      listener(document.documentElement, "pointerup", upHandler),
       () => {
         shape.off("pointerenter.drag pointerleave.drag pointerdown.drag");
         if (pop) {

+ 7 - 7
src/components/global-search/index.vue

@@ -109,13 +109,13 @@ const options = computed(() => [
     getLabel: (tag: View) => tag.title,
     comp: ViewComp,
   },
-  {
-    key: "monitor-",
-    name: "监控",
-    options: monitors.value,
-    getLabel: (tag: Monitor) => tag.title,
-    comp: MonitorComp,
-  },
+  // {
+  //   key: "monitor-",
+  //   name: "监控",
+  //   options: monitors.value,
+  //   getLabel: (tag: Monitor) => tag.title,
+  //   comp: MonitorComp,
+  // },
   {
     key: "map-",
     name: "地址",

+ 5 - 1
src/views/animation/right/index.vue

@@ -1,5 +1,9 @@
 <template>
-  <RightFillPano class="animation-right" v-if="activeAttrib?.key !== 'frames'">
+  <RightFillPano
+    @pointerup.stop
+    class="animation-right"
+    v-if="activeAttrib?.key !== 'frames'"
+  >
     <AM
       v-if="!activeAttrib || !~activeAttrib.ndx"
       :am="am"

+ 3 - 2
src/views/tagging/index.vue

@@ -42,11 +42,11 @@ import { currentIsFullView } from "@/utils/full";
 const current = ref("tagging");
 const tabs = reactive([
   { key: "tagging", text: "标签()" },
-  { key: "monitor", text: "监控()" },
+  // { key: "monitor", text: "监控()" },
 ]);
 watchEffect(() => {
   tabs[0].text = `标签(${taggings.value.length})`;
-  tabs[1].text = `监控(${monitors.value.length})`;
+  // tabs[1].text = `监控(${monitors.value.length})`;
 });
 const quiskObj = ref<any>();
 const quiskAdd = async (key: string) => {
@@ -72,6 +72,7 @@ const quiskAdd = async (key: string) => {
     position: relative;
     transition: color 0.3s ease;
     cursor: pointer;
+    max-width: 50%;
     font-size: 16px;
 
     &::after {