bill 2 rokov pred
rodič
commit
b521ada704

+ 1 - 1
src/components/edit-fix-point/index.vue

@@ -19,8 +19,8 @@
         :key="option"
         :class="{ active: option === text }"
         @click="$emit('update:text', option)"
-        v-show="option.includes(text)"
       >
+        <!-- v-show="option.includes(text)" -->
         {{ option }}
       </p>
     </div>

+ 28 - 25
src/views/graphic/data.ts

@@ -1,37 +1,36 @@
-import {computed, ref, watch} from "vue";
-import {Mode} from "@/views/graphic/menus";
-import {accidentPhotos, types, AccidentPhoto} from "@/store/accidentPhotos";
-import {roadPhotos, RoadPhoto} from "@/store/roadPhotos";
-import {router} from '@/router'
-import {getId} from "@/utils";
-import {photos} from "@/store/photos";
-import {trackMode} from "@/views/scene/trackMeasureWidth";
+import { computed, ref, watch } from "vue";
+import { Mode } from "@/views/graphic/menus";
+import { accidentPhotos, types, AccidentPhoto } from "@/store/accidentPhotos";
+import { roadPhotos, RoadPhoto } from "@/store/roadPhotos";
+import { router } from "@/router";
+import { getId } from "@/utils";
+import { photos } from "@/store/photos";
+import { trackMode } from "@/views/scene/trackMeasureWidth";
 
 export const useData = () => {
   const data = ref<AccidentPhoto | RoadPhoto>(null);
   watch(
     () => ({
-        params: router.currentRoute.value.params,
-        accidentPhotos: accidentPhotos.value,
-        roadPhotos: roadPhotos.value
+      params: router.currentRoute.value.params,
+      accidentPhotos: accidentPhotos.value,
+      roadPhotos: roadPhotos.value,
     }),
-    ({params}) => {
-
+    ({ params }) => {
       if (trackMode.value) {
         return;
       }
-      console.error("reload data")
+      console.error("reload data");
       if (!params.action) {
-        data.value = null
-      } else if (params.action === 'add') {
-        const photo = photos.value.find(data => data.id === params.id)
+        data.value = null;
+      } else if (params.action === "add") {
+        const photo = photos.value.find((data) => data.id === params.id);
         if (!photo) {
           return;
         }
         data.value = {
           data: null,
           title: "",
-          type: types[0],
+          type: types[2],
           sceneData: {
             meterPerPixel: photo.meterPerPixel,
             measures: photo.measures,
@@ -42,19 +41,23 @@ export const useData = () => {
           photoUrl: photo.url,
           id: getId(),
           url: null,
-          time: new Date().getTime()
-        }
+          time: new Date().getTime(),
+        };
       } else {
-        const mode = Number(params.mode) as Mode
+        const mode = Number(params.mode) as Mode;
         if (mode === Mode.Photo) {
-          return data.value = accidentPhotos.value.find(data => data.id === params.id)
+          return (data.value = accidentPhotos.value.find(
+            (data) => data.id === params.id
+          ));
         } else {
-          return data.value = roadPhotos.value.find(data => data.id === params.id)
+          return (data.value = roadPhotos.value.find(
+            (data) => data.id === params.id
+          ));
         }
       }
     },
     { immediate: true }
-  )
+  );
 
   return data;
-}
+};

+ 0 - 1
vite.config.ts

@@ -12,7 +12,6 @@ export default async ({ mode }) => {
   if (isDev) {
     await createMockServer(Number(env.VITE_DEV_PORT));
     server = {
-      port: 8080,
       watch: {
         ignored: [
           "**/node_modules/**",