bill пре 2 година
родитељ
комит
6e7dcffd09

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


Разлика између датотеке није приказан због своје велике величине
+ 545 - 546
src/graphic/CanvasStyle/ImageLabels/SVGIcons.js


+ 1 - 1
src/graphic/CanvasStyle/select.js

@@ -105,7 +105,7 @@ const TestPoint = {
 };
 
 const SVG = {
-  fillStyle: "rgba(0,0,0,0)",
+  fillStyle: "#3290FF",
   strokeStyle: "#3290FF",
   lineWidth: 2 * coordinate.ratio,
 };

+ 4 - 3
src/graphic/Load.js

@@ -82,7 +82,7 @@ export default class Load {
           point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
           point.setLinkedTestPointId(dataLocal.points[key].linkedTestPointId);
         }
-    
+
         // let points = dataService.vectorData.points;
         let points = dataLocal.points;
         Settings.basePointIds =[]
@@ -107,7 +107,7 @@ export default class Load {
           svg.setPoints(dataLocal.svgs[key].points);
         }
       }
-   
+
       if (dataLocal.lines) {
         for (let key in dataLocal.lines) {
           let line = lineService.createByPointId(
@@ -139,7 +139,7 @@ export default class Load {
         }
       }
       if(dataLocal.roadPoints){
-        
+
         for (let key in dataLocal.roadPoints) {
           let roadPoint = roadPointService.create(
             dataLocal.roadPoints[key],
@@ -301,6 +301,7 @@ export default class Load {
 
   // 退出页面清除缓存及其他操作
   clear() {
+    console.error("clear")
     this.layer.uiControl.menu_clear();
     console.warn("clear");
   }

+ 2 - 2
src/graphic/Renderer/Draw.js

@@ -1050,14 +1050,14 @@ export default class Draw {
     const dires = [points[0], { ...points[0], x: 10000 }, points[1]];
     let angle = mathUtil.Angle(...dires) * (Math.PI / 180);
     angle = mathUtil.isClockwise(dires) ? angle : -angle;
-    console.log(angle)
     this.context.save();
     this.context.translate(points[0].x, points[0].y);
     this.context.rotate(angle);
     this.context.scale(width / svgWidth, height / svgHidth);
     const [style, label] = help.setVectorStyle(this.context, vector);
     this.context.lineWidth = style.lineWidth / (width / svgWidth);
-    SVGIcons[vector.type].draw(this.context);
+    console.log(style, vector.type)
+    SVGIcons[vector.type].draw(this.context, style.fillStyle, style.strokeStyle);
     this.context.restore();
 
     if (label) {

+ 1 - 0
src/graphic/Service/HistoryService.js

@@ -49,6 +49,7 @@ export class HistoryService {
     }
 
     setHistoryState(pre, next) {
+        console.error(pre, next)
         this.history.state.pre = pre
         this.history.state.next = next
     }

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

@@ -2,6 +2,7 @@ import { Mode, PointInfo, Pos } from "@/sdk/types";
 import { stackFactory, Stack, fastStacksValue, os } from "@/utils/vue";
 import { Ref, ref } from "vue";
 import {FixPoint} from "@/store/fixPoint";
+import {BasePoint} from "@/store/basePoint";
 
 export enum DisabledCom {
   Search = "search",
@@ -79,6 +80,7 @@ export enum CustomCom {
   MagnifierMode = "magnifier",
   CustomMouseMenu = "cMoseMenu",
   ActiveFixPoint = "activeFixPoint",
+  ActiveBasePoint = "activeBasePoint",
   ResidenMouseMenu = "rMouseMenu",
   CarryView = "carryView",
   SysView = "sysView",
@@ -126,12 +128,14 @@ export const boxWidthStack = stackFactory(
 export const autoSysViewLeftStack = stackFactory(ref<string>("70px"));
 export const controlFullStack = stackFactory(ref<boolean>(false));
 export const activeFixPointStack = stackFactory(ref<FixPoint>());
+export const activeBasePointStack = stackFactory(ref<BasePoint>());
 
 export const customMapStack = {
   [CustomCom.LaserMode]: laserModeStack,
   [CustomCom.FullView]: fullViewStack,
   [CustomCom.SpiltView]: spiltViewModeStack,
   [CustomCom.ActiveFixPoint]: activeFixPointStack,
+  [CustomCom.ActiveBasePoint]: activeBasePointStack,
   [CustomCom.MagnifierMode]: magnifierModeStack,
   [CustomCom.ResidenMouseMenu]: residenMouseMenuStack,
   [CustomCom.CustomMouseMenu]: customMouseMenuStack,

+ 1 - 1
src/store/sync.ts

@@ -193,7 +193,7 @@ export const api =
       };
 
 export const back = () => {
-  api.closePage();
+  router.back()
 };
 
 const loadStore = async () => {

+ 4 - 0
src/views/accidents/index.vue

@@ -67,6 +67,7 @@ import Header from "@/components/photos/header.vue";
 import {useConfirm} from "@/hook";
 import Undata from "@/components/photos/undata.vue";
 import {api} from "@/store/sync";
+import {photos} from "@/store/photos";
 
 const sortPhotos = computed(() => {
   const photos = [...accidentPhotos.value]
@@ -160,6 +161,9 @@ const delSelects = async () => {
       delPhotoRaw(selects.value[0])
       selects.value.shift()
     }
+    if (!sortPhotos.value.length) {
+      selectMode.value = false
+    }
   }
 }
 const gotoDraw = () => {

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

@@ -7,7 +7,7 @@
       </template>
     </template>
   </GeoTeleport>
-  <GeoTeleport :menus="typeMenus" v-if="typeMenus" class="type-geo" />
+  <GeoTeleport :menus="typeMenus" v-if="typeMenus" class="type-geo" :active="typeMenus.find(menu => menu.key === type)" />
 </template>
 
 <script setup lang="ts">
@@ -25,10 +25,9 @@ const props = defineProps<{geo: FocusVector}>()
 const vector = computed(() => dataService.getLine(props.geo.vectorId))
 const color = ref("#000000")
 const type = ref(props.geo.category || "SingleArrowLine")
-console.log(type.value)
 useChange(() => {
   color.value = vector.value.color
-  color.value = vector.value.category
+  type.value = vector.value.category
 })
 
 
@@ -57,13 +56,13 @@ const menus = ref([
       typeMenus.value = !typeMenus.value
         ? [
           {
-            key: 'color',
+            key: 'SingleArrowLine',
             icon: 'arrows_s',
             text: "单向",
             onClick: () => type.value = "SingleArrowLine"
           },
           {
-            key: 'color',
+            key: 'DoubleArrowLine',
             icon: 'arrows_d',
             text: "双向",
             onClick: () => type.value = "DoubleArrowLine"

+ 8 - 3
src/views/graphic/geos/magnifier.vue

@@ -9,7 +9,7 @@ import UiInput from "@/components/base/components/input/index.vue";
 import UiIcon from "@/components/base/components/icon/index.vue";
 import {uploadImage} from '@/store/sync'
 import {drawRef, FocusVector, uiType, UIType} from '@/hook/useGraphic'
-import {computed, ref, UnwrapRef, watch} from "vue";
+import {computed, reactive, ref, UnwrapRef, watch} from "vue";
 import {dataService} from "@/graphic/Service/DataService";
 import {api} from "@/store/sync";
 import GeoActions from "@/graphic/enum/GeoActions";
@@ -17,7 +17,8 @@ import GeoActions from "@/graphic/enum/GeoActions";
 const props = defineProps<{geo: FocusVector}>()
 const vector = computed(() => dataService.getMagnifier(props.geo.vectorId))
 const typeMenus = ref<UnwrapRef<typeof menus>>()
-const menus = [
+console.log(vector.value)
+const menus = reactive([
   {
     key: 'file',
     text: "拍照",
@@ -49,6 +50,7 @@ const menus = [
     key: 'reset',
     icon: "recover",
     text: "恢复默认",
+    disabled: !vector.value.photoUrl,
     onClick: () => syncVector(null)
   },
   {
@@ -59,7 +61,7 @@ const menus = [
       drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
     }
   }
-]
+])
 const syncVector = (url: string) => {
   vector.value.setSrc(url)
   vector.value.setImageData()
@@ -67,6 +69,9 @@ const syncVector = (url: string) => {
       drawRef.value.renderer.autoRedraw()
       drawRef.value.history.save()
     })
+
+
+  menus[1].disabled = !vector.value.photoUrl
 }
 
 </script>

+ 3 - 0
src/views/photos/index.vue

@@ -162,6 +162,9 @@ const delSelects = async () => {
       delPhotoRaw(selects.value[0])
       selects.value.shift()
     }
+    if (!sortPhotos.value.length) {
+      selectMode.value = false
+    }
   }
 }
 

+ 4 - 0
src/views/roads/index.vue

@@ -67,6 +67,7 @@ import ButtonPane from "@/components/button-pane/index.vue";
 import UiIcon from "@/components/base/components/icon/index.vue";
 import {useConfirm} from "@/hook";
 import {api} from "@/store/sync";
+import {photos} from "@/store/photos";
 
 
 const sortPhotos = computed(() => [...roadPhotos.value].reverse())
@@ -134,6 +135,9 @@ const delSelects = async () => {
       delPhotoRaw(selects.value[0])
       selects.value.shift()
     }
+    if (!sortPhotos.value.length) {
+      selectMode.value = false
+    }
   }
 }
 

+ 8 - 8
src/views/scene/covers/basePoints.vue

@@ -4,15 +4,15 @@
     :key="point.id"
     :pos="point.pos"
     @change-pos="pos => point.pos = pos"
-    :active="active === point"
-    @blur="() => active = active === point ? null : active"
-    @focus="() => active = point"
+    :active="customMap.activeBasePoint === point"
+    @blur="() => customMap.activeBasePoint = customMap.activeBasePoint === point ? null : customMap.activeBasePoint"
+    @focus="() => customMap.activeBasePoint = point"
   />
 
 <!--  <ActionsPanel :menus="activeActionMenus" v-if="active" />-->
   <div ref="menu" @touchstart.stop class="action-menus">
     <ActionMenus
-        v-if="active"
+        v-if="customMap.activeBasePoint"
         :menus="activeActionMenus"
         dire="row"
     />
@@ -28,7 +28,6 @@ import ActionsPanel from "@/views/scene/covers/actions.vue";
 import {customMap} from "@/hook";
 import ActionMenus from "@/components/group-button/index.vue";
 
-const active = ref<BasePoint>()
 const activeActionMenus = [
   {
     key: "delete",
@@ -36,11 +35,12 @@ const activeActionMenus = [
     text: "删除",
     color: "#FF4D4F",
     iconColor: "#fff",
-    action() {
-      const index = basePoints.value.indexOf(active.value)
+    onClick() {
+      const index = basePoints.value.indexOf(customMap.activeBasePoint)
+      console.log(index)
       if (~index) {
         basePoints.value.splice(index, 1)
-        active.value = null
+        customMap.activeBasePoint = null
       }
     }
   }

+ 27 - 3
src/views/scene/covers/measures.vue

@@ -8,7 +8,13 @@
       @focus="() => active = measure"
   />
 
-  <ActionsPanel :menus="activeActionMenus" v-if="active" />
+  <div ref="menu" @touchstart.stop class="action-menus">
+    <ActionMenus
+        v-if="active"
+        :menus="activeActionMenus"
+        dire="row"
+    />
+  </div>
 </template>
 
 <script setup lang="ts">
@@ -17,6 +23,8 @@ import { baseLines } from '@/store/baseLine'
 import Measure from './measure.vue'
 import {ref} from "vue";
 import ActionsPanel from "@/views/scene/covers/actions.vue";
+import {customMap} from "@/hook";
+import ActionMenus from "@/components/group-button/index.vue";
 
 const active = ref<MeasureAtom>()
 const getStore = (item: MeasureAtom) =>
@@ -29,9 +37,10 @@ const activeActionMenus = [
   {
     key: "delete",
     icon: "del",
+    text: "删除",
     color: "#FF4D4F",
     iconColor: "#fff",
-    action() {
+    onClick() {
       console.log('aa')
       const store = getStore(active.value)
       if (store) {
@@ -45,4 +54,19 @@ const activeActionMenus = [
 const changePoints = (measure, points) => {
   measure.points = points.map(point => ({...point}))
 }
-</script>
+</script>
+
+<style scoped>
+
+.action-menus {
+  position: absolute;
+  bottom: var(--boundMargin);
+  left: 50%;
+  transform: translateX(-50%);
+  display: flex;
+  z-index: 2;
+  .menus {
+    position: static;
+  }
+}
+</style>

+ 21 - 6
src/views/scene/menus/actions.ts

@@ -4,7 +4,7 @@ import {list, MeasureAtom, MeasureType} from "@/store/measure";
 import {baseLines} from '@/store/baseLine'
 import {basePoints} from "@/store/basePoint";
 import {Ref, watch} from "vue";
-import {activeFixPointStack, customMap} from "@/hook";
+import {activeBasePointStack, activeFixPointStack, customMap} from "@/hook";
 import {getCoverPos} from '../linkage/cover'
 import {Pos3D} from "@/sdk";
 import {fixPoints} from "@/store/fixPoint";
@@ -45,13 +45,21 @@ const trackMeasureMenuAction = (
   color = "#3290ff"
 ) => {
   let hide
+  let startTipEd = false
+  let endTipEd = false
   const startTip = () => {
     hide && hide()
-    hide = Message.success({ msg: `请选择一个位置单击,确定${name}的起点` })
+    if (!startTipEd) {
+      hide = Message.success({msg: `请选择一个位置单击,确定${name}的起点`})
+      startTipEd = true
+    }
   }
   const firstTip = () => {
     hide && hide()
-    hide = Message.success({ msg: `再选择一个位置单击,确定${name}的终点` })
+    if (!endTipEd) {
+      endTipEd = true
+      hide = Message.success({msg: `再选择一个位置单击,确定${name}的终点`})
+    }
   }
   startTip()
   // customMap.magnifier = true
@@ -84,11 +92,18 @@ const menuActions = {
     let hide = Message.success({ msg: "请单击选择基准点位置" })
     const onDestroy = trackPosMenuAction(
       () => {
-        hide()
-        hide = null
+        hide && hide()
         onComplete()
       },
-      pos => basePoints.value.push({ id: getId(), pos })
+      pos => {
+        const len = basePoints.value.push({ id: getId(), pos })
+        activeBasePointStack.current.value.value = basePoints.value[len - 1]
+        if (hide) {
+          hide()
+          hide = null
+        }
+      },
+      true
     )
     return () => {
       onDestroy()

+ 4 - 3
src/views/scene/menus/menus.ts

@@ -50,20 +50,20 @@ export const menus: MenuRaw[] = [
     children: [
       {
         icon: "line_h",
-        // continued: true,
+        continued: true,
         text: "水平",
         defaultSelect: true,
         key: menuEnum.MEASURE_ROW
       },
       {
         icon: "line_v",
-        // continued: true,
+        continued: true,
         text: "垂直",
         key: menuEnum.MEASURE_COLUMN
       },
       {
         icon: "line_f",
-        // continued: true,
+        continued: true,
         text: "自由",
         key: menuEnum.MEASURE_FREE
       }
@@ -114,6 +114,7 @@ export const menus: MenuRaw[] = [
       {
         defaultSelect: true,
         icon: "point",
+        continued: true,
         text: "基准点",
         key: menuEnum.BASE_POINT
       },