refactor: 修改查询projectId的方式

This commit is contained in:
Captain.B 2021-06-01 11:42:55 +08:00 committed by 刘瑞斌
parent 2c95a05646
commit 5ca32674a2
51 changed files with 457 additions and 441 deletions

View File

@ -40,7 +40,7 @@
import MsApiReportExport from "./ApiReportExport"; import MsApiReportExport from "./ApiReportExport";
import MsApiReportViewHeader from "./ApiReportViewHeader"; import MsApiReportViewHeader from "./ApiReportViewHeader";
import {RequestFactory} from "../../definition/model/ApiTestModel"; import {RequestFactory} from "../../definition/model/ApiTestModel";
import {windowPrint,getUUID} from "@/common/js/utils"; import {windowPrint, getUUID, getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "MsApiReport", name: "MsApiReport",
@ -310,7 +310,7 @@
return "Running" !== this.report.status; return "Running" !== this.report.status;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
} }
} }

View File

@ -87,7 +87,7 @@
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -26,7 +26,7 @@
import MsDebugJdbcPage from "../../definition/components/debug/DebugJdbcPage"; import MsDebugJdbcPage from "../../definition/components/debug/DebugJdbcPage";
import MsDebugTcpPage from "../../definition/components/debug/DebugTcpPage"; import MsDebugTcpPage from "../../definition/components/debug/DebugTcpPage";
import MsDebugDubboPage from "../../definition/components/debug/DebugDubboPage"; import MsDebugDubboPage from "../../definition/components/debug/DebugDubboPage";
import {getUUID} from "@/common/js/utils"; import {getCurrentProjectID, getUUID} from "@/common/js/utils";
export default { export default {
name: "ApiCustomize", name: "ApiCustomize",
@ -68,7 +68,7 @@
this.request.method = row.method; this.request.method = row.method;
} }
this.request.resourceId = getUUID(); this.request.resourceId = getUUID();
this.request.projectId = this.$store.state.projectId; this.request.projectId = getCurrentProjectID();
let obj = {}; let obj = {};
Object.assign(obj, this.request); Object.assign(obj, this.request);
this.$emit('addCustomizeApi', obj); this.$emit('addCustomizeApi', obj);

View File

