chenrui  2 жил өмнө
parent
commit
aa1bf4cbb2

+ 9 - 1
src/views/statisticalanalysis/cargoperiod/index.vue

@@ -26,7 +26,7 @@
         style="margin-top: 10px"
       />
       <div class="imgechatr">
-        <Echarts :id="dataid" :option="echartsData" />
+        <Echarts :id="dataid" :option="echartsData" :options="optiontime" />
       </div>
     </div>
   </div>
@@ -109,6 +109,7 @@ export default {
           options: [],
         },
       ],
+      optiontime: [],
     };
   },
   mounted() {
@@ -137,6 +138,13 @@ export default {
           fd2: data.dateTime + " 23:00:00",
         },
       ];
+      this.optiontime = [
+        Format(
+          "yyyy-MM-dd",
+          new Date(new Date(data.dateTime).getTime() - 24 * 60 * 60 * 1000)
+        ),
+        data.dateTime,
+      ];
       // this.getQuery(option, null);
       this.getQuerys(option, data.dateTime);
       // this.listname =

+ 5 - 1
src/views/statisticalanalysis/components/echart/echartsgas.vue

@@ -24,6 +24,10 @@ export default {
       type: Object,
       default: () => {},
     },
+    options: {
+      type: Array,
+      default: () => {},
+    },
   },
   data() {
     return {
@@ -64,7 +68,7 @@ export default {
         let arr = JSON.parse(JSON.stringify(newVal.list));
         for (let index = 0; index < arr.length; index++) {
           collection.series.push({
-            name: "",
+            name: this.options[index],
             type: "bar",
             // barWidth: 18,
             data: arr[index],