...
|
...
|
@@ -76,6 +76,9 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
|
querySetMapGroup := make(map[int]bool)
|
|
|
querySetGroups := make([]*domain.QuerySet, 0)
|
|
|
for _, t := range result {
|
|
|
if filterTableByFilterRule(t, searchQuery) {
|
|
|
continue
|
|
|
}
|
|
|
if !domain.TableType(t.TableType).TableHasGroup() {
|
|
|
response = append(response, t)
|
|
|
continue
|
...
|
...
|
@@ -87,9 +90,7 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
|
}
|
|
|
t.Update(v)
|
|
|
parentGroupId := v.ParentId
|
|
|
if filterTableByFilterRule(t, searchQuery.FilterRules) {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
response = append(response, t)
|
|
|
for {
|
|
|
if parentGroupId == 0 {
|
...
|
...
|
@@ -129,7 +130,15 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
|
}
|
|
|
|
|
|
// true:代表需要过滤 false:不需要过滤
|
|
|
func filterTableByFilterRule(item *dto.TableObjectDto, filterRules []*query.FilterRule) bool {
|
|
|
func filterTableByFilterRule(item *dto.TableObjectDto, searchQuery *query.SearchTableQuery) bool {
|
|
|
filterRules := searchQuery.FilterRules
|
|
|
if len(searchQuery.ExcludeTables) > 0 {
|
|
|
for _, t := range searchQuery.ExcludeTables {
|
|
|
if t == item.TableId {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for _, rule := range filterRules {
|
|
|
if rule.TableType == item.TableType && rule.Status > 0 && rule.Status != item.Status {
|
|
|
return true
|
...
|
...
|
|