Commit 9142674e authored by xinzhedeai's avatar xinzhedeai

fix:点位数量修改

parent 6da24588
......@@ -67,7 +67,7 @@ VITE_STORAGE_PREFIX=SOY_
# VITE_WEBSOCKET_URL=ws://192.168.2.16:9999
# VITE_SERVICE_URL=http://192.168.2.16:9998
# 开发环境(黄国安)
## 开发环境(黄国安)
VITE_VIDEO_URL=ws://192.168.2.14:9999
VITE_WEBSOCKET_URL=ws://192.168.2.14:9999
VITE_SERVICE_URL=http://192.168.2.14:9998
......
......@@ -131,13 +131,13 @@
<img src="../../../assets/jiankong1.png"
style="height: 80px; display: inline-block; border-radius: 50%; width: 80px; box-shadow: 0 0 10px rgba(0,0,0,.3);" />
<br />
<i>在线监控: {{ form[0] || 0 }}</i>
<i>在线监控: {{ form.online || 0 }}</i>
</div>
<div>
<img src="../../../assets/jiankong2.png"
style="height: 80px; display: inline-block; border-radius: 50%; width: 80px; box-shadow: 0 0 10px rgba(0,0,0,.3);" />
<br />
<i>离线监控: {{ form[1] || 0 }}</i>
<i>离线监控: {{ form.offline || 0 }}</i>
</div>
</div>
</div>
......@@ -693,13 +693,19 @@ const getCameraList = async () => {
});
};
const form = ref([]);
// 初始化响应式对象
const form = ref({});
const getLogData = async () => {
await api_pointsCount().then(res => {
if (res.data.code === 200) {
res.data.data.forEach(item => {
form.value.push(item.count)
if(item.status === 0){
form.value.online = item.count
}else{
form.value.offline = item.count
}
// form.value.push(item.count)
})
};
})
......
......@@ -231,7 +231,14 @@ const devData = ref({});
const getCardData = async () => {
await api_pointsCount().then(res => {
if (res.data.code === 200) {
devData.value = res.data.data;
// devData.value = res.data.data;
(res.data.data).forEach(item => {
if(item.status === 0){
devData.value.online = item.count
}else{
devData.value.offline = item.count
}
})
};
})
};
......@@ -517,7 +524,7 @@ onMounted(() => {
<div style="height: 100px; display: flex; justify-content: space-between; align-items: center;">
<div style="flex: 1; text-align: center;">
<div style="display: inline-block; font-size: 40px; font-weight: 500;">
{{ devData[0]?.count || 0 }}
{{ devData.online || 0 }}
</div>
<br />
<div style="display: inline-block;margin-top: 10px; margin-bottom: 20px;">
......@@ -526,7 +533,7 @@ onMounted(() => {
</div>
<div style="flex: 1; text-align: center;">
<div style="display: inline-block;font-size: 40px; font-weight: 500;">
{{ devData[1]?.count || 0 }}
{{ devData.offline || 0 }}
</div>
<br />
<div style="display: inline-block; margin-top: 10px; margin-bottom: 20px;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment