From 6125f1d7118525e86ee8b0c26b0d731cbda0dc62 Mon Sep 17 00:00:00 2001 From: g82tt Date: Tue, 19 May 2026 23:17:05 +0800 Subject: [PATCH] =?UTF-8?q?K8:=20=E7=AE=A1=E7=90=86=E7=AB=AF=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=85=8D=E5=A5=97=20=E9=97=A8=E7=A6=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE(=E5=BC=80?= =?UTF-8?q?=E9=97=A8/=E6=8E=88=E6=9D=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse/device_manager/base_device.vue | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/web.vite/src/views/warehouse/device_manager/base_device.vue b/web.vite/src/views/warehouse/device_manager/base_device.vue index b63add0..c57d41b 100644 --- a/web.vite/src/views/warehouse/device_manager/base_device.vue +++ b/web.vite/src/views/warehouse/device_manager/base_device.vue @@ -134,6 +134,21 @@ } const openControl = (d) => { curDev.value = d; controlVisible.value = true } + //── KMS 钥匙柜操作 ── + const kmsOpen = async (row) => { + try { + await fetch(`${GW}/api/gateway/control/${row.adapterCode}`, { + method: 'POST', headers: {'Content-Type':'application/json'}, + body: JSON.stringify({ deviceId: row.sourceId, command: 'open', parameters: {} }) + }) + proxy.$message.success('开门指令已发送') + } catch { proxy.$message.error('开门失败') } + } + const kmsAuthorize = (row) => { + // TODO Phase 2: 打开授权对话框 + console.log('authorize', row) + } + //── 框架钩子 ── const onInit = async ($vm) => { gridRef = $vm; } const onInited = async () => { @@ -168,6 +183,22 @@ ); } + if (row.DeviceGroup === '门禁设备') { + return ( +
+ kmsOpen(row)}> + 开门 + + kmsAuthorize(row)}> + 授权 + +
+ ); + } return null; } });