Browse Source

add nose data

allen 2 months ago
parent
commit
0761e4cf42

+ 4 - 1
sql/update20250415.sql

@@ -3,7 +3,10 @@ CREATE TABLE `uavps_task`  (
   `biz_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '业务ID',
   `biz_name` varchar(127) COMMENT '任务名称',
   `biz_type` varchar(7) COMMENT '业务类型(start:开始,change:队形转换,disappear:消失出现)',
-  `multiTarget` varchar(7) COMMENT '业务类型',
+  `multi_target` varchar(7) COMMENT '多目标类型',
+  `nose_type` varchar(127) COMMENT '噪声类型',
+  `noise_variance` DECIMAL(10,6) COMMENT '噪声类型',
+  `noise_mean` DECIMAL(12,6) COMMENT '噪声类型',
   `platform_uav_str` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '固定翼平台无人机数据',
   `fixed_multi_target_formation_str` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '固定编队目标数据',
   `customized_multi_target_formation_str` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '自定义编队目标数据',

+ 2 - 10
uavps-framework/src/main/java/com/uavps/framework/websocket/WebSocketServer.java

@@ -8,25 +8,18 @@ import com.uavps.framework.udp.UdpClientService;
 import com.uavps.framework.udp.UdpServerService;
 import com.uavps.framework.udp.utils.UdpDataUtils;
 import com.uavps.system.domain.UavpsAircraft;
-import com.uavps.system.domain.UavpsAlgorithmParameter;
 import com.uavps.system.domain.UavpsTask;
 import com.uavps.system.service.IUavpsAircraftService;
 import com.uavps.system.service.IUavpsAlgorithmParameterService;
 import com.uavps.system.service.IUavpsTaskService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
-import javax.websocket.OnClose;
-import javax.websocket.OnError;
-import javax.websocket.OnMessage;
-import javax.websocket.OnOpen;
-import javax.websocket.Session;
+import javax.websocket.*;
 import javax.websocket.server.ServerEndpoint;
 import java.io.IOException;
-import java.math.BigDecimal;
 import java.net.DatagramPacket;
 import java.net.DatagramSocket;
 import java.net.InetAddress;
@@ -53,8 +46,7 @@ public class WebSocketServer {
 
     private IUavpsAlgorithmParameterService algorithmParameterService = SpringUtils.getBean(IUavpsAlgorithmParameterService.class);
 
-    @Autowired
-    private IUavpsTaskService uavpsTaskService;
+    private IUavpsTaskService uavpsTaskService = SpringUtils.getBean(IUavpsTaskService.class);;
 
     /**
      * 连接建立成功调用的方法

+ 1 - 1
uavps-system/src/main/java/com/uavps/system/controller/UavpsTaskController.java

@@ -25,7 +25,7 @@ import com.uavps.common.core.page.TableDataInfo;
  * 任务数据Controller
  * 
  * @author ruoyi
- * @date 2025-04-15
+ * @date 2025-04-17
  */
 @RestController
 @RequestMapping("/system/task")

+ 69 - 133
uavps-system/src/main/java/com/uavps/system/domain/UavpsTask.java

@@ -1,69 +1,48 @@
 package com.uavps.system.domain;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.math.BigDecimal;
 import com.uavps.common.annotation.Excel;
-import com.uavps.common.core.domain.BaseEntity;
-import com.uavps.system.domain.dto.CustomizedMultiTargetFormationDTO;
-import com.uavps.system.domain.dto.FixedMultiTargetFormationDTO;
-import com.uavps.system.domain.dto.PlatformUavDTO;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * 任务数据对象 uavps_task
  * 
  * @author ruoyi
- * @date 2025-04-15
+ * @date 2025-04-17
  */
 public class UavpsTask extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    public static final String START = "start";
-    public static final String CHANGE = "change";
-    public static final String DISAPPEAR = "disappear";
-    public static final String SHOW = "show";
-
     /** 业务ID */
     private Long bizId;
 
-    /** 业务类型(start:开始,change:队形转换,disappear:消失出现) */
-    @Excel(name = "业务类型", readConverterExp = "s=tart:开始,change:队形转换,disappear:消失出现")
-    private String bizType;
+    /** 任务名称 */
+    @Excel(name = "任务名称")
+    private String bizName;
 
     /** 业务类型 */
-    @Excel(name = "业务类型")
+    private String bizType;
+
+    /** 多目标类型 */
     private String multiTarget;
 
+    /** 噪声类型 */
+    private String noseType;
+
+    /** 噪声类型 */
+    private BigDecimal noiseVariance;
+
+    /** 噪声类型 */
+    private BigDecimal noiseMean;
+
     /** 固定翼平台无人机数据 */
-    @JsonIgnore
     private String platformUavStr;
 
     /** 固定编队目标数据 */
-    @JsonIgnore
     private String fixedMultiTargetFormationStr;
 
     /** 自定义编队目标数据 */
-    @JsonIgnore
     private String customizedMultiTargetFormationStr;
-    /** 固定翼平台无人机数据 */
-    private PlatformUavDTO platformUav;
-
-    /** 固定编队目标数据 */
-    private FixedMultiTargetFormationDTO fixedMultiTargetFormation;
-
-    /** 自定义编队目标数据 */
-    private List<CustomizedMultiTargetFormationDTO> customizedMultiTargetFormation;
-
-    private List<Integer> numbers = new ArrayList<>();
 
     public void setBizId(Long bizId) 
     {
@@ -74,6 +53,15 @@ public class UavpsTask extends BaseEntity
     {
         return bizId;
     }
+    public void setBizName(String bizName) 
+    {
+        this.bizName = bizName;
+    }
+
+    public String getBizName() 
+    {
+        return bizName;
+    }
     public void setBizType(String bizType) 
     {
         this.bizType = bizType;
@@ -92,6 +80,33 @@ public class UavpsTask extends BaseEntity
     {
         return multiTarget;
     }
+    public void setNoseType(String noseType) 
+    {
+        this.noseType = noseType;
+    }
+
+    public String getNoseType() 
+    {
+        return noseType;
+    }
+    public void setNoiseVariance(BigDecimal noiseVariance) 
+    {
+        this.noiseVariance = noiseVariance;
+    }
+
+    public BigDecimal getNoiseVariance() 
+    {
+        return noiseVariance;
+    }
+    public void setNoiseMean(BigDecimal noiseMean) 
+    {
+        this.noiseMean = noiseMean;
+    }
+
+    public BigDecimal getNoiseMean() 
+    {
+        return noiseMean;
+    }
     public void setPlatformUavStr(String platformUavStr) 
     {
         this.platformUavStr = platformUavStr;
@@ -120,102 +135,23 @@ public class UavpsTask extends BaseEntity
         return customizedMultiTargetFormationStr;
     }
 
-    public PlatformUavDTO getPlatformUav() {
-        if (platformUav == null && StringUtils.isNotEmpty(platformUavStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            try {
-                this.platformUav = mapper.readValue(this.platformUavStr, PlatformUavDTO.class);
-            } catch (Exception e) {
-                logger.error("UavpsTask.getPlatformUav error", e);
-            }
-        }
-        return platformUav;
-    }
-
-    public void setPlatformUav(PlatformUavDTO platformUav) {
-        this.platformUav = platformUav;
-        if (platformUav != null && StringUtils.isEmpty(this.platformUavStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            try {
-                String json = mapper.writeValueAsString(platformUav);
-                this.platformUavStr = json;
-            } catch (Exception e) {
-                logger.error("UavpsTask.setPlatformUav error", e);
-            }
-        }
-    }
-
-    public FixedMultiTargetFormationDTO getFixedMultiTargetFormation() {
-        if (fixedMultiTargetFormation == null && StringUtils.isNotEmpty(fixedMultiTargetFormationStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            try {
-                fixedMultiTargetFormation = mapper.readValue(this.fixedMultiTargetFormationStr, FixedMultiTargetFormationDTO.class);
-            } catch (Exception e) {
-                logger.error("UavpsTask.getPlatformUav error", e);
-            }
-        }
-        return fixedMultiTargetFormation;
-    }
-
-    public void setFixedMultiTargetFormation(FixedMultiTargetFormationDTO fixedMultiTargetFormation) {
-        this.fixedMultiTargetFormation = fixedMultiTargetFormation;
-        if (fixedMultiTargetFormation != null && StringUtils.isEmpty(this.fixedMultiTargetFormationStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            String json = null;
-            try {
-                json = mapper.writeValueAsString(fixedMultiTargetFormation);
-            } catch (Exception e) {
-                logger.error("UavpsTask.setPlatformUav error", e);
-            }
-            this.fixedMultiTargetFormationStr = json;
-        }
-    }
-
-    public List<CustomizedMultiTargetFormationDTO> getCustomizedMultiTargetFormation() {
-        if (customizedMultiTargetFormation == null && StringUtils.isNotEmpty(customizedMultiTargetFormationStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            try {
-                this.customizedMultiTargetFormation = mapper.readValue(customizedMultiTargetFormationStr, new TypeReference<List<CustomizedMultiTargetFormationDTO>>() {});
-            } catch (Exception e) {
-                logger.error("UavpsTask.getCustomizedMultiTargetFormation error", e);
-            }
-        }
-        return customizedMultiTargetFormation;
-    }
-
-    public void setCustomizedMultiTargetFormation(List<CustomizedMultiTargetFormationDTO> customizedMultiTargetFormation) {
-        this.customizedMultiTargetFormation = customizedMultiTargetFormation;
-        if (customizedMultiTargetFormation != null && StringUtils.isEmpty(this.customizedMultiTargetFormationStr)) {
-            ObjectMapper mapper = new ObjectMapper();
-            try {
-                customizedMultiTargetFormationStr = mapper.writeValueAsString(customizedMultiTargetFormation);
-            } catch (Exception e) {
-                logger.error("UavpsTask.setCustomizedMultiTargetFormation error", e);
-            }
-        }
-    }
-
-    public List<Integer> getNumbers() {
-        return numbers;
-    }
-
-    public void setNumbers(List<Integer> numbers) {
-        this.numbers = numbers;
-    }
-
     @Override
     public String toString() {
-        return "UavpsTask{" +
-                "bizId=" + bizId +
-                ", bizType='" + bizType + '\'' +
-                ", multiTarget='" + multiTarget + '\'' +
-                ", platformUavStr='" + platformUavStr + '\'' +
-                ", fixedMultiTargetFormationStr='" + fixedMultiTargetFormationStr + '\'' +
-                ", customizedMultiTargetFormationStr='" + customizedMultiTargetFormationStr + '\'' +
-                ", platformUav=" + platformUav +
-                ", fixedMultiTargetFormation=" + fixedMultiTargetFormation +
-                ", customizedMultiTargetFormation=" + customizedMultiTargetFormation +
-                ", numbers=" + numbers +
-                '}';
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("bizId", getBizId())
+            .append("bizName", getBizName())
+            .append("bizType", getBizType())
+            .append("multiTarget", getMultiTarget())
+            .append("noseType", getNoseType())
+            .append("noiseVariance", getNoiseVariance())
+            .append("noiseMean", getNoiseMean())
+            .append("platformUavStr", getPlatformUavStr())
+            .append("fixedMultiTargetFormationStr", getFixedMultiTargetFormationStr())
+            .append("customizedMultiTargetFormationStr", getCustomizedMultiTargetFormationStr())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
     }
 }

+ 83 - 0
uavps-system/src/main/java/com/uavps/system/domain/dto/CustomizedMultiTargetFormationDTO.java

@@ -1,4 +1,87 @@
 package com.uavps.system.domain.dto;
 
+import java.math.BigDecimal;
+
 public class CustomizedMultiTargetFormationDTO {
+    private Integer number;
+    private BigDecimal longitude;
+    private BigDecimal latitude;
+    private BigDecimal altitude;
+    private BigDecimal eastSpeed;
+    private BigDecimal northSpeed;
+    private BigDecimal skySpeed;
+    private String flightPathType;
+    private BigDecimal positionNoise;
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public BigDecimal getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(BigDecimal longitude) {
+        this.longitude = longitude;
+    }
+
+    public BigDecimal getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(BigDecimal latitude) {
+        this.latitude = latitude;
+    }
+
+    public BigDecimal getAltitude() {
+        return altitude;
+    }
+
+    public void setAltitude(BigDecimal altitude) {
+        this.altitude = altitude;
+    }
+
+    public BigDecimal getEastSpeed() {
+        return eastSpeed;
+    }
+
+    public void setEastSpeed(BigDecimal eastSpeed) {
+        this.eastSpeed = eastSpeed;
+    }
+
+    public BigDecimal getNorthSpeed() {
+        return northSpeed;
+    }
+
+    public void setNorthSpeed(BigDecimal northSpeed) {
+        this.northSpeed = northSpeed;
+    }
+
+    public BigDecimal getSkySpeed() {
+        return skySpeed;
+    }
+
+    public void setSkySpeed(BigDecimal skySpeed) {
+        this.skySpeed = skySpeed;
+    }
+
+    public String getFlightPathType() {
+        return flightPathType;
+    }
+
+    public void setFlightPathType(String flightPathType) {
+        this.flightPathType = flightPathType;
+    }
+
+    public BigDecimal getPositionNoise() {
+        return positionNoise;
+    }
+
+    public void setPositionNoise(BigDecimal positionNoise) {
+        this.positionNoise = positionNoise;
+    }
 }

+ 1 - 1
uavps-system/src/main/java/com/uavps/system/mapper/UavpsTaskMapper.java

@@ -7,7 +7,7 @@ import com.uavps.system.domain.UavpsTask;
  * 任务数据Mapper接口
  * 
  * @author ruoyi
- * @date 2025-04-15
+ * @date 2025-04-17
  */
 public interface UavpsTaskMapper 
 {

+ 1 - 1
uavps-system/src/main/java/com/uavps/system/service/IUavpsTaskService.java

@@ -7,7 +7,7 @@ import com.uavps.system.domain.UavpsTask;
  * 任务数据Service接口
  * 
  * @author ruoyi
- * @date 2025-04-15
+ * @date 2025-04-17
  */
 public interface IUavpsTaskService 
 {

+ 1 - 1
uavps-system/src/main/java/com/uavps/system/service/impl/UavpsTaskServiceImpl.java

@@ -12,7 +12,7 @@ import com.uavps.system.service.IUavpsTaskService;
  * 任务数据Service业务层处理
  * 
  * @author ruoyi
- * @date 2025-04-15
+ * @date 2025-04-17
  */
 @Service
 public class UavpsTaskServiceImpl implements IUavpsTaskService 

+ 26 - 10
uavps-system/src/main/resources/mapper/system/UavpsTaskMapper.xml

@@ -6,8 +6,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="UavpsTask" id="UavpsTaskResult">
         <result property="bizId"    column="biz_id"    />
+        <result property="bizName"    column="biz_name"    />
         <result property="bizType"    column="biz_type"    />
-        <result property="multiTarget"    column="multiTarget"    />
+        <result property="multiTarget"    column="multi_target"    />
+        <result property="noseType"    column="nose_type"    />
+        <result property="noiseVariance"    column="noise_variance"    />
+        <result property="noiseMean"    column="noise_mean"    />
         <result property="platformUavStr"    column="platform_uav_str"    />
         <result property="fixedMultiTargetFormationStr"    column="fixed_multi_target_formation_str"    />
         <result property="customizedMultiTargetFormationStr"    column="customized_multi_target_formation_str"    />
@@ -18,14 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectUavpsTaskVo">
-        select biz_id, biz_type, multiTarget, platform_uav_str, fixed_multi_target_formation_str, customized_multi_target_formation_str, create_by, create_time, update_by, update_time from uavps_task
+        select biz_id, biz_name, biz_type, multi_target, nose_type, noise_variance, noise_mean, platform_uav_str, fixed_multi_target_formation_str, customized_multi_target_formation_str, create_by, create_time, update_by, update_time from uavps_task
     </sql>
 
     <select id="selectUavpsTaskList" parameterType="UavpsTask" resultMap="UavpsTaskResult">
         <include refid="selectUavpsTaskVo"/>
         <where>  
-            <if test="bizType != null  and bizType != ''"> and biz_type = #{bizType}</if>
-            <if test="multiTarget != null  and multiTarget != ''"> and multiTarget = #{multiTarget}</if>
+            <if test="bizName != null  and bizName != ''"> and biz_name like concat('%', #{bizName}, '%')</if>
+            <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
         </where>
     </select>
     
@@ -37,8 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertUavpsTask" parameterType="UavpsTask" useGeneratedKeys="true" keyProperty="bizId">
         insert into uavps_task
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="bizType != null and bizType != ''">biz_type,</if>
-            <if test="multiTarget != null and multiTarget != ''">multiTarget,</if>
+            <if test="bizName != null">biz_name,</if>
+            <if test="bizType != null">biz_type,</if>
+            <if test="multiTarget != null">multi_target,</if>
+            <if test="noseType != null">nose_type,</if>
+            <if test="noiseVariance != null">noise_variance,</if>
+            <if test="noiseMean != null">noise_mean,</if>
             <if test="platformUavStr != null">platform_uav_str,</if>
             <if test="fixedMultiTargetFormationStr != null">fixed_multi_target_formation_str,</if>
             <if test="customizedMultiTargetFormationStr != null">customized_multi_target_formation_str,</if>
@@ -48,8 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="bizType != null and bizType != ''">#{bizType},</if>
-            <if test="multiTarget != null and multiTarget != ''">#{multiTarget},</if>
+            <if test="bizName != null">#{bizName},</if>
+            <if test="bizType != null">#{bizType},</if>
+            <if test="multiTarget != null">#{multiTarget},</if>
+            <if test="noseType != null">#{noseType},</if>
+            <if test="noiseVariance != null">#{noiseVariance},</if>
+            <if test="noiseMean != null">#{noiseMean},</if>
             <if test="platformUavStr != null">#{platformUavStr},</if>
             <if test="fixedMultiTargetFormationStr != null">#{fixedMultiTargetFormationStr},</if>
             <if test="customizedMultiTargetFormationStr != null">#{customizedMultiTargetFormationStr},</if>
@@ -63,8 +75,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateUavpsTask" parameterType="UavpsTask">
         update uavps_task
         <trim prefix="SET" suffixOverrides=",">
-            <if test="bizType != null and bizType != ''">biz_type = #{bizType},</if>
-            <if test="multiTarget != null and multiTarget != ''">multiTarget = #{multiTarget},</if>
+            <if test="bizName != null">biz_name = #{bizName},</if>
+            <if test="bizType != null">biz_type = #{bizType},</if>
+            <if test="multiTarget != null">multi_target = #{multiTarget},</if>
+            <if test="noseType != null">nose_type = #{noseType},</if>
+            <if test="noiseVariance != null">noise_variance = #{noiseVariance},</if>
+            <if test="noiseMean != null">noise_mean = #{noiseMean},</if>
             <if test="platformUavStr != null">platform_uav_str = #{platformUavStr},</if>
             <if test="fixedMultiTargetFormationStr != null">fixed_multi_target_formation_str = #{fixedMultiTargetFormationStr},</if>
             <if test="customizedMultiTargetFormationStr != null">customized_multi_target_formation_str = #{customizedMultiTargetFormationStr},</if>

+ 246 - 67
uavps-web/src/views/system/task/index.vue

@@ -1,8 +1,27 @@
 <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="bizType">
-        <el-select v-model="queryParams.bizType" placeholder="请选择业务类型" clearable>
+    <el-form
+      v-show="showSearch"
+      ref="queryForm"
+      :model="queryParams"
+      size="small"
+      :inline="true"
+      label-width="68px"
+    >
+      <el-form-item label="任务名称" prop="bizName">
+        <el-input
+          v-model="queryParams.bizName"
+          placeholder="请输入任务名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="多目标类型" prop="multiTarget">
+        <el-select
+          v-model="queryParams.multiTarget"
+          placeholder="请选择多目标类型"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.uavps_target_formation_type"
             :key="dict.value"
@@ -11,101 +30,153 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="业务类型" prop="multiTarget">
-        <el-input
-          v-model="queryParams.multiTarget"
-          placeholder="请输入业务类型"
-          clearable
-          @keyup.enter.native="handleQuery"
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="daterangeCreateTime"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:task:add']"
           type="primary"
           plain
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['system:task:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:task:edit']"
           type="success"
           plain
           icon="el-icon-edit"
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['system:task:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:task:remove']"
           type="danger"
           plain
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['system:task:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:task:export']"
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['system:task:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
     </el-row>
 
-    <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="taskList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="业务ID" align="center" prop="bizId" />
-      <el-table-column label="业务类型" align="center" prop="bizType">
+      <el-table-column label="任务名称" align="center" prop="bizName" />
+      <el-table-column label="多目标类型" align="center" prop="multiTarget">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.uavps_target_formation_type"
+            :value="scope.row.multiTarget"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+        width="180"
+      >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.uavps_target_formation_type" :value="scope.row.bizType"/>
+          <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="业务类型" align="center" prop="multiTarget">
+      <el-table-column
+        label="更新时间"
+        align="center"
+        prop="updateTime"
+        width="180"
+      >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.uavps_target_formation_type" :value="scope.row.multiTarget"/>
+          <span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
+            v-hasPermi="['system:task:edit']"
+            size="mini"
+            type="text"
+            icon="el-icon-s-operation"
+            @click="handleRun(scope.row)"
+            >运行</el-button
+          >
+          <el-button
+            v-hasPermi="['system:task:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:task:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
+            v-hasPermi="['system:task:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:task:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -115,6 +186,9 @@
     <!-- 添加或修改任务数据对话框 -->
     <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="bizName">
+          <el-input v-model="form.bizName" placeholder="请输入任务名称" />
+        </el-form-item>
         <el-form-item label="业务类型" prop="bizType">
           <el-select v-model="form.bizType" placeholder="请选择业务类型">
             <el-option
@@ -122,20 +196,45 @@
               :key="dict.value"
               :label="dict.label"
               :value="dict.value"
-            ></el-option>
+            />
           </el-select>
         </el-form-item>
-        <el-form-item label="业务类型" prop="multiTarget">
-          <el-input v-model="form.multiTarget" placeholder="请输入业务类型" />
+        <el-form-item label="多目标类型" prop="multiTarget">
+          <el-select v-model="form.multiTarget" placeholder="请选择多目标类型">
+            <el-option
+              v-for="dict in dict.type.uavps_target_formation_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="固定翼平台无人机数据" prop="platformUavStr">
-          <el-input v-model="form.platformUavStr" type="textarea" placeholder="请输入内容" />
+          <el-input
+            v-model="form.platformUavStr"
+            type="textarea"
+            placeholder="请输入内容"
+          />
         </el-form-item>
-        <el-form-item label="固定编队目标数据" prop="fixedMultiTargetFormationStr">
-          <el-input v-model="form.fixedMultiTargetFormationStr" type="textarea" placeholder="请输入内容" />
+        <el-form-item
+          label="固定编队目标数据"
+          prop="fixedMultiTargetFormationStr"
+        >
+          <el-input
+            v-model="form.fixedMultiTargetFormationStr"
+            type="textarea"
+            placeholder="请输入内容"
+          />
         </el-form-item>
-        <el-form-item label="自定义编队目标数据" prop="customizedMultiTargetFormationStr">
-          <el-input v-model="form.customizedMultiTargetFormationStr" type="textarea" placeholder="请输入内容" />
+        <el-form-item
+          label="自定义编队目标数据"
+          prop="customizedMultiTargetFormationStr"
+        >
+          <el-input
+            v-model="form.customizedMultiTargetFormationStr"
+            type="textarea"
+            placeholder="请输入内容"
+          />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -143,15 +242,30 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog
+      :title="title"
+      :visible.sync="showTrajectory"
+      @opened="initTrajectory"
+      :before-close="destroyTrajectory"
+      :fullscreen="true"
+      append-to-body
+      destroy-on-close
+    ></el-dialog>
   </div>
 </template>
 
 <script>
-import { listTask, getTask, delTask, addTask, updateTask } from "@/api/system/task";
+import {
+  listTask,
+  getTask,
+  delTask,
+  addTask,
+  updateTask,
+} from "@/api/system/task";
 
 export default {
   name: "Task",
-  dicts: ['uavps_target_formation_type'],
+  dicts: ["uavps_target_formation_type"],
   data() {
     return {
       // 遮罩层
@@ -172,24 +286,30 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      // 自定义编队目标数据时间范围
+      daterangeCreateTime: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        bizType: null,
+        bizName: null,
         multiTarget: null,
+        createTime: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         bizType: [
-          { required: true, message: "业务类型不能为空", trigger: "change" }
+          { required: true, message: "业务类型不能为空", trigger: "change" },
         ],
         multiTarget: [
-          { required: true, message: "业务类型不能为空", trigger: "blur" }
+          { required: true, message: "多目标类型不能为空", trigger: "change" },
         ],
-      }
+      },
+      parameterId: 0,
+      showTrajectory: false,
+      webSocket: null,
     };
   },
   created() {
@@ -199,7 +319,13 @@ export default {
     /** 查询任务数据列表 */
     getList() {
       this.loading = true;
-      listTask(this.queryParams).then(response => {
+      this.queryParams.params = {};
+      if (this.daterangeCreateTime != null && this.daterangeCreateTime != "") {
+        this.queryParams.params["beginCreateTime"] =
+          this.daterangeCreateTime[0];
+        this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
+      }
+      listTask(this.queryParams).then((response) => {
         this.taskList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -214,6 +340,7 @@ export default {
     reset() {
       this.form = {
         bizId: null,
+        bizName: null,
         bizType: null,
         multiTarget: null,
         platformUavStr: null,
@@ -222,7 +349,7 @@ export default {
         createBy: null,
         createTime: null,
         updateBy: null,
-        updateTime: null
+        updateTime: null,
       };
       this.resetForm("form");
     },
@@ -233,14 +360,15 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.daterangeCreateTime = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.bizId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.bizId);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -251,8 +379,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const bizId = row.bizId || this.ids
-      getTask(bizId).then(response => {
+      const bizId = row.bizId || this.ids;
+      getTask(bizId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改任务数据";
@@ -260,16 +388,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.bizId != null) {
-            updateTask(this.form).then(response => {
+            updateTask(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addTask(this.form).then(response => {
+            addTask(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -281,19 +409,70 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const bizIds = row.bizId || this.ids;
-      this.$modal.confirm('是否确认删除任务数据编号为"' + bizIds + '"的数据项?').then(function() {
-        return delTask(bizIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除任务数据编号为"' + bizIds + '"的数据项?')
+        .then(function () {
+          return delTask(bizIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('system/task/export', {
-        ...this.queryParams
-      }, `task_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "system/task/export",
+        {
+          ...this.queryParams,
+        },
+        `task_${new Date().getTime()}.xlsx`
+      );
+    },
+    handleRun(row) {
+      this.parameterId = row.bizId || this.ids;
+      this.showTrajectory = true;
+      this.title = "飞行轨迹";
+    },
+    initWebSocket() {
+      const wsUri = "ws://127.0.0.1:8080/websocket/message";
+      this.webSocket = new WebSocket(wsUri);
+      const self = this;
+      debugger;
+      this.webSocket.onopen = function (event) {
+        self.webSocket.send("RUN:" + self.parameterId);
+        console.log("WebSocket连接成功!");
+      };
+
+      this.webSocket.onmessage = function (event) {
+        self.processMessage(JSON.parse(event.data));
+      };
+
+      this.webSocket.onclose = function (event) {
+        console.log("WebSocket连接断开!");
+      };
+
+      this.webSocket.onerror = function (event) {
+        console.log(
+          "WebSocket连接异常: " +
+            event.code +
+            " " +
+            event.reason +
+            " " +
+            event.wasClean
+        );
+      };
+    },
+    destroyTrajectory() {
+      if (this.webSocket) {
+        this.webSocket.close();
+      }
+      this.showTrajectory = false;
+    },
+    initTrajectory() {
+      this.initWebSocket();
+    },
+  },
 };
 </script>