|
|
@@ -43,9 +43,9 @@
|
|
|
:class="{
|
|
|
isAdded: isAddedCamera(item.code),
|
|
|
isActive: item.code === caremaActiveId,
|
|
|
- integrationState: item.integrationState === 1,
|
|
|
+ integrationState: item.integrationState === IntegrationIsActive.NO,
|
|
|
}"
|
|
|
- @click="handleAddCamera(item.code, index)"
|
|
|
+ @click="handleAddCamera(item, index)"
|
|
|
>
|
|
|
<span class="camera-id">{{ item.name }}</span>
|
|
|
<el-popover placement="right-start" trigger="hover" :content="item.workSpaceName" :teleported="false">
|
|
|
@@ -107,7 +107,7 @@
|
|
|
import { ShopMapCamera } from '@/types/scene/type';
|
|
|
import { ViewType } from '@/types/page-config/type';
|
|
|
import { openMessageBox } from '@/views/system-config/business-scene/components/MessageBox';
|
|
|
-
|
|
|
+ import { IntegrationIsActive } from '@/types/camera/type';
|
|
|
const cameraStatus = useCameraStatus();
|
|
|
const { openIntervalNew, closeInterval } = cameraStatus;
|
|
|
|
|
|
@@ -275,19 +275,26 @@
|
|
|
);
|
|
|
});
|
|
|
|
|
|
- const handleAddCamera = (cameraId: string, index: number) => {
|
|
|
- if (isAddedCamera(cameraId)) {
|
|
|
- const camera = konvaMap.value.findCamera(cameraId);
|
|
|
+ const handleAddCamera = (cameraDetail: ShopMapCamera, index: number) => {
|
|
|
+ const cameraCode = cameraDetail.code;
|
|
|
+ if (isAddedCamera(cameraCode)) {
|
|
|
+ const camera = konvaMap.value.findCamera(cameraCode);
|
|
|
konvaMap.value.handleCameraClick(camera);
|
|
|
return;
|
|
|
}
|
|
|
+ if (cameraDetail.integrationState === IntegrationIsActive.NO) {
|
|
|
+ ElMessage.warning({
|
|
|
+ message: '该相机未接入平台,暂时无法添加到小地图',
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!hasBg.value) {
|
|
|
ElMessage.warning({
|
|
|
message: '请先添加车间地图',
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- konvaMap.value.addCamera(cameraId, index);
|
|
|
+ konvaMap.value.addCamera(cameraCode, index);
|
|
|
};
|
|
|
|
|
|
const handleSave = () => {
|