From 444aeffafd8360746c8d780f7fc8d0d34d978f3d Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 11 Nov 2021 16:45:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=8F=E6=96=97=E5=9B=BE=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/echartsConfigJson/widget-funnel.js | 12 +---- .../designer/widget/widgetFunnel.vue | 45 +++++++++++-------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/report-ui/src/views/report/bigscreen/designer/tools/echartsConfigJson/widget-funnel.js b/report-ui/src/views/report/bigscreen/designer/tools/echartsConfigJson/widget-funnel.js index 5208b930..279f7095 100644 --- a/report-ui/src/views/report/bigscreen/designer/tools/echartsConfigJson/widget-funnel.js +++ b/report-ui/src/views/report/bigscreen/designer/tools/echartsConfigJson/widget-funnel.js @@ -56,7 +56,7 @@ export const widgetFunnel = { name: 'fontSize', require: false, placeholder: '', - value: 12, + value: 14, }, { type: 'vue-color', @@ -80,14 +80,6 @@ export const widgetFunnel = { ], value: 'normal' }, - { - type: 'el-switch', - label: '反转', - name: 'reversal', - require: false, - placeholder: '', - value: 0 - }, ], }, { @@ -198,7 +190,7 @@ export const widgetFunnel = { { type: 'el-input-number', label: '字体大小', - name: 'fontSize', + name: 'tipFontSize', required: false, placeholder: '', value: '' diff --git a/report-ui/src/views/report/bigscreen/designer/widget/widgetFunnel.vue b/report-ui/src/views/report/bigscreen/designer/widget/widgetFunnel.vue index 6b6e696b..d8c80267 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/widgetFunnel.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/widgetFunnel.vue @@ -1,6 +1,6 @@ @@ -27,8 +27,8 @@ export default { formatter: "{a}
{b} : {c}" }, legend: { - x : 'center', - y : '92%', + x: 'center', + y: '92%', textStyle: { color: "#fff" } @@ -43,11 +43,12 @@ export default { sort: "descending", label: { normal: { + show: true, position: 'inside', formatter: '{c}', textStyle: { color: '#fff', - fontSize:14, + fontSize: 14, } }, emphasis: { @@ -110,6 +111,7 @@ export default { methods: { // 修改图标options属性 editorOptions() { + this.setCending(); this.setOptionsText(); this.setOptionsTitle(); this.setOptionsTooltip(); @@ -117,23 +119,30 @@ export default { this.setOptionsColor(); this.setOptionsData(); }, + // 翻转 + setCending(){ + const optionsSetup = this.optionsSetup; + const series = this.options.series; + if (optionsSetup.cending) { + series[0].sort = "ascending"; + } else { + series[0].sort = "descending"; + } + }, // 文字设置 setOptionsText() { const optionsSetup = this.optionsSetup; - const series = this.options.series; - - for (const key in series) { - if (series[key].type == "funnel") { - series[key].label.show = optionsSetup.isShow; - series[key].label.fontSize = optionsSetup.fontSize; - series[key].label.color = optionsSetup.color; - series[key].label.fontWeight = optionsSetup.fontWeight; - - series[key].sort = optionsSetup.reversal - ? "ascending" - : "descending"; + const normal = { + show: optionsSetup.isShow, + position: 'inside', + formatter: '{c}', + textStyle: { + color: optionsSetup.color, + fontSize: optionsSetup.fontSize, + fontWeight: optionsSetup.fontWeight, } } + this.options.series[0].label['normal'] = normal; }, // 标题修改 setOptionsTitle() { @@ -164,7 +173,7 @@ export default { show: true, textStyle: { color: optionsSetup.lineColor, - fontSize: optionsSetup.fontSize + fontSize: optionsSetup.tipFontSize } }; this.options.tooltip = tooltip; @@ -182,7 +191,7 @@ export default { legend.orient = optionsSetup.layoutFront; legend.textStyle = { color: optionsSetup.lengedColor, - fontSize: optionsSetup.fontSize + fontSize: optionsSetup.lengedFontSize }; legend.itemWidth = optionsSetup.lengedWidth; },