bill 2 anni fa
parent
commit
2fff625936

+ 2 - 0
package.json

@@ -10,6 +10,7 @@
     "preview": "vite preview"
   },
   "dependencies": {
+    "@lk77/vue3-color": "^3.0.6",
     "@types/express": "^4.17.17",
     "axios": "^1.3.5",
     "body-parser": "^1.20.2",
@@ -18,6 +19,7 @@
     "driver.js": "^0.9.8",
     "express-fileupload": "^1.4.0",
     "html2canvas": "^1.4.1",
+    "install": "^0.13.0",
     "js-base64": "^3.7.5",
     "jspdf": "^2.5.1",
     "mitt": "^3.0.0",

File diff suppressed because it is too large
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 5 - 1
src/components/base/assets/scss/components/_slide.scss

@@ -3,8 +3,12 @@
   position: relative;
   height: 100%;
 
+
   &.stop-animation .ui-gate-slides{
     transition: none;
+    .ui-gate-content {
+      transition: none !important;
+    }
   }
 
   .right,
@@ -56,4 +60,4 @@
       }
     }
   }
-}
+}

+ 11 - 1
src/components/base/components/input/color.vue

@@ -1,6 +1,15 @@
 <template>
     <div class="color input" :class="{ default: !$slots.replace }" :style="{ width, height }">
-        <input :name="name" :disabled="disabled" :id="id" :value="props.modelValue" type="color" class="replace-input" :checked="props.modelValue" @input="inputHandler" />
+        <input
+            :name="name"
+            :disabled="disabled"
+            :id="id"
+            :value="props.modelValue"
+            type="color"
+            class="replace-input"
+            :checked="props.modelValue"
+            @input="inputHandler"
+        />
         <span class="replace" v-if="$slots.replace">
             <slot name="replace"></slot>
         </span>
@@ -15,6 +24,7 @@ const props = defineProps(colorPropsDesc)
 const emit = defineEmits(['update:modelValue'])
 const id = randomId(4)
 
