From fdb2d71d2e593b36207799f396b104ef7a2c5d4d Mon Sep 17 00:00:00 2001 From: kerwincui <164770707@qq.com> Date: Fri, 10 Jun 2022 16:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=9C=B0=E5=9B=BE=E5=8D=95?= =?UTF-8?q?=E5=87=BB=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/src/views/index.vue | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/vue/src/views/index.vue b/vue/src/views/index.vue index fa95634d..b6d0dba5 100644 --- a/vue/src/views/index.vue +++ b/vue/src/views/index.vue @@ -152,7 +152,7 @@ - + @@ -327,7 +327,7 @@ - +
公告 信息 @@ -397,7 +397,7 @@ export default { // 设备列表 deviceList: [], // 设备统计信息 - deviceStatistic:{}, + deviceStatistic: {}, // 设备总数 deviceCount: 0, // emqx状态数据 @@ -447,7 +447,7 @@ export default { } }, /** 查询设备统计信息 */ - getDeviceStatistic(){ + getDeviceStatistic() { getDeviceStatistic().then(response => { this.deviceStatistic = response.data; }); @@ -465,11 +465,11 @@ export default { // 打开信息详情 openDetail(id) { this.open = true; - this.loading=true; + this.loading = true; getNotice(id).then(response => { this.notice = response.data; this.open = true; - this.loading=false; + this.loading = false; }); }, // 取消按钮 @@ -519,6 +519,19 @@ export default { var myChart = echarts.init(this.$refs.map); var option; + // 单击事件 + myChart.on('click', (params) => { + if (params.data.deviceId) { + this.$router.push({ + path: '/iot/device-edit', + query: { + t: Date.now(), + deviceId: params.data.deviceId, + } + }); + } + }); + // 格式化数据 let convertData = function (data, status) { var res = []; @@ -534,7 +547,8 @@ export default { firmwareVersion: data[i].firmwareVersion, networkAddress: data[i].networkAddress, productName: data[i].productName, - activeTime: data[i].activeTime, + activeTime: data[i].activeTime == null ? '' : data[i].activeTime, + deviceId: data[i].deviceId, }); } } @@ -598,7 +612,7 @@ export default { featureType: 'land', elementType: 'all', stylers: { - color: '#fafafa' // #fffff8 淡黄色 + color: '#fafafa' // #fffff8 淡黄色 } }, { @@ -951,7 +965,6 @@ export default {