From 234ff615bab83252b49f8c4beef248c6c17a5654 Mon Sep 17 00:00:00 2001 From: qianming Date: Fri, 13 Oct 2023 16:57:15 +0800 Subject: [PATCH] =?UTF-8?q?feat--=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AE=BE=E5=AE=9A=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=99=BE=E5=88=86=E6=AF=94=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/configure/barCharts/widget-bar-stack.js | 10 +++++++++- .../tools/configure/barCharts/widget-barchart.js | 2 +- .../configure/barCharts/widget-gradient-barchart.js | 10 +++++++++- .../designer/widget/bar/widgetBarStackChart.vue | 2 ++ .../designer/widget/bar/widgetBarchart.vue | 4 ++-- .../widget/bar/widgetGradientColorBarchart.vue | 7 ++++--- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-bar-stack.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-bar-stack.js index a3ff0f9a..c4461a68 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-bar-stack.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-bar-stack.js @@ -536,6 +536,14 @@ export const widgetBarStack = { placeholder: '', value: false }, + { + type: 'el-switch', + label: '百分比符号显示', + name: 'percentSign', + required: false, + placeholder: '', + value: false + }, { type: 'el-input-number', label: '字体字号', @@ -550,7 +558,7 @@ export const widgetBarStack = { name: 'dataColor', required: false, placeholder: '', - value: '#fff' + value: '' }, { type: 'el-select', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-barchart.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-barchart.js index 87435a35..93494c6a 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-barchart.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-barchart.js @@ -574,7 +574,7 @@ export const widgetBarchart = { name: 'dataColor', required: false, placeholder: '', - value: '#fff' + value: '' }, { type: 'el-select', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-gradient-barchart.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-gradient-barchart.js index 4a6bfcdb..b5a51025 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-gradient-barchart.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-gradient-barchart.js @@ -426,6 +426,14 @@ export const widgetGradientBarchart = { placeholder: '', value: true }, + { + type: 'el-switch', + label: '百分比符号显示', + name: 'percentSign', + required: false, + placeholder: '', + value: false + }, { type: 'el-input-number', label: '距离', @@ -538,7 +546,7 @@ export const widgetGradientBarchart = { name: 'bar100color', required: false, placeholder: '', - value: 'rgba(0,77,167,1)' + value: 'rgba(255, 69, 0, 1)' }, { type: 'vue-color', diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarStackChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarStackChart.vue index 0063b75e..590684c1 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarStackChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarStackChart.vue @@ -369,6 +369,7 @@ export default { fontSize: optionsSetup.fontSize, color: optionsSetup.dataColor, fontWeight: optionsSetup.fontWeight, + formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}' }, //颜色,圆角属性 itemStyle: { @@ -450,6 +451,7 @@ export default { fontSize: optionsSetup.fontSize, color: optionsSetup.dataColor, fontWeight: optionsSetup.fontWeight, + formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}' }, //颜色,圆角属性 itemStyle: { diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue index 1341a049..e7c90c5b 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue @@ -392,10 +392,10 @@ export default { }; } series[i].data = data; - this.options.legend["data"] = legendName; - this.setOptionsLegendName(legendName); } } + this.options.legend["data"] = legendName; + this.setOptionsLegendName(legendName); }, // 动态数据 dynamicDataFn(refreshTime) { diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue index 6dd3e050..0c883187 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue @@ -314,6 +314,7 @@ export default { fontSize: optionsSetup.fontSize, color: optionsSetup.dataColor, fontWeight: optionsSetup.fontWeight, + formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}' }; } else { series[0].label = { @@ -323,6 +324,7 @@ export default { fontSize: optionsSetup.fontSize, color: optionsSetup.dataColor, fontWeight: optionsSetup.fontWeight, + formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}' }; } series[0].barWidth = optionsSetup.maxWidth; @@ -360,7 +362,7 @@ export default { let normal = {}; if (optionsSetup.verticalShow) { normal = { - color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [ + color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: optionsSetup.bar0color, // 0% 处的颜色 @@ -376,7 +378,7 @@ export default { }; } else { normal = { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ { offset: 0, color: optionsSetup.bar0color, // 0% 处的颜色 @@ -395,7 +397,6 @@ export default { }, // 数据解析 setOptionsData(e, paramsConfig) { - const optionsSetup = this.optionsSetup; const optionsData = this.optionsData; // 数据类型 静态 or 动态 // 联动接收者逻辑开始 optionsData.dynamicData = optionsData.dynamicData || {}; // 兼容 dynamicData undefined