From be3e67b2c18fc35aa0c5592b4ef74c6d1c2aa6fa Mon Sep 17 00:00:00 2001 From: CGD <3030332422@qq.com> Date: Tue, 25 Mar 2025 16:23:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E6=88=90=E2=80=9C=E5=B7=B2?= =?UTF-8?q?=E7=BB=91=E8=AE=BE=E5=A4=87=E2=80=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/manager-web/src/apis/module/user.js | 16 +++ .../manager-web/src/components/DeviceItem.vue | 5 +- main/manager-web/src/components/HeaderBar.vue | 2 +- .../src/views/DeviceManagement.vue | 108 +++++++++++------- main/manager-web/src/views/roleConfig.vue | 1 + 5 files changed, 90 insertions(+), 42 deletions(-) diff --git a/main/manager-web/src/apis/module/user.js b/main/manager-web/src/apis/module/user.js index 4b008ffe..6bd4acea 100755 --- a/main/manager-web/src/apis/module/user.js +++ b/main/manager-web/src/apis/module/user.js @@ -257,4 +257,20 @@ export default { }); }).send(); }, + // 获取已绑设备 + getAgentBindDevices(agentId, callback) { + RequestService.sendRequest() + .url(`${getServiceUrl()}/api/v1/user/agent/device/bind/${agentId}`) + .method('GET') + .success((res) => { + RequestService.clearRequestTime(); + callback(res); + }) + .fail((err) => { + console.error('获取设备列表失败:', err); + RequestService.reAjaxFun(() => { + this.getAgentBindDevices(agentId, callback); + }); + }).send(); + }, } diff --git a/main/manager-web/src/components/DeviceItem.vue b/main/manager-web/src/components/DeviceItem.vue index 4f651482..4ad34709 100644 --- a/main/manager-web/src/components/DeviceItem.vue +++ b/main/manager-web/src/components/DeviceItem.vue @@ -26,7 +26,7 @@
历史对话
-
+
设备管理
@@ -51,6 +51,9 @@ export default { }, handleConfigure() { this.$router.push({ path: '/role-config', query: { agentId: this.device.agentId } }); + }, + handleDeviceManage() { + this.$router.push({ path: '/device-management', query: { agentId: this.device.agentId } }); } } } diff --git a/main/manager-web/src/components/HeaderBar.vue b/main/manager-web/src/components/HeaderBar.vue index 95ed2b94..5c1f52e9 100644 --- a/main/manager-web/src/components/HeaderBar.vue +++ b/main/manager-web/src/components/HeaderBar.vue @@ -25,7 +25,7 @@ - {{ userInfo.username || '加载中...' }} + {{ userInfo.mobile || '加载中...' }} 个人中心 diff --git a/main/manager-web/src/views/DeviceManagement.vue b/main/manager-web/src/views/DeviceManagement.vue index 03939a28..9135a3e6 100644 --- a/main/manager-web/src/views/DeviceManagement.vue +++ b/main/manager-web/src/views/DeviceManagement.vue @@ -1,20 +1,20 @@