Jelajahi Sumber

feat: #8405 新增设备批量激活

jackhoo_98 3 tahun lalu
induk
melakukan
a25eab6015
1 mengubah file dengan 23 tambahan dan 0 penghapusan
  1. 23 0
      src/pages/device/Instance/index.tsx

+ 23 - 0
src/pages/device/Instance/index.tsx

@@ -16,6 +16,7 @@ import {
   PlusOutlined,
   StopOutlined,
   SyncOutlined,
+  CheckOutlined,
 } from '@ant-design/icons';
 import { model } from '@formily/reactive';
 import Service from '@/pages/device/Instance/service';
@@ -572,6 +573,28 @@ const Instance = () => {
         <Menu.Item key="6">
           <PermissionButton
             isPermission={permission.action}
+            icon={<CheckOutlined />}
+            type="primary"
+            popConfirm={{
+              title: '确认激活选中设备?',
+              onConfirm() {
+                service.batchDeployDevice(bindKeys).then((resp) => {
+                  if (resp.status === 200) {
+                    onlyMessage('操作成功');
+                    actionRef.current?.reset?.();
+                  }
+                });
+              },
+            }}
+          >
+            激活选中设备
+          </PermissionButton>
+        </Menu.Item>
+      )}
+      {bindKeys.length > 0 && (
+        <Menu.Item key="6">
+          <PermissionButton
+            isPermission={permission.action}
             icon={<StopOutlined />}
             type="primary"
             danger