|
@@ -79,6 +79,7 @@
|
|
|
:class="{
|
|
:class="{
|
|
|
isAdded: isAddedCamera(item.code),
|
|
isAdded: isAddedCamera(item.code),
|
|
|
isActive: item.code === caremaActiveId,
|
|
isActive: item.code === caremaActiveId,
|
|
|
|
|
+ integrationState: item.integrationState === 1,
|
|
|
}"
|
|
}"
|
|
|
@click="handleAddCamera(item.code)"
|
|
@click="handleAddCamera(item.code)"
|
|
|
>
|
|
>
|
|
@@ -104,6 +105,7 @@
|
|
|
>
|
|
>
|
|
|
<KonvaMap
|
|
<KonvaMap
|
|
|
ref="konvaMap"
|
|
ref="konvaMap"
|
|
|
|
|
+ :filter-data="filterShopCameraList"
|
|
|
@change-default-camera="changeDefault"
|
|
@change-default-camera="changeDefault"
|
|
|
@send-camera-id="sendCameras"
|
|
@send-camera-id="sendCameras"
|
|
|
v-moveable:1
|
|
v-moveable:1
|
|
@@ -135,12 +137,16 @@
|
|
|
import useMiniMap from './use-mini-map';
|
|
import useMiniMap from './use-mini-map';
|
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { ElMessage, ElInput } from 'element-plus';
|
|
import { ElMessage, ElInput } from 'element-plus';
|
|
|
- import { onMounted, ref } from 'vue';
|
|
|
|
|
|
|
+ import { onMounted, onUnmounted, ref } from 'vue';
|
|
|
import { updateMinMapViewLayoutApi } from '@/api/scene/scene';
|
|
import { updateMinMapViewLayoutApi } from '@/api/scene/scene';
|
|
|
import { computed } from 'vue';
|
|
import { computed } from 'vue';
|
|
|
import { Search, Refresh, ArrowLeft } from '@element-plus/icons-vue';
|
|
import { Search, Refresh, ArrowLeft } from '@element-plus/icons-vue';
|
|
|
import KonvaMap from './MapBase/KonvaMap.vue';
|
|
import KonvaMap from './MapBase/KonvaMap.vue';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
+ import useCameraStatus from '@/views/cameras/preview/store/useCameraStatus';
|
|
|
|
|
+
|
|
|
|
|
+ const cameraStatus = useCameraStatus();
|
|
|
|
|
+ const { openInterval, closeInterval } = cameraStatus;
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
const getHeaders = () => {
|
|
const getHeaders = () => {
|
|
@@ -166,6 +172,17 @@
|
|
|
const isUploadBg = ref<boolean>(true);
|
|
const isUploadBg = ref<boolean>(true);
|
|
|
const isMap = ref(false);
|
|
const isMap = ref(false);
|
|
|
|
|
|
|
|
|
|
+ function updataState(data, updateData) {
|
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
|
+ const camera = data[i];
|
|
|
|
|
+ const matchedCamera = updateData.find((item) => item.cameraCode === camera.code);
|
|
|
|
|
+ if (matchedCamera) {
|
|
|
|
|
+ camera.status = matchedCamera.status;
|
|
|
|
|
+ camera.integrationState = matchedCamera.integrationState;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const changeUploadBg = () => {
|
|
const changeUploadBg = () => {
|
|
|
if (isUploadBg.value && !isMap.value) {
|
|
if (isUploadBg.value && !isMap.value) {
|
|
|
konvaMap.value.resetMap();
|
|
konvaMap.value.resetMap();
|
|
@@ -211,6 +228,10 @@
|
|
|
|
|
|
|
|
const getShopContent = (code: string) => {
|
|
const getShopContent = (code: string) => {
|
|
|
getShowCameras(code).then(() => {
|
|
getShowCameras(code).then(() => {
|
|
|
|
|
+ const codeList = filterShopCameraList.value.map((item) => item.code);
|
|
|
|
|
+ openInterval(codeList, (targetData) => {
|
|
|
|
|
+ updataState(filterShopCameraList.value, targetData);
|
|
|
|
|
+ });
|
|
|
getMapLayout(code).then((res) => {
|
|
getMapLayout(code).then((res) => {
|
|
|
if (!res) {
|
|
if (!res) {
|
|
|
return;
|
|
return;
|
|
@@ -239,6 +260,10 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ onUnmounted(() => {
|
|
|
|
|
+ closeInterval();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
const filterShopCameraList = computed(() => {
|
|
const filterShopCameraList = computed(() => {
|
|
|
const k = searchKey.value.trim();
|
|
const k = searchKey.value.trim();
|
|
|
if (!k) return shopCameraList.value;
|
|
if (!k) return shopCameraList.value;
|
|
@@ -387,6 +412,11 @@
|
|
|
background-color: rgba(0, 0, 0, 0.6);
|
|
background-color: rgba(0, 0, 0, 0.6);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .integrationState {
|
|
|
|
|
+ cursor: not-allowed;
|
|
|
|
|
+ color: #ccc;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
:deep(.search-put .el-input__wrapper) {
|
|
:deep(.search-put .el-input__wrapper) {
|
|
|
background-color: #f0f2f5;
|
|
background-color: #f0f2f5;
|
|
|
}
|
|
}
|