fix: 看板ws模块接入

This commit is contained in:
TsMask
2024-01-26 17:35:27 +08:00
parent 308a66b925
commit dd8c4ea343
5 changed files with 354 additions and 78 deletions

View File

@@ -3,7 +3,7 @@ import { onMounted, reactive, ref } from 'vue';
import useI18n from '@/hooks/useI18n';
import Topology from './components/Topology/index.vue';
import NeResources from './components/NeResources/index.vue';
import CDREvent from './components/CDREvent/index.vue';
import UEEvent from './components/UEEvent/index.vue';
import AlarnDayLine from './components/AlarnDayLine/index.vue';
import AlarnTypeBar from './components/AlarnTypeBar/index.vue';
import UPFFlow from './components/UPFFlow/index.vue';
@@ -14,9 +14,11 @@ import { listBase5G } from '@/api/neUser/base5G';
import { formatBytes } from '@/utils/parse-utils';
import { graphNodeClickID } from './hooks/useTopology';
import { useFullscreen } from '@vueuse/core';
import useWS from './hooks/useWS';
import useAppStore from '@/store/modules/app';
const appStore = useAppStore();
const { t } = useI18n();
const { wsSend, wsInitData } = useWS();
/**用户在线信息 */
let onlineInfo: {
@@ -61,27 +63,30 @@ onMounted(() => {
}),
listUPFIndex(),
listUENum('001'),
]).then(resArr => {
if (resArr[0].status === 'fulfilled') {
onlineInfo.subNum = resArr[0].value.total;
}
if (resArr[1].status === 'fulfilled') {
resArr[1].value['data'].map((item: any) => {
switch (item.kpiId) {
case 'UPF.03':
upfFlowInfo.up = item.Total;
break;
case 'UPF.06':
upfFlowInfo.down = item.Total;
}
});
}
])
.then(resArr => {
if (resArr[0].status === 'fulfilled') {
onlineInfo.subNum = resArr[0].value.total;
}
if (resArr[1].status === 'fulfilled') {
resArr[1].value['data'].map((item: any) => {
switch (item.kpiId) {
case 'UPF.03':
upfFlowInfo.up = item.Total;
break;
case 'UPF.06':
upfFlowInfo.down = item.Total;
}
});
}
if (resArr[2].status === 'fulfilled') {
console.log(resArr)
}
});
if (resArr[2].status === 'fulfilled') {
console.log(resArr);
}
})
.finally(() => {
wsInitData();
});
});
</script>
@@ -186,14 +191,14 @@ onMounted(() => {
<!-- 数据 -->
<div class="data">
<div class="item">
<h4>{{formatBytes(upfFlowInfo.up)}} </h4>
<h4>{{ formatBytes(upfFlowInfo.up) }}</h4>
<span>
<ArrowUpOutlined style="color: #ed3f35" />
上行
</span>
</div>
<div class="item">
<h4>{{formatBytes(upfFlowInfo.down)}} </h4>
<h4>{{ formatBytes(upfFlowInfo.down) }}</h4>
<span>
<ArrowDownOutlined style="color: #eacf19" />
下行
@@ -221,7 +226,7 @@ onMounted(() => {
<WhatsAppOutlined style="color: #d93f36" />&nbsp;&nbsp; 会话监控
</h3>
<div class="chart">
<CDREvent />
<UEEvent />
</div>
</div>
</div>