fix: CDR返回信息调整

This commit is contained in:
TsMask
2025-07-15 19:49:18 +08:00
parent 818f91ad89
commit 3eae546aa4
8 changed files with 40 additions and 57 deletions

View File

@@ -290,14 +290,11 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
type ModalStateType = {
/**确定按钮 loading */
confirmLoading: boolean;
/**最大ID值 */
maxId: number;
};
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
confirmLoading: false,
maxId: 0,
});
/**
@@ -399,11 +396,6 @@ function fnGetList(pageNum?: number) {
return item;
});
// 取最大值ID用作实时累加
if (total > 0) {
modalState.maxId = Number(rows[0].id);
}
}
tableState.loading = false;
});
@@ -490,15 +482,18 @@ function wsMessage(res: Record<string, any>) {
// cdrEvent CDR会话事件
if (data.groupId === `1005_${queryParams.neId}`) {
const cdrEvent = data.data;
let cdrJSON = {};
try {
cdrJSON = JSON.parse(cdrEvent.cdrJSON);
} catch (e) {}
queue.add(async () => {
modalState.maxId += 1;
tableState.data.unshift({
id: modalState.maxId,
id: cdrEvent.id,
neType: cdrEvent.neType,
neName: cdrEvent.neName,
rmUID: cdrEvent.rmUID,
timestamp: cdrEvent.timestamp,
cdrJSON: cdrEvent.CDR,
cdrJSON: cdrJSON,
});
tablePagination.total += 1;
if (tableState.data.length > 100) {