Skip to content

Commit fba2dea

Browse files
committed
fix: 审计风险列表优化:事件排序 --bug=131727749
1 parent 9889d23 commit fba2dea

File tree

1 file changed

+11
-1
lines changed
  • src/frontend/src/components/tdesign-list

1 file changed

+11
-1
lines changed

src/frontend/src/components/tdesign-list/index.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,21 @@
471471
if (result) {
472472
// 确保使用当前的 pagination.limit 值
473473
const currentLimit = pagination.limit;
474-
const params = {
474+
const params: Record<string, any> = {
475475
...paramsMemo,
476476
page: isUnload.value ? 1 : pagination.current,
477477
page_size: currentLimit < 10 ? 10 : currentLimit,
478478
};
479+
// 若 event_filters 非空,在保留原有 sort 的基础上追加对应的 event_data.xxx 排序字段(后端走 BKBase 查询)
480+
if (Array.isArray(params.event_filters) && params.event_filters.length > 0) {
481+
const eventSortFields = params.event_filters
482+
.filter((f: any) => f && typeof f.field === 'string')
483+
.map((f: any) => `-event_data.${f.field}`);
484+
if (eventSortFields.length > 0) {
485+
const existingSort = Array.isArray(params.sort) ? [...params.sort] : [];
486+
params.sort = [...existingSort, ...eventSortFields];
487+
}
488+
}
479489
isSearching.value = Object.keys(paramsMemo).length > 0;
480490
cancel();
481491
isLoading.value = true;

0 commit comments

Comments
 (0)