fix(接口测试): 场景引用场景类型问题

--bug=1026410 --user=宋昌昌 【接口测试】导入的场景里有引用的场景,点击引用的场景ID,跳转的项目不对,并且引用步骤变成了复制 https://www.tapd.cn/55049933/s/1374282
This commit is contained in:
song-cc-rock 2023-05-23 15:23:17 +08:00 committed by fit2-zhao
parent 69d3e9a8e1
commit d7f6d2dbab
2 changed files with 6 additions and 2 deletions

View File

@ -129,6 +129,7 @@ export default {
variables: scenarioDefinition.variables,
environmentMap: scenarioDefinition.environmentMap,
referenced: referenced,
refType: 'scenario',
resourceId: getUUID(),
hashTree: scenarioDefinition.hashTree,
projectId: item.projectId,

View File

@ -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);