|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="surveillance-list">
|
|
|
<header class="list-header">
|
|
|
- <img class="config-btn" src="@/assets/images/institute-safety/config.png" alt="" />
|
|
|
+ <img class="config-btn" src="@/assets/images/institute-safety/config.png" alt="" @click="handleToPlatform" />
|
|
|
<span> 重点监控区域 </span>
|
|
|
<img class="close-btn" src="@/assets/images/institute-safety/close.png" alt="" @click="emits('close')" />
|
|
|
</header>
|
|
|
@@ -12,10 +12,10 @@
|
|
|
</div>
|
|
|
<div
|
|
|
class="surveillance-camera"
|
|
|
- :class="{ 'surveillance-camera_active': cam.code === curCamCode }"
|
|
|
+ :class="{ 'surveillance-camera_active': cam.code === curCamera?.code }"
|
|
|
v-for="cam in group.children"
|
|
|
:key="cam.id"
|
|
|
- @click="emits('change-camera', cam.code)"
|
|
|
+ @click="handleChangeCamera(cam)"
|
|
|
>
|
|
|
<img class="camera-preview" :src="cam.pushStreamDTO.imageUrl" alt="" />
|
|
|
<div class="camera-info">
|
|
|
@@ -33,20 +33,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+ import { onMounted, ref } from 'vue';
|
|
|
+ import { storeToRefs } from 'pinia';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
import { ElTooltip } from 'element-plus';
|
|
|
import { getSurveillanceAreaList } from '@/api/security-confidentiality-position';
|
|
|
import type { PositionMonitorCameraListRes } from '@/api/security-confidentiality-position';
|
|
|
- import { onMounted, ref } from 'vue';
|
|
|
-
|
|
|
- const props = defineProps<{
|
|
|
- curCamCode: string | null;
|
|
|
- }>();
|
|
|
+ import type { CameraInfo } from '@/api/disaster-overview';
|
|
|
+ import useCameraStore from '../stores/use-camera-store';
|
|
|
|
|
|
const emits = defineEmits<{
|
|
|
(e: 'close'): void;
|
|
|
- (e: 'change-camera', code: string): void;
|
|
|
+ // (e: 'change-camera', code: string): void;
|
|
|
}>();
|
|
|
|
|
|
+ const cameraStore = useCameraStore();
|
|
|
+ const { curCamera } = storeToRefs(cameraStore);
|
|
|
+
|
|
|
const surveillanceAreaList = ref<PositionMonitorCameraListRes[]>([]);
|
|
|
|
|
|
const getListData = () => {
|
|
|
@@ -55,6 +58,17 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ const router = useRouter();
|
|
|
+ function handleToPlatform() {
|
|
|
+ router.push({
|
|
|
+ name: 'SystemSurveillance',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleChangeCamera(camera: CameraInfo) {
|
|
|
+ cameraStore.setCurCamera(camera);
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getListData();
|
|
|
});
|
|
|
@@ -114,6 +128,7 @@
|
|
|
text-align: center;
|
|
|
}
|
|
|
.surveillance-camera {
|
|
|
+ cursor: pointer;
|
|
|
position: relative;
|
|
|
margin-top: 16px;
|
|
|
width: 249px;
|