From f15f3cc90c3a33e82dd2fb4203eac49510f41e4e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 17 Jun 2022 19:31:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/log/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/log/index.vue b/frontend/src/views/system/log/index.vue index dfc935abe7..6dbd5649cc 100644 --- a/frontend/src/views/system/log/index.vue +++ b/frontend/src/views/system/log/index.vue @@ -54,7 +54,8 @@ export default { options: [], multiple: true, class: 'de-log-filter', - defaultOperator: 'in' + defaultOperator: 'in', + filterable: true }, { field: 'nick_name', label: this.$t('log.user'), component: 'DeComplexInput', class: 'de-log-filter' }, From d9e967a0c3e12324fb397936da9eac8079816f93 Mon Sep 17 00:00:00 2001 From: junjun Date: Fri, 17 Jun 2022 20:08:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20echarts=E8=BE=85=E5=8A=A9=E7=BA=BF?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8E=E5=AD=98=E5=9C=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/common/common.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/chart/common/common.js b/frontend/src/views/chart/chart/common/common.js index d4bf4e371e..e1e5de1641 100644 --- a/frontend/src/views/chart/chart/common/common.js +++ b/frontend/src/views/chart/chart/common/common.js @@ -216,12 +216,13 @@ export function seniorCfg(chart_option, chart) { } } } + // begin mark line settings + chart_option.series[0].markLine = { + symbol: 'none', + data: [] + } if (senior.assistLine && senior.assistLine.length > 0) { if (chart_option.series && chart_option.series.length > 0) { - chart_option.series[0].markLine = { - symbol: 'none', - data: [] - } const customStyle = JSON.parse(chart.customStyle) let xAxis, yAxis if (customStyle.xAxis) { From eb01ec59eaa661fa619603ff3aba09df2deaaa53 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Jun 2022 10:12:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2=E9=80=89=E6=8B=A9=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E5=90=8E=E8=AF=8D=E6=9D=A1=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/log/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/log/index.vue b/frontend/src/views/system/log/index.vue index 6dbd5649cc..b18632acc5 100644 --- a/frontend/src/views/system/log/index.vue +++ b/frontend/src/views/system/log/index.vue @@ -55,7 +55,8 @@ export default { multiple: true, class: 'de-log-filter', defaultOperator: 'in', - filterable: true + filterable: true, + 'reserve-keyword': true }, { field: 'nick_name', label: this.$t('log.user'), component: 'DeComplexInput', class: 'de-log-filter' }, From b53392762b6282412d380ec5f9e5b8132615e3d2 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 20 Jun 2022 14:52:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E8=A7=86=E5=9B=BE=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/chart/gauge/gauge_antv.js | 27 ++++++++++-- frontend/src/views/chart/chart/util.js | 5 +-- .../shape-attr/LabelSelectorAntV.vue | 43 ++++++++++++++++++- .../shape-attr/SizeSelectorAntV.vue | 28 +++++++++--- 4 files changed, 89 insertions(+), 14 deletions(-) diff --git a/frontend/src/views/chart/chart/gauge/gauge_antv.js b/frontend/src/views/chart/chart/gauge/gauge_antv.js index 99227c1adb..b554959fdc 100644 --- a/frontend/src/views/chart/chart/gauge/gauge_antv.js +++ b/frontend/src/views/chart/chart/gauge/gauge_antv.js @@ -1,10 +1,13 @@ import { getPadding, getTheme } from '@/views/chart/chart/common/common_antv' import { Gauge } from '@antv/g2plot' -import { DEFAULT_SIZE, DEFAULT_THRESHOLD } from '@/views/chart/chart/chart' +import { DEFAULT_LABEL, DEFAULT_SIZE, DEFAULT_THRESHOLD } from '@/views/chart/chart/chart' import { getScaleValue } from '@/components/canvas/utils/style' +import { valueFormatter } from '@/views/chart/chart/formatter' + +let labelFormatter = null export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { - let max, labelContent, startAngel, endAngel + let min, max, labelContent, startAngel, endAngel, tickCount // theme const theme = getTheme(chart) // data @@ -15,7 +18,9 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { customAttr = JSON.parse(chart.customAttr) if (customAttr.size) { const size = JSON.parse(JSON.stringify(customAttr.size)) + min = size.gaugeMin ? size.gaugeMin : DEFAULT_SIZE.gaugeMin max = size.gaugeMax ? size.gaugeMax : DEFAULT_SIZE.gaugeMax + tickCount = size.gaugeTickCount ? size.gaugeTickCount : DEFAULT_SIZE.gaugeTickCount startAngel = parseInt(size.gaugeStartAngle) * Math.PI / 180 endAngel = parseInt(size.gaugeEndAngle) * Math.PI / 180 } @@ -28,13 +33,23 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { style: ({ percent }) => ({ fontSize: parseInt(label.fontSize), color: label.color - }) + }), + formatter: function(v) { + let value + if (labelFormatter.type === 'percent') { + value = per + } else { + value = data + } + return valueFormatter(value, labelFormatter) + } } } else { labelContent = false } + labelFormatter = label.gaugeLabelFormatter ? label.gaugeLabelFormatter : DEFAULT_LABEL.gaugeLabelFormatter } - const per = (parseFloat(data) / parseFloat(max)) + const per = (parseFloat(data) - parseFloat(min)) / (parseFloat(max) - parseFloat(min)) const range = [0] let index = 0 @@ -75,9 +90,13 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { content: labelContent }, axis: { + tickInterval: 1 / tickCount, label: { style: { fontSize: getScaleValue(14, scale) // 刻度值字体大小 + }, + formatter: function(v) { + return Number(v) * (max - min) + min } }, tickLine: { diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index 381d32eece..1afb455441 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -237,14 +237,13 @@ export const TYPE_CONFIGS = [ 'alpha' ], 'size-selector-ant-v': [ + 'gaugeMin', 'gaugeMax', 'gaugeStartAngle', 'gaugeEndAngle' ], 'label-selector-ant-v': [ - 'show', - 'fontSize', - 'color' + 'labelGauge' ], 'title-selector-ant-v': [ 'show', diff --git a/frontend/src/views/chart/components/shape-attr/LabelSelectorAntV.vue b/frontend/src/views/chart/components/shape-attr/LabelSelectorAntV.vue index 81ed7e57ff..0ad8802f01 100644 --- a/frontend/src/views/chart/components/shape-attr/LabelSelectorAntV.vue +++ b/frontend/src/views/chart/components/shape-attr/LabelSelectorAntV.vue @@ -31,12 +31,48 @@ + + + + {{ $t('chart.show') }} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+