feat(接口管理): 接口定义列表表头下拉增加筛选和重置

--bug=1037489 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037489
This commit is contained in:
guoyuqi 2024-03-28 11:14:26 +08:00 committed by Craftsman
parent 1e269536ee
commit b9b122b4cc
1 changed files with 36 additions and 0 deletions

View File

@ -48,6 +48,14 @@
</a-checkbox> </a-checkbox>
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetMethodFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div> </div>
</template> </template>
</a-trigger> </a-trigger>
@ -71,6 +79,14 @@
</a-checkbox> </a-checkbox>
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<div class="filter-button">
<a-button type="primary" size="mini" class="mr-[8px]" @click="resetStatusFilter">
{{ t('common.reset') }}
</a-button>
<a-button size="mini" @click="handleFilterHidden(false)">
{{ t('system.orgTemplate.confirm') }}
</a-button>
</div>
</div> </div>
</template> </template>
</a-trigger> </a-trigger>
@ -532,6 +548,8 @@
function handleFilterHidden(val: boolean) { function handleFilterHidden(val: boolean) {
if (!val) { if (!val) {
loadApiList(); loadApiList();
methodFilterVisible.value = false;
statusFilterVisible.value = false;
} }
} }
@ -792,6 +810,18 @@
selectedModuleKeys.value = []; selectedModuleKeys.value = [];
} }
function resetMethodFilter() {
methodFilters.value = Object.keys(RequestMethods);
methodFilterVisible.value = false;
loadApiList();
}
function resetStatusFilter() {
statusFilters.value = Object.keys(RequestDefinitionStatus);
statusFilterVisible.value = false;
loadApiList();
}
/** /**
* 处理文件夹树节点选中事件 * 处理文件夹树节点选中事件
*/ */
@ -875,4 +905,10 @@
} }
} }
} }
.filter-button {
display: flex;
justify-content: space-between;
flex-direction: row;
margin: 12px;
}
</style> </style>