File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/frontend/src/components/tdesign-list Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments