Sfoglia il codice sorgente

中国地图-路线图增加地图块颜色配置项

qianming 3 anni fa
parent
commit
5335d5f9d4

+ 29 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/widget-map.js

@@ -188,6 +188,35 @@ export const widgetMap = {
             },
           ],
         },
+        {
+          name: '地图颜色',
+          list: [
+            {
+              type: 'vue-color',
+              label: '地图块颜色',
+              name: 'blockColor',
+              required: false,
+              placeholder: '',
+              value: '#073684'
+            },
+            {
+              type: 'vue-color',
+              label: '边界颜色',
+              name: 'borderColor',
+              required: false,
+              placeholder: '',
+              value: '#061E3D'
+            },
+            {
+              type: 'vue-color',
+              label: '高亮颜色',
+              name: 'highlightColor',
+              required: false,
+              placeholder: '',
+              value: '#2B91B7'
+            },
+          ],
+        },
       ]
     ],
     data: [

+ 22 - 4
report-ui/src/views/bigscreenDesigner/designer/widget/map/widgetLineMap.vue

@@ -305,7 +305,8 @@ export default {
               value: dataItem.value,
             }
           )
-        };
+        }
+        ;
       }
       return res;
     },
@@ -313,6 +314,7 @@ export default {
       this.setOptionsTitle();
       this.setOptionsText();
       this.setOptionsPoint();
+      this.setOptionsColor();
       this.setOptionsData();
     },
     // 标题设置
@@ -336,7 +338,7 @@ export default {
       this.options.title = title;
     },
     // 地图字体设置
-    setOptionsText(){
+    setOptionsText() {
       const optionsSetup = this.optionsSetup;
       const lable = this.options.series[2].label;
       const normal = {
@@ -349,17 +351,33 @@ export default {
       lable["normal"] = normal;
     },
     // 地图点设置
-    setOptionsPoint(){
+    setOptionsPoint() {
       const optionsSetup = this.optionsSetup;
       const series = this.options.series[2];
       pointSize = optionsSetup.pointSize
-      const itemStyle= {
+      const itemStyle = {
         normal: {
           color: optionsSetup.pointColor,
         }
       };
       series["itemStyle"] = itemStyle;
     },
+    // 地图颜色设置
+    setOptionsColor() {
+      const optionsSetup = this.optionsSetup;
+      const itemStyle = {
+        normal: {
+          // 地图的颜色
+          areaColor: optionsSetup.blockColor,
+          borderColor: optionsSetup.borderColor,
+        },
+        emphasis: {
+          // 地图块颜色
+          areaColor: optionsSetup.highlightColor,
+        }
+      };
+      this.options.geo["itemStyle"] = itemStyle;
+    },
     //数据解析
     setOptionsData() {
       const optionsData = this.optionsData; // 数据类型 静态 or 动态