优化:ROI 编辑页删除边缘设备选择器

device_id 现在由后端从摄像头配置自动继承,前端不再需要手动选择。
This commit is contained in:
2026-03-30 14:14:28 +08:00
parent ed25910679
commit 7e13025e3b

View File

@@ -68,17 +68,6 @@ const snapOk = ref(false);
const panelVisible = ref(false);
const roiCanvasRef = ref<InstanceType<typeof RoiCanvas> | null>(null);
const edgeDevices = ref<Array<{ deviceId: string }>>([]);
async function loadEdgeDevices() {
try {
const list = await wvpRequestClient.get<Array<{ deviceId: string }>>('/aiot/device/device/list');
edgeDevices.value = (list as any) || [];
} catch {
edgeDevices.value = [{ deviceId: 'edge' }];
}
}
const selectedRoi = computed(() => {
if (!selectedRoiId.value) return null;
return roiList.value.find((r) => r.roiId === selectedRoiId.value) || null;
@@ -93,7 +82,6 @@ const polygonPointCount = computed(() => {
// ==================== 初始化 ====================
onMounted(async () => {
loadEdgeDevices();
const q = route.query;
if (q.cameraCode) {
cameraCode.value = String(q.cameraCode);
@@ -230,7 +218,7 @@ function addFullscreen() {
priority: 0,
enabled: 1,
description: '',
deviceId: edgeDevices.value[0]?.deviceId || 'edge',
deviceId: '',
};
try {
await saveRoi(newRoi);
@@ -283,7 +271,7 @@ async function onRoiDrawn(data: { coordinates: string; roi_type: string }) {
priority: 0,
enabled: 1,
description: '',
deviceId: edgeDevices.value[0]?.deviceId || 'edge',
deviceId: '',
};
try {
await saveRoi(newRoi);
@@ -532,17 +520,6 @@ function handlePush() {
@blur="updateRoiData(selectedRoi!)"
/>
</Form.Item>
<Form.Item label="边缘设备">
<Select
v-model:value="selectedRoi.deviceId"
placeholder="选择边缘设备"
@change="updateRoiData(selectedRoi!)"
>
<Select.Option v-for="dev in edgeDevices" :key="dev.deviceId" :value="dev.deviceId">
{{ dev.deviceId }}
</Select.Option>
</Select>
</Form.Item>
<Form.Item label="颜色">
<Input
v-model:value="selectedRoi.color"