refactor: 修改查询projectId的方式
This commit is contained in:
parent
ff7538b2e0
commit
9d43b1ecc2
|
@ -40,7 +40,7 @@
|
|||
import MsApiReportExport from "./ApiReportExport";
|
||||
import MsApiReportViewHeader from "./ApiReportViewHeader";
|
||||
import {RequestFactory} from "../../definition/model/ApiTestModel";
|
||||
import {windowPrint,getUUID} from "@/common/js/utils";
|
||||
import {windowPrint, getUUID, getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsApiReport",
|
||||
|
@ -310,7 +310,7 @@
|
|||
return "Running" !== this.report.status;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
import MsDebugJdbcPage from "../../definition/components/debug/DebugJdbcPage";
|
||||
import MsDebugTcpPage from "../../definition/components/debug/DebugTcpPage";
|
||||
import MsDebugDubboPage from "../../definition/components/debug/DebugDubboPage";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "ApiCustomize",
|
||||
|
@ -68,7 +68,7 @@
|
|||
this.request.method = row.method;
|
||||
}
|
||||
this.request.resourceId = getUUID();
|
||||
this.request.projectId = this.$store.state.projectId;
|
||||
this.request.projectId = getCurrentProjectID();
|
||||
let obj = {};
|
||||
Object.assign(obj, this.request);
|
||||
this.$emit('addCustomizeApi', obj);
|
||||
|
|
|
@ -413,7 +413,7 @@ export default {
|
|||
return "Running" !== this.report.status;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
import ModuleTrashButton from "../../definition/components/module/ModuleTrashButton";
|
||||
import ApiImport from "./common/ScenarioImport";
|
||||
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: 'MsApiScenarioModule',
|
||||
|
@ -78,7 +79,7 @@
|
|||
return this.relevanceProjectId ? true : false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -501,7 +501,7 @@
|
|||
return buttons.filter(btn => btn.show);
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
<script>
|
||||
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";
|
||||
|
||||
export default {
|
||||
|
@ -164,7 +164,7 @@
|
|||
return this.selectedPlatformValue === 'Har';
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -227,7 +227,7 @@ export default {
|
|||
return false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
this.scenario.projectId = response.data.projectId;
|
||||
const pro = this.projectList.find(p => p.id === response.data.projectId);
|
||||
if (!pro) {
|
||||
this.scenario.projectId = this.$store.state.projectId;
|
||||
this.scenario.projectId = getCurrentProjectID();
|
||||
}
|
||||
if (this.scenario.hashTree) {
|
||||
this.setDisabled(this.scenario.hashTree, this.scenario.projectId);
|
||||
|
@ -103,7 +103,7 @@
|
|||
return false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -148,13 +148,13 @@
|
|||
},
|
||||
calcProjectId(projectId, parentId) {
|
||||
if (!projectId) {
|
||||
return parentId ? parentId : this.$store.state.projectId;
|
||||
return parentId ? parentId : getCurrentProjectID();
|
||||
} else {
|
||||
const project = this.projectList.find(p => p.id === projectId);
|
||||
if (project) {
|
||||
return projectId;
|
||||
}
|
||||
return parentId ? parentId : this.$store.state.projectId;
|
||||
return parentId ? parentId : getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
getProjectName(id) {
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
import {parseEnvironment} from "../../../definition/model/EnvironmentModel";
|
||||
import {ELEMENT_TYPE, ELEMENTS} from "../Setting";
|
||||
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 MsInputTag from "../MsInputTag";
|
||||
import MsRun from "../DebugRun";
|
||||
|
@ -364,7 +364,7 @@
|
|||
return buttons.filter(btn => btn.show);
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {exportPdf} from "@/common/js/utils";
|
||||
import {exportPdf, getCurrentProjectID} from "@/common/js/utils";
|
||||
import html2canvas from 'html2canvas';
|
||||
import EnvPopover from "../../scenario/EnvPopover";
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -160,7 +160,7 @@ import MsRunTestHttpPage from "./components/runtest/RunTestHTTPPage";
|
|||
import MsRunTestTcpPage from "./components/runtest/RunTestTCPPage";
|
||||
import MsRunTestSqlPage from "./components/runtest/RunTestSQLPage";
|
||||
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 ApiCaseSimpleList from "./components/list/ApiCaseSimpleList";
|
||||
|
||||
|
@ -185,7 +185,7 @@ export default {
|
|||
return false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
components: {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<span></span>
|
||||
</template>
|
||||
<script>
|
||||
import {getBodyUploadFiles, strMapToObj} from "@/common/js/utils";
|
||||
import {getBodyUploadFiles, getCurrentProjectID, strMapToObj} from "@/common/js/utils";
|
||||
import ThreadGroup from "./jmeter/components/thread-group";
|
||||
import TestPlan from "./jmeter/components/test-plan";
|
||||
|
||||
|
@ -58,10 +58,10 @@
|
|||
}
|
||||
},
|
||||
run() {
|
||||
let projectId = this.$store.state.projectId;
|
||||
let projectId = getCurrentProjectID();
|
||||
// 如果envMap不存在,是单接口调用
|
||||
if (!this.envMap || this.envMap.size === 0) {
|
||||
projectId = this.$store.state.projectId;
|
||||
projectId = getCurrentProjectID();
|
||||
} else {
|
||||
// 场景步骤下接口调用
|
||||
if (this.runData.projectId) {
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</template>
|
||||
|
||||
<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";
|
||||
|
||||
export default {
|
||||
|
@ -65,7 +65,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -51,12 +51,11 @@
|
|||
import ApiCaseHeader from "./ApiCaseHeader";
|
||||
import ApiCaseItem from "./ApiCaseItem";
|
||||
import MsRun from "../Run";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
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 MsBatchEdit from "../basis/BatchEdit";
|
||||
import {CASE_PRIORITY, REQ_METHOD, TCP_METHOD, SQL_METHOD, DUBBO_METHOD} from "../../model/JsonData";
|
||||
|
||||
export default {
|
||||
name: 'ApiCaseList',
|
||||
|
@ -113,7 +112,7 @@
|
|||
method: REQ_METHOD,
|
||||
},
|
||||
envMap: new Map,
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
refreshSign() {
|
||||
|
@ -136,7 +135,7 @@
|
|||
return this.testCaseId ? true : false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -181,7 +180,7 @@
|
|||
if (!apiCase.request.hashTree) {
|
||||
apiCase.request.hashTree = [];
|
||||
}
|
||||
})
|
||||
});
|
||||
this.apiCaseList = data;
|
||||
this.addCase();
|
||||
});
|
||||
|
@ -204,7 +203,7 @@
|
|||
} else {
|
||||
this.apiCaseList.forEach(item => {
|
||||
this.$set(item, 'selected', false);
|
||||
})
|
||||
});
|
||||
}
|
||||
// 批量更新最后执行环境
|
||||
let obj = {envId: this.environment, show: true};
|
||||
|
@ -291,7 +290,7 @@
|
|||
apiCase.request.hashTree = [];
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
this.apiCaseList = data;
|
||||
if (this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
|
||||
this.environment = this.apiCaseList[0].request.useEnvironment;
|
||||
|
@ -367,7 +366,7 @@
|
|||
return;
|
||||
}
|
||||
this.envMap = new Map();
|
||||
this.envMap.set(this.$store.state.projectId, this.environment);
|
||||
this.envMap.set(getCurrentProjectID(), this.environment);
|
||||
this.runData = [];
|
||||
this.batchLoadingIds = [];
|
||||
this.selectdCases = [];
|
||||
|
@ -380,7 +379,7 @@
|
|||
this.batchLoadingIds.push(item.id);
|
||||
this.selectdCases.push(item.id);
|
||||
}
|
||||
})
|
||||
});
|
||||
if (this.runData.length > 0) {
|
||||
/*触发执行操作*/
|
||||
this.reportId = getUUID().substring(0, 8);
|
||||
|
@ -397,7 +396,7 @@
|
|||
if (item.selected && item.id) {
|
||||
this.selectdCases.push(item.id);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
if (this.selectdCases.length === 0) {
|
||||
this.$warning("请选择用例!");
|
||||
|
@ -439,7 +438,7 @@
|
|||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
<script>
|
||||
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 MsSelectTree from "../../../../common/select-tree/SelectTree";
|
||||
|
||||
|
@ -258,7 +258,7 @@
|
|||
return this.model === 'scenario';
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -160,7 +160,7 @@ import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
|
|||
import MsBatchEdit from "../basis/BatchEdit";
|
||||
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 MsApiCaseTableExtendBtns from "../reference/ApiCaseTableExtendBtns";
|
||||
import MsReferenceView from "../reference/ReferenceView";
|
||||
|
@ -313,7 +313,7 @@ export default {
|
|||
return this.model === 'api';
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
selectRows() {
|
||||
return this.$refs.caseTable.getSelectRows();
|
||||
|
|
|
@ -406,7 +406,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
selectRows() {
|
||||
return this.$refs.apiDefinitionTable.getSelectRows();
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
import MsNodeTree from "../../../../track/common/NodeTree";
|
||||
import ApiModuleHeader from "./ApiModuleHeader";
|
||||
import {buildNodePath, buildTree} from "../../model/NodeTree";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: 'MsApiModule',
|
||||
|
@ -94,7 +95,7 @@
|
|||
return this.reviewId ? true : false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -39,6 +39,7 @@ import ApiImport from "../import/ApiImport";
|
|||
import ModuleTrashButton from "./ModuleTrashButton";
|
||||
import TemplateComponent from "../../../../track/plan/view/comonents/report/TemplateComponent/TemplateComponent";
|
||||
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "ApiModuleHeader",
|
||||
|
@ -117,7 +118,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
<script>
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsFailureTestCaseList",
|
||||
|
@ -59,7 +60,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
|
||||
<script>
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "MsRunningTaskList",
|
||||
components: {
|
||||
|
@ -81,7 +82,7 @@ export default {
|
|||
return false;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -339,13 +339,13 @@
|
|||
},
|
||||
getProject() {
|
||||
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;
|
||||
this.items = [{id: project.id, label: project.name}];
|
||||
this.condition.projectIds = [project.id];
|
||||
this.condition.projectId = project.id;
|
||||
this.initTableData();
|
||||
})
|
||||
});
|
||||
},
|
||||
getType(type) {
|
||||
return this.LOG_TYPE_MAP.get(type);
|
||||
|
|
|
@ -105,7 +105,7 @@ import SelectMenu from "../common/SelectMenu";
|
|||
import MsContainer from "../../common/components/MsContainer";
|
||||
import MsAsideContainer from "../../common/components/MsAsideContainer";
|
||||
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 MsTabButton from "@/business/components/common/components/MsTabButton";
|
||||
|
@ -177,7 +177,7 @@ export default {
|
|||
},
|
||||
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testCaseSelectNodeIds;
|
||||
|
|
|
@ -61,6 +61,7 @@ import IssueDescriptionTableItem from "@/business/components/track/issue/IssueDe
|
|||
import {ISSUE_STATUS_MAP} from "@/common/js/table-constants";
|
||||
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||
import {getPageInfo} from "@/common/js/tableUtils";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "IssueRelateList",
|
||||
components: {MsTablePagination, IssueDescriptionTableItem, MsTableColumn, MsTable, MsEditDialog},
|
||||
|
@ -75,7 +76,7 @@ export default {
|
|||
return ISSUE_STATUS_MAP;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
props: ['caseId'],
|
||||
|
|
|
@ -99,7 +99,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
|
|
|
@ -271,7 +271,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectIds() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
|
|
|
@ -336,7 +336,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
selectNodeIds() {
|
||||
return this.$store.state.testCaseSelectNodeIds;
|
||||
|
|
|
@ -17,6 +17,7 @@ import TemplateComponentEditHeader
|
|||
from "@/business/components/track/plan/view/comonents/report/TemplateComponentEditHeader";
|
||||
import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail";
|
||||
import MsEditDialog from "@/business/components/common/components/MsEditDialog";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "TestPlanIssueEdit",
|
||||
components: {MsEditDialog, IssueEditDetail, TemplateComponentEditHeader},
|
||||
|
@ -27,7 +28,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
props: ['caseId', 'planId'],
|
||||
|
|
|
@ -43,6 +43,7 @@ import TestCaseImport from "@/business/components/track/case/components/TestCase
|
|||
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
|
||||
import {buildTree} from "../../api/definition/model/NodeTree";
|
||||
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestCaseNodeTree",
|
||||
|
@ -100,7 +101,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -43,6 +43,7 @@ import MsRecentList from "../../common/head/RecentList";
|
|||
import MsCreateButton from "../../common/head/CreateButton";
|
||||
import SearchList from "@/business/components/common/head/SearchList";
|
||||
import ProjectChange from "@/business/components/common/head/ProjectSwitch";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TrackHeaderMenus",
|
||||
|
@ -76,7 +77,7 @@ export default {
|
|||
},
|
||||
planRecent: {
|
||||
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) {
|
||||
return '/track/plan/view/' + item.id;
|
||||
},
|
||||
|
|
|
@ -80,6 +80,7 @@ import BugCountCard from "@/business/components/track/home/components/BugCountCa
|
|||
import ReviewList from "@/business/components/track/home/components/ReviewList";
|
||||
import MsRunningTaskList from "@/business/components/api/homepage/components/RunningTaskList";
|
||||
import MsFailureTestCaseList from "@/business/components/api/homepage/components/FailureTestCaseList";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
require('echarts/lib/component/legend');
|
||||
export default {
|
||||
|
@ -111,7 +112,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -76,7 +76,7 @@ import {buildCustomFields, getTemplate, parseCustomField} from "@/common/js/cust
|
|||
import CustomFiledComponent from "@/business/components/settings/workspace/template/CustomFiledComponent";
|
||||
import TestCaseIssueList from "@/business/components/track/issue/TestCaseIssueList";
|
||||
import IssueEditDetail from "@/business/components/track/issue/IssueEditDetail";
|
||||
import {getCurrentUserId} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "IssueEditDetail",
|
||||
|
@ -140,7 +140,7 @@ export default {
|
|||
return SYSTEM_FIELD_NAME_MAP;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -99,6 +99,7 @@ import {getIssues} from "@/network/Issue";
|
|||
import {getPageInfo} from "@/common/js/tableUtils";
|
||||
import MsContainer from "@/business/components/common/components/MsContainer";
|
||||
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "CustomFieldList",
|
||||
|
@ -153,7 +154,7 @@ export default {
|
|||
return SYSTEM_FIELD_NAME_MAP;
|
||||
},
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
import TestPlanEdit from './components/TestPlanEdit';
|
||||
import MsContainer from "../../common/components/MsContainer";
|
||||
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlan",
|
||||
|
@ -30,7 +31,7 @@
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -252,7 +252,7 @@ import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
|||
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain";
|
||||
import {hasPermission} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, hasPermission} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlanList",
|
||||
|
@ -310,7 +310,7 @@ export default {
|
|||
created() {
|
||||
this.projectId = this.$route.params.projectId;
|
||||
if (!this.projectId) {
|
||||
this.projectId = this.$store.state.projectId;
|
||||
this.projectId = getCurrentProjectID();
|
||||
}
|
||||
this.hasEditPermission = hasPermission('PROJECT_TRACK_PLAN:READ+EDIT');
|
||||
this.initTableData();
|
||||
|
|
|
@ -601,7 +601,7 @@ export default {
|
|||
},
|
||||
handleRunBatch(config) {
|
||||
let testPlan = new TestPlan();
|
||||
let projectId = this.$store.state.projectId;
|
||||
let projectId = getCurrentProjectID();
|
||||
if (config.mode === 'serial') {
|
||||
testPlan.serializeThreadgroups = true;
|
||||
testPlan.hashTree = [];
|
||||
|
@ -672,7 +672,7 @@ export default {
|
|||
},
|
||||
getProjectId() {
|
||||
if (!this.isRelevanceModel) {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
} else {
|
||||
return this.currentCaseProjectId;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
|
|||
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
|
||||
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
|
||||
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 MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
|
||||
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
|
||||
|
@ -238,7 +238,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
this.result = this.$get("/project/listAll", res => {
|
||||
let data = res.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;
|
||||
if (index !== -1) {
|
||||
this.projectId = data[index].id;
|
||||
|
|
|
@ -122,7 +122,7 @@ import ApiTestDetail from "../test/ApiTestDetail";
|
|||
import ApiTestResult from "../test/ApiTestResult";
|
||||
import PerformanceTestDetail from "../test/PerformanceTestDetail";
|
||||
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 CaseComment from "@/business/components/track/case/components/CaseComment";
|
||||
import MsPreviousNextButton from "../../../../../common/components/MsPreviousNextButton";
|
||||
|
@ -199,7 +199,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
systemNameMap() {
|
||||
return SYSTEM_FIELD_NAME_MAP;
|
||||
|
|
|
@ -50,6 +50,7 @@ import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
|
|||
import FunctionalTestCaseList from "./FunctionalTestCaseList";
|
||||
import MsTabButton from "@/business/components/common/components/MsTabButton";
|
||||
import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlanFunctional",
|
||||
|
@ -81,7 +82,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
activated() {
|
||||
|
|
|
@ -91,6 +91,7 @@ import {
|
|||
setUnSelectIds, toggleAllSelection,
|
||||
} from "@/common/js/tableUtils";
|
||||
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlanReportList",
|
||||
|
@ -142,7 +143,7 @@ export default {
|
|||
created() {
|
||||
this.projectId = this.$route.params.projectId;
|
||||
if (!this.projectId) {
|
||||
this.projectId = this.$store.state.projectId;
|
||||
this.projectId = getCurrentProjectID();
|
||||
}
|
||||
this.isTestManagerOrTestUser = true;
|
||||
this.initTableData();
|
||||
|
|
|
@ -18,6 +18,7 @@ import TestCaseReviewList from "./components/TestCaseReviewList";
|
|||
import TestCaseReviewEdit from "./components/TestCaseReviewEdit";
|
||||
import MsMainContainer from "../../common/components/MsMainContainer";
|
||||
import MsContainer from "../../common/components/MsContainer";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestCaseReview",
|
||||
|
@ -34,7 +35,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -140,7 +140,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -125,7 +125,7 @@ import MsDialogFooter from "../../../common/components/MsDialogFooter";
|
|||
import MsTableHeader from "../../../common/components/MsTableHeader";
|
||||
import MsCreateBox from "../../../settings/CreateBox";
|
||||
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 PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
||||
import {Test_Case_Review} from "@/business/components/common/model/JsonData";
|
||||
|
@ -182,7 +182,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -47,6 +47,7 @@ import TestReviewRelevance from "@/business/components/track/review/view/compone
|
|||
import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList";
|
||||
import MsTabButton from "@/business/components/common/components/MsTabButton";
|
||||
import TestReviewMinder from "@/business/components/track/common/minder/TestReviewMinder";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestReviewFunction",
|
||||
|
@ -81,7 +82,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -108,6 +108,7 @@ import ReviewStatus from "@/business/components/track/case/components/ReviewStat
|
|||
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||
import SelectMenu from "../../../common/SelectMenu";
|
||||
import {_filter} from "@/common/js/tableUtils";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -316,7 +317,7 @@ export default {
|
|||
let data = res.data;
|
||||
if (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) {
|
||||
this.projectId = data[index].id;
|
||||
this.projectName = data[index].name;
|
||||
|
|
|
@ -134,7 +134,7 @@ import PerformanceTestDetail from "../../../plan/view/comonents/test/Performance
|
|||
import ApiTestResult from "../../../plan/view/comonents/test/ApiTestResult";
|
||||
import ApiTestDetail from "../../../plan/view/comonents/test/ApiTestDetail";
|
||||
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 TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
import ApiCaseItem from "@/business/components/api/definition/components/case/ApiCaseItem";
|
||||
|
@ -206,7 +206,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
return this.$store.state.projectId;
|
||||
return getCurrentProjectID();
|
||||
},
|
||||
systemNameMap() {
|
||||
return SYSTEM_FIELD_NAME_MAP;
|
||||
|
|
Loading…
Reference in New Issue