wyj0522 vor 2 Tagen
Ursprung
Commit
07592a9f00

+ 7 - 0
fdapfe-admin/src/main/java/com/cn/fdapfe/biz/controller/ModelDataGenController.java

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.cn.fdapfe.biz.domain.ModelDataGen;
 import com.cn.fdapfe.biz.service.IModelDataGenService;
+import com.cn.fdapfe.biz.service.impl.ExeProcessManager;
 import com.cn.fdapfe.common.utils.poi.ExcelUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -81,6 +82,12 @@ public class ModelDataGenController extends BaseController
     public AjaxResult add(@RequestBody ModelDataGen modelDataGen) throws Exception {
         return toAjax(service.add(modelDataGen));
     }
+    @PreAuthorize("@ss.hasPermi('dataGen:add')")
+    @Log(title = "物理模型数据生成管理", businessType = BusinessType.INSERT)
+    @PostMapping("/upExe")
+    public void upExe(String exePath) throws Exception {
+        ExeProcessManager.startExe(exePath, true);
+    }
 
     /**
      * 修改物理模型数据生成管理

+ 49 - 47
fdapfe-admin/src/main/java/com/cn/fdapfe/biz/service/impl/FdAlgorithmServiceImpl.java

@@ -40,16 +40,17 @@ import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
 
+import static com.cn.fdapfe.common.utils.file.FileCopyUtils.deleteAllFiles;
+import static com.cn.fdapfe.common.utils.file.FileCopyUtils.waitForFileAndGetAllFiles;
+
 /**
  * 故障诊断算法功能验证Service业务层处理
- * 
+ *
  * @author Allen
  * @date 2025-03-07
  */
 @Service
