Преглед на файлове

Merge branch 'local' of http://192.168.0.115:3000/bill/fuse-code into local

xzw преди 3 години
родител
ревизия
028d148166
променени са 6 файла, в които са добавени 31 реда и са изтрити 15 реда
  1. 2 2
      src/components/bill-ui/components/slide/index.vue
  2. 8 1
      src/sdk/association.ts
  3. 11 2
      src/sdk/sdk.ts
  4. 1 1
      src/views/guide/edit-paths.vue
  5. 7 9
      src/views/merge/index.vue
  6. 2 0
      src/views/tagging/index.vue

+ 2 - 2
src/components/bill-ui/components/slide/index.vue

@@ -6,8 +6,8 @@
             </GateContent>
         </Gate>
         <template v-if="showCtrl">
-            <span class="left" @click="prevHandler"><UIIcon type="left" /></span>
-            <span class="right" @click="nextHandler"><UIIcon type="pull-more" /></span>
+            <span class="left" @click="prevHandler"><UIIcon type="left1" /></span>
+            <span class="right" @click="nextHandler"><UIIcon type="right" /></span>
         </template>
         <slot name="attach" :active="items[index]" />
 

+ 8 - 1
src/sdk/association.ts

@@ -13,9 +13,15 @@ import {
 
 import TaggingComponent from '@/components/tagging/list.vue'
 
-import type { SDK, SceneModel, SceneGuidePath } from '.'
+import type { SDK, SceneModel, SceneGuidePath, ModelAttrRange } from '.'
 import { Model, Tagging } from '@/store'
 
+export const modelRange: ModelAttrRange  = {
+  opacityRange: { min: 0, max: 100, step: 0.1 },
+  bottomRange: { min: -30, max: 70, step: 0.1 },
+  scaleRange: { min: 0, max: 200, step: 0.1 }
+}
+
 const sceneModelMap = new WeakMap<Model, SceneModel>()
 export const getSceneModel = (model: Model | null) => model && sceneModelMap.get(toRaw(model))
 
@@ -31,6 +37,7 @@ const associationModels = (sdk: SDK) => {
       const itemRaw = toRaw(item)
       const sceneModel = sdk.addModel({
         ...itemRaw,
+        ...modelRange,
         type: ModelType.SWMX,
         url: getResource(item.url)
       })

+ 11 - 2
src/sdk/sdk.ts

@@ -29,8 +29,17 @@ export type SceneModel = ToChangeAPI<Omit<SceneModelAttrs, 'position' | 'rotatio
     leaveTransform: () => void
   }
 
+export type ModelAttrRange = {
+  [key in 'opacity' | 'bottom' | 'scale' as `${key}Range`]: {
+    min: number,
+    max: number,
+    step: number
+  }
+}
 
-export type AddModelProps = Pick<Model, 'type' | 'url' | 'id'> & ModelAttrs
+export type AddModelProps = Pick<Model, 'type' | 'url' | 'id'> 
+  & ModelAttrs 
+  & ModelAttrRange
 
 export type SceneGuidePath = Pick<GuidePath, 'position' | 'target' | 'speed' | 'time'>
 export interface SceneGuide {
@@ -87,7 +96,7 @@ export const initialSDK = async (props: InialSDKProps) => {
   await Promise.all(libs.map(loadLib))
   await loadLib(`./lib/potree/potree.js`)
 
-  const localSdk = cover(props.layout) as unknown as SDK
+  const localSdk = cover(props.layout, true) as unknown as SDK
 
   sdk = localSdk
   sdk.layout = props.layout

+ 1 - 1
src/views/guide/edit-paths.vue

@@ -19,7 +19,7 @@
     <div class="info" v-if="paths.length">
       <div class="meta">
         <div class="length">
-          <span>视频时长</span>
+          <span>视频时长</span>{{paths.reduce((t, c) => t + c.time, 0)}}s
         </div>
         <div 
           class="fun-ctrl clear" 

+ 7 - 9
src/views/merge/index.vue

@@ -8,17 +8,17 @@
         <!-- <template #icon>
           <a href="">设置比例</a>
         </template> -->
-        <ui-input type="range" v-model="custom.currentModel.scale" v-bind="scaleOption" width="100%">
+        <ui-input type="range" v-model="custom.currentModel.scale" v-bind="modelRange.scaleRange" :ctrl="false" width="100%">
           <template #icon>%</template>
         </ui-input>
       </ui-group-option>
       <ui-group-option label="离地高度">
-        <ui-input type="range" v-model="custom.currentModel.bottom" v-bind="bottomOption" width="100%">
+        <ui-input type="range" v-model="custom.currentModel.bottom" v-bind="modelRange.bottomRange" :ctrl="false" width="100%">
           <template #icon>m</template>
         </ui-input>
       </ui-group-option>
       <ui-group-option label="模型不透明度">
-        <ui-input type="range" v-model="custom.currentModel.opacity" v-bind="opacityOption" width="100%">
+        <ui-input type="range" v-model="custom.currentModel.opacity" v-bind="modelRange.opacityRange" :ctrl="false" width="100%">
           <template #icon>%</template>
         </ui-input>
       </ui-group-option>
@@ -37,7 +37,7 @@ import { RightPano } from '@/layout'
 import { autoSaveModels, ModelAttrs } from '@/store'
 import { togetherCallback } from '@/utils'
 import Actions from '@/components/actions/index.vue'
-import { getSceneModel } from '@/sdk'
+import { getSceneModel, modelRange } from '@/sdk'
 import { useViewStack } from '@/hook'
 import { showLeftCtrlPanoStack, showLeftPanoStack, custom, modelsChangeStoreStack } from '@/env'
 import { ref, nextTick } from 'vue'
@@ -52,15 +52,13 @@ useViewStack(() => {
 })
 const defaultAttrs: ModelAttrs = {
   show: true,
-  scale: 1,
-  opacity: 1,
+  scale: 100,
+  opacity: 100,
   bottom: 0,
   position: {x: 0, y: 0, z: 0},
   rotation: {x: 0, y: 0, z: 0}
 }
-const opacityOption = { min: 0, max: 100, step: 0.01, ctrl: false }
-const bottomOption = { min: -30, max: 70, step: 0.1, ctrl: false }
-const scaleOption = { min: 0, max: 200, step: 0.01, ctrl: false }
+
 const actionItems: ActionsProps['items'] = [
   {
     icon: 'move',

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

@@ -93,6 +93,8 @@ const saveHandler = (tagging: Tagging) => {
 
 const deleteTagging = (tagging: Tagging) => {
   const index = taggings.value.indexOf(tagging)
+  const positions = getTaggingPositions(tagging)
+  taggingPositions.value = taggingPositions.value.filter(position => !positions.includes(position))
   taggings.value.splice(index, 1)
 }