浏览代码

修正问题

bill 2 年之前
父节点
当前提交
1e231de23a

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

@@ -410,6 +410,11 @@ export default class Draw {
     const height = help.getReal(img.height);
     const center = coordinate.getScreenXY(vector.center);
     this.context.save();
+    if (vector.scale) {
+      this.context.translate(center.x, center.y)
+      this.context.scale(vector.scale, vector.scale)
+      this.context.translate(-center.x, -center.y)
+    }
     this.context.drawImage(
       img,
       center.x - width / 2,

+ 3 - 0
src/hook/custom/preset.ts

@@ -87,6 +87,7 @@ export enum CustomCom {
   boxWidth = "boxWidth",
   autoMarginLeft = "autoMarginLeft",
   fullCtrl = "fullCtrl",
+  trackMeasureMode = "trackMeasureMode"
 }
 
 export enum RightMenuEum {
@@ -127,6 +128,7 @@ export const boxWidthStack = stackFactory(
 );
 export const autoSysViewLeftStack = stackFactory(ref<string>("70px"));
 export const controlFullStack = stackFactory(ref<boolean>(false));
+export const trackMeasureModeStack = stackFactory(ref<boolean>(false));
 export const activeFixPointStack = stackFactory(ref<FixPoint>());
 export const activeBasePointStack = stackFactory(ref<BasePoint>());
 
@@ -144,6 +146,7 @@ export const customMapStack = {
   [CustomCom.boxWidth]: boxWidthStack,
   [CustomCom.autoMarginLeft]: autoSysViewLeftStack,
   [CustomCom.fullCtrl]: controlFullStack,
+  [CustomCom.trackMeasureMode]: trackMeasureModeStack
 };
 export type CustomMapStack = typeof customMapStack;
 

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

@@ -14,13 +14,15 @@ import { propsKey, laserKey } from '../constant'
 import { inject, computed, ref, watch } from 'vue'
 import {MeasureUnit} from "@/sdk";
 import {tempMeasures} from "@/store/measure";
+import {customMap} from "@/hook";
+import {trackMode} from "@/views/scene/trackMeasureWidth";
 
 const props = inject(propsKey)
 const laser = inject(laserKey)
 const refs = ref([])
 const measureMap = props.measureMap
 
-const measure = computed(() => [...props.store.measure.list, ...props.store.measure.tempMeasures, ...props.store.baseLine.baseLines])
+const measure = computed(() => trackMode.value ?  props.store.measure.tempMeasures : [...props.store.measure.list, ...props.store.baseLine.baseLines])
 
 watch(
   refs,

+ 4 - 1
src/views/graphic/setting.vue

@@ -69,7 +69,10 @@ const lineWidthOption = [
 console.log(data)
 
 const setSceneSingleRoadWidth = async () => {
-  data.value.singleRoadWidth = await trackMeasureWidth()
+  const width = await trackMeasureWidth()
+  if (width !== null) {
+    data.value.singleRoadWidth = width
+  }
 }
 
 const setSceneRoadQuarantineWidth = async () => {

+ 9 - 2
src/views/scene/TrackMeasure.vue

@@ -3,7 +3,6 @@
     <ButtonPane
         class="item fun-ctrl"
         :size="80"
-        :class="{disabled: !tempMeasures.length}"
         @click="callback"
     >
       <ui-icon type="affirm" class="icon" />
@@ -17,8 +16,9 @@
 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 {onActivated, onMounted, ref, watchEffect} from "vue";
 import {tempMeasures} from "@/store/measure";
+import {measureDisabledStack} from '@/hook/custom'
 
 const props = defineProps<{ onConfirm: (data: SuccessMeasureAtom) => void }>()
 const active = ref(true)
@@ -38,6 +38,13 @@ watchEffect(() => {
       })
   }
 })
+
+onMounted(() => {
+  measureDisabledStack.push(ref(true))
+})
+onActivated(() => {
+  measureDisabledStack.pop()
+})
 </script>
 
 <style lang="scss" scoped>

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

@@ -43,7 +43,6 @@
 <script setup lang="ts">
 import { fixPoints, FixPoint } from '@/store/fixPoint'
 import FixPointPanel from './fixPoint.vue'
-import ActionsPanel from './actions.vue'
 import {ref, watch, watchEffect} from "vue";
 import {customMap} from '@/hook'
 import UiIcon from "@/components/base/components/icon/index.vue";

+ 1 - 1
src/views/scene/index.vue

@@ -23,7 +23,7 @@ import FixPoints from "@/views/scene/covers/fixPoints.vue";
 import Measures from "@/views/scene/covers/measures.vue";
 import Photo from './photo.vue'
 import ButtonPane from '@/components/button-pane'
-import {disabledMap, useSDK} from "@/hook";
+import {customMap, disabledMap, useSDK} from "@/hook";
 import customSetup from "../../hook/custom";
 import UiIcon from "@/components/base/components/icon/index.vue";
 import {ref, watchEffect} from "vue";

+ 1 - 1
src/views/scene/photo.vue

@@ -2,7 +2,7 @@
   <img :src="tempPhoto" class="face-animation" v-if="tempPhoto" ref="coverRef">
 
   <div class="photo-layout" v-if="disabledMap.photo">
-    <ButtonPane class="photo-btn fun-ctrl" size="80" @click="photo">
+    <ButtonPane class="photo-btn fun-ctrl" :size="80" @click="photo">
       <ui-icon type="photo" class="icon" />
     </ButtonPane>
 

+ 5 - 1
src/views/scene/trackMeasureWidth.ts

@@ -39,5 +39,9 @@ export const trackMeasureWidth = async () => {
   await new Promise(resolve => setTimeout(resolve, 100))
   sdk.leaveTopView()
   trackMode.value = false
-  return Number(measure.length.toFixed(2))
+  if (measure) {
+    return Number(measure.length.toFixed(2))
+  } else {
+    return null
+  }
 }