From 98495e2521c4a04a9dd7bc1001b6936f8778753e Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Wed, 27 Aug 2025 17:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.js | 3 ++- src/i18n/langs/zh.js | 5 +++-- src/pages/modules/building.vue | 30 ++++++++++++++++++++++++++++-- src/pages/modules/gl-map-2.vue | 6 ------ src/pages/shells/index.vue | 6 +++--- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/i18n/langs/en.js b/src/i18n/langs/en.js index 1a433d5..7058c3c 100644 --- a/src/i18n/langs/en.js +++ b/src/i18n/langs/en.js @@ -99,5 +99,6 @@ module.exports = { AttreconnectWebSocket: 'Attempting to reconnect to WebSocket...', PicturesTexts: 'Illustration with Pictures and Texts', VideoInstructions: 'Video Instructions', - Handmethod: 'Handling method' + Handmethod: 'Handling method', + stationnotcommas: 'The station name cannot contain English commas.' } diff --git a/src/i18n/langs/zh.js b/src/i18n/langs/zh.js index d237937..d165637 100644 --- a/src/i18n/langs/zh.js +++ b/src/i18n/langs/zh.js @@ -83,7 +83,7 @@ module.exports = { driverTxt2: '移动到工位点时,点击打点按钮记录当前车辆所在位置为工位点。', driverTxt3: '完成建图,点击结束建图按钮,等待地图自动生成。', carbuildingmap: '小车正在建图中', - errorbuildingredone: '建图出现错误,需要重新建图', + errorbuildingredone: '图', sureendbuilding: '确定是否结束建图?', endbuildingcancel: '已取消结束建图', errorendbuilding: '结束建图出现错误', @@ -99,5 +99,6 @@ module.exports = { AttreconnectWebSocket: '尝试重新连接 WebSocket...', PicturesTexts: '图文说明', VideoInstructions: '视频说明', - Handmethod: '处理方法' + Handmethod: '处理方法', + stationnotcommas: '站点名称不能包含英文逗号' } diff --git a/src/pages/modules/building.vue b/src/pages/modules/building.vue index d9f734c..2ae9476 100644 --- a/src/pages/modules/building.vue +++ b/src/pages/modules/building.vue @@ -16,14 +16,14 @@ :title="$t('SetUpStation')" :visible.sync="dialogVisible" width="55%"> - + - + @@ -97,6 +97,13 @@ export default { } }, data () { + const validateStationName = (rule, value, callback) => { + if (value && value.includes(',')) { + callback(new Error(this.$t('stationnotcommas'))); + } else { + callback(); + } + } return { driver: null, driverActive: true, @@ -107,6 +114,12 @@ export default { stationCode: '', stationName: '' }, + dataRule: { + stationName: [ + { validator: validateStationName, trigger: 'blur' } + ] + }, + submitSuccess: false, keyPoints: [], disabled: false, message: '', // 用于显示消息 @@ -241,6 +254,19 @@ export default { this.dataForm.stationName = `${na}${this.keyPoints.length + 1}` }, // 打点->保存 + stationConfirm () { + this.$refs.dataForm.validate((valid) => { + if (valid) { + this.submitSuccess = true + this._setStation() + setTimeout(() => { + this.submitSuccess = false + }, 3000) + } else { + return false + } + }) + }, async _setStation () { this.disabled = true try { diff --git a/src/pages/modules/gl-map-2.vue b/src/pages/modules/gl-map-2.vue index 86381b8..d242726 100644 --- a/src/pages/modules/gl-map-2.vue +++ b/src/pages/modules/gl-map-2.vue @@ -416,9 +416,6 @@ export default { this.calculateCarSize() }, - // 核心修改:移除响应式调整逻辑,不再处理窗口大小变化 - // handleResize() { ... }, - startAnimationLoop() { const animate = () => { this.animationId = requestAnimationFrame(animate) @@ -482,9 +479,6 @@ export default { this.carTexture = null } - // 移除窗口大小变化监听 - window.removeEventListener('resize', this.handleResize) - this.camera = null this.carMesh = null this.pointCloudMesh = null diff --git a/src/pages/shells/index.vue b/src/pages/shells/index.vue index 8573248..e69fb58 100644 --- a/src/pages/shells/index.vue +++ b/src/pages/shells/index.vue @@ -80,7 +80,7 @@ export default { theta: 0.9073792099952698, // 车辆航向角 x: 0.004027, // 车辆x坐标 y: -0.001812, // 车辆y坐标 - task_seq: '点位1-点位2-顶顶位3-point layout location-顶地方的方法顶顶顶点位3', + task_seq: '点位1,点位2,work point 3,顶地方的方法顶顶顶点位3', task_point: '点位2', anomalyLevel: 1, errorData: [ @@ -127,7 +127,7 @@ export default { created () { // this.$store.dispatch('setAgvObj', this.topInfo) // if (this.topInfo.task_seq) { - // this.taskSeq = this.topInfo.task_seq.split('-') + // this.taskSeq = this.topInfo.task_seq.split(',') // const target = this.topInfo.task_point // this.currentStep = this.taskSeq.findIndex(item => item === target) // } else { @@ -212,7 +212,7 @@ export default { if (this.reconnectTimer) clearTimeout(this.reconnectTimer) this.topInfo = res.data if (this.topInfo.task_seq) { - this.taskSeq = this.topInfo.task_seq.split('-') + this.taskSeq = this.topInfo.task_seq.split(',') const target = this.topInfo.task_point this.currentStep = this.taskSeq.findIndex(item => item === target) } else {