瀏覽代碼

修改需求

bill 2 年之前
父節點
當前提交
f113a898c2

+ 2 - 2
src/api/mesasure.ts

@@ -39,7 +39,7 @@ const toLocal = (serviceMeasure: ServiceMeasure) : Measure => ({
   fusionId: serviceMeasure.fusionId,
   title: serviceMeasure.meterTitle,
   desc: serviceMeasure.length.toString(),
-  positions: JSON.parse(serviceMeasure.position),
+  positions: JSON.parse(serviceMeasure.position).map((pos: any) => ({modelId: pos.fusionNumId, ...pos})),
   type: serviceMeasure.meterType === ServiceMeasureType.area 
     ? MeasureType.area
     : serviceMeasure.meterType === ServiceMeasureType.vertical
@@ -56,7 +56,7 @@ const toService = (measure: Measure, isUpdate = true): PartialProps<ServiceMeasu
     : measure.type === MeasureType.vertical
     ? ServiceMeasureType.vertical
     : ServiceMeasureType.free,
-  position: JSON.stringify(measure.positions),
+  position: JSON.stringify(measure.positions.map(item => ({...item, modelId: undefined, fusionNumId: item.modelId}))),
   length: Number(measure.desc),
 
 })

+ 4 - 3
src/api/tagging-position.ts

@@ -12,7 +12,8 @@ import type { Tagging } from './tagging'
 interface ServicePosition {
   "tagPointId": number,
   "tagId": number,
-  "modelId": number
+  "fusionNumId": number
+  "modelId"?: number
   "tagPoint": string,
 }
 
@@ -28,7 +29,7 @@ export type TaggingPositions = TaggingPosition[]
 
 const serviceToLocal = (position: ServicePosition, taggingId?: Tagging['id']): TaggingPosition => ({
   id: position.tagPointId.toString(),
-  modelId: position.modelId ? position.modelId.toString() : '123123',
+  modelId: position.fusionNumId ? position.fusionNumId.toString() : position.modelId ? position.modelId.toString() : '123123',
   taggingId: taggingId || position.tagId.toString(),
   localPos: JSON.parse(position.tagPoint)
 })
@@ -36,7 +37,7 @@ const serviceToLocal = (position: ServicePosition, taggingId?: Tagging['id']): T
 const localToService = (position: TaggingPosition, update = false): PartialProps<ServicePosition, 'tagPointId'> => ({
   "tagPointId": update ? Number(position.id) : undefined,
   "tagId": Number(position.taggingId),
-  "modelId": Number(position.modelId),
+  "fusionNumId": Number(position.modelId),
   "tagPoint": JSON.stringify(position.localPos),
 })
 

+ 4 - 0
src/layout/edit/scene-select.vue

