bill 9 달 전
부모
커밋
85c15ba8dc

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

@@ -85262,6 +85262,7 @@
 	    //path = `${Potree.scriptPath}/data/${Potree.settings.number}/panos-${datasetId}.json`
 	    path = "".concat(Potree.settings.urls.prefix, "/laser/filter/").concat(Potree.settings.number, "/query");
 	  }
+		path = path + '/'+datasetId
 	  return loadFile(path, {
 	    datasetId: datasetId
 	  }, callback);

+ 3 - 0
src/api/fuse-model.ts

@@ -67,6 +67,9 @@ export const getSceneUrl = (sceneData: Scene) => {
     }
     try {
       url = JSON.parse(url);
+      url = url.map((u: any) => location.origin + (import.meta.env.DEV ? '/res' : '/') + u)
+      console.log(url)
+      
     } catch (e) {
       console.error(url, e);
     }

+ 1 - 1
src/api/instance.ts

@@ -64,7 +64,7 @@ addHook({
   } 
 })
 
-setDefaultURI(baseURL)
+setDefaultURI('/api')
 params.token && setToken(params.token)
 
 export default axios

+ 1 - 0
src/api/setup.ts

@@ -110,6 +110,7 @@ export const axiosFactory = () => {
   } = getExponseApi('hook')
 
   const setDefaultURI = (url: string) => {
+    console.error(url)
     axiosRaw.defaults.baseURL = url
   }
 

+ 1 - 1
src/env/index.ts

@@ -79,7 +79,7 @@ export type Params = {
   token?: string
 }
 
