|
@@ -3,14 +3,16 @@ import {
|
|
|
IncidentItem,
|
|
|
IncidentItemDetail,
|
|
|
} from '@/api/incident';
|
|
|
-import { getAllResources } from '@/api/resource';
|
|
|
+import { getAllResources, getAllsingleDevice } from '@/api/resource';
|
|
|
import {
|
|
|
PENDING_DISPOSAL_INCIDENT,
|
|
|
PENDING_INCIDENT,
|
|
|
// EMERGENCY_VEHICLES,
|
|
|
VIDEO_SURVEILLANCE,
|
|
|
WARNING_INCIDENT,
|
|
|
+ SINGLE_PAWN,
|
|
|
// EMERGENCY_TEAM,
|
|
|
+
|
|
|
} from '@/components/MarkerMap/constants';
|
|
|
import { defineStore } from 'pinia';
|
|
|
|
|
@@ -30,6 +32,7 @@ export interface MarkerStateType {
|
|
|
emergencyVehicles: MarkerType[];
|
|
|
emergencyTeam: MarkerType[];
|
|
|
emergencyWarehouse: MarkerType[];
|
|
|
+ singleDevice: MarkerType[];
|
|
|
/** 详情页面 点击监控点位 打开视频 */
|
|
|
livevideovisible: boolean;
|
|
|
livevideos: MarkerType[];
|
|
@@ -42,6 +45,7 @@ export interface MainActionsType {
|
|
|
toggleLoading(): void;
|
|
|
getHDIncidentList(): void;
|
|
|
getAllResources(): void;
|
|
|
+ getAllsingleDevice(): void;
|
|
|
}
|
|
|
|
|
|
export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
|
|
@@ -56,6 +60,7 @@ export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
|
|
|
videoSurveillance: VIDEO_SURVEILLANCE,
|
|
|
emergencyVehicles: [],
|
|
|
emergencyTeam: [],
|
|
|
+ singleDevice: SINGLE_PAWN,
|
|
|
emergencyWarehouse: [],
|
|
|
livevideos: [],
|
|
|
livevideovisible: false,
|
|
@@ -74,6 +79,24 @@ export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
|
|
|
this.toggleLoading();
|
|
|
}
|
|
|
},
|
|
|
+ async getAllsingleDevice() {
|
|
|
+ try {
|
|
|
+ this.toggleLoading();
|
|
|
+ const { data } = await getAllsingleDevice();
|
|
|
+
|
|
|
+ this.singleDevice = [];
|
|
|
+
|
|
|
+ Object.values(data).forEach(datap => {
|
|
|
+ datap["locations"] = `${datap.gpsX},${datap.gpsY}`,
|
|
|
+ this.singleDevice.push(datap);
|
|
|
+ });
|
|
|
+ console.log(this.singleDevice);
|
|
|
+
|
|
|
+ } finally {
|
|
|
+ this.toggleLoading();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
async getAllResources() {
|
|
|
try {
|
|
|
this.toggleLoading();
|