From 7a2b07ad2b0715c6e2dffb5102cd1d1c05c28d6a Mon Sep 17 00:00:00 2001
From: mark <mark18340872469@163.com>
Date: 星期四, 29 九月 2022 11:14:20 +0800
Subject: [PATCH] 点位信息 all
---
src/views/invalidCamera/components/DevBox.vue | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/views/invalidCamera/components/DevBox.vue b/src/views/invalidCamera/components/DevBox.vue
index d9b4e7b..6202a43 100644
--- a/src/views/invalidCamera/components/DevBox.vue
+++ b/src/views/invalidCamera/components/DevBox.vue
@@ -67,7 +67,8 @@
})
.then((res) => {
if (res.success) {
- this.dataList = res.data.list
+ this.dataList = res.data.list.sort(this.compare("createTime", "inverted"))
+ // this.dataList = this.reverseDate(res.data.list, "createTime")
this.total = res.data.total
} else {
this.$notify.error("鍔犺浇鍒楄〃澶辫触")
@@ -77,6 +78,19 @@
this.$notify.error(e.msg)
})
},
+ compare(prop, align) {
+ return function(a, b) {
+ var value1 = a[prop]
+ var value2 = b[prop]
+ if (align == "positive") {
+ //姝e簭
+ return new Date(value1) - new Date(value2)
+ } else if (align == "inverted") {
+ //鍊掑簭
+ return new Date(value2) - new Date(value1)
+ }
+ }
+ },
//鍒嗛〉鍔熻兘
handleSizeChange(size) {
this.size = size
--
Gitblit v1.8.0