From 508a578f0b46fd083f5bdcb678d505891e949e73 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 25 Jul 2024 11:40:26 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E6=94=AF=E6=8C=81=E6=89=B9?=
=?UTF-8?q?=E9=87=8F=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../data-visualization/canvas/CanvasCore.vue | 13 ++++
.../data-visualization/canvas/Shape.vue | 15 ++--
.../visualization/ComponentEditBar.vue | 6 +-
.../editor/editor-style/ChartStyle.vue | 10 ++-
.../editor-style/ChartStyleBatchSet.vue | 11 ++-
.../src/views/data-visualization/index.vue | 75 +++++++++++--------
6 files changed, 89 insertions(+), 41 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 1532403877..daffd76982 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
@@ -1371,6 +1371,15 @@ const contextMenuShow = computed(() => {
const markLineShow = computed(() => isMainCanvas(canvasId.value))
+// 批量设置
+
+const dataVBatchOptAdaptor = () => {
+ dvMainStore.setBatchOptStatus(true)
+ areaData.value.components.forEach(component => {
+ dvMainStore.addCurBatchComponent(component)
+ })
+}
+
// 点击事件导致选择区域变更
const groupAreaClickChange = async () => {
let groupAreaCom
@@ -1378,8 +1387,12 @@ const groupAreaClickChange = async () => {
if (groupAreaHis && groupAreaHis.length > 0) {
groupAreaCom = groupAreaHis[0]
}
+ if (areaData.value.components.length === 0) {
+ dvMainStore.setBatchOptStatus(false)
+ }
// 显示Group视括组件
if (areaData.value.components.length > 1) {
+ dataVBatchOptAdaptor()
// 重新计算边界
composeStore.calcComposeArea()
if (groupAreaHis.length === 0) {
diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
index 795cdd1e5e..6387da7b24 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
@@ -59,7 +59,7 @@
:style="getPointStyle(item)"
@mousedown="handleMouseDownOnPoint(item, $event)"
>
-
+
{
const showPosition = computed(() => {
let position
- if (batchOptStatus.value) {
+ // 数据大屏批量操作合并为分组
+ if (batchOptFlag.value) {
position = 'batchOpt'
} else if (isEditMode.value) {
position = dvInfo.value.type === 'dashboard' ? 'canvas' : 'canvasDataV'
@@ -421,7 +422,7 @@ const handleInnerMouseDownOnShape = e => {
if (!canvasActive.value) {
return
}
- if (dvMainStore.batchOptStatus) {
+ if (batchOptFlag.value) {
componentEditBarRef.value.batchOptCheckOut()
e.stopPropagation()
e.preventDefault()
@@ -592,7 +593,7 @@ const selectCurComponent = e => {
}
const batchSelected = e => {
- if (dvMainStore.batchOptStatus) {
+ if (batchOptFlag.value) {
componentEditBarRef.value.batchOptCheckOut()
e.stopPropagation()
e.preventDefault()
@@ -823,7 +824,7 @@ const componentBackgroundStyle = computed(() => {
const editBarShowFlag = computed(() => {
return (
- ((active.value || batchOptStatus.value) &&
+ ((active.value || batchOptFlag.value) &&
['canvas', 'canvasDataV', 'batchOpt'].includes(showPosition.value)) ||
linkageSettingStatus.value
)
@@ -921,6 +922,10 @@ const tabMoveInCheck = async () => {
}
}
+const batchOptFlag = computed(() => {
+ return batchOptStatus.value && dashboardActive.value
+})
+
const dragCollision = computed(() => {
return active.value && Boolean(tabCollisionActiveId.value)
})
diff --git a/core/core-frontend/src/components/visualization/ComponentEditBar.vue b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
index 9302dcc6c1..dc75986ba2 100644
--- a/core/core-frontend/src/components/visualization/ComponentEditBar.vue
+++ b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
@@ -440,8 +440,10 @@ const multiplexingCheck = val => {
// 批量操作-Begin
const batchOptCheckOut = () => {
- state.batchOptCheckModel = !state.batchOptCheckModel
- batchOptChange(state.batchOptCheckModel)
+ if (showPosition.value === 'batchOpt') {
+ state.batchOptCheckModel = !state.batchOptCheckModel
+ batchOptChange(state.batchOptCheckModel)
+ }
}
const batchOptChange = val => {
diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue
index 8332d3b4b7..e6e9dc8ee8 100644
--- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue
+++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue
@@ -1,6 +1,6 @@