|
|
|
@ -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 |
|
|
|
|