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
685fc56bfc

+ 2 - 2
src/api/setting.ts

@@ -27,10 +27,10 @@ export type Setting = {
   };
   mapType: 'satellite' | 'standard',
   cover: string;
-  back?: string;
+  back?: string | null;
   fov?: number;
   openCompass?: boolean;
-  mapId?: number
+  mapId?: number | null
 };
 
 const toLocal = (serviceSetting: ServeSetting): Setting => ({

+ 94 - 93
src/components/bill-ui/components/slide/index.vue

@@ -1,114 +1,115 @@
 <template>
-    <div class="ui-slide" :class="{'stop-animation': stopAmimation}" v-if="items.length">
-        <Gate :index="extendIndex">
-            <GateContent v-for="(item, i) in extendItems">
-                <slot :raw="item" :active="items[index]" :index="getIndex(i)" />
-            </GateContent>
-        </Gate>
-        <template v-if="showCtrl">
-            <span class="left fun-ctrl" @click="prevHandler"><UIIcon type="left1" /></span>
-            <span class="right fun-ctrl" @click="nextHandler"><UIIcon type="right" /></span>
-        </template>
-        <slot name="attach" :active="items[index]" />
+  <div class="ui-slide" :class="{ 'stop-animation': stopAmimation }" v-if="items.length">
+    <Gate :index="extendIndex">
+      <GateContent v-for="(item, i) in extendItems">
+        <slot :raw="item" :active="items[index]" :index="getIndex(i)" />
+      </GateContent>
+    </Gate>
+    <template v-if="showCtrl">
+      <span class="left fun-ctrl" @click="prevHandler"><UIIcon type="left1" /></span>
+      <span class="right fun-ctrl" @click="nextHandler"><UIIcon type="right" /></span>
+    </template>
+    <slot name="attach" :active="items[index]" />
 
-        <span class="infos" v-if="showInfos">
-            <span class="tj">
-                <span>{{ index + 1 }}</span> / {{ items.length }}
-            </span>
-        </span>
-    </div>
+    <span class="infos" v-if="showInfos">
+      <span class="tj">
+        <span>{{ index + 1 }}</span> / {{ items.length }}
+      </span>
+    </span>
+  </div>
 </template>
 
 <script setup>
-import { Gate, GateContent } from '../gate'
-import { ref, watchEffect, computed } from 'vue'
-import UIIcon from '../icon'
-import { nextTick } from 'vue';
+import { Gate, GateContent } from "../gate";
+import { ref, watchEffect, computed } from "vue";
+import UIIcon from "../icon";
+import { nextTick } from "vue";
 
 const props = defineProps({
-    items: Array,
-    currentIndex: {
-        type: Number,
-        default: 0,
-    },
-    showCtrl: {
-        type: Boolean,
-    },
-    showInfos: {
-        type: Boolean,
-    },
-})
-const emit = defineEmits(['change'])
-const extendIndex = ref()
-const extendLength = computed(() => props.items.length > 1 ? 1 : 0)
+  items: Array,
+  currentIndex: {
+    type: Number,
+    default: 0,
+  },
+  showCtrl: {
+    type: Boolean,
+  },
+  showInfos: {
+    type: Boolean,
+  },
+});
+const emit = defineEmits(["change"]);
+const extendIndex = ref();
+// const extendLength = computed(() => (props.items.length > 1 ? 1 : 0));
+const extendLength = computed(() => 0);
 const getIndex = (extendIndex) => {
-    const len = props.items.length
-    const diff = extendIndex - extendLength.value
+  const len = props.items.length;
+  const diff = extendIndex - extendLength.value;
 
-    if (diff < 0) {
-        return diff + len
-    } else if (diff >= len) {
-        return diff % len
-    } else {
-        return diff
-    }
-}
+  if (diff < 0) {
+    return diff + len;
+  } else if (diff >= len) {
+    return diff % len;
+  } else {
+    return diff;
+  }
+};
 const extendItems = computed(() => {
-    if (extendLength.value) {
-        const reverItems = [...props.items].reverse()
-        return [
-            ...reverItems.slice(0, extendLength.value),
-            ...props.items,
-            ...props.items.slice(0, extendLength.value)
-        ]
-    } else {
-        return props.items
-    }
-})
+  if (extendLength.value) {
+    const reverItems = [...props.items].reverse();
+    return [
+      ...reverItems.slice(0, extendLength.value),
+      ...props.items,
+      ...props.items.slice(0, extendLength.value),
+    ];
+  } else {
+    return props.items;
+  }
+});
 
