Browse Source

统计默认日期添加

Liugl 3 years ago
parent
commit
3ae2872fc2
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/views/index.vue

+ 11 - 1
src/views/index.vue

@@ -371,7 +371,7 @@ export default {
     };
     };
   },
   },
   mounted: function () {
   mounted: function () {
-
+    this.initDefaultTime()
     this.initChart()
     this.initChart()
     // this.$nextTick(function () {
     // this.$nextTick(function () {
 
 
@@ -387,6 +387,16 @@ export default {
   },
   },
   methods: {
   methods: {
 
 
+    initDefaultTime(){
+      const end = new Date();
+      const start = new Date();
+      start.setTime(start.getTime() - 3600 * 1000 * 24 * (7-1));
+      this.timeArr1 = [start,end]
+      this.timeArr2 = [start,end]
+      this.timeArr3 = [start,end]
+      this.timeArr4 = [start,end]
+    },
+
     initChart(){
     initChart(){
       // 初始化echarts实例
       // 初始化echarts实例
       this.chartObj1 = echarts.init(this.$refs.echart1);
       this.chartObj1 = echarts.init(this.$refs.echart1);