From a4906b348eb0e80067a990dc24b7b5e51f0b8825 Mon Sep 17 00:00:00 2001 From: zhangyao Date: Tue, 4 Jul 2023 14:30:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=AF=BB=E8=BD=A6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/offline/JSON/GetDevCoordinateByIP.json | 2 +- public/static/qm/MainMap_QM.js | 12 +++++++----- src/components/HomeDialog/HomeDialog.vue | 4 ++-- src/composables/useFindCar.ts | 6 +++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/public/static/offline/JSON/GetDevCoordinateByIP.json b/public/static/offline/JSON/GetDevCoordinateByIP.json index 4d8fc37..9cf596c 100644 --- a/public/static/offline/JSON/GetDevCoordinateByIP.json +++ b/public/static/offline/JSON/GetDevCoordinateByIP.json @@ -16,7 +16,7 @@ "ip": "192.168.1.209", "mac": "4CEDFBCAFF27", "location": "30", - "angle": "90", + "angle": "135", "projectCode": "project-n-ww5jvpwnu0ads70lbkda" } } diff --git a/public/static/qm/MainMap_QM.js b/public/static/qm/MainMap_QM.js index fff4a7e..0552eee 100644 --- a/public/static/qm/MainMap_QM.js +++ b/public/static/qm/MainMap_QM.js @@ -2158,6 +2158,7 @@ MainMap_QM.prototype = { }, onInnerMeDir: function () { this.changeMapModel("2D"); + Map_QM.controls.reset(); Map_QM.controls.maxPolarAngle = 0 Map_QM.controls.minPolarAngle = 0 if (Map_QM.util.pathStateObj.isPathState) { @@ -2171,8 +2172,10 @@ MainMap_QM.prototype = { Map_QM.controls.target = new THREE.Vector3(0, 0, 0) } Map_QM.controls.setZoom(Map_QM.util.options.camZoom) - Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - Map_QM.controls.enableRotate = false + setTimeout(()=>{ + Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) + Map_QM.controls.enableRotate = false + },50); }, changeMapModel: function (model) { if (model == "2D") { @@ -2646,9 +2649,8 @@ MainMap_QM.prototype = { * */ rotationAngle: function (angle) { - if(Math.abs(parseInt(angle)+Map_QM.controls.getRotateHorizontal()*180/Math.PI)>5){ - Map_QM.controls.setRotateHorizontal((angle / 180) * Math.PI) - } + Map_QM.controls.setRotateHorizontal(Map_QM.controls.getRotateHorizontal()); + Map_QM.controls.setRotateHorizontal((angle / 180) * Math.PI) }, /** * @api {方法} rotateAngle(angle) 改变垂直角度 diff --git a/src/components/HomeDialog/HomeDialog.vue b/src/components/HomeDialog/HomeDialog.vue index f808c31..c5de3c0 100644 --- a/src/components/HomeDialog/HomeDialog.vue +++ b/src/components/HomeDialog/HomeDialog.vue @@ -51,9 +51,9 @@ function move() { // } // console.log('x,y :>> ', x, y) tip.value.style.transform = `translate(${x}px,${y}px)` //移动它的位置 - i += 0.75 //随意设置,与快慢有关,但也会影响35行判断到达最大移动距离时改变颜色,因为它可能加不到等于最大距离的时候 + i += 1 //随意设置,与快慢有关,但也会影响35行判断到达最大移动距离时改变颜色,因为它可能加不到等于最大距离的时候 //假如最大距离为10,i+=3,那i的值只能为3,6,9,12...则进不了改变颜色那个条件,则到达右边时不会改变颜色 - j += 0.75 + j += 1 x = i y = j if (i >= winWidth) { diff --git a/src/composables/useFindCar.ts b/src/composables/useFindCar.ts index ea52549..2f06873 100644 --- a/src/composables/useFindCar.ts +++ b/src/composables/useFindCar.ts @@ -31,7 +31,11 @@ export const useFindCar = () => { } return } - Message({ text: msg, type: 'success' }) + if (msg) { + Message({ text: msg, type: 'success' }) + } else { + Message({ type: 'success', text: '未能获取数据,请稍后重试!' }) + } } catch (error) { Message({ text: error as string, type: 'success' }) } finally {