Skip to content

Commit 00985d0

Browse files
committed
UI: Show applied search filters
1 parent b429e84 commit 00985d0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ui/src/views/AutogenView.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@
106106
@change-filter="changeFilter"/>
107107
</a-col>
108108
</a-row>
109+
<a-row v-if="!dataView" style="min-height: 40px;" :wrap="true">
110+
<a-col style="margin-top: 15px" v-for="filter in Object.keys($route.query)" :key="filter">
111+
<a-tag v-if="!['page', 'pagesize', 'q', 'keyword'].includes(filter)" closable @close="removeFilter(filter)">
112+
{{ $t('label.' + filter) === ('label.' + filter) ? filter : $t('label.' + filter) }}:
113+
{{ $t('label.' + $route.query[filter].toLowerCase()) === ('label.' + $route.query[filter].toLowerCase()) ? $route.query[filter] : $t('label.' + $route.query[filter].toLowerCase()) }}
114+
</a-tag>
115+
</a-col>
116+
</a-row>
109117
</a-card>
110118
</a-affix>
111119

@@ -1105,6 +1113,11 @@ export default {
11051113
eventBus.emit('action-closing', { action: this.currentAction })
11061114
this.closeAction()
11071115
},
1116+
removeFilter (filter) {
1117+
const queryParams = Object.assign({}, this.$route.query)
1118+
delete queryParams[filter]
1119+
this.onSearch(queryParams)
1120+
},
11081121
onRowSelectionChange (selection) {
11091122
this.selectedRowKeys = selection
11101123
if (selection?.length > 0) {

0 commit comments

Comments
 (0)