-const index = computed(() => getIndex(extendIndex.value))
+const index = computed(() => getIndex(extendIndex.value));
 
 watchEffect(() => {
-    extendIndex.value = props.currentIndex + extendLength.value
-})
+  extendIndex.value = props.currentIndex + extendLength.value;
+});
 
-const stopAmimation = ref(false)
-let prevent = false
+const stopAmimation = ref(false);
+let prevent = false;
 const openPrevent = (fn) => {
-    prevent = true
-    setTimeout(() => {
-        stopAmimation.value = true
-        nextTick(() => {
-            fn()
-            setTimeout(() => {
-                stopAmimation.value = false
-                prevent = false
-            }, 50)
-        })
-    }, 300)
-}
+  prevent = true;
+  setTimeout(() => {
+    stopAmimation.value = true;
+    nextTick(() => {
+      fn();
+      setTimeout(() => {
+        stopAmimation.value = false;
+        prevent = false;
+      }, 50);
+    });
+  }, 300);
+};
 const prevHandler = () => {
-    if (prevent) return;
-    if (index.value === 0) {
-        openPrevent(() => {
-            extendIndex.value = extendLength.value + props.items.length  - 1
-        })
-    }
-    extendIndex.value--
-    emit('change', index.value)
-}
+  if (prevent) return;
+  if (index.value === 0) {
+    openPrevent(() => {
+      extendIndex.value = extendLength.value + props.items.length - 1;
+    });
+  }
+  extendIndex.value--;
+  emit("change", index.value);
+};
 const nextHandler = () => {
-    if (prevent) return;
-    if (index.value === props.items.length - 1) {
-        openPrevent(() => {
-            extendIndex.value = extendLength.value
-        })
-    }
-    extendIndex.value++
-    emit('change', index.value)
-}
+  if (prevent) return;
+  if (index.value === props.items.length - 1) {
+    openPrevent(() => {
+      extendIndex.value = extendLength.value;
+    });
+  }
+  extendIndex.value++;
+  emit("change", index.value);
+};
 </script>
 
 <script>
-export default { name: 'ui-slide' }
+export default { name: "ui-slide" };
 </script>

+ 4 - 4
src/hook/ids.ts

