fix:修复加载显示
This commit is contained in:
@@ -31,7 +31,7 @@ interface ChartDataItem {
|
||||
date: string; // 将存储完整的时间字符串包含时分秒
|
||||
[kpiId: string]: string | number; // 动态指标
|
||||
}
|
||||
|
||||
const tableLoading = ref(false);
|
||||
//网元类型定义
|
||||
const ALL_NE_TYPES = ['AMF','SMF','UPF','MME','IMS','SMSC'] as const;
|
||||
type NeType= typeof ALL_NE_TYPES[number];
|
||||
@@ -107,6 +107,7 @@ const fnRealTimeSwitch = (bool: boolean) => {
|
||||
}
|
||||
chartData.value = [];
|
||||
|
||||
tableLoading.value =true;
|
||||
const options: OptionsType = {
|
||||
url: '/ws',
|
||||
params: {
|
||||
@@ -119,6 +120,7 @@ const fnRealTimeSwitch = (bool: boolean) => {
|
||||
} else if (ws.value) {
|
||||
ws.value.close(); //断开链接
|
||||
ws.value = null; //清空链接
|
||||
tableLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,6 +144,9 @@ const handleWebSocketMessage = (kpiEvent:any)=>{
|
||||
|
||||
// 更新数据
|
||||
updateChartData(newData);
|
||||
if(tableLoading.value){
|
||||
tableLoading.value=false;
|
||||
}
|
||||
};
|
||||
//成功回调
|
||||
const wsMessage = (res:Record<string,any>)=>{
|
||||
@@ -606,6 +611,7 @@ const updateChartLegendSelect = (selectedKpiId?: string) => {
|
||||
:pagination="false"
|
||||
:scroll="{ y: 250 }"
|
||||
size="small"
|
||||
:loading="tableLoading"
|
||||
:custom-row="(record) => ({
|
||||
onClick: () => handleRowClick(record),
|
||||
class: record.kpiId === selectedRow ? 'selected-row' : ''
|
||||
|
||||
Reference in New Issue
Block a user