allen 1 ماه پیش
والد
کامیت
ce5196b703

+ 7 - 0
ips-admin/src/main/java/com/ips/system/controller/AlgorithmConfigController.java

@@ -1,6 +1,7 @@
 package com.ips.system.controller;
 
 import java.util.List;
+import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -101,4 +102,10 @@ public class AlgorithmConfigController extends BaseController
     {
         return toAjax(algorithmConfigService.deleteAlgorithmConfigByIds(ids));
     }
+
+    @GetMapping("/getOptionsByType/{type}")
+    public AjaxResult getOptionsByType(@PathVariable("type")String type)
+    {
+        return success(algorithmConfigService.getOptionsByType(type));
+    }
 }

+ 14 - 0
ips-admin/src/main/java/com/ips/system/controller/PreprocessedController.java

@@ -2,6 +2,9 @@ package com.ips.system.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.ips.common.utils.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -101,4 +104,15 @@ public class PreprocessedController extends BaseController
     {
         return toAjax(preprocessedService.deletePreprocessedByIds(ids));
     }
+
+    @PreAuthorize("@ss.hasPermi('biz:preprocessed:add')")
+    @GetMapping(value = "/run/{id}")
+    public AjaxResult run(@PathVariable("id") Long id) throws JsonProcessingException {
+        String errorMsg = preprocessedService.run(id);
+        if(StringUtils.isEmpty(errorMsg)){
+            return success(errorMsg);
+        } else {
+            return error(errorMsg);
+        }
+    }
 }

+ 16 - 5
ips-admin/src/main/java/com/ips/system/domain/AlgorithmConfig.java

@@ -20,11 +20,13 @@ public class AlgorithmConfig extends BaseEntity
 
     /** 算法名称 */
     @Excel(name = "算法名称")
-    private Long algorithmName;
+    private String algorithmName;
 
     /** 算法类型 */
     @Excel(name = "算法类型")
     private String algorithmType;
+    @Excel(name = "算法路径")
+    private String algorithmPath;
 
     /** 算法参数 */
     private String algorithmParams;
@@ -34,16 +36,16 @@ public class AlgorithmConfig extends BaseEntity
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setAlgorithmName(Long algorithmName) 
+    public void setAlgorithmName(String algorithmName)
     {
         this.algorithmName = algorithmName;
     }
 
-    public Long getAlgorithmName() 
+    public String getAlgorithmName()
     {
         return algorithmName;
     }
@@ -52,7 +54,15 @@ public class AlgorithmConfig extends BaseEntity
         this.algorithmType = algorithmType;
     }
 
-    public String getAlgorithmType() 
+    public String getAlgorithmPath() {
+        return algorithmPath;
+    }
+
+    public void setAlgorithmPath(String algorithmPath) {
+        this.algorithmPath = algorithmPath;
+    }
+
+    public String getAlgorithmType()
     {
         return algorithmType;
     }
@@ -72,6 +82,7 @@ public class AlgorithmConfig extends BaseEntity
             .append("id", getId())
             .append("algorithmName", getAlgorithmName())
             .append("algorithmType", getAlgorithmType())
+            .append("algorithmPath", getAlgorithmPath())
             .append("algorithmParams", getAlgorithmParams())
             .append("remark", getRemark())
             .append("createBy", getCreateBy())

+ 23 - 0
ips-admin/src/main/java/com/ips/system/dto/AlgorithmParamsDto.java

@@ -0,0 +1,23 @@
+package com.ips.system.dto;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.Data;
+
+import java.util.Map;
+import java.util.Objects;
+
+@Data
+public class AlgorithmParamsDto {
+    public static final String MODEL_KEY = "model";
+    private String files_path;
+    private String output_path;
+    private Map<String,Object> params;
+
+    public AlgorithmParamsDto(String inputPath, String outputPath, Map<String, Object> params) {
+        this.files_path = inputPath;
+        this.output_path = outputPath;
+        this.params = params;
+    }
+
+}

+ 4 - 0
ips-admin/src/main/java/com/ips/system/mapper/AlgorithmConfigMapper.java

@@ -1,6 +1,8 @@
 package com.ips.system.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ips.system.domain.AlgorithmConfig;
 
 /**
@@ -58,4 +60,6 @@ public interface AlgorithmConfigMapper
      * @return 结果
      */
     public int deleteAlgorithmConfigByIds(Long[] ids);