+
 const inputHandler = ev => {
     emit('update:modelValue', ev.target.value)
     nextTick(() => {

+ 15 - 6
src/components/base/components/slide/index.vue

@@ -125,7 +125,7 @@ const mousedownHandler = ev => {
 }
 
 let prevent = false
-const openPrevent = (fn) => {
+const openPrevent = (fn, fnend) => {
     prevent = true
     setTimeout(() => {
         stopAmimation.value = true
@@ -134,29 +134,38 @@ const openPrevent = (fn) => {
             setTimeout(() => {
                 stopAmimation.value = false
                 prevent = false
-            }, 50)
+                fnend && fnend()
+            }, 300)
         })
     }, 300)
 }
 const prevHandler = () => {
     if (prevent) return;
     if (index.value === 0) {
+        extendIndex.value--
         openPrevent(() => {
             extendIndex.value = extendLength.value + props.items.length  - 1
+        }, () => {
+            emit('change', index.value)
         })
+    } else {
+        extendIndex.value--
+        emit('change', index.value)
     }
-    extendIndex.value--
-    emit('change', index.value)
 }
 const nextHandler = () => {
     if (prevent) return;
     if (index.value === props.items.length - 1) {
+        extendIndex.value++
         openPrevent(() => {
             extendIndex.value = extendLength.value
+        }, () => {
+            emit('change', index.value)
         })
+    } else {
+        extendIndex.value++
+        emit('change', index.value)
     }
-    extendIndex.value++
-    emit('change', index.value)
 }
 </script>
 

+ 86 - 0
src/components/color/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="color-layout" @click.stop>
+    <div v-if="show" class="color-model">
+      <Sketch
+          :modelValue="color"
+          :presetColors="presetColors"
+          @update:modelValue="data => $emit('update:color', data.hex8)"
+      />
+    </div>
+    <div @click.stop="show = !show">
+      <slot/>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import {Sketch} from '@lk77/vue3-color'
+import {ref, watchEffect} from "vue";
+
+defineProps<{ color: string }>()
+defineEmits<{ (e: "update:color", color: string): void }>()
+const presetColors = [
+  '#f00', '#00ff00', '#00ff0055', 'rgb(201, 76, 76)', 'rgba(0,0,255,1)', 'hsl(89, 43%, 51%)', 'hsla(89, 43%, 51%, 0.6)'
+]
+const show = ref(false)
+
+watchEffect((onCleanup) => {
+  if (show.value) {
+    const handler = () => {
+      show.value = false
+    }
+    document.documentElement.addEventListener("click", handler)
+    onCleanup(() => {
+      document.documentElement.removeEventListener("click", handler)
+    })
+  }
+})
+</script>
+
+<style lang="scss" scoped>
+
+.color-layout {
+  position: relative;
+
+  .color-model {
+    position: absolute;
+    bottom: calc(100% + 20px);
+    left: 50%;
+    transform: translateX(-50%);
+  }
+}
+</style>
+<style lang="scss">
+body {
+  .vc-sketch-alpha-wrap,
+  .vc-sketch-field--single,
+  .vc-sketch-field {
+    display: none !important;
+  }
+
+  .vc-sketch {
+    /*background-color: #000;*/
+    width: 455px !important;
+  }
+
+  .vc-sketch-presets-color {
+    width: 48px;
+    height: 48px;
+  }
+
+  .vc-hue-picker {
+    width: 14px;
+    height: 22px;
+  }
+
+  .vc-sketch-alpha-wrap, .vc-sketch-hue-wrap {
+    height: 24px;
+  }
+
+  .vc-saturation-circle {
+    width: 24px;
+    height: 24px;
+    transform: translate(-12px, -12px);
+  }
+}
+</style>

+ 1 - 1
src/components/main-panel/index.vue

@@ -107,4 +107,4 @@ const layoutClass = computed(() => ({
 .fill {
   left: calc(-1 * var(--editor-menu-width))
 }
-</style>
+</style>

+ 1 - 1
src/graphic/CanvasStyle/ImageLabels/SVGIcons.js

@@ -601,7 +601,7 @@ const SVGIcons = {
     }
 
   }, "huoche_p.svg": {
-    text: "货车平面",
+    text: "货车平面",
     draw: function (ctx, fillStyle, strokeStyle) {
       ctx.save();
       //// ctx.strokeStyle = "rgba(0,0,0,0)";

+ 4 - 2
src/graphic/Load.js

@@ -65,9 +65,9 @@ export default class Load {
           );
           magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
           magnifier.setDisplay(dataLocal.magnifiers[key].display);
-     
+
           magnifier.setPopPosition(null,dataLocal.magnifiers[key].popPosition)
-      
+
           try {
             if (dataLocal.magnifiers[key].photoUrl) {
               await magnifier.setImageData();
@@ -171,6 +171,8 @@ export default class Load {
       }
       if(dataLocal.curveRoads){
         for (let key in dataLocal.curveRoads) {
+          console.log(dataLocal.curveRoads[key].points)
+          console.log(mathUtil.getCurvesByPoints(dataLocal.curveRoads[key].points, 0.2))
           let curveRoad = curveRoadService.create(
             dataLocal.curveRoads[key].startId,
             dataLocal.curveRoads[key].endId,

+ 1 - 0
src/graphic/Renderer/Draw.js

@@ -248,6 +248,7 @@ const help = {
       // 单实线
       case VectorStyle.DoubleDashedLine:
       case VectorStyle.DoubleSolidLine:
+        ctx.lineWidth = lineWidth;
         if (style === VectorStyle.DoubleDashedLine) {
           ctx.setLineDash([8 * coordinate.ratio, 8 * coordinate.ratio]);
         }

+ 1 - 0
src/graphic/enum/UIEvents.js

@@ -29,6 +29,7 @@ const UIEvents = {
   // 综合定位法
   AllLocationMode: "AllLocationMode",
 
+  FixPoint: "fixpoint",
   // 文字
   Text: "text", //这个是标注,暂时这样
   //svg

+ 1 - 1
src/main.ts

@@ -1,5 +1,5 @@
 import VConsole from 'vconsole';
-if (import.meta.env.MODE !== "production") {
+if (import.meta.env.MODE === "test") {
   if (!os.isPc) {
     new VConsole();
   }

+ 2 - 1
src/sdk/carry/measures/index.vue

@@ -13,13 +13,14 @@ import MeasureItem from './item.vue'
 import { propsKey, laserKey } from '../constant'
 import { inject, computed, ref, watch } from 'vue'
 import {MeasureUnit} from "@/sdk";
+import {tempMeasures} from "@/store/measure";
 
 const props = inject(propsKey)
 const laser = inject(laserKey)
 const refs = ref([])
 const measureMap = props.measureMap
 
-const measure = computed(() => [...props.store.measure.list, ...props.store.baseLine.baseLines])
+const measure = computed(() => [...props.store.measure.list, ...props.store.measure.tempMeasures, ...props.store.baseLine.baseLines])
 
 watch(
   refs,

+ 1 - 0
src/sdk/types/store.ts

@@ -2,6 +2,7 @@ import { MeasuresRaw, MeasureUnit } from '@/sdk'
 
 export type Store = {
     measure?: {
+        tempMeasures: MeasuresRaw
         list: MeasuresRaw
         unit: MeasureUnit
     },

+ 2 - 0
src/store/measure.ts

@@ -7,12 +7,14 @@ export * from "@/sdk/types/measure";
 
 export const list: Measures = ref([]);
 
+export const tempMeasures: Measures = ref([])
 export const show = ref(false);
 export const unit = ref<MeasureUnit>(
   Number(useParams().unit) || MeasureUnit.meter
 );
 export const store = reactive({
   list,
+  tempMeasures,
   show,
   unit,
 });

+ 16 - 4
src/store/sync.ts

@@ -12,9 +12,20 @@ import {params} from "@/hook";
 import router, {writeRouteName} from "@/router";
 import {baseURL} from "@/dbo/main";
 import {defaultUses, uses} from '@/store/SVGLabel'
+import {imageRotate} from "@/utils/image-rotate";
 
 const global = window as any;
 
+const normalImage = async (url: string) => {
+  const getUrl = await api.getFile(url)
+  const blob = await imageRotate(getUrl)
+  if (!blob) {
+    return url
+  } else {
+    return await api.uploadImage(new File([blob], getId()))
+  }
+}
+
 let count = 0;
 export const api =
   !global.android
@@ -70,7 +81,8 @@ export const api =
             })
           })
 
-          return await this.uploadImage(file)
+          const url = await this.uploadImage(file)
+          return await normalImage(url);
         },
         async selectPhotoAlbum() {
           return await this.photograph()
@@ -167,7 +179,7 @@ export const api =
             const apiName = `photograph${count++}`
             global[apiName] = (data) => {
               console.log("拍照后路径:", data)
-              resolve(data);
+              normalImage(data).then(resolve);
               delete global[apiName]
             }
             global.android.cameraPhotograph(params.m, apiName);
@@ -178,7 +190,7 @@ export const api =
             const apiName = `selectPhotoAlbum${count++}`
             global[apiName] = (data) => {
               console.log("获得相册图片路径:", data)
-              resolve(data);
+              normalImage(data).then(resolve);
               delete global[apiName]
             }
             global.android.selectPhotoAlbum(params.m, apiName);
@@ -193,7 +205,7 @@ export const api =
       };
 
 export const back = () => {
-  api.closePage()
+  router.back()
 };
 
 const loadStore = async () => {

+ 39 - 0
src/utils/image-rotate.ts

@@ -0,0 +1,39 @@
+
+
+export const imageRotate = async (url: string, direction: "row" | "column" = "row"): Promise<void | Blob> => {
+  const img = new Image()
+  img.src = url
+  await new Promise(resolve => img.onload = resolve);
+
+  let width = img.width
+  let height = img.height
+  if (width > height) {
+    if (direction === 'row') {
+      return;
+    }
+    width = img.height
+    height = img.width
+  } else {
+    if (direction === "column") {
+      return
+    }
+    width = img.height
+    height = img.width
+  }
+
+  const canvas = document.createElement("canvas");
+  canvas.width = width
+  canvas.height = height
+  const ctx = canvas.getContext("2d")
+
+  const center = direction === "row"
+    ? [img.width / 2, height / 2]
+    : [img.height / 2, width / 2]
+  console.log(img.width, img.height, width, height, center)
+  ctx.translate(center[0], center[1])
+  ctx.rotate((direction === "row" ? -1 : 1) * Math.PI / 2)
+  ctx.translate(-center[0], -center[1])
+  ctx.drawImage(img, 0, 0)
+
+  return await new Promise<Blob>(resolve => canvas.toBlob(resolve, "image/png", 1))
+}

+ 1 - 1
src/views/accidents/print.vue

@@ -1,7 +1,7 @@
 <template>
   <MainPanel>
     <template v-slot:header>
-      <Header  title="生成A4" type="return">
+      <Header  title="生成A4" type="return" :onBack="() => router.back()">
         <ui-button
             type="primary"
             @click="saveHandler"

+ 6 - 3
src/views/graphic/childMenus.vue

@@ -10,7 +10,7 @@
         :key="menu.key"
         class="menu"
         :class="{active: uiType.current === menu.key}"
-        @click="uiType.change(menu.key as any)"
+        @click="clickHandler(menu)"
       >
         <ui-icon :type="menu.icon" class="icon" />
         <p>{{ menu.text }}</p>
@@ -28,8 +28,11 @@ import {computed} from "vue";
 const props = defineProps<{ menus: MenusRaw }>();
 const title = computed(() => findMainMenuByAttr(props.menus)?.text)
 
-defineEmits<{ (e: "quit") }>();
-
+const emit = defineEmits<{ (e: "quit") }>();
+const clickHandler = (menu) => {
+  uiType.change(menu.key as any)
+  emit("quit")
+}
 </script>
 
 <style lang="scss" scoped>

+ 6 - 4
src/views/graphic/geos/arrow.vue

@@ -2,8 +2,9 @@
   <GeoTeleport :menus="menus" class="geo-teleport-use" :active="typeMenus && menus[1]">
     <template v-slot="{ data }">
       <template v-if="data.key === 'color'">
-        <ui-input type="color" class="geo-input" v-model="color" />
-        <span class="color" :style="{backgroundColor: color}"></span>
+        <Color v-model:color="color">
+          <span class="color" :style="{backgroundColor: color}"></span>
+        </Color>
       </template>
     </template>
   </GeoTeleport>
@@ -12,13 +13,12 @@
 
 <script setup lang="ts">
 import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
-import UiInput from "@/components/base/components/input/index.vue";
-import UiIcon from "@/components/base/components/icon/index.vue";
 import {drawRef, FocusVector, uiType, UIType, useChange} from '@/hook/useGraphic'
 import {computed, ref, UnwrapRef, watch, watchEffect} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import GeoActions from "@/graphic/enum/GeoActions"
 import {debounce} from "@/utils";
+import Color from '@/components/color/index.vue'
 import VectorCategory from "@/graphic/enum/VectorCategory";
 
 const props = defineProps<{geo: FocusVector}>()
@@ -104,6 +104,7 @@ if (props.geo.category === VectorCategory.Line.NormalLine) {
   height: 18px;
   border: 2px solid #fff;
   border-radius: 50%;
+  display: inline-block;
 }
 
 .icon {
@@ -123,6 +124,7 @@ if (props.geo.category === VectorCategory.Line.NormalLine) {
 .type-geo {
   margin-bottom: 74px;
 }
+
 </style>
 
 <style lang="scss">

+ 1 - 1
src/views/graphic/geos/geo-teleport.vue

@@ -94,7 +94,7 @@ defineProps<{ menus: Menu[], active?: Menu }>()
   display: flex;
   align-items: center;
   justify-content: center;
-  overflow-y: hidden;
+  //overflow-y: hidden;
 }
 
 </style>

+ 1 - 1
src/views/graphic/geos/normalLine.vue

@@ -61,7 +61,7 @@ const lineTypeMenu = [
     text: "点画线",
     onClick: clickHandlerFactory(VectorStyle.PointDrawLine)
   },
-  {key: VectorStyle.Greenbelt, icon: "treelawn", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
+  // {key: VectorStyle.Greenbelt, icon: "treelawn", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
 ]
 const lineWidthMenu = [
   {

+ 10 - 2
src/views/graphic/geos/road.vue

@@ -11,7 +11,7 @@
 import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
 import UiIcon from "@/components/base/components/icon/index.vue";
 import {drawRef, FocusVector, VectorType} from '@/hook/useGraphic'
-import {computed, ref} from "vue";
+import {computed, ref, watchEffect} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import GeoActions from "@/graphic/enum/GeoActions"
 import GraphicAction from "@/components/button-pane/index.vue";
@@ -20,9 +20,13 @@ import VectorEvents from "@/graphic/enum/VectorEvents";
 const props = defineProps<{geo: FocusVector}>()
 const vector = computed(() => dataService.getRoad(props.geo.vectorId))
 const clickHandlerFactory = (key) => {
-  return () => drawRef.value.uiControl.updateVectorForSelectUI(key)
+  return () => {
+    drawRef.value.uiControl.updateVectorForSelectUI(key)
+    console.log(vector)
+  }
 }
 
+
 const appendMenus = props.geo.type === VectorType.CurveRoad
   ? [
     {
@@ -71,6 +75,10 @@ const menus = ref([
   }
 ])
 
+watchEffect(() => {
+  menus.value[1].disabled = vector.value?.singleRoadDrivewayCount === 1
+})
+
 </script>
 
 <style scoped lang="scss">

+ 1 - 1
src/views/graphic/geos/roadEdge.vue

@@ -55,7 +55,7 @@ const lineTypeMenu = [
     text: "点画线",
     onClick: clickHandlerFactory(VectorStyle.PointDrawLine)
   },
-  {key: VectorStyle.Greenbelt, icon: "treelawn", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
+  // {key: VectorStyle.Greenbelt, icon: "treelawn", text: "绿化带 ", onClick: clickHandlerFactory(VectorStyle.Greenbelt)},
 ]
 
 const lineWidthMenu = [

+ 6 - 2
src/views/graphic/geos/text.vue

@@ -2,8 +2,9 @@
   <GeoTeleport :menus="menus" class="geo-teleport-use">
     <template v-slot="{ data }">
       <template v-if="data.key === 'color'">
-        <ui-input type="color" class="geo-input" v-model="color" />
-        <span class="color" :style="{backgroundColor: color}"></span>
+        <Color v-model:color="color">
+          <span class="color" :style="{backgroundColor: color}"></span>
+        </Color>
       </template>
       <template v-if="data.key === 'fontSize'">
         <ui-input
@@ -25,6 +26,7 @@
           ref="inputTextRef"
           v-model="text"
           width="100%"
+          :maxlength="20"
           height="64px"
           @blur="updateText = false"
       />
@@ -41,6 +43,7 @@ import {computed, ref, watch, watchEffect} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import {debounce} from '@/utils'
 import GeoActions from "@/graphic/enum/GeoActions";
+import Color from "@/components/color/index.vue";
 
 const props = defineProps<{geo: FocusVector}>()
 const inputTextRef = ref()
@@ -113,6 +116,7 @@ const menus = [
   height: 18px;
   border: 2px solid #fff;
   border-radius: 50%;
+  display: inline-block;
 }
 
 .font-size {

+ 2 - 1
src/views/graphic/imageLabel.vue

@@ -56,7 +56,8 @@ const typeMenus = computed(() => {
       .filter(item => item.text.includes(keyword.value))
       .sort((a, b) => a.icon.localeCompare(b.icon))
   }));
-  const items = [
+
+  const items = keyword.value ? raws : [
     {
       title: "常用",
       children: uses.value

+ 12 - 5
src/views/graphic/index.vue

@@ -1,13 +1,13 @@
 <template>
   <MainPanel
-      :menus="graphicState.continuedMode ? null : store.menus as any"
+      :menus="store.menus as any"
       :active-menu-key="store.activeMenuKey.value">
     <template v-slot:header>
-      <Header :class="{disabled: graphicState.continuedMode}" />
+      <Header  />
     </template>
     <Container />
     <ChildMenus
-        v-if="store.child.value"
+        v-if="store.child.value && store.activeMenuKey.value === UITypeExtend.template"
         :menus="store.child.value as any"
         @quit="store.child.value = null"
     />
@@ -16,7 +16,7 @@
         @quit="uiType.change(null)"
     />
 
-    <GraphicAction class="full-action">
+    <GraphicAction class="full-action" v-if="!graphicState.continuedMode">
       <ui-icon
         :type="isFull ? 'screen_c' : 'screen_f'"
         ctrl
@@ -38,7 +38,7 @@ import UiIcon from "@/components/base/components/icon/index.vue";
 import Confirm from './confirm.vue'
 import ImageLabel from "./imageLabel.vue";
 import {router} from '@/router'
-import {computed} from "vue";
+import {computed, watchEffect} from "vue";
 import {customMap} from '@/hook'
 import {focusMenuRaw, generateMixMenus, mainMenusRaw, photoMenusRaw, Mode, UITypeExtend} from './menus'
 import {currentVector, graphicState, uiType} from "@/hook/useGraphic";
@@ -61,6 +61,13 @@ const store = computed(() => generateMixMenus(
   menusRaws.value
 ))
 
+watchEffect(() => {
+  if (graphicState.value.continuedMode) {
+    customMap.sysView = 'full'
+  } else {
+    customMap.sysView = 'auto'
+  }
+})
 
 const focusMenus = computed(() => focusMenuRaw[currentVector.value?.type])
 const geoComponent = computed(() => {

+ 1 - 0
src/views/graphic/menus.ts

@@ -170,6 +170,7 @@ export const mainMenusRaw: MenusRaw = [
     //   { key: UIType.BusPlane, text: "客车平面图" }
     // ]
   },
+  { key: UIType.FixPoint, text: '固定点', icon: 'text' },
   {
     key: UITypeExtend.measure,
     text: '测量',

+ 6 - 2
src/views/graphic/setting.vue

@@ -9,7 +9,7 @@
           </p>
           <ui-input v-model="data.singleRoadWidth" width="100%">
             <template v-slot:icon>
-              <ui-icon type="measure" ctrl @click="setSceneSingleRoadWidth" />
+              <ui-icon type="measure" ctrl @click="setSceneSingleRoadWidth" class="measure_icon" />
             </template>
           </ui-input>
         </div>
@@ -21,7 +21,7 @@
           </p>
           <ui-input v-model="data.roadQuarantineWidth" width="100%">
             <template v-slot:icon>
-              <ui-icon type="measure" ctrl @click="setSceneRoadQuarantineWidth" />
+              <ui-icon type="measure" ctrl @click="setSceneRoadQuarantineWidth" class="measure_icon" />
             </template>
           </ui-input>
         </div>
@@ -117,4 +117,8 @@ const handler = (label) => {
     }
   }
 }
+
+.measure_icon {
+  padding: 10px;
+}
 </style>

+ 25 - 6
src/views/scene/TrackMeasure.vue

@@ -1,21 +1,36 @@
 <template>
-  <ButtonPane class="photo-btn fun-ctrl" :size="80" @click="active = true">
-    <ui-icon type="line_h" class="icon" :class="{active}" />
-  </ButtonPane>
+  <div class="photo-btn">
+    <ButtonPane
+        class="item fun-ctrl"
+        :size="80"
+        :class="{disabled: !tempMeasures.length}"
+        @click="onConfirm(tempMeasures[0] as any)"
+    >
+      <ui-icon type="affirm" class="icon" />
+    </ButtonPane>
+    <ButtonPane class="item fun-ctrl" :size="80" @click="active = !active">
+      <ui-icon type="line_h" class="icon" :class="{active}" />
+    </ButtonPane>
+  </div>
 </template>
 <script setup lang="ts">
 import UiIcon from "@/components/base/components/icon/index.vue";
 import ButtonPane from "@/components/button-pane/index.vue";
 import {startMeasure, SuccessMeasureAtom} from "@/views/scene/linkage/measure";
 import {ref, watchEffect} from "vue";
+import {tempMeasures} from "@/store/measure";
 
 const props = defineProps<{ onConfirm: (data: SuccessMeasureAtom) => void }>()
-const active = ref(false)
+const active = ref(true)
 watchEffect(() => {
   if (active.value) {
+    tempMeasures.value = []
     startMeasure('L_LINE', 'red')
       .then((measure) => {
-        props.onConfirm(measure)
+        if (measure) {
+          active.value = null
+          tempMeasures.value = [measure]
+        }
       })
   }
 })
@@ -24,10 +39,14 @@ watchEffect(() => {
 <style lang="scss" scoped>
 .photo-btn {
   position: absolute;
-  margin-bottom: 16px;
+  transform: translateY(-50%);
   top: 50%;
   left: 15px;
 
+  .item {
+    position: static;
+    margin: 20px 0;
+  }
 
   .icon {
     &.active {

+ 5 - 3
src/views/scene/container.vue

@@ -93,13 +93,15 @@ onMounted(async () => {
 
 <style lang="scss">
 .canvas-layout  {
-  #navCube,
+  #navCube{
+    position: absolute !important;
+    right: calc(var(--boundMargin) + 10px) !important;
+    top: calc(var(--boundMargin) + 10px) !important;
+  }
   #home {
     position: absolute !important;
     right: var(--boundMargin) !important;
     top: var(--boundMargin) !important;
-  }
-  #home {
     display: flex;
     align-items: center;
     justify-content: center;

+ 1 - 1
src/views/scene/covers/fixPoints.vue

@@ -24,7 +24,7 @@
       <h3>添加名称</h3>
       <ui-icon type="close" ctrl @click="edit = null" />
     </div>
-    <ui-input type="text" v-model="edit.text" width="100%" />
+    <ui-input type="text" v-model="edit.text" width="100%" maxlength="20" />
     <div class="select">
       <span>常用名称</span>
       <p

+ 3 - 2
src/views/scene/menus/actions.ts

@@ -50,7 +50,8 @@ const trackMeasureMenuAction = (
   const startTip = () => {
     hide && hide()
     if (!startTipEd) {
-      hide = Message.success({msg: `请选择一个位置单击,确定${name}的起点`})
+      hide = Message.success({msg: `请绘制${name}`})
+      // 请选择一个位置单击,确定${name}的起点
       startTipEd = true
     }
   }
@@ -58,7 +59,7 @@ const trackMeasureMenuAction = (
     hide && hide()
     if (!endTipEd) {
       endTipEd = true
-      hide = Message.success({msg: `再选择一个位置单击,确定${name}的终点`})
+      // hide = Message.success({msg: `再选择一个位置单击,确定${name}的终点`})
     }
   }
   startTip()

+ 10 - 0
yarn.lock

@@ -169,6 +169,11 @@
     "@intlify/core-base" "9.2.2"
     "@intlify/shared" "9.2.2"
 
+"@lk77/vue3-color@^3.0.6":
+  version "3.0.6"
+  resolved "http://192.168.0.47:4873/@lk77/vue3-color/-/vue3-color-3.0.6.tgz#3f9262b82b21c606b30e2b79c570636e80d91dfa"
+  integrity sha512-1e/TJrk2jJFo7z+teHjavndVxV9c25J5FA6LVEKJFKqLQzYDesTijxBmX1rAmiHHnFrjfVcwie5QAr3PzZbR2Q==
+
 "@types/body-parser@*":
   version "1.19.2"
   resolved "http://192.168.0.47:4873/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
@@ -879,6 +884,11 @@ inherits@2.0.4:
   resolved "http://192.168.0.47:4873/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
   integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
 
+install@^0.13.0:
+  version "0.13.0"
+  resolved "http://192.168.0.47:4873/install/-/install-0.13.0.tgz#6af6e9da9dd0987de2ab420f78e60d9c17260776"
+  integrity sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==
+
 ipaddr.js@1.9.1:
   version "1.9.1"
   resolved "http://192.168.0.47:4873/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"