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 100bec5f3d
commit 8732795ce6

View File

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