Pārlūkot izejas kodu

添加新数据需求

bill 2 gadi atpakaļ
vecāks
revīzija
d03f11930c

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 9 - 0
src/graphic/CanvasStyle/ImageLabels/keche_plane.svg

@@ -0,0 +1,9 @@
+<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M6.5 23.5C6.5 21.2909 8.29086 19.5 10.5 19.5H58.5C60.7091 19.5 62.5 21.2909 62.5 23.5V40.5C62.5 42.7091 60.7091 44.5 58.5 44.5H10.5C8.29086 44.5 6.5 42.7091 6.5 40.5L6.5 23.5Z" stroke="black"/>
+<path d="M1.5 23.5C1.5 21.2909 3.29086 19.5 5.5 19.5L58.5007 19.5C60.7099 19.5 62.5007 21.2909 62.5007 23.5V40.5C62.5007 42.7091 60.7099 44.5 58.5007 44.5H5.5C3.29086 44.5 1.5 42.7091 1.5 40.5V23.5Z" stroke="black"/>
+<path d="M1.5 32.5H6.5" stroke="black"/>
+<path d="M12.5 22.5H20.5" stroke="black" stroke-linecap="round"/>
+<path d="M12.5 41.5H20.5" stroke="black" stroke-linecap="round"/>
+<path d="M49.5 22.5H55.5" stroke="black" stroke-linecap="round"/>
+<path d="M49.5 41.5H55.5" stroke="black" stroke-linecap="round"/>
+</svg>

+ 6 - 1
src/graphic/enum/UIEvents.js

@@ -1,5 +1,10 @@
 const UIEvents = {
-  // 画线
+  // 图例
+  // 客车平面
+  BusPlane: "BusPlane",
+
+
+  // 画直线线
   Line: "line",
   // 画曲线
   CurveLine: "Curveline",

+ 2 - 2
src/main.ts

@@ -1,9 +1,9 @@
 import VConsole from 'vconsole';
-// if (import.meta.env.DEV) {
+if (import.meta.env.DEV) {
   if (!os.isPc) {
     new VConsole();
   }
-// }
+}
 
 import "@/assets/theme.editor.scss";
 import "@/assets/public.scss";

+ 20 - 7
src/store/sync.ts

@@ -90,7 +90,11 @@ export const api =
           fileUrl = (params.realPath || params.m) + fileUrl
           console.error("处理后url:" + fileUrl)
 
-          if (import.meta.env.DEV) {
+          const paths = fileUrl.split("/")
+          const notBase64 = paths[paths.length - 1].includes(".png") ||
+            paths[paths.length - 1].includes(".jpg")
+
+          if (import.meta.env.DEV || !notBase64) {
             return await new Promise<string>((resolve) => {
               const apiName = `getImageCallback${count++}`
               global[apiName] = (base64) => {
@@ -101,12 +105,8 @@ export const api =
               global.android.getImage(fileUrl, apiName);
             });
           } else {
-            // console.log("请求文件" + fileUrl)
-            const data = await axios.get(fileUrl, { responseType: "blob" });
-            console.log("axios请求文件" + fileUrl, "结果为" + data.status)
-            const base64 = await blobToBase64(data.data);
-            return base64
-            // return Promise.resolve(fileUrl);
+            console.log("图片文件直接文件系统读取", fileUrl)
+            return fileUrl
           }
         },
         uploadImage(file: File) {
@@ -205,6 +205,19 @@ const syncSceneStore = () => {
   );
 };
 
+if (global.android) {
+  document.documentElement.addEventListener('focusin', ev => {
+    console.log("获得焦点")
+    console.log(ev.target)
+    global.android.inputMethodManager(true);
+  })
+  document.documentElement.addEventListener('focusout', ev => {
+    console.log("失去焦点")
+    console.log(ev.target)
+    global.android.inputMethodManager(false);
+  })
+}
+
 loadStore().catch((e) => {
   console.error(e);
   alert("场景数据加载失败");

+ 1 - 1
src/views/graphic/index.vue

@@ -18,8 +18,8 @@
       />
     </GraphicAction>
     <VectorMenus :menus="focusMenus" v-if="focusMenus" />
-    <Confirm v-if="graphicState.continuedMode" />
     <Component :is="geoComponent as any" v-else-if="geoComponent" :geo="currentVector"/>
+    <Confirm v-if="graphicState.continuedMode" />
   </MainPanel>
 </template>
 

+ 28 - 1
src/views/graphic/menus.ts

@@ -17,6 +17,8 @@ export const UITypeExtend = {
   template: "template",
   measure: "measure",
   road: "__road",
+  image: "__image",
+  line: "__line",
   photo: "photo",
   setup: "setup",
   lineType: "lineType",
@@ -128,6 +130,24 @@ export const mainMenusRaw: MenusRaw = [
 ];
 
 if (import.meta.env.DEV) {
+  mainMenusRaw[0] = {
+    key: UITypeExtend.line,
+    text: "画线",
+    icon: "line_d",
+    children: [
+      {
+        key: UIType.Line,
+        text: "直线",
+        icon: "line_d",
+      },
+      {
+        key: UIType.CurveLine,
+        text: "曲线",
+        icon: "line_d",
+      }
+    ]
+  }
+
   mainMenusRaw.unshift(
     { key: UIType.CurveRoad, text: "弯路", icon: "road", }
   )
@@ -145,7 +165,14 @@ if (import.meta.env.DEV) {
       { key: UITypeExtend.structure, text: "道路结构", extend: structureMenusRaw },
       { key: UITypeExtend.template, text: "道路模板", extend: templateMenusRaw },
     ]
-  },)
+  }, {
+    key: UITypeExtend.image,
+    text: "图例",
+    icon: "road",
+    children: [
+      { key: UIType.BusPlane, text: "客车平面图" }
+    ]
+  })
 }
 
 export const photoMenusRaw: MenusRaw = [