瀏覽代碼

设备列表增加点击事件

xujunjie 1 年之前
父節點
當前提交
3cd36954f5
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/pages/Controller/Device.js

+ 4 - 1
src/pages/Controller/Device.js

@@ -34,7 +34,9 @@ function Hardware() {
 
     return `${styles.icon} ${statusClassName}`;
   });
-
+  const onHandleClick = item => {
+    UnityAction.sendMsg('SingleDevLocate', JSON.stringify([item]));
+  };
   useEffect(() => {
     if (!draw) return;
     run(projectId);
@@ -56,6 +58,7 @@ function Hardware() {
           key={item.id}
           className={`card-box ${styles.item}`}
           style={{ justifyContent: 'space-between' }}
+          onClick={() => onHandleClick(item)}
         >
           <div>
             <i