-public class FdAlgorithmServiceImpl implements IFdAlgorithmService
-
-{
+public class FdAlgorithmServiceImpl implements IFdAlgorithmService {
     private static final Logger logger = LoggerFactory.getLogger(FdAlgorithmServiceImpl.class);
     @Resource
     private FdAlgorithmMapper mapper;
@@ -61,35 +62,33 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
 
     /**
      * 查询故障诊断算法功能验证
-     * 
+     *
      * @param id 故障诊断算法功能验证主键
      * @return 故障诊断算法功能验证
      */
     @Override
-    public FdAlgorithm selectFdAlgorithmById(String id)
-    {
+    public FdAlgorithm selectFdAlgorithmById(String id) {
         return mapper.selectById(id);
     }
 
     /**
      * 查询故障诊断算法功能验证列表
-     * 
+     *
      * @param po 故障诊断算法功能验证
      * @return 故障诊断算法功能验证
      */
     @Override
-    public List<FdAlgorithm> selectFdAlgorithmList(FdAlgorithm po)
-    {
+    public List<FdAlgorithm> selectFdAlgorithmList(FdAlgorithm po) {
         QueryWrapper<FdAlgorithm> wrapper = new QueryWrapper<>();
-        wrapper.eq(StringUtils.isNotEmpty(po.getId()),"id",po.getId())
-                .like(StringUtils.isNotEmpty(po.getName()),"name",po.getName())
-                .like(StringUtils.isNotEmpty(po.getDataId()),"model_id",po.getDataId())
-                .eq(StringUtils.isNotEmpty(po.getDataId()),"data_id",po.getDataId());
-        if(po.getStartTime()!=null){
-            wrapper.ge("start_time",po.getStartTime());
+        wrapper.eq(StringUtils.isNotEmpty(po.getId()), "id", po.getId())
+                .like(StringUtils.isNotEmpty(po.getName()), "name", po.getName())
+                .like(StringUtils.isNotEmpty(po.getDataId()), "model_id", po.getDataId())
+                .eq(StringUtils.isNotEmpty(po.getDataId()), "data_id", po.getDataId());
+        if (po.getStartTime() != null) {
+            wrapper.ge("start_time", po.getStartTime());
         }
-        if(po.getEndTime()!=null){
-            wrapper.le("end_time",po.getEndTime());
+        if (po.getEndTime() != null) {
+            wrapper.le("end_time", po.getEndTime());
         }
 
         return mapper.selectList(wrapper);
@@ -97,7 +96,7 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
 
     /**
      * 新增故障诊断算法功能验证
-     * 
+     *
      * @param po 故障诊断算法功能验证
      * @return 结果
      */
@@ -106,7 +105,7 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
         po.setCreateTime(DateUtils.getNowDate());
         po.setCreateBy(SecurityUtils.getUsername());
         ArrayList<String> todoFileUrl = new ArrayList<>();
-        ArrayList<String>jsonDataArray = new ArrayList<>();
+        ArrayList<String> jsonDataArray = new ArrayList<>();
         // 记录开始执行外部程序的时间
         Date startTime = new Date();
         po.setStartTime(startTime);
@@ -116,46 +115,47 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
         // 循环数组,取出每个参数组
         for (LinkedHashMap item : array) {
             // 将上传的文件重命名并复制到当前模型输入目录中
-            FileCopyUtils.copyFile2source(item.get("inputFile").toString(), item.get("inputFilePath").toString());
-            // 将算法配置信息重新写入到算法的input.txt中
-            FileCopyUtils.writeToTxt(item.get("inputPath").toString(), item.get("modelData").toString());
+            FileCopyUtils.copyFile2source(item.get("inputFile").toString(), item.get("inputPath").toString());
+            if (item.containsKey("inputFilePath")) {
+                // 将算法配置信息重新写入到算法的input.txt中
+                FileCopyUtils.writeToTxt(item.get("inputFilePath").toString(), item.get("modelData").toString());
+            }
             // 启动诊断算法对进行诊断
             ExeProcessManager.startExe(item.get("exePath").toString(), true);
             // 获取输出目录
             String outputPath = item.get("outputPath").toString();
             File outputDir = new File(outputPath);
             // 检查输出目录是否存在
-            if (outputDir.exists() && outputDir.isDirectory()) {
-                // 获取目录中的所有文件
-                File[] files = outputDir.listFiles();
-                if (files != null) {
-                    for (File file : files) {
-                        if (file.isFile()) {
-                            FileToMultipartFile multipartFile = new FileToMultipartFile(file.getAbsolutePath(), "file");
-                            AjaxResult ajaxResult = commonController.customUploadFile(multipartFile, "D:/modelData");
-                            // 如果是JSON文件,解析其内容作为返回数据
-                            if (ajaxResult.get("fileSuffix").equals("json") || ajaxResult.get("fileSuffix").equals("txt")) {
-                                String jsonPath = file.getAbsolutePath();
-                                String jsonData = new String(Files.readAllBytes(Paths.get(jsonPath)));
-                                jsonDataArray.add(jsonData);
-                            }else if(ajaxResult.get("fileSuffix").equals("png") || ajaxResult.get("fileSuffix").equals("jpg")){
-                                todoFileUrl.add(ajaxResult.get("todofilePath").toString());
-                            }
+            File[] files = waitForFileAndGetAllFiles(item, "diagnosis_results_summary.json", 1000);
+            if (files != null) {
+                for (File file : files) {
+                    if (file.isFile()) {
+                        FileToMultipartFile multipartFile = new FileToMultipartFile(file.getAbsolutePath(), "file");
+                        AjaxResult ajaxResult = commonController.customUploadFile(multipartFile, null);
+                        String fileName = ajaxResult.get("fileName").toString();
+                        // 如果是JSON文件,解析其内容作为返回数据
+                        if (fileName.startsWith("diagnosis_results_summary") && fileName.endsWith(".json")) {
+                            String jsonPath = file.getAbsolutePath();
+                            String jsonData = new String(Files.readAllBytes(Paths.get(jsonPath)));
+                            po.setReturnData(jsonData);
+                        } else if (ajaxResult.get("fileSuffix").equals("png") || ajaxResult.get("fileSuffix").equals("jpg")) {
+                            todoFileUrl.add(ajaxResult.get("todofilePath").toString());
                         }
                     }
                 }
             }
+            // 清理文件
+            deleteAllFiles(item.get("outputPath").toString());
+            deleteAllFiles(item.get("inputPath").toString());
         }
         // 将算法生成的图片结果集转换成JSONString进行入库前准备,图片结果集
         po.setReturnDataImage(JSON.toJSONString(todoFileUrl));
-        //json 文件结果集
-        po.setReturnData(JSON.toJSONString(jsonDataArray));
         return mapper.insert(po);
     }
 
     /**
      * 修改故障诊断算法功能验证
-     * 
+     *
      * @param po 故障诊断算法功能验证
      * @return 结果
      */
@@ -164,20 +164,20 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
         FdAlgorithm id = mapper.selectById(po.getId());
         po.setUpdateTime(DateUtils.getNowDate());
         po.setUpdateBy(SecurityUtils.getUsername());
-        return id == null? mapper.insert(po): mapper.updateById(po);
+        return id == null ? mapper.insert(po) : mapper.updateById(po);
     }
 
     /**
      * 批量删除故障诊断算法功能验证
-     * 
+     *
      * @param ids 需要删除的故障诊断算法功能验证主键
      * @return 结果
      */
     @Override
-    public int deleteFdAlgorithmByIds(String[] ids)
-    {
-        return ids.length == 1? mapper.deleteById(ids[0]):mapper.deleteBatchIds(Arrays.asList(ids));
+    public int deleteFdAlgorithmByIds(String[] ids) {
+        return ids.length == 1 ? mapper.deleteById(ids[0]) : mapper.deleteBatchIds(Arrays.asList(ids));
     }
+
     public static JSONArray convertToStandardJson(String input) {
         // 匹配键值对
         Pattern pattern = Pattern.compile("(\\w+)=([^,}]+)");
@@ -190,6 +190,7 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
         String standardJson = sb.toString();
         return JSON.parseArray(standardJson);
     }
+
     @Override
     public Map<String, List<Object>> handleVerify(FdAlgorithm po) throws IOException, InterruptedException {
         List<String> verifyData = po.getVerifyData();
@@ -239,6 +240,7 @@ public class FdAlgorithmServiceImpl implements IFdAlgorithmService
         System.err.println("公式计算结果: " + resultMap);
         return resultMap;
     }
+
     @Override
     public List<Map<String, Object>> getOptions() {
         return mapper.getOptions();

+ 16 - 65
fdapfe-admin/src/main/java/com/cn/fdapfe/biz/service/impl/ModelDataGenServiceImpl.java

@@ -1,6 +1,7 @@
 package com.cn.fdapfe.biz.service.impl;
 
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
 import com.cn.fdapfe.biz.domain.Data;
 import com.cn.fdapfe.biz.domain.FaultPhysicalModel;
 import com.cn.fdapfe.biz.domain.ModelDataGen;
@@ -15,7 +16,6 @@ import com.cn.fdapfe.common.utils.file.FileCopyUtils;
 import com.cn.fdapfe.common.utils.file.FileToMultipartFile;
 import com.cn.fdapfe.web.controller.common.CommonController;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sun.xml.bind.v2.TODO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -179,7 +179,7 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
                 // 如果加噪,根据模型id查询
                 FaultPhysicalModel noiseModel = faultPhysicalModelMapper.selectById(item.get("noiseModel").toString());
                 HashMap<String, Object> noiseMap = new HashMap<>();
-                noiseMap.put("noiseType", item.get("noiseType").toString());
+                noiseMap.put("noise_type", item.get("noise_type").toString());
                 noiseMap.put("input_file", item.get("outputPath").toString().replace("\\", "/"));
 
                 // 调用噪声算法进行加噪
@@ -203,18 +203,15 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
      */
     public void processNoiseModelData(LinkedHashMap item, Data data, ModelDataGen po, FaultPhysicalModel model) throws IOException {
         data.setType("1");
-        String key = processMap(item);
-        HashMap<String, Object> noiseMap = new HashMap<>();
-        if(item.containsKey("noiseType")) {
-            noiseMap.put("noiseType", item.get("noiseType").toString());
-        }
-        noiseMap.put(key, item.get(key).toString());
-        // 调用噪声算法进行加噪
-        sendPostRequest(model.getModelPath(), JSON.toJSONString(noiseMap));
-
-        // 将文件进行备份存储
         try {
-            if(item.containsKey("noiseType")) {
+            if(item.containsKey("noise_type")) {
+                String key = processMap(item);
+                HashMap<String, Object> noiseMap = new HashMap<>();
+                if(item.containsKey("noise_type")) {
+                    noiseMap.put("noise_type", item.get("noise_type").toString());
+                }
+                noiseMap.put(key, item.get(key).toString());
+                sendPostRequest(model.getModelPath(), JSON.toJSONString(noiseMap));
                 FileToMultipartFile file = new FileToMultipartFile(item.get("input_file").toString(), "file");
                 AjaxResult ajaxResult = commonController.customUploadFile(file, storagePath);
                 data.setUrl(ajaxResult.get("url").toString());
@@ -224,8 +221,8 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
                 data.setFileSizeBytes(ajaxResult.get("fileSizeBytes").toString());
                 data.setFileSuffix(ajaxResult.get("fileSuffix").toString());
             }else{
-                //TODO 文件合并后上传逻辑
-                FileToMultipartFile file = new FileToMultipartFile(item.get("output_file").toString(), "file");
+                Map map = sendPostRequest(model.getModelPath(), JSON.toJSONString(item));
+                FileToMultipartFile file = new FileToMultipartFile(map.get("filePath").toString(), "file");
                 AjaxResult ajaxResult = commonController.customUploadFile(file, storagePath);
                 data.setUrl(ajaxResult.get("url").toString());
                 data.setName(po.getDataGenName());
@@ -246,7 +243,6 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
     public void storeGeneratedFile(LinkedHashMap item, Data data, ModelDataGen po) throws Exception {
         FileToMultipartFile file = new FileToMultipartFile(item.get("outputPath").toString(), "file");
         AjaxResult ajaxResult = commonController.customUploadFile(file, "D:/modelData");
-
         data.setUrl(ajaxResult.get("url").toString());
         data.setName(po.getDataGenName());
         data.setFileName(ajaxResult.get("originalFilename").toString());
@@ -257,34 +253,6 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
     }
 
 
-    /**
-     * 启动可执行程序,设置正确的工作目录
-     */
-    public static void startExe(String exePath) throws IOException, InterruptedException {
-        // 获取exe文件所在目录
-        File exeFile = new File(exePath);
-        File workingDir = exeFile.getParentFile();
-        // 打印调试信息
-        logger.info("设置工作目录为: {}", workingDir.getAbsolutePath());
-        ProcessBuilder processBuilder = new ProcessBuilder(exePath);
-        // 设置工作目录为exe所在目录
-        processBuilder.directory(workingDir);
-        // 重定向错误输出到标准输出,便于调试
-        processBuilder.redirectErrorStream(true);
-        // 启动进程
-        Process process = processBuilder.start();
-        // 读取进程输出
-        java.io.BufferedReader reader = new java.io.BufferedReader(
-                new java.io.InputStreamReader(process.getInputStream()));
-        String line;
-        while ((line = reader.readLine()) != null) {
-            logger.info("Exe输出: {}", line);
-        }
-        int exitCode = process.waitFor();
-        logger.info("程序退出码: {}", exitCode);
-    }
-
-
     /**
      * 查找Map中的文件路径键
      */
@@ -312,16 +280,6 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
         return false;
     }
 
-    /**
-     * 从URL中提取最后一部分
-     */
-    public static String extractLastPart(String url, String dom) {
-        int lastSlashIndex = url.lastIndexOf(dom);
-        if (lastSlashIndex != -1 && lastSlashIndex < url.length() - 1) {
-            return url.substring(lastSlashIndex + 1);
-        }
-        return "";
-    }
 
 
 
@@ -340,18 +298,10 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
         return ids.length == 1 ? modelDataGenMapper.deleteById(ids[0]) : modelDataGenMapper.deleteBatchIds(Arrays.asList(ids));
     }
 
-//    public static void main(String[] args) {
-//        http://127.0.0.1:10000/jrzs
-//        String apiUrl= "";
-//        String jsonBody = "{" +
-//               "input_file" : "D:/matlab_data/data_load/output/fea_all.mat," +
-//                "noiseType" : +
-//                "}"
-//    }
     /**
      * 发送POST请求
      */
-    public static boolean sendPostRequest(String apiUrl, String jsonBody) throws IOException {
+    public static Map sendPostRequest(String apiUrl, String jsonBody) throws IOException {
         URL url = new URL(apiUrl);
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("POST");
@@ -383,9 +333,10 @@ public class ModelDataGenServiceImpl implements IModelDataGenService {
 
         // 记录完整响应信息
         logger.info("API 请求响应: 状态码={}, 响应数据={}", responseCode, response);
-
+        ObjectMapper objectMapper = new ObjectMapper();
+        Map<String, Object> responseMap = objectMapper.readValue(response.toString(), Map.class);
         // 判断响应状态码是否在200 - 299之间
-        return responseCode >= 200 && responseCode < 300;
+        return responseMap;
     }
     /**
      * 构建查询条件

+ 4 - 6
fdapfe-admin/src/main/java/com/cn/fdapfe/biz/service/impl/PerformanceEvaluationServiceImpl.java

@@ -166,8 +166,8 @@ public class PerformanceEvaluationServiceImpl implements IPerformanceEvaluationS
                         }
                     }
                     // 清理文件
-//                    deleteAllFiles(outputPath);
-//                    deleteAllFiles(hashMap.get("inputPath").toString());
+                    deleteAllFiles(outputPath);
+                    deleteAllFiles(hashMap.get("inputPath").toString());
                     po.setResultImagePath(JSON.toJSONString(todoFileUrl));
                 }
 
@@ -235,9 +235,8 @@ public class PerformanceEvaluationServiceImpl implements IPerformanceEvaluationS
                             returnPathFileList.add(ajaxResult.get("todofilePath").toString());
                         }
                     }
-                    hashMap1.put("noData",returnPathFileList);
                     //发送中间文件处理过程文件,给到首页进行查看
-                    sendProgress(hashMap1);
+                    sendProgress(returnPathFileList);
                 }
                 // 诊断
                 ExeProcessManager.startExe(hashMap.get("exePath").toString(), true);
@@ -259,7 +258,7 @@ public class PerformanceEvaluationServiceImpl implements IPerformanceEvaluationS
                                 po.setResultText(jsonData);
                                 po.setResultFilePath(ajaxResult.get("todofilePath").toString());
                                 hashMap1.put("data",ajaxResult.get("todofilePath").toString());
-                                sendProgress(hashMap1);
+                                sendProgress(ajaxResult.get("todofilePath").toString());
                             } else if (ajaxResult.get("fileSuffix").equals("png") || ajaxResult.get("fileSuffix").equals("jpg")) {
                                 todoFileUrl.add(ajaxResult.get("todofilePath").toString());
                             }
@@ -302,7 +301,6 @@ public class PerformanceEvaluationServiceImpl implements IPerformanceEvaluationS
             outputStream.write(requestBody);
             outputStream.flush();
         }
-
         int responseCode = connection.getResponseCode();
         StringBuilder response = new StringBuilder();
         try (BufferedReader reader = new BufferedReader(

+ 15 - 53
fdapfe-admin/src/main/java/com/cn/fdapfe/biz/service/impl/WorkflowServiceImpl.java

@@ -32,6 +32,9 @@ import org.springframework.web.servlet.View;
 
 import javax.annotation.Resource;
 
+import static com.cn.fdapfe.common.utils.file.FileCopyUtils.deleteAllFiles;
+import static com.cn.fdapfe.common.utils.file.FileCopyUtils.waitForFileAndGetAllFiles;
+
 /**
  * 流程任务Service业务层处理
  * 
@@ -101,83 +104,42 @@ public class WorkflowServiceImpl implements IWorkflowService
                 modelDataGenService.processPhysicalModelData(item, data, dataGen, model);
 
                 // 将上传的文件重命名并复制到当前模型输入目录中
-                FileCopyUtils.copyFileDirectly(item.get("outputPath").toString(), hashMap.get("inputFilePath").toString());
-
-                // 将算法配置信息重新写入到算法的input.txt中
-                FileCopyUtils.writeToTxt(hashMap.get("inputPath").toString(), po.getDiagModelData().toString());
-
+                FileCopyUtils.copyFileDirectly(item.get("outputPath").toString(), hashMap.get("inputPath").toString());
+                if (item.containsKey("inputFilePath")) {
+                    // 将算法配置信息重新写入到算法的input.txt中
+                    FileCopyUtils.writeToTxt(item.get("inputFilePath").toString(), item.get("modelData").toString());
+                }
                 // 启动诊断算法对进行诊断
                 ExeProcessManager.startExe(hashMap.get("exePath").toString(), true);
 
                 // 获取输出目录
                 String outputPath = hashMap.get("outputPath").toString();
-                File outputDir = new File(outputPath);
-
-                // 设置等待参数
-                int maxWaitTime = 60000; // 最大等待时间(毫秒)- 60秒
-                int checkInterval = 1000; // 检查间隔(毫秒)- 1秒
-                long startTime = System.currentTimeMillis();
-                boolean filesGenerated = false;
-
-                // 轮询检查文件是否生成
-                while (!filesGenerated && (System.currentTimeMillis() - startTime) < maxWaitTime) {
-                    try {
-                        Thread.sleep(checkInterval);
-                    } catch (InterruptedException e) {
-                        Thread.currentThread().interrupt();
-                        throw new RuntimeException("等待文件生成时被中断", e);
-                    }
-
-                    if (outputDir.exists() && outputDir.isDirectory()) {
-                        File[] files = outputDir.listFiles();
-                        if (files != null && files.length > 0) {
-                            // 确认至少有一个非空文件
-                            boolean hasValidFile = false;
-                            for (File file : files) {
-                                if (file.isFile() && file.length() >= 3) {
-                                    hasValidFile = true;
-                                    break;
-                                }
-                            }
-
-                            if (hasValidFile) {
-                                filesGenerated = true;
-                                break;
-                            }
-                        }
-                    }
-                }
-
-                // 检查是否超时
-                if (!filesGenerated) {
-                    throw new RuntimeException("等待诊断算法生成文件超时: " + outputPath);
-                }
+                File[] files = waitForFileAndGetAllFiles(hashMap, "diagnosis_results_summary.json", 1000);
 
-                // 获取目录中的所有文件
-                File[] files = outputDir.listFiles();
                 if (files != null) {
                     for (File file : files) {
                         if (file.isFile()) {
                             FileToMultipartFile multipartFile = new FileToMultipartFile(file.getAbsolutePath(), "file");
-                            AjaxResult ajaxResult = commonController.customUploadFile(multipartFile, "D:/modelData");
+                            AjaxResult ajaxResult = commonController.customUploadFile(multipartFile, null);
+                            String fileName = ajaxResult.get("fileName").toString();
                             // 如果是JSON文件,解析其内容作为返回数据
-                            if (ajaxResult.get("fileSuffix").equals("json") || ajaxResult.get("fileSuffix").equals("txt")) {
+                            if (fileName.startsWith("diagnosis_results_summary") && fileName.endsWith(".json")) {
                                 String jsonPath = file.getAbsolutePath();
                                 String jsonData = new String(Files.readAllBytes(Paths.get(jsonPath)));
-                                jsonDataArray.add(jsonData);
+                                po.setReturnData(jsonData);
                             } else if (ajaxResult.get("fileSuffix").equals("png") || ajaxResult.get("fileSuffix").equals("jpg")) {
                                 todoFileUrl.add(ajaxResult.get("todofilePath").toString());
                             }
                         }
                     }
+                    deleteAllFiles(outputPath);
+                    deleteAllFiles(hashMap.get("inputPath").toString());
                 }
             }
         }
 
         // 将算法生成的图片结果集转换成JSONString进行入库前准备,图片结果集
         po.setReturnDataImage(JSON.toJSONString(todoFileUrl));
-        // json 文件结果集
-        po.setReturnData(JSON.toJSONString(jsonDataArray));
         po.setEndTime(DateUtils.getTime());
 
         return mapper.insert(po);

+ 11 - 1
fdapfe-ui/src/api/dataGen/phyModel.js

@@ -1,5 +1,5 @@
 import request from "@/utils/request";
-
+import qs from 'qs';
 // 查询物理模型数据生成管理列表
 export function listPhyModel(query) {
   return request({
@@ -26,6 +26,16 @@ export function addPhyModel(data) {
     data: data,
   });
 }
+export function upExe(exePath) {
+  return request({
+    url: '/dataGen/upExe',
+    method: 'post',
+    data: qs.stringify({ exePath }),  // 把参数转换为表单格式
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded'  // 明确设置Content-Type
+    }
+  });
+}
 
 // 修改物理模型数据生成管理
 export function updatePhyModel(data) {

+ 1 - 1
fdapfe-ui/src/router/index.js

@@ -68,7 +68,7 @@ export const constantRoutes = [
     children: [
       {
         path: 'index',
-        component: () => import('@/views/form.vue'),
+        component: () => import('@/views/index.vue'),
         name: 'Index',
         meta: { title: '首页', icon: 'dashboard', affix: true }
       }

+ 4 - 39
fdapfe-ui/src/views/add.vue

@@ -5,7 +5,7 @@
     width="1000px"
     :close-on-click-modal="false"
     append-to-body
-    @close="handleClose"
+    @close="closeWithCleanup"
   >
     <!-- 任务未开始时显示表单 -->
     <div>
@@ -60,7 +60,7 @@
         >
           确 定
         </el-button>
-        <el-button @click="handleClose" :disabled="isProcessing">
+        <el-button @click="closeWithCleanup" :disabled="isProcessing">
           取消
         </el-button>
       </div>
@@ -121,10 +121,6 @@ export default {
       console.log('状态更新了', newVal);
       this.dialogOpen = newVal;
 
-      // 关闭对话框时清理资源
-      if (!newVal && this.isProcessing) {
-        this.cancelTask();
-      }
     }
   },
   created() {
@@ -237,11 +233,13 @@ export default {
           // 建立WebSocket连接以接收进度
           this.connectWebSocket();
           this.taskPromise = addPerf2index(this.formData).then((response) => {
+            this.dialogOpen = false;
             return response;
           }).catch(error => {
             this.isProcessing = false;
             this.errorMessage = error.response?.data?.message || '启动任务失败';
             this.$message.error(this.errorMessage);
+
             console.error(error);
           }).finally(() => {
             this.submitting = false;
@@ -268,22 +266,6 @@ export default {
       });
     },
 
-    // 取消任务
-    cancelTask() {
-      if (this.taskId) {
-        // 调用取消任务API
-        cancelPerf(this.taskId).then(() => {
-          this.$message.info('已请求取消任务');
-        }).catch(error => {
-          this.$message.error('取消任务请求失败');
-          console.error(error);
-        }).finally(() => {
-          this.closeWithCleanup();
-        });
-      } else {
-        this.closeWithCleanup();
-      }
-    },
 
     // 关闭对话框并清理资源
     closeWithCleanup() {
@@ -316,23 +298,6 @@ export default {
       this.dialogOpen = false;
       this.$emit('callback', false);
     },
-
-    // 对话框关闭处理
-    handleClose() {
-      if (this.isProcessing) {
-        this.$confirm('任务正在处理中,确定要取消吗?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          this.cancelTask();
-        }).catch(() => {
-          // 取消关闭
-        });
-      } else {
-        this.closeWithCleanup();
-      }
-    }
   },
   beforeDestroy() {
     // 组件销毁时清理资源

+ 12 - 12
fdapfe-ui/src/views/data/data/index.vue

@@ -56,18 +56,18 @@
         >新增</el-button
         >
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['data:data:edit']"-->
-<!--        >修改</el-button-->
-<!--        >-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['data:data:edit']"
+        >修改</el-button
+        >
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"

+ 1 - 1
fdapfe-ui/src/views/dataGen/DynamicParameterForm.vue

@@ -91,7 +91,7 @@
                 inactive-text="关闭"
               />
             </template>
-            <template v-else-if="param.paramType === 'select'&&param.paramName==='noiseType'">
+            <template v-else-if="param.paramType === 'select'&&param.paramName==='noiseType'||param.paramName==='noise_type'">
               <el-select
                 size="small"
                 v-model="group.formData[param.paramName]"

+ 15 - 5
fdapfe-ui/src/views/dataGen/form.vue

@@ -31,7 +31,10 @@
           </el-select>
         </el-form-item>
       </el-row>
-        <el-form-item v-if="formData.modelId && modelType" label="模型参数">
+      <el-form-item v-if="formData.modelId && modelType==='3'" label="模型参数">
+        <el-button @click="handUpExe">打开软件</el-button>
+      </el-form-item>
+        <el-form-item v-if="formData.modelId && modelType!=='3'" label="模型参数">
             <dynamic-parameter-form  :config-data="initialData" @submit="handleSubmitDataList" />
         </el-form-item>
       <el-row>
@@ -64,7 +67,7 @@
 </template>
 
 <script>
-import { addPhyModel, updatePhyModel } from "@/api/dataGen/phyModel";
+import { addPhyModel, updatePhyModel,upExe } from "@/api/dataGen/phyModel";
 import { getDataOptions } from "@/api/data/data";
 import { getFaultPhysicalOptions } from "@/api/model/faultPhysical";
 import {getFaultPhysical} from "@/api/model/faultPhysical";
@@ -91,6 +94,7 @@ export default {
       modelDataParams: [], // 视图层显示的参数组数组
       dataOptions: [],
       faultPhysicalOptions: [],
+      exePath:'',
       formData: {
         outputPath:null,
         newFileName:null,
@@ -162,14 +166,20 @@ export default {
       };
       this.modelDataParams = [...this.formData.modelDataParams]; // 同步到视图数组
     },
-
+    handUpExe(){
+      console.log(this.exePath);
+      upExe(this.exePath);
+    },
     onModelChange(modelId) {
       //获取模型参数详情
       getFaultPhysical(modelId).then(rest => {
         this.initialData  = rest.data.configData;
-        this.modelType=rest.data.modelAttribution;
+        if(rest.data.modelType==='3'){
+         this.exePath= rest.data.configData[0].paramDefaultValue
+        }
+        this.modelType = rest.data.modelType;
         this.formData.modelId = rest.data.modelId;
-        console.log('modelDataParams',rest.data.modelAttribution)
+        console.log('modelDataParams',rest.data)
       });
     },
 

+ 10 - 11
fdapfe-ui/src/views/dataGen/index.vue

@@ -60,17 +60,16 @@
           v-hasPermi="['dataGen:phyModel:add']"
         >新增</el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['dataGen:phyModel:edit']"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          v-hasPermi="['dataGen:phyModel:edit']"
+        >修改</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"

+ 7 - 7
fdapfe-ui/src/views/eval/indicator/index.vue

@@ -8,10 +8,10 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="评估体系名称" prop="name">
+      <el-form-item label="评估指标名称" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入评估体系名称"
+          placeholder="请输入评估指标名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -89,8 +89,8 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="评估体系名称" align="center" prop="name" />
-      <el-table-column label="评估体系参数" align="center" prop="bizParams" />
+      <el-table-column label="评估指标名称" align="center" prop="name" />
+      <el-table-column label="评估指标参数" align="center" prop="bizParams" />
       <el-table-column label="说明" align="center" prop="remark" />
       <el-table-column
         label="操作"
@@ -135,10 +135,10 @@
       append-to-body
     >
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="评估体系名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入评估体系名称" />
+        <el-form-item label="评估指标名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入评估指标名称" />
         </el-form-item>
-        <el-form-item label="评估体系参数" prop="bizParams">
+        <el-form-item label="评估指标参数" prop="bizParams">
           <el-input
             v-model="form.bizParams"
             type="textarea"

+ 93 - 190
fdapfe-ui/src/views/form.vue

@@ -27,7 +27,7 @@
           <div class="metric-icon">{{ metric.icon }}</div>
         </div>
         <div class="card-body">
-          <div class="metric-value" :class="metric.class">{{ metric.value }}%</div>
+          <div class="metric-value" :class="metric.class">{{ metric.value }}</div>
           <div class="metric-trend" :class="metric.trendClass">
             <span>{{ metric.trendText }}</span>
             <i :class="'trend-icon ' + metric.trendIcon"></i>
@@ -68,76 +68,76 @@
       </div>
     </div>
 
-    <!-- 数据表格 -->
-    <div class="data-table-container">
-      <h3 class="table-title" style="color: #3375F6">模型评估详细数据</h3>
-      <div class="table-wrapper">
-        <dv-scroll-board class="data-table" :config="config" style="width:100%;height:100%" />
-      </div>
-    </div>
-
-    <!-- 指标说明区 -->
-    <div class="metric-explanation">
-      <h3>精度评估指标说明</h3>
-      <div class="explanation-table">
-        <table>
-          <thead>
-          <tr>
-            <th>指标名称</th>
-            <th>公式</th>
-            <th>说明</th>
-          </tr>
-          </thead>
-          <tbody>
-          <tr>
-            <td>准确率 (Accuracy)</td>
-            <td>(TP+TN)/(TP+TN+FP+FN)</td>
-            <td>正确预测的样本占总样本的比例</td>
-          </tr>
-          <tr>
-            <td>精确率 (Precision)</td>
-            <td>TP/(TP+FP)</td>
-            <td>正类预测中实际为正类的比例</td>
-          </tr>
-          <tr>
-            <td>召回率 (Recall)</td>
-            <td>TP/(TP+FN)</td>
-            <td>实际正类中被正确预测的比例</td>
-          </tr>
-          <tr>
-            <td>特异度 (Specificity)</td>
-            <td>TN/(TN+FP)</td>
-            <td>实际负类中被正确预测的比例</td>
-          </tr>
-          <tr>
-            <td>F1分数 (F-measure)</td>
-            <td>2*(Precision*Recall)/(Precision+Recall)</td>
-            <td>精确率和召回率的加权平均</td>
-          </tr>
-          <tr>
-            <td>ROC曲线</td>
-            <td>横坐标: FPR, 纵坐标: TPR</td>
-            <td>45度线为参照线,曲线偏离越远结果越准确</td>
-          </tr>
-          <tr>
-            <td>AUC</td>
-            <td>ROC曲线下面积</td>
-            <td>参考线面积为0.5,AUC越大分类效果越好</td>
-          </tr>
-          <tr>
-            <td>基尼系数</td>
-            <td>2*AUC-1</td>
-            <td>评估模型区分不同类别的能力</td>
-          </tr>
-          <tr>
-            <td>K-S值</td>
-            <td>max(TPR-FPR)</td>
-            <td>评判模型区分正负样本的能力,一般0.3以上效果较好</td>
-          </tr>
-          </tbody>
-        </table>
-      </div>
-    </div>
+<!--    &lt;!&ndash; 数据表格 &ndash;&gt;-->
+<!--    <div class="data-table-container">-->
+<!--      <h3 class="table-title" style="color: #3375F6">模型评估详细数据</h3>-->
+<!--      <div class="table-wrapper">-->
+<!--        <dv-scroll-board class="data-table" :config="config" style="width:100%;height:100%" />-->
+<!--      </div>-->
+<!--    </div>-->
+
+<!--    &lt;!&ndash; 指标说明区 &ndash;&gt;-->
+<!--    <div class="metric-explanation">-->
+<!--      <h3>精度评估指标说明</h3>-->
+<!--      <div class="explanation-table">-->
+<!--        <table>-->
+<!--          <thead>-->
+<!--          <tr>-->
+<!--            <th>指标名称</th>-->
+<!--            <th>公式</th>-->
+<!--            <th>说明</th>-->
+<!--          </tr>-->
+<!--          </thead>-->
+<!--          <tbody>-->
+<!--          <tr>-->
+<!--            <td>准确率 (Accuracy)</td>-->
+<!--            <td>(TP+TN)/(TP+TN+FP+FN)</td>-->
+<!--            <td>正确预测的样本占总样本的比例</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>精确率 (Precision)</td>-->
+<!--            <td>TP/(TP+FP)</td>-->
+<!--            <td>正类预测中实际为正类的比例</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>召回率 (Recall)</td>-->
+<!--            <td>TP/(TP+FN)</td>-->
+<!--            <td>实际正类中被正确预测的比例</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>特异度 (Specificity)</td>-->
+<!--            <td>TN/(TN+FP)</td>-->
+<!--            <td>实际负类中被正确预测的比例</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>F1分数 (F-measure)</td>-->
+<!--            <td>2*(Precision*Recall)/(Precision+Recall)</td>-->
+<!--            <td>精确率和召回率的加权平均</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>ROC曲线</td>-->
+<!--            <td>横坐标: FPR, 纵坐标: TPR</td>-->
+<!--            <td>45度线为参照线,曲线偏离越远结果越准确</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>AUC</td>-->
+<!--            <td>ROC曲线下面积</td>-->
+<!--            <td>参考线面积为0.5,AUC越大分类效果越好</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>基尼系数</td>-->
+<!--            <td>2*AUC-1</td>-->
+<!--            <td>评估模型区分不同类别的能力</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td>K-S值</td>-->
+<!--            <td>max(TPR-FPR)</td>-->
+<!--            <td>评判模型区分正负样本的能力,一般0.3以上效果较好</td>-->
+<!--          </tr>-->
+<!--          </tbody>-->
+<!--        </table>-->
+<!--      </div>-->
+<!--    </div>-->
   </div>
 </template>
 
@@ -151,6 +151,12 @@ import 'echarts/lib/component/legend'
 
 export default {
   name: 'ModelEvaluationDashboard',
+  props: {
+    dataInfo: {
+      type: Array,
+      default: ()=>{}
+    },
+  },
   data() {
     return {
       config: {
@@ -162,117 +168,7 @@ export default {
         columnWidth: [100, 100, 100, 100, 100, 120],
         align: ['center', 'center', 'center', 'center', 'center', 'center']
       },
-      dataSource: [
-        {
-          "filename": "fea_all_20250701172248A001_1.00.mat",
-          "model": "BP",
-          "snr": 1,
-          "accuracy": 83.333333333333343,
-          "precision": 0.88253968253968251,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.85723095898859081,
-          "test_time_ms": 3159.6098,
-          "uncertainty": 0.32758402828046262
-        },
-        {
-          "filename": "fea_all_20250701172248A001_100.00.mat",
-          "model": "KNN",
-          "snr": 100,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 45.331700000000005,
-          "uncertainty": 0.35049194532946931
-        },
-        {
-          "filename": "fea_all_20250701172248A001_12.00.mat",
-          "model": "KNN",
-          "snr": 12,
-          "accuracy": 85,
-          "precision": 0.89142857142857146,
-          "recall": 0.85,
-          "f1_score": 0.8702214930270713,
-          "test_time_ms": 42.123,
-          "uncertainty": 0.35362030033887409
-        },
-        {
-          "filename": "fea_all_20250701172248A001_23.00.mat",
-          "model": "KNN",
-          "snr": 23,
-          "accuracy": 80,
-          "precision": 0.82222222222222219,
-          "recall": 0.8,
-          "f1_score": 0.810958904109589,
-          "test_time_ms": 16.9869,
-          "uncertainty": 0.369065022155844
-        },
-        {
-          "filename": "fea_all_20250701172248A001_34.00.mat",
-          "model": "BP",
-          "snr": 34,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 97.5425,
-          "uncertainty": 0.3756035323507031
-        },
-        {
-          "filename": "fea_all_20250701172248A001_45.00.mat",
-          "model": "ss",
-          "snr": 45,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 14.5044,
-          "uncertainty": 0.38447836662627638
-        },
-        {
-          "filename": "fea_all_20250701172248A001_56.00.mat",
-          "model": "ss",
-          "snr": 56,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 8.1883,
-          "uncertainty": 0.39321211604602763
-        },
-        {
-          "filename": "fea_all_20250701172248A001_67.00.mat",
-          "model": "BP",
-          "snr": 67,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 11.1326,
-          "uncertainty": 0.40173666709205219
-        },
-        {
-          "filename": "fea_all_20250701172248A001_78.00.mat",
-          "model": "BP",
-          "snr": 78,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 7.2708,
-          "uncertainty": 0.41032815207536966
-        },
-        {
-          "filename": "fea_all_20250701172248A001_89.00.mat",
-          "model": "BP",
-          "snr": 89,
-          "accuracy": 83.333333333333343,
-          "precision": 0.83333333333333326,
-          "recall": 0.83333333333333337,
-          "f1_score": 0.83333333333333337,
-          "test_time_ms": 6.7476,
-          "uncertainty": 0.41888217650787873
-        }
+      dataInfo: [
       ],
       selectedFilename: '',
       selectedModel: '',
@@ -281,13 +177,13 @@ export default {
   },
   computed: {
     uniqueFilenames() {
-      return [...new Set(this.dataSource.map(item => item.filename))]
+      return [...new Set(this.dataInfo.map(item => item.filename))]
     },
     uniqueModels() {
-      return [...new Set(this.dataSource.map(item => item.model))]
+      return [...new Set(this.dataInfo.map(item => item.model))]
     },
     filteredData() {
-      let filtered = this.dataSource
+      let filtered = this.dataInfo
       if (this.selectedFilename) {
         filtered = filtered.filter(item => item.filename === this.selectedFilename)
       }
@@ -304,6 +200,8 @@ export default {
       const maxPrecision = this.calculateMax(data, 'precision')
       const avgRecall = this.calculateAverage(data, 'recall')
       const avgF1Score = this.calculateAverage(data, 'f1_score')
+      const avgTime = this.calculateAverage(data, 'test_time_ms')
+
 
       const getTrend = (current) => {
         const lastWeek = current * (0.95 + Math.random() * 0.1)
@@ -322,25 +220,30 @@ export default {
         {
           name: '平均准确率',
           icon: '🔢',
-          value: avgAccuracy.toFixed(2),
+          value: avgAccuracy.toFixed(2)+'%',
           ...getTrend(avgAccuracy)
+        },  {
+          name: '平均评估时间',
+          icon: '🔢',
+          value: avgTime.toFixed(2)+'ms',
+          ...getTrend(avgTime)
         },
         {
           name: '最高精确率',
           icon: '🎯',
-          value: maxPrecision.toFixed(2),
+          value: maxPrecision.toFixed(2)*100+'%',
           ...getTrend(maxPrecision)
         },
         {
           name: '平均召回率',
           icon: '🔄',
-          value: avgRecall.toFixed(2),
+          value: avgRecall.toFixed(2)*100+'%',
           ...getTrend(avgRecall)
         },
         {
           name: '平均F1分数',
           icon: '📊',
-          value: avgF1Score.toFixed(2),
+          value: avgF1Score.toFixed(2)*100+'%',
           ...getTrend(avgF1Score)
         }
       ]
@@ -841,7 +744,7 @@ export default {
 
 .metric-cards {
   display: grid;
-  grid-template-columns: repeat(4, 1fr);
+  grid-template-columns: repeat(5, 1fr);
   gap: 20px;
   margin-bottom: 20px;
 }

+ 370 - 91
fdapfe-ui/src/views/index.vue

@@ -1,9 +1,7 @@
 <template>
   <div class="home" v-loading="loading">
     <div class="second">
-      <div class="topPanel">
-
-      </div>
+      <div class="topPanel"></div>
       <div class="step">
         <div class="yuan">
           <div class="img yuanBg odd" @click="switchHandle('0')">
@@ -17,13 +15,7 @@
           </div>
         </div>
         <dv-decoration-6 style="width:150px;height:30px;"/>
-<!--        <div class="two">-->
-<!--          <div class="img twoBg even">-->
-<!--            <div class="tag">算法验证</div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--        <dv-decoration-6 style="width:150px;height:30px;" />-->
-        <div class="three"  @click="switchHandle('1')">
+        <div class="three" @click="switchHandle('1')">
           <div class="img threeBg even">
             <div class="tag">功能验证</div>
             <div class="tag2">算法评估</div>
@@ -40,75 +32,21 @@
       <div class="bottomPanel">
         <div class="vanel"></div>
         <div class="bPanel">
-          <el-table size="mini">
-            <el-table-column
-              prop="processedDataName"
-              label="处理前数据"
-              align="center"
-            >
-              <template slot-scope="scope">
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  :content="scope.row"
-                  placement="top"
-                >
-                  <span class="beforeFile">{{
-                      scope.row
-                    }}</span>
-                </el-tooltip>
-              </template>
-            </el-table-column>
-            <el-table-column
-              prop="resultDataName"
-              label="处理后数据"
-              align="center"
-            >
-              <template slot-scope="scope">
-                <el-tooltip
-                  class="item"
-                  effect="dark"
-                  :content="scope.row"
-                  placement="top"
-                >
-                  <span class="file">{{
-                      scope.row
-                    }}</span>
-                </el-tooltip>
-              </template>
-            </el-table-column>
-            <el-table-column
-              prop="processStatus"
-              label="状态"
-              align="center"
-              width="60"
-            >
-              <template slot-scope="scope">
-                <dict-tag
-                  :options="dict.type.biz_process_status"
-                  :value="scope.row.processStatus"
-                />
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div class="bPanel">
-          <el-table :data="messages[0]" size="mini">
+          <!-- 第二个表格:显示noData数组内容 -->
+          <el-table size="mini" :data="tableData2">
             <el-table-column
               prop="processedDataName"
-              label="处理前数据"
+              label="加噪后数据"
               align="center"
             >
               <template slot-scope="scope">
                 <el-tooltip
                   class="item"
                   effect="dark"
-                  :content="scope.row"
+                  :content="scope.row.processedDataName"
                   placement="top"
                 >
-                  <span class="beforeFile">{{
-                      scope.row
-                    }}</span>
+                  <span class="beforeFile" @click="dowloadfile(scope.row.processedDataName)">{{ scope.row.processedDataName }}</span>
                 </el-tooltip>
               </template>
             </el-table-column>
@@ -121,12 +59,10 @@
                 <el-tooltip
                   class="item"
                   effect="dark"
-                  :content="scope.row"
+                  :content="scope.row.resultDataName"
                   placement="top"
                 >
-                  <span class="file">{{
-                      scope.row
-                    }}</span>
+                  <span class="file" @click="dowloadfile(scope.row.resultDataName)" >{{ scope.row.resultDataName }}</span>
                 </el-tooltip>
               </template>
             </el-table-column>
@@ -146,7 +82,7 @@
           </el-table>
         </div>
         <div class="bPanel">
-          <el-table size="mini">
+          <el-table size="mini" :data="tableData1">
             <el-table-column
               prop="resultDataName"
               label="处理后数据"
@@ -156,12 +92,10 @@
                 <el-tooltip
                   class="item"
                   effect="dark"
-                  :content="scope.row"
+                  :content="scope.row.resultDataName"
                   placement="top"
                 >
-                  <span class="file">{{
-                      scope.row
-                    }}</span>
+                  <span class="file" @click="dowloadfile(scope.row.resultDataName)">{{ scope.row.resultDataName }}</span>
                 </el-tooltip>
               </template>
             </el-table-column>
@@ -183,10 +117,132 @@
         <div class="vanel"></div>
       </div>
     </div>
+    <div class="table-index" style="width: 100%;height: 500px;margin-top: 100px">
+      <el-row style="padding: 10px" :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="danger"
+            plain
+            icon="el-icon-delete"
+            size="mini"
+            :disabled="multiple"
+            @click="handleDelete"
+            v-hasPermi="['test:perf:remove']"
+          >删除</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-download"
+            size="mini"
+            @click="handleExport"
+            :disabled="!canCompare"
+           v-hasPermi="['test:perf:export']"
+          >综合比对</el-button>
+        </el-col>
+        <right-toolbar
+          :showSearch.sync="showSearch"
+          @queryTable="getList"
+        ></right-toolbar>
+      </el-row>
+      <el-table
+        v-loading="loading"
+        :data="perfList"
+        v-show="showSearch"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="任务名称" align="center" prop="name" />
+        <el-table-column
+          label="噪声生成算法"
+          align="center"
+          prop="noseModelName"
+        />
+        <el-table-column
+          label="故障诊断算法"
+          align="center"
+          prop="fdAlgorithmName"
+        />
+        <el-table-column label="文件结果" align="center" prop="resultFilePath">
+          <template slot-scope="scope">
+            <span @click="dowloadfile(scope.row.resultFilePath)">点击下载</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="图片结果" align="center" prop="resultImagePath">
+          <template slot-scope="scope">
+            <span @click="showimages(scope.row.resultImagePath)">查看图片</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="文本结果" align="center" prop="resultText" >
+          <template slot-scope="scope">
+            <el-input type="textarea" disabled v-model="scope.row.resultText" />
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="开始时间"
+          align="center"
+          prop="startTime"
+          width="180"
+        >
+          <template slot-scope="scope">
+            <span>{{scope.row.startTime}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="结束时间"
+          align="center"
+          prop="endTime"
+          width="180"
+        >
+          <template slot-scope="scope">
+            <span>{{scope.row.endTime}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-video-play"
+              @click="handleRun(scope.row)"
+              v-hasPermi="['test:ddAlgorithm:edit']"
+            >运行</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['test:perf:remove']"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
     <form-model-view v-model="dialogVisible"
                      @message="handleMessage"
                      @allMessages="handleAllMessages"
                      @callback="handleRowData"/>
+    <!-- 比对结果对话框 -->
+    <el-dialog
+      fullscreen
+      title="综合比对结果"
+      :visible.sync="compareDialogVisible"
+      width="80%"
+      :before-close="handleCompareDialogClose"
+    >
+      <info-data :data-info="compareResult" />
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="handleCompareDialogClose">关闭</el-button>
+          <el-button type="primary" @click="exportCompareResult">导出结果</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -196,9 +252,16 @@ import RingChart from '@/views/homePage/ringChart'
 import PreCharts from '@/views/homePage/preCharts'
 import CurveCharts from '@/views/homePage/curveCharts'
 import BarChart from '@/views/dashboard/BarChart'
-import { getDataOptions } from '@/api/data/data'
+import infoData from './form.vue'
 import FormModelView from './add.vue'
 import FileTable from '@/views/fileTable.vue'
+import {
+  listPerf,
+  getPerf,
+  delPerf,
+  run,
+} from "@/api/test/perf";
+import dowloadService from '@/plugins/download'
 
 export default {
   name: 'Index',
@@ -210,59 +273,275 @@ export default {
     BarChart,
     PreCharts,
     CurveCharts,
-    FormModelView
+    FormModelView,
+    infoData
   },
   data() {
     return {
+      showSearch: true,
       dialogVisible: false,
-      loading: false, // 补充可能存在的loading状态
+      loading: false,
       initFileData: {},
-      messages: []
-      // 保留原有数据属性...
+      messages: [],
+      perfList: [],
+      tableData1: [],
+      tableData2: [],
+      tableData3: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      total: 0,
+      ids: [],
+      names: [],
+      single: false,
+      multiple: false,
+      rowImageData: [],
+      infoOpen: false,
+      fileShowVisible: false,
+      canCompare: false, // 控制综合比对按钮是否可用
+      compareDialogVisible: false, // 比对结果对话框可见性
+      compareResult: [] // 比对结果数据
     }
   },
   mounted() {
+    this.$watch('messages', (newVal) => {
+      if (newVal && newVal.length > 0) {
+        this.parseMessagesData()
+      }
+    }, { deep: true })
   },
   created() {
-    // 保留原有生命周期钩子...
-  },
-  watch: {
-    // 保留原有watchers...
+    this.getList()
   },
   methods: {
+    handleExport(){
+      if (this.ids.length < 2) {
+        this.$message({
+          message: '请至少选择两条数据进行比对',
+          type: 'warning'
+        })
+        return
+      }
+
+      try {
+        // 合并所有选中行的resultText数据
+        const allResults = []
+        this.ids.forEach(id => {
+          const row = this.perfList.find(item => item.id === id)
+          if (row && row.resultText) {
+            try {
+              const resultItems = JSON.parse(row.resultText)
+              allResults.push(...resultItems)
+              console.log('allResults',allResults)
+            } catch (e) {
+              this.$message({
+                message: `解析数据失败:${row.name}`,
+                type: 'error'
+              })
+            }
+          }
+        })
+
+        if (allResults.length === 0) {
+          this.$message({
+            message: '没有可比对的数据',
+            type: 'warning'
+          })
+          return
+        }
+
+        // 去重处理(如果需要)
+        const uniqueResults = this.removeDuplicates(allResults)
+
+        // 保存比对结果并显示对话框
+        this.compareResult = uniqueResults
+        this.compareDialogVisible = true
+      } catch (error) {
+        console.error('综合比对失败', error)
+        this.$message({
+          message: '综合比对失败,请重试',
+          type: 'error'
+        })
+      }
+    },
+
+    // 去重处理(根据filename和snr判断是否重复)
+    removeDuplicates(data) {
+      const seen = new Set()
+      return data.filter(item => {
+        const key = `${item.filename}_${item.snr}`
+        if (seen.has(key)) {
+          return false
+        }
+        seen.add(key)
+        return true
+      })
+    },
+
+    // 导出比对结果
+    exportCompareResult() {
+      if (this.compareResult.length === 0) {
+        this.$message({
+          message: '没有可导出的比对结果',
+          type: 'warning'
+        })
+        return
+      }
+
+      // 创建CSV内容
+      const headers = '文件名,模型,信噪比,准确率(%),精确率,召回率,F1分数,测试时间(ms),不确定性\n'
+      const csvContent = headers + this.compareResult.map(item =>
+        `${item.filename},${item.model},${item.snr},${item.accuracy},${item.precision},${item.recall},${item.f1_score},${item.test_time_ms},${item.uncertainty}`
+      ).join('\n')
+
+      // 创建Blob并下载
+      const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
+      const url = URL.createObjectURL(blob)
+      const link = document.createElement('a')
+      link.setAttribute('href', url)
+      link.setAttribute('download', `比对结果_${new Date().getTime()}.csv`)
+      link.style.visibility = 'hidden'
+      document.body.appendChild(link)
+      link.click()
+      document.body.removeChild(link)
+    },
+
+    handleCompareDialogClose() {
+      this.compareDialogVisible = false
+    },
+
+    getList() {
+      this.loading = true
+      listPerf(this.queryParams).then((response) => {
+        this.perfList = response.rows || [];
+        this.total = response.total || 0;
+        this.loading = false;
+      }).catch(() => {
+        this.loading = false;
+      });
+    },
+
+    handleRun(data) {
+      // 保存比对结果并显示对话框
+      this.compareResult = JSON.parse(data.resultText)
+      this.compareDialogVisible = true
+    },
+
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.names = selection.map((item) => item.name);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+
+      // 更新比对按钮状态
+      this.canCompare = selection.length >= 2
+    },
+
+    dowloadfile(fileurl) {
+      console.log('下载文件', fileurl);
+      dowloadService.resource(fileurl)
+    },
+
+    showimages(data) {
+      this.rowImageData = data ? JSON.parse(data) : [];
+      this.infoOpen = true;
+    },
+
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      const names = row.name || this.names;
+      this.$modal
+        .confirm('是否确认删除算法性能评估名称为"' + names + '"的数据项?')
+        .then(function () {
+          return delPerf(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+
     handleMessage(message) {
       this.messages.push(message);
+
       console.log('父组件接收到消息:', message);
+      this.parseMessagesData()
     },
+
     handleAllMessages(allMessages) {
       this.messages = allMessages;
       console.log('父组件接收到所有消息:', allMessages);
+      this.parseMessagesData()
     },
+
     handleDialogClose(visible) {
       this.dialogVisible = visible;
     },
+
     handleRowData(row) {
-      this.dialogVisible= false
+      this.dialogVisible = false
+      this.getList();
       console.log('接收到文件管理的行数据:', row)
       this.initFileData = row
     },
+
     switchHandle(dataType) {
       switch (dataType) {
         case '0':
           this.dialogVisible = true
-          // this.loading = false;
           break
         case '1':
           this.fileShowVisible = true
-          // this.loading = false;
           break
         case '2':
           this.fileShowVisible = true
           this.$nextTick(() => {
-            // this.loading = false;
           })
           break
       }
+    },
+
+    parseMessagesData() {
+      try {
+        // 清空之前的数据
+        this.tableData1 = [];
+        this.tableData2 = [];
+
+        // 确保tableData1存在且为数组
+        if (Array.isArray(this.messages) && this.messages.length > 0) {
+          // 解析第一个元素:多个.mat文件URL
+          const matUrlsString = this.messages[0];
+          if (matUrlsString) {
+            // 去除首尾方括号并按逗号分割
+            const matUrls = matUrlsString.replace(/^\[|]$/g, '').split(',').map(url => url.trim());
+
+            // 处理每个.mat文件URL,绑定到第二个表格(处理前数据)
+            matUrls.forEach((url, index) => {
+              this.tableData2.push({
+                processedDataName: url,
+                resultDataName: `处理后_${index + 1}`, // 假设的处理后数据,可根据实际情况修改
+                processStatus: '1' // 假设状态为"已完成",可根据实际情况调整
+              });
+            });
+          }
+
+          // 解析第二个元素:.json文件URL
+          const jsonUrl = this.messages[1];
+          if (jsonUrl) {
+            // 绑定到第一个表格(处理后数据)
+            this.tableData1.push({
+              resultDataName: jsonUrl,
+              processStatus: '1' // 假设状态为"已完成"
+            });
+          }
+        }
+      } catch (error) {
+        console.error('数据解析失败', error);
+        this.tableData1 = [];
+        this.tableData2 = [];
+      }
     }
   }
 }

+ 20 - 20
fdapfe-ui/src/views/model/faultPhysical/form.vue

@@ -12,23 +12,6 @@
         <el-input v-model="formData.modelName" placeholder="请输入模型名称"/>
       </el-form-item>
       <el-form-item v-if="modelAtrtibution==='0'" label="模型类型" prop="type">
-        <el-select
-          v-model="formData.modelType"
-          placeholder="请选择模型类型"
-          clearable
-        >
-          <el-option
-            label="Amesim模型"
-            value="1"
-          />
-          <el-option
-            label="Matlab模型"
-            value="2"
-          />
-        </el-select>
-      </el-form-item>
-      <div v-else>
-      <el-form-item label="模型类型" prop="type">
         <el-select
           v-model="formData.modelType"
           placeholder="请选择模型类型"
@@ -42,7 +25,22 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="模型类型" prop="type">
+      <div v-else>
+<!--      <el-form-item label="模型类型" prop="type">-->
+<!--        <el-select-->
+<!--          v-model="formData.modelTypet"-->
+<!--          placeholder="请选择模型类型"-->
+<!--          clearable-->
+<!--        >-->
+<!--          <el-option-->
+<!--            v-for="dict in dict.type.biz_model_type"-->
+<!--            :key="dict.value"-->
+<!--            :label="dict.label"-->
+<!--            :value="dict.value"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+      <el-form-item label="模型种类" prop="type">
         <el-select
           v-model="formData.modelTypet"
           placeholder="请选择模型种类"
@@ -77,12 +75,14 @@
         <el-table :data="formData.configData">
           <el-table-column prop="paramName" label="字段名称" min-width="60" header-align="center" align="center">
             <template slot-scope="scope">
-              <el-input :disabled="disable"  v-model="scope.row.paramName" placeholder="字段名称"></el-input>
+<!--              <el-input :disabled="disable"  v-model="scope.row.paramName" placeholder="字段名称"></el-input>-->
+              <el-input   v-model="scope.row.paramName" placeholder="字段名称"></el-input>
             </template>
           </el-table-column>
           <el-table-column prop="paramChineseName" label="中文名称" min-width="60" align="center">
             <template slot-scope="scope">
-              <el-input :disabled="disable" v-model="scope.row.paramChineseName" placeholder="中文名称"></el-input>
+              <el-input  v-model="scope.row.paramChineseName" placeholder="中文名称"></el-input>
+<!--              <el-input :disabled="disable" v-model="scope.row.paramChineseName" placeholder="中文名称"></el-input>-->
             </template>
           </el-table-column>
           <el-table-column prop="paramType" label="参数类型" header-align="center" align="center">

+ 1 - 1
fdapfe-ui/src/views/model/faultPhysical/index.vue

@@ -106,7 +106,7 @@
         <el-table-column label="模型名称" align="center" prop="modelName"/>
         <el-table-column label="模型类型" align="center" prop="modelType" >
           <template slot-scope="scope" >
-            <span>{{scope.row.modelType==='1'?"Amesim模型":"Matlab模型"}}</span>
+            <dict-tag :options="dict.type.biz_model_type" :value="scope.row.modelType"/>
           </template>
         </el-table-column>
         <el-table-column label="备注" align="center" prop="remark"/>

+ 4 - 4
fdapfe-ui/src/views/test/ddAlgorithm/form.vue

@@ -26,7 +26,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="模型类" prop="type" @change="queryModels">
+      <el-form-item label="模型类" prop="type" @change="queryModels">
         <el-select
           v-model="queryFrom.modelTypet"
           placeholder="请选择模型种类"
@@ -40,7 +40,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="模型" prop="modelId">
+      <el-form-item label="故障诊断算法模型" prop="modelId">
         <el-select v-model="formData.modelId" placeholder="请选择模型" @change="onModelChange">
           <el-option
             v-for="item in faultPhysicalOptions"
@@ -87,10 +87,10 @@ export default {
   computed: {
     title() {
       if (this.options === 'add') {
-        return '添加功能验证';
+        return '功能验证';
       }
       if (this.options === 'edit') {
-        return '修改功能验证';
+        return '功能验证';
       }
       return '';
     },

+ 14 - 22
fdapfe-ui/src/views/test/ddAlgorithm/index.vue

@@ -42,19 +42,18 @@
           新增
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['test:ddAlgorithm:edit']"-->
-<!--        >-->
-<!--          修改-->
-<!--        </el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          v-hasPermi="['test:ddAlgorithm:edit']"
+        >
+          修改
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"
@@ -148,7 +147,7 @@
             @click="handleVerify(scope.row)"
             v-hasPermi="['test:ddAlgorithm:edit']"
           >
-            开始验证
+            查看
           </el-button>
           <el-button
             size="mini"
@@ -202,14 +201,7 @@
 
       <div slot="footer" class="dialog-footer">
         <el-button v-if="!returnDataShow" @click="verifyDialogVisible = false">
-          取消
-        </el-button>
-        <el-button
-          v-if="!returnDataShow"
-          type="primary"
-          @click="handleConfirmVerify"
-        >
-          开始验证
+          关闭
         </el-button>
         <el-button v-if="returnDataShow" @click="handleDialogClose">
           关闭

+ 46 - 8
fdapfe-ui/src/views/test/perf/index.vue

@@ -90,12 +90,12 @@
       />
       <el-table-column label="文件结果" align="center" prop="resultFilePath">
         <template slot-scope="scope">
-          <span @click="dowloadfile(scope.row.resultFilePath)">点击下载</span>
+          <el-link type="primary" @click="dowloadfile(scope.row.resultFilePath)">点击下载</el-link>
         </template>
       </el-table-column>
       <el-table-column label="图片结果" align="center" prop="resultFilePath">
         <template slot-scope="scope">
-          <span @click="showimages(scope.row.resultImagePath)">查看图片</span>
+          <el-link type="primary"  @click="showimages(scope.row.resultImagePath)">查看</el-link>
         </template>
       </el-table-column>
       <el-table-column label="文本结果" align="center" prop="resultText" >
@@ -135,7 +135,7 @@
             icon="el-icon-video-play"
             @click="handleRun(scope.row)"
             v-hasPermi="['test:ddAlgorithm:edit']"
-            >运行</el-button
+            >开始评估</el-button
           >
           <el-button
             size="mini"
@@ -179,14 +179,21 @@
       width="1300px"
       :close-on-click-modal="false"
       append-to-body
+      fullscreen
     >
-      <precision-snr-chart :data="analysisData" />
+      <precision-snr-chart :data-info="compareResult" />
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="handleCompareDialogClose">关闭</el-button>
+          <el-button type="primary" @click="exportCompareResult">导出结果</el-button>
+        </span>
+      </template>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import PrecisionSnrChart from './PrecisionSnrChart.vue';
+import PrecisionSnrChart from '/src/views/form.vue';
 import {
   listPerf,
   getPerf,
@@ -197,9 +204,11 @@ import PerformanceEvaluation from './PerformanceEvaluation.vue';
 import perfDetail from "./perfDetail.vue";
 import showInfo from "./show-info.vue";
 import  dowloadService  from '@/plugins/download'
+import Link from '@/layout/components/Sidebar/Link.vue'
 export default {
   name: "Perf",
   components: {
+    Link,
     perfDetail,
     showInfo,
     PerformanceEvaluation,
@@ -210,7 +219,7 @@ export default {
     return {
       baseUrl: process.env.VUE_APP_BASE_API,
       // 遮罩层
-      analysisData:[],
+      compareResult:[],
       ChartOpen:false,
       loading: true,
       // 选中数组
@@ -250,6 +259,33 @@ export default {
     this.getList();
   },
   methods: {
+    // 导出比对结果
+    exportCompareResult() {
+      if (this.compareResult.length === 0) {
+        this.$message({
+          message: '没有可导出的比对结果',
+          type: 'warning'
+        })
+        return
+      }
+
+      // 创建CSV内容
+      const headers = '文件名,模型,信噪比,准确率(%),精确率,召回率,F1分数,测试时间(ms),不确定性\n'
+      const csvContent = headers + this.compareResult.map(item =>
+        `${item.filename},${item.model},${item.snr},${item.accuracy},${item.precision},${item.recall},${item.f1_score},${item.test_time_ms},${item.uncertainty}`
+      ).join('\n')
+
+      // 创建Blob并下载
+      const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
+      const url = URL.createObjectURL(blob)
+      const link = document.createElement('a')
+      link.setAttribute('href', url)
+      link.setAttribute('download', `比对结果_${new Date().getTime()}.csv`)
+      link.style.visibility = 'hidden'
+      document.body.appendChild(link)
+      link.click()
+      document.body.removeChild(link)
+    },
     dowloadfile(fileurl){
       console.log('showimages', fileurl);
       dowloadService.resource(fileurl)
@@ -357,11 +393,13 @@ export default {
         `perf_${new Date().getTime()}.xlsx`
       );
     },
+    handleCompareDialogClose(){
+      this.ChartOpen=false
+    },
     /** 验证*/
     handleRun(row) {
-
       const dataArray = JSON.parse(row.resultText);
-      this.analysisData = dataArray
+      this.compareResult = dataArray
       console.log(dataArray)
       this.ChartOpen=true;
     },

+ 15 - 18
fdapfe-ui/src/views/workflow/workflow/form.vue

@@ -23,7 +23,7 @@
               placeholder="请输入任务名称"
             ></el-input>
           </el-form-item>
-          <el-form-item label="模型类型" prop="type" >
+          <el-form-item label="模型语言" prop="type" >
             <el-select
               @change="queryModels"
               v-model="queryFrom.modelType"
@@ -53,6 +53,19 @@
               />
             </el-select>
           </el-form-item>
+        <el-form-item label="诊断模型">
+          <el-select
+            v-model="formData.diagModelId"
+            placeholder="请选择诊断模型"
+          >
+            <el-option
+              v-for="item in faultOptions"
+              :key="item.modelId"
+              :label="item.modelName"
+              :value="item.modelId"
+            />
+          </el-select>
+        </el-form-item>
           <el-form-item label="物理模型">
             <el-select
               v-model="formData.modelId"
@@ -70,23 +83,7 @@
           <el-form-item v-if="formData.modelId && modelType" label="模型参数">
             <dynamic-parameter-form :config-data="initialData" @submit="handleSubmitDataList" />
           </el-form-item>
-          <el-form-item label="诊断模型">
-            <el-select
-              v-model="formData.diagModelId"
-              placeholder="请选择诊断模型"
-              @change="onModeldiagChange"
-            >
-              <el-option
-                v-for="item in faultOptions"
-                :key="item.modelId"
-                :label="item.modelName"
-                :value="item.modelId"
-              />
-            </el-select>
-          </el-form-item>
-        <el-form-item v-if="formData.diagModelId" label="诊断模型参数">
-          <el-input v-model="formData.diagModelData"/>
-        </el-form-item>
+
       </el-form>
     <!-- 对话框底部操作 -->
     <div slot="footer" class="dialog-footer">

+ 28 - 69
fdapfe-ui/src/views/workflow/workflow/index.vue

@@ -17,40 +17,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="任务状态" prop="status">-->
-<!--        <el-select-->
-<!--          v-model="queryParams.status"-->
-<!--          placeholder="请选择任务状态"-->
-<!--          clearable-->
-<!--        >-->
-<!--          <el-option-->
-<!--            v-for="dict in dict.type.sys_job_status"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="开始时间" prop="startTime">-->
-<!--        <el-date-picker-->
-<!--          clearable-->
-<!--          v-model="queryParams.startTime"-->
-<!--          type="date"-->
-<!--          value-format="yyyy-MM-dd HH:mm:ss"-->
-<!--          placeholder="请选择开始时间"-->
-<!--        >-->
-<!--        </el-date-picker>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="结束时间" prop="endTime">-->
-<!--        <el-date-picker-->
-<!--          clearable-->
-<!--          v-model="queryParams.endTime"-->
-<!--          type="date"-->
-<!--          value-format="yyyy-MM-dd HH:mm:ss"-->
-<!--          placeholder="请选择结束时间"-->
-<!--        >-->
-<!--        </el-date-picker>-->
-<!--      </el-form-item>-->
       <el-form-item>
         <el-button
           type="primary"
@@ -83,19 +49,18 @@
           新增
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['workflow:workflow:edit']"-->
-<!--        >-->
-<!--          修改-->
-<!--        </el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          v-hasPermi="['workflow:workflow:edit']"
+        >
+          修改
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"
@@ -181,7 +146,7 @@
             @click="handleVerify(scope.row)"
             v-hasPermi="['workflow:workflow:edit']"
           >
-            开始评估
+            运行
           </el-button>
           <el-button
             size="mini"
@@ -214,21 +179,21 @@
       @close="handleDialogClose"
     >
       <el-form :model="verifyRow" label-width="80px">
-        <el-form-item v-if="!returnDataShow" label="所属指标" prop="verifyData">
-          <el-select
-            v-model="verifyRow.verifyData"
-            placeholder="请选择所属指标"
-            style="width: 100%"
-          >
-            <el-option
-              v-for="dict in dict.type.biz_perf_eval_type"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="验证结果" v-else>
+<!--        <el-form-item v-if="!returnDataShow" label="所属指标" prop="verifyData">-->
+<!--          <el-select-->
+<!--            v-model="verifyRow.verifyData"-->
+<!--            placeholder="请选择所属指标"-->
+<!--            style="width: 100%"-->
+<!--          >-->
+<!--            <el-option-->
+<!--              v-for="dict in dict.type.biz_perf_eval_type"-->
+<!--              :key="dict.value"-->
+<!--              :label="dict.label"-->
+<!--              :value="dict.value"-->
+<!--            />-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="验证结果" >
           <template>
             <el-row :gutter="5" class="mb-4">
               <el-col v-for="(url, index) in verifyRow.imageData" :key="index" :span="11">
@@ -240,12 +205,6 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="!returnDataShow" @click="verifyDialogVisible = false">
-          取消
-        </el-button>
-        <el-button v-if="!returnDataShow" type="primary" @click="handleConfirmVerify">
-          开始验证
-        </el-button>
-        <el-button v-if="returnDataShow" @click="handleDialogClose">
           关闭
         </el-button>
       </div>