bill 2 gadi atpakaļ
vecāks
revīzija
24af176910

+ 3 - 0
src/graphic/CanvasStyle/focus.js

@@ -132,6 +132,9 @@ export default {
   TestPoint,
   PositionLine: MeasureLine,
   FreeMeasureLine: MeasureLine,
+  PositionLine: MeasureLine,
+  LocationLineByFixPoint: MeasureLine,
+  LocationLineByBasePoint: MeasureLine,
   Circle,
   CurveLine,
   RoadEdge,

+ 3 - 2
src/graphic/CanvasStyle/select.js

@@ -91,7 +91,6 @@ const CrossPoint = {
   fillStyle: "rgba(255, 143, 40, 1)",
 };
 
-
 const TestPoint = {
   strokeStyle: "rgba(0,0,0,0)",
   fillStyle: "#fff",
@@ -111,7 +110,6 @@ const SVG = {
   lineWidth: 2 * coordinate.ratio,
 };
 
-
 export default {
   Road,
   Text,
@@ -125,6 +123,9 @@ export default {
   MeasureLine,
   BaseLine,
   FreeMeasureLine: MeasureLine,
+  PositionLine: MeasureLine,
+  LocationLineByFixPoint: MeasureLine,
+  LocationLineByBasePoint: MeasureLine,
   CurveLine,
   Circle,
   RoadEdge,

+ 2 - 2
src/store/sync.ts

@@ -189,7 +189,7 @@ export const api = !global.android
           const apiName = `photograph${count++}`;
           global[apiName] = (data) => {
             console.log("拍照后路径:", data);
-            normalImage(data).then(resolve);
+            data ? normalImage(data).then(resolve) : resolve(null);
             delete global[apiName];
           };
           global.android.cameraPhotograph(params.m, apiName);
@@ -200,7 +200,7 @@ export const api = !global.android
           const apiName = `selectPhotoAlbum${count++}`;
           global[apiName] = (data) => {
             console.log("获得相册图片路径:", data);
-            normalImage(data).then(resolve);
+            data ? normalImage(data).then(resolve) : resolve(null);
             delete global[apiName];
           };
           global.android.selectPhotoAlbum(params.m, apiName);

+ 46 - 47
src/views/graphic/geos/magnifier.vue

@@ -7,73 +7,72 @@
 import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
 import UiInput from "@/components/base/components/input/index.vue";
 import UiIcon from "@/components/base/components/icon/index.vue";
-import {uploadImage} from '@/store/sync'
-import {drawRef, FocusVector, uiType, UIType} from '@/hook/useGraphic'
-import {computed, reactive, ref, UnwrapRef, watch} from "vue";
-import {dataService} from "@/graphic/Service/DataService";
-import {api} from "@/store/sync";
+import { uploadImage } from "@/store/sync";
+import { drawRef, FocusVector, uiType, UIType } from "@/hook/useGraphic";
+import { computed, reactive, ref, UnwrapRef, watch } from "vue";
+import { dataService } from "@/graphic/Service/DataService";
+import { api } from "@/store/sync";
 import GeoActions from "@/graphic/enum/GeoActions";
 
-const props = defineProps<{geo: FocusVector}>()
-const vector = computed(() => dataService.getMagnifier(props.geo.vectorId))
-const typeMenus = ref<UnwrapRef<typeof menus>>()
-console.log(vector.value)
+const props = defineProps<{ geo: FocusVector }>();
+const vector = computed(() => dataService.getMagnifier(props.geo.vectorId));
+const typeMenus = ref<UnwrapRef<typeof menus>>();
+console.log(vector.value);
 const menus = reactive([
   {
-    key: 'file',
+    key: "file",
     text: "拍照",
-    icon: 'photo',
+    icon: "photo",
     onClick() {
       typeMenus.value = !typeMenus.value
         ? [
-          {
-            key: 'color',
-            icon: 'photo',
-            text: "拍照",
-            onClick: async () => {
-              syncVector(await api.photograph())
-            }
-          },
-          {
-            key: 'color',
-            icon: 'map',
-            text: "相册",
-            onClick: async () => {
-              syncVector(await api.selectPhotoAlbum())
-            }
-          },
-        ]
-        : null
-    }
+            {
+              key: "color",
+              icon: "photo",
+              text: "拍照",
+              onClick: async () => {
+                const data = await api.photograph();
+                data && syncVector(data);
+              },
+            },
+            {
+              key: "color",
+              icon: "map",
+              text: "相册",
+              onClick: async () => {
+                const data = await api.selectPhotoAlbum();
+                data && syncVector(data);
+              },
+            },
+          ]
+        : null;
+    },
   },
   {
-    key: 'reset',
+    key: "reset",
     icon: "recover",
     text: "恢复默认",
     disabled: !vector.value.photoUrl,
-    onClick: () => syncVector(null)
+    onClick: () => syncVector(null),
   },
   {
-    key: 'del',
+    key: "del",
     icon: "del",
     text: "删除",
     onClick: () => {
-      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
-    }
-  }
-])
+      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction);
+    },
+  },
+]);
 const syncVector = (url: string) => {
-  vector.value.setSrc(url)
-  vector.value.setImageData()
-    .then(() => {
-      drawRef.value.renderer.autoRedraw()
-      drawRef.value.history.save()
-    })
-
-
-  menus[1].disabled = !vector.value.photoUrl
-}
+  vector.value.setSrc(url);
+  vector.value.setImageData().then(() => {
+    drawRef.value.renderer.autoRedraw();
+    drawRef.value.history.save();
+  });
 
+  menus[1].disabled = !vector.value.photoUrl;
+};
 </script>
 
 <style scoped lang="scss">

+ 1 - 1
src/views/roads/tabulation.vue

@@ -85,7 +85,7 @@
                   :style="{ transform: compassCSSMatrix }"
                   ref="compassRef"
                 />
-                <p class="compass-info">比例1 : {{ proportion }}</p>
+                <!-- <p class="compass-info">比例1 : {{ proportion }}</p> -->
               </div>
             </td>
           </tr>