From 0ce001a465040b39be9d1c3c02e95966bdc118b8 Mon Sep 17 00:00:00 2001 From: ihzero Date: Wed, 30 Aug 2023 16:32:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E5=88=86?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/sys/user.ts | 1 + src/views/main/insect-monitors/index.vue | 26 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/api/sys/user.ts b/src/api/sys/user.ts index feda10fe..f5a42770 100644 --- a/src/api/sys/user.ts +++ b/src/api/sys/user.ts @@ -1010,6 +1010,7 @@ export function getWormPhotos(device, params, mode: ErrorMessageMode = 'modal') }, { errorMessageMode: mode, + isTransformResponse: false, }, ) } diff --git a/src/views/main/insect-monitors/index.vue b/src/views/main/insect-monitors/index.vue index cdafe152..165837fa 100644 --- a/src/views/main/insect-monitors/index.vue +++ b/src/views/main/insect-monitors/index.vue @@ -92,6 +92,19 @@ +
+ +
@@ -115,6 +128,7 @@ Radio, List, Image, + Pagination, } from 'ant-design-vue' import { reactive, ref, onMounted } from 'vue' const RadioButton = Radio.Button @@ -133,6 +147,10 @@ time_interval: 'day', }) + const pageCurrent = ref(1) + const pageTotal = ref(0) + const pageSize = ref(20) + const baseDate = ref([]) const pointDate = ref([]) const list = ref([]) @@ -176,6 +194,8 @@ // 获取数据 const getData = async () => { const params = { + per_page: pageSize.value, + page: pageCurrent.value, device_id: formState.device_id, start_time: '', end_time: '', @@ -199,8 +219,10 @@ params.end_time = dayjs().endOf('day').format('YYYY-MM-DD') } if (params.device_id == null) return (list.value = []) - const res = await getWormPhotos(params.device_id, params) - list.value = res + const { data, meta } = await getWormPhotos(params.device_id, params) + pageTotal.value = meta.total + list.value = data + console.log(data) } onMounted(() => {