From 8483fd828f90c05487ab0f7ccbba9510e0a3745a Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Wed, 25 Oct 2023 13:18:43 +0800
Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=8D=E7=94=A8?=
=?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E7=BF=BB=E9=A1=B5=E6=A8=A1=E5=BC=8F?=
=?UTF-8?q?=E5=88=87=E6=8D=A2=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/store/modules/data-visualization/dvMain.ts | 6 +++++-
.../components/views/components/ChartComponentS2.vue | 11 +++++++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
index 88148d13b7..1ac36ccf3c 100644
--- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
+++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
@@ -577,7 +577,11 @@ export const dvMainStore = defineStore('dataVisualization', {
} else {
viewInfo[propertyInfo.custom][propertyInfo.property] = propertyInfo.value
}
- useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
+ if (['tablePageMode', 'tablePageSize'].includes(propertyInfo.subProp)) {
+ useEmitt().emitter.emit('calcData-' + viewId, viewInfo)
+ } else {
+ useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
+ }
})
} else {
this.componentData.forEach(component => {
diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
index 74d072a1bc..6e0093baf9 100644
--- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
+++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
@@ -108,18 +108,21 @@ const renderChartFromDialog = (viewInfo: Chart, chartDataInfo) => {
chartData.value = chartDataInfo
renderChart(viewInfo, false)
}
-const renderChart = (view: Chart, resetPageInfo: boolean) => {
- if (!view) {
+const renderChart = (viewInfo: Chart, resetPageInfo: boolean) => {
+ if (!viewInfo) {
return
}
// view 为引用对象 需要存库 view.data 直接赋值会导致保存不必要的数据
const chart = {
- ...defaultsDeep(view, cloneDeep(BASE_VIEW_CONFIG)),
+ ...defaultsDeep(viewInfo, cloneDeep(BASE_VIEW_CONFIG)),
data: chartData.value
} as ChartObj
setupPage(chart, resetPageInfo)
myChart?.destroy()
- const chartView = chartViewManager.getChartView(view.render, view.type) as S2ChartView
+ const chartView = chartViewManager.getChartView(
+ viewInfo.render,
+ viewInfo.type
+ ) as S2ChartView
myChart = chartView.drawChart({
container: containerId,
chart: toRaw(chart),
From 023c17bd46a01ed28a8b978294d665389adbcef1 Mon Sep 17 00:00:00 2001
From: wisonic-s
Date: Wed, 25 Oct 2023 14:30:58 +0800
Subject: [PATCH 2/6] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=E5=B1=9E=E6=80=A7=E5=BC=80=E5=85=B3=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../collapse-switch-item/src/CollapseSwitchItem.vue | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
index c9ab2a9d91..03e4972117 100644
--- a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
+++ b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
@@ -63,5 +63,18 @@ const switchValue = computed({
align-items: center;
padding-right: 8px;
flex-grow: 1;
+ :deep(.ed-switch.is-checked .ed-switch__core > .ed-switch__action) {
+ left: calc(100% - 12px);
+ }
+ :deep(span.ed-switch__core) {
+ min-width: 24px;
+ border: none;
+ height: 6px;
+ border-radius: 3px;
+ .ed-switch__action {
+ left: 0;
+ box-shadow: 0 2px 4px rgba(31, 35, 41, 0.12);
+ }
+ }
}
From 619141fd60b44d7985806bbc33d1a834a7c0daf7 Mon Sep 17 00:00:00 2001
From: maninhill <41712985+maninhill@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:43:57 +0800
Subject: [PATCH 3/6] Update README.md
---
README.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index ccdc83186e..e7c960d412 100644
--- a/README.md
+++ b/README.md
@@ -16,9 +16,7 @@
DataEase 是开源的数据可视化分析工具,帮助用户快速分析数据并洞察业务趋势,从而实现业务的改进与优化。DataEase 支持丰富的数据源连接,能够通过拖拉拽方式快速制作图表,并可以方便的与他人分享。
-**DataEase 的工作原理:**
-
-
+
**DataEase 的优势:**
From 3bb4a31ba307977b2ddbca1706fb71784f3f0854 Mon Sep 17 00:00:00 2001
From: maninhill <41712985+maninhill@users.noreply.github.com>
Date: Wed, 25 Oct 2023 14:51:07 +0800
Subject: [PATCH 4/6] Update README.md
---
README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/README.md b/README.md
index e7c960d412..870ba7168e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@
-
|说明|
From 4ae936859f038deaf98541cb077ddeee03332552 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Wed, 25 Oct 2023 15:45:41 +0800
Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E5=BF=AB=E6=8D=B7=E9=94=AE=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0el-popover=E7=9A=84=E5=BC=B9=E6=A1=86=E7=9B=91?=
=?UTF-8?q?=E6=8E=A7=EF=BC=8C=E9=98=B2=E6=AD=A2el-popover=E5=86=85?=
=?UTF-8?q?=E9=83=A8=E6=93=8D=E4=BD=9C=E5=BD=B1=E5=93=8D=E5=A4=A7=E5=B1=8F?=
=?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
core/core-frontend/src/utils/DeShortcutKey.ts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts
index 119103a51b..2417cc911e 100644
--- a/core/core-frontend/src/utils/DeShortcutKey.ts
+++ b/core/core-frontend/src/utils/DeShortcutKey.ts
@@ -83,6 +83,11 @@ const checkDialog = () => {
haveDialog = true
}
})
+ document.querySelectorAll('.ed-popover').forEach(element => {
+ if (window.getComputedStyle(element).getPropertyValue('display') != 'none') {
+ haveDialog = true
+ }
+ })
// 富文本单框
if (document.querySelector('.tox-dialog-wrap')) {
haveDialog = true
From 74f840e0fc89fcd2fcdb6eccee6861550dc4db8d Mon Sep 17 00:00:00 2001
From: wisonic-s
Date: Wed, 25 Oct 2023 15:49:09 +0800
Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E6=8A=98=E7=BA=BF=E5=9B=BE=E5=AD=98?=
=?UTF-8?q?=E5=9C=A8=E5=AD=90=E7=BB=B4=E5=BA=A6=E6=97=B6=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E7=B1=BB=E5=88=AB=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/CollapseSwitchItem.vue | 2 +-
.../components/js/panel/charts/line/line.ts | 60 ++++++++++++++++++-
2 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
index 03e4972117..4476ca562f 100644
--- a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
+++ b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue
@@ -49,7 +49,7 @@ const switchValue = computed({
:effect="themes"
size="small"
v-model="switchValue"
- @click.stop="e => onSwitchChange(e)"
+ @click.stop="onSwitchChange"
/>
diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
index 4e43f0b772..600b280ebb 100644
--- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
+++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/line.ts
@@ -5,7 +5,7 @@ import {
import { Line as G2Line, LineOptions } from '@antv/g2plot/esm/plots/line'
import { getPadding } from '../../common/common_antv'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
-import { cloneDeep } from 'lodash-es'
+import { cloneDeep, isEmpty } from 'lodash-es'
import { valueFormatter } from '@/views/chart/components/js/formatter'
import {
LINE_AXIS_TYPE,
@@ -214,11 +214,67 @@ export class Line extends G2PlotChartView {
return tmpOptions
}
+ protected configTooltip(chart: Chart, options: LineOptions): LineOptions {
+ const customAttr: DeepPartial = parseJson(chart.customAttr)
+ const tooltipAttr = customAttr.tooltip
+ if (!tooltipAttr.show) {
+ return {
+ ...options,
+ tooltip: false
+ }
+ }
+ const xAxisExt = chart.xAxisExt
+ const formatterMap = tooltipAttr.seriesTooltipFormatter
+ ?.filter(i => i.show)
+ .reduce((pre, next) => {
+ pre[next.id] = next
+ return pre
+ }, {}) as Record
+ const tooltip: LineOptions['tooltip'] = {
+ showTitle: true,
+ customItems(originalItems) {
+ if (!tooltipAttr.seriesTooltipFormatter?.length) {
+ return originalItems
+ }
+ const head = originalItems[0]
+ // 非原始数据
+ if (!head.data.quotaList) {
+ return originalItems
+ }
+ const result = []
+ originalItems
+ .filter(item => formatterMap[item.data.quotaList[0].id])
+ .forEach(item => {
+ const formatter = formatterMap[item.data.quotaList[0].id]
+ const value = valueFormatter(parseFloat(item.value as string), formatter.formatterCfg)
+ let name = isEmpty(formatter.chartShowName) ? formatter.name : formatter.chartShowName
+ if (xAxisExt?.length > 0) {
+ name = item.data.category
+ }
+ result.push({ ...item, name, value })
+ })
+ head.data.dynamicTooltipValue?.forEach(item => {
+ const formatter = formatterMap[item.fieldId]
+ if (formatter) {
+ const value = valueFormatter(parseFloat(item.value), formatter.formatterCfg)
+ const name = isEmpty(formatter.chartShowName) ? formatter.name : formatter.chartShowName
+ result.push({ color: 'grey', name, value })
+ }
+ })
+ return result
+ }
+ }
+ return {
+ ...options,
+ tooltip
+ }
+ }
+
protected setupOptions(chart: Chart, options: LineOptions): LineOptions {
return flow(
this.configTheme,
this.configLabel,
- this.configMultiSeriesTooltip,
+ this.configTooltip,
this.configBasicStyle,
this.configCustomColors,
this.configLegend,