fix: 看板Hooks数据复位
This commit is contained in:
@@ -129,6 +129,9 @@ function handleRanderGraph(
|
||||
var observer = new ResizeObserver(function (entries) {
|
||||
// 当元素大小发生变化时触发回调函数
|
||||
entries.forEach(function (entry) {
|
||||
if (!graphG6.value) {
|
||||
return;
|
||||
}
|
||||
graphG6.value.changeSize(
|
||||
entry.contentRect.width,
|
||||
entry.contentRect.height - 30
|
||||
|
||||
@@ -158,3 +158,15 @@ export function neStateParse(neType: string, data: Record<string, any>) {
|
||||
// 请求标记复位
|
||||
neStateRequestMap.value.set(neType, false);
|
||||
}
|
||||
|
||||
/**属性复位 */
|
||||
export function topologyReset() {
|
||||
graphState.data = {
|
||||
combos: [],
|
||||
edges: [],
|
||||
nodes: [],
|
||||
};
|
||||
graphG6.value = null;
|
||||
graphNodeClickID.value = 'UPF';
|
||||
neStateRequestMap.value = new Map();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { parseSizeFromBits, parseSizeFromKbs } from '@/utils/parse-utils';
|
||||
import { ref } from 'vue';
|
||||
|
||||
/**UPF-流量数据 */
|
||||
export const upfFlowData = ref<{
|
||||
type FDType = {
|
||||
/**时间 */
|
||||
lineXTime: string[];
|
||||
/**上行 N3 */
|
||||
@@ -11,7 +10,10 @@ export const upfFlowData = ref<{
|
||||
lineYDown: number[];
|
||||
/**容量 */
|
||||
cap: number;
|
||||
}>({
|
||||
};
|
||||
|
||||
/**UPF-流量数据 */
|
||||
export const upfFlowData = ref<FDType>({
|
||||
lineXTime: [],
|
||||
lineYUp: [],
|
||||
lineYDown: [],
|
||||
@@ -74,3 +76,32 @@ export function upfTFParse(data: Record<string, string>) {
|
||||
|
||||
/**UPF-总流量数 选中 */
|
||||
export const upfTFActive = ref<number>(0);
|
||||
|
||||
/**属性复位 */
|
||||
export function upfTotalFlowReset() {
|
||||
upfFlowData.value = {
|
||||
lineXTime: [],
|
||||
lineYUp: [],
|
||||
lineYDown: [],
|
||||
cap: 0,
|
||||
};
|
||||
upfTotalFlow.value = [
|
||||
// 0天 当天24小时
|
||||
{
|
||||
up: '0 B',
|
||||
down: '0 B',
|
||||
requestFlag: false,
|
||||
},
|
||||
{
|
||||
up: '0 B',
|
||||
down: '0 B',
|
||||
requestFlag: false,
|
||||
},
|
||||
{
|
||||
up: '0 B',
|
||||
down: '0 B',
|
||||
requestFlag: false,
|
||||
},
|
||||
];
|
||||
upfTFActive.value = 0;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
/**UE事件数据 */
|
||||
export const ueEventData = ref<Record<string, any>[]>([]);
|
||||
|
||||
/**UE事件总量 */
|
||||
export const ueEventTotal = ref<number>(0);
|
||||
|
||||
/**UE事件推送id */
|
||||
export const ueEventId = ref<string>('');
|
||||
|
||||
/**ueEvent UE会话事件 数据解析 */
|
||||
export function ueEventParse(item: Record<string, any>) {
|
||||
let evData: Record<string, any> = item.eventJSON;
|
||||
@@ -29,15 +20,6 @@ export function ueEventParse(item: Record<string, any>) {
|
||||
};
|
||||
}
|
||||
|
||||
/**CDR事件数据 */
|
||||
export const cdrEventData = ref<Record<string, any>[]>([]);
|
||||
|
||||
/**CDR事件总量 */
|
||||
export const cdrEventTotal = ref<number>(0);
|
||||
|
||||
/**CDR事件推送id */
|
||||
export const cdrEventId = ref<string>('');
|
||||
|
||||
/**cdrEvent CDR会话事件 数据解析 */
|
||||
export function cdrEventParse(item: Record<string, any>) {
|
||||
let evData: Record<string, any> = item.cdrJSON || item.CDR;
|
||||
@@ -69,3 +51,10 @@ export const eventData = ref<Record<string, any>[]>([]);
|
||||
export const eventTotal = ref<number>(0);
|
||||
/**CDR/UE事件推送id */
|
||||
export const eventId = ref<string>('');
|
||||
|
||||
/**属性复位 */
|
||||
export function userActivityReset() {
|
||||
eventData.value = [];
|
||||
eventTotal.value = 0;
|
||||
eventId.value = '';
|
||||
}
|
||||
|
||||
@@ -7,9 +7,15 @@ import {
|
||||
eventData,
|
||||
eventTotal,
|
||||
eventId,
|
||||
userActivityReset,
|
||||
} from './useUserActivity';
|
||||
import { upfTotalFlow, upfTFParse, upfFlowParse } from './useUPFTotalFlow';
|
||||
import { neStateParse } from './useTopology';
|
||||
import {
|
||||
upfTotalFlow,
|
||||
upfTFParse,
|
||||
upfFlowParse,
|
||||
upfTotalFlowReset,
|
||||
} from './useUPFTotalFlow';
|
||||
import { topologyReset, neStateParse } from './useTopology';
|
||||
import PQueue from 'p-queue';
|
||||
|
||||
/**websocket连接 */
|
||||
@@ -225,6 +231,9 @@ export default function useWS() {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
ws.close();
|
||||
userActivityReset();
|
||||
upfTotalFlowReset();
|
||||
topologyReset();
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user