-export const baseURL = params.baseURL ? params.baseURL : '/'
+export const baseURL = import.meta.env.DEV ? '/res' : ''
 
 
 export const getResource = (uri: string) => {

+ 4 - 3
src/model/platform.ts

@@ -27,7 +27,7 @@ export async function modelSDKFactory(
   let center: number[] | undefined = undefined;
 
   if (caseProject.value) {
-    const lonlatStr = caseProject.value?.latAndLong || "22.364093,113.600356";
+    const lonlatStr = caseProject.value?.latAndLong || "22.27545304080856, 113.53817378515573";
     const lonlat = lonlatStr.split(",").map(Number);
     const gcenter = aMapToWgs84({
       x: lonlat[1],
@@ -39,8 +39,9 @@ export async function modelSDKFactory(
     if (!fuseInitialed) {
       await initialSDK({
         layout: dom,
-        panoBasePath: '',
-        cloudBasePath: '',
+        panoBasePath: import.meta.env.DEV ? '/res' : '/',
+        cloudBasePath: import.meta.env.DEV ? '/res' : '/',
+        // https://uat-laser.4dkankan.com/laser/dataset/SG-t-WReTBN204dQ/getDataSet
         scenes: scenes.value,
         lonlat: center,
       });

+ 2 - 0
src/utils/index.ts

@@ -1,3 +1,5 @@
+import { getResource } from '@/env';
+
 // 加载第三方库
 export const loadLib = (() => {
   const cache: Record<string, Promise<void>> = {};

+ 1 - 1
src/views/guide/sign.vue

@@ -45,7 +45,7 @@ const emit = defineEmits<{
 
 const menus = [
   { label: "编辑", value: "edit" },
-  { label: "下载", value: "download" },
+  // { label: "下载", value: "download" },
   { label: "删除", value: "delete" },
 ];
 const actions = {

+ 98 - 85
src/views/record/sign.vue

@@ -1,23 +1,26 @@
 <template>
-  <ui-group-option class=" record-sign" :class="{sign: record.status === RecordStatus.SUCCESS}">
+  <ui-group-option
+    class="record-sign"
+    :class="{ sign: record.status === RecordStatus.SUCCESS }"
+  >
     <div class="content">
       <span class="cover">
-        <img :src="getResource(getFileUrl(record.cover))" alt="" v-if="record.cover">
-        <ui-icon 
-          type="preview" 
-          ctrl 
-          class="preview" 
-          @click="actions.play()"  
+        <img :src="getResource(getFileUrl(record.cover))" alt="" v-if="record.cover" />
+        <ui-icon
+          type="preview"
+          ctrl
+          class="preview"
+          @click="actions.play()"
           v-if="record.status === RecordStatus.SUCCESS"
         />
       </span>
-      <ui-input 
-        type="text" 
-        :modelValue="record.title" 
+      <ui-input
+        type="text"
+        :modelValue="record.title"
         @update:modelValue="(title: string) => $emit('updateTitle', title.trim())"
-        v-show="isEditTitle" 
-        ref="inputRef" 
-        height="28px" 
+        v-show="isEditTitle"
+        ref="inputRef"
+        height="28px"
         :maxlength="15"
       />
       <div class="title" v-show="!isEditTitle">
@@ -27,112 +30,124 @@
     </div>
     <div class="action" v-if="edit && record.status === RecordStatus.SUCCESS">
       <ui-icon type="order" ctrl />
-      <ui-more 
-        :options="menus" 
-        style="margin-left: 20px" 
-        @click="(action: keyof typeof actions) => actions[action]()" 
+      <ui-more
+        :options="menus"
+        style="margin-left: 20px"
+        @click="(action: keyof typeof actions) => actions[action]()"
       />
     </div>
 
-    <Shot 
-      v-if="isShot" 
+    <Shot
+      v-if="isShot"
       @close="closeHandler"
-      @append="appendFragment" 
-      @updateCover="(cover: string) => $emit('updateCover', cover)" 
+      @append="appendFragment"
+      @updateCover="(cover: string) => $emit('updateCover', cover)"
       @deleteRecord="$emit('delete')"
-      :record="record" />
-    <Preview 
-      v-if="isPlayVideo" 
+      :record="record"
+    />
+    <Preview
+      v-if="isPlayVideo"
       :items="[{ type: MediaType.video, url: record.url! }]"
-      @close="isPlayVideo = false" 
+      @close="isPlayVideo = false"
     />
   </ui-group-option>
 </template>
 
 <script lang="ts">
-import type {PropType} from 'vue'
-import {computed, defineComponent, ref, watchEffect} from 'vue'
-import {getExtname, getFileUrl, loadPack, saveAs} from '@/utils'
-import {useFocus} from 'bill/hook/useFocus'
-import {createRecordFragment, getRecordFragmentBlobs, isTemploraryID, recordFragments, RecordStatus} from '@/store'
-import {MediaType, Preview} from '@/components/static-preview/index.vue'
-import {getResource} from '@/env'
-import Shot from './shot.vue'
-import type {RecordProcess} from './help'
-import {Message} from 'bill/index'
+import type { PropType } from "vue";
+import { computed, defineComponent, ref, watchEffect } from "vue";
+import { getExtname, getFileUrl, loadPack, saveAs } from "@/utils";
+import { useFocus } from "bill/hook/useFocus";
+import {
+  createRecordFragment,
+  getRecordFragmentBlobs,
+  isTemploraryID,
+  recordFragments,
+  RecordStatus,
+} from "@/store";
+import { MediaType, Preview } from "@/components/static-preview/index.vue";
+import { getResource } from "@/env";
+import Shot from "./shot.vue";
+import type { RecordProcess } from "./help";
+import { Message } from "bill/index";
 
 export default defineComponent({
   props: {
     record: {
       type: Object as PropType<RecordProcess>,
-      required: true
+      required: true,
     },
     edit: {
       type: Boolean,
       required: false,
-      default: true
-    }
+      default: true,
+    },
   },
   emits: {
-    'updateCover': (cover: string) => true,
-    'updateTitle': (title: string) => true,
-    'delete': () => true
+    updateCover: (cover: string) => true,
+    updateTitle: (title: string) => true,
+    delete: () => true,
   },
   setup(props, { emit }) {
     const menus = computed(() => {
-      const base = []
+      const base = [];
       if ([RecordStatus.SUCCESS, RecordStatus.UN].includes(props.record.status)) {
         base.push(
-          { label: '重命名', value: 'rename' },
-          { label: '继续录制', value: 'continue' },
-        )
+          { label: "重命名", value: "rename" },
+          { label: "继续录制", value: "continue" }
+        );
 
         if (props.record.status === RecordStatus.SUCCESS) {
-          base.push({ label: '下载', value: 'download' },)
+          // base.push({ label: '下载', value: 'download' },)
         }
       }
-      base.push({ label: '删除', value: 'delete' })
-      return base
-    })
+      base.push({ label: "删除", value: "delete" });
+      return base;
+    });
 
-    const isShot = ref<boolean>(false)
-    const inputRef = ref()
-    const isEditTitle = useFocus(computed(() => inputRef.value?.vmRef.root))
+    const isShot = ref<boolean>(false);
+    const inputRef = ref();
+    const isEditTitle = useFocus(computed(() => inputRef.value?.vmRef.root));
 
     watchEffect(() => {
       if (!isEditTitle.value && !props.record.title.length) {
-        isEditTitle.value = true
-        Message.warning('视频名称不可为空')
+        isEditTitle.value = true;
+        Message.warning("视频名称不可为空");
       }
-    })
+    });
 
-    const isPlayVideo = ref(false)
+    const isPlayVideo = ref(false);
     const actions = {
-      continue: () => isShot.value = true,
-      delete: () => emit('delete'),
-      rename: () => isEditTitle.value = true,
-      play: () => isPlayVideo.value = true,
+      continue: () => (isShot.value = true),
+      delete: () => emit("delete"),
+      rename: () => (isEditTitle.value = true),
+      play: () => (isPlayVideo.value = true),
       download() {
-        const url = getResource(props.record.url!)
-        const ext = getExtname(url) || 'mp4'
-        loadPack(saveAs(url, `${props.record.title}.${ext}`))
+        const url = getResource(props.record.url!);
+        const ext = getExtname(url) || "mp4";
+        loadPack(saveAs(url, `${props.record.title}.${ext}`));
       },
-    }
-    props.record.immediately && actions.continue()
+    };
+    props.record.immediately && actions.continue();
 
     const closeHandler = () => {
-      if (getRecordFragmentBlobs(props.record).length === 0 && isTemploraryID(props.record.id)) {
-        emit('delete')
+      if (
+        getRecordFragmentBlobs(props.record).length === 0 &&
+        isTemploraryID(props.record.id)
+      ) {
+        emit("delete");
       }
-      isShot.value = false
-    }
+      isShot.value = false;
+    };
 
     const appendFragment = (blobs: Blob[]) => {
       recordFragments.value.push(
-        ...blobs.map(blob => createRecordFragment({ url: blob, recordId: props.record.id }))
-      )
-      props.record.status = RecordStatus.UN
-    }
+        ...blobs.map((blob) =>
+          createRecordFragment({ url: blob, recordId: props.record.id })
+        )
+      );
+      props.record.status = RecordStatus.UN;
+    };
 
     return {
       menus,
@@ -146,22 +161,20 @@ export default defineComponent({
       isPlayVideo,
       getResource,
       getFileUrl,
-      appendFragment
-    }
+      appendFragment,
+    };
   },
   components: {
     Shot,
-    Preview
-  }
-})
+    Preview,
+  },
+});
 </script>
 
