chenbaoxin пре 4 месеци
родитељ
комит
944ef79dd3
2 измењених фајлова са 12 додато и 1 уклоњено
  1. 5 0
      src/api/index.ts
  2. 7 1
      src/views/MaintenanceStrategyAssistance/view.vue

+ 5 - 0
src/api/index.ts

@@ -23,6 +23,11 @@ export function downloadStrategy() {
 
   return "/deviceRepair/downloadStrategy";
 }
+export function downloadDeviceRepair() {
+  // return post("/deviceRepair/downloadStrategy",data);
+
+  return "/deviceRepair/download";
+}
 // 工况列表接口
 /**
  * 

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

@@ -97,7 +97,7 @@
               <el-button class="btns"  link @click="viewDetails(scope.row.id,scope.row.name)"
                 >设备历史建议</el-button
               >
-              <el-button class="btns"  link @click="exportRecord(scope.row.id)"
+              <el-button class="btns"  link @click="exportRecord(scope.row.name)"
                 >导出记录</el-button
               >
               <el-button class="btns-warn"  link @click="delBefore(scope.row.id)"
@@ -145,6 +145,8 @@ import { Filter } from "@element-plus/icons-vue";
 import { Search } from "@element-plus/icons-vue";
 import { useRoute, useRouter } from "vue-router";
 import ModalComponent from "@/components/ModalComponent/index.vue";
+import { downloadDeviceRepair } from "@/api/index";
+import { downloadFile } from "@/utils/utils";
 
 // 基础路由
 const router = useRouter();
@@ -165,6 +167,10 @@ const getHealthStatusClass = (sts: number) => {
       return "info"; // 处理未知或未定义的状态
   }
 };
+const exportRecord=(value:string)=>{
+
+     downloadFile(downloadDeviceRepair(), "设备历史维修策略.xlsx", {name:value });
+}
 // 当前健康状态:1-良好;2-一般;3-较差;4-危险
 const getHealthStatusText = (status: number) => {
   switch (status) {