From 60a73b52647237297a7226b14b2421079ccd4db1 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Mon, 20 Jul 2026 09:02:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/utils/request.js | 2 +- .../cockpit/components/ManualTakeover/RoboticArm.vue | 9 +++++++++ src/views/inspection/cockpit/index.vue | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0525e84..97afe9b 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@vueup/vue-quill": "1.2.0", "@vueuse/core": "10.11.0", "ace-builds": "^1.43.0", + "autofit.js": "^3.2.8", "axios": "0.28.1", "clipboard": "2.0.11", "dayjs": "^1.11.13", diff --git a/src/utils/request.js b/src/utils/request.js index 51cab29..829bd12 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -95,7 +95,7 @@ service.interceptors.response.use(res => { } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') } else if (code === 500) { - ElMessage({ message: msg, type: 'error' }) + ElMessage({ message: msg, grouping: true, type: 'error' }) return Promise.reject(new Error(msg)) } else if (code === 601) { ElMessage({ message: msg, type: 'warning' }) diff --git a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue index 3df6fe1..5c81dc8 100644 --- a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue +++ b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue @@ -167,6 +167,7 @@ const pose = ref({ const speed = ref(1) // 速度百分比,范围 0.1 - 5 +const errorNum = ref(0) /** * 获取机械臂末端状态信息 */ @@ -181,8 +182,16 @@ const getPose = async (robot) => { pose.value = { x, y, z, rx, ry, rz } } else { console.error('获取姿态失败:', res.message) + errorNum.value++ + if (errorNum.value > 3) { + clearInterval(timer.value) + } } } catch (error) { + errorNum.value++ + if (errorNum.value > 3) { + clearInterval(timer.value) + } console.error('获取姿态失败:', error) } } diff --git a/src/views/inspection/cockpit/index.vue b/src/views/inspection/cockpit/index.vue index cdacc2b..916636b 100644 --- a/src/views/inspection/cockpit/index.vue +++ b/src/views/inspection/cockpit/index.vue @@ -16,6 +16,9 @@ import MapOverview from './components/MapOverview.vue'; import ManualTakeover from './components/ManualTakeover/index.vue'; import Monitor from './components/Monitor.vue'; +// import autofit from 'autofit.js' +// autofit.init() + const currentPage = ref('home') const activePage = (page) => {