From c25e9dc0c8a60428283d88bb8b376f2fa92457fa Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Tue, 3 Sep 2024 18:45:33 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?=
=?UTF-8?q?=20=E4=B8=89=E8=A7=92=E5=BD=A2=E5=9B=BE=E5=BD=A2=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../data-visualization/canvas/CanvasCore.vue | 29 ++-
.../canvas/ComponentWrapper.vue | 12 +-
.../common/CommonBorderSetting.vue | 197 +++++++++++-------
3 files changed, 160 insertions(+), 78 deletions(-)
diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
index b08e47106a..5058dd97cb 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
@@ -200,7 +200,17 @@ const start = ref({
const width = ref(0)
const height = ref(0)
const isShowArea = ref(false)
-const svgFilterAttrs = ['width', 'height', 'top', 'left', 'rotate', 'backgroundColor']
+const svgFilterAttrs = [
+ 'width',
+ 'height',
+ 'top',
+ 'left',
+ 'rotate',
+ 'backgroundColor',
+ 'borderWidth',
+ 'borderStyle',
+ 'borderColor'
+]
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
const commonFilterAttrsFilterBorder = [
'width',
@@ -1569,6 +1579,23 @@ defineExpose({
:dv-info="dvInfo"
:canvas-active="canvasActive"
/>
+
{
const getComponentStyleDefault = style => {
if (config.value.component.includes('Svg')) {
- return getStyle(style, ['top', 'left', 'width', 'height', 'rotate', 'backgroundColor'])
+ return getStyle(style, [
+ 'top',
+ 'left',
+ 'width',
+ 'height',
+ 'rotate',
+ 'backgroundColor',
+ 'borderWidth',
+ 'borderStyle',
+ 'borderColor'
+ ])
} else {
return getStyle(style, style.borderActive ? commonFilterAttrs : commonFilterAttrsFilterBorder)
}
diff --git a/core/core-frontend/src/custom-component/common/CommonBorderSetting.vue b/core/core-frontend/src/custom-component/common/CommonBorderSetting.vue
index 308c11994a..075b517fbb 100644
--- a/core/core-frontend/src/custom-component/common/CommonBorderSetting.vue
+++ b/core/core-frontend/src/custom-component/common/CommonBorderSetting.vue
@@ -8,7 +8,7 @@ import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
-const { canvasStyleData } = storeToRefs(dvMainStore)
+const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
const props = withDefaults(
defineProps<{
@@ -63,6 +63,10 @@ const sizeChange = key => {
changeStyle({ key: key, value: styleInfo.value[key] })
}
+const isSvgComponent = computed(
+ () => curComponent.value && curComponent.value.component === 'SvgTriangle'
+)
+
watch(
() => styleInfo.value,
() => {
@@ -78,85 +82,126 @@ watch(
-
-
-
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+