From 690258ccabb0c95c4e288ca81c1a531bb872e6b0 Mon Sep 17 00:00:00 2001 From: qianming Date: Wed, 19 Jan 2022 16:26:33 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/configure/widget-more-bar-line.js | 27 ++++++---- .../widget/bar/widgetBarlinechart.vue | 4 +- .../widget/bar/widgetMoreBarLineChart.vue | 50 ++++++++++++++++--- 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js index 1b6b2713..2c100ee6 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js @@ -229,10 +229,10 @@ export const widgetMoreBarLine = { { type: 'el-input-text', label: '图例名称', - name: 'layerName', + name: 'legendName', required: false, - placeholder: '', - value: '', + placeholder: '多值以英文,隔开', + value: '成功,失败,终止,成功率' }, { type: 'vue-color', @@ -248,7 +248,7 @@ export const widgetMoreBarLine = { name: 'lengedFontSize', required: false, placeholder: '', - value: 16, + value: 12, }, { type: 'el-input-number', @@ -256,7 +256,7 @@ export const widgetMoreBarLine = { name: 'lengedWidth', required: false, placeholder: '', - value: 15, + value: 12, }, { type: 'el-select', @@ -268,7 +268,7 @@ export const widgetMoreBarLine = { {code: 'left', name: '左对齐'}, {code: 'right', name: '右对齐'}, ], - value: '' + value: 'left' }, { type: 'el-select', @@ -280,7 +280,7 @@ export const widgetMoreBarLine = { {code: 'top', name: '顶部'}, {code: 'bottom', name: '底部'}, ], - value: '' + value: 'top' }, { type: 'el-select', @@ -292,7 +292,7 @@ export const widgetMoreBarLine = { {code: 'vertical', name: '竖排'}, {code: 'horizontal', name: '横排'}, ], - value: '未销,核销,总共,比例' + value: 'horizontal' }, ], }, @@ -655,7 +655,12 @@ export const widgetMoreBarLine = { label: '', name: 'customColor', required: false, - value: [{color: '#00F4FFFF'}, {color: '#e68b55'}], + value: [ + {color: '#4bdfff'}, + {color: '#5dc1fd'}, + {color: '#55f49c'}, + {color: '#ffa43a'}, + ], }, ], }, @@ -745,7 +750,7 @@ export const widgetMoreBarLine = { name: 'width', required: false, placeholder: '该容器在1920px大屏中的宽度', - value: 400, + value: 500, }, { type: 'el-input-number', @@ -753,7 +758,7 @@ export const widgetMoreBarLine = { name: 'height', required: false, placeholder: '该容器在1080px大屏中的高度', - value: 200, + value: 300, }, ], } diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarlinechart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarlinechart.vue index ecdceb1a..c605d19f 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarlinechart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarlinechart.vue @@ -134,7 +134,7 @@ export default { this.setOptionsTitle(); this.setOptionsX(); this.setOptionsY(); - this.setOptionsTop(); + this.setOptionsLine(); this.setOptionsBar(); this.setOptionsTooltip(); this.setOptionsData(); @@ -262,7 +262,7 @@ export default { this.options.yAxis = yAxis; }, // 折线设置 数值设置 - setOptionsTop() { + setOptionsLine() { const optionsSetup = this.optionsSetup; const series = this.options.series; for (const key in series) { diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index 460d153d..429b0483 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -172,7 +172,7 @@ export default { lineStyle: { color: "#ffa43a" }, - data: [4.2, 3.8, 4.8, 3.5, 2.9, 2.8, 3, 5] + data: [4.2, 3.8, 4.8, 3.5, 2.9, 2.8, 3, 5, 2] } ] } @@ -215,14 +215,15 @@ export default { this.setOptionsTitle(); this.setOptionsX(); this.setOptionsY(); - /* - this.setOptionsTop(); + this.setOptionsLegend(); + this.setOptionsLine(); this.setOptionsBar(); this.setOptionsTooltip(); - this.setOptionsData(); this.setOptionsMargin(); - this.setOptionsLegend(); - this.setOptionsColor();*/ + this.setOptionsColor(); + /* + this.setOptionsData(); + */ }, // 标题修改 setOptionsTitle() { @@ -340,6 +341,40 @@ export default { ]; this.options.yAxis = yAxis; }, + // 折线设置 数值设置 + setOptionsLine() { + const optionsSetup = this.optionsSetup; + const series = this.options.series; + for (const key in series) { + if (series[key].type == "line") { + series[key].showSymbol = optionsSetup.markPoint; + series[key].symbolSize = optionsSetup.pointSize; + series[key].smooth = optionsSetup.smoothCurve; + if (optionsSetup.area) { + series[key].areaStyle = { + opacity: optionsSetup.areaThickness / 100 + }; + } else { + series[key].areaStyle = { + opacity: 0 + }; + } + series[key].lineStyle = { + width: optionsSetup.lineWidth + }; + series[key].itemStyle.borderRadius = optionsSetup.radius; + series[key].label = { + show: optionsSetup.isShowLine, + position: "top", + distance: optionsSetup.distanceLine, + fontSize: optionsSetup.fontSizeLine, + color: optionsSetup.subTextColorLine, + fontWeight: optionsSetup.fontWeightLine + }; + } + } + this.options.series = series; + }, // 柱体设置 数值设置 setOptionsBar() { const optionsSetup = this.optionsSetup; @@ -389,6 +424,9 @@ export default { setOptionsLegend() { const optionsSetup = this.optionsSetup; const legend = this.options.legend; + let legendName = optionsSetup.legendName; + let arr = legendName.split(",") + legend.data = arr; legend.show = optionsSetup.isShowLegend; legend.left = optionsSetup.lateralPosition; legend.top = optionsSetup.longitudinalPosition == "top" ? 0 : "auto"; From 418cd5f5fa9c050d209acd518f828621c8a7cf57 Mon Sep 17 00:00:00 2001 From: qianming Date: Wed, 19 Jan 2022 17:00:27 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/configure/widget-more-bar-line.js | 15 ++---- .../widget/bar/widgetMoreBarLineChart.vue | 51 +++++++++++-------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js index 2c100ee6..81bae9cb 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js @@ -48,7 +48,7 @@ export const widgetMoreBarLine = { name: 'pointSize', required: false, placeholder: '', - value: 5, + value: 3, }, { type: 'el-switch', @@ -56,7 +56,7 @@ export const widgetMoreBarLine = { name: 'smoothCurve', required: false, placeholder: '', - value: true, + value: false, }, { type: 'el-switch', @@ -103,14 +103,6 @@ export const widgetMoreBarLine = { placeholder: '', value: 5, }, - { - type: 'el-slider', - label: '最小高度', - name: 'minHeight', - require: false, - placeholder: '', - value: 0, - }, ], }, { @@ -265,10 +257,11 @@ export const widgetMoreBarLine = { required: false, placeholder: '', selectOptions: [ + {code: 'center', name: '居中'}, {code: 'left', name: '左对齐'}, {code: 'right', name: '右对齐'}, ], - value: 'left' + value: 'center' }, { type: 'el-select', diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index 429b0483..f25397f6 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -114,7 +114,7 @@ export default { barBorderRadius: 6, }, }, - data: [400, 400, 300, 300, 300, 400, 400, 400, 300] + data: [] }, { name: '调解失败', @@ -133,7 +133,7 @@ export default { } }, - data: [400, 500, 500, 500, 500, 400, 400, 500, 500] + data: [] }, { name: '调解终止', @@ -151,14 +151,13 @@ export default { barBorderRadius: 6, } }, - data: [400, 600, 700, 700, 1000, 400, 400, 600, 700] + data: [] }, { name: "调解成功率", type: "line", yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用 smooth: false, //平滑曲线显示 - symbol: "circle", //标记的图形为实心圆 symbolSize: 8, //标记的大小 itemStyle: { @@ -172,7 +171,7 @@ export default { lineStyle: { color: "#ffa43a" }, - data: [4.2, 3.8, 4.8, 3.5, 2.9, 2.8, 3, 5, 2] + data: [] } ] } @@ -221,9 +220,7 @@ export default { this.setOptionsTooltip(); this.setOptionsMargin(); this.setOptionsColor(); - /* this.setOptionsData(); - */ }, // 标题修改 setOptionsTitle() { @@ -390,8 +387,7 @@ export default { fontWeight: optionsSetup.fontWeightBar }; series[key].barWidth = optionsSetup.maxWidth; - series[key].barMinHeight = optionsSetup.minHeight; - series[key].itemStyle.barBorderRadius = optionsSetup.radius; + series[key].itemStyle.normal['barBorderRadius'] = optionsSetup.radius; } } this.options.series = series; @@ -423,9 +419,13 @@ export default { }, setOptionsLegend() { const optionsSetup = this.optionsSetup; + const series = this.options.series; const legend = this.options.legend; let legendName = optionsSetup.legendName; let arr = legendName.split(",") + for (const i in series) { + series[i].name = arr[i]; + } legend.data = arr; legend.show = optionsSetup.isShowLegend; legend.left = optionsSetup.lateralPosition; @@ -443,13 +443,19 @@ export default { setOptionsColor() { const optionsSetup = this.optionsSetup; const customColor = optionsSetup.customColor; + const series = this.options.series; if (!customColor) return; const arrColor = []; for (let i = 0; i < customColor.length; i++) { arrColor.push(customColor[i].color); } - this.options.color = arrColor; - this.options = Object.assign({}, this.options); + for (const i in series) { + if (series[i].type == "bar") { + series[i].itemStyle.normal['color'] = arrColor[i]; + }else { + series[i].lineStyle["color"] = arrColor[i]; + } + } }, // 数据处理 setOptionsData() { @@ -461,23 +467,24 @@ export default { staticDataFn(val) { const series = this.options.series; let axis = []; - let bar = []; + let bar1 = []; + let bar2 = []; + let bar3 = []; let line = []; for (const i in val) { - axis[i] = val[i].axis; - bar[i] = val[i].bar; - line[i] = val[i].line; + axis[i] = val[i].date; + bar1[i] = val[i].unsales; + bar2[i] = val[i].manus; + bar3[i] = val[i].rework; + line[i] = val[i].sales; } // x轴 this.options.xAxis.data = axis; // series - for (const i in series) { - if (series[i].type == "bar") { - series[i].data = bar; - } else { - series[i].data = line; - } - } + series[0].data = bar1; + series[1].data = bar2; + series[2].data = bar3; + series[3].data = line; }, dynamicDataFn(val, refreshTime) { if (!val) return; From b36765fae45a7100fda7e7a9fe5cad7f08a38ef9 Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 20 Jan 2022 14:46:19 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- report-ui/src/mixins/queryform.js | 1 + .../tools/configure/widget-more-bar-line.js | 2 +- .../widget/bar/widgetMoreBarLineChart.vue | 183 +++++++++++------- 3 files changed, 113 insertions(+), 73 deletions(-) diff --git a/report-ui/src/mixins/queryform.js b/report-ui/src/mixins/queryform.js index 62d8273d..4454041d 100644 --- a/report-ui/src/mixins/queryform.js +++ b/report-ui/src/mixins/queryform.js @@ -139,6 +139,7 @@ export default { const seriesData = []; const value = chartProperties[key]; obj["type"] = value; + obj["name"] = key; for (let i = 0; i < data.length; i++) { if (value.startsWith("xAxis")) { // 代表为x轴 diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js index 81bae9cb..246dc047 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js @@ -224,7 +224,7 @@ export const widgetMoreBarLine = { name: 'legendName', required: false, placeholder: '多值以英文,隔开', - value: '成功,失败,终止,成功率' + value: '' }, { type: 'vue-color', diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index f25397f6..675d6f5c 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -215,8 +215,7 @@ export default { this.setOptionsX(); this.setOptionsY(); this.setOptionsLegend(); - this.setOptionsLine(); - this.setOptionsBar(); + this.setOptionsLegendName(); this.setOptionsTooltip(); this.setOptionsMargin(); this.setOptionsColor(); @@ -338,60 +337,6 @@ export default { ]; this.options.yAxis = yAxis; }, - // 折线设置 数值设置 - setOptionsLine() { - const optionsSetup = this.optionsSetup; - const series = this.options.series; - for (const key in series) { - if (series[key].type == "line") { - series[key].showSymbol = optionsSetup.markPoint; - series[key].symbolSize = optionsSetup.pointSize; - series[key].smooth = optionsSetup.smoothCurve; - if (optionsSetup.area) { - series[key].areaStyle = { - opacity: optionsSetup.areaThickness / 100 - }; - } else { - series[key].areaStyle = { - opacity: 0 - }; - } - series[key].lineStyle = { - width: optionsSetup.lineWidth - }; - series[key].itemStyle.borderRadius = optionsSetup.radius; - series[key].label = { - show: optionsSetup.isShowLine, - position: "top", - distance: optionsSetup.distanceLine, - fontSize: optionsSetup.fontSizeLine, - color: optionsSetup.subTextColorLine, - fontWeight: optionsSetup.fontWeightLine - }; - } - } - this.options.series = series; - }, - // 柱体设置 数值设置 - setOptionsBar() { - const optionsSetup = this.optionsSetup; - const series = this.options.series; - for (const key in series) { - if (series[key].type == "bar") { - series[key].label = { - show: optionsSetup.isShowBar, - position: "top", - distance: optionsSetup.distanceBar, - fontSize: optionsSetup.fontSizeBar, - color: optionsSetup.subTextColorBar, - fontWeight: optionsSetup.fontWeightBar - }; - series[key].barWidth = optionsSetup.maxWidth; - series[key].itemStyle.normal['barBorderRadius'] = optionsSetup.radius; - } - } - this.options.series = series; - }, // tooltip 设置 setOptionsTooltip() { const optionsSetup = this.optionsSetup; @@ -419,14 +364,7 @@ export default { }, setOptionsLegend() { const optionsSetup = this.optionsSetup; - const series = this.options.series; const legend = this.options.legend; - let legendName = optionsSetup.legendName; - let arr = legendName.split(",") - for (const i in series) { - series[i].name = arr[i]; - } - legend.data = arr; legend.show = optionsSetup.isShowLegend; legend.left = optionsSetup.lateralPosition; legend.top = optionsSetup.longitudinalPosition == "top" ? 0 : "auto"; @@ -439,6 +377,16 @@ export default { }; legend.itemWidth = optionsSetup.lengedWidth; }, + setOptionsLegendName() { + const optionsSetup = this.optionsSetup; + const legend = this.options.legend; + const legendName = optionsSetup.legendName; + if (legendName != null) { + const arr = legendName.split("|"); + console.log(arr) + legend.data = arr; + } + }, // 颜色修改 setOptionsColor() { const optionsSetup = this.optionsSetup; @@ -452,7 +400,7 @@ export default { for (const i in series) { if (series[i].type == "bar") { series[i].itemStyle.normal['color'] = arrColor[i]; - }else { + } else { series[i].lineStyle["color"] = arrColor[i]; } } @@ -465,7 +413,9 @@ export default { : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); }, staticDataFn(val) { + const optionsSetup = this.optionsSetup; const series = this.options.series; + const legendName = []; let axis = []; let bar1 = []; let bar2 = []; @@ -481,10 +431,54 @@ export default { // x轴 this.options.xAxis.data = axis; // series + for (const i in series) { + if (series[i].type == "bar") { + series[i].label = { + show: optionsSetup.isShowBar, + position: "top", + distance: optionsSetup.distanceBar, + fontSize: optionsSetup.fontSizeBar, + color: optionsSetup.subTextColorBar, + fontWeight: optionsSetup.fontWeightBar + }; + series[i].barWidth = optionsSetup.maxWidth; + series[i].itemStyle.normal['barBorderRadius'] = optionsSetup.radius; + } else if (series[i].type == "line") { + series[i].yAxisIndex = 1; + series[i].showSymbol = optionsSetup.markPoint; + series[i].symbolSize = optionsSetup.pointSize; + series[i].smooth = optionsSetup.smoothCurve; + if (optionsSetup.area) { + series[i].areaStyle = { + opacity: optionsSetup.areaThickness / 100 + }; + } else { + series[i].areaStyle = { + opacity: 0 + }; + } + series[i].lineStyle = { + width: optionsSetup.lineWidth + }; + series[i].label = { + show: optionsSetup.isShowLine, + position: "top", + distance: optionsSetup.distanceLine, + fontSize: optionsSetup.fontSizeLine, + color: optionsSetup.subTextColorLine, + fontWeight: optionsSetup.fontWeightLine + }; + } + } series[0].data = bar1; series[1].data = bar2; series[2].data = bar3; series[3].data = line; + legendName.push(series[0].name); + legendName.push(series[1].name); + legendName.push(series[2].name); + legendName.push(series[3].name); + this.options.legend["data"] = legendName; }, dynamicDataFn(val, refreshTime) { if (!val) return; @@ -504,16 +498,61 @@ export default { }); }, renderingFn(val) { + const optionsSetup = this.optionsSetup; this.options.xAxis.data = val.xAxis; - // series - const series = this.options.series; - for (const i in series) { - for (const j in val.series) { - if (series[i].type == val.series[j].type) { - series[i].data = val.series[j].data; + this.options.series = val.series; + const legendName = []; + for (const i in val.series) { + if (val.series[i].type == "bar") { + val.series[i].name = val.series[i].name; + val.series[i].type = val.series[i].type; + val.series[i].label = { + show: optionsSetup.isShowBar, + position: "top", + distance: optionsSetup.distanceBar, + fontSize: optionsSetup.fontSizeBar, + color: optionsSetup.subTextColorBar, + fontWeight: optionsSetup.fontWeightBar + }; + val.series[i].barWidth = optionsSetup.maxWidth; + val.series[i].itemStyle = { + normal: { + barBorderRadius: optionsSetup.radius, + } + }; + val.series[i].data = val.series[i].data; + } else if (val.series[i].type == "line") { + val.series[i].name = val.series[i].name; + val.series[i].type = val.series[i].type; + val.series[i].yAxisIndex = 1; + val.series[i].showSymbol = optionsSetup.markPoint; + val.series[i].symbolSize = optionsSetup.pointSize; + val.series[i].smooth = optionsSetup.smoothCurve; + if (optionsSetup.area) { + val.series[i].areaStyle = { + opacity: optionsSetup.areaThickness / 100 + }; + } else { + val.series[i].areaStyle = { + opacity: 0 + }; } - } - } + val.series[i].lineStyle = { + width: optionsSetup.lineWidth + }; + val.series[i].label = { + show: optionsSetup.isShowLine, + position: "top", + distance: optionsSetup.distanceLine, + fontSize: optionsSetup.fontSizeLine, + color: optionsSetup.subTextColorLine, + fontWeight: optionsSetup.fontWeightLine + }; + val.series[i].data = val.series[i].data; + }; + legendName.push(val.series[i].name); + }; + this.options.legend["data"] = legendName; } } }; From 4a92396a31e5fd5755391ed9d99c486845b0db0e Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 20 Jan 2022 15:04:19 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/bar/widgetMoreBarLineChart.vue | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index 675d6f5c..59e12ea1 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -383,7 +383,6 @@ export default { const legendName = optionsSetup.legendName; if (legendName != null) { const arr = legendName.split("|"); - console.log(arr) legend.data = arr; } }, @@ -500,13 +499,15 @@ export default { renderingFn(val) { const optionsSetup = this.optionsSetup; this.options.xAxis.data = val.xAxis; - this.options.series = val.series; + const series = []; + // this.options.series = val.series; const legendName = []; for (const i in val.series) { + const obj = {}; if (val.series[i].type == "bar") { - val.series[i].name = val.series[i].name; - val.series[i].type = val.series[i].type; - val.series[i].label = { + obj.name = val.series[i].name; + obj.type = val.series[i].type; + obj.label = { show: optionsSetup.isShowBar, position: "top", distance: optionsSetup.distanceBar, @@ -514,33 +515,34 @@ export default { color: optionsSetup.subTextColorBar, fontWeight: optionsSetup.fontWeightBar }; - val.series[i].barWidth = optionsSetup.maxWidth; - val.series[i].itemStyle = { + obj.barWidth = optionsSetup.maxWidth; + obj.itemStyle = { normal: { barBorderRadius: optionsSetup.radius, } }; - val.series[i].data = val.series[i].data; + obj.data = val.series[i].data; + series.push(obj); } else if (val.series[i].type == "line") { - val.series[i].name = val.series[i].name; - val.series[i].type = val.series[i].type; - val.series[i].yAxisIndex = 1; - val.series[i].showSymbol = optionsSetup.markPoint; - val.series[i].symbolSize = optionsSetup.pointSize; - val.series[i].smooth = optionsSetup.smoothCurve; + obj.name = val.series[i].name; + obj.type = val.series[i].type; + obj.yAxisIndex = 1; + obj.showSymbol = optionsSetup.markPoint; + obj.symbolSize = optionsSetup.pointSize; + obj.smooth = optionsSetup.smoothCurve; if (optionsSetup.area) { - val.series[i].areaStyle = { + obj.areaStyle = { opacity: optionsSetup.areaThickness / 100 }; } else { - val.series[i].areaStyle = { + obj.areaStyle = { opacity: 0 }; } - val.series[i].lineStyle = { + obj.lineStyle = { width: optionsSetup.lineWidth }; - val.series[i].label = { + obj.label = { show: optionsSetup.isShowLine, position: "top", distance: optionsSetup.distanceLine, @@ -548,11 +550,13 @@ export default { color: optionsSetup.subTextColorLine, fontWeight: optionsSetup.fontWeightLine }; - val.series[i].data = val.series[i].data; - }; + obj.data = val.series[i].data; + series.push(obj); + } legendName.push(val.series[i].name); - }; - this.options.legend["data"] = legendName; + } + this.options.legend["data"] = legendName; + this.options.series = series; } } }; From a263bce35f5ad4168c1beca2e0cb3797bb1930c3 Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 20 Jan 2022 16:11:51 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=95=B0=E6=8D=AE=E5=9B=BE=E4=BE=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/configure/widget-more-bar-line.js | 2 +- .../widget/bar/widgetMoreBarLineChart.vue | 117 +++++++++--------- 2 files changed, 62 insertions(+), 57 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js index 246dc047..c85aa512 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-more-bar-line.js @@ -223,7 +223,7 @@ export const widgetMoreBarLine = { label: '图例名称', name: 'legendName', required: false, - placeholder: '多值以英文,隔开', + placeholder: '多值以'|'隔开', value: '' }, { diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index 59e12ea1..8fb2b5ff 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -1,15 +1,15 @@ -