From c832bf2e80ac465e71b7a1c1f7a59d4252030989 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 05 Aug 2025 17:33:08 +0800
Subject: [PATCH] feat:事件工单滚动条

---
 src/views/device/components/use-dock-control.js |   42 +++++++++++++++++-------------------------
 1 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/src/views/device/components/use-dock-control.js b/src/views/device/components/use-dock-control.js
index bd62a21..546a2fb 100644
--- a/src/views/device/components/use-dock-control.js
+++ b/src/views/device/components/use-dock-control.js
@@ -24,41 +24,33 @@
 
   // 发送指令
   async function sendDockControlCmd(params, tip = true) {
-    try {
-      let body = undefined;
-      if (params.action !== undefined) {
-        if (params.cmd === DeviceCmd.SdrWorkModeSwitch) {
-          body = {
-            link_workmode: params.action,
-          };
-        } else {
-          body = {
-            action: params.action,
-          };
-        }
+    let body = undefined;
+    if (params.action !== undefined) {
+      if (params.cmd === DeviceCmd.SdrWorkModeSwitch) {
+        body = {
+          link_workmode: params.action,
+        };
+      } else {
+        body = {
+          action: params.action,
+        };
       }
-      const { code, message: msg } = await postSendCmd(
-        { dock_sn: params.sn, device_cmd: params.cmd },
-        body
-      );
-      if (code === 0) {
+    }
+    try {
+      const res = await postSendCmd({ dock_sn: params.sn, device_cmd: params.cmd }, body);
+      if (res.data.code === 0) {
         tip &&
           ElMessage({
             message: '指令发送成功',
             type: 'success',
           });
         return true;
-        message.error('指令发送失败');
       }
-      throw msg;
-    } catch (e) {
-      tip &&
-        ElMessage({
-          message: '指令发送失败',
-          type: 'error',
-        });
+    } catch (error) {
       return false;
     }
+
+    return false;
   }
 
   // 控制面板关闭

--
Gitblit v1.9.3