From cd1492360d32bf96f48bab44d009104818e2a70f Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Wed, 12 Feb 2025 17:31:43 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20Tab=E6=A0=87=E9=A2=98?=
=?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=E8=BE=B9=E6=A1=86=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../custom-component/de-tabs/Component.vue | 117 +++++++++++++-----
.../de-tabs/TabBackgroundOverall.vue | 80 +++++++-----
core/core-frontend/src/locales/en.ts | 2 +-
core/core-frontend/src/locales/tw.ts | 2 +-
core/core-frontend/src/utils/canvasUtils.ts | 6 +-
5 files changed, 144 insertions(+), 63 deletions(-)
diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue
index f0dd01f948..761e74d869 100644
--- a/core/core-frontend/src/custom-component/de-tabs/Component.vue
+++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue
@@ -30,34 +30,54 @@
>
-
{{ tabItem.title }}
-
-
-
+ {{ tabItem.title }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('visualization.edit_title') }}
+
+
+ {{ t('visualization.copy') }}
+
+
+ {{ t('visualization.delete') }}
+
+
+
+
-
-
-
- {{ t('visualization.edit_title') }}
-
-
- {{ t('visualization.copy') }}
-
-
- {{ t('visualization.delete') }}
-
-
-
-
+
@@ -150,6 +170,7 @@ import { deepCopyTabItemHelper } from '@/store/modules/data-visualization/copy'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import { useI18n } from '@/hooks/web/useI18n'
import { imgUrlTrans } from '@/utils/imgUtils'
+import Board from '@/components/de-board/Board.vue'
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const { tabMoveInActiveId, bashMatrixInfo, editMode, mobileInPc } = storeToRefs(dvMainStore)
@@ -216,6 +237,37 @@ const {
searchCount
} = toRefs(props)
+const titleBackgroundActiveSvgInner = computed(() => {
+ return element.value.titleBackground.active.innerImage.replace('board/', '').replace('.svg', '')
+})
+
+const titleBackgroundInActiveSvgInner = computed(() => {
+ return element.value.titleBackground.inActive.innerImage.replace('board/', '').replace('.svg', '')
+})
+
+const svgInnerInActiveEnable = itemName => {
+ const { backgroundImageEnable, backgroundType, innerImage } =
+ element.value.titleBackground.inActive
+ return (
+ editableTabsValue.value !== itemName &&
+ element.value.titleBackground?.enable &&
+ backgroundImageEnable &&
+ backgroundType === 'innerImage' &&
+ typeof innerImage === 'string'
+ )
+}
+
+const svgInnerActiveEnable = itemName => {
+ const { backgroundImageEnable, backgroundType, innerImage } = element.value.titleBackground.active
+ return (
+ editableTabsValue.value === itemName &&
+ element.value.titleBackground?.enable &&
+ backgroundImageEnable &&
+ backgroundType === 'innerImage' &&
+ typeof innerImage === 'string'
+ )
+}
+
const handleMouseEnter = () => {
state.hoverFlag = true
}
@@ -475,7 +527,8 @@ const titleStyle = itemName => {
textDecoration: element.value.style.textDecoration,
fontStyle: element.value.style.fontStyle,
fontWeight: element.value.style.fontWeight,
- fontSize: (element.value.style.activeFontSize || 18) * scale.value + 'px'
+ fontSize: (element.value.style.activeFontSize || 18) * scale.value + 'px',
+ lineHeight: (element.value.style.activeFontSize || 18) * scale.value + 'px'
}
if (element.value.titleBackground?.enable) {
style = {
@@ -488,7 +541,8 @@ const titleStyle = itemName => {
textDecoration: element.value.style.textDecoration,
fontStyle: element.value.style.fontStyle,
fontWeight: element.value.style.fontWeight,
- fontSize: (element.value.style.fontSize || 16) * scale.value + 'px'
+ fontSize: (element.value.style.fontSize || 16) * scale.value + 'px',
+ lineHeight: (element.value.style.fontSize || 16) * scale.value + 'px'
}
if (element.value.titleBackground?.enable) {
style = {
@@ -635,6 +689,7 @@ onBeforeMount(() => {
}
:deep(.ed-tabs__item) {
font-family: inherit;
+ padding-right: 0 !important;
}
}
@@ -688,7 +743,11 @@ onBeforeMount(() => {
}
.custom-tab-title {
.title-inner {
+ position: relative;
background-size: 100% 100% !important;
}
+ :deep(.ed-dropdown) {
+ vertical-align: middle !important;
+ }
}
diff --git a/core/core-frontend/src/custom-component/de-tabs/TabBackgroundOverall.vue b/core/core-frontend/src/custom-component/de-tabs/TabBackgroundOverall.vue
index 2bff95637a..08ddaa767b 100644
--- a/core/core-frontend/src/custom-component/de-tabs/TabBackgroundOverall.vue
+++ b/core/core-frontend/src/custom-component/de-tabs/TabBackgroundOverall.vue
@@ -1,9 +1,10 @@