+
+    List<Map> getOptionsByType(String type);
 }

+ 4 - 0
ips-admin/src/main/java/com/ips/system/service/IAlgorithmConfigService.java

@@ -1,6 +1,8 @@
 package com.ips.system.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ips.system.domain.AlgorithmConfig;
 
 /**
@@ -58,4 +60,6 @@ public interface IAlgorithmConfigService
      * @return 结果
      */
     public int deleteAlgorithmConfigById(Long id);
+
+    List<Map> getOptionsByType(String type);
 }

+ 4 - 0
ips-admin/src/main/java/com/ips/system/service/IPreprocessedService.java

@@ -1,6 +1,8 @@
 package com.ips.system.service;
 
 import java.util.List;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ips.system.domain.Preprocessed;
 
 /**
@@ -58,4 +60,6 @@ public interface IPreprocessedService
      * @return 结果
      */
     public int deletePreprocessedById(Long id);
+
+    String run(Long id) throws JsonProcessingException;
 }

+ 7 - 0
ips-admin/src/main/java/com/ips/system/service/impl/AlgorithmConfigServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ips.system.service.impl;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ips.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -93,4 +95,9 @@ public class AlgorithmConfigServiceImpl implements IAlgorithmConfigService
     {
         return algorithmConfigMapper.deleteAlgorithmConfigById(id);
     }
+
+    @Override
+    public List<Map> getOptionsByType(String type) {
+        return algorithmConfigMapper.getOptionsByType(type);
+    }
 }

+ 61 - 1
ips-admin/src/main/java/com/ips/system/service/impl/PreprocessedServiceImpl.java

@@ -1,12 +1,24 @@
 package com.ips.system.service.impl;
 
-import java.util.List;
+import java.util.*;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ips.common.utils.DateUtils;
+import com.ips.common.utils.StringUtils;
+import com.ips.system.domain.AlgorithmConfig;
+import com.ips.system.dto.AlgorithmParamsDto;
+import com.ips.system.service.IAlgorithmConfigService;
+import com.ips.system.utils.AlgorithmCaller;
+import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import com.ips.system.mapper.PreprocessedMapper;
 import com.ips.system.domain.Preprocessed;
 import com.ips.system.service.IPreprocessedService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 数据预处理Service业务层处理
@@ -20,6 +32,9 @@ public class PreprocessedServiceImpl implements IPreprocessedService
     @Autowired
     private PreprocessedMapper preprocessedMapper;
 
