首页地图单击跳转

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: [],
// 设备统计信息
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,
});
}
}
@@ -951,7 +965,6 @@ export default {
</script>
<style lang="scss" scoped>
.description {
font-size: 14px;