@ -413,7 +413,7 @@ export default {
return "Running" !== this.report.status; return "Running" !== this.report.status;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -48,6 +48,7 @@
import ModuleTrashButton from "../../definition/components/module/ModuleTrashButton"; import ModuleTrashButton from "../../definition/components/module/ModuleTrashButton";
import ApiImport from "./common/ScenarioImport"; import ApiImport from "./common/ScenarioImport";
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar"; import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: 'MsApiScenarioModule', name: 'MsApiScenarioModule',
@ -78,7 +79,7 @@
return this.relevanceProjectId ? true : false; return this.relevanceProjectId ? true : false;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
data() { data() {

View File

@ -501,7 +501,7 @@
return buttons.filter(btn => btn.show); return buttons.filter(btn => btn.show);
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -67,7 +67,7 @@
<script> <script>
import MsDialogFooter from "../../../../common/components/MsDialogFooter"; import MsDialogFooter from "../../../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsSelectTree from "../../../../common/select-tree/SelectTree"; import MsSelectTree from "../../../../common/select-tree/SelectTree";
export default { export default {
@ -164,7 +164,7 @@
return this.selectedPlatformValue === 'Har'; return this.selectedPlatformValue === 'Har';
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -227,7 +227,7 @@ export default {
return false; return false;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -71,7 +71,7 @@
this.scenario.projectId = response.data.projectId; this.scenario.projectId = response.data.projectId;
const pro = this.projectList.find(p => p.id === response.data.projectId); const pro = this.projectList.find(p => p.id === response.data.projectId);
if (!pro) { if (!pro) {
this.scenario.projectId = this.$store.state.projectId; this.scenario.projectId = getCurrentProjectID();
} }
if (this.scenario.hashTree) { if (this.scenario.hashTree) {
this.setDisabled(this.scenario.hashTree, this.scenario.projectId); this.setDisabled(this.scenario.hashTree, this.scenario.projectId);
@ -103,7 +103,7 @@
return false; return false;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
methods: { methods: {
@ -148,13 +148,13 @@
}, },
calcProjectId(projectId, parentId) { calcProjectId(projectId, parentId) {
if (!projectId) { if (!projectId) {
return parentId ? parentId : this.$store.state.projectId; return parentId ? parentId : getCurrentProjectID();
} else { } else {
const project = this.projectList.find(p => p.id === projectId); const project = this.projectList.find(p => p.id === projectId);
if (project) { if (project) {
return projectId; return projectId;
} }
return parentId ? parentId : this.$store.state.projectId; return parentId ? parentId : getCurrentProjectID();
} }
}, },
getProjectName(id) { getProjectName(id) {

View File

@ -143,7 +143,7 @@
import {parseEnvironment} from "../../../definition/model/EnvironmentModel"; import {parseEnvironment} from "../../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "../Setting"; import {ELEMENT_TYPE, ELEMENTS} from "../Setting";
import MsApiCustomize from "../ApiCustomize"; import MsApiCustomize from "../ApiCustomize";
import {getUUID, strMapToObj} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig"; import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig";
import MsInputTag from "../MsInputTag"; import MsInputTag from "../MsInputTag";
import MsRun from "../DebugRun"; import MsRun from "../DebugRun";
@ -364,7 +364,7 @@
return buttons.filter(btn => btn.show); return buttons.filter(btn => btn.show);
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -30,8 +30,8 @@
</template> </template>
<script> <script>
import {exportPdf} from "@/common/js/utils"; import {exportPdf, getCurrentProjectID} from "@/common/js/utils";
import html2canvas from 'html2canvas'; import html2canvas from 'html2canvas';
import EnvPopover from "../../scenario/EnvPopover"; import EnvPopover from "../../scenario/EnvPopover";
export default { export default {
@ -56,7 +56,7 @@
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
} }
}, },
mounted() { mounted() {

View File

@ -160,7 +160,7 @@ import MsRunTestHttpPage from "./components/runtest/RunTestHTTPPage";
import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage"; import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage";
import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage"; import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage";
import MsRunTestDubboPage from "./components/runtest/RunTestDubboPage"; import MsRunTestDubboPage from "./components/runtest/RunTestDubboPage";
import {getCurrentUser, getUUID, hasPermission} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUser, getUUID, hasPermission} from "@/common/js/utils";
import MsApiModule from "./components/module/ApiModule"; import MsApiModule from "./components/module/ApiModule";
import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList"; import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList";
@ -185,7 +185,7 @@ export default {
return false; return false;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
components: { components: {

View File

@ -2,8 +2,8 @@
<span></span> <span></span>
</template> </template>
<script> <script>
import {getBodyUploadFiles, strMapToObj} from "@/common/js/utils"; import {getBodyUploadFiles, getCurrentProjectID, strMapToObj} from "@/common/js/utils";
import ThreadGroup from "./jmeter/components/thread-group"; import ThreadGroup from "./jmeter/components/thread-group";
import TestPlan from "./jmeter/components/test-plan"; import TestPlan from "./jmeter/components/test-plan";
export default { export default {
@ -58,10 +58,10 @@
} }
}, },
run() { run() {
let projectId = this.$store.state.projectId; let projectId = getCurrentProjectID();
// envMap // envMap
if (!this.envMap || this.envMap.size === 0) { if (!this.envMap || this.envMap.size === 0) {
projectId = this.$store.state.projectId; projectId = getCurrentProjectID();
} else { } else {
// //
if (this.runData.projectId) { if (this.runData.projectId) {

View File

@ -97,7 +97,7 @@
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -34,7 +34,7 @@
</template> </template>
<script> <script>
import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {parseEnvironment} from "@/business/components/api/test/model/EnvironmentModel"; import {parseEnvironment} from "@/business/components/api/test/model/EnvironmentModel";
export default { export default {
@ -65,7 +65,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -48,17 +48,16 @@
</template> </template>
<script> <script>
import ApiCaseHeader from "./ApiCaseHeader"; import ApiCaseHeader from "./ApiCaseHeader";
import ApiCaseItem from "./ApiCaseItem"; import ApiCaseItem from "./ApiCaseItem";
import MsRun from "../Run"; import MsRun from "../Run";
import {getUUID} from "@/common/js/utils"; import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import MsDrawer from "../../../../common/components/MsDrawer"; import MsDrawer from "../../../../common/components/MsDrawer";
import {CASE_ORDER} from "../../model/JsonData"; import {CASE_ORDER, CASE_PRIORITY, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components"; import {API_CASE_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsBatchEdit from "../basis/BatchEdit"; import MsBatchEdit from "../basis/BatchEdit";
import {CASE_PRIORITY, REQ_METHOD, TCP_METHOD, SQL_METHOD, DUBBO_METHOD} from "../../model/JsonData";
export default { export default {
name: 'ApiCaseList', name: 'ApiCaseList',
components: { components: {
MsDrawer, MsDrawer,
@ -113,7 +112,7 @@
method: REQ_METHOD, method: REQ_METHOD,
}, },
envMap: new Map, envMap: new Map,
} };
}, },
watch: { watch: {
refreshSign() { refreshSign() {
@ -136,7 +135,7 @@
return this.testCaseId ? true : false; return this.testCaseId ? true : false;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {
@ -181,7 +180,7 @@
if (!apiCase.request.hashTree) { if (!apiCase.request.hashTree) {
apiCase.request.hashTree = []; apiCase.request.hashTree = [];
} }
}) });
this.apiCaseList = data; this.apiCaseList = data;
this.addCase(); this.addCase();
}); });
@ -204,7 +203,7 @@
} else { } else {
this.apiCaseList.forEach(item => { this.apiCaseList.forEach(item => {
this.$set(item, 'selected', false); this.$set(item, 'selected', false);
}) });
} }
// //
let obj = {envId: this.environment, show: true}; let obj = {envId: this.environment, show: true};
@ -291,7 +290,7 @@
apiCase.request.hashTree = []; apiCase.request.hashTree = [];
} }
}) });
this.apiCaseList = data; this.apiCaseList = data;
if (this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) { if (this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
this.environment = this.apiCaseList[0].request.useEnvironment; this.environment = this.apiCaseList[0].request.useEnvironment;
@ -367,7 +366,7 @@
return; return;
} }
this.envMap = new Map(); this.envMap = new Map();
this.envMap.set(this.$store.state.projectId, this.environment); this.envMap.set(getCurrentProjectID(), this.environment);
this.runData = []; this.runData = [];
this.batchLoadingIds = []; this.batchLoadingIds = [];
this.selectdCases = []; this.selectdCases = [];
@ -380,7 +379,7 @@
this.batchLoadingIds.push(item.id); this.batchLoadingIds.push(item.id);
this.selectdCases.push(item.id); this.selectdCases.push(item.id);
} }
}) });
if (this.runData.length > 0) { if (this.runData.length > 0) {
/*触发执行操作*/ /*触发执行操作*/
this.reportId = getUUID().substring(0, 8); this.reportId = getUUID().substring(0, 8);
@ -397,7 +396,7 @@
if (item.selected && item.id) { if (item.selected && item.id) {
this.selectdCases.push(item.id); this.selectdCases.push(item.id);
} }
}) });
} }
if (this.selectdCases.length === 0) { if (this.selectdCases.length === 0) {
this.$warning("请选择用例!"); this.$warning("请选择用例!");
@ -439,13 +438,13 @@
}); });
}, },
} }
} };
</script> </script>
<style scoped> <style scoped>
.ms-drawer >>> .ms-drawer-body { .ms-drawer >>> .ms-drawer-body {
margin-top: 80px; margin-top: 80px;
} }
</style> </style>

