Bladeren bron

平台无人机、自定义可视化、结束

Rmengdi 5 dagen geleden
bovenliggende
commit
81d7b52dd1
3 gewijzigde bestanden met toevoegingen van 261 en 196 verwijderingen
  1. 95 108
      uavps-web/src/router/index.js
  2. 166 88
      uavps-web/src/views/system/task/index.vue
  3. BIN
      uavps-web/src/views/textures/platform.png

+ 95 - 108
uavps-web/src/router/index.js

@@ -1,10 +1,10 @@
-import Vue from 'vue'
-import Router from 'vue-router'
+import Vue from "vue";
+import Router from "vue-router";
 
-Vue.use(Router)
+Vue.use(Router);
 
 /* Layout */
-import Layout from '@/layout'
+import Layout from "@/layout";
 
 /**
  * Note: 路由配置项
@@ -31,180 +31,167 @@ import Layout from '@/layout'
 // 公共路由
 export const constantRoutes = [
   {
-    path: '/redirect',
+    path: "/redirect",
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/redirect/:path(.*)',
-        component: () => import('@/views/redirect')
-      }
-    ]
+        path: "/redirect/:path(.*)",
+        component: () => import("@/views/redirect"),
+      },
+    ],
   },
   {
-    path: '/login',
-    component: () => import('@/views/login'),
-    hidden: true
-  },
-  {
-    path: '/register',
-    component: () => import('@/views/register'),
-    hidden: true
+    path: "/login",
+    component: () => import("@/views/login"),
+    hidden: true,
   },
   {
-    path: '/404',
-    component: () => import('@/views/error/404'),
-    hidden: true
+    path: "/register",
+    component: () => import("@/views/register"),
+    hidden: true,
   },
   {
-    path: '/401',
-    component: () => import('@/views/error/401'),
-    hidden: true
+    path: "/404",
+    component: () => import("@/views/error/404"),
+    hidden: true,
   },
   {
-    path: '',
-    component: Layout,
-    redirect: 'index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/index'),
-        name: 'Index',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
-      }
-    ]
+    path: "/401",
+    component: () => import("@/views/error/401"),
+    hidden: true,
   },
   {
-    path: '',
+    path: "",
     component: Layout,
-    redirect: 'Demo',
+    redirect: "index",
     children: [
       {
-        path: 'demo',
-        component: () => import('@/views/demo/index'),
-        name: 'Demo',
-        meta: { title: 'DEMO', icon: 'dashboard', affix: true }
-      }
-    ]
+        path: "index",
+        component: () => import("@/views/index"),
+        name: "Index",
+        meta: { title: "首页", icon: "dashboard", affix: true },
+      },
+    ],
   },
   {
-    path: '/user',
+    path: "/user",
     component: Layout,
     hidden: true,
-    redirect: 'noredirect',
+    redirect: "noredirect",
     children: [
       {
-        path: 'profile',
-        component: () => import('@/views/system/user/profile/index'),
-        name: 'Profile',
-        meta: { title: '个人中心', icon: 'user' }
-      }
-    ]
-  }
-]
+        path: "profile",
+        component: () => import("@/views/system/user/profile/index"),
+        name: "Profile",
+        meta: { title: "个人中心", icon: "user" },
+      },
+    ],
+  },
+];
 
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [
   {
-    path: '/system/user-auth',
+    path: "/system/user-auth",
     component: Layout,
     hidden: true,
-    permissions: ['system:user:edit'],
+    permissions: ["system:user:edit"],
     children: [
       {
-        path: 'role/:userId(\\d+)',
-        component: () => import('@/views/system/user/authRole'),
-        name: 'AuthRole',
-        meta: { title: '分配角色', activeMenu: '/system/user' }
-      }
-    ]
+        path: "role/:userId(\\d+)",
+        component: () => import("@/views/system/user/authRole"),
+        name: "AuthRole",
+        meta: { title: "分配角色", activeMenu: "/system/user" },
+      },
+    ],
   },
   {
-    path: '/system/role-auth',
+    path: "/system/role-auth",
     component: Layout,
     hidden: true,
-    permissions: ['system:role:edit'],
+    permissions: ["system:role:edit"],
     children: [
       {
-        path: 'user/:roleId(\\d+)',
-        component: () => import('@/views/system/role/authUser'),
-        name: 'AuthUser',
-        meta: { title: '分配用户', activeMenu: '/system/role' }
-      }
-    ]
+        path: "user/:roleId(\\d+)",
+        component: () => import("@/views/system/role/authUser"),
+        name: "AuthUser",
+        meta: { title: "分配用户", activeMenu: "/system/role" },
+      },
+    ],
   },
   {
-    path: '/system/dict-data',
+    path: "/system/dict-data",
     component: Layout,
     hidden: true,
-    permissions: ['system:dict:list'],
+    permissions: ["system:dict:list"],
     children: [
       {
-        path: 'index/:dictId(\\d+)',
-        component: () => import('@/views/system/dict/data'),
-        name: 'Data',
-        meta: { title: '字典数据', activeMenu: '/system/dict' }
-      }
-    ]
+        path: "index/:dictId(\\d+)",
+        component: () => import("@/views/system/dict/data"),
+        name: "Data",
+        meta: { title: "字典数据", activeMenu: "/system/dict" },
+      },
+    ],
   },
   {
-    path: '/monitor/job-log',
+    path: "/monitor/job-log",
     component: Layout,
     hidden: true,
-    permissions: ['monitor:job:list'],
+    permissions: ["monitor:job:list"],
     children: [
       {
-        path: 'index/:jobId(\\d+)',
-        component: () => import('@/views/monitor/job/log'),
-        name: 'JobLog',
-        meta: { title: '调度日志', activeMenu: '/monitor/job' }
-      }
-    ]
+        path: "index/:jobId(\\d+)",
+        component: () => import("@/views/monitor/job/log"),
+        name: "JobLog",
+        meta: { title: "调度日志", activeMenu: "/monitor/job" },
+      },
+    ],
   },
   {
-    path: '/tool/gen-edit',
+    path: "/tool/gen-edit",
     component: Layout,
     hidden: true,
-    permissions: ['tool:gen:edit'],
+    permissions: ["tool:gen:edit"],
     children: [
       {
-        path: 'index/:tableId(\\d+)',
-        component: () => import('@/views/tool/gen/editTable'),
-        name: 'GenEdit',
-        meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
-      }
-    ]
+        path: "index/:tableId(\\d+)",
+        component: () => import("@/views/tool/gen/editTable"),
+        name: "GenEdit",
+        meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
+      },
+    ],
   },
   {
-    path: '/uavps/task-run',
+    path: "/uavps/task-run",
     component: Layout,
     hidden: true,
-    permissions: ['uavps:task:run'],
+    permissions: ["uavps:task:run"],
     children: [
       {
-        path: 'task/:taskId(\\d+)',
-        component: () => import('@/views/display'),
-        name: 'TaskRun',
-        meta: { title: '轨迹模拟', activeMenu: '/task' }
-      }
-    ]
+        path: "task/:taskId(\\d+)",
+        component: () => import("@/views/display"),
+        name: "TaskRun",
+        meta: { title: "轨迹模拟", activeMenu: "/task" },
+      },
+    ],
   },
-]
+];
 
 // 防止连续点击多次路由报错
 let routerPush = Router.prototype.push;
 let routerReplace = Router.prototype.replace;
 // push
 Router.prototype.push = function push(location) {
-  return routerPush.call(this, location).catch(err => err)
-}
+  return routerPush.call(this, location).catch((err) => err);
+};
 // replace
 Router.prototype.replace = function push(location) {
-  return routerReplace.call(this, location).catch(err => err)
-}
+  return routerReplace.call(this, location).catch((err) => err);
+};
 
 export default new Router({
-  mode: 'history', // 去掉url中的#
+  mode: "history", // 去掉url中的#
   scrollBehavior: () => ({ y: 0 }),
-  routes: constantRoutes
-})
+  routes: constantRoutes,
+});

+ 166 - 88
uavps-web/src/views/system/task/index.vue

@@ -151,7 +151,9 @@
         width="180"
       >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
+          <span>{{
+            parseTime(scope.row.startTime, "{y}-{m}-{d} {h}:{m}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -161,7 +163,9 @@
         width="180"
       >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
+          <span>{{
+            parseTime(scope.row.endTime, "{y}-{m}-{d} {h}:{m}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -171,7 +175,9 @@
         width="180"
       >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
+          <span>{{
+            parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{m}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -181,7 +187,9 @@
         width="180"
       >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
+          <span>{{
+            parseTime(scope.row.updateTime, "{y}-{m}-{d} {h}:{m}:{s}")
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -523,31 +531,33 @@
         >
           <el-form-item label="编号" prop="number">
             <el-input
-              v-model.number="formationInfoForm.number"
+              v-model="formationInfoForm.number"
               placeholder="请输入编号"
             />
           </el-form-item>
           <el-form-item label="经度" prop="longitude">
             <el-input
-              v-model.number="formationInfoForm.longitude"
+              v-model="formationInfoForm.longitude"
+              oninput="value=value.replace(/[^\d.]/g,'')"
               placeholder="请输入经度"
             />
           </el-form-item>
           <el-form-item label="纬度" prop="latitude">
             <el-input
-              v-model.number="formationInfoForm.latitude"
+              v-model="formationInfoForm.latitude"
+              oninput="value=value.replace(/[^\d.]/g,'')"
               placeholder="请输入纬度"
             />
           </el-form-item>
           <el-form-item label="海拔" prop="altitude">
             <el-input
-              v-model.number="formationInfoForm.altitude"
+              v-model="formationInfoForm.altitude"
               placeholder="请输入海拔"
             />
           </el-form-item>
           <el-form-item label="东向速度" prop="eastSpeed">
             <el-input
-              v-model.number="formationInfoForm.eastSpeed"
+              v-model="formationInfoForm.eastSpeed"
               placeholder="请输入东向速度"
             >
               <template slot="append">m/s</template>
@@ -555,7 +565,7 @@
           </el-form-item>
           <el-form-item label="北向速度" prop="northSpeed">
             <el-input
-              v-model.number="formationInfoForm.northSpeed"
+              v-model="formationInfoForm.northSpeed"
               placeholder="请输入北向速度"
             >
               <template slot="append">m/s</template>
@@ -563,7 +573,7 @@
           </el-form-item>
           <el-form-item label="天向速度" prop="skySpeed">
             <el-input
-              v-model.number="formationInfoForm.skySpeed"
+              v-model="formationInfoForm.skySpeed"
               placeholder="请输入天向速度"
             >
               <template slot="append">m/s</template>
@@ -579,7 +589,7 @@
           </el-form-item>
           <el-form-item label="噪声" prop="positionNoise">
             <el-input
-              v-model.number="formationInfoForm.positionNoise"
+              v-model="formationInfoForm.positionNoise"
               placeholder="请输入噪声"
             />
           </el-form-item>
@@ -610,9 +620,12 @@
               <el-button
                 v-if="!isUpdateView"
                 @click="transFormation"
-                type="danger"
+                type="warning"
                 >转换队形</el-button
               >
+              <el-button v-if="!isUpdateView" @click="endHandle" type="danger"
+                >结束</el-button
+              >
               <el-progress
                 style="margin: 0 auto"
                 :text-inside="true"
@@ -620,7 +633,6 @@
                 v-if="isUpdateView"
                 :percentage="percentage"
               ></el-progress>
-              <!-- <el-button @click="handlePlayback" type="success">回放</el-button> -->
             </el-col>
           </el-row>
           <el-row>
@@ -631,8 +643,8 @@
           <div style="float: right">
             <el-link type="primary" @click="showConfig">显示配置</el-link>
           </div>
-          <div>
-            <el-divider content-position="left">隐藏列表</el-divider>
+          <el-divider content-position="left">隐藏列表</el-divider>
+          <div style="height: 30px">
             <div style="margin-left: 10px" v-if="hideList.length !== 0">
               <el-tag
                 v-for="item in hideList"
@@ -643,45 +655,75 @@
             </div>
             <div style="margin-left: 10px" v-else>暂无</div>
           </div>
+          <el-divider content-position="left">平台无人机</el-divider>
+          <div style="height: 120px; overflow: auto">
+            <div v-if="configList.includes('经度')">
+              <span>经度:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.longitude }}</label>
+            </div>
+            <div v-if="configList.includes('纬度')">
+              <span>纬度:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.latitude }}</label>
+            </div>
+            <div v-if="configList.includes('海拔')">
+              <span>海拔:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.altitude }}m</label>
+            </div>
+            <div v-if="configList.includes('东向速度')">
+              <span>东向速度:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.eastSpeed }}m/s</label>
+            </div>
+            <div v-if="configList.includes('北向速度')">
+              <span>北向速度:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.northSpeed }}m/s</label>
+            </div>
+            <div v-if="configList.includes('天向速度')">
+              <span>天向速度:&nbsp;&nbsp;</span
+              ><label>{{ platformInfo.skySpeed }}m/s</label>
+            </div>
+          </div>
           <el-divider content-position="left">目标无人机群</el-divider>
-          <li v-for="(item, index) in targetLblAry" :key="index">
-            <div
-              v-if="!hideList.includes(item.id)"
-              @click="showSprite(item.id)"
-              style="cursor: pointer"
-            >
-              <div>
-                <span>编号:&nbsp;&nbsp;</span><label>{{ item.showNo }}</label>
-                <!-- <span style="margin-left: 10px" v-if="hideList.includes(item.id)"
+          <div style="height: 550px; overflow: auto">
+            <li v-for="(item, index) in targetLblAry" :key="index">
+              <div
+                v-if="!hideList.includes(item.id)"
+                @click="showSprite(item.id)"
+                style="cursor: pointer"
+              >
+                <div>
+                  <span>编号:&nbsp;&nbsp;</span
+                  ><label>{{ item.showNo }}</label>
+                  <!-- <span style="margin-left: 10px" v-if="hideList.includes(item.id)"
                 >( 隐 藏 )</span
               > -->
+                </div>
+                <div v-if="configList.includes('经度')">
+                  <span>经度:&nbsp;&nbsp;</span
+                  ><label>{{ item.longitude }}</label>
+                </div>
+                <div v-if="configList.includes('纬度')">
+                  <span>纬度:&nbsp;&nbsp;</span
+                  ><label>{{ item.latitude }}</label>
+                </div>
+                <div v-if="configList.includes('海拔')">
+                  <span>海拔:&nbsp;&nbsp;</span
+                  ><label>{{ item.altitude }}</label>
+                </div>
+                <div v-if="configList.includes('东向速度')">
+                  <span>东向速度:&nbsp;&nbsp;</span
+                  ><label>{{ item.eastSpeed }}</label>
+                </div>
+                <div v-if="configList.includes('北向速度')">
+                  <span>北向速度:&nbsp;&nbsp;</span
+                  ><label>{{ item.northSpeed }}</label>
+                </div>
+                <div v-if="configList.includes('天向速度')">
+                  <span>天向速度:&nbsp;&nbsp;</span
+                  ><label>{{ item.skySpeed }}</label>
+                </div>
               </div>
-              <div v-if="configList.includes('经度')">
-                <span>经度:&nbsp;&nbsp;</span
-                ><label>{{ item.longitude }}</label>
-              </div>
-              <div v-if="configList.includes('纬度')">
-                <span>纬度:&nbsp;&nbsp;</span
-                ><label>{{ item.latitude }}</label>
-              </div>
-              <div v-if="configList.includes('海拔')">
-                <span>海拔:&nbsp;&nbsp;</span
-                ><label>{{ item.altitude }}</label>
-              </div>
-              <div v-if="configList.includes('东向速度')">
-                <span>东向速度:&nbsp;&nbsp;</span
-                ><label>{{ item.eastSpeed }}</label>
-              </div>
-              <div v-if="configList.includes('北向速度')">
-                <span>北向速度:&nbsp;&nbsp;</span
-                ><label>{{ item.northSpeed }}</label>
-              </div>
-              <div v-if="configList.includes('天向速度')">
-                <span>天向速度:&nbsp;&nbsp;</span
-                ><label>{{ item.skySpeed }}</label>
-              </div>
-            </div>
-          </li>
+            </li>
+          </div>
         </div>
       </div>
     </el-dialog>
@@ -719,6 +761,8 @@ import {
   updateTask,
 } from "@/api/system/task";
 import * as PIXI from "pixi.js";
+import platformPNG from "../../textures/platform.png";
+import uavTarPNG from "../../textures/uav-tar.png";
 
 export default {
   name: "Task",
@@ -1019,6 +1063,7 @@ export default {
       platformInfo: {},
       platformPathData: {}, //平台无人机位置
       platformGraphics: null, //平台无人机轨迹
+      playbackTime: null, // 回放的时间
     };
   },
   created() {
@@ -1122,13 +1167,13 @@ export default {
     },
     // 根据后端返回的自定义编队信息,显示飞机位置
     airPosShow(info, type) {
-      let texture;
-      if (type == "fixedWing") {
-        texture = new PIXI.Texture.from("../../textures/uav-tar.png");
-      } else {
-        // 旋翼机型 需要改
-        texture = new PIXI.Texture.from("../../textures/uav-tar.png");
-      }
+      let texture = new PIXI.Texture.from(uavTarPNG);
+      // if (type == "fixedWing") {
+      //   texture = new PIXI.Texture.from("../../textures/uav-tar.png");
+      // } else {
+      //   // 旋翼机型 需要改
+      //   texture = new PIXI.Texture.from("../../textures/uav-tar.png");
+      // }
       // TODO 需要给精灵加上id,就是数据中的number
       info.forEach((item) => {
         const { x, y } = this.calculateXY(item.longitude, item.latitude);
@@ -1234,11 +1279,10 @@ export default {
       this.title = "飞行轨迹";
     },
     handlePlayback(row) {
-      this.parameterId = row.id || this.ids;
+      this.parameterId = row.bizId || this.ids;
+      this.playbackTime = row.totalDuration;
       this.showTrajectory = true;
       this.isUpdateView = true;
-      const msg = "REPLAY:" + this.parameterId;
-      this.webSocket.send(msg);
       this.title = "回放";
     },
     initWebSocket() {
@@ -1246,7 +1290,11 @@ export default {
       this.webSocket = new WebSocket(wsUri);
       const self = this;
       this.webSocket.onopen = function (event) {
-        self.webSocket.send("RUN:" + self.parameterId);
+        if (self.title == "回放") {
+          self.webSocket.send("REPLAY:" + self.parameterId);
+        } else {
+          self.webSocket.send("RUN:" + self.parameterId);
+        }
         console.log("WebSocket连接成功!");
       };
 
@@ -1270,12 +1318,15 @@ export default {
       };
     },
     transFormation() {
-      // debugger;
       let msg = "TRANSFORMATION:" + this.parameterId;
       console.info("transFormation", msg);
       this.webSocket.send(msg);
-      // this.pixiApp.stage.removeChildren();
-      // this.clearAllAry();
+    },
+    endHandle() {
+      let msg = "END:" + this.parameterId;
+      this.webSocket.send(msg);
+      this.getList();
+      this.showTrajectory = false;
     },
     destroyTrajectory() {
       if (this.webSocket) {
@@ -1312,7 +1363,7 @@ export default {
       this.clearAllAry();
     },
     initTrajectory() {
-      this.clearAllAry();
+      // this.clearAllAry();
       this.initPixi();
       this.initWebSocket();
     },
@@ -1365,12 +1416,10 @@ export default {
     showPlatformAir(platformData) {
       const data = platformData.platformAircraft;
       if (this.platformData.length == 0) {
-        const platformTexture = new PIXI.Texture.from(
-          "../../textures/bunny.png"
-        );
+        const platformTexture = new PIXI.Texture.from(platformPNG);
         this.platformSprite = new PIXI.Sprite(platformTexture);
         this.platformSprite.anchor.set(0.5, 0.5);
-        this.platformSprite.scale.set(1);
+        this.platformSprite.scale.set(0.1);
         this.platformSprite.x = data.coordinateX;
         this.platformSprite.y = data.coordinateY;
         this.platformData.push(this.platformSprite);
@@ -1389,6 +1438,7 @@ export default {
           data.northSpeed,
           data.eastSpeed
         );
+        this.platformInfo = data;
         if (this.platformCycleCount % this.updatePlatformPathFlag == 0) {
           // 更新路径绘制
           this.updatePlatformPath(this.platformSprite.x, this.platformSprite.y);
@@ -1404,9 +1454,7 @@ export default {
       this.targetTotal = targetData.aircrafts.length;
       // 还没有真实数据时,先初始化数据。
       if (this.targetDataR.length === 0) {
-        const targetTexture = new PIXI.Texture.from(
-          "../../textures/uav-tar.png"
-        );
+        const targetTexture = new PIXI.Texture.from(uavTarPNG);
         for (let i = 0; i < this.targetTotal; i++) {
           this.allId.push(targetData.aircrafts[i].aircraftNumber);
           const group = new PIXI.Container();
@@ -1456,9 +1504,9 @@ export default {
           this.targetUavCircleNum.push(text);
           group.addChild(text);
           // 绑定鼠标事件,飞机隐藏
-          group.on("pointerdown", () => {
-            this.hideSprite(group.id);
-          });
+          // group.on("pointerdown", () => {
+          //   this.hideSprite(group.id);
+          // });
           this.pixiApp.stage.addChild(group);
 
           // 创建路径
@@ -1569,7 +1617,7 @@ export default {
       this.targetTotal = targetData.aircrafts.length;
       // 还没有数据时,先初始化数据。
       if (this.targetDataN.length === 0) {
-        const targetTexture = new PIXI.Texture.from("../../textures/bunny.png");
+        const targetTexture = new PIXI.Texture.from(uavTarPNG);
         for (let i = 0; i < this.targetTotal; i++) {
           const group = new PIXI.Container();
           group.id = targetData.aircrafts[i].aircraftNumber;
@@ -1577,7 +1625,8 @@ export default {
           // 创建无人机
           const dude = new PIXI.Sprite(targetTexture);
           dude.anchor.set(0.5, 0.5);
-          dude.scale.set(0.4);
+          dude.scale.set(0.01);
+          dude.alpha = 0.5;
 
           dude.x = targetData.aircrafts[i].coordinateX;
           dude.y = targetData.aircrafts[i].coordinateY;
@@ -1761,6 +1810,16 @@ export default {
         this.pixiApp.stage.scale.x *= zoomFactor;
         this.pixiApp.stage.scale.y *= zoomFactor;
       });
+
+      // 画布点击事件
+      // this.pixiApp.renderer.view.addEventListener("click", (event) => {
+      //   const position = new PIXI.Point(event.clientX, event.clientY);
+      //   // 需要换算成画布位置
+      //   // const localPosition = app.renderer.plugins.interaction.mouse.global;
+      //   console.log("画布被点击的位置:", position);
+
+      //   // 可以检查点击位置是否有精灵覆盖
+      // });
     },
     // 更新无人机飞行路径
     updatePath(index, x, y) {
@@ -1832,12 +1891,13 @@ export default {
     addAirSprite() {
       // 判断是哪个机型
       let texture;
-      if (this.form && this.form.multiTarget == "1") {
-        texture = new PIXI.Texture.from("../../textures/uav-tar.png");
-      } else if (this.form && this.form.multiTarget == "2") {
-        // 旋翼机型 需要改
-        texture = new PIXI.Texture.from("../../textures/uav-tar.png");
-      }
+      texture = new PIXI.Texture.from(uavTarPNG);
+      // if (this.form && this.form.multiTarget == "1") {
+      //   texture = new PIXI.Texture.from("../../textures/uav-tar.png");
+      // } else if (this.form && this.form.multiTarget == "2") {
+      //   // 旋翼机型 需要改
+      //   texture = new PIXI.Texture.from("../../textures/uav-tar.png");
+      // }
       // 创建飞机
       const airSprite = new PIXI.Sprite(texture);
       airSprite.anchor.set(0.5, 0.5);
@@ -1915,13 +1975,15 @@ export default {
     handleDrawerSubmit() {
       this.$refs["formationInfoRef"].validate((valid) => {
         if (valid) {
+          this.formationInfoForm = this.ObjectStringToNumber(
+            this.formationInfoForm
+          );
           if (this.formationInfoForm.number) {
             this.formationInfoList.forEach((item) => {
               if (item.number == this.formationInfoForm.number) {
                 item = this.formationInfoForm;
               }
             });
-            // TODO 需要找到页面上的精灵,获取其id根据经纬度计算位置
             let spriteIndex;
             this.formationAirPiXiApp.stage.children.forEach((child, index) => {
               // 检查 child 是否是 Container 类型
@@ -1932,13 +1994,17 @@ export default {
               }
             });
             const sprite = this.formationAirPiXiApp.stage.children[spriteIndex];
+            console.log(
+              this.formationInfoForm.longitude,
+              this.formationInfoForm.latitude
+            );
             const { x, y } = this.calculateXY(
               this.formationInfoForm.longitude,
               this.formationInfoForm.latitude
             );
             sprite.x = x;
             sprite.y = y;
-            // TODO 像素计算中是pixiCanvas
+            // TODO 边缘经纬度的数字要显示,或者需要设定画布大小
             this.drawerOpen = false;
           } else {
             let index = this.formationInfoList.findIndex(
@@ -1973,6 +2039,17 @@ export default {
       });
     },
 
+    ObjectStringToNumber(obj) {
+      for (let key in obj) {
+        const parsedValue = Number(obj[key]); // 尝试将值转换为数字
+        if (!isNaN(parsedValue)) {
+          // 检查是否是有效的数字
+          obj[key] = parsedValue; // 如果是数字,更新字段值
+        }
+      }
+      return obj;
+    },
+
     closeDialog() {
       const msg = "END:" + this.parameterId;
       this.webSocket.send(msg);
@@ -2064,6 +2141,7 @@ export default {
       this.platformGraphics = null;
       this.platformPathData = {};
       this.platformInfo = {};
+      this.platformData = [];
     },
   },
 };
@@ -2093,7 +2171,7 @@ export default {
 .right-board {
   padding: 2px;
   margin: 2px;
-  height: 750px;
-  overflow: auto; /* 当内容超出元素边界时显示滚动条 */
+  height: 800px;
+  /* 当内容超出元素边界时显示滚动条 */
 }
 </style>

BIN
uavps-web/src/views/textures/platform.png