|
@ -205,10 +205,21 @@ |
|
|
|
|
|
|
|
|
import { dict, getEnum } from '/@/api'; |
|
|
import { dict, getEnum } from '/@/api'; |
|
|
import dayjs from 'dayjs'; |
|
|
import dayjs from 'dayjs'; |
|
|
|
|
|
|
|
|
|
|
|
// 全局变量 |
|
|
|
|
|
import { items } from '/@/store/item'; |
|
|
|
|
|
|
|
|
defineOptions({ |
|
|
defineOptions({ |
|
|
name: 'AggregateData', // 与页面路由name一致缓存才可生效 |
|
|
name: 'AggregateData', // 与页面路由name一致缓存才可生效 |
|
|
}); |
|
|
}); |
|
|
const loading = ref(false); |
|
|
let statusLoading = ref(false); |
|
|
|
|
|
|
|
|
|
|
|
let averageLoading = ref(false); |
|
|
|
|
|
|
|
|
|
|
|
let hotLoading = ref(false); |
|
|
|
|
|
|
|
|
|
|
|
// 全局变量 |
|
|
|
|
|
const state = items(); |
|
|
// 采集频率 |
|
|
// 采集频率 |
|
|
const frequencyValue = ref<string>(); |
|
|
const frequencyValue = ref<string>(); |
|
|
|
|
|
|
|
@ -241,7 +252,10 @@ |
|
|
|
|
|
|
|
|
// 获取设备状态 |
|
|
// 获取设备状态 |
|
|
const getDeviceStatus = () => { |
|
|
const getDeviceStatus = () => { |
|
|
http.post(environmentMonitor.getDeviceStatus, { orgId: orgId.value }).then((res) => { |
|
|
statusLoading.value = true; |
|
|
|
|
|
http |
|
|
|
|
|
.post(environmentMonitor.getDeviceStatus, { orgId: orgId.value }) |
|
|
|
|
|
.then((res) => { |
|
|
ringData.value = [ |
|
|
ringData.value = [ |
|
|
{ |
|
|
{ |
|
|
name: '在线', |
|
|
name: '在线', |
|
@ -256,10 +270,17 @@ |
|
|
]; |
|
|
]; |
|
|
sum.value = res.data.在线 + res.data.离线; |
|
|
sum.value = res.data.在线 + res.data.离线; |
|
|
// drawRing(ringData.value); |
|
|
// drawRing(ringData.value); |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
statusLoading.value = false; |
|
|
|
|
|
if (!statusLoading.value && !averageLoading.value && !hotLoading.value) { |
|
|
|
|
|
state.setLoading(false); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
// 获取平均值 |
|
|
// 获取平均值 |
|
|
const getAverageData = () => { |
|
|
const getAverageData = () => { |
|
|
|
|
|
averageLoading.value = true; |
|
|
const now = new Date(); |
|
|
const now = new Date(); |
|
|
const year = now.getFullYear(); |
|
|
const year = now.getFullYear(); |
|
|
// getMonth() 返回的月份是从0开始的,所以需要加1 |
|
|
// getMonth() 返回的月份是从0开始的,所以需要加1 |
|
@ -319,6 +340,12 @@ |
|
|
'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0Ny45OTYiIGhlaWdodD0iNDguMDAxIiB2aWV3Qm94PSIwIDAgNDcuOTk2IDQ4LjAwMSI+DQogIDxwYXRoIGlkPSLlh4/ljrtfMTA3OCIgZGF0YS1uYW1lPSLlh4/ljrsgMTA3OCIgZD0iTS0xNjU5Ni05YTIzLjg0LDIzLjg0LDAsMCwxLTE2Ljk2Ny03LjAyOUEyMy44MzEsMjMuODMxLDAsMCwxLTE2NjIwLTMzYTIzLjg0NSwyMy44NDUsMCwwLDEsNy4wMjUtMTYuOTczQTIzLjg0MSwyMy44NDEsMCwwLDEtMTY1OTYtNTdoLjAwOGEyMy44MzIsMjMuODMyLDAsMCwxLDE2Ljk2NSw3LjAyOUEyMy44NDUsMjMuODQ1LDAsMCwxLTE2NTcyLTMzYTIzLjg0MywyMy44NDMsMCwwLDEtNy4wMjksMTYuOTcxQTIzLjg0NSwyMy44NDUsMCwwLDEtMTY1OTYtOVptLTIuODQ0LTM0LjIyNGgtLjAxYTEuMjA2LDEuMjA2LDAsMCwwLS45My4zOTJjLS4xMDcuMTE5LS42NjIuNzI4LTEuMjA1LDEuMzkzbC0uMDQzLjA1MmMtMS43OTUsMi4xODQtNS45NjksNy42LTUuOTY5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jc2LS41MTguNTcybC0uMDI1LjAyOWMtLjc2Ni44ODktMi41NDksMy4wOTEtMi41NDksNC4zNDZhMy4yNzEsMy4yNzEsMCwwLDAsMS4xNiwyLjU2NSwzLjY3NywzLjY3NywwLDAsMCwyLjMzMi44NTloLjAyMWEzLjc0NiwzLjc0NiwwLDAsMCwyLjI4OS0uODQzLDMuMzc4LDMuMzc4LDAsMCwwLDEuMTc2LTIuNTY1YzAtMS41MDYtMi40ODItNC4yOTMtMi41MDYtNC4zMjEsMCwwLS40MzItLjUxLS42LS42NTlBLjU5LjU5LDAsMCwwLTE2NTg4Ljc2OC00NFptLTguNTYxLDE4LjIyNWEuNjM3LjYzNywwLDAsMS0uNjMxLS4zMWMtLjItLjQ0NS4zLTEuMjExLDEuMTI3LTEuNzA2YTIuNTM5LDIuNTM5LDAsMCwxLDEuMjMtLjQuNjQzLjY0MywwLDAsMSwuNjM1LjMxM2MuMi40NDUtLjMsMS4yMDktMS4xMjcsMS43QTIuNTYsMi41NiwwLDAsMS0xNjU5Ny4zMjgtMjUuNzc2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTY2MTkuOTk4IDU3LjAwMikiIGZpbGw9IiMyNzc4ZmYiLz4NCjwvc3ZnPg0K', |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
averageLoading.value = false; |
|
|
|
|
|
if (!statusLoading.value && !averageLoading.value && !hotLoading.value) { |
|
|
|
|
|
state.setLoading(false); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
// 获取区域数据 |
|
|
// 获取区域数据 |
|
@ -336,6 +363,7 @@ |
|
|
|
|
|
|
|
|
// 获取热力图数据 |
|
|
// 获取热力图数据 |
|
|
const getDeviceHotMap = () => { |
|
|
const getDeviceHotMap = () => { |
|
|
|
|
|
hotLoading.value = true; |
|
|
let environmentType = ''; |
|
|
let environmentType = ''; |
|
|
for (let i = 0; i < typeList.value.length; i++) { |
|
|
for (let i = 0; i < typeList.value.length; i++) { |
|
|
if (typeList.value[i].value == typeValue.value) { |
|
|
if (typeList.value[i].value == typeValue.value) { |
|
@ -356,10 +384,18 @@ |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
let hotData = res.data; |
|
|
let hotData = res.data; |
|
|
drawHot(hotData); |
|
|
drawHot(hotData); |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
hotLoading.value = false; |
|
|
|
|
|
if (!statusLoading.value && !averageLoading.value && !hotLoading.value) { |
|
|
|
|
|
state.setLoading(false); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const initOptions = () => {}; |
|
|
const initOptions = () => { |
|
|
|
|
|
state.setLoading(true); |
|
|
|
|
|
}; |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
initOptions(); |
|
|
initOptions(); |
|
|
//获取设备状态 |
|
|
//获取设备状态 |
|
|