bill 1 год назад
Родитель
Сommit
a857c52ec9

+ 47 - 0
src/assets/public.scss

@@ -143,6 +143,10 @@ samp {
     --colors-primary-fill     : 0, 0, 0;
     --editor-men-color        : rgb(0, 0, 0);
 
+    .ui-menu-item.active {
+      background-color: #EFF0F2;
+    }
+
     .edit-fix-point {
       background-color: #fff;
 
@@ -382,6 +386,49 @@ samp {
     --editor-head-back   : #252828;
     --colors-primary-fill: 255, 255, 255;
 
+    .type-photos-layout {
+      background: #252828;
+    }
+
+    .type-title {
+      color: #ddd;
+    }
+
+    .setting-layout .ui-input .text input {
+      background: var(--colors-normal-back);
+    }
+
+    .table .ui-input .text.ready input {
+      color       : #fff;
+      border-color: #fff;
+    }
+
+    .fill-slide .foot .menus .menu {
+      color: rgb(22, 24, 26) !important;
+    }
+
+    .select-boxs span {
+      border: 1px solid #666;
+      color : #ccc;
+
+      &.active {
+        border: 1px solid #1779ed;
+        color : #1779ed;
+      }
+    }
+
+    .text-input .ui-input .text.suffix .len {
+      color: #000;
+    }
+
+    .empty-images div p {
+      color: #fff;
+    }
+
+    .ui-menu-item.active {
+      background: var(--editor-menu-bac);
+    }
+
     .fun-ctrl,
     .fun-ctrl:hover,
     .menu {

+ 10 - 5
src/graphic/Load.js

@@ -441,11 +441,16 @@ export default class Load {
             }
           }
         }
-        if (data3d.fixGraph) {
-          data3d.fixGraph.map((graph) => {
-            // graph points
-            for (let i = 0; i < graph.length; i++) {
-              const point = graph[i];
+        if (data3d.fixGraphs) {
+          data3d.fixGraphs.map((graph) => {
+            for (let i = 0; i < graph.length - 1; i++) {
+              lineService.create(
+                this.getXY(width, height, graph[i]),
+                this.getXY(width, height, graph[i + 1]),
+                VectorCategory.Line.NormalLine
+              );
+              // const point = graph[i];
+              // NormalLine;
             }
           });
         }

+ 1 - 1
src/hook/useGraphic.ts

@@ -58,7 +58,7 @@ export const graphicState = ref({
 
 export const loadData = genUseLoading(
   async (data: RoadPhoto, oldId: RoadPhoto["id"], onCleanup: any) => {
-    console.log(data, oldId);
+    console.error(data, oldId);
     if (data) {
       oldId && drawRef.value.load.clear();
       await drawRef.value.load.load(JSON.parse(JSON.stringify(data.data)), {

+ 4 - 4
src/main.ts

@@ -1,5 +1,5 @@
 import VConsole from "vconsole";
-import { useParams } from "@/hook/useParams";
+import params, { useParams } from "@/hook/useParams";
 
 if (import.meta.env.VITE_APP_SDK === "true") {
   import("./openSDK");
@@ -32,8 +32,8 @@ app.use(Components);
 
 app.mount("#app");
 
-// if (params.theme) {
-document.documentElement.classList.add("light");
-// }
+document.documentElement.classList.add(
+  params.theme === "dark" ? "dark" : "light"
+);
 
 export default app;

+ 6 - 6
src/openSDK.ts

@@ -34,12 +34,12 @@ const sdkLoaded = computed(
   () => loaded.value && mustAPI.every((api) => api in sdkAPI)
 );
 
-const stopWatch = watchEffect(() => {
-  if (sdkLoaded.value) {
-    mustAPI.forEach((api) => (global[api] = sdkAPI[api]));
-    nextTick(() => stopWatch());
-  }
-});
+global.photo = () => {
+  sdkAPI.photo((data) => {
+    console.log("告诉anzhuo", JSON.stringify(data, null, 2));
+    global.android.photoCallback(JSON.stringify(data, null, 2));
+  });
+};
 
 global.getSDK = (callback: (sdk: SDKAPI) => {}) => {
   const stopWatch = watchEffect(() => {

+ 1 - 0
src/store/accidentPhotos.ts

@@ -12,6 +12,7 @@ export type AccidentPhoto = {
   type?: string;
   sceneData: {
     meterPerPixel: number;
+    fixGraphs: PhotoRaw["fixGraphs"];
     measures: PhotoRaw["measures"];
     fixPoints: PhotoRaw["fixPoints"];
     basePoints: PhotoRaw["basePoints"];

+ 1 - 0
src/store/photos.ts

@@ -19,6 +19,7 @@ export type PhotoRaw = {
   basePoints: Array<Pos>;
   // 基准线
   baseLines: Array<Pos[]>;
+  fixGraphs: Array<Pos[]>;
 };
 
 export const photos = ref<PhotoRaw[]>([]);

+ 1 - 0
src/store/roadPhotos.ts

@@ -27,6 +27,7 @@ export type RoadPhoto = {
     fixPoints: PhotoRaw["fixPoints"];
     basePoints: PhotoRaw["basePoints"];
     baseLines: PhotoRaw["baseLines"];
+    fixGraphs: PhotoRaw["fixGraphs"];
   };
   updateTime?: number;
 };

+ 1 - 1
src/views/graphic/data.ts

@@ -35,7 +35,7 @@ export const useData = () => {
             measures: photo.measures,
             basePoints: photo.basePoints,
             baseLines: photo.baseLines,
-
+            fixGraphs: photo.fixGraphs,
             fixPoints: photo.fixPoints,
           },
           photoUrl: photo.url,

+ 1 - 0
src/views/photos/index.vue

@@ -148,6 +148,7 @@ watchEffect(() => {
             time: new Date().getTime(),
             meterPerPixel: null,
             measures: [],
+            fixGraphs: [],
             baseLines: [],
             fixPoints: [],
             basePoints: [],

+ 4 - 0
src/views/scene/fixManage.ts

@@ -40,6 +40,9 @@ export const baseCheck = () => {
     });
     return false;
   }
+  if (!customMap.activeBasePoint && basePoints.value.length === 1) {
+    customMap.activeBasePoint = basePoints.value[0];
+  }
 
   let hideTip;
   let stopWatch;
@@ -54,6 +57,7 @@ export const baseCheck = () => {
       stopWatch = watchEffect(() => {
         if (!customMap.activeBasePoint) {
           hideTip = Message.success({ msg: "请选择一个基准点" });
+          return;
         } else {
           resolve(customMap.activeBasePoint);
           hideTip && hideTip();

+ 1 - 0
src/views/scene/menus/actions.ts

@@ -305,6 +305,7 @@ const menuActions = {
       list.value = [];
       baseLines.value = [];
       basePoints.value = [];
+      fixPoints.value.forEach((fix) => delFix3d(fix));
       fixPoints.value = [];
     }
     onComplete();

+ 2 - 2
src/views/scene/photo.vue

@@ -140,7 +140,7 @@ const photo = async () => {
           );
         })
         .flat();
-      const fixGraph = fixPoints.value
+      const fixGraphs = fixPoints.value
         .filter((fix) => "type" in fix && fix.type === FixType.GRAPH)
         .map((fix) => getCurrentScreens((fix as GFixPoint).points))
         .filter((points) => points.length > 1);
@@ -162,7 +162,7 @@ const photo = async () => {
           })
           .concat(fixMeasures)
           .filter((poss) => poss?.pos.length === 2),
-        fixGraph,
+        fixGraphs,
         baseLines: baseLines.value
           .map((data) => getCurrentScreens(data.points))
           .filter((poss) => poss.length === 2),