File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,7 +316,8 @@ export default class baTable {
316316 [
317317 'com-search' ,
318318 ( ) => {
319- this . table . filter ! . search = this . getComSearchData ( )
319+ // 主动触发公共搜索,采用覆盖模式设定请求筛选数据
320+ this . setFilterSearchData ( this . getComSearchData ( ) , 'cover' )
320321
321322 // 刷新表格
322323 this . onTableHeaderAction ( 'refresh' , { event : 'com-search' , data : this . table . filter ! . search } )
@@ -491,15 +492,17 @@ export default class baTable {
491492 const route = useRoute ( )
492493 this . table . routePath = route . fullPath
493494
494- // 初始化公共搜索表单数据和字段 Map
495- this . initComSearch ( )
495+ // 按需初始化公共搜索表单数据和字段Map
496+ if ( this . comSearch . fieldData . size === 0 ) {
497+ this . initComSearch ( )
498+ }
496499
497500 if ( this . table . acceptQuery && ! isEmpty ( route . query ) ) {
498501 // 根据当前 URL 的 query 初始化公共搜索默认值
499502 this . setComSearchData ( route . query )
500503
501504 // 获取公共搜索数据合并至表格筛选条件
502- this . table . filter ! . search = this . getComSearchData ( ) . concat ( this . table . filter ?. search ?? [ ] )
505+ this . setFilterSearchData ( this . getComSearchData ( ) , 'merge' )
503506 }
504507 }
505508
You can’t perform that action at this time.
0 commit comments