+    @Autowired
+    private IAlgorithmConfigService algorithmConfigService;
+
     /**
      * 查询数据预处理
      * 
@@ -54,6 +69,7 @@ public class PreprocessedServiceImpl implements IPreprocessedService
     public int insertPreprocessed(Preprocessed preprocessed)
     {
         preprocessed.setCreateTime(DateUtils.getNowDate());
+        preprocessed.setStatus("0");
         return preprocessedMapper.insertPreprocessed(preprocessed);
     }
 
@@ -93,4 +109,48 @@ public class PreprocessedServiceImpl implements IPreprocessedService
     {
         return preprocessedMapper.deletePreprocessedById(id);
     }
+
+    @Override
+    @Async
+    @Transactional
+    public String run(Long id) throws JsonProcessingException {
+        Preprocessed preprocessed = preprocessedMapper.selectPreprocessedById(id);
+        if(preprocessed == null || preprocessed.getAlgorithmId() == null){
+            return "无法找到该任务,id:"+id;
+        }
+        Long algorithmId = preprocessed.getAlgorithmId();
+        AlgorithmConfig algorithmConfig = algorithmConfigService.selectAlgorithmConfigById(algorithmId);
+        preprocessed.setStartTime(new Date());
+        preprocessed.setStatus("1");
+        this.updatePreprocessed(preprocessed);
+
+        String algorithmPath = algorithmConfig.getAlgorithmPath();
+
+        // 组装json
+        String inputPath = preprocessed.getInputPath();
+        String outputPath = preprocessed.getOutputPath();
+        ObjectMapper objectMapper = new ObjectMapper();
+        Map<String, Object> params = objectMapper.readValue(
+                preprocessed.getAlgorithmParams(),
+                new TypeReference<Map<String, Object>>() {}
+        );
+        AlgorithmParamsDto algorithmParamsDto = new AlgorithmParamsDto(inputPath,outputPath,params);
+
+        // 创建 ObjectMapper(Jackson 核心类)
+
+        // 对象 → JSON 字符串
+        String json = objectMapper.writeValueAsString(algorithmParamsDto);
+        // 处理算法
+        String errorMsg = AlgorithmCaller.executeAlgorithm(algorithmPath, json);
+        //处理结果
+
+        if(StringUtils.isEmpty(errorMsg)){
+            preprocessed.setStatus("2");
+        } else {
+            preprocessed.setStatus("3");
+        }
+        preprocessed.setEndTime(new Date());
+        this.updatePreprocessed(preprocessed);
+        return errorMsg;
+    }
 }

+ 9 - 1
ips-admin/src/main/resources/mapper/biz/AlgorithmConfigMapper.xml

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="algorithmName"    column="algorithm_name"    />
         <result property="algorithmType"    column="algorithm_type"    />
+        <result property="algorithmPath"    column="algorithm_path"    />
         <result property="algorithmParams"    column="algorithm_params"    />
         <result property="remark"    column="remark"    />
         <result property="createBy"    column="create_by"    />
@@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAlgorithmConfigVo">
-        select id, algorithm_name, algorithm_type, algorithm_params, remark, create_by, create_time, update_by, update_time from biz_algorithm_config
+        select id, algorithm_name, algorithm_type, algorithm_path, algorithm_params, remark, create_by, create_time, update_by, update_time from biz_algorithm_config
     </sql>
 
     <select id="selectAlgorithmConfigList" parameterType="AlgorithmConfig" resultMap="AlgorithmConfigResult">
@@ -38,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="algorithmName != null">algorithm_name,</if>
             <if test="algorithmType != null">algorithm_type,</if>
+            <if test="algorithmPath != null">algorithm_path,</if>
             <if test="algorithmParams != null">algorithm_params,</if>
             <if test="remark != null">remark,</if>
             <if test="createBy != null">create_by,</if>
@@ -48,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="algorithmName != null">#{algorithmName},</if>
             <if test="algorithmType != null">#{algorithmType},</if>
+            <if test="algorithmPath != null">#{algorithmPath},</if>
             <if test="algorithmParams != null">#{algorithmParams},</if>
             <if test="remark != null">#{remark},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="algorithmName != null">algorithm_name = #{algorithmName},</if>
             <if test="algorithmType != null">algorithm_type = #{algorithmType},</if>
+            <if test="algorithmPath != null">algorithm_path = #{algorithmPath},</if>
             <if test="algorithmParams != null">algorithm_params = #{algorithmParams},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
@@ -82,4 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <select id="getOptionsByType" parameterType="String" resultType="HashMap">
+        select id, algorithm_name as name,algorithm_params as params from biz_algorithm_config where algorithm_type = #{value}
+    </select>
 </mapper>

+ 8 - 0
ips-ui/src/api/biz/config.js

@@ -42,3 +42,11 @@ export function delConfig(id) {
     method: 'delete'
   })
 }
+
+// 根据类型查询算法配置Options
+export function getOptionsByType(type) {
+  return request({
+    url: '/biz/config/getOptionsByType/' + type,
+    method: 'get'
+  })
+}

+ 8 - 0
ips-ui/src/api/biz/preprocessed.js

@@ -42,3 +42,11 @@ export function delPreprocessed(id) {
     method: 'delete'
   })
 }
+
+// 运行数据预处理
+export function run(id) {
+  return request({
+    url: '/biz/preprocessed/run/' + id,
+    method: 'get'
+  })
+}

+ 8 - 5
ips-ui/src/views/biz/config/index.vue

@@ -12,7 +12,7 @@
       <el-form-item label="算法类型" prop="algorithmType">
         <el-select v-model="queryParams.algorithmType" placeholder="请选择算法类型" clearable>
           <el-option
-            v-for="dict in dict.type.sys_job_status"
+            v-for="dict in dict.type.biz_algorithm_type"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -77,7 +77,7 @@
       <el-table-column label="算法名称" align="center" prop="algorithmName" />
       <el-table-column label="算法类型" align="center" prop="algorithmType">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_job_status" :value="scope.row.algorithmType"/>
+          <dict-tag :options="dict.type.biz_algorithm_type" :value="scope.row.algorithmType"/>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remark" />
@@ -100,7 +100,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -118,13 +118,16 @@
         <el-form-item label="算法类型" prop="algorithmType">
           <el-select v-model="form.algorithmType" placeholder="请选择算法类型">
             <el-option
-              v-for="dict in dict.type.sys_job_status"
+              v-for="dict in dict.type.biz_algorithm_type"
               :key="dict.value"
               :label="dict.label"
               :value="dict.value"
             ></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="算法路径" prop="algorithmPath">
+          <el-input v-model="form.algorithmPath" placeholder="请输入内容" />
+        </el-form-item>
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -145,7 +148,7 @@ import { listConfig, getConfig, delConfig, addConfig, updateConfig } from "@/api
 
 export default {
   name: "Config",
-  dicts: ['sys_job_status'],
+  dicts: ['biz_algorithm_type'],
   data() {
     return {
       // 遮罩层

+ 8 - 33
ips-ui/src/views/biz/distillation/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="算法名称" prop="taskName">
+      <el-form-item label="任务名称" prop="taskName">
         <el-input
           v-model="queryParams.taskName"
-          placeholder="请输入算法名称"
+          placeholder="请输入任务名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
           <el-option
-            v-for="dict in dict.type.sys_show_hide"
+            v-for="dict in dict.type.biz_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -98,11 +98,11 @@
     <el-table v-loading="loading" :data="distillationList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="算法名称" align="center" prop="taskName" />
+      <el-table-column label="任务名称" align="center" prop="taskName" />
       <el-table-column label="算法" align="center" prop="algorithmId" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_show_hide" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180">
@@ -147,8 +147,8 @@
     <!-- 添加或修改知识蒸馏对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="算法名称" prop="taskName">
-          <el-input v-model="form.taskName" placeholder="请输入算法名称" />
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
         </el-form-item>
         <el-form-item label="算法" prop="algorithmId">
           <el-input v-model="form.algorithmId" placeholder="请输入算法" />
@@ -162,31 +162,6 @@
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in dict.type.sys_show_hide"
-              :key="dict.value"
-              :label="dict.value"
-            >{{dict.label}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择开始时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结束时间">
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -204,7 +179,7 @@ import { listDistillation, getDistillation, delDistillation, addDistillation, up
 
 export default {
   name: "Distillation",
-  dicts: ['sys_show_hide'],
+  dicts: ['biz_status'],
   data() {
     return {
       // 遮罩层

+ 8 - 33
ips-ui/src/views/biz/features/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="算法名称" prop="taskName">
+      <el-form-item label="任务名称" prop="taskName">
         <el-input
           v-model="queryParams.taskName"
-          placeholder="请输入算法名称"
+          placeholder="请输入任务名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
           <el-option
-            v-for="dict in dict.type.sys_show_hide"
+            v-for="dict in dict.type.biz_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -106,11 +106,11 @@
     <el-table v-loading="loading" :data="featuresList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="算法名称" align="center" prop="taskName" />
+      <el-table-column label="任务名称" align="center" prop="taskName" />
       <el-table-column label="算法" align="center" prop="algorithmId" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_show_hide" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180">
@@ -155,8 +155,8 @@
     <!-- 添加或修改特征提取对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="算法名称" prop="taskName">
-          <el-input v-model="form.taskName" placeholder="请输入算法名称" />
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
         </el-form-item>
         <el-form-item label="算法" prop="algorithmId">
           <el-input v-model="form.algorithmId" placeholder="请输入算法" />
@@ -170,31 +170,6 @@
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in dict.type.sys_show_hide"
-              :key="dict.value"
-              :label="dict.value"
-            >{{dict.label}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择开始时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结束时间">
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
         </el-form-item>
@@ -212,7 +187,7 @@ import { listFeatures, getFeatures, delFeatures, addFeatures, updateFeatures } f
 
 export default {
   name: "Features",
-  dicts: ['sys_show_hide'],
+  dicts: ['biz_status'],
   data() {
     return {
       // 遮罩层

+ 48 - 37
ips-ui/src/views/biz/preprocessed/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="算法名称" prop="taskName">
+      <el-form-item label="任务名称" prop="taskName">
         <el-input
           v-model="queryParams.taskName"
-          placeholder="请输入算法名称"
+          placeholder="请输入任务名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
           <el-option
-            v-for="dict in dict.type.sys_show_hide"
+            v-for="dict in dict.type.biz_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -98,11 +98,11 @@
     <el-table v-loading="loading" :data="preprocessedList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="算法名称" align="center" prop="taskName" />
+      <el-table-column label="任务名称" align="center" prop="taskName" />
       <el-table-column label="算法" align="center" prop="algorithmId" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_show_hide" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180">
@@ -118,6 +118,13 @@
       <el-table-column label="备注" align="center" prop="remark" />
       <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-edit"
+            @click="handleRun(scope.row)"
+            v-hasPermi="['biz:preprocessed:add']"
+          >运行</el-button>
           <el-button
             size="mini"
             type="text"
@@ -147,11 +154,18 @@
     <!-- 添加或修改数据预处理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="算法名称" prop="taskName">
-          <el-input v-model="form.taskName" placeholder="请输入算法名称" />
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
         </el-form-item>
         <el-form-item label="算法" prop="algorithmId">
-          <el-input v-model="form.algorithmId" placeholder="请输入算法" />
+          <el-select v-model="form.algorithmId" placeholder="请选择算法" @change="changeAlgorithmId" clearable>
+            <el-option
+              v-for="option in configOptions"
+              :key="option.id"
+              :label="option.name"
+              :value="option.id"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="输入路径" prop="inputPath">
           <el-input v-model="form.inputPath" placeholder="请输入输入路径" />
@@ -162,31 +176,6 @@
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in dict.type.sys_show_hide"
-              :key="dict.value"
-              :label="dict.value"
-            >{{dict.label}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择开始时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结束时间">
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -200,11 +189,11 @@
 </template>
 
 <script>
-import { listPreprocessed, getPreprocessed, delPreprocessed, addPreprocessed, updatePreprocessed } from "@/api/biz/preprocessed";
-
+import { listPreprocessed, getPreprocessed, delPreprocessed, addPreprocessed, updatePreprocessed, run } from "@/api/biz/preprocessed";
+import { getOptionsByType } from "@/api/biz/config";
 export default {
   name: "Preprocessed",
-  dicts: ['sys_show_hide'],
+  dicts: ['biz_status'],
   data() {
     return {
       // 遮罩层
@@ -240,11 +229,13 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      configOptions:[],
     };
   },
   created() {
     this.getList();
+    this.getOptions();
   },
   methods: {
     /** 查询数据预处理列表 */
@@ -313,6 +304,12 @@ export default {
         this.title = "修改数据预处理";
       });
     },
+    handleRun(row){
+      const id = row.id;
+      run(id).then(response => {
+        alert("任务开始运行!")
+      });
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
@@ -348,6 +345,20 @@ export default {
       this.download('biz/preprocessed/export', {
         ...this.queryParams
       }, `preprocessed_${new Date().getTime()}.xlsx`)
+    },
+    getOptions() {
+      getOptionsByType("1").then(response => {
+        this.configOptions = response.data;
+      });
+    },
+    changeAlgorithmId(){
+      const algorithmId = this.form.algorithmId;
+      const config = this.configOptions.find(item => item.id === algorithmId);
+      if (config && config.params) {
+        this.form.algorithmParams = config.params;
+      } else {
+        this.form.algorithmParams = '';
+      }
     }
   }
 };

+ 8 - 33
ips-ui/src/views/biz/test/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="算法名称" prop="taskName">
+      <el-form-item label="任务名称" prop="taskName">
         <el-input
           v-model="queryParams.taskName"
-          placeholder="请输入算法名称"
+          placeholder="请输入任务名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
           <el-option
-            v-for="dict in dict.type.sys_show_hide"
+            v-for="dict in dict.type.biz_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -98,11 +98,11 @@
     <el-table v-loading="loading" :data="testList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="算法名称" align="center" prop="taskName" />
