|
@@ -76,6 +76,9 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
@@ -76,6 +76,9 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
76
|
querySetMapGroup := make(map[int]bool)
|
76
|
querySetMapGroup := make(map[int]bool)
|
77
|
querySetGroups := make([]*domain.QuerySet, 0)
|
77
|
querySetGroups := make([]*domain.QuerySet, 0)
|
78
|
for _, t := range result {
|
78
|
for _, t := range result {
|
|
|
79
|
+ if filterTableByFilterRule(t, searchQuery) {
|
|
|
80
|
+ continue
|
|
|
81
|
+ }
|
79
|
if !domain.TableType(t.TableType).TableHasGroup() {
|
82
|
if !domain.TableType(t.TableType).TableHasGroup() {
|
80
|
response = append(response, t)
|
83
|
response = append(response, t)
|
81
|
continue
|
84
|
continue
|
|
@@ -87,9 +90,7 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
@@ -87,9 +90,7 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
87
|
}
|
90
|
}
|
88
|
t.Update(v)
|
91
|
t.Update(v)
|
89
|
parentGroupId := v.ParentId
|
92
|
parentGroupId := v.ParentId
|
90
|
- if filterTableByFilterRule(t, searchQuery.FilterRules) {
|
|
|
91
|
- continue
|
|
|
92
|
- }
|
93
|
+
|
93
|
response = append(response, t)
|
94
|
response = append(response, t)
|
94
|
for {
|
95
|
for {
|
95
|
if parentGroupId == 0 {
|
96
|
if parentGroupId == 0 {
|
|
@@ -129,7 +130,15 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
|
@@ -129,7 +130,15 @@ func (tableService *TableService) TableObjectSearch(searchQuery *query.SearchTab |
129
|
}
|
130
|
}
|
130
|
|
131
|
|
131
|
// true:代表需要过滤 false:不需要过滤
|
132
|
// true:代表需要过滤 false:不需要过滤
|
132
|
-func filterTableByFilterRule(item *dto.TableObjectDto, filterRules []*query.FilterRule) bool {
|
133
|
+func filterTableByFilterRule(item *dto.TableObjectDto, searchQuery *query.SearchTableQuery) bool {
|
|
|
134
|
+ filterRules := searchQuery.FilterRules
|
|
|
135
|
+ if len(searchQuery.ExcludeTables) > 0 {
|
|
|
136
|
+ for _, t := range searchQuery.ExcludeTables {
|
|
|
137
|
+ if t == item.TableId {
|
|
|
138
|
+ return true
|
|
|
139
|
+ }
|
|
|
140
|
+ }
|
|
|
141
|
+ }
|
133
|
for _, rule := range filterRules {
|
142
|
for _, rule := range filterRules {
|
134
|
if rule.TableType == item.TableType && rule.Status > 0 && rule.Status != item.Status {
|
143
|
if rule.TableType == item.TableType && rule.Status > 0 && rule.Status != item.Status {
|
135
|
return true
|
144
|
return true
|