Kaynağa Gözat

Merge branch 'v1.2.0-ga' of http://192.168.0.115:3000/bill/fuse-code into v1.2.0-ga

xzw 4 ay önce
ebeveyn
işleme
d728707a50

+ 2 - 1
src/components/view-setting/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div v-if="custom.showViewSetting">
     <Dropdown placement="top">
       <div class="strengthen show-setting">
         <span>显示设置</span>
@@ -25,6 +25,7 @@
 <script setup lang="ts">
 import { Dropdown, Menu, MenuItem } from "ant-design-vue";
 import {
+  custom,
   showMeasuresStack,
   showMonitorsStack,
   showPathsStack,

+ 2 - 0
src/env/index.ts

@@ -20,6 +20,7 @@ export const showPathsStack = stackFactory(ref<boolean>(true));
 export const showSearchStack = stackFactory(ref<boolean>(true));
 export const showPathStack = stackFactory(ref<Path["id"]>());
 export const showMeasuresStack = stackFactory(ref<boolean>(true));
+export const showViewSettingStack = stackFactory(ref<boolean>(true));
 export const currentModelStack = stackFactory(ref<FuseModel | null>(null));
 export const showModelsMapStack = stackFactory(
   ref<WeakMap<FuseModel, boolean>>(new Map()),
@@ -54,6 +55,7 @@ export const custom = flatStacksValue({
   currentView: currentViewStack,
   showMode: showModeStack,
   showSearch: showSearchStack,
+  showViewSetting: showViewSettingStack
 });
 
 export const params = reactive(

+ 9 - 3
src/sdk/association/guide.ts

@@ -1,6 +1,6 @@
 import { SceneGuide, sdk } from "../sdk";
 import { toRaw, ref, watch, watchEffect, computed } from "vue";
-import { viewModeStack, showLeftPanoStack, custom, showTaggingsStack, showPathsStack, showMeasuresStack, showSearchStack } from "@/env";
+import { viewModeStack, showLeftPanoStack, custom, showTaggingsStack, showPathsStack, showMeasuresStack, showSearchStack, showViewSettingStack } from "@/env";
 import { togetherCallback, asyncTimeout } from "@/utils";
 import { fuseModels, isEdit, sysBus, fuseModelsLoaded, selectPaths } from "@/store";
 import type { FuseModel, FuseModels, Guide, GuidePath } from "@/store";
@@ -105,7 +105,8 @@ export const playSceneGuide = (
         const oldSelect = [...selectPaths.selects.value]
         const oldUSelect = [...selectPaths.unSelects.value]
         selectPaths.all.value = guide ? guide.showPath :  true
-        pop = togetherCallback([
+
+        const cleanups = [
           showTaggingsStack.push(computed(() => guide ? guide.showTagging : true)),
           () => {
             oldSelect.forEach(item => selectPaths.updateSelectId(item.id, true))
@@ -114,7 +115,12 @@ export const playSceneGuide = (
           // showPathsStack.push(computed(() => guide ? guide.showPath : true)),
           showMeasuresStack.push(computed(() => guide ? guide.showMeasure : true)),
           showSearchStack.push(ref(false))
-        ])
+        ]
+        if (forceFull) {
+          cleanups.push(showViewSettingStack.push(ref(false)))
+        }
+
+        pop = togetherCallback(cleanups)
       },
       play: () => {
         sceneGuide.play();

+ 8 - 2
src/sdk/association/path.ts

@@ -6,8 +6,9 @@ import { nextTick, reactive, ref, watch, watchEffect } from "vue";
 import { groupProxy } from "@/store/group";
 import { isScenePlayRun, pauseScene, playScene } from "@/utils/full";
 import { analysisPose, setPose } from ".";
-import { custom, showPathsStack, showPathStack, showSearchStack } from "@/env";
+import { custom, showPathsStack, showPathStack, showSearchStack, showViewSettingStack } from "@/env";
 import { Message } from "bill/expose-common";
+import { mergeFuns } from "@/components/drawing/hook";
 
 // -----------------导览线关联--------------------
 export type PathNode = Path;
@@ -63,7 +64,12 @@ export const playScenePath = async (
   let pop: null | (() => void) = null
   await playScene({
     create: () => {
-      pop = showSearchStack.push(ref(false))
+      const cleanups = [showSearchStack.push(ref(false))]
+      if (forceFull) {
+        cleanups.push(showViewSettingStack.push(ref(false)))
+      }
+      pop = mergeFuns(cleanups)
+
     },
     play: () => {
       return new Promise(resolve => {

+ 4 - 0
src/views/guide/guide/attach-animation-sam.vue

@@ -13,6 +13,7 @@
 import { currentTime } from "@/sdk/association/animation";
 import { computed, ref, watchEffect } from "vue";
 import { GuidePath } from "@/store";
+import { Message } from "bill/index";
 
 const props = defineProps<{ current: GuidePath; paths: GuidePath[] }>();
 
@@ -39,6 +40,9 @@ watchEffect(() => {
 
 const attachAnimation = () => {
   props.current.playAnimation = !props.current.playAnimation;
+  Message.success(
+    props.current.playAnimation ? "动画已激活,请至少添加2个视角" : "动画已关闭"
+  );
 };
 </script>
 

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

@@ -65,6 +65,12 @@
               @click.stop="deletePath(path)"
               :class="{ disabled: isScenePlayIng }"
             />
+            <ui-icon
+              type="a-animation_s"
+              class="path-animation"
+              v-if="path.playAnimation"
+            />
+
             <img :src="getResource(getFileUrl(path.cover))" />
           </div>
           <div class="set-phone-attr" v-if="i !== paths.length - 1">
@@ -410,6 +416,12 @@ onUnmounted(() => {
         justify-content: center;
         cursor: pointer;
         border-radius: 50%;
+
+        &.path-animation {
+          margin-right: 30px;
+          color: var(--colors-primary-base) !important;
+          background-color: rgba(0, 0, 0, 0.4);
+        }
       }
 
       img {

+ 3 - 3
src/views/guide/path/show.vue

@@ -3,8 +3,8 @@
     <template #icon>
       <ui-icon
         ctrl
-        :type="custom.showPaths ? 'eye-s' : 'eye-n'"
-        @click="custom.showPaths = !custom.showPaths"
+        :type="selectPaths.all.value ? 'eye-s' : 'eye-n'"
+        @click="selectPaths.all.value = !selectPaths.all.value"
       />
     </template>
     <PathSign
@@ -20,7 +20,7 @@
 <script setup lang="ts">
 import { custom } from "@/env";
 import PathSign from "./sign.vue";
-import { paths } from "@/store";
+import { paths, selectPaths } from "@/store";
 import { computed } from "vue";
 
 const props = withDefaults(defineProps<{ keyword?: string }>(), { keyword: "" });