bill 1 gadu atpakaļ
vecāks
revīzija
643ac32e77

+ 9 - 7
src/views/accidents/index.vue

@@ -76,7 +76,7 @@ import MainPanel from "@/components/main-panel/index.vue";
 import FillSlide from "@/components/fill-slide/index.vue";
 import ActionMenus from "@/components/group-button/index.vue";
 import { types, accidentPhotos, AccidentPhoto } from "@/store/accidentPhotos";
-import { router, writeRouteName } from "@/router";
+import { readyRouteName, router, writeRouteName } from "@/router";
 import { computed, onDeactivated, reactive, ref, watchEffect } from "vue";
 import { Mode } from "@/views/graphic/menus";
 import UiButton from "@/components/base/components/button/index.vue";
@@ -100,12 +100,14 @@ const typePhotos = computed(() =>
     .filter((data) => data.photos.length)
 );
 const onBack = () => {
-  let back = router.currentRoute.value.query.back;
-  if (back) {
-    router.back();
-  } else {
-    api.closePage();
-  }
+  router.replace(readyRouteName.scene);
+  // router.back();
+  // let back = router.currentRoute.value.query.back;
+  // if (back) {
+  //   router.back();
+  // } else {
+  //   api.closePage();
+  // }
 };
 const selectMode = ref(false);
 const selects = ref<AccidentPhoto[]>([]);

+ 14 - 1
src/views/graphic/header.vue

@@ -26,7 +26,7 @@
     <div class="table">
       <ui-input
         v-if="options"
-        v-model="(data as AccidentPhoto).type"
+        v-model="currentType"
         :options="options"
         height="32px"
         type="select"
@@ -86,6 +86,13 @@ const isRoad = computed(() => mode.value === Mode.Road);
 const options = computed(() =>
   !isRoad.value ? types.map((t) => ({ label: t, value: t })) : null
 );
+const currentType = ref<string>();
+watchEffect(() => {
+  if (!isRoad.value && data.value) {
+    currentType.value = (data.value as AccidentPhoto).type;
+  }
+});
+
 const currentMeterPerPixel = ref();
 let interval;
 onActivated(() => {
@@ -175,6 +182,9 @@ const saveStore = genUseLoading(async () => {
     data: JSON.parse(JSON.stringify(drawRef.value.load.save())),
     updateTime: new Date().getTime(),
   };
+  if (currentType.value) {
+    (newData as AccidentPhoto).type = currentType.value;
+  }
   const blob = await drawRef.value.uiControl.screenShot();
   newData.url = await uploadImage(blob);
   const origin = isRoad.value ? roadPhotos.value : accidentPhotos.value;
@@ -187,6 +197,9 @@ const saveStore = genUseLoading(async () => {
   data.value = newData;
   if (!isRoad.value) {
     await downloadImage(blob);
+    setTimeout(() => {
+      Message.success(`已保存至相册`);
+    });
   }
 });
 

+ 2 - 2
src/views/scene/covers/range.vue

@@ -53,8 +53,8 @@ const props = defineProps<{ rangeKey: string }>();
 const topSetting = useSDK().scene.getSceneCropSetting().top;
 
 const sceneRangeSetting = {
-  top: { min: topSetting.minTop, max: topSetting.maxTop, step: 0.5, unit: "米" },
-  scale: { min: 0, max: 100, step: 0.1, unit: "%" },
+  top: { min: topSetting.minTop, max: topSetting.maxTop, step: 1, unit: "米" },
+  scale: { min: 0, max: 100, step: 1, unit: "%" },
   rotate: { min: -180, max: 180, step: 1, unit: "°" },
 };
 const rangeSetting = computed(() => sceneRangeSetting[props.rangeKey]);