Browse Source

Merge branch 'v1.9.0-position' of http://192.168.0.115:3000/bill/fuse-code into v1.9.0-position

xzw 1 tuần trước cách đây
mục cha
commit
c282a9bb0f

+ 10 - 0
src/api/path.ts

@@ -57,6 +57,16 @@ export const postAddPath = async (path: Path) => {
   return serviceToLocal(stagging);
 };
 
+export const postAddPathInPosition = async (path: Path, recordStartTime: any, recordEndTime: any) => {
+  const stagging = await axios.post<ServerPath>(INSERT_PATH, {
+    ...localToService(path),
+    caseId: params.caseId,
+    recordStartTime,
+    recordEndTime
+  });
+  return serviceToLocal(stagging);
+};
+
 export const postUpdatePath = (path: Path) => {
   return axios.post<undefined>(UPDATE_PATH, {
     ...localToService(path),

+ 10 - 0
src/hook/use-fly.ts

@@ -135,6 +135,16 @@ export const flyPlayPath = (path: Path) => {
   return stopFly
 }
 
+export const flyplayPosition = (macId: any) => {
+  stopFly && stopFly()
+  stopFly = () => {
+    stopFly = null
+    // pauseSceneGuide()
+  }
+  // playPosition()
+  return stopFly
+}
+
 export const flyLatLng = (latlng: number[]) => {
   stopFly && stopFly();
   sdk.comeToByLatLng(latlng)

+ 2 - 2
src/views/positioning/components/sign.vue

@@ -3,13 +3,13 @@
       <div class="info">
         <div class="position-cover">
           <img src="@/assets/equipment_e.svg" />
-          <ui-icon
+          <!-- <ui-icon
             type="preview"
             class="icon"
             ctrl
             @click="flyPlayGuide(position)"
             v-if="positionList.length"
-          />
+          /> -->
         </div>
         <div>
           <p>{{ position.deviceName }}</p>

+ 6 - 2
src/views/positioning/index.vue

@@ -19,9 +19,10 @@
 
 <script lang="ts" setup>
 import { RightFillPano } from "@/layout";
+import { postAddPathInPosition } from '@/api'
 import mediaList from "./components/mediaList.vue";
 import { nextTick, reactive, ref, watchEffect, onUnmounted } from "vue";
-import { enterOld, enterEdit } from "@/store";
+import { positionList, enterOld, enterEdit } from "@/store";
 import { loadPack } from '@/utils'
 
 const isRecord = ref(false);
@@ -74,7 +75,10 @@ const startRecord = (type: string) => {
             endTime: endTime.value,
             duration: endTime.value - startTime.value
         });
-        // 这里调path接口传路线数据过去
+        // 这里调path接口传路线数据过去,有几个设备就生成几个path
+        positionList.value.forEach((pos: any) => {
+          postAddPathInPosition({}, startTime.value, endTime.value)
+        });
         // enterOld(async () => {})
     }
 };