diff --git a/web/src/api/gas/fence/index.ts b/web/src/api/gas/fence/index.ts index 3039038..ee0b8d5 100644 --- a/web/src/api/gas/fence/index.ts +++ b/web/src/api/gas/fence/index.ts @@ -1,5 +1,4 @@ -import request from '@/config/axios' -import type { Dayjs } from 'dayjs' +import request from '@/config/axios' /** GAS电子围栏信息 */ export interface Fence { @@ -46,5 +45,9 @@ export const FenceApi = { // 导出GAS电子围栏 Excel exportFence: async (params) => { return await request.download({ url: `/gas/fence/export-excel`, params }) + }, + // 查询GAS电子围栏所有列表 + getListAll: async () => { + return await request.get({ url: `/gas/fence/getListAll` }) } } diff --git a/web/src/api/gas/handdetector/index.ts b/web/src/api/gas/handdetector/index.ts index a0a1631..46af978 100644 --- a/web/src/api/gas/handdetector/index.ts +++ b/web/src/api/gas/handdetector/index.ts @@ -1,5 +1,5 @@ -import request from '@/config/axios' -import type { Dayjs } from 'dayjs' +import request from '@/config/axios' + /** GAS手持探测器信息 */ export interface HandDetector { @@ -32,7 +32,6 @@ export interface HandDetectorData extends HandDetector { batteryStatus?: number //电池报警状态 fenceStatus?: number //电子围栏报警状态 onlineStatus?: number //在线状态 - enableStatus?: number //启用状态 } // GAS手持探测器 API @@ -70,5 +69,16 @@ export const HandDetectorApi = { // 导出GAS手持探测器 Excel exportHandDetector: async (params) => { return await request.download({ url: `/gas/hand-detector/export-excel`, params }) + }, + + // 综合监控数据展示 + getMonitor: async () => { + return await request.get<{deviceCount: number}>({ + url: `/gas/hand-detector/getMonitor` + }) + }, + // 查询GAS手持探测器所有列表 + getListAll: async () => { + return await request.get({ url: `/gas/hand-detector/getListAll` }) } } diff --git a/web/src/store/modules/handDetector.ts b/web/src/store/modules/handDetector.ts index bfa1d69..82a97b7 100644 --- a/web/src/store/modules/handDetector.ts +++ b/web/src/store/modules/handDetector.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia' -import { store } from '@/store' + import { HandDetector, HandDetectorApi } from '@/api/gas/handdetector' import { Type, TypeApi } from '@/api/gas/gastype' import { Fence, FenceApi } from '@/api/gas/fence' @@ -31,11 +31,8 @@ export const useHandDetectorStore = defineStore('handDetector', { actions: { async getAllHandDetector(refresh: boolean = false) { if (refresh || this.handDetectorList.length === 0) { - const data = await HandDetectorApi.getHandDetectorPage({ - pageNo: 1, - pageSize: 100 - }) - this.handDetectorList = data.list + const data = await HandDetectorApi.getListAll() + this.handDetectorList = data return this.handDetectorList } else { return this.handDetectorList @@ -43,11 +40,8 @@ export const useHandDetectorStore = defineStore('handDetector', { }, async getAllFences(refresh: boolean = false) { if (refresh || this.fences.length === 0) { - const data = await FenceApi.getFencePage({ - pageNo: 1, - pageSize: 100 - }) - this.fences = data.list + const data = await FenceApi.getListAll() + this.fences = data return this.fences } else { return this.fences