소스 검색

添加draw类别

bill 2 년 전
부모
커밋
70a91a3faa

+ 8 - 0
src/assets/pc.scss

@@ -15,3 +15,11 @@
 
   --boundMargin: 24px
 }
+
+.head-icon {
+  display: inline-block;
+  width: var(--editor-menu-width);
+  font-size: 20px !important;
+  margin-left: -20px;
+  text-align: center;
+}

+ 1 - 1
src/components/group-button/index.vue

@@ -81,7 +81,7 @@ const menuStyle = computed(() => {
 
   p {
     line-height: 17px;
-    font-size: 12px;
+    font-size: 14px;
     white-space:nowrap;
   }
 }

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

@@ -53,6 +53,7 @@ const layoutClass = computed(() => ({
   top: var(--header-top);
   display: flex;
   align-items: center;
+  font-size: 16px;
 }
 
 .header .menu {

+ 1 - 0
src/graphic/CanvasStyle/default.js

@@ -204,6 +204,7 @@ export default {
   Magnifier,
   Font: CanvasFont,
   MeasureLine,
+  PositionLine: MeasureLine,
   Measure,
   Element,
   TestPoint,

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

@@ -736,7 +736,7 @@ export default class Draw {
     const [style, attr] = help.setVectorStyle(
       this.context,
       vector,
-      vector.category || vector.geoType
+      [vector.category, vector.geoType, 'BaseLine']
     );
     if (style.dash) {
       this.context.setLineDash(style.dash);

+ 54 - 0
src/views/graphic/geos/del.vue

@@ -0,0 +1,54 @@
+<template>
+  <GeoTeleport :menus="menus" class="geo-teleport-use">
+    <template v-slot="{ data }">
+      <ui-icon type="del" class="icon" v-if="data.key === 'del'" />
+    </template>
+  </GeoTeleport>
+</template>
+
+<script setup lang="ts">
+import GeoTeleport from "@/views/graphic/geos/geo-teleport.vue";
+import UiIcon from "@/components/base/components/icon/index.vue";
+import {drawRef, uiType, UIType} from '@/hook/useGraphic'
+import GeoActions from "@/graphic/enum/GeoActions"
+
+const menus = [
+  {
+    key: 'del',
+    text: "删除",
+    onClick: () => {
+      drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
+      uiType.change(UIType.Delete)
+    }
+  }
+]
+</script>
+
+<style scoped lang="scss">
+.color {
+  width: 18px;
+  height: 18px;
+  border: 2px solid #fff;
+  border-radius: 50%;
+}
+
+.icon {
+  font-size: 16px;
+}
+
+.geo-input {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  z-index: 1;
+  opacity: 0;
+}
+</style>
+
+<style lang="scss">
+.select-floating.select-float.dire-top {
+  margin-top: -10px;
+}
+</style>

+ 3 - 0
src/views/graphic/geos/index.ts

@@ -3,9 +3,12 @@ import Arrow from './arrow.vue'
 import Text from './text.vue'
 import Circle from './circle.vue'
 import magnifier from './magnifier.vue'
+import Del from './del.vue'
 import VectorCategory from "@/graphic/enum/VectorCategory";
 
 
+export const GlobalComp = Del
+
 export default {
   [VectorType.ArrowLine]: Arrow,
   // [VectorCategory.Line.MeasureLine]: Arrow,

+ 2 - 2
src/views/graphic/header.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="graphic-header" v-if="data">
     <div class="title">
-      <ui-icon type="close" @click="router.back" />
+      <ui-icon type="close" @click="router.back" class="head-icon" />
       <p>{{ isRoad ? '现场绘图' : '事故照片' }}</p>
     </div>
     <div class="actions">
@@ -148,7 +148,7 @@ const createTable = async () => {
   align-items: center;
   justify-content: center;
   p {
-    font-size: 12px;
+    font-size: 14px;
     text-align: center;
   }
 }

+ 4 - 2
src/views/graphic/index.vue

@@ -36,7 +36,7 @@ import {computed} from "vue";
 import {customMap} from '@/hook'
 import {focusMenuRaw, generateMixMenus, mainMenusRaw, photoMenusRaw, Mode, UITypeExtend} from './menus'
 import {currentVector} from "@/hook/useGraphic";
-import geos from "./geos/index";
+import geos, {GlobalComp} from "./geos/index";
 
 const menusRaws = computed(() => {
   const mode = Number(router.currentRoute.value.params.mode) as Mode
@@ -57,7 +57,9 @@ const store = computed(() => generateMixMenus(
 
 const focusMenus = computed(() => focusMenuRaw[currentVector.value?.type])
 const geoComponent = computed(() => {
-  return geos[currentVector.value?.type] || geos[currentVector.value?.category]
+  if (currentVector.value) {
+    return geos[currentVector.value?.type] || geos[currentVector.value?.category] || GlobalComp
+  }
 })
 const isFull = computed(() => customMap.sysView === 'full' )
 </script>

+ 1 - 1
src/views/sys/head/index.vue

@@ -9,7 +9,7 @@
       }"
       @click="customMap.sysView = customMap.sysView === 'full' ? 'auto' : 'full'"
     >
-      <ui-icon :type="customMap.sysView === 'full' || !os.isPc ? 'menu' : 'close'" ctrl />
+      <ui-icon  :type="customMap.sysView === 'full' || !os.isPc ? 'menu' : 'close'" ctrl />
     </div>
     <div class="main">
       <span class="title">{{ title }}</span>

+ 9 - 3
src/views/sys/menu/index.vue

@@ -67,9 +67,6 @@ const active = computed(() =>
   display: flex;
   flex-direction: column;
 
-  .ui-menu-item span {
-    font-size: 12px;
-  }
 
   .ui-editor-menu-item {
     position: relative;
@@ -90,6 +87,15 @@ const active = computed(() =>
     }
   }
 }
+.global-menu ,.menu-children {
+
+  .ui-menu-item span {
+    font-size: 14px;
+  }
+  .ui-menu-item .icon {
+    font-size: 20px !important;
+  }
+}
 
 .readonly .menu-item {
   cursor: inherit;