fix: 修复设备查询缓存键冲突问题

- 将查询键中的设备ID改为由车站编码和设备ID组成的唯一键,防止不同车站下相同设备ID导致的数据混淆。
- 同时更新相关监控逻辑,当车站或设备IP变化时重置页面状态。
This commit is contained in:
yangsy
2026-04-10 10:15:32 +08:00
parent 943aa27de1
commit 86e3e1726d
3 changed files with 15 additions and 8 deletions
@@ -25,8 +25,10 @@ const showCard = computed(() => deviceType.value === DEVICE_TYPE_LITERALS.ndmMed
const SERVER_STREAM_PUSH_KEY = 'server-stream-push-query';
const deviceUniqueKey = computed(() => [station.value.code, ndmDevice.value.id]);
const { data: streamPushes } = useQuery({
queryKey: computed(() => [SERVER_STREAM_PUSH_KEY, ndmDevice.value.id, ndmDevice.value.lastDiagTime]),
queryKey: computed(() => [SERVER_STREAM_PUSH_KEY, deviceUniqueKey.value, ndmDevice.value.lastDiagTime]),
enabled: computed(() => activeRequests.value && showCard.value),
refetchInterval: 30 * 1000,
gcTime: 0,