+      <el-table-column label="任务名称" align="center" prop="taskName" />
       <el-table-column label="算法" align="center" prop="algorithmId" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_show_hide" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180">
@@ -147,8 +147,8 @@
     <!-- 添加或修改分类测试对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="算法名称" prop="taskName">
-          <el-input v-model="form.taskName" placeholder="请输入算法名称" />
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
         </el-form-item>
         <el-form-item label="算法" prop="algorithmId">
           <el-input v-model="form.algorithmId" placeholder="请输入算法" />
@@ -162,31 +162,6 @@
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in dict.type.sys_show_hide"
-              :key="dict.value"
-              :label="dict.value"
-            >{{dict.label}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择开始时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结束时间">
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -204,7 +179,7 @@ import { listTest, getTest, delTest, addTest, updateTest } from "@/api/biz/test"
 
 export default {
   name: "Test",
-  dicts: ['sys_show_hide'],
+  dicts: ['biz_status'],
   data() {
     return {
       // 遮罩层

+ 8 - 33
ips-ui/src/views/biz/training/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="算法名称" prop="taskName">
+      <el-form-item label="任务名称" prop="taskName">
         <el-input
           v-model="queryParams.taskName"
-          placeholder="请输入算法名称"
+          placeholder="请输入任务名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
           <el-option
-            v-for="dict in dict.type.sys_show_hide"
+            v-for="dict in dict.type.biz_status"
             :key="dict.value"
             :label="dict.label"
             :value="dict.value"
@@ -98,11 +98,11 @@
     <el-table v-loading="loading" :data="trainingList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="算法名称" align="center" prop="taskName" />
+      <el-table-column label="任务名称" align="center" prop="taskName" />
       <el-table-column label="算法" align="center" prop="algorithmId" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_show_hide" :value="scope.row.status"/>
+          <dict-tag :options="dict.type.biz_status" :value="scope.row.status"/>
         </template>
       </el-table-column>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180">
@@ -147,8 +147,8 @@
     <!-- 添加或修改模型训练对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="算法名称" prop="taskName">
-          <el-input v-model="form.taskName" placeholder="请输入算法名称" />
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
         </el-form-item>
         <el-form-item label="算法" prop="algorithmId">
           <el-input v-model="form.algorithmId" placeholder="请输入算法" />
@@ -162,31 +162,6 @@
         <el-form-item label="算法参数" prop="algorithmParams">
           <el-input v-model="form.algorithmParams" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-radio-group v-model="form.status">
-            <el-radio
-              v-for="dict in dict.type.sys_show_hide"
-              :key="dict.value"
-              :label="dict.value"
-            >{{dict.label}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择开始时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结束时间">
-          </el-date-picker>
-        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
         </el-form-item>
@@ -204,7 +179,7 @@ import { listTraining, getTraining, delTraining, addTraining, updateTraining } f
 
 export default {
   name: "Training",
-  dicts: ['sys_show_hide'],
+  dicts: ['biz_status'],
   data() {
     return {
       // 遮罩层

+ 49 - 48
sql/biz.sql

@@ -1,10 +1,11 @@
 drop table if exists biz_algorithm_config;
 create table biz_algorithm_config (
-  id           bigint(20)      not null auto_increment        comment '编号',
-  algorithm_name         bigint(20)      default 0                  comment '算法名称',
-  algorithm_type         varchar(50)     default ''                 comment '算法类型',
-  algorithm_params         text                                     comment '算法参数',
-  remark            varchar(255)          default ''                 comment '备注',
+  id           bigint(20)      not null auto_increment         comment '编号',
+  algorithm_name         varchar(20)      default 0             comment '算法名称',
+  algorithm_type         varchar(50)     default ''            comment '算法类型',
+  algorithm_path         varchar(255)          default ''      comment '算法路径',
+  algorithm_params         text                                comment '算法参数',
+  remark            varchar(255)          default ''           comment '备注',
   create_by         varchar(64)     default ''                 comment '创建者',
   create_time 	    datetime                                   comment '创建时间',
   update_by         varchar(64)     default ''                 comment '更新者',
@@ -15,10 +16,10 @@ create table biz_algorithm_config (
 drop table if exists biz_preprocessed;
 create table biz_preprocessed (
   id           bigint(20)      not null auto_increment    comment '编号',
-  task_name         varchar(50)      default ''                comment '算法名称',
+  task_name         varchar(50)      default ''                comment '任务名称',
   algorithm_id      bigint(20)                                 comment '算法',
   input_path        varchar(255)     default ''                comment '输入路径',
-  output_path       varchar(255)     default ''                comment '输路径',
+  output_path       varchar(255)     default ''                comment '输路径',
   algorithm_params  text                                       comment '算法参数',
   status            char(1)          default '0'               comment '状态(0未运行,1运行中,2已完成,3失败)',
   start_time        datetime                                   comment '开始时间',
@@ -34,10 +35,10 @@ create table biz_preprocessed (
 drop table if exists biz_extracted_features;
 create table biz_extracted_features (
   id           bigint(20)      not null auto_increment    comment '编号',
-  task_name         varchar(50)      default ''                comment '算法名称',
+  task_name         varchar(50)      default ''                comment '任务名称',
   algorithm_id      bigint(20)                                 comment '算法',
   input_path        varchar(255)     default ''                comment '输入路径',
-  output_path       varchar(255)     default ''                comment '输路径',
+  output_path       varchar(255)     default ''                comment '输路径',
   algorithm_params  text                                       comment '算法参数',
   status            char(1)          default '0'               comment '状态(0未运行,1运行中,2已完成,3失败)',
   start_time        datetime                                   comment '开始时间',
@@ -53,10 +54,10 @@ create table biz_extracted_features (
 drop table if exists biz_training;
 create table biz_training (
   id           bigint(20)      not null auto_increment    comment '编号',
-  task_name         varchar(50)      default ''                comment '算法名称',
+  task_name         varchar(50)      default ''                comment '任务名称',
   algorithm_id      bigint(20)                                 comment '算法',
   input_path        varchar(255)     default ''                comment '输入路径',
-  output_path       varchar(255)     default ''                comment '输路径',
+  output_path       varchar(255)     default ''                comment '输路径',
   algorithm_params  text                                       comment '算法参数',
   status            char(1)          default '0'               comment '状态(0未运行,1运行中,2已完成,3失败)',
   start_time        datetime                                   comment '开始时间',
@@ -72,10 +73,10 @@ create table biz_training (
 drop table if exists biz_distillation;
 create table biz_distillation (
   id           bigint(20)      not null auto_increment    comment '编号',
-  task_name         varchar(50)      default ''                comment '算法名称',
+  task_name         varchar(50)      default ''                comment '任务名称',
   algorithm_id      bigint(20)                                 comment '算法',
   input_path        varchar(255)     default ''                comment '输入路径',
-  output_path       varchar(255)     default ''                comment '输路径',
+  output_path       varchar(255)     default ''                comment '输路径',
   algorithm_params  text                                       comment '算法参数',
   status            char(1)          default '0'               comment '状态(0未运行,1运行中,2已完成,3失败)',
   start_time        datetime                                   comment '开始时间',
@@ -91,10 +92,10 @@ create table biz_distillation (
 drop table if exists biz_classify_test;
 create table biz_classify_test (
   id           bigint(20)      not null auto_increment    comment '编号',
-  task_name         varchar(50)      default ''                comment '算法名称',
+  task_name         varchar(50)      default ''                comment '任务名称',
   algorithm_id      bigint(20)                                 comment '算法',
   input_path        varchar(255)     default ''                comment '输入路径',
-  output_path       varchar(255)     default ''                comment '输路径',
+  output_path       varchar(255)     default ''                comment '输路径',
   algorithm_params  text                                       comment '算法参数',
   status            char(1)          default '0'               comment '状态(0未运行,1运行中,2已完成,3失败)',
   start_time        datetime                                   comment '开始时间',
@@ -107,39 +108,39 @@ create table biz_classify_test (
   primary key (id)
 ) engine=innodb comment = '分类测试表';
 
-drop table if exists gen_child_tables;
-CREATE TABLE `gen_child_tables` (
-  `table_ref_id` varchar(64) NOT NULL COMMENT '主键ID',
-  `table_id` varchar(64) DEFAULT NULL COMMENT '业务对象id',
-  `table_name` varchar(255) DEFAULT NULL COMMENT '表名',
-  `child_table_id` varchar(64) DEFAULT NULL COMMENT '子业务对象id',
-  `child_table_name` varchar(255) DEFAULT NULL COMMENT '子表名',
-  `rel_field` varchar(255) DEFAULT NULL COMMENT '关联字段',
-  `rel_field_name` varchar(255) DEFAULT NULL COMMENT '关联字段名称',
-  `name` varchar(255) DEFAULT NULL COMMENT '父子业务对象关系',
-  `desc_text` varchar(512) DEFAULT NULL COMMENT '父子业务对象关系描述',
-  `remark`            varchar(255)          default ''           comment '备注',
-  `create_by`         varchar(64)     default ''                 comment '创建者',
-  `create_time` 	    datetime                                   comment '创建时间',
-  `update_by`         varchar(64)     default ''                 comment '更新者',
-  `update_time`       datetime                                   comment '更新时间',
-  PRIMARY KEY (`table_ref_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='父子表关系表';
-
-CREATE TABLE `gen_page` (
-  `page_id` varchar(64) NOT NULL COMMENT '页面ID',
-  `table_id` bigint(20) DEFAULT NULL COMMENT '关联表ID',
-  `name` varchar(255) DEFAULT NULL COMMENT '页面名称',
-  `desc_text` varchar(512) DEFAULT NULL COMMENT '页面描述',
-  `config` text DEFAULT NULL COMMENT '页面配置信息',
-  `version` bigint(20) DEFAULT NULL COMMENT '版本号',
-  `remark`            varchar(255)          default ''           comment '备注',
-  `create_by`         varchar(64)     default ''                 comment '创建者',
-  `create_time` 	    datetime                                   comment '创建时间',
-  `update_by`         varchar(64)     default ''                 comment '更新者',
-  `update_time`       datetime                                   comment '更新时间',
-  PRIMARY KEY (`page_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='页面配置表';
+--drop table if exists gen_child_tables;
+--CREATE TABLE `gen_child_tables` (
+--  `table_ref_id` varchar(64) NOT NULL COMMENT '主键ID',
+--  `table_id` varchar(64) DEFAULT NULL COMMENT '业务对象id',
+--  `table_name` varchar(255) DEFAULT NULL COMMENT '表名',
+--  `child_table_id` varchar(64) DEFAULT NULL COMMENT '子业务对象id',
+--  `child_table_name` varchar(255) DEFAULT NULL COMMENT '子表名',
+--  `rel_field` varchar(255) DEFAULT NULL COMMENT '关联字段',
+--  `rel_field_name` varchar(255) DEFAULT NULL COMMENT '关联字段名称',
+--  `name` varchar(255) DEFAULT NULL COMMENT '父子业务对象关系',
+--  `desc_text` varchar(512) DEFAULT NULL COMMENT '父子业务对象关系描述',
+--  `remark`            varchar(255)          default ''           comment '备注',
+--  `create_by`         varchar(64)     default ''                 comment '创建者',
+--  `create_time` 	    datetime                                   comment '创建时间',
+--  `update_by`         varchar(64)     default ''                 comment '更新者',
+--  `update_time`       datetime                                   comment '更新时间',
+--  PRIMARY KEY (`table_ref_id`)
+--) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='父子表关系表';
+--
+--CREATE TABLE `gen_page` (
+--  `page_id` varchar(64) NOT NULL COMMENT '页面ID',
+--  `table_id` bigint(20) DEFAULT NULL COMMENT '关联表ID',
+--  `name` varchar(255) DEFAULT NULL COMMENT '页面名称',
+--  `desc_text` varchar(512) DEFAULT NULL COMMENT '页面描述',
+--  `config` text DEFAULT NULL COMMENT '页面配置信息',
+--  `version` bigint(20) DEFAULT NULL COMMENT '版本号',
+--  `remark`            varchar(255)          default ''           comment '备注',
+--  `create_by`         varchar(64)     default ''                 comment '创建者',
+--  `create_time` 	    datetime                                   comment '创建时间',
+--  `update_by`         varchar(64)     default ''                 comment '更新者',
+--  `update_time`       datetime                                   comment '更新时间',
+--  PRIMARY KEY (`page_id`)
+--) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='页面配置表';
 
 
 -- 菜单 SQL