فهرست منبع

增加设备的批量检测状态功能

yanglzh 1 ماه پیش
والد
کامیت
27d8908c9e

+ 1 - 1
src/api/device/index.ts

@@ -114,7 +114,7 @@ export default {
     setDeviceStatus: (data: object) => post('/product/device/setDeviceStatus', data),
     import: (data: object) => post('/product/device/import', data),
     export: (data: object) => file('/product/device/export', data),
-    
+    syncStatus: () => get('/product/device/syncStatus'),
   },
   dev_asset: {
     all: (params: object) => get('/asset/asset/all', params),

+ 2 - 1
src/i18n/pages/iotmanagerI18n/en.ts

@@ -276,7 +276,8 @@ export default {
 			batchEnable: "Batch Enable",
 			batchDisable: "Batch Disable",
 			importDevice: "Import Device",
-			exportDevice: "Export Device"
+			exportDevice: "Export Device",
+			batchCheckStatus: "Batch Check Status"
 		},
 		rules: {
 			productName: "Product name cannot be empty",

+ 2 - 1
src/i18n/pages/iotmanagerI18n/zh-cn.ts

@@ -276,7 +276,8 @@ export default {
 			batchEnable: "批量启用",
 			batchDisable: "批量禁用",
 			importDevice: "导入设备",
-			exportDevice: "导出设备"
+			exportDevice: "导出设备",
+			batchCheckStatus: "批量检测状态"
 		},
 		rules: {
 			productName: "产品名称不能为空",

+ 2 - 1
src/i18n/pages/iotmanagerI18n/zh-tw.ts

@@ -276,7 +276,8 @@ export default {
 			batchEnable: "批量啟用",
 			batchDisable: "批量禁用",
 			importDevice: "导入设备",
-			exportDevice: "导出设备"
+			exportDevice: "导出设备",
+			batchCheckStatus: "批量檢查狀態"
 		},
 		rules: {
 			productName: "產品名稱不能為空",

+ 22 - 1
src/views/iot/device/instance/index.vue

@@ -175,6 +175,15 @@
                         {{ $t('message.device.formI18nButton.exportDevice') }}
                       </el-button>
                     </el-dropdown-item>
+                    <el-dropdown-item>
+                      <!-- 批量检测状态 -->
+                      <el-button @click="batchCheckStatus()">
+                        <el-icon>
+                          <ele-Refresh />
+                        </el-icon>
+                        {{ $t('message.device.formI18nButton.batchCheckStatus') }}
+                      </el-button>
+                    </el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
               </el-dropdown>
@@ -347,6 +356,18 @@ export default defineComponent({
       excelDicRef.value.openDialog(type);
     };
 
+    const batchCheckStatus = () => {
+      const loading = ElMessage({
+        message: '同步中,请稍后...',
+        type: 'info',
+        duration: 0,
+      });
+      api.device.syncStatus().then(() => {
+        ElMessage.success('同步成功');
+        typeList();
+      }).finally(() => loading.close());
+    };
+
     //批量启用
     const setDeviceStatus1 = (row?: TableDataRow) => {
       let keys: string[] = [];
@@ -485,10 +506,10 @@ export default defineComponent({
     };
 
     return {
-
       addDicRef,
       excelDicRef,
       onOpenexcelDic,
+      batchCheckStatus,
       editDicRef,
       detailRef,
       queryRef,