浏览代码

添加draw类别

bill 2 年之前
父节点
当前提交
d80ff59197

文件差异内容过多而无法显示
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 15 - 3
src/components/fill-slide/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="fill-slide">
+    <div></div>
     <div class="header">
       <slot name="header" />
-      <ui-icon class="close" type="close" @click="$emit('quit')" ctrl />
+      <ui-icon class="close" type="close" @click="clickHandler" ctrl />
     </div>
     <div class="slide-layout">
       <ui-slide
@@ -32,10 +33,14 @@ import UiIcon from "@/components/base/components/icon/index.vue";
 type Item = {url: string}
 
 defineProps<{ data: Item[], active: Item, getURL?: (data: any) => string }>()
-defineEmits<{
+const emit = defineEmits<{
   (e: 'update:active', d: Item): void,
   (e: 'quit'): void
 }>()
+
+const clickHandler = () => {
+  emit('quit')
+}
 </script>
 
 <style scoped lang="scss">
@@ -54,8 +59,11 @@ defineEmits<{
 }
 
 .slide-layout {
+  max-width: 90vw;
   width: 840px;
   height: 540px;
+  position: relative;
+  z-index: 1;
 }
 
 .image {
@@ -67,7 +75,10 @@ defineEmits<{
 
 .header {
   width: 100%;
-  position: relative;
+  position: absolute;
+  z-index: 4;
+  background: red;
+  //height: 120px;
 }
 
 .close {
@@ -76,6 +87,7 @@ defineEmits<{
   top: 32px;
   font-size: 20px;
   color: #fff;
+  z-index: 1;
 }
 .foot {
   width: 100%;

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

@@ -610,14 +610,29 @@ export default class Draw {
   }
 
   drawPoint(vector) {
+    if (vector.category === VectorCategory.Point.TestBasePoint) {
+      return;
+    }
     const pt = coordinate.getScreenXY({ x: vector.x, y: vector.y });
     const ctx = this.context;
-    const [style] = help.setVectorStyle(
+    const [style, attr] = help.setVectorStyle(
       ctx,
       vector,
       [vector.category, vector.geoType, "Point"]
 
     );
+    if (vector.category === VectorCategory.Point.NormalPoint) {
+      const lineid = Object.keys(vector.parent)[0]
+      let line, style
+      if (!(lineid && (line = dataService.getLine(lineid)))) {
+        return;
+      }
+      const [_, attr] = help.getVectorStyle(line)
+      if (!attr) {
+        return;
+      }
+    }
+
     if (vector.color) {
       ctx.strokeStyle = vector.color;
     }
@@ -631,6 +646,7 @@ export default class Draw {
       ctx.fill();
       ctx.restore();
     }
+
     draw(style)
     if (style.out) {
       draw(style.out)
@@ -750,11 +766,13 @@ export default class Draw {
 
     const drawPoints = () => {
       // if (attr) {
+      console.log("???")
         this.drawPoint(dataService.getPoint(vector.startId))
         this.drawPoint(dataService.getPoint(vector.endId))
       // }
     }
 
+    console.log(vector.category)
     switch (vector.category) {
       case VectorCategory.Line.ArrowLine:
         this.drawArrow(vector);
@@ -767,6 +785,7 @@ export default class Draw {
       case VectorCategory.Line.PositionLine:
         this.drawLineText(vector, style.text)
         break;
+
     }
 
   }

+ 9 - 3
src/hook/useGraphic.ts

@@ -20,11 +20,17 @@ const newsletter = ref<{
 }>({ selectUI: null, focusVector: null });
 
 const changeIndex = ref(0)
-export const changeStore = () => changeIndex.value++
+export const changeStore = () => {
+  console.error("111")
+  changeIndex.value++
+}
 export const useChange = (fn: () => void) => {
+  let old
   return watchEffect(() => {
-    changeIndex.value;
-    fn()
+    if (old !== changeIndex.value) {
+      old = changeIndex.value;
+      fn()
+    }
   })
 }
 

+ 0 - 2
src/views/graphic/geos/arrow.vue

@@ -49,7 +49,6 @@ const menus = [
     text: "复制",
     onClick: () => {
       drawRef.value.uiControl.handleGeo(GeoActions.CopyAction)
-      uiType.change(UIType.Copy)
     }
   },
   {
@@ -57,7 +56,6 @@ const menus = [
     text: "删除",
     onClick: () => {
       drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
-      uiType.change(UIType.Delete)
     }
   }
 ]

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

@@ -18,7 +18,6 @@ const menus = [
     text: "删除",
     onClick: () => {
       drawRef.value.uiControl.handleGeo(GeoActions.DeleteAction)
-      uiType.change(UIType.Delete)
     }
   }
 ]

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

@@ -53,6 +53,7 @@ const color = ref("#000000")
 const size = ref(18)
 
 const syncVector = ([text, size, color]) => {
+  console.log(text, size, color)
   vector.value.setValue(text)
   vector.value.setColor(color)
   vector.value.setFontSize(size)
@@ -67,7 +68,6 @@ watchEffect(() => {
 })
 
 useChange(() => {
-  console.log(vector.value)
   color.value = vector.value.color
   size.value = vector.value.fontSize
   text.value = vector.value.value

+ 5 - 5
src/views/sys/menu/index.vue

@@ -4,11 +4,11 @@
     class="menu global-menu"
     :class="{ show: !isEdit, disabled: showToolbar, readonly: disabledGoto }"
   >
-    <template #first v-if="!os.isPc">
-      <div class="menu-close" @click="customMap.sysView = 'full'">
-        <ui-icon type="close"></ui-icon>
-      </div>
-    </template>
+<!--    <template #first v-if="!os.isPc">-->
+<!--      <div class="menu-close" @click="customMap.sysView = 'full'">-->
+<!--        <ui-icon type="close"></ui-icon>-->
+<!--      </div>-->
+<!--    </template>-->
 
     <template v-slot="{ raw }">
       <Item :menu="raw" :active="active" @select="gotoMenuItem">