-
-<style lang="scss" src="./style.scss" scoped>
-</style>
+<style lang="scss" src="./style.scss" scoped></style>
 
 <style>
-  .record-sign .ui-input .text.suffix input {
-    padding-right: 60px;
-  }
-</style>
+.record-sign .ui-input .text.suffix input {
+  padding-right: 60px;
+}
+</style>

+ 2 - 2
src/views/setting/index.vue

@@ -3,7 +3,7 @@
     <ui-group title="初始画面" borderBottom>
       <ui-group-option>
         <div class="init-pic" :class="{ disabled: isEdit }">
-          <img :src="getFileUrl(setting!.cover)" class="init-puc-cover" />
+          <img :src="getResource(getFileUrl(setting!.cover))" class="init-puc-cover" />
           <div class="init-pic-set" @click="enterSetPic">设置</div>
         </div>
       </ui-group-option>
@@ -35,7 +35,7 @@ import { RightFillPano } from "@/layout";
 import { enterEdit, enterOld, setting, isEdit, updataSetting } from "@/store";
 import { ref, watchEffect } from "vue";
 import { togetherCallback, getFileUrl, loadPack } from "@/utils";
-import { showRightPanoStack, showRightCtrlPanoStack, custom } from "@/env";
+import { showRightPanoStack, showRightCtrlPanoStack, custom, getResource } from "@/env";
 import { analysisPose, sdk, SettingResourceType } from "@/sdk";
 
 const backs = ref<{ label: string; type: string; image: string; value: string }[]>([]);

+ 2 - 1
src/views/tagging/styles.vue

@@ -22,7 +22,7 @@
       @click="clickHandler(hotStyle)"
     >
       <span>
-        <img :src="getFileUrl(hotStyle.icon)" />
+        <img :src="getResource(getFileUrl(hotStyle.icon))" />
         <ui-icon
           v-if="!hotStyle.default"
           class="delete"
@@ -64,6 +64,7 @@ import { createTaggingStyle } from "@/store";
 import { ref, computed, defineEmits } from "vue";
 import { Cropper } from "bill/index";
 import { getFileUrl } from "@/utils";
+import { getResource } from "@/env";
 
 const props = defineProps<{
   styles: TaggingStyles;

+ 10 - 1
vite.config.ts

@@ -17,10 +17,19 @@ const proxy = {
     rewrite: path => path.replace(/^\/local/, '')
   },
   '/fusion': {
-    target: config.dev ? 'https://test-mix3d.4dkankan.com' : 'https://mix3d.4dkankan.com',
+    target: config.dev ? 'http://192.168.0.140:8808/' : 'https://mix3d.4dkankan.com',
     changeOrigin: true,
     rewrite: path => path.replace(/^\/api/, '')
   },
+  '/res': {
+    target: config.dev ? 'http://192.168.0.140' : 'https://mix3d.4dkankan.com',
+    changeOrigin: true,
+    rewrite: path => path.replace(/^\/res/, '')
+  },
+  '/api': {
+    target: config.dev ? 'http://192.168.0.140' : 'https://mix3d.4dkankan.com',
+    changeOrigin: true,
+  },
   '/swkk': {
     target: config.dev ? 'https://test.4dkankan.com' : 'https://www.4dkankan.com',
     changeOrigin: true,