diff --git a/api-test/frontend/src/business/automation/scenario/api/ScenarioRelevance.vue b/api-test/frontend/src/business/automation/scenario/api/ScenarioRelevance.vue index 7d8537ac5a..1fbf3ad0f4 100644 --- a/api-test/frontend/src/business/automation/scenario/api/ScenarioRelevance.vue +++ b/api-test/frontend/src/business/automation/scenario/api/ScenarioRelevance.vue @@ -129,6 +129,7 @@ export default { variables: scenarioDefinition.variables, environmentMap: scenarioDefinition.environmentMap, referenced: referenced, + refType: 'scenario', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId, diff --git a/framework/sdk-parent/frontend/src/components/head/ProjectSearchList.vue b/framework/sdk-parent/frontend/src/components/head/ProjectSearchList.vue index e54107223d..e1bbf0c7c2 100644 --- a/framework/sdk-parent/frontend/src/components/head/ProjectSearchList.vue +++ b/framework/sdk-parent/frontend/src/components/head/ProjectSearchList.vue @@ -32,6 +32,7 @@ import {hasPermissions} from "../../utils/permission"; import {getUserProjectList, switchProject} from "../../api/project"; import {useUserStore} from "@/store"; import {getDefaultSecondLevelMenu} from "../../router"; +import {PROJECT_ID, WORKSPACE_ID} from '../../utils/constants'; export default { name: "SearchList", @@ -66,7 +67,7 @@ export default { init() { let data = { userId: getCurrentUserId(), - workspaceId: getCurrentWorkspaceId() + workspaceId: (this.$route.params && this.$route.params.workspaceId) || getCurrentWorkspaceId() }; this.loading = true; getUserProjectList(data) @@ -75,7 +76,9 @@ export default { this.items = response.data; this.searchArray = response.data; let projectId = getCurrentProjectID(); - if (projectId) { + if (this.$route.params && this.$route.params.projectId) { + this.change(this.$route.params.projectId); + } else if (projectId) { // 保存的 projectId 在当前项目列表是否存在; 切换工作空间后 if (this.searchArray.length > 0 && this.searchArray.map(p => p.id).indexOf(projectId) === -1) { this.change(this.items[0].id);