功能:ROI绑定算法时校验RTSP地址有效性

截图加载失败时阻止算法绑定并提示"RTSP拉流地址无效",
通过Canvas截图加载状态逐层传递到算法绑定组件实现校验。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 15:25:07 +08:00
parent d8e1ae5dab
commit eab4337a77
3 changed files with 17 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ const roiList = ref<AiotDeviceApi.Roi[]>([]);
const selectedRoiId = ref<null | string>(null);
const selectedRoiBindings = ref<AiotDeviceApi.RoiAlgoBinding[]>([]);
const snapUrl = ref('');
const snapOk = ref(false);
const edgeDevices = ref<Array<{ deviceId: string }>>([]);
@@ -157,6 +158,10 @@ async function refreshSnap() {
await buildSnapUrl(true);
}
function onSnapStatus(ok: boolean) {
snapOk.value = ok;
}
// ==================== ROI 数据加载 ====================
async function loadRois() {
@@ -352,6 +357,7 @@ function handlePush() {
@roi-drawn="onRoiDrawn"
@roi-selected="onRoiSelected"
@roi-deleted="onRoiDeleted"
@snap-status="onSnapStatus"
/>
</div>
@@ -471,6 +477,7 @@ function handlePush() {
<RoiAlgorithmBind
:roi-id="selectedRoi.roiId || ''"
:bindings="selectedRoiBindings"
:snap-ok="snapOk"
@changed="loadRoiDetail"
/>
</div>