首页地图单击跳转

This commit is contained in:
kerwincui
2022-06-10 16:10:29 +08:00
parent a8f6dcf882
commit fdb2d71d2e

View File

@@ -397,7 +397,7 @@ export default {
// 设备列表 // 设备列表
deviceList: [], deviceList: [],
// 设备统计信息 // 设备统计信息
deviceStatistic:{}, deviceStatistic: {},
// 设备总数 // 设备总数
deviceCount: 0, deviceCount: 0,
// emqx状态数据 // emqx状态数据
@@ -447,7 +447,7 @@ export default {
} }
}, },
/** 查询设备统计信息 */ /** 查询设备统计信息 */
getDeviceStatistic(){ getDeviceStatistic() {
getDeviceStatistic().then(response => { getDeviceStatistic().then(response => {
this.deviceStatistic = response.data; this.deviceStatistic = response.data;
}); });
@@ -465,11 +465,11 @@ export default {
// 打开信息详情 // 打开信息详情
openDetail(id) { openDetail(id) {
this.open = true; this.open = true;
this.loading=true; this.loading = true;
getNotice(id).then(response => { getNotice(id).then(response => {
this.notice = response.data; this.notice = response.data;
this.open = true; this.open = true;
this.loading=false; this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
@@ -519,6 +519,19 @@ export default {
var myChart = echarts.init(this.$refs.map); var myChart = echarts.init(this.$refs.map);
var option; 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) { let convertData = function (data, status) {
var res = []; var res = [];
@@ -534,7 +547,8 @@ export default {
firmwareVersion: data[i].firmwareVersion, firmwareVersion: data[i].firmwareVersion,
networkAddress: data[i].networkAddress, networkAddress: data[i].networkAddress,
productName: data[i].productName, productName: data[i].productName,
activeTime: data[i].activeTime, activeTime: data[i].activeTime == null ? '' : data[i].activeTime,
deviceId: data[i].deviceId,
}); });
} }
} }
@@ -951,7 +965,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.description { .description {
font-size: 14px; font-size: 14px;