rindy před 2 roky
rodič
revize
032ffa3106

+ 6 - 2
src/components/calendar/index.vue

@@ -1,8 +1,8 @@
 <template>
     <div class="calendar">
-        <span class="prev" @click="emits('prev', props.name)"><i class="iconfont icon-arrows_left"></i></span>
+        <span class="prev" @click="emits('prev', props.name)" v-show="props.count>1"><i class="iconfont icon-arrows_left"></i></span>
         <span class="cale" @click="onPickDate()">{{ value.format('YYYY-mm-dd') }}<i class="iconfont icon-date"></i></span>
-        <span class="next" @click="emits('next', props.name)"><i class="iconfont icon-arrows_right"></i></span>
+        <span class="next" @click="emits('next', props.name)" v-show="props.count>1"><i class="iconfont icon-arrows_right"></i></span>
         <div class="calendar-list" v-if="showCalendar" @click="showCalendar = false">
             <div @click.stop>
                 <datepicker language="zh" :inline="true" :value="value" :highlighted="highlighted" @selected="onSelected"></datepicker>
@@ -16,11 +16,15 @@ import Datepicker from '@/components/datepicker/Datepicker'
 const props = defineProps({
     name: String,
     value: Date,
+    count:Number,
     highlighted: Object,
 })
 const emits = defineEmits(['prev', 'selected', 'next', 'pick'])
 const showCalendar = ref(false)
 const onPickDate = () => {
+    if(props.count<2){
+        return
+    }
     showCalendar.value = !showCalendar.value
     if (showCalendar.value) {
         emits('pick', props.name)

+ 3 - 2
src/pages/Bim.vue

@@ -3,6 +3,7 @@
 </template>
 <script setup>
 import { onMounted } from 'vue'
+import browser from '@/utils/browser'
 
 let viewToken = 'c34b3bf046e140968d1d3a30bdc229f4'
 // 声明Viewer及App
@@ -71,11 +72,11 @@ onMounted(() => {
     // let loaderConfig = new BimfaceSDKLoaderConfig()
     // loaderConfig.viewToken = viewToken
     // BimfaceSDKLoader.load(loaderConfig, successCallback1, failureCallback)
-
+    const m = browser.valueFromUrl('m')
     let BimfaceLoaderConfig = new BimfaceSDKLoaderConfig()
     BimfaceLoaderConfig.dataEnvType = BimfaceEnvOption.Local
     BimfaceLoaderConfig.sdkPath = 'https://4dkk.4dage.com/bim/jssdk'
-    BimfaceLoaderConfig.path = 'https://4dkk.4dage.com/bim/project-1/viewToken.json'
+    BimfaceLoaderConfig.path = `${m}viewToken.json`
     BimfaceSDKLoader.load(BimfaceLoaderConfig, successCallback2, failureCallback)
 })
 </script>

+ 3 - 3
src/pages/Viewer.vue

@@ -6,7 +6,7 @@
                 <iframe ref="sourceFrame" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
                 <div class="tools" v-show="!showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
                     <div class="item-date">
-                        <calendar name="source" :value="sourceDate" :highlighted="sourceDays" @selected="onSelected" @pick="onPickDate" @prev="onPrevDate" @next="onNextDate"></calendar>
+                        <calendar name="source" :count="scenes.length" :value="sourceDate" :highlighted="sourceDays" @selected="onSelected" @pick="onPickDate" @prev="onPrevDate" @next="onNextDate"></calendar>
                     </div>
                     <div class="item-mode" v-if="source.type == 2">
                         <div class="iconfont icon-show_roaming" :class="{ active: mode == 0 }" @click="onModeChange(0)"></div>
@@ -111,7 +111,7 @@ const scenes = computed(() => {
 })
 const sourceURL = computed(() => {
     if (bimChecked.value && !dbsChecked.value) {
-        return `smart-bim.html?m=${source.value.num}`
+        return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
     }
 
     if (source.value.type < 2) {
@@ -124,7 +124,7 @@ const sourceURL = computed(() => {
 })
 const targetURL = computed(() => {
     if (bimChecked.value) {
-        return `smart-bim.html?m=${target.value.num}`
+        return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
     }
 
     if (source.value.type < 2) {

+ 1 - 1
src/utils/request.js

@@ -166,7 +166,7 @@ const http = {
 
 export function setup(options = {}) {
     fetch = axios.create({
-        baseURL: options.server || '',
+        baseURL: options.server || '/',
     })
 
     fetch.interceptors.request.use(