Преглед на файлове

Merge branch 'local' of https://github.com/le5le-com/visualization-design into local

Wind-Breaker1 преди 1 година
родител
ревизия
8344dacac9
променени са 2 файла, в които са добавени 83 реда и са изтрити 9 реда
  1. 74 0
      src/views/components/PenProps.vue
  2. 9 9
      src/views/components/PensProps.vue

+ 74 - 0
src/views/components/PenProps.vue

@@ -49,6 +49,29 @@
             </t-select-input>
           </div>
           <t-divider style="margin: -8px 0" />
+          <div style="margin: 0 16px 16px 16px">
+            <t-space direction="vertical" size="small" class="w-full">
+              <div style="color: var(--color); margin-bottom: 2px">
+                大屏对齐
+              </div>
+              <div class="icons">
+                <t-tooltip
+                  v-for="item in aligns"
+                  :content="item.label"
+                  placement="top"
+                >
+                  <svg
+                    class="l-icon btn"
+                    aria-hidden="true"
+                    @click="align(item.value)"
+                  >
+                    <use :xlink:href="item.icon"></use>
+                  </svg>
+                </t-tooltip>
+              </div>
+            </t-space>
+          </div>
+          <t-divider style="margin: -8px 0" />
           <div class="form-item" style="margin-top: -12px">
             <t-input
               class="ml-4"
@@ -1148,6 +1171,43 @@ const iconsDrawer = reactive<any>({
   show: false,
 });
 
+const aligns = [
+  {
+    value: 'left',
+    label: '左对齐',
+    icon: '#l-align-left',
+  },
+  {
+    value: 'center',
+    label: '垂直居中对齐',
+    icon: '#l-align-center',
+  },
+  {
+    value: 'right',
+    label: '右对齐',
+    icon: '#l-align-right',
+  },
+  {
+    value: 'top',
+    label: '顶部对齐',
+    icon: '#l-align-top',
+  },
+  {
+    value: 'middle',
+    label: '水平居中对齐',
+    icon: '#l-align-middle',
+  },
+  {
+    value: 'bottom',
+    label: '底部对齐',
+    icon: '#l-align-bottom',
+  },
+];
+
+const align = (align: string) => {
+  meta2d.alignNodesV(align, meta2d.store.active);
+};
+
 onBeforeMount(() => {
   if (inTreePanel.value) {
     data.tab = 5;
@@ -1387,5 +1447,19 @@ onUnmounted(() => {
 </script>
 <style lang="postcss" scoped>
 .props {
+  .icons {
+    display: flex;
+
+    svg:hover {
+      cursor: pointer;
+      color: var(--color-primary);
+    }
+
+    .btn {
+      font-size: 16px;
+      margin-right: 16px;
+      color: var(--color);
+    }
+  }
 }
 </style>

+ 9 - 9
src/views/components/PensProps.vue

@@ -786,7 +786,7 @@ import { updatePen } from './pen';
 
 import { useSelection } from '@/services/selections';
 import { fonts, setChildrenVisible } from '@/services/common';
-import {defaultGradientColor, defaultPureColor} from "@/services/defaults";
+import { defaultGradientColor, defaultPureColor } from '@/services/defaults';
 
 const { selections } = useSelection();
 
@@ -803,8 +803,8 @@ const aligns = [
     icon: '#l-align-left',
   },
   {
-    value: 'right',
-    label: '水平居中对齐',
+    value: 'center',
+    label: '垂直居中对齐',
     icon: '#l-align-center',
   },
   {
@@ -818,8 +818,8 @@ const aligns = [
     icon: '#l-align-top',
   },
   {
-    value: 'right',
-    label: '垂直居中对齐',
+    value: 'middle',
+    label: '水平居中对齐',
     icon: '#l-align-middle',
   },
   {
@@ -846,8 +846,8 @@ const aligns2 = [
     icon: '#l-align-left',
   },
   {
-    value: 'right',
-    label: '水平居中对齐',
+    value: 'center',
+    label: '垂直居中对齐',
     icon: '#l-align-center',
   },
   {
@@ -861,8 +861,8 @@ const aligns2 = [
     icon: '#l-align-top',
   },
   {
-    value: 'right',
-    label: '垂直居中对齐',
+    value: 'middle',
+    label: '水平居中对齐',
     icon: '#l-align-middle',
   },
   {