From 2892d4bd869d6a32220cbc271e4599a7455ae864 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Sun, 29 Sep 2024 16:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=BD=E5=B7=A5=E7=AE=A1=E6=8E=A7=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/personManage/personManage.vue | 47 ++++++++----------- .../manage/realTimeManage/realTimeManage.vue | 6 +-- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/views/construction/manage/personManage/personManage.vue b/src/views/construction/manage/personManage/personManage.vue index 058bf47..f40588d 100644 --- a/src/views/construction/manage/personManage/personManage.vue +++ b/src/views/construction/manage/personManage/personManage.vue @@ -289,17 +289,7 @@ export default { // 预警表格 warnTable: [], //保存表格数据 - hatTable: [ - { - name: '张三', - devName: '1号智能安全帽' - }, - { - name: '张三', - devName: '1号智能安全帽' - } - ], - + hatTable: [], //保存对话框隐藏展示 dialogVisible1: false, dialogVisible2: false, @@ -356,10 +346,8 @@ export default { this.idArr.push(this.checkNodeId); } if (this.checkNodeLevel === 2) { // 杆塔 - // this.$message('刷新杆塔选中的数据'); this.loadWorkInfo(); } else if (this.checkNodeLevel === 3) { // 班组 - // this.$message('刷新班组选中的数据'); this.removeOverlay(); const obj = { 'id': this.checkNodeTowerId, @@ -367,7 +355,6 @@ export default { } this.loadPersonsInfo(obj, null); } else if (this.checkNodeLevel === 4) { // 班组人员 - // this.$message('刷新班组人员选中的数据'); if (!this.isShowHistoryGj) { this.removeOverlay(); const obj = { @@ -420,14 +407,6 @@ export default { }, /* 人员树过滤 */ filterNode(value, data, node) { - /* if (!value) { - if (node.level == 1 || node.level == 2) { - node.expanded = true - } else { - node.expanded = false - } - return true - } */ // 查询列表是否有匹配数据 let val = value.toLowerCase() return this.chooseNode(val, data, node) @@ -606,8 +585,8 @@ export default { }).catch((res) => { }) }, // 人员树选中人员加载的数据 - loadPersonDetail(params) { - getPersonDetail(params).then((res) => { + async loadPersonDetail(params) { + await getPersonDetail(params).then((res) => { const data = res.data; if (data && data.vo) { const obj = data.vo; @@ -632,13 +611,13 @@ export default { }).catch((res) => { }) }, // 人员历史轨迹 - loadHistoryGj() { + async loadHistoryGj() { // 手环设备ID和开始时间 let obj = { 'id': this.person.sh.devId, 'startTime': this.chooseDate }; - getHistoryGj(obj).then((res) => { + await getHistoryGj(obj).then((res) => { const data = res.data; if (data && data.length > 0) { this.gjArr = data; @@ -710,7 +689,16 @@ export default { this.checkTeamId = teamId; this.checkNodeTowerId = towerId; this.checkPersonObj = _.cloneDeep(data); - this.loadPersonsInfo(obj, data); + if (this.isShowHistoryGj) { + // 历史轨迹打开,只切换历史轨迹数据 + const obj = { + 'id': data.type === 0 ? parseInt(data.id.replace('zs-', '')) : parseInt(data.id.replace('ls-', '')), + 'type': data.type + } + this.relaodHistoryGj(obj); + } else { + this.loadPersonsInfo(obj, data); + } } else { // 选中班组人员 触发事件 this.clickMarker(data); @@ -722,6 +710,11 @@ export default { this.removeOverlay(); } }, + async relaodHistoryGj(obj){ + this.removeOverlay(); + await this.loadPersonDetail(obj); + await this.loadHistoryGj(); + }, // 清除百度地图覆盖物 removeOverlay() { this.map.clearOverlays(); diff --git a/src/views/construction/manage/realTimeManage/realTimeManage.vue b/src/views/construction/manage/realTimeManage/realTimeManage.vue index 4d7a568..10dbf55 100644 --- a/src/views/construction/manage/realTimeManage/realTimeManage.vue +++ b/src/views/construction/manage/realTimeManage/realTimeManage.vue @@ -76,7 +76,7 @@
-
@@ -186,8 +186,8 @@ export default { }, methods: { startRefresh() { - // 每10分钟刷新一次 - this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10); + // 每5分钟刷新一次 + this.intervalId = setInterval(this.refreshData, 1000 * 60 * 5); }, stopRefresh() { if (this.intervalId) {