@@ -79,6 +79,7 @@ const rowSelection: any = ref({
 })
 const cloumns = [
   {
+    width: "400px",
     title: '名称',
     dataIndex: 'name',
     key: 'name',
@@ -157,4 +158,7 @@ watch(visible, (visible, oldvisible) => {
     color: @primary-color;
   }
 }
+.ant-modal-root .ant-table-tbody > tr > td {
+  word-break: break-all;
+}
 </style>

+ 3 - 3
src/layout/show/slide-menu.vue

@@ -16,11 +16,11 @@ import { metas, RoutesName, router, getRouteConfig } from '@/router'
 import { views, records, floders } from '@/store';
 import { computed } from 'vue';
 
-import type { RouteRecordRaw } from '@/router'
+import type { RouteRaw } from '@/router'
 
 export type MenuItem = {
   name: RoutesName,
-  config: RouteRecordRaw,
+  config: RouteRaw,
 } & (typeof metas)[keyof typeof metas]
 
 defineProps<{ activeName: RoutesName }>()
@@ -72,7 +72,7 @@ const items = computed(() => {
   background-color: var(--editor-menu-back);
   position: fixed;
   left: var(--editor-menu-left);
-  top: var(--editor-head-height);
+  top: calc(var(--editor-head-height) + var(--header-top));
   bottom: 0;
   z-index: 2000;
   overflow: hidden;

+ 2 - 3
src/router/config.ts

@@ -1,8 +1,7 @@
 import { RoutesName, paths, metas } from './constant'
 
-import type { RouteRecordRaw } from 'vue-router'
-
-export const routes: RouteRecordRaw[] = [
+export type RouteRaw = (typeof routes)[number]
+export const routes = [
   {
     path: paths[RoutesName.fuseEdit],
     name: RoutesName.fuseEdit,

+ 8 - 9
src/router/index.ts

@@ -4,12 +4,12 @@ import { computed } from 'vue'
 import { RoutesName } from './constant'
 import { metas } from './constant'
 
-import type { RouteRecordRaw, RouteRecordName } from 'vue-router'
+import { RouteRaw } from './config'
 
 export const history = createWebHashHistory()
 export const router = createRouter({ history, routes })
 
-export const getRouteTree = (name: RouteRecordName, raw: RouteRecordRaw[] = routes): void | RouteRecordRaw => {
+export const getRouteTree = (name: RoutesName, raw: RouteRaw[] = routes): void | RouteRaw => {
   for (const route of raw) {
     if (route.name === name) {
       return route
@@ -22,9 +22,9 @@ export const getRouteTree = (name: RouteRecordName, raw: RouteRecordRaw[] = rout
   }
 }
 
-export const getRouteNames = (name: RouteRecordName, raw: RouteRecordRaw[] = routes): RouteRecordName[] => {
+export const getRouteNames = (name: RoutesName, raw: RouteRaw[] = routes): RoutesName[] => {
   let current = getRouteTree(name, raw)
-  const names: RouteRecordName[] = []
+  const names: RoutesName[] = []
   while (current) {
     names.push(current.name!)
     current = current.children && current.children[0]
@@ -32,15 +32,15 @@ export const getRouteNames = (name: RouteRecordName, raw: RouteRecordRaw[] = rou
   return names
 }
 
-export const getRouteConfig = (name: RouteRecordName, raw: RouteRecordRaw[] = routes): RouteRecordRaw | void => {
+export const getRouteConfig = (name: RoutesName, raw: RouteRaw[] = routes): RouteRaw | void => {
   let current = getRouteTree(name, raw)
-  while (current) {
-    current = current.children && current.children[0]
+  while (current?.children && current.children[0]) {
+    current = current.children[0]
   }
   return current
 }
 
-export const currentRouteNames = computed(() => getRouteNames(router.currentRoute.value.name!, routes))
+export const currentRouteNames = computed(() => getRouteNames(router.currentRoute.value.name as RoutesName, routes))
 
 export const currentLayout = computed(() => {
   const names = currentRouteNames.value
@@ -57,6 +57,5 @@ export const currentMeta = computed(() => {
 
 export * from './config'
 export * from './constant'
-export type { RouteRecordRaw }
 
 export default router

+ 2 - 2
src/sdk/association.ts

@@ -352,7 +352,7 @@ const fullView = async (fn: () => void) => {
 }
 
 export const isScenePlayIng = ref(false)
-export const playSceneGuide = async (paths: SceneGuidePath[], changeIndexCallback?: (index: number) => void) => {
+export const playSceneGuide = async (paths: SceneGuidePath[], changeIndexCallback?: (index: number) => void, forceFull = false) => {
   if (isScenePlayIng.value) {
     throw new Error('导览正在播放')
   }
@@ -363,7 +363,7 @@ export const playSceneGuide = async (paths: SceneGuidePath[], changeIndexCallbac
   changeIndexCallback && sceneGuide.bus.on('changePoint', changeIndexCallback)
 
   const quitHandler = () => (isScenePlayIng.value = false)
-  const clearHandler = isEdit.value ? null : await fullView(quitHandler)
+  const clearHandler = !forceFull && isEdit.value ? null : await fullView(quitHandler)
   if (!clearHandler) {
     sysBus.on('leave', quitHandler, { last: true })
     sysBus.on('save', quitHandler, { last: true })

+ 1 - 1
src/views/guide/sign.vue

@@ -7,7 +7,7 @@
           type="preview" 
           class="icon" 
           ctrl 
-          @click="playSceneGuide(paths)" 
+          @click="playSceneGuide(paths, undefined, true)" 
           v-if="paths.length" 
         />
       </div>

+ 17 - 11
src/views/measure/sign.vue

@@ -41,8 +41,9 @@ import { getSceneMeasure, getSceneMeasureDesc } from '@/sdk'
 import { useFocus } from 'bill/hook/useFocus'
 
 import type { Measure } from '@/store'
-import { computed, ref, watchEffect } from 'vue';
+import { computed, ref, watch, watchEffect } from 'vue';
 import { Message } from 'bill/index';
+import { custom } from '@/env';
 
 const props = withDefaults(
   defineProps<{ measure: Measure, edit?: boolean }>(),
@@ -74,15 +75,16 @@ watchEffect(() => {
 const fly = () => {
   getSceneMeasure(props.measure)?.fly()
 }
-const desc = computed(() => {
-  const smeasure = getSceneMeasure(props.measure)
-  console.log(smeasure)
-  if (smeasure) {
-    return getSceneMeasureDesc(smeasure, props.measure)
-  } else {
-    return '-'
-  }
-})
+const desc = ref('-')
+watch(
+  () => [props.measure, custom.showMeasures, custom.showModelsMap], 
+  () => {
+    const smeasure = getSceneMeasure(props.measure)
+    desc.value = smeasure ? getSceneMeasureDesc(smeasure, props.measure) : '-'
+  }, 
+  { deep: true, flush: 'post', immediate: true }
+)
+
 </script>
 
 <style lang="scss" scoped>
@@ -144,6 +146,10 @@ const desc = computed(() => {
     }
   }  
 }
+</style>
 
-
+<style>
+.view-title-input.ui-input .text.suffix input {
+  padding-right: 50px;
+}
 </style>

+ 70 - 7
src/views/record/shot-imitate.vue

@@ -1,17 +1,80 @@
 <template>
-  <slideMenu :activeName="activeName" @change-item="item => activeName = item.name" />
-    <!-- 123123123 -->
-  <component :is="component"></component>
+  <div class="imiate">
+    <div :class="{ hideLeft: !custom.showLeftPano }">
+      <slideMenu :activeName="activeName" @change-item="item => activeName = item.name" />
+      <component :is="component" v-if="component"></component>
+    </div>
+  </div>
 </template>
 
 <script lang="ts" setup>
+import { useViewStack } from '@/hook';
 import slideMenu from '@/layout/show/slide-menu.vue';
 import { getRouteConfig, RoutesName } from '@/router'
-import { computed, ref } from 'vue';
+import { ref, shallowRef, watch, watchEffect } from 'vue';
+import { togetherCallback } from '@/utils'
+import { 
+  custom,
+  showLeftCtrlPanoStack, 
+  showLeftPanoStack,
+  showRightCtrlPanoStack,
+  showRightPanoStack
+} from '@/env'
+
+import type { Component } from 'vue'
+import { currentModel } from '@/model';
 
 const activeName = ref(RoutesName.summaryShow)
-const component = computed(() => {
+const component = shallowRef<Component | null>(null)
+
+watchEffect(() => {
   const route = getRouteConfig(activeName.value)
-  return route?.component
+  route?.component().then(comp => component.value = comp.default)
+})
+
+const showLeftPano = ref(false)
+
+watch(currentModel, () => {
+  if (currentModel.value) {
+    showLeftPano.value = false
+  }
+})
+
+useViewStack(() => {
+  const style = document.createElement('style')
+  style.type = 'text/css'
+  style.textContent = `
+    #app  {
+      --editor-menu-width: 80px;
+    }
+    #app .edit-mode {
+      --editor-menu-left: 0px;
+    }
+    #app .hideLeft {
+      --editor-menu-left: calc(-1 * var(--editor-menu-width));
+      --left-pano-left: calc(var(--editor-menu-left) + var(--editor-menu-width) - var(--left-pano-width)) !important
+    }
+    #app .ctrl-pano-c,
+    #app .left-pano,
+    #app .ui-editor-toolbox {
+      display: none;
+    }
+    #app .imiate .ctrl-pano-c,
+    #app .imiate .ui-editor-toolbox {
+      display: flex;
+    }
+    #app .imiate .left-pano {
+      display: block;
+    }
+  `
+  document.head.appendChild(style)
+
+  return togetherCallback([
+    showLeftCtrlPanoStack.push(ref(true)), 
+    showLeftPanoStack.push(showLeftPano),
+    showRightCtrlPanoStack.push(ref(true)),
+    showRightPanoStack.push(ref(false)),
+    () => document.head.removeChild(style)
+  ])
 })
-</script>
+</script>

+ 20 - 18
src/views/record/shot.vue

@@ -1,9 +1,9 @@
 <template>
   <teleport :to="appEl" v-if="appEl">
-    <div class="countdown strengthen" v-if="!custom.showBottomBar && countdown">
+    <!-- <div class="countdown strengthen" v-if="!custom.showBottomBar && countdown">
       <p class="title"><span>{{countdown}}</span>秒后开始录制</p>
       <p>按ESC可暂停录制</p>
-    </div>
+    </div> -->
 
     <ui-editor-toolbar :toolbar="custom.showBottomBar" class="shot-ctrl">
       <ui-button type="submit" class="btn" @click="close">取消</ui-button>
@@ -32,7 +32,7 @@
       @close="palyUrl = null" 
     />
 
-    <ShotImiate v-if="!custom.showBottomBar" />
+    <ShotImiate v-if="!custom.showBottomBar && !countdown" />
   </teleport>
 </template>
 
@@ -91,14 +91,14 @@ export default defineComponent({
     let recordIng = false
     const start = () => {
       showBottomBar.value = false
-      countdown.value = 1
+      countdown.value = 2
       const timeiffe = () => {
-        if (--countdown.value === 0) {
+        if (--countdown.value <= 0) {
           clearInterval(interval)
           videoRecorder.startRecord()
           recordIng = true
         } else {
-          interval = setTimeout(timeiffe, 1000)
+          interval = setTimeout(timeiffe, 300)
         }
       }
       timeiffe()
@@ -182,18 +182,20 @@ export default defineComponent({
         showLeftPano.value = false
       }
     })
-    useViewStack(() => togetherCallback([
-      showHeadBarStack.push(ref(false)),
-      showRightCtrlPanoStack.push(ref(false)),
-      showRightPanoStack.push(ref(false)),
-      showBottomBarStack.push(showBottomBar),
-      bottomBarHeightStack.push(barHeight),
-      showLeftPanoStack.push(showLeftPano),
-      close,
-      () => {
-        console.log('pop', showBottomBarStack.current)
-      }
-    ]))
+    useViewStack(() => {
+      return togetherCallback([
+        showHeadBarStack.push(ref(false)),
+        showRightCtrlPanoStack.push(ref(false)),
+        showRightPanoStack.push(ref(false)),
+        showBottomBarStack.push(showBottomBar),
+        bottomBarHeightStack.push(barHeight),
+        showLeftPanoStack.push(showLeftPano),
+        close,
+        () => {
+          console.log('pop', showBottomBarStack.current)
+        }
+      ])
+    })
 
     return {
       MediaType,

+ 5 - 2
src/views/record/show.vue

@@ -3,7 +3,7 @@
   <LeftPano>
     <ui-group class="pano-group">
       <Sign 
-        v-for="record in records" 
+        v-for="record in filterRecords" 
         :record="record"
         :key="record.id" 
         :edit="false"
@@ -14,8 +14,11 @@
 
 <script setup lang="ts">
 import Sign from './sign.vue'
-import { records } from '@/store'
+import { isTemploraryID, records } from '@/store'
 import { LeftPano } from '@/layout'
+import { computed } from 'vue';
+
+const filterRecords = computed(() => records.value.filter(record => !isTemploraryID(record.id)))
 
 </script>
 

+ 0 - 12
src/views/registration/index.vue

@@ -118,18 +118,6 @@ watchEffect((onCleanup) => {
   }
 })
 
-useViewStack(() => {
-  const style = document.createElement('style')
-  style.type = 'text/css'
-  style.textContent = `
-    .scene-canvas #direction {
-      right: 50% !important;
-    }
-  `
-  document.head.appendChild(style)
-
-  return () => document.head.removeChild(style)
-})
 
 useViewStack(() => () => {
   if (selectOptions.value.length) {

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

@@ -1,6 +1,6 @@
 <template>
   <RightFillPano>
-    <ui-group :title="`标注${tagging?.title}放置位置`" class="position-group">
+    <ui-group :title="`${tagging?.title}放置位置`" class="position-group">
       <PositionSign 
         v-for="(position, i) in positions" 
         :key="position.id"