From 99a5f8bd16a502c82cb4f3d467a26b23c92930d8 Mon Sep 17 00:00:00 2001 From: zxr <271055687@qq.com> Date: Sun, 5 Jul 2026 17:54:23 +0800 Subject: [PATCH] fix: trim parsed snmp oid rows --- .../ops/pages/dc/device-collect/components/FormDialog.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/ops/pages/dc/device-collect/components/FormDialog.vue b/src/views/ops/pages/dc/device-collect/components/FormDialog.vue index e191900..927480e 100644 --- a/src/views/ops/pages/dc/device-collect/components/FormDialog.vue +++ b/src/views/ops/pages/dc/device-collect/components/FormDialog.vue @@ -290,10 +290,10 @@ const parseSnmpOidRows = (raw: string): SnmpOidRow[] => { throw new Error('SNMP OID 配置必须是 JSON 数组') } return parsed.map((item) => ({ - oid: String(item?.oid ?? ''), - metric_name: String(item?.metric_name ?? ''), - metric_unit: String(item?.metric_unit ?? ''), - type: String(item?.type ?? ''), + oid: String(item?.oid ?? '').trim(), + metric_name: String(item?.metric_name ?? '').trim(), + metric_unit: String(item?.metric_unit ?? '').trim(), + type: String(item?.type ?? '').trim(), })) }