fix(我的工作台): 解决我的仪表盘跨项目跳转问题
--user=郭雨琦 --bug=1013843 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001013843
This commit is contained in:
parent
764e2f6562
commit
4e2af32e82
|
@ -735,10 +735,6 @@ export default {
|
||||||
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);
|
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
let routeTestCase = this.$route.params.apiDefinition;
|
|
||||||
if (routeTestCase) {
|
|
||||||
this.editApi(routeTestCase);
|
|
||||||
}
|
|
||||||
let dataRange = this.$route.params.dataSelectRange;
|
let dataRange = this.$route.params.dataSelectRange;
|
||||||
let dataType = this.$route.params.dataType;
|
let dataType = this.$route.params.dataType;
|
||||||
if (dataRange) {
|
if (dataRange) {
|
||||||
|
|
|
@ -106,6 +106,7 @@ import MsChangeHistory from "../../history/ChangeHistory";
|
||||||
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
|
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
|
||||||
import MsTipButton from "@/business/components/common/components/MsTipButton";
|
import MsTipButton from "@/business/components/common/components/MsTipButton";
|
||||||
import DiffVersion from "@/business/components/performance/test/DiffVersion";
|
import DiffVersion from "@/business/components/performance/test/DiffVersion";
|
||||||
|
import {PROJECT_ID} from "@/common/js/constants";
|
||||||
|
|
||||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||||
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {};
|
||||||
|
@ -179,6 +180,10 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
let projectId = this.$route.query.projectId;
|
||||||
|
if (projectId && projectId !== getCurrentProjectID()) {
|
||||||
|
sessionStorage.setItem(PROJECT_ID, projectId);
|
||||||
|
}
|
||||||
this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_TEST:READ+EDIT');
|
this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_TEST:READ+EDIT');
|
||||||
this.getTest(this.$route.params.testId);
|
this.getTest(this.$route.params.testId);
|
||||||
if (hasLicense()) {
|
if (hasLicense()) {
|
||||||
|
|
|
@ -221,6 +221,7 @@ import TestCaseMinder from "@/business/components/track/common/minder/TestCaseMi
|
||||||
import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm";
|
import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm";
|
||||||
import {openMinderConfirm, saveMinderConfirm} from "@/business/components/track/common/minder/minderUtils";
|
import {openMinderConfirm, saveMinderConfirm} from "@/business/components/track/common/minder/minderUtils";
|
||||||
import TestCaseEditShow from "@/business/components/track/case/components/TestCaseEditShow";
|
import TestCaseEditShow from "@/business/components/track/case/components/TestCaseEditShow";
|
||||||
|
import {PROJECT_ID} from "@/common/js/constants";
|
||||||
|
|
||||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||||
const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {};
|
const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {};
|
||||||
|
@ -263,17 +264,22 @@ export default {
|
||||||
versionEnable: false,
|
versionEnable: false,
|
||||||
isAsideHidden: true,
|
isAsideHidden: true,
|
||||||
showPublicNode: false,
|
showPublicNode: false,
|
||||||
publicTreeNodes: []
|
publicTreeNodes: [],
|
||||||
|
ignoreTreeNodes:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
let projectId = this.$route.query.projectId;
|
||||||
|
if (projectId) {
|
||||||
|
this.ignoreTreeNodes = true;
|
||||||
|
if (projectId !== getCurrentProjectID() && projectId !== 'all') {
|
||||||
|
sessionStorage.setItem(PROJECT_ID, projectId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getProject();
|
this.getProject();
|
||||||
let routeTestCase = this.$route.params.testCase;
|
this.init(this.$route);
|
||||||
if (routeTestCase && routeTestCase.add === true) {
|
|
||||||
this.addTab({name: 'add'});
|
|
||||||
} else {
|
|
||||||
this.init(this.$route);
|
|
||||||
}
|
|
||||||
this.checkVersionEnable();
|
this.checkVersionEnable();
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
|
@ -564,14 +570,11 @@ export default {
|
||||||
if (path.indexOf("/track/case/edit") >= 0 || path.indexOf("/track/case/create") >= 0) {
|
if (path.indexOf("/track/case/edit") >= 0 || path.indexOf("/track/case/create") >= 0) {
|
||||||
this.testCaseReadOnly = false;
|
this.testCaseReadOnly = false;
|
||||||
let caseId = this.$route.params.caseId;
|
let caseId = this.$route.params.caseId;
|
||||||
let routeTestCase = this.$route.params.testCase;
|
|
||||||
if (!this.projectId) {
|
if (!this.projectId) {
|
||||||
this.$warning(this.$t('commons.check_project_tip'));
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (routeTestCase) {
|
if (caseId) {
|
||||||
this.editTestCase(routeTestCase);
|
|
||||||
} else if (caseId) {
|
|
||||||
this.$get('test/case/get/' + caseId, response => {
|
this.$get('test/case/get/' + caseId, response => {
|
||||||
let testCase = response.data;
|
let testCase = response.data;
|
||||||
this.editTestCase(testCase);
|
this.editTestCase(testCase);
|
||||||
|
@ -607,10 +610,12 @@ export default {
|
||||||
if (!index) {
|
if (!index) {
|
||||||
this.type = "edit";
|
this.type = "edit";
|
||||||
this.testCaseReadOnly = false;
|
this.testCaseReadOnly = false;
|
||||||
if (testCase.label !== "redirect") {
|
if (!this.ignoreTreeNodes) {
|
||||||
if (this.treeNodes.length < 1) {
|
if (testCase.label !== "redirect") {
|
||||||
this.$warning(this.$t('test_track.case.create_module_first'));
|
if (this.treeNodes.length < 1) {
|
||||||
return;
|
this.$warning(this.$t('test_track.case.create_module_first'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
||||||
|
|
|
@ -88,6 +88,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'$route.query.projectId'() {
|
||||||
|
let projectId = this.$route.query.projectId;
|
||||||
|
if (projectId && projectId !== getCurrentProjectID()) {
|
||||||
|
sessionStorage.setItem(PROJECT_ID, projectId);
|
||||||
|
}
|
||||||
|
},
|
||||||
'$route.params.planId'() {
|
'$route.params.planId'() {
|
||||||
this.genRedirectParam();
|
this.genRedirectParam();
|
||||||
this.getTestPlans();
|
this.getTestPlans();
|
||||||
|
|
|
@ -35,6 +35,7 @@ import TestReviewRelevance from "./components/TestReviewRelevance";
|
||||||
import MsTestPlanHeaderBar from "@/business/components/track/plan/view/comonents/head/TestPlanHeaderBar";
|
import MsTestPlanHeaderBar from "@/business/components/track/plan/view/comonents/head/TestPlanHeaderBar";
|
||||||
import TestReviewFunction from "@/business/components/track/review/view/components/TestReviewFunction";
|
import TestReviewFunction from "@/business/components/track/review/view/components/TestReviewFunction";
|
||||||
import {getCurrentProjectID, hasLicense} from "@/common/js/utils";
|
import {getCurrentProjectID, hasLicense} from "@/common/js/utils";
|
||||||
|
import {PROJECT_ID} from "@/common/js/constants";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseReviewView",
|
name: "TestCaseReviewView",
|
||||||
|
@ -76,6 +77,10 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
let projectId = this.$route.query.projectId;
|
||||||
|
if (projectId) {
|
||||||
|
sessionStorage.setItem(PROJECT_ID, projectId);
|
||||||
|
}
|
||||||
this.$EventBus.$on('projectChange', () => {
|
this.$EventBus.$on('projectChange', () => {
|
||||||
if (this.$route.name === 'testCaseReviewView') {
|
if (this.$route.name === 'testCaseReviewView') {
|
||||||
this.$router.push('/track/review/all');
|
this.$router.push('/track/review/all');
|
||||||
|
|
Loading…
Reference in New Issue