From 41b2368c2a5ce6f4bf76e1c32e1e60fd84a310b5 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期五, 09 十月 2026 14:17:20 +0800
Subject: [PATCH] 工步页说明工步名称是判定出的方向
---
src/api/deviceAdapters.ts | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/api/deviceAdapters.ts b/src/api/deviceAdapters.ts
new file mode 100644
index 0000000..b02cf99
--- /dev/null
+++ b/src/api/deviceAdapters.ts
@@ -0,0 +1,34 @@
+import { request, type ApiResponse } from './request'
+
+interface DeviceAdapterDto {
+ adapterId: number
+ adapterCode: string
+ adapterName: string | null
+ adapterType: string | null
+ host: string | null
+ connectionStatus: string | null
+}
+
+interface DeviceAdapterListResponse extends ApiResponse {
+ rows: DeviceAdapterDto[]
+}
+
+export interface DeviceAdapterOption {
+ id: number
+ code: string
+ name: string
+ type: string
+ connectionStatus: string
+}
+
+/** 供采集器登记选择「数据来源」:采集器的辅助测量由所链接来源实例提供(ADR-0064)。 */
+export async function getDeviceAdapterOptions(): Promise<DeviceAdapterOption[]> {
+ const result = await request<DeviceAdapterListResponse>('/system/deviceAdapter/list?pageNum=1&pageSize=200')
+ return (result.rows || []).map(item => ({
+ id: item.adapterId,
+ code: item.adapterCode,
+ name: item.adapterName || item.adapterCode,
+ type: item.adapterType || '-',
+ connectionStatus: item.connectionStatus || '',
+ }))
+}
--
Gitblit v1.7.1