From d198189d2cc957879e8995ac17e2c7b1d603368b Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Mon, 1 Jun 2026 11:04:18 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E7=82=B9=E4=BD=8D=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=92=8C=E6=9C=BA=E5=99=A8=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/inspection/map.js | 33 +
src/api/inspection/robot.js | 32 +
src/main.js | 2 +-
src/store/modules/inspection.js | 2 +-
.../cockpit/components/MapCanvas.vue | 2 +-
src/views/inspection/flow/index.vue | 308 ++++++++-
src/views/inspection/map/index.vue | 624 ++++++++++--------
src/views/inspection/robot/index.vue | 159 +++--
vite.config.js | 4 +-
9 files changed, 857 insertions(+), 309 deletions(-)
create mode 100644 src/api/inspection/map.js
create mode 100644 src/api/inspection/robot.js
diff --git a/src/api/inspection/map.js b/src/api/inspection/map.js
new file mode 100644
index 0000000..ec8c562
--- /dev/null
+++ b/src/api/inspection/map.js
@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+
+
+export function getMapList(params) {
+ return request({
+ url: '/inspection/map/list',
+ method: 'get',
+ params: params
+ })
+}
+
+export function addMap(data) {
+ return request({
+ url: '/inspection/map',
+ method: 'post',
+ data: data
+ })
+}
+
+export function updateMap(data) {
+ return request({
+ url: '/inspection/map',
+ method: 'put',
+ data: data
+ })
+}
+
+export function deleteMap(id) {
+ return request({
+ url: `/inspection/map/${id}`,
+ method: 'delete'
+ })
+}
\ No newline at end of file
diff --git a/src/api/inspection/robot.js b/src/api/inspection/robot.js
new file mode 100644
index 0000000..8844e22
--- /dev/null
+++ b/src/api/inspection/robot.js
@@ -0,0 +1,32 @@
+import request from '@/utils/request'
+
+export function getRobotList(params) {
+ return request({
+ url: '/inspection/robot/list',
+ method: 'get',
+ params: params
+ })
+}
+
+export function addRobot(data) {
+ return request({
+ url: '/inspection/robot',
+ method: 'post',
+ data: data
+ })
+}
+
+export function updateRobot(data) {
+ return request({
+ url: '/inspection/robot',
+ method: 'put',
+ data: data
+ })
+}
+
+export function deleteRobot(id) {
+ return request({
+ url: `/inspection/robot/${id}`,
+ method: 'delete'
+ })
+}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index f52695b..5630a13 100644
--- a/src/main.js
+++ b/src/main.js
@@ -88,7 +88,7 @@ app.use(ElementPlus, {
app.use(WebSocketPlugin, {
// url: import.meta.env.VITE_WS_URL,
- url: 'ws://192.168.0.100:13080/ws',
+ url: 'ws://192.168.0.114:13080/ws',
// url: 'ws://10.148.209.5:13080/ws',
userId: 'your_user_id'
});
diff --git a/src/store/modules/inspection.js b/src/store/modules/inspection.js
index f9b12fc..08efa03 100644
--- a/src/store/modules/inspection.js
+++ b/src/store/modules/inspection.js
@@ -9,7 +9,7 @@ export const useInspectionStore = defineStore('inspection', {
camera: { // 相机参数
centerX: 0, // 相机中心的世界坐标 X
centerY: 0, // 相机中心的世界坐标 Y
- pixelsPerMeter: 40, // 缩放:每米对应的屏幕像素数
+ pixelsPerMeter: 20, // 缩放:每米对应的屏幕像素数
},
canvasWidthPx: 0, // Canvas CSS 逻辑宽度(像素)
canvasHeightPx: 0, // Canvas CSS 逻辑高度(像素)
diff --git a/src/views/inspection/cockpit/components/MapCanvas.vue b/src/views/inspection/cockpit/components/MapCanvas.vue
index bf6ebb1..0cfffc6 100644
--- a/src/views/inspection/cockpit/components/MapCanvas.vue
+++ b/src/views/inspection/cockpit/components/MapCanvas.vue
@@ -153,7 +153,7 @@ async function loadMapIntoApplication(parsedMap) {
const worldHeightMeters = parsedMap.maxY - parsedMap.originY; // 地图世界高度
const fitScaleX = inspectionStore.canvasWidthPx / worldWidthMeters; // 水平方向恰好填满的缩放
const fitScaleY = inspectionStore.canvasHeightPx / worldHeightMeters; // 垂直方向恰好填满的缩放
- inspectionStore.camera.pixelsPerMeter = Math.max(1, Math.min(fitScaleX, fitScaleY) * 0.88); // 取较小值并留12%边距
+ inspectionStore.camera.pixelsPerMeter = Math.max(1, Math.min(fitScaleX, fitScaleY) * 1); // 取较小值
// 标记加载完成并更新UI
applicationState.isMapLoaded = true;
diff --git a/src/views/inspection/flow/index.vue b/src/views/inspection/flow/index.vue
index 1e21e79..6531b30 100644
--- a/src/views/inspection/flow/index.vue
+++ b/src/views/inspection/flow/index.vue
@@ -1,3 +1,307 @@
-