View File

@ -97,7 +97,7 @@
<script> <script>
import MsDialogFooter from "../../../../common/components/MsDialogFooter"; import MsDialogFooter from "../../../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener,hasLicense} from "@/common/js/utils"; import {listenGoBack, removeGoBackListener, hasLicense, getCurrentProjectID} from "@/common/js/utils";
import ScheduleImport from "@/business/components/api/definition/components/import/ImportScheduleEdit"; import ScheduleImport from "@/business/components/api/definition/components/import/ImportScheduleEdit";
import MsSelectTree from "../../../../common/select-tree/SelectTree"; import MsSelectTree from "../../../../common/select-tree/SelectTree";
@ -258,7 +258,7 @@
return this.model === 'scenario'; return this.model === 'scenario';
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -160,7 +160,7 @@ import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
import MsBatchEdit from "../basis/BatchEdit"; import MsBatchEdit from "../basis/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData"; import {API_METHOD_COLOUR, CASE_PRIORITY, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
import {getBodyUploadFiles} from "@/common/js/utils"; import {getBodyUploadFiles, getCurrentProjectID} from "@/common/js/utils";
import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem";
import MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns"; import MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns";
import MsReferenceView from "../reference/ReferenceView"; import MsReferenceView from "../reference/ReferenceView";
@ -313,7 +313,7 @@ export default {
return this.model === 'api'; return this.model === 'api';
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
selectRows() { selectRows() {
return this.$refs.caseTable.getSelectRows(); return this.$refs.caseTable.getSelectRows();

View File

@ -406,7 +406,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
selectRows() { selectRows() {
return this.$refs.apiDefinitionTable.getSelectRows(); return this.$refs.apiDefinitionTable.getSelectRows();

View File

@ -48,6 +48,7 @@
import MsNodeTree from "../../../../track/common/NodeTree"; import MsNodeTree from "../../../../track/common/NodeTree";
import ApiModuleHeader from "./ApiModuleHeader"; import ApiModuleHeader from "./ApiModuleHeader";
import {buildNodePath, buildTree} from "../../model/NodeTree"; import {buildNodePath, buildTree} from "../../model/NodeTree";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: 'MsApiModule', name: 'MsApiModule',
@ -94,7 +95,7 @@
return this.reviewId ? true : false; return this.reviewId ? true : false;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
mounted() { mounted() {

View File

@ -39,6 +39,7 @@ import ApiImport from "../import/ApiImport";
import ModuleTrashButton from "./ModuleTrashButton"; import ModuleTrashButton from "./ModuleTrashButton";
import TemplateComponent from "../../../../track/plan/view/comonents/report/TemplateComponent/TemplateComponent"; import TemplateComponent from "../../../../track/plan/view/comonents/report/TemplateComponent/TemplateComponent";
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar"; import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "ApiModuleHeader", name: "ApiModuleHeader",
@ -117,7 +118,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -137,7 +137,7 @@
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -42,6 +42,7 @@
<script> <script>
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "MsFailureTestCaseList", name: "MsFailureTestCaseList",
@ -59,7 +60,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -58,6 +58,7 @@
<script> <script>
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "MsRunningTaskList", name: "MsRunningTaskList",
components: { components: {
@ -81,7 +82,7 @@ export default {
return false; return false;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },

View File

@ -46,7 +46,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -339,13 +339,13 @@
}, },
getProject() { getProject() {
this.condition.projectIds = []; this.condition.projectIds = [];
this.result = this.$get("/project/get/" + this.$store.state.projectId, response => { this.result = this.$get("/project/get/" + getCurrentProjectID(), response => {
let project = response.data; let project = response.data;
this.items = [{id: project.id, label: project.name}]; this.items = [{id: project.id, label: project.name}];
this.condition.projectIds = [project.id]; this.condition.projectIds = [project.id];
this.condition.projectId = project.id; this.condition.projectId = project.id;
this.initTableData(); this.initTableData();
}) });
}, },
getType(type) { getType(type) {
return this.LOG_TYPE_MAP.get(type); return this.LOG_TYPE_MAP.get(type);

View File

@ -105,7 +105,7 @@ import SelectMenu from "../common/SelectMenu";
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer"; import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsMainContainer from "../../common/components/MsMainContainer"; import MsMainContainer from "../../common/components/MsMainContainer";
import {getUUID, hasPermission} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, hasPermission} from "@/common/js/utils";
import TestCaseNodeTree from "../common/TestCaseNodeTree"; import TestCaseNodeTree from "../common/TestCaseNodeTree";
import MsTabButton from "@/business/components/common/components/MsTabButton"; import MsTabButton from "@/business/components/common/components/MsTabButton";
@ -177,7 +177,7 @@ export default {
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
selectNodeIds() { selectNodeIds() {
return this.$store.state.testCaseSelectNodeIds; return this.$store.state.testCaseSelectNodeIds;

View File

@ -61,6 +61,7 @@ import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDe
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants"; import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import {getPageInfo} from "@/common/js/tableUtils"; import {getPageInfo} from "@/common/js/tableUtils";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "IssueRelateList", name: "IssueRelateList",
components: {MsTablePagination, IssueDescriptionTableItem, MsTableColumn, MsTable, MsEditDialog}, components: {MsTablePagination, IssueDescriptionTableItem, MsTableColumn, MsTable, MsEditDialog},
@ -75,7 +76,7 @@ export default {
return ISSUE_STATUS_MAP; return ISSUE_STATUS_MAP;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
} }
}, },
props: ['caseId'], props: ['caseId'],

View File

@ -99,7 +99,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
moduleOptions() { moduleOptions() {
return this.$store.state.testCaseModuleOptions; return this.$store.state.testCaseModuleOptions;

View File

@ -271,7 +271,7 @@
}, },
computed: { computed: {
projectIds() { projectIds() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
moduleOptions() { moduleOptions() {
return this.$store.state.testCaseModuleOptions; return this.$store.state.testCaseModuleOptions;

View File

@ -336,7 +336,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
selectNodeIds() { selectNodeIds() {
return this.$store.state.testCaseSelectNodeIds; return this.$store.state.testCaseSelectNodeIds;

View File

@ -17,6 +17,7 @@ import TemplateComponentEditHeader
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader"; from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail"; import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail";
import MsEditDialog from "@/business/components/common/components/MsEditDialog"; import MsEditDialog from "@/business/components/common/components/MsEditDialog";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestPlanIssueEdit", name: "TestPlanIssueEdit",
components: {MsEditDialog, IssueEditDetail, TemplateComponentEditHeader}, components: {MsEditDialog, IssueEditDetail, TemplateComponentEditHeader},
@ -27,7 +28,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
} }
}, },
props: ['caseId', 'planId'], props: ['caseId', 'planId'],

View File

@ -43,6 +43,7 @@ import TestCaseImport from "@/business/components/track/case/components/TestCase
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar"; import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
import {buildTree} from "../../api/definition/model/NodeTree"; import {buildTree} from "../../api/definition/model/NodeTree";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree"; import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestCaseNodeTree", name: "TestCaseNodeTree",
@ -100,7 +101,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -43,6 +43,7 @@ import MsRecentList from "../../common/head/RecentList";
import MsCreateButton from "../../common/head/CreateButton"; import MsCreateButton from "../../common/head/CreateButton";
import SearchList from "@/business/components/common/head/SearchList"; import SearchList from "@/business/components/common/head/SearchList";
import ProjectChange from "@/business/components/common/head/ProjectSwitch"; import ProjectChange from "@/business/components/common/head/ProjectSwitch";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TrackHeaderMenus", name: "TrackHeaderMenus",
@ -76,7 +77,7 @@ export default {
}, },
planRecent: { planRecent: {
title: this.$t('test_track.recent_plan'), title: this.$t('test_track.recent_plan'),
url: this.$store.state.projectId === '' ? "/test/plan/recent/5/" + undefined : "/test/plan/recent/5/" + this.$store.state.projectId, url: getCurrentProjectID() === '' ? "/test/plan/recent/5/" + undefined : "/test/plan/recent/5/" + getCurrentProjectID(),
index: function (item) { index: function (item) {
return '/track/plan/view/' + item.id; return '/track/plan/view/' + item.id;
}, },

View File

@ -80,6 +80,7 @@ import BugCountCard from "@/business/components/track/home/components/BugCountCa
import ReviewList from "@/business/components/track/home/components/ReviewList"; import ReviewList from "@/business/components/track/home/components/ReviewList";
import MsRunningTaskList from "@/business/components/api/homepage/components/RunningTaskList"; import MsRunningTaskList from "@/business/components/api/homepage/components/RunningTaskList";
import MsFailureTestCaseList from "@/business/components/api/homepage/components/FailureTestCaseList"; import MsFailureTestCaseList from "@/business/components/api/homepage/components/FailureTestCaseList";
import {getCurrentProjectID} from "@/common/js/utils";
require('echarts/lib/component/legend'); require('echarts/lib/component/legend');
export default { export default {
@ -111,7 +112,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -76,7 +76,7 @@ import {buildCustomFields, getTemplate, parseCustomField} from "@/common/js/cust
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent"; import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent";
import TestCaseIssueList from "@/business/components/track/issue/TestCaseIssueList"; import TestCaseIssueList from "@/business/components/track/issue/TestCaseIssueList";
import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail"; import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail";
import {getCurrentUserId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils";
export default { export default {
name: "IssueEditDetail", name: "IssueEditDetail",
@ -140,7 +140,7 @@ export default {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
}, },
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
} }
}, },
methods: { methods: {

View File

@ -99,6 +99,7 @@ import {getIssues} from "@/network/Issue";
import {getPageInfo} from "@/common/js/tableUtils"; import {getPageInfo} from "@/common/js/tableUtils";
import MsContainer from "@/business/components/common/components/MsContainer"; import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "CustomFieldList", name: "CustomFieldList",
@ -153,7 +154,7 @@ export default {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
}, },
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
} }
}, },
methods: { methods: {

View File

@ -20,6 +20,7 @@
import TestPlanEdit from './components/TestPlanEdit'; import TestPlanEdit from './components/TestPlanEdit';
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer"; import MsMainContainer from "../../common/components/MsMainContainer";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestPlan", name: "TestPlan",
@ -30,7 +31,7 @@
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
mounted() { mounted() {

View File

@ -252,7 +252,7 @@ import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain"; import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain";
import {hasPermission} from "@/common/js/utils"; import {getCurrentProjectID, hasPermission} from "@/common/js/utils";
export default { export default {
name: "TestPlanList", name: "TestPlanList",
@ -310,7 +310,7 @@ export default {
created() { created() {
this.projectId = this.$route.params.projectId; this.projectId = this.$route.params.projectId;
if (!this.projectId) { if (!this.projectId) {
this.projectId = this.$store.state.projectId; this.projectId = getCurrentProjectID();
} }
this.hasEditPermission = hasPermission('PROJECT_TRACK_PLAN:READ+EDIT'); this.hasEditPermission = hasPermission('PROJECT_TRACK_PLAN:READ+EDIT');
this.initTableData(); this.initTableData();

View File

@ -601,7 +601,7 @@ export default {
}, },
handleRunBatch(config) { handleRunBatch(config) {
let testPlan = new TestPlan(); let testPlan = new TestPlan();
let projectId = this.$store.state.projectId; let projectId = getCurrentProjectID();
if (config.mode === 'serial') { if (config.mode === 'serial') {
testPlan.serializeThreadgroups = true; testPlan.serializeThreadgroups = true;
testPlan.hashTree = []; testPlan.hashTree = [];
@ -672,7 +672,7 @@ export default {
}, },
getProjectId() { getProjectId() {
if (!this.isRelevanceModel) { if (!this.isRelevanceModel) {
return this.$store.state.projectId; return getCurrentProjectID();
} else { } else {
return this.currentCaseProjectId; return this.currentCaseProjectId;
} }

View File

@ -134,7 +134,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn"; import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../../../common/components/MsTag"; import MsTag from "../../../../../common/components/MsTag";
import {getUUID, strMapToObj} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail"; import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn"; import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns"; import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@ -238,7 +238,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
created() { created() {

View File

@ -94,7 +94,7 @@
this.result = this.$get("/project/listAll", res => { this.result = this.$get("/project/listAll", res => {
let data = res.data; let data = res.data;
if (data) { if (data) {
const index = data.findIndex(d => d.id === this.$store.state.projectId); const index = data.findIndex(d => d.id === getCurrentProjectID());
this.projects = data; this.projects = data;
if (index !== -1) { if (index !== -1) {
this.projectId = data[index].id; this.projectId = data[index].id;

View File

@ -122,7 +122,7 @@ import ApiTestDetail from "../test/ApiTestDetail";
import ApiTestResult from "../test/ApiTestResult"; import ApiTestResult from "../test/ApiTestResult";
import PerformanceTestDetail from "../test/PerformanceTestDetail"; import PerformanceTestDetail from "../test/PerformanceTestDetail";
import PerformanceTestResult from "../test/PerformanceTestResult"; import PerformanceTestResult from "../test/PerformanceTestResult";
import {getUUID, hasPermission, listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, hasPermission, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment"; import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import CaseComment from "@/business/components/track/case/components/CaseComment"; import CaseComment from "@/business/components/track/case/components/CaseComment";
import MsPreviousNextButton from "../../../../../common/components/MsPreviousNextButton"; import MsPreviousNextButton from "../../../../../common/components/MsPreviousNextButton";
@ -199,7 +199,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
systemNameMap() { systemNameMap() {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;

View File

@ -50,6 +50,7 @@ import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
import FunctionalTestCaseList from "./FunctionalTestCaseList"; import FunctionalTestCaseList from "./FunctionalTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton"; import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder"; import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestPlanFunctional", name: "TestPlanFunctional",
@ -81,7 +82,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
activated() { activated() {

View File

@ -91,6 +91,7 @@ import {
setUnSelectIds, toggleAllSelection, setUnSelectIds, toggleAllSelection,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestPlanReportList", name: "TestPlanReportList",
@ -142,7 +143,7 @@ export default {
created() { created() {
this.projectId = this.$route.params.projectId; this.projectId = this.$route.params.projectId;
if (!this.projectId) { if (!this.projectId) {
this.projectId = this.$store.state.projectId; this.projectId = getCurrentProjectID();
} }
this.isTestManagerOrTestUser = true; this.isTestManagerOrTestUser = true;
this.initTableData(); this.initTableData();

View File

@ -18,6 +18,7 @@ import TestCaseReviewList from "./components/TestCaseReviewList";
import TestCaseReviewEdit from "./components/TestCaseReviewEdit"; import TestCaseReviewEdit from "./components/TestCaseReviewEdit";
import MsMainContainer from "../../common/components/MsMainContainer"; import MsMainContainer from "../../common/components/MsMainContainer";
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestCaseReview", name: "TestCaseReview",
@ -34,7 +35,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
mounted() { mounted() {

View File

@ -140,7 +140,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
} }
}, },
methods: { methods: {

View File

@ -125,7 +125,7 @@ import MsDialogFooter from "../../../common/components/MsDialogFooter";
import MsTableHeader from "../../../common/components/MsTableHeader"; import MsTableHeader from "../../../common/components/MsTableHeader";
import MsCreateBox from "../../../settings/CreateBox"; import MsCreateBox from "../../../settings/CreateBox";
import MsTablePagination from "../../../common/pagination/TablePagination"; import MsTablePagination from "../../../common/pagination/TablePagination";
import {getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils";
import {_filter, _sort, deepClone, getLabel} from "@/common/js/tableUtils"; import {_filter, _sort, deepClone, getLabel} from "@/common/js/tableUtils";
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem"; import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
import {Test_Case_Review} from "@/business/components/common/model/JsonData"; import {Test_Case_Review} from "@/business/components/common/model/JsonData";
@ -182,7 +182,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -47,6 +47,7 @@ import TestReviewRelevance from "@/business/components/track/review/view/compone
import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList"; import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton"; import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestReviewMinder from "@/business/components/track/common/minder/TestReviewMinder"; import TestReviewMinder from "@/business/components/track/common/minder/TestReviewMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
name: "TestReviewFunction", name: "TestReviewFunction",
@ -81,7 +82,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId return getCurrentProjectID();
}, },
}, },
methods: { methods: {

View File

@ -108,6 +108,7 @@ import ReviewStatus from "@/business/components/track/case/components/ReviewStat
import elTableInfiniteScroll from 'el-table-infinite-scroll'; import elTableInfiniteScroll from 'el-table-infinite-scroll';
import SelectMenu from "../../../common/SelectMenu"; import SelectMenu from "../../../common/SelectMenu";
import {_filter} from "@/common/js/tableUtils"; import {_filter} from "@/common/js/tableUtils";
import {getCurrentProjectID} from "@/common/js/utils";
export default { export default {
@ -316,7 +317,7 @@ export default {
let data = res.data; let data = res.data;
if (data) { if (data) {
this.projects = data; this.projects = data;
const index = data.findIndex(d => d.id === this.$store.state.projectId); const index = data.findIndex(d => d.id === getCurrentProjectID());
if (index !== -1) { if (index !== -1) {
this.projectId = data[index].id; this.projectId = data[index].id;
this.projectName = data[index].name; this.projectName = data[index].name;

View File

@ -134,7 +134,7 @@ import PerformanceTestDetail from "../../../plan/view/comonents/test/Performance
import ApiTestResult from "../../../plan/view/comonents/test/ApiTestResult"; import ApiTestResult from "../../../plan/view/comonents/test/ApiTestResult";
import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail"; import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail";
import TestPlanTestCaseStatusButton from "../../../plan/common/TestPlanTestCaseStatusButton"; import TestPlanTestCaseStatusButton from "../../../plan/common/TestPlanTestCaseStatusButton";
import {getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import ReviewComment from "../../commom/ReviewComment"; import ReviewComment from "../../commom/ReviewComment";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment"; import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import ApiCaseItem from "@/business/components/api/definition/components/case/ApiCaseItem"; import ApiCaseItem from "@/business/components/api/definition/components/case/ApiCaseItem";
@ -206,7 +206,7 @@ export default {
}, },
computed: { computed: {
projectId() { projectId() {
return this.$store.state.projectId; return getCurrentProjectID();
}, },
systemNameMap() { systemNameMap() {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;