xiao547607 5 tahun lalu
induk
melakukan
fe3482fc75
2 mengubah file dengan 12 tambahan dan 5 penghapusan
  1. 2 2
      .env.development
  2. 10 3
      src/views/base/personDeviceLog-list.vue

+ 2 - 2
.env.development

@@ -1,5 +1,5 @@
-#VUE_APP_BACKEND_URL=http://wisdomhouse.sudaonline.net
-VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-community-server
+VUE_APP_BACKEND_URL=http://wisdomhouse.sudaonline.net
+#VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-community-server
 #VUE_APP_BACKEND_URL=http://192.168.33.26:8080/smart-community-server
 #VUE_APP_BACKEND_URL=http://zldb.xiaoxinda.com:8088/smart-community-server
 #VUE_APP_BACKEND_URL=http://kr6zr7.natappfree.cc/smart-community-server/

+ 10 - 3
src/views/base/personDeviceLog-list.vue

@@ -295,12 +295,19 @@ export default {
     getCurrentMonthFirst() {
       var self = this;
       var date = new Date();
-      //date.get(1);
+      var startDate = new Date();
       var month = parseInt(date.getMonth() + 1);
+
       //获取三天前时间
-      var day = date.getDate() - 7;
+      var startMonth = month;
+      if(startDate.getDate() < 7){
+        startMonth = startDate.getMonth();
+        startDate.setDate(0);
+      }
+      startDate = startDate.getDate() - 7;
+
       var startTime =
-        date.getFullYear() + "-" + month + "-" + day + " 00:00:00";
+        date.getFullYear() + "-" + startMonth + "-" + startDate + " 00:00:00";
 
       var endTime =
         date.getFullYear() +