fix(接口定义): 修复点击工作空间筛选后,下拉框只剩当前工作空间的选项的缺陷

--bug=1019884 --user=王孝刚 【接口测试】接口用例查看引用关系 - 场景引用,所属工作空间和所属项目筛选后就只剩所选的选项了
https://www.tapd.cn/55049933/s/1299800
This commit is contained in:
wxg0103 2022-11-21 17:18:30 +08:00 committed by wxg0103
parent d837f95a41
commit c50e83b3f4
1 changed files with 22 additions and 10 deletions

View File

@ -164,17 +164,29 @@ export default {
let data = res.data || []; let data = res.data || [];
this.total = data.itemCount || 0; this.total = data.itemCount || 0;
if (this.workspaceList) { if (this.workspaceList) {
this.workspaceFilters = this.workspaceList if (this.workspaceFilters.length === 0) {
.filter((workspace) => { this.workspaceFilters = this.workspaceList
return data.listObject.find((i) => i.workspaceId === workspace.id); .filter((workspace) => {
}) return data.listObject.find((i) => i.workspaceId === workspace.id);
.map((e) => { })
return { text: e.name, value: e.id }; .map((e) => {
}); return { text: e.name, value: e.id };
});
}
let workspaceIds = []; let workspaceIds = [];
this.workspaceFilters.map((item) => { if (
workspaceIds.push(item.value); this.condition.filters &&
}); this.condition.filters.workspace_id &&
this.condition.filters.workspace_id.length > 0
) {
this.condition.filters.workspace_id.map((item) => {
workspaceIds.push(item);
});
} else {
this.workspaceFilters.map((item) => {
workspaceIds.push(item.value);
});
}
apiProjectRelated({ apiProjectRelated({
userId: getCurrentUserId(), userId: getCurrentUserId(),
workspaceIds: workspaceIds, workspaceIds: workspaceIds,