From d667fce729c223e885930bb8edb528ab501b8d6a Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期二, 26 十一月 2024 16:57:53 +0800 Subject: [PATCH] 1. 移动socket客户端类、新增socket/index.js文件(初始化) 2. socketMessage枚举类的完善(增加对每个类型的英文描述字段以及对类型筛选和判断是否为心跳消息的工具方法) 3. 在FYBgTaskCard.vue监听并处理如何刷后台任务状态逻辑 --- src/api/fysp/deviceApi.js | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/api/fysp/deviceApi.js b/src/api/fysp/deviceApi.js index f46d505..f95c919 100644 --- a/src/api/fysp/deviceApi.js +++ b/src/api/fysp/deviceApi.js @@ -9,5 +9,21 @@ } }) .then((res) => res.data); + }, + // 鑾峰彇璁惧 + fetchDevices(sceneId, deviceTypeId) { + const params = `?sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`; + return $fysp + .get(`device${params}`) + .then((res) => res) + .then((res) => res.data); + }, + // 鑾峰彇璁惧鐘舵�佷互鍙婅澶囪鎯� + fetchDeviceStatus({ deviceId, sceneId, deviceTypeId }) { + const params = `?deviceId=${deviceId}&sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`; + return $fysp + .get(`device/status${params}`) + .then((res) => res) + .then((res) => res.data); } }; -- Gitblit v1.9.3