@@ -6,7 +6,7 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
 
   const updateSelect = (item: T, select: boolean) => {
     const ndx = selects.value.findIndex((s) => s.id === item.id);
-    test && console.log('updateSelect', item.id, select)
+    test && console.error('updateSelect', item.id, select)
     if (select) {
       if (~ndx) {
         selects.value[ndx] = item as any
@@ -37,15 +37,15 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
         items.map((item) => item.id),
         oldItems.map((item) => item.id)
       );
-      // test && console.error('added', added)
-      // test && console.error('deleted', deleted)
+      test && console.error('added', added)
+      test && console.error('deleted', deleted)
       
       added.forEach((id) => updateSelectId(id, true));
       deleted.forEach((id) => updateSelectId(id, false));
       oldItems.length = 0;
       oldItems.push(...items);
     },
-    { deep: true, flush: 'post' }
+    { deep: true, flush: 'post', immediate: true }
   );
 
   return {

+ 0 - 1
src/layout/edit/fuse-edit.vue

@@ -80,7 +80,6 @@ watch(
   (_n, _, onClean) => {
     const meta = currentMeta.value;
     if (meta && "full" in meta && (meta as any).full) {
-      debugger;
       enterEdit(() => {
         back();
       });

+ 13 - 13
src/layout/edit/fuse-left-pano.vue

@@ -26,19 +26,19 @@ import { LeftPano } from "@/layout";
 
 import type { FuseModel } from "@/store";
 
-watch(
-  () => custom.currentModel,
-  (model, oldModel) => {
-    if (oldModel && getFuseModelShowVariable(oldModel).value) {
-      getSceneModel(oldModel)?.changeSelect(false);
-      activeModel({ showMode: "fuse" });
-    }
-    if (model && getFuseModelShowVariable(model).value) {
-      getSceneModel(model)?.changeSelect(true);
-      activeModel({ active: model, showMode: "fuse" });
-    }
-  }
-);
+// watch(
+//   () => custom.currentModel,
+//   (model, oldModel) => {
+//     if (oldModel && getFuseModelShowVariable(oldModel).value) {
+//       getSceneModel(oldModel)?.changeSelect(false);
+//       activeModel({ showMode: "fuse" });
+//     }
+//     if (model && getFuseModelShowVariable(model).value) {
+//       getSceneModel(model)?.changeSelect(true);
+//       activeModel({ active: model, showMode: "fuse" });
+//     }
+//   }
+// );
 
 const modelChangeSelect = (model: FuseModel) => {
   custom.currentModel = model === custom.currentModel ? null : model;

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

@@ -197,7 +197,6 @@ export const activeModel = (status: {
 
   setTimeout(() => {
     if (status.showMode !== "pano" && model) {
-      console.error(status)
       if (oldStatus.showMode !== 'pano' || status.fore) {
         model && model.changeSelect(true);
       }

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

@@ -1,12 +1,13 @@
 import { SceneGuide, sdk } from "../sdk";
 import { toRaw, ref, watch, watchEffect, computed } from "vue";
-import { viewModeStack, showLeftPanoStack, custom, showTaggingsStack, showPathsStack, showMeasuresStack, showSearchStack, showViewSettingStack } from "@/env";
+import { viewModeStack, showLeftPanoStack, custom, showTaggingsStack, showPathsStack, showMeasuresStack, showSearchStack, showViewSettingStack, showModeTabStack } from "@/env";
 import { togetherCallback, asyncTimeout } from "@/utils";
 import { fuseModels, isEdit, sysBus, fuseModelsLoaded, selectPaths } from "@/store";
 import type { FuseModel, FuseModels, Guide, GuidePath } from "@/store";
 import { analysisPoseInfo } from ".";
 import { fullView, isScenePlayRun, pauseScene, playScene } from "@/utils/full";
 import { animationGroup, currentTime, play } from "./animation";
+import { mergeFuns } from "@/components/drawing/hook";
 
 // -----------------导览关联--------------------
 
@@ -117,7 +118,12 @@ export const playSceneGuide = (
           showSearchStack.push(ref(false))
         ]
         if (forceFull) {
-          cleanups.push(showViewSettingStack.push(ref(false)))
+          cleanups.push(
+            mergeFuns([
+              showViewSettingStack.push(ref(false)),
+              showModeTabStack.push(ref(false)),
+            ])
+          );
         }
 
         pop = togetherCallback(cleanups)

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

@@ -6,7 +6,7 @@ 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, showViewSettingStack } from "@/env";
+import { custom, showModeTabStack, showPathsStack, showPathStack, showSearchStack, showViewSettingStack } from "@/env";
 import { Message } from "bill/expose-common";
 import { mergeFuns } from "@/components/drawing/hook";
 
@@ -66,7 +66,10 @@ export const playScenePath = async (
     create: () => {
       const cleanups = [showSearchStack.push(ref(false))]
       if (forceFull) {
-        cleanups.push(showViewSettingStack.push(ref(false)))
+        cleanups.push(
+          showViewSettingStack.push(ref(false)),
+          showModeTabStack.push(ref(false))
+        )
       }
       pop = mergeFuns(cleanups)
 

+ 8 - 4
src/style.scss

@@ -171,15 +171,19 @@ input::-ms-clear,input::-ms-reveal {
   top: 0;
   text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
   pointer-events: none;
-  max-width: 240px;
+  max-width: 320px;
   border-radius: 4px;
-  font-size: 14px;
-  padding: 10px 20px;
+  font-size: 12px;
+  padding: 10px 10px;
   color: #ffffff;
-  line-height: 22px;
+  line-height: 18px;
   word-break: break-all;
 }
 
 * {
   user-select: none;
+}
+
+.ant-select-clear {
+  background: none !important;
 }

+ 2 - 1
src/views/animation/index.vue

@@ -22,7 +22,7 @@
     />
     <GlobalFrame
       class="global-frame"
-      v-if="activeAttrib?.key !== 'frames' && !play && focusAM"
+      v-if="activeAttrib?.key !== 'frames' && !play && focusAM && !currentIsFullView"
       :data="{ id: '0', name: 'global-frame', time: 0 }"
       :frame-action="frameAction"
       @change-frame-action="(action) => (frameAction = action.action)"
@@ -80,6 +80,7 @@ import {
 import { clickListener } from "@/utils/event";
 import { useRMenus } from "@/components/right-menu";
 import { asyncTimeout } from "@/utils";
+import { currentIsFullView } from "@/utils/full";
 
 enterEdit(() => back());
 useViewStack(autoSaveAnimationModel);

+ 1 - 1
src/views/animation/left.vue

@@ -72,7 +72,7 @@ const emit = defineEmits<{
 const activeKey = ref("model");
 const { updateSelect, selects: selectAMs, unSelects, all } = useSelects(ams, true);
 all.value = true;
-watchEffect(() => {
+watch([selectAMs, unSelects], () => {
   emit("changeSelect", { select: selectAMs.value, unSelect: unSelects.value });
 });
 const updateSelectAm = (item: AnimationModel, select: boolean) => {

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

@@ -166,6 +166,7 @@ const actionsMap: Record<string, string> = {
   mma_kick: "右前踢",
   standing_jump: "标准向上跳",
   sitting: "标准坐",
+  a_idel: "站立",
   peone_forward: "匍匐前行",
   wall_crash: "松手摔倒",
   head_hit: "头被击中",

+ 0 - 1
src/views/merge/index.vue

@@ -40,7 +40,6 @@
         </ui-input>
       </ui-group-option>
       <ui-group-option label="不透明度">
-        {{ currentItem?.text }}---
         <ui-input
           type="range"
           v-model="custom.currentModel.opacity"

+ 13 - 1
src/views/proportion/index.vue

@@ -22,10 +22,16 @@ import { router, RoutesName } from "@/router";
 import { ref, computed, watch, watchEffect } from "vue";
 import { getSceneModel } from "@/sdk";
 import { autoSaveFuseModels, FuseModel, getFuseModel, leave } from "@/store";
-import { currentModelStack } from "@/env";
+import {
+  currentModelStack,
+  showLeftCtrlPanoStack,
+  showLeftPanoStack,
+  showSearchStack,
+} from "@/env";
 
 import type { ScaleSet } from "@/sdk";
 import { round } from "@/utils";
+import { mergeFuns } from "@/components/drawing/hook";
 
 const isCurrent = computed(
   () => router.currentRoute.value.name === RoutesName.proportion
@@ -75,8 +81,14 @@ watchEffect((onCleanup) => {
 
 useViewStack(() => {
   const hide = Message.show({ msg: "请选择两点标记一段已知长度,并输入真实长度" });
+  const cleanups = mergeFuns([
+    showLeftPanoStack.push(ref(false)),
+    showLeftCtrlPanoStack.push(ref(false)),
+    showSearchStack.push(ref(false)),
+  ]);
   return () => {
     hide();
+    cleanups();
     length.value = null;
   };
 });

+ 10 - 2
src/views/registration/index.vue

@@ -77,9 +77,12 @@ import { router, RoutesName } from "@/router";
 import {
   currentModelStack,
   custom,
+  showLeftCtrlPanoStack,
+  showLeftPanoStack,
   showMeasuresStack,
   showPathsStack,
   showPathStack,
+  showSearchStack,
   showTaggingsStack,
 } from "@/env";
 
@@ -166,11 +169,16 @@ watchEffect((onCleanup) => {
 });
 
 useViewStack(() => {
-  showMeasuresStack.push(ref(false));
+  const cleanups = mergeFuns([
+    showMeasuresStack.push(ref(false)),
+    showLeftPanoStack.push(ref(false)),
+    showLeftCtrlPanoStack.push(ref(false)),
+    showSearchStack.push(ref(false)),
+  ]);
   sdk.showGrid();
 
   return () => {
-    showMeasuresStack.pop();
+    cleanups();
     if (selectOptions.value.length) {
       selectOptions.value = [];
     }

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

@@ -50,10 +50,9 @@ const enterSetPic = () => {
 let initBack = setting.value!.back;
 let initMapId = setting.value!.mapId;
 let isFirst = true;
-const changeBack = ([back, mapId]: [string | undefined, number | undefined]) => {
+const changeBack = ([back, mapId]: [string | null, number | null]) => {
   setting.value!.back = back;
   setting.value!.mapId = mapId;
-  console.log(back, mapId);
 
   if (isFirst) {
     let isSave = false;

+ 19 - 8
src/views/setting/select-back.vue

@@ -13,16 +13,25 @@
             />
           </div>
           <template #overlay>
-            <Menu :selectedKeys="[value]">
+            <Menu
+              :selectedKeys="[value]"
+              :default-active="value[1]?.toString()"
+              active-text-color="#ffd04b"
+            >
               <MenuItem
                 v-for="item in back.children"
                 @click="
-                  value[1] !== item.value &&
-                    $emit('update:value', [undefined, item.value])
+                  value[1] !== item.value && $emit('update:value', [null, item.value])
                 "
-                :key="item.value"
+                :index="item.value.toString()"
               >
-                {{ item.label }}
+                <span
+                  :style="{
+                    color:
+                      value[1] === item.value ? 'var(--colors-primary-base) ' : '#fff',
+                  }"
+                  >{{ item.label }}</span
+                >
               </MenuItem>
             </Menu>
           </template>
@@ -34,7 +43,7 @@
         :label="back.label"
         :url="back.image"
         :active="value[0] === back.value"
-        @click="value[0] !== back.value && $emit('update:value', [back.value, undefined])"
+        @click="value[0] !== back.value && $emit('update:value', [back.value, null])"
       />
     </template>
   </div>
@@ -47,9 +56,11 @@ import BackItem from "./back-item.vue";
 import { fetchMapTiles } from "@/api/map-tile";
 import { sysTiles } from "@/store";
 
-const props = defineProps<{ value: [string | undefined, number | undefined] }>();
+const props = defineProps<{
+  value: [string | null | undefined, number | null | undefined];
+}>();
 defineEmits<{
-  (e: "update:value", value: [string | undefined, number | undefined]): void;
+  (e: "update:value", value: [string | null, number | null]): void;
 }>();
 
 const backs = computed(() => [

+ 1 - 0
src/views/tagging/hot/images.vue

@@ -15,6 +15,7 @@
           @click="inFull && $emit('pull', ndx)"
         >
           <!-- v-if="ndx === index" -->
+          {{ ndx }}
           <ResourceView :data="getFileUrl(raw)" class="p-item" :focus="ndx === index" />
           <!-- <img :src="getResource(getFileUrl(raw))" /> -->
         </div>