From ecfb6048ce225dfdcc6204c5bc15aa673f5388f7 Mon Sep 17 00:00:00 2001 From: yangsy Date: Tue, 16 Jun 2026 10:32:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84(vimp):=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8DVIMP=20API=E6=96=87=E4=BB=B6=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B0=83=E7=94=A8=E5=A4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原有的catalog.channel和catalog.all-device API文件重命名为带client前缀的新文件,新增对应API实现模块,修复all-device接口函数名的拼写错误,并更新use-channels-query组合式函数中的API调用逻辑 --- .../{catalog.all-device.ts => client.catalog.all-device.ts} | 2 +- .../{catalog.channel.ts => client.catalog.channel.ts} | 2 +- src/pages/vimp/apis/request/index.ts | 4 ++-- src/pages/vimp/composables/query/use-channels-query.ts | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename src/pages/vimp/apis/request/{catalog.all-device.ts => client.catalog.all-device.ts} (81%) rename src/pages/vimp/apis/request/{catalog.channel.ts => client.catalog.channel.ts} (78%) diff --git a/src/pages/vimp/apis/request/catalog.all-device.ts b/src/pages/vimp/apis/request/client.catalog.all-device.ts similarity index 81% rename from src/pages/vimp/apis/request/catalog.all-device.ts rename to src/pages/vimp/apis/request/client.catalog.all-device.ts index 3c4b002..180888a 100644 --- a/src/pages/vimp/apis/request/catalog.all-device.ts +++ b/src/pages/vimp/apis/request/client.catalog.all-device.ts @@ -1,7 +1,7 @@ import { unwrapVimpResponse, vimpClient } from '../client'; import { normalizeVimpSite, type VimpRawSite } from '../model'; -export const catalogAllDeviceApi = async (options?: { signal?: AbortSignal }) => { +export const clientCatalogAllDeviceApi = async (options?: { signal?: AbortSignal }) => { const { signal } = options ?? {}; const client = vimpClient; const endpoint = `/client/catalog/allDevice`; diff --git a/src/pages/vimp/apis/request/catalog.channel.ts b/src/pages/vimp/apis/request/client.catalog.channel.ts similarity index 78% rename from src/pages/vimp/apis/request/catalog.channel.ts rename to src/pages/vimp/apis/request/client.catalog.channel.ts index 14dda8d..c551eee 100644 --- a/src/pages/vimp/apis/request/catalog.channel.ts +++ b/src/pages/vimp/apis/request/client.catalog.channel.ts @@ -1,7 +1,7 @@ import { unwrapVimpResponse, vimpClient } from '../client'; import type { VimpChannel } from '../model'; -export const catalogChannelApi = async (code: string, options?: { signal?: AbortSignal }) => { +export const clientCatalogChannelApi = async (code: string, options?: { signal?: AbortSignal }) => { const { signal } = options ?? {}; const client = vimpClient; const endpoint = `/client/catalog/channel`; diff --git a/src/pages/vimp/apis/request/index.ts b/src/pages/vimp/apis/request/index.ts index 15cde47..896d1a9 100644 --- a/src/pages/vimp/apis/request/index.ts +++ b/src/pages/vimp/apis/request/index.ts @@ -1,2 +1,2 @@ -export * from './catalog.channel'; -export * from './catalog.all-device'; +export * from './client.catalog.channel'; +export * from './client.catalog.all-device'; diff --git a/src/pages/vimp/composables/query/use-channels-query.ts b/src/pages/vimp/composables/query/use-channels-query.ts index 1a4703b..e4e990b 100644 --- a/src/pages/vimp/composables/query/use-channels-query.ts +++ b/src/pages/vimp/composables/query/use-channels-query.ts @@ -4,7 +4,7 @@ import type { AxiosRequestConfig } from 'axios'; import axios from 'axios'; import { compileCodeAreas, type CodeArea, type CodeLines, type CodeSites } from '../../types'; import { useCameraStore, useAlarmStore } from '../../stores'; -import { catalogAllDeviceApi, catalogChannelApi, type VimpChannel, type VimpSite } from '../../apis'; +import { cientCatalogAllDeviceApi, clientCatalogChannelApi, type VimpChannel, type VimpSite } from '../../apis'; import { VIMP_CHANNELS_QUERY_KEY } from '../../constants'; const config: AxiosRequestConfig = { @@ -69,7 +69,7 @@ export const useChannelsQuery = () => { codeTrainAreas, }); - const sitesFromApi = await catalogAllDeviceApi({ signal }); + const sitesFromApi = await cientCatalogAllDeviceApi({ signal }); // 从 /allDevice 接口获取的站点信息并不保证真实性和完整性, // 例如有一个站点的编码是 010699 开头,但是其下的通道是 010199 和 010599 开头, @@ -82,7 +82,7 @@ export const useChannelsQuery = () => { const siteCodeToAlarmsMap = new Map(); for (const siteFromApi of sitesFromApi ?? []) { - const channels = await catalogChannelApi(siteFromApi.code, { signal }); + const channels = await clientCatalogChannelApi(siteFromApi.code, { signal }); if (!channels) continue; channels.forEach((channel) => {