bill vor 3 Jahren
Ursprung
Commit
50a8faeb12

+ 2 - 0
src/components/tagging/sign.vue

@@ -5,6 +5,7 @@
     :style="posStyle" 
     @mouseenter="isHover = true"
     @mouseleave="isHover = false"
+    :class="{active: showContent}"
   >
     <ui-tip :tip="tagging.title" foreShow tipV="top" class="tag-tip">
       <img 
@@ -175,6 +176,7 @@ const iconClickHandler = () => {
   z-index: 8 !important;
 }
 .tag-tip p {
+  padding: 6px 10px !important;
   margin: 5px 0 !important;
 }
 </style>

+ 1 - 0
src/layout/model-list/sign.vue

@@ -12,6 +12,7 @@
     </div>
   </div>
   <div class="model-desc" @click="$emit('click')" v-if="custom.currentModel === model">
+  {{custom.currentModel.title}}
     <p><span>数据来源:</span>{{ ModelTypeDesc[model.type] }}</p>
     <p><span>数据大小:</span>{{ model.size }}</p>
     <p v-if="model.type === ModelType.SWSS"><span>拍摄时间:</span>{{ model.time }}</p>

+ 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>{{paths.reduce((t, c) => t + c.time, 0)}}s
+          <span>视频时长</span>{{paths.reduce((t, c) => t + c.time, 0).toFixed(1)}}s
         </div>
         <div 
           class="fun-ctrl clear" 

+ 2 - 4
src/views/tagging/edit.vue

@@ -207,13 +207,11 @@ const delImageHandler = async (file: Tagging['images'][number]) => {
   z-index: 2000;
   padding: 20px;
   overflow-y: auto;
-  display: flex;
-  justify-content: center;
+
 }
 
 .edit-hot-item {
-  margin-top: 100px;
-  margin-bottom: 20px;
+  margin: 100px auto 20px;
   width: 400px;
   padding: 20px;
   background: rgba(27, 27, 28, 0.8);

+ 18 - 24
src/views/tagging/index.vue

@@ -49,9 +49,9 @@ import Edit from './edit.vue'
 import TagingSign from './sign.vue'
 import { Message } from 'bill/index'
 import { RightFillPano } from '@/layout'
-import { togetherCallback } from '@/utils'
+import { asyncTimeout, togetherCallback } from '@/utils'
 import { useViewStack } from '@/hook'
-import { computed, ref, watch } from 'vue';
+import { computed, nextTick, ref, watch } from 'vue';
 import { sdk } from '@/sdk'
 import { 
   taggings, 
@@ -65,7 +65,8 @@ import {
   getModelShowVariable,
   getTaggingPositions,
   taggingPositions,
-  createTaggingPosition
+  createTaggingPosition,
+models
 } from '@/store'
 import { 
   custom, 
@@ -148,37 +149,30 @@ watch(selectTagging, (a, b, onCleanup) => {
   if (selectTagging.value) {
     const leave = () => selectTagging.value = null
 
-    let currentModel: Model | null = custom.currentModel
-    if (!currentModel) {
-      for (const [model, show] of custom.showModelsMap.entries()) {
-        show && (currentModel = model)
-      }
-      if (!currentModel) {
-        Message.error('请显示要添加热点的模型') 
-        leave()
-        return
-      }
-    }
-
     const pop = togetherCallback([
       showLeftCtrlPanoStack.push(ref(true)), 
       showLeftPanoStack.push(ref(true)),
-      currentModelStack.push(ref(currentModel)),
       showRightCtrlPanoStack.push(ref(false)),
       showRightPanoStack.push(ref(false))
     ])
 
-    const clickHandler = (ev: MouseEvent) => {
-      const position = sdk.getPositionByScreen({
-        x: ev.clientX,
-        y: ev.clientY
-      }, custom.currentModel?.id)
-
-      if (!position) {
+    const clickHandler = async (ev: MouseEvent) => {
+      await nextTick()
+      await asyncTimeout()
+      const positions = models.value.
+        map(model => 
+          sdk.getPositionByScreen({
+            x: ev.clientX,
+            y: ev.clientY
+          }, model.id)
+        )
+        .filter(pos => pos)
+
+      if (!positions.length) {
         Message.error('当前位置无法添加')
       } else if (selectTagging.value) {
         const storePosition = createTaggingPosition({
-          ...position,
+          ...positions[0],
           taggingId: selectTagging.value.id
         })
         taggingPositions.value.push(storePosition)