Ver código fonte

山水工程工程进度

maxiaoxiao 9 meses atrás
pai
commit
cf0aebe392

+ 45 - 36
src/components/echartsTemplate/bar.vue

@@ -3,6 +3,7 @@
 </template>
 
 <script>
+import { cloneDeep } from "lodash";
 let option = {
   backgroundColor: "rgba(0,0,0,0)",
   tooltip: {
@@ -95,39 +96,39 @@ let option = {
       },
     },
   ],
-  series: [
-    {
-      name: "", //收储面积
-      type: "bar",
-      barWidth: "12px",
-      itemStyle: {
-        normal: {
-          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-            {
-              offset: 0,
-              color: "#409EFF",
-            },
-            {
-              offset: 1,
-              color: "rgba(24, 253, 255, 0)",
-            },
-          ]),
+  series: [],
+};
+// 柱体
+let seriesItem = {
+  name: "", //收储面积
+  type: "bar",
+  barWidth: "12px",
+  itemStyle: {
+    normal: {
+      color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+        {
+          offset: 0,
+          color: "#409EFF",
         },
-      },
-      data: [],
-    },
-    {
-      name: "", //收储个数
-      type: "line",
-      smooth: true,
-      itemStyle: {
-        normal: {
-          color: "#FFCC64", // 折线的颜色
+        {
+          offset: 1,
+          color: "rgba(24, 253, 255, 0)",
         },
-      },
-      data: [],
+      ]),
     },
-  ],
+  },
+  data: [],
+};
+let lineItem = {
+  name: "", //收储个数
+  type: "line",
+  smooth: true,
+  itemStyle: {
+    normal: {
+      color: "#FFCC64", // 折线的颜色
+    },
+  },
+  data: [],
 };
 export default {
   name: "bar_echart",
@@ -144,17 +145,25 @@ export default {
     };
   },
   methods: {
-    setOptions(cartData) {
+    setOptions(v) {
       let _this = this;
       if (!this.myChart) {
         // var dom = document.getElementById("bar_echart");
         this.myChart = echarts.init(this.$refs.echart);
       }
-      option.legend.data = cartData.legend;
-      option.xAxis.data = cartData.xdata;
-
-      option.series[0].data = cartData.data;
-
+      option.legend.data = v.legend;
+      option.xAxis.data = v.xData;
+      v.yData.forEach((item, k) => {
+        let o = cloneDeep(seriesItem); // JSON.parse(JSON.stringify(seriesItem));
+        o.name = v.xData[k];
+        o.data = item;
+        // alldata = [...alldata, ...o.data];
+        // if (v.interval) {
+        //   option.xAxis.axisLabel.interval = 0;
+        //   option.xAxis.axisLabel.rotate = 0;
+        // }
+        option.series.push(o);
+      });
       this.myChart.resize();
       this.myChart.setOption(option);
 

+ 4 - 2
src/components/echartsTemplate/pie.vue

@@ -215,9 +215,11 @@ export default {
         if (sItem) {
           let aname = name.length > max ? name.substr(0, max) + "..." : name;
           let ratio = cartData.total
-            ? "," + ((sItem.value / cartData.total) * 100).toFixed(2) + "%"
+            ? " ," + ((sItem.value / cartData.total) * 100).toFixed(2) + "%"
             : "";
-          return `{name|${aname}}  {value|${sItem.value}}  {unit|${_this.$props.unit}${ratio}}`;
+          return `{name|${aname}} ${ratio ? "\n" : ""} {value|${
+            sItem.value
+          }}  {unit|${_this.$props.unit}${ratio}}`;
           // return name + 'sItem.value';
         } else {
           return name;

+ 1 - 1
src/views/cockpit/common/ThreeStackedBarAndLine.vue

@@ -170,7 +170,7 @@ export default {
                     {
                         name: obj.legend_data[2],
                         type: 'bar',
-                        stack: '渠道1',
+                        stack: '渠道2',
                         barWidth: 14,
 
                         data: obj.result[1],

+ 2 - 1
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -93,7 +93,7 @@
           </el-table-column>
         </el-table>
       </template>
-      <slot name="all" v-else></slot>
+      <slot name="all"></slot>
     </div>
   </div>
 </template>
@@ -147,6 +147,7 @@ export default {
       else {
         tdsy.addLayer(this.layersData);
         store.state.vectorlayerlist.push(this.layersData);
+        console.log("---aaa", store.state.vectorlayerlist);
       }
       // this.Getlayers(res.data.url);
     },

+ 2 - 2
src/views/complianceAnalysis/ghzc.scss

@@ -187,8 +187,8 @@
         }
 
         .echart {
-            width: 380px;
-            height: 220px;
+            width: 380px !important;
+            height: 220px !important;
         }
 
         .echart_vertical {