diff --git a/src/views/administrator/alarm/index.vue b/src/views/administrator/alarm/index.vue
index 837d61b..7265172 100644
--- a/src/views/administrator/alarm/index.vue
+++ b/src/views/administrator/alarm/index.vue
@@ -17,7 +17,7 @@
-
筛选
+ 筛选
@@ -129,11 +129,11 @@
}
// 获取报警列表
-const fetchAlarmList = (isNowPage = false) => {
- if (!isNowPage) {
- // 是否显示当前页,否则跳转第一页
- listQuery.value.pageNo = 1
- }
+const fetchAlarmList = () => {
+ // if (!isNowPage) {
+ // // 是否显示当前页,否则跳转第一页
+ // listQuery.value.pageNo = 1
+ // }
// listQuery.value.begTime = listQuery.value.begTime.replace(/\//g, '-')
// listQuery.value.endTime = listQuery.value.endTime.replace(/\//g, '-')
const data = {
@@ -142,17 +142,21 @@
endTime: listQuery.value.endTime ? `${listQuery.value.endTime} 23:59:59` : '',
}
getAlarmList(data).then((res) => {
- if (isNowPage) {
+ // if (isNowPage) {
list.value = list.value.concat(res.data.records)
- } else {
- list.value = res.data.records
- }
+ // } else {
+ // list.value = res.data.records
+ // }
showLoading.value = false
total.value = res.data.total
})
}
// ------------------------------------------------------------------------------------------
-
+const search = () => {
+ listQuery.value.pageNo = 1
+ list.value = []
+ fetchAlarmList()
+}
onMounted(() => {
begTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
endTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
diff --git a/src/views/administrator/alarm/index.vue b/src/views/administrator/alarm/index.vue
index 837d61b..7265172 100644
--- a/src/views/administrator/alarm/index.vue
+++ b/src/views/administrator/alarm/index.vue
@@ -17,7 +17,7 @@
-
筛选
+
筛选
@@ -129,11 +129,11 @@
}
// 获取报警列表
-const fetchAlarmList = (isNowPage = false) => {
- if (!isNowPage) {
- // 是否显示当前页,否则跳转第一页
- listQuery.value.pageNo = 1
- }
+const fetchAlarmList = () => {
+ // if (!isNowPage) {
+ // // 是否显示当前页,否则跳转第一页
+ // listQuery.value.pageNo = 1
+ // }
// listQuery.value.begTime = listQuery.value.begTime.replace(/\//g, '-')
// listQuery.value.endTime = listQuery.value.endTime.replace(/\//g, '-')
const data = {
@@ -142,17 +142,21 @@
endTime: listQuery.value.endTime ? `${listQuery.value.endTime} 23:59:59` : '',
}
getAlarmList(data).then((res) => {
- if (isNowPage) {
+ // if (isNowPage) {
list.value = list.value.concat(res.data.records)
- } else {
- list.value = res.data.records
- }
+ // } else {
+ // list.value = res.data.records
+ // }
showLoading.value = false
total.value = res.data.total
})
}
// ------------------------------------------------------------------------------------------
-
+const search = () => {
+ listQuery.value.pageNo = 1
+ list.value = []
+ fetchAlarmList()
+}
onMounted(() => {
begTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
endTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
diff --git a/src/views/user/device/index.vue b/src/views/user/device/index.vue
index 7b10844..0da5a42 100644
--- a/src/views/user/device/index.vue
+++ b/src/views/user/device/index.vue
@@ -66,10 +66,15 @@
}
getUserPhone({ code, isAdmin: false }).then(res => {
phone.value = res.data
- console.log(res.data, '用户手机号')
- sessionStorage.setItem('gas-user-phone', phone.value)
+ if(phone.value) {
+ sessionStorage.setItem('gas-user-phone', phone.value)
// 获取设备列表
getDevice()
+ }
+ else {
+ deviceList.value = []
+ }
+
})
}
onMounted(() => {
diff --git a/src/views/administrator/alarm/index.vue b/src/views/administrator/alarm/index.vue
index 837d61b..7265172 100644
--- a/src/views/administrator/alarm/index.vue
+++ b/src/views/administrator/alarm/index.vue
@@ -17,7 +17,7 @@
-
筛选
+
筛选
@@ -129,11 +129,11 @@
}
// 获取报警列表
-const fetchAlarmList = (isNowPage = false) => {
- if (!isNowPage) {
- // 是否显示当前页,否则跳转第一页
- listQuery.value.pageNo = 1
- }
+const fetchAlarmList = () => {
+ // if (!isNowPage) {
+ // // 是否显示当前页,否则跳转第一页
+ // listQuery.value.pageNo = 1
+ // }
// listQuery.value.begTime = listQuery.value.begTime.replace(/\//g, '-')
// listQuery.value.endTime = listQuery.value.endTime.replace(/\//g, '-')
const data = {
@@ -142,17 +142,21 @@
endTime: listQuery.value.endTime ? `${listQuery.value.endTime} 23:59:59` : '',
}
getAlarmList(data).then((res) => {
- if (isNowPage) {
+ // if (isNowPage) {
list.value = list.value.concat(res.data.records)
- } else {
- list.value = res.data.records
- }
+ // } else {
+ // list.value = res.data.records
+ // }
showLoading.value = false
total.value = res.data.total
})
}
// ------------------------------------------------------------------------------------------
-
+const search = () => {
+ listQuery.value.pageNo = 1
+ list.value = []
+ fetchAlarmList()
+}
onMounted(() => {
begTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
endTime.value = new Date().toLocaleDateString().replace(/\//g, '-'); // 打开popup默认的日期
diff --git a/src/views/user/device/index.vue b/src/views/user/device/index.vue
index 7b10844..0da5a42 100644
--- a/src/views/user/device/index.vue
+++ b/src/views/user/device/index.vue
@@ -66,10 +66,15 @@
}
getUserPhone({ code, isAdmin: false }).then(res => {
phone.value = res.data
- console.log(res.data, '用户手机号')
- sessionStorage.setItem('gas-user-phone', phone.value)
+ if(phone.value) {
+ sessionStorage.setItem('gas-user-phone', phone.value)
// 获取设备列表
getDevice()
+ }
+ else {
+ deviceList.value = []
+ }
+
})
}
onMounted(() => {
diff --git a/src/views/user/deviceLogs/index.vue b/src/views/user/deviceLogs/index.vue
index a436838..de9efbd 100644
--- a/src/views/user/deviceLogs/index.vue
+++ b/src/views/user/deviceLogs/index.vue
@@ -14,11 +14,14 @@