bill пре 4 месеци
родитељ
комит
c5079dc009

+ 0 - 1
src/api/map-tile.ts

@@ -13,7 +13,6 @@ export type MapTile = {
   name: string,
   mapUrls: {tempUrl: string, maximumLevel: number}[];
   coord: string;
-  maximumLevel: number
 };
 
 export const fetchMapTiles = async () => {

+ 2 - 0
src/api/material.ts

@@ -62,11 +62,13 @@ export const fetchMaterialPage = async (params: MaterialPageProps) => {
     pageSize: params.pageSize,
     name: params.name,
     dictIds: params.groupIds,
+    
     fileFormats: params.formats
   });
   const nm = {
     ...material,
     list: material.list.map((item): Material => ({
+      ...item,
       id: item.id,
       name: item.name,
       format: item.fileFormat,

+ 8 - 2
src/api/setting.ts

@@ -2,6 +2,7 @@ import { GET_SETTING, UPDATE_SETTING } from "./constant";
 import defaultCover from "@/assets/cover.png";
 import { params } from "@/env";
 import axios from "./instance";
+import { fetchMapTiles } from "./map-tile";
 
 type ServeSetting = {
   settingsId?: string;
@@ -51,10 +52,15 @@ const toService = (setting: Setting): ServeSetting => ({
 });
 
 export const fetchSetting = async () => {
-  const data = await axios.get<ServeSetting[]>(GET_SETTING, {
+  let data = await axios.get<ServeSetting[]>(GET_SETTING, {
     params: { caseId: params.caseId },
   });
-  return toLocal(data[0] || {});
+  const tData = toLocal(data[0] || {})
+  if (!tData.back && !tData.mapId) {
+    const tiles = await fetchMapTiles()
+    tData.mapId = tiles[0].id
+  }
+  return tData
 };
 
 export const updateSetting = async (setting: Setting) => {

+ 1 - 2
src/components/drawing-time-line/check.ts

@@ -88,13 +88,12 @@ export const getAddTLItemTime = (items: TLItem[], refNdx = 0, dur = 0.5) => {
 
 export const getAddTLItemTimeByTime = (items: TLItem[], curTime: number, dur: number): ReturnType<typeof getAddTLItemAttr> => {
   let tl
-  if (tl = getAddTLItemAttr(items, curTime, dur, 1)) {
+  if (tl = getAddTLItemAttr(items, curTime, dur, Math.min(1, dur))) {
     return tl
   }
 
   items = [...items].sort((a, b) => a.time - b.time);
   let refNdx = items.findIndex(item => item.time >= curTime)
   refNdx = ~refNdx ? refNdx : items.length - 1
-  console.log(refNdx, curTime, items[refNdx].time + (items[refNdx].duration || 0.01))
   return getAddTLItemTimeByTime(items, items[refNdx].time + (items[refNdx].duration || 0.01) + 0.001, dur)
 };

+ 2 - 1
src/components/materials/index.vue

@@ -76,7 +76,8 @@
               <span class="group-str">{{ record.group }}</span>
             </template>
             <template v-else-if="column.key === 'action'">
-              <span>
+              <span v-if="record.useType !== 'animation'">
+              
                 <a @click="delHandler(record.id)">删除</a>
               </span>
             </template>

+ 1 - 0
src/env/index.ts

@@ -100,3 +100,4 @@ export const getResource = (uri: string) => {
   }
 };
 
+

+ 5 - 6
src/layout/edit/fuse-edit.vue

@@ -20,7 +20,7 @@
 
 <script lang="ts" setup>
 import { ref, watch, watchEffect, nextTick } from "vue";
-import { currentMeta, router, RoutesName } from "@/router";
+import { back, currentMeta, router, RoutesName } from "@/router";
 import { showLeftPanoStack, showRightPanoStack } from "@/env";
 import { asyncTimeout, togetherCallback } from "@/utils";
 import { loadModel, fuseModel } from "@/model";
@@ -73,17 +73,16 @@ router.beforeEach(async (to, from, next) => {
   }
   next();
 });
+
+const routes: any[] = [];
 watch(
   router.currentRoute,
   (_n, _, onClean) => {
     const meta = currentMeta.value;
     if (meta && "full" in meta && (meta as any).full) {
+      debugger;
       enterEdit(() => {
-        if (!history.state.back) {
-          router.replace({ name: RoutesName.merge });
-        } else {
-          router.back();
-        }
+        back();
       });
       onClean(
         togetherCallback([

+ 2 - 0
src/layout/left-pano.vue

@@ -11,11 +11,13 @@
     <div class="left-pano strengthen-right">
       <slot></slot>
     </div>
+    <ModeTab />
   </div>
 </template>
 
 <script lang="ts" setup>
 import { custom } from "@/env";
+import ModeTab from "./model-list/mode-tab.vue";
 
 withDefaults(defineProps<{ show?: boolean }>(), { show: false });
 </script>

+ 0 - 23
src/layout/model-list/index.vue

@@ -19,28 +19,6 @@
       />
     </template>
   </List>
-
-  <Teleport
-    to="#left-pano"
-    v-if="panoModel && currentModel === fuseModel && custom.showModeTab"
-  >
-    <div class="mode-tab strengthen">
-      <div
-        class="mode-icon-layout"
-        @click="flyModel(panoModel, 'fuse')"
-        :class="{ active: custom.showMode === 'fuse' }"
-      >
-        <ui-icon type="show_3d_n" class="icon" ctrl tip="三维模型" tipV="top" />
-      </div>
-      <div
-        class="mode-icon-layout"
-        @click="flyModel(panoModel, 'pano')"
-        :class="{ active: custom.showMode === 'pano' }"
-      >
-        <ui-icon type="show_roaming_n" class="icon" ctrl tip="全景图" tipV="top" />
-      </div>
-    </div>
-  </Teleport>
 </template>
 
 <script lang="ts" setup>
@@ -77,7 +55,6 @@ defineEmits<{
   (e: "clickModel", model: FuseModel): void;
 }>();
 
-const panoModel = getSupperPanoModel();
 const modelList = computed(() =>
   fuseModels.value.map((model) => ({
     raw: model,

+ 39 - 0
src/layout/model-list/mode-tab.vue

@@ -0,0 +1,39 @@
+<template>
+  <div
+    class="mode-tab strengthen"
+    v-if="panoModel && currentModel === fuseModel && custom.showModeTab"
+  >
+    <div
+      class="mode-icon-layout"
+      @click="flyModel(panoModel, 'fuse')"
+      :class="{ active: custom.showMode === 'fuse' }"
+    >
+      <ui-icon type="show_3d_n" class="icon" ctrl tip="三维模型" tipV="top" />
+    </div>
+    <div
+      class="mode-icon-layout"
+      @click="flyModel(panoModel, 'pano')"
+      :class="{ active: custom.showMode === 'pano' }"
+    >
+      <ui-icon type="show_roaming_n" class="icon" ctrl tip="全景图" tipV="top" />
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { custom } from "@/env";
+import { getSupperPanoModel } from "@/sdk/association";
+import { currentModel, fuseModel } from "@/model";
+import { flyModel } from "@/hook/use-fly";
+import { onUnmounted, watchEffect } from "vue";
+
+const panoModel = getSupperPanoModel();
+watchEffect(() =>
+  console.error(
+    "panoModel",
+    panoModel.value && currentModel.value === fuseModel && custom.showModeTab
+  )
+);
+</script>
+
+<style lang="scss" scoped src="./style.scss"></style>

+ 1 - 1
src/layout/model-list/style.scss

@@ -51,7 +51,7 @@
   height          : 34px;
   border-radius   : 17px;
   margin-left     : 10px;
-  bottom          : 10px;
+  bottom          : calc(var(--editor-menu-bottom, 0px) + 10px);
   left            : calc(var(--left-pano-left) + var(--left-pano-width));
   padding         : 0 5px;
 

+ 1 - 0
src/layout/show/index.vue

@@ -30,6 +30,7 @@ import { router, RoutesName } from "@/router";
 import { loadModel, fuseModel } from "@/model";
 import { asyncTimeout } from "@/utils";
 import SlideMenu from "./slide-menu.vue";
+
 import {
   initialFloders,
   initialFloderTypes,

+ 10 - 1
src/router/index.ts

@@ -68,4 +68,13 @@ watch(currentLayout, () => {
 export * from './config'
 export * from './constant'
 
-export default router
+export default router
+
+
+export const back = () => {
+  if (!history.state.back) {
+    router.replace({ name: RoutesName.merge });
+  } else {
+    router.back();
+  }
+}

+ 1 - 0
src/sdk/association/animation.ts

@@ -75,6 +75,7 @@ export const addAM = (data: AnimationModel): Promise<AnimationModel3D> => {
           subtitles: {},
         };
         const am = animationGroup.addAnimationModel({...data, quaAtPath: data.mat?.quaAtPath});
+        am.putInFrontOfCam()
         am.bus.on("loadDone", () => {
           amMap[key].am = am;
           console.log("0.0", am);

+ 2 - 1
src/sdk/association/index.ts

@@ -22,6 +22,7 @@ export const getSupperPanoModel = () => {
     if (!sdk) return;
     clearInterval(interval);
 
+
     const update = () => {
       const data = sdk.canTurnToPanoMode();
       if (data?.model) {
@@ -33,7 +34,6 @@ export const getSupperPanoModel = () => {
     }
     watchEffect((onCleanup) => {
       const smodels = [...sceneModelMap.values()]
-      console.log(smodels)
       smodels.forEach(smodel => {
         smodel.bus.on('transformChanged', update)
       })
@@ -44,6 +44,7 @@ export const getSupperPanoModel = () => {
       })
     })
     sdk.sceneBus.on("cameraChange", update);
+    update()
   }, 16);
 
   return supperModel;

+ 3 - 0
src/sdk/sdk.ts

@@ -370,6 +370,8 @@ export type Tagging3D = {
 
 // 动画组对象
 export type AnimationGroup = {
+  enterEditPannel: () => void,
+  exitEditPannel: () => void,
   // 播放
   play: () => void;
   // 暂停
@@ -447,6 +449,7 @@ export type AnimationModel3D = {
   enterScaleMode: () => void;
   leaveTransform: () => void;
 
+  putInFrontOfCam: () => void
   // 动画帧姿态修改数据
   bus: Emitter<{
     loadDone: void;

+ 22 - 6
src/views/animation/index.vue

@@ -14,11 +14,11 @@
       @change-frame-action="(f) => (frameAction = f.action)"
       class="animation-right"
       v-model:activeAttrib="activeAttrib"
-      @add-frame="add('frames', { duration: 0 })"
+      @add-frame="add('frames', { duration: 0.1 })"
       @add-path="(preset) => add('paths', { reverse: false, ...preset })"
       @add-subtitle="add('subtitles', { content: '', background: '#000000' })"
       @add-action="(preset) => add('actions', preset)"
-      @apply-global="k => ams.forEach((am: any) => (am[k] = focusAM![k]))"
+      @apply-global="(k) => applyGlobal(k)"
     />
     <GlobalFrame
       class="global-frame"
@@ -45,7 +45,7 @@ import Right from "./right/index.vue";
 import GlobalFrame from "./right/frame.vue";
 import Bottom from "./bottom.vue";
 import BottomPano from "@/layout/bottom-pano.vue";
-import router from "@/router";
+import router, { back } from "@/router";
 import { enterEdit, sysBus } from "@/store";
 import { useViewStack } from "@/hook";
 import { ams, AnimationModel, autoSaveAnimationModel } from "@/store/animation";
@@ -55,12 +55,19 @@ import {
   getAddTLItemAttr,
   getAddTLItemTimeByTime,
 } from "@/components/drawing-time-line/check";
-import { Message } from "bill/expose-common";
+import { Dialog, Message } from "bill/expose-common";
 import { mergeFuns, uuid } from "@/components/drawing/hook";
 import { title } from "./type";
-import { amMap, getAMKey, currentTime, play } from "@/sdk/association/animation";
+import {
+  amMap,
+  getAMKey,
+  currentTime,
+  play,
+  animationGroup,
+} from "@/sdk/association/animation";
 import { sdk, AnimationModel3D } from "@/sdk";
 import {
+  bottomBarHeightStack,
   showAMsStack,
   showBottomBarStack,
   showHeadBarStack,
@@ -74,15 +81,17 @@ import { clickListener } from "@/utils/event";
 import { useRMenus } from "@/components/right-menu";
 import { asyncTimeout } from "@/utils";
 
-enterEdit(() => router.back());
+enterEdit(() => back());
 useViewStack(autoSaveAnimationModel);
 sysBus.on("leave", () => {
   updateFocus();
 });
 useViewStack(() => {
   const showRight = ref(false);
+  animationGroup.enterEditPannel();
   return mergeFuns(
     showBottomBarStack.push(ref(true)),
+    bottomBarHeightStack.push(ref("0px")),
     showRightPanoStack.push(showRight),
     showLeftPanoStack.push(ref(true)),
     showAMsStack.push(ref(true)),
@@ -90,6 +99,7 @@ useViewStack(() => {
     showLeftCtrlPanoStack.push(computed(() => !play.value)),
     showModeTabStack.push(computed(() => !play.value)),
     showSearchStack.push(computed(() => !play.value)),
+    () => animationGroup.exitEditPannel(),
     watchEffect((onCleanup) => {
       const cleanups: any[] = [];
       if (play.value || activeAttrib.value?.key === "frames") {
@@ -112,6 +122,12 @@ const activeAttrib = ref<Active>();
 const follow = ref(false);
 const frameAction = ref<string>();
 
+const applyGlobal = async (k: keyof AnimationModel) => {
+  console.error(k, focusAM.value![k]);
+  if (!(await Dialog.confirm("确定要将此属性应用到所有动画模型?"))) return;
+  ams.value.forEach((am: any) => (am[k] = focusAM.value![k]));
+};
+
 const amM = computed(() => focusAM.value && amMap[getAMKey(focusAM.value)]);
 watch(play, (play, _, onCleanup) => {
   if (play) {

+ 1 - 1
src/views/animation/right/am.vue

@@ -33,7 +33,7 @@
           <SignItem
             label="可见范围"
             v-if="!am.globalVisibility"
-            @apply-global="$emit('applyGlobal', 'globalVisibility')"
+            @apply-global="$emit('applyGlobal', 'visibilityRange')"
           >
             <Slider v-model:value="am.visibilityRange" :min="1" :max="1000" :step="0.1" />
           </SignItem>

+ 0 - 1
src/views/animation/right/index.vue

@@ -11,7 +11,6 @@
       @add-path="(preset) => emit('addPath', preset)"
       @add-subtitle="(preset) => emit('addSubtitle', preset)"
       @add-action="(preset) => emit('addAction', preset)"
-      @apply-global="(k) => emit('applyGlobal', k)"
       @applyGlobal="(k) => emit('applyGlobal', k)"
     />
     <template v-if="!(!activeAttrib || !~activeAttrib.ndx)">

+ 6 - 0
src/views/guide/guide/edit-paths.vue

@@ -141,6 +141,8 @@ import {
   showPathsStack,
   showMeasuresStack,
   showMonitorsStack,
+  bottomBarHeightStack,
+  showBottomBarStack,
 } from "@/env";
 
 import type { Guide, GuidePaths, GuidePath } from "@/store";
@@ -167,6 +169,10 @@ useViewStack(() => {
 
   return togetherCallback([
     showRightPanoStack.push(ref(false)),
+    bottomBarHeightStack.push(
+      computed(() => (paths.value.length > 0 ? "230px" : "100px"))
+    ),
+    showBottomBarStack.push(ref(true)),
     showLeftCtrlPanoStack.push(ref(false)),
     showLeftPanoStack.push(ref(false)),
     showRightCtrlPanoStack.push(ref(false)),

+ 2 - 2
src/views/tagging-position/index.vue

@@ -30,7 +30,7 @@
 
 <script lang="ts" setup>
 import PositionSign from "./sign.vue";
-import { router } from "@/router";
+import { back, router } from "@/router";
 import { Dialog, Message } from "bill/index";
 import { RightFillPano } from "@/layout";
 import { asyncTimeout, debounce } from "@/utils";
@@ -74,7 +74,7 @@ useViewStack(autoSaveTaggings);
 useViewStack(() => {
   taggingsGroup.changeCanMove(true);
   taggingsGroup.showDelete(true);
-  enterEdit(() => router.back());
+  enterEdit(() => back());
   return () => {
     taggingsGroup.changeCanMove(false);
     taggingsGroup.showDelete(false);