소스 검색

兼容高密度设备

bill 2 년 전
부모
커밋
956a3e2f4a

+ 1 - 1
public/static/lib/potree/potree.js

@@ -77274,7 +77274,7 @@ void main()
 	            let startLoad = ()=>{
 	                pco.url = url;
 	                let xhr = XHRFactory.createXMLHttpRequest();
-	                xhr.open('GET', url+'?m='+timeStamp, true);  
+	                xhr.open('GET', url, true);
 
 	                xhr.onreadystatechange = function () {
 	                    if (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)) {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 249 - 3193
src/components/base/components/icon/iconfont/demo_index.html


+ 26 - 538
src/components/base/components/icon/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
-  font-family: "iconfont"; /* Project id 2930899 */
-  src: url('iconfont.woff2?t=1675754565602') format('woff2'),
-       url('iconfont.woff?t=1675754565602') format('woff'),
-       url('iconfont.ttf?t=1675754565602') format('truetype');
+  font-family: "iconfont"; /* Project id 4084834 */
+  src: url('iconfont.woff2?t=1684996225484') format('woff2'),
+       url('iconfont.woff?t=1684996225484') format('woff'),
+       url('iconfont.ttf?t=1684996225484') format('truetype');
 }
 
 .iconfont {
@@ -13,563 +13,51 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
-.icon-jump_kk:before {
-  content: "\e703";
+.icon-text:before {
+  content: "\e71d";
 }
 
-.icon-close_r:before {
-  content: "\e704";
+.icon-legend:before {
+  content: "\e71e";
 }
 
-.icon-cloud_c:before {
-  content: "\e6fc";
+.icon-road:before {
+  content: "\e71f";
 }
 
-.icon-clear1:before {
-  content: "\e640";
+.icon-magnify_g:before {
+  content: "\e720";
 }
 
-.icon-a-exclude:before {
-  content: "\e6f7";
+.icon-line_d:before {
+  content: "\e721";
 }
 
-.icon-a-intersect:before {
-  content: "\e6f8";
-}
-
-.icon-a-scale-d:before {
-  content: "\e6f9";
-}
-
-.icon-update:before {
-  content: "\e6f6";
-}
-
-.icon-icon_f_z_n:before {
-  content: "\e6f3";
-}
-
-.icon-icon_h_z_n:before {
-  content: "\e6f4";
-}
-
-.icon-icon_v_z_n:before {
-  content: "\e6f5";
-}
-
-.icon-state_gps_d:before {
-  content: "\e6f2";
-}
-
-.icon-panorama-f:before {
-  content: "\e6f1";
-}
-
-.icon-international:before {
-  content: "\e6b3";
-}
-
-.icon-left1:before {
-  content: "\e6ae";
-}
-
-.icon-right:before {
-  content: "\e6af";
-}
-
-.icon-video1:before {
-  content: "\e63b";
-}
-
-.icon-more:before {
-  content: "\e600";
-}
-
-.icon-preview:before {
-  content: "\e63a";
-}
-
-.icon-nav-record:before {
-  content: "\e6dc";
-}
-
-.icon-order:before {
-  content: "\e6dd";
-}
-
-.icon-point-s:before {
-  content: "\e6d9";
-}
-
-.icon-a-connect-dis:before {
-  content: "\e6d1";
-}
-
-.icon-data_revise_n:before {
-  content: "\e6d2";
-}
-
-.icon-zoom_n:before {
-  content: "\e6d4";
-}
-
-.icon-a-connect:before {
-  content: "\e6d0";
-}
-
-.icon-dianwei:before {
-  content: "\e6cc";
-}
-
-.icon-weitiao:before {
-  content: "\e6cd";
-}
-
-.icon-state_gps:before {
-  content: "\e6ce";
-}
-
-.icon-m-r:before {
-  content: "\e6cf";
-}
-
-.icon-lessen:before {
-  content: "\e6aa";
-}
-
-.icon-change1:before {
-  content: "\e6a8";
-}
-
-.icon-nav:before {
-  content: "\e6a6";
-}
-
-.icon-city:before {
-  content: "\e6ea";
-}
-
-.icon-pipeline:before {
-  content: "\e6eb";
-}
-
-.icon-users:before {
-  content: "\e6ec";
-}
-
-.icon-quanbu:before {
-  content: "\e6e8";
-}
-
-.icon-factory:before {
-  content: "\e6e9";
-}
-
-.icon-list:before {
-  content: "\e69c";
-}
-
-.icon-map-m:before {
-  content: "\e692";
-}
-
-.icon-extend:before {
-  content: "\e690";
-}
-
-.icon-shrink:before {
-  content: "\e691";
-}
-
-.icon-download:before {
-  content: "\e61c";
-}
-
-.icon-logo:before {
-  content: "\e68f";
-}
-
-.icon-d-r:before {
-  content: "\e68d";
-}
-
-.icon-up-a:before {
-  content: "\e68e";
-}
-
-.icon-menu:before {
-  content: "\e689";
-}
-
-.icon-user:before {
-  content: "\e68c";
-}
-
-.icon-password:before {
-  content: "\e68b";
-}
-
-.icon-hole:before {
-  content: "\e68a";
-}
-
-.icon-affirm:before {
-  content: "\e688";
-}
-
-.icon-cancel:before {
-  content: "\e687";
-}
-
-.icon-location:before {
-  content: "\e686";
-}
-
-.icon-pin1:before {
-  content: "\e685";
-}
-
-.icon-lock_s:before {
-  content: "\e683";
-}
-
-.icon-lock_n:before {
-  content: "\e684";
-}
-
-.icon-add_d:before {
-  content: "\e682";
-}
-
-.icon-uploading1:before {
-  content: "\e681";
-}
-
-.icon-move:before {
-  content: "\e680";
-}
-
-.icon-flip:before {
-  content: "\e67e";
-}
-
-.icon-rotate_r:before {
-  content: "\e67f";
-}
-
-.icon-rotate_l:before {
-  content: "\e67d";
-}
-
-.icon-pin:before {
-  content: "\e67c";
-}
-
-.icon-layout:before {
-  content: "\e67b";
-}
-
-.icon-change:before {
-  content: "\e67a";
-}
-
-.icon-iorigin:before {
-  content: "\e678";
-}
-
-.icon-destination:before {
-  content: "\e679";
-}
-
-.icon-state_e:before {
-  content: "\e624";
-}
-
-.icon-state_f:before {
-  content: "\e625";
-}
-
-.icon-state_s:before {
-  content: "\e626";
+.icon-measure:before {
+  content: "\e716";
 }
 
 .icon-clear:before {
-  content: "\e676";
+  content: "\e717";
 }
 
-.icon-cut:before {
-  content: "\e677";
-}
-
-.icon-copy:before {
-  content: "\e675";
-}
-
-.icon-v-m:before {
-  content: "\e674";
-}
-
-.icon-f-m:before {
-  content: "\e671";
-}
-
-.icon-v-r:before {
-  content: "\e672";
-}
-
-.icon-f-l:before {
-  content: "\e673";
-}
-
-.icon-h-l:before {
-  content: "\e66d";
-}
-
-.icon-h-m:before {
-  content: "\e66e";
-}
-
-.icon-v-l:before {
-  content: "\e66f";
-}
-
-.icon-h-r:before {
-  content: "\e670";
-}
-
-.icon-share:before {
-  content: "\e66c";
-}
-
-.icon-magnify:before {
-  content: "\e66b";
-}
-
-.icon-a-2d:before {
-  content: "\e669";
-}
-
-.icon-a-3d:before {
-  content: "\e66a";
-}
-
-.icon-left:before {
-  content: "\e668";
-}
-
-.icon-video:before {
-  content: "\e667";
-}
-
-.icon-pic:before {
-  content: "\e64e";
-}
-
-.icon-full:before {
-  content: "\e638";
-}
-
-.icon-del:before {
-  content: "\e632";
-}
-
-.icon-link:before {
-  content: "\e618";
-}
-
-.icon-uploading:before {
-  content: "\e619";
-}
-
-.icon-complete:before {
-  content: "\e61b";
-}
-
-.icon-web:before {
-  content: "\e635";
-}
-
-.icon-music:before {
-  content: "\e637";
-}
-
-.icon-element:before {
-  content: "\e666";
-}
-
-.icon-add:before {
-  content: "\e631";
-}
-
-.icon-edit:before {
-  content: "\e61f";
-}
-
-.icon-info:before {
-  content: "\e65e";
-}
-
-.icon-transmit:before {
-  content: "\e65f";
-}
-
-.icon-room:before {
-  content: "\e660";
-}
-
-.icon-point:before {
-  content: "\e661";
-}
-
-.icon-bulid:before {
-  content: "\e662";
-}
-
-.icon-floor:before {
-  content: "\e663";
-}
-
-.icon-pull-up1:before {
-  content: "\e664";
-}
-
-.icon-pull-down1:before {
-  content: "\e665";
-}
-
-.icon-checkbox1:before {
-  content: "\e65d";
-}
-
-.icon-minimize:before {
-  content: "\e65c";
-}
-
-.icon-reset:before {
-  content: "\e65a";
-}
-
-.icon-refresh:before {
-  content: "\e65b";
-}
-
-.icon-checkbox:before {
-  content: "\e659";
-}
-
-.icon-pull-down:before {
-  content: "\e61d";
-}
-
-.icon-pull-up:before {
-  content: "\e61e";
-}
-
-.icon-show_pic_s:before {
-  content: "\e658";
-}
-
-.icon-show_pic_n:before {
-  content: "\e650";
-}
-
-.icon-show_dot_s:before {
-  content: "\e64f";
-}
-
-.icon-show_dot_n:before {
-  content: "\e657";
-}
-
-.icon-share1:before {
-  content: "\e656";
-}
-
-.icon-portrait:before {
-  content: "\e655";
-}
-
-.icon-course:before {
-  content: "\e652";
-}
-
-.icon-self-more:before {
-  content: "\e64b";
-}
-
-.icon-search:before {
-  content: "\e64c";
-}
-
-.icon-pull-more:before {
-  content: "\e64d";
-}
-
-.icon-switch:before {
-  content: "\e651";
-}
-
-.icon-nav-hotspot:before {
-  content: "\e64a";
-}
-
-.icon-nav-measure:before {
-  content: "\e649";
-}
-
-.icon-nav-edit:before {
-  content: "\e642";
-}
-
-.icon-nav-setup:before {
-  content: "\e648";
+.icon-point_f:before {
+  content: "\e718";
 }
 
 .icon-close:before {
-  content: "\e633";
-}
-
-.icon-nav-browse:before {
-  content: "\e63d";
-}
-
-.icon-nav-correct:before {
-  content: "\e63e";
-}
-
-.icon-nav_data-setup:before {
-  content: "\e63f";
-}
-
-.icon-nav-coord:before {
-  content: "\e641";
-}
-
-.icon-nav-geography:before {
-  content: "\e643";
-}
-
-.icon-nav-space:before {
-  content: "\e644";
-}
-
-.icon-nav-download:before {
-  content: "\e645";
-}
-
-.icon-nav-data:before {
-  content: "\e646";
+  content: "\e719";
 }
 
-.icon-nav-house:before {
-  content: "\e647";
+.icon-photo:before {
+  content: "\e71a";
 }
 
-.icon-eye-s:before {
-  content: "\e653";
+.icon-save:before {
+  content: "\e71b";
 }
 
-.icon-eye-n:before {
-  content: "\e654";
+.icon-return:before {
+  content: "\e71c";
 }
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
src/components/base/components/icon/iconfont/iconfont.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 59 - 955
src/components/base/components/icon/iconfont/iconfont.json


BIN
src/components/base/components/icon/iconfont/iconfont.ttf


BIN
src/components/base/components/icon/iconfont/iconfont.woff


BIN
src/components/base/components/icon/iconfont/iconfont.woff2


+ 1 - 0
src/components/fill-slide/index.vue

@@ -46,6 +46,7 @@ const clickHandler = () => {
 <style scoped lang="scss">
 .fill-slide {
   position: absolute;
+  overflow: hidden;
   top: 0;
   left: 0;
   right: 0;

+ 38 - 10
src/store/sync.ts

@@ -34,18 +34,28 @@ export const api = import.meta.env.DEV && !global.android
         window.open(URL.createObjectURL(file))
       },
       async getFile(url) {
+        if (url.includes(baseURL)) {
+          url = url.substring(baseURL.length)
+        }
         const data = await axios.get(url,{responseType:'blob'})
-        return blobToBase64(data.data)
+        const base64 = await blobToBase64(data.data)
+        return base64
       },
       async closePage() {
         return router.push({ name: writeRouteName.scene })
       }
     }
   : {
+    // async setStore(data) {
+    //   return axios.post("sceneStore", data)
+    // },
+    // async getStore() {
+    //   return (await axios.get("/attach/sceneStore")).data
+    // },
     setStore(data) {
       return new Promise(resolve => {
-        console.log("调用setSceneStore")
-        global.android.setSceneStore(params.m + "/store.json", data)
+        console.log("调用setSceneStore参数", JSON.stringify(data))
+        global.android.setSceneStore(params.m + "/store.json", JSON.stringify(data))
         global.setSceneStoreCallback = data => {
           console.log("setSceneStoreCallback返回", data)
           resolve(data)
@@ -57,28 +67,34 @@ export const api = import.meta.env.DEV && !global.android
         console.log("调用getSceneStore")
         global.getSceneStoreCallback = data => {
           console.log("getSceneStoreCallback返回", data)
-          resolve(data)
+          resolve(data ? JSON.parse(data) : data)
         }
         global.android.getSceneStore(params.m + "/store.json")
       })
     },
     getFile(fileUrl) {
-      return new Promise<string>(resolve => {
-        global.getImageCallback = resolve
-        global.android.getImage(fileUrl)
-      })
+      if (import.meta.env.DEV) {
+        return new Promise<string>(resolve => {
+          global.getImageCallback = resolve
+          global.android.getImage(fileUrl)
+        })
+      } else {
+        return Promise.resolve(fileUrl)
+      }
     },
     uploadImage(file: File) {
       return new Promise<string>(resolve => {
         global.uploadImageCallback = resolve
-        global.android.uploadImage(params.m + "/" + file.name, file)
+        console.log("上传图片", params.m + "/" + file.name, "参数", blobToBase64(file))
+        global.android.uploadImage(params.m + "/" + file.name, blobToBase64(file))
       })
     },
     downloadImage(file: File) {
       return new Promise(resolve => {
         global.downloadImageCallback = resolve
         // file为base64
-        global.android.downloadImage(file.name, file)
+        console.log("下载图片", file.name, blobToBase64(file))
+        global.android.downloadImage(file.name, blobToBase64(file))
       })
     },
     closePage() {
@@ -125,6 +141,18 @@ export const downloadImage = async (data: Blob | string, name: string = getId())
 }
 
 const syncSceneStore = () => {
+  if (import.meta.env.DEV) {
+    console.log("自动保存测试")
+    updateSceneStore({
+      measures: list.value,
+      baseLines: baseLines.value,
+      basePoints: basePoints.value,
+      fixPoints: fixPoints.value,
+      photos: photos.value,
+      accidentPhotos: accidentPhotos.value,
+      roadPhotos: roadPhotos.value
+    })
+  }
   return watch(
     () => ({
       measures: list.value,

+ 38 - 13
src/utils/vue.ts

@@ -369,21 +369,46 @@ export const genCountDown = (
     }
   }
 }
+function isTabletf() {
+  // 获取设备的屏幕宽度和高度
+  var screenWidth = window.screen.width;
+  var screenHeight = window.screen.height;
+
+  // 计算屏幕的对角线长度
+  var diagonalSize = Math.sqrt(Math.pow(screenWidth, 2) + Math.pow(screenHeight, 2));
+
+  // 判断屏幕的对角线长度是否大于等于7英寸(一般认为大于等于7英寸的设备是平板)
+  if (diagonalSize >= 7) {
+    return true;
+  } else {
+    return false;
+  }
+}
+function isPCf() {
+  const ua = navigator.userAgent.toLowerCase();
+  const agents = ["android", "iphone", "symbianos", "windows phone", "ipad", "ipod"];
+  for (let i = 0; i < agents.length; i++) {
+    if (ua.indexOf(agents[i]) !== -1) {
+      return false;
+    }
+  }
+  return true;
+}
 
 export const os = (function () {
-  let ua = navigator.userAgent
-  let isWindowsPhone = /(?:Windows Phone)/.test(ua)
-  let isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone
-  let isAndroid = /(?:Android)/.test(ua)
-  let isFireFox = /(?:Firefox)/.test(ua)
-  let isChrome = /(?:Chrome|CriOS)/.test(ua)
-  let isTablet =
-    /(?:iPad|PlayBook)/.test(ua) ||
-    (isAndroid && !/(?:Mobile)/.test(ua)) ||
-    (isFireFox && /(?:Tablet)/.test(ua))
-  let isPhone = /(?:iPhone)/.test(ua) && !isTablet
-  let isPc = !isPhone && !isAndroid && !isSymbian
-  let isWX = /(?:MicroMessenger)/.test(ua)
+  let ua = navigator.userAgent.toLowerCase();
+  let isWindowsPhone = /(?:windows phone)/.test(ua)
+  let isSymbian = /(?:symbianOS)/.test(ua) || isWindowsPhone
+  let isAndroid = /(?:android)/.test(ua)
+  let isFireFox = /(?:firefox)/.test(ua)
+  let isChrome = /(?:chrome|crios)/.test(ua)
+
+  let isTablet = isTabletf()
+
+  let isPhone = /(?:iphone)/.test(ua) && !isTablet
+  // let isPc = !isPhone && !isAndroid && !isSymbian && !isTablet
+  let isPc = isPCf()
+  let isWX = /(?:microMessenger)/.test(ua)
 
   // if (isPc && navigator.maxTouchPoints > 1) {
   //     isTablet = true

+ 3 - 0
src/views/graphic/data.ts

@@ -15,6 +15,9 @@ export const useData = () => {
         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: "",