|
@@ -38,6 +38,7 @@
|
|
|
filterable
|
|
filterable
|
|
|
clearable
|
|
clearable
|
|
|
@change="onCameraChange(activePoint)"
|
|
@change="onCameraChange(activePoint)"
|
|
|
|
|
+ @focus="ensureCurrentCameraInList"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="camera in availableCameras"
|
|
v-for="camera in availableCameras"
|
|
@@ -142,6 +143,7 @@ const pointList = [
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
// 多相机模式的配置结构(统一数据结构)
|
|
// 多相机模式的配置结构(统一数据结构)
|
|
|
|
|
+// 使用原始 CameraKey 作为存储和显示
|
|
|
const multiConfig = reactive({
|
|
const multiConfig = reactive({
|
|
|
A: {
|
|
A: {
|
|
|
iso: { low: '100', high: '6400' },
|
|
iso: { low: '100', high: '6400' },
|
|
@@ -221,10 +223,7 @@ const fetchCameraList = () => {
|
|
|
clientStore.ipc.invoke(icpList.camera.getCameraList).then(result => {
|
|
clientStore.ipc.invoke(icpList.camera.getCameraList).then(result => {
|
|
|
if (result && result.CameraLists && Array.isArray(result.CameraLists)) {
|
|
if (result && result.CameraLists && Array.isArray(result.CameraLists)) {
|
|
|
cameraList.value = result.CameraLists
|
|
cameraList.value = result.CameraLists
|
|
|
- // 自动分配相机到点位
|
|
|
|
|
- if (isMultiCameraMode.value) {
|
|
|
|
|
- autoAssignCameras()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 不再自动分配相机,让用户手动选择
|
|
|
updatePointConnectionStatus()
|
|
updatePointConnectionStatus()
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -232,21 +231,6 @@ const fetchCameraList = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 自动分配相机到点位
|
|
|
|
|
-const autoAssignCameras = () => {
|
|
|
|
|
- const cameras = cameraList.value || []
|
|
|
|
|
- const unassignedCameras = cameras.filter(cam => {
|
|
|
|
|
- return !Object.values(multiConfig).some(p => p.CameraKey === cam.CameraKey)
|
|
|
|
|
- })
|
|
|
|
|
- const points = ['A', 'B', 'C']
|
|
|
|
|
- unassignedCameras.slice(0, 3).forEach((cam, index) => {
|
|
|
|
|
- if (points[index]) {
|
|
|
|
|
- multiConfig[points[index]].CameraKey = cam.CameraKey
|
|
|
|
|
- multiConfig[points[index]].CameraName = cam.CameraName
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 相机选择变更
|
|
// 相机选择变更
|
|
|
const onCameraChange = (pointKey) => {
|
|
const onCameraChange = (pointKey) => {
|
|
|
const cameraKey = multiConfig[pointKey].CameraKey
|
|
const cameraKey = multiConfig[pointKey].CameraKey
|
|
@@ -262,6 +246,23 @@ const onCameraChange = (pointKey) => {
|
|
|
updatePointConnectionStatus()
|
|
updatePointConnectionStatus()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 确保当前绑定的相机在列表中(即使断开连接也显示)
|
|
|
|
|
+const ensureCurrentCameraInList = () => {
|
|
|
|
|
+ const currentCameraKey = multiConfig[activePoint.value].CameraKey
|
|
|
|
|
+ if (!currentCameraKey) return
|
|
|
|
|
+
|
|
|
|
|
+ // 检查是否已在列表中
|
|
|
|
|
+ const exists = cameraList.value.some(c => c.CameraKey === currentCameraKey)
|
|
|
|
|
+ if (!exists) {
|
|
|
|
|
+ // 添加一个临时条目(未连接状态)用于显示
|
|
|
|
|
+ cameraList.value.push({
|
|
|
|
|
+ CameraKey: currentCameraKey,
|
|
|
|
|
+ CameraName: multiConfig[activePoint.value].CameraName || currentCameraKey,
|
|
|
|
|
+ CameraStatus: false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 监听multiConfig变化并更新父组件
|
|
// 监听multiConfig变化并更新父组件
|
|
|
watch(multiConfig, (newVal) => {
|
|
watch(multiConfig, (newVal) => {
|
|
|
emit('update:camera_configs', {
|
|
emit('update:camera_configs', {
|