Selaa lähdekoodia

feat: 添加匹配点提示

rindy 2 vuotta sitten
vanhempi
commit
f5498709de
1 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 10 2
      src/components/header/index.vue

+ 10 - 2
src/components/header/index.vue

@@ -82,17 +82,25 @@ const getCurPosInfo = () => {
 }
 
 const onSetP1 = () => {
+    let p1 = getCurPosInfo()
+    if(points.value.p2 && points.value.p2.id == p1.id){
+        return  showTips.value = '匹配失败,请选择不同点位进行同步'
+    }
     if (points.value.p1) {
         showTips.value = '关联位置已更新'
     }
-    points.value.p1 = getCurPosInfo()
+    points.value.p1 = p1
     emits('update', 'p1', points.value.p1)
 }
 const onSetP2 = () => {
+    let p2 = getCurPosInfo()
+    if(points.value.p1 && points.value.p1.id == p2.id){
+        return  showTips.value = '匹配失败,请选择不同点位进行同步'
+    }
     if (points.value.p2) {
         showTips.value = '关联位置已更新'
     }
-    points.value.p2 = getCurPosInfo()
+    points.value.p2 = p2
     emits('update', 'p2', points.value.p2)
 }