消费组支持模糊过滤查询.

This commit is contained in:
许晓东
2025-02-22 20:56:00 +08:00
parent a48812ed0e
commit a927dd412e

View File

@@ -58,6 +58,22 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<hr class="hr" />
<a-row :gutter="24">
<a-col :span="24">
<a-form-item label="过滤消费组">
<a-input
placeholder="groupId 模糊过滤"
class="input-w"
v-decorator="['filterGroupId']"
@change="onFilterGroupIdUpdate"
/>
<span>
仅过滤当前已查出来的消费组如果要查询服务端最新消费组请点击查询按钮</span
>
</a-form-item>
</a-col>
</a-row>
</a-form> </a-form>
</div> </div>
<div class="operation-row-button"> <div class="operation-row-button">
@@ -70,7 +86,7 @@
</div> </div>
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="data" :data-source="filteredData"
bordered bordered
row-key="groupId" row-key="groupId"
> >
@@ -169,6 +185,7 @@ export default {
return { return {
queryParam: {}, queryParam: {},
data: [], data: [],
filteredData: [],
columns, columns,
selectRow: {}, selectRow: {},
form: this.$form.createForm(this, { form: this.$form.createForm(this, {
@@ -186,6 +203,7 @@ export default {
showConsumerDetailDialog: false, showConsumerDetailDialog: false,
showAddSubscriptionDialog: false, showAddSubscriptionDialog: false,
showOffsetPartitionDialog: false, showOffsetPartitionDialog: false,
filterGroupId: "",
}; };
}, },
methods: { methods: {
@@ -209,6 +227,7 @@ export default {
this.loading = false; this.loading = false;
if (res.code == 0) { if (res.code == 0) {
this.data = res.data.list; this.data = res.data.list;
this.filter();
} else { } else {
notification.error({ notification.error({
message: "error", message: "error",
@@ -268,6 +287,19 @@ export default {
closeOffsetPartitionDialog() { closeOffsetPartitionDialog() {
this.showOffsetPartitionDialog = false; this.showOffsetPartitionDialog = false;
}, },
onFilterGroupIdUpdate(input) {
this.filterGroupId = input.target.value;
this.filter();
},
filter() {
if (this.filterGroupId) {
this.filteredData = this.data.filter(
(e) => e.groupId.indexOf(this.filterGroupId) != -1
);
} else {
this.filteredData = this.data;
}
},
}, },
created() { created() {
this.getConsumerGroupList(); this.getConsumerGroupList();
@@ -372,4 +404,9 @@ const columns = [
.type-select { .type-select {
width: 200px !important; width: 200px !important;
} }
.hr {
height: 1px;
border: none;
border-top: 1px dashed #0066cc;
}
</style> </style>