From bff5bb3d2250f4bd32ad2fe487335f1cd7e488df Mon Sep 17 00:00:00 2001 From: qianming Date: Fri, 11 Mar 2022 16:18:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=B1=E7=8A=B6=E5=9B=BE=E3=80=81=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E5=9B=BE=E4=BE=8B=E5=8A=9F=E8=83=BD=E5=8E=BB?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/configure/widget-barchart.js | 85 +----------------- .../configure/widget-gradient-barchart.js | 82 ----------------- .../tools/configure/widget-linechart.js | 88 +------------------ .../designer/widget/bar/widgetBarchart.vue | 47 +--------- .../bar/widgetGradientColorBarchart.vue | 47 +--------- .../designer/widget/line/widgetLinechart.vue | 47 +--------- 6 files changed, 8 insertions(+), 388 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-barchart.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-barchart.js index d7f401c5..8b8060a9 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-barchart.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-barchart.js @@ -170,88 +170,6 @@ export const widgetBarchart = { }, ], }, - { - name: '图例操作', - list: [ - { - type: 'el-switch', - label: '图例显示', - name: 'isShowLegend', - required: false, - placeholder: '', - value: true, - }, - { - type: 'el-input-text', - label: '图例名称', - name: 'legendName', - required: false, - placeholder: '', - value: '' - }, - { - type: 'vue-color', - label: '字体颜色', - name: 'lengedColor', - required: false, - placeholder: '', - value: '#fff', - }, - { - type: 'el-input-number', - label: '字体字号', - name: 'lengedFontSize', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-input-number', - label: '图例宽度', - name: 'lengedWidth', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-select', - label: '横向位置', - name: 'lateralPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'center', name: '居中'}, - {code: 'left', name: '左对齐'}, - {code: 'right', name: '右对齐'}, - ], - value: 'center' - }, - { - type: 'el-select', - label: '纵向位置', - name: 'longitudinalPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'top', name: '顶部'}, - {code: 'bottom', name: '底部'}, - ], - value: 'top' - }, - { - type: 'el-select', - label: '布局前置', - name: 'layoutFront', - required: false, - placeholder: '', - selectOptions: [ - {code: 'vertical', name: '竖排'}, - {code: 'horizontal', name: '横排'}, - ], - value: 'horizontal' - }, - ], - }, { name: 'X轴设置', list: [ @@ -519,9 +437,10 @@ export const widgetBarchart = { { type: 'el-input-number', label: '字体字号', - name: 'tipFontSize', + name: 'tipsFontSize', required: false, placeholder: '', + value: 16 }, { type: 'vue-color', diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-gradient-barchart.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-gradient-barchart.js index 6b1dac1a..1cc09b41 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-gradient-barchart.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-gradient-barchart.js @@ -162,88 +162,6 @@ export const widgetGradientBarchart = { }, ], }, - { - name: '图例操作', - list: [ - { - type: 'el-switch', - label: '图例显示', - name: 'isShowLegend', - required: false, - placeholder: '', - value: true, - }, - { - type: 'el-input-text', - label: '图例名称', - name: 'legendName', - required: false, - placeholder: '', - value: '' - }, - { - type: 'vue-color', - label: '字体颜色', - name: 'lengedColor', - required: false, - placeholder: '', - value: '#fff', - }, - { - type: 'el-input-number', - label: '字体字号', - name: 'lengedFontSize', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-input-number', - label: '图例宽度', - name: 'lengedWidth', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-select', - label: '横向位置', - name: 'lateralPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'center', name: '居中'}, - {code: 'left', name: '左对齐'}, - {code: 'right', name: '右对齐'}, - ], - value: 'center' - }, - { - type: 'el-select', - label: '纵向位置', - name: 'longitudinalPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'top', name: '顶部'}, - {code: 'bottom', name: '底部'}, - ], - value: 'top' - }, - { - type: 'el-select', - label: '布局前置', - name: 'layoutFront', - required: false, - placeholder: '', - selectOptions: [ - {code: 'vertical', name: '竖排'}, - {code: 'horizontal', name: '横排'}, - ], - value: 'horizontal' - }, - ], - }, { name: 'X轴设置', list: [ diff --git a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-linechart.js b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-linechart.js index ae09d0fb..188dcf59 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-linechart.js +++ b/report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-linechart.js @@ -186,88 +186,6 @@ export const widgetLinechart = { }, ], }, - { - name: '图例操作', - list: [ - { - type: 'el-switch', - label: '图例显示', - name: 'isShowLegend', - required: false, - placeholder: '', - value: true, - }, - { - type: 'el-input-text', - label: '图例名称', - name: 'legendName', - required: false, - placeholder: '', - value: '' - }, - { - type: 'vue-color', - label: '字体颜色', - name: 'lengedColor', - required: false, - placeholder: '', - value: '#fff', - }, - { - type: 'el-input-number', - label: '字体字号', - name: 'lengedFontSize', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-input-number', - label: '图例宽度', - name: 'lengedWidth', - required: false, - placeholder: '', - value: 12, - }, - { - type: 'el-select', - label: '横向位置', - name: 'lateralPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'center', name: '居中'}, - {code: 'left', name: '左对齐'}, - {code: 'right', name: '右对齐'}, - ], - value: 'center' - }, - { - type: 'el-select', - label: '纵向位置', - name: 'longitudinalPosition', - required: false, - placeholder: '', - selectOptions: [ - {code: 'top', name: '顶部'}, - {code: 'bottom', name: '底部'}, - ], - value: 'top' - }, - { - type: 'el-select', - label: '布局前置', - name: 'layoutFront', - required: false, - placeholder: '', - selectOptions: [ - {code: 'vertical', name: '竖排'}, - {code: 'horizontal', name: '横排'}, - ], - value: 'horizontal' - }, - ], - }, { name: 'X轴设置', list: [ @@ -525,12 +443,12 @@ export const widgetLinechart = { name: '提示语设置', list: [ { - type: 'el-input-text', + type: 'el-input-number', label: '字体大小', - name: 'fontSize', + name: 'tipsFontSize', required: false, placeholder: '', - value: '' + value: 16 }, { type: 'vue-color', 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 74090891..29b4393f 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue @@ -98,7 +98,6 @@ export default { this.setOptionsTop(); this.setOptionsTooltip(); this.setOptionsMargin(); - this.setOptionsLegend(); this.setOptionsColor(); this.setOptionsData(); }, @@ -236,7 +235,7 @@ export default { show: true, textStyle: { color: optionsSetup.lineColor, - fontSize: optionsSetup.tipFontSize + fontSize: optionsSetup.tipsFontSize } }; this.options.tooltip = tooltip; @@ -253,42 +252,6 @@ export default { }; this.options.grid = grid; }, - // 图例操作 legend - setOptionsLegend() { - const optionsSetup = this.optionsSetup; - const legend = this.options.legend; - legend.show = optionsSetup.isShowLegend; - legend.left = optionsSetup.lateralPosition; - legend.right = optionsSetup.lateralPosition; - legend.top = optionsSetup.longitudinalPosition; - legend.bottom = - optionsSetup.longitudinalPosition; - legend.orient = optionsSetup.layoutFront; - legend.textStyle = { - color: optionsSetup.lengedColor, - fontSize: optionsSetup.fontSize - }; - legend.itemWidth = optionsSetup.lengedWidth; - }, - // 图例名称设置 - setOptionsLegendName(name){ - const optionsSetup = this.optionsSetup; - const series = this.options.series; - const legendName = optionsSetup.legendName; - // 图例没有手动写则显示原值,写了则显示新值 - if (null == legendName || legendName == '') { - for (let i = 0; i < name.length; i++) { - series[i].name = name[i]; - } - this.options.legend['data'] = name; - }else { - const arr = legendName.split('|'); - for (let i = 0; i < arr.length; i++) { - series[i].name = arr[i]; - } - this.options.legend['data'] = arr - } - }, // 图例颜色修改 setOptionsColor() { const optionsSetup = this.optionsSetup; @@ -350,10 +313,6 @@ export default { if (series[0].type == "bar") { series[0].data = data; } - const legendName = []; - legendName.push('销售量') - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); }, // 动态数据 dynamicDataFn(val, refreshTime, optionsSetup) { @@ -388,16 +347,12 @@ export default { } // series const series = this.options.series; - const legendName = []; for (const i in series) { if (series[i].type == "bar") { series[i].name = val.series[i].name; series[i].data = val.series[i].data; } - legendName.push(val.series[i].name); } - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); } } }; 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 b3b02b79..039a01cd 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetGradientColorBarchart.vue @@ -167,7 +167,6 @@ export default { this.setOptionsX(); this.setOptionsY(); this.setOptionsTop(); - this.setOptionsLegend(); this.setOptionsMargin(); this.setOptionsColor(); this.setOptionsData(); @@ -302,7 +301,7 @@ export default { show: true, textStyle: { color: optionsSetup.lineColor, - fontSize: optionsSetup.fontSize + fontSize: optionsSetup.tipsFontSize } }; this.options.tooltip = tooltip; @@ -319,42 +318,6 @@ export default { }; this.options.grid = grid; }, - // 图例操作 legend - setOptionsLegend() { - const optionsSetup = this.optionsSetup; - const legend = this.options.legend; - legend.show = optionsSetup.isShowLegend; - legend.left = optionsSetup.lateralPosition; - legend.right = optionsSetup.lateralPosition; - legend.top = optionsSetup.longitudinalPosition; - legend.bottom = - optionsSetup.longitudinalPosition; - legend.orient = optionsSetup.layoutFront; - legend.textStyle = { - color: optionsSetup.lengedColor, - fontSize: optionsSetup.fontSize - }; - legend.itemWidth = optionsSetup.lengedWidth; - }, - // 图例名称设置 - setOptionsLegendName(name){ - const optionsSetup = this.optionsSetup; - const series = this.options.series; - const legendName = optionsSetup.legendName; - // 图例没有手动写则显示原值,写了则显示新值 - if (null == legendName || legendName == '') { - for (let i = 0; i < name.length; i++) { - series[i].name = name[i]; - } - this.options.legend['data'] = name; - }else { - const arr = legendName.split('|'); - for (let i = 0; i < arr.length; i++) { - series[i].name = arr[i]; - } - this.options.legend['data'] = arr - } - }, // 渐变色 setOptionsColor() { const optionsSetup = this.optionsSetup; @@ -436,10 +399,6 @@ export default { if (series[0].type == "bar") { series[0].data = data; } - const legendName = []; - legendName.push('销售量') - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); }, // 动态数据 dynamicDataFn(val, refreshTime, optionsSetup) { @@ -475,16 +434,12 @@ export default { // series const series = this.options.series; - const legendName = []; for (const i in series) { if (series[i].type == "bar") { series[i].name = val.series[i].name; series[i].data = val.series[i].data; } - legendName.push(val.series[i].name); } - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); } } }; diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/line/widgetLinechart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/line/widgetLinechart.vue index 15e931ba..8505293e 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/line/widgetLinechart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/line/widgetLinechart.vue @@ -105,7 +105,6 @@ export default { this.setOptionsTooltip(); this.setOptionsData(); this.setOptionsMargin(); - this.setOptionsLegend(); this.setOptionsColor(); }, // 标题修改 @@ -244,7 +243,7 @@ export default { show: true, textStyle: { color: optionsSetup.lineColor, - fontSize: optionsSetup.fontSize + fontSize: optionsSetup.tipsFontSize } }; this.options.tooltip = tooltip; @@ -261,42 +260,6 @@ export default { }; this.options.grid = grid; }, - // 图例操作 legend - setOptionsLegend() { - const optionsSetup = this.optionsSetup; - const legend = this.options.legend; - legend.show = optionsSetup.isShowLegend; - legend.left = optionsSetup.lateralPosition; - legend.right = optionsSetup.lateralPosition; - legend.top = optionsSetup.longitudinalPosition; - legend.bottom = - optionsSetup.longitudinalPosition; - legend.orient = optionsSetup.layoutFront; - legend.textStyle = { - color: optionsSetup.lengedColor, - fontSize: optionsSetup.fontSize - }; - legend.itemWidth = optionsSetup.lengedWidth; - }, - // 图例名称设置 - setOptionsLegendName(name){ - const optionsSetup = this.optionsSetup; - const series = this.options.series; - const legendName = optionsSetup.legendName; - // 图例没有手动写则显示原值,写了则显示新值 - if (null == legendName || legendName == '') { - for (let i = 0; i < name.length; i++) { - series[i].name = name[i]; - } - this.options.legend['data'] = name; - }else { - const arr = legendName.split('|'); - for (let i = 0; i < arr.length; i++) { - series[i].name = arr[i]; - } - this.options.legend['data'] = arr - } - }, // 图例颜色修改 setOptionsColor() { const optionsSetup = this.optionsSetup; @@ -332,10 +295,6 @@ export default { series[i].data = data; } } - const legendName = []; - legendName.push('销售量') - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); }, dynamicDataFn(val, refreshTime) { if (!val) return; @@ -359,15 +318,11 @@ export default { this.options.xAxis.data = val.xAxis; // series const series = this.options.series; - const legendName = []; for (const i in series) { if (series[i].type == "line") { series[i].data = val.series[i].data; } - legendName.push(val.series[i].name); } - this.options.legend['data'] = legendName; - this.setOptionsLegendName(legendName); } } };