浏览代码

柱状图与柱线图数值设定配置中增加是否显示百分号的开关

Mr.Z 1 年之前
父节点
当前提交
48b86f75b6

+ 8 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-barchart.js

@@ -544,6 +544,14 @@ export const widgetBarchart = {
               placeholder: '',
               value: true
             },
+            {
+              type: 'el-switch',
+              label: '百分比符号显示',
+              name: 'percentSign',
+              required: false,
+              placeholder: '',
+              value: false
+            },
             {
               type: 'el-input-number',
               label: '距离',

+ 16 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/barlineCharts/widget-barlinechart.js

@@ -713,6 +713,14 @@ export const widgetBarlinechart = {
               placeholder: '',
               value: false
             },
+            {
+              type: 'el-switch',
+              label: '百分比符号显示',
+              name: 'percentSignLine',
+              required: false,
+              placeholder: '',
+              value: false
+            },
             {
               type: 'el-input-number',
               label: '距离',
@@ -764,6 +772,14 @@ export const widgetBarlinechart = {
               placeholder: '',
               value: false
             },
+            {
+              type: 'el-switch',
+              label: '百分比符号显示',
+              name: 'percentSignBar',
+              required: false,
+              placeholder: '',
+              value: false
+            },
             {
               type: 'el-input-number',
               label: '距离',

+ 2 - 0
report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue

@@ -371,6 +371,7 @@ export default {
             fontSize: optionsSetup.fontSize,
             color: optionsSetup.dataColor,
             fontWeight: optionsSetup.fontWeight,
+            formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
           };
           // 获取颜色样式
           if (optionsSetup.colorStyle == 'same') {
@@ -454,6 +455,7 @@ export default {
             fontSize: optionsSetup.fontSize,
             color: optionsSetup.dataColor,
             fontWeight: optionsSetup.fontWeight,
+            formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
           };
           // 获取颜色样式
           if (optionsSetup.colorStyle == 'same') {

+ 2 - 0
report-ui/src/views/bigscreenDesigner/designer/widget/barline/widgetBarlinechart.vue

@@ -337,6 +337,7 @@ export default {
             fontSize: optionsSetup.fontSizeLine,
             color: optionsSetup.subTextColorLine,
             fontWeight: optionsSetup.fontWeightLine,
+            formatter: !!optionsSetup.percentSignLine ? '{c}%' : '{c}'
           };
         }
       }
@@ -355,6 +356,7 @@ export default {
             fontSize: optionsSetup.fontSizeBar,
             color: optionsSetup.subTextColorBar,
             fontWeight: optionsSetup.fontWeightBar,
+            formatter: !!optionsSetup.percentSignBar ? '{c}%' : '{c}'
           };
           series[key].barWidth = optionsSetup.maxWidth;
           series[key].barMinHeight = optionsSetup.minHeight;