Browse Source

feat:增加场景过滤

xzh 4 năm trước cách đây
mục cha
commit
52040c4c96
1 tập tin đã thay đổi với 13 bổ sung3 xóa
  1. 13 3
      pc/src/page/manage/temp/scene.vue

+ 13 - 3
pc/src/page/manage/temp/scene.vue

@@ -28,7 +28,7 @@
           <span class="label">拍摄时间</span>
           <vueDate v-model="startTime" placeholder="开始时间" :isDateDisabled="isAfter" :weekdays="weekdays" :months="months"></vueDate>
           <span>-</span>
-          <vueDate v-model="endTime" placeholder="结束时间" :isDateDisabled="isAfter" :weekdays="weekdays" :months="months"></vueDate>
+          <vueDate v-model="endTime" placeholder="结束时间" :isDateDisabled="isBefore" :weekdays="weekdays" :months="months"></vueDate>
         </div>
         <div class="tab-search">
           <input
@@ -506,7 +506,9 @@ export default {
         pageSize: this.pageSize,
         cameraId,
         searchKey: this.searchKey.trim(),
-        cameraType
+        cameraType,
+        startTime: new Date(this.startTime).getTime(),
+        endTime: new Date(this.endTime).getTime(),
       }
       if (this.tabActive === 2) {
         await this.$store.dispatch('getCooperationScene', params)
@@ -551,7 +553,15 @@ export default {
       }
 
       document.body.removeChild(textArea)
-    }
+    },
+    isBefore (date) {
+      const startDate = new Date(this.startTime)
+      return date < startDate
+    },
+    isAfter (date) {
+      const endDate = new Date(this.endTime)
+      return date > endDate
+    },
   }
 }
 </script>