Ver Fonte

#660 自动详情中设备历史记录数据缺失,与导出记录不一致

Mr. Robot há 3 meses atrás
pai
commit
7a945b1fe2
1 ficheiros alterados com 7 adições e 4 exclusões
  1. 7 4
      src/views/MaintenanceStrategyAssistance/view.vue

+ 7 - 4
src/views/MaintenanceStrategyAssistance/view.vue

@@ -98,7 +98,7 @@
               <el-button class="btns"  link @click="viewDetails(scope.row.id,scope.row.name)"
                 > {{  routeType === 'auto' ? '设备历史记录' : '设备历史建议' }}</el-button
               >
-              <el-button class="btns"  link @click="exportRecord(scope.row.name)"
+              <el-button class="btns"  link @click="exportRecord(scope.row)"
                 >导出记录</el-button
               >
               <!-- <el-button class="btns-warn"  link @click="delBefore(scope.row.id)"
@@ -168,9 +168,12 @@ const getHealthStatusClass = (sts: number) => {
       return "info"; // 处理未知或未定义的状态
   }
 };
-const exportRecord=(value:string)=>{
-
-downloadFile(downloadDeviceRepair(), "设备历史维修策略.xlsx", {name:value });
+const exportRecord=(value:any)=>{
+  if (routeType.value == 'auto') {
+    downloadFile('/maintenanceStrategy/autoDetection/exportFaultHistoryRecords', "设备历史维修策略 (自动).xlsx", {id: value.id});
+  } else {
+    downloadFile(downloadDeviceRepair(), "设备历史维修策略.xlsx", {name: value.name});
+  }
 }
 // 当前健康状态:1-良好;2-一般;3-较差;4-危险
 const getHealthStatusText = (status: number) => {