refactor: 修改查询projectId的方式
This commit is contained in:
parent
2c95a05646
commit
5ca32674a2
|
@ -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();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -227,7 +227,7 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId;
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -48,128 +48,195 @@
|
||||||
</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,
|
||||||
MsRun,
|
MsRun,
|
||||||
ApiCaseHeader,
|
ApiCaseHeader,
|
||||||
ApiCaseItem,
|
ApiCaseItem,
|
||||||
MsBatchEdit
|
MsBatchEdit
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
createCase: String,
|
||||||
|
loaded: Boolean,
|
||||||
|
refreshSign: String,
|
||||||
|
currentApi: {
|
||||||
|
type: Object
|
||||||
},
|
},
|
||||||
props: {
|
},
|
||||||
createCase: String,
|
data() {
|
||||||
loaded: Boolean,
|
return {
|
||||||
refreshSign: String,
|
result: {},
|
||||||
currentApi: {
|
grades: [],
|
||||||
type: Object
|
environment: "",
|
||||||
|
isReadOnly: false,
|
||||||
|
selectedEvent: Object,
|
||||||
|
priorities: CASE_ORDER,
|
||||||
|
apiCaseList: [],
|
||||||
|
batchLoadingIds: [],
|
||||||
|
singleLoading: false,
|
||||||
|
singleRunId: "",
|
||||||
|
runData: [],
|
||||||
|
selectdCases: [],
|
||||||
|
reportId: "",
|
||||||
|
testCaseId: "",
|
||||||
|
checkedCases: new Set(),
|
||||||
|
visible: false,
|
||||||
|
condition: {
|
||||||
|
components: API_CASE_CONFIGS
|
||||||
},
|
},
|
||||||
},
|
api: {},
|
||||||
data() {
|
typeArr: [
|
||||||
return {
|
{id: 'priority', name: this.$t('test_track.case.priority')},
|
||||||
result: {},
|
{id: 'method', name: this.$t('api_test.definition.api_type')},
|
||||||
grades: [],
|
{id: 'path', name: this.$t('api_test.request.path')},
|
||||||
environment: "",
|
],
|
||||||
isReadOnly: false,
|
priorityFilters: [
|
||||||
selectedEvent: Object,
|
{text: 'P0', value: 'P0'},
|
||||||
priorities: CASE_ORDER,
|
{text: 'P1', value: 'P1'},
|
||||||
apiCaseList: [],
|
{text: 'P2', value: 'P2'},
|
||||||
batchLoadingIds: [],
|
{text: 'P3', value: 'P3'}
|
||||||
singleLoading: false,
|
],
|
||||||
singleRunId: "",
|
valueArr: {
|
||||||
runData: [],
|
priority: CASE_PRIORITY,
|
||||||
selectdCases: [],
|
method: REQ_METHOD,
|
||||||
reportId: "",
|
|
||||||
testCaseId: "",
|
|
||||||
checkedCases: new Set(),
|
|
||||||
visible: false,
|
|
||||||
condition: {
|
|
||||||
components: API_CASE_CONFIGS
|
|
||||||
},
|
|
||||||
api: {},
|
|
||||||
typeArr: [
|
|
||||||
{id: 'priority', name: this.$t('test_track.case.priority')},
|
|
||||||
{id: 'method', name: this.$t('api_test.definition.api_type')},
|
|
||||||
{id: 'path', name: this.$t('api_test.request.path')},
|
|
||||||
],
|
|
||||||
priorityFilters: [
|
|
||||||
{text: 'P0', value: 'P0'},
|
|
||||||
{text: 'P1', value: 'P1'},
|
|
||||||
{text: 'P2', value: 'P2'},
|
|
||||||
{text: 'P3', value: 'P3'}
|
|
||||||
],
|
|
||||||
valueArr: {
|
|
||||||
priority: CASE_PRIORITY,
|
|
||||||
method: REQ_METHOD,
|
|
||||||
},
|
|
||||||
envMap: new Map,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
refreshSign() {
|
|
||||||
this.api = this.currentApi;
|
|
||||||
this.getApiTest();
|
|
||||||
},
|
},
|
||||||
createCase() {
|
envMap: new Map,
|
||||||
this.api = this.currentApi;
|
};
|
||||||
this.sysAddition();
|
},
|
||||||
},
|
watch: {
|
||||||
},
|
refreshSign() {
|
||||||
created() {
|
|
||||||
this.api = this.currentApi;
|
this.api = this.currentApi;
|
||||||
if (this.createCase) {
|
this.getApiTest();
|
||||||
this.sysAddition();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
createCase() {
|
||||||
isCaseEdit() {
|
this.api = this.currentApi;
|
||||||
return this.testCaseId ? true : false;
|
this.sysAddition();
|
||||||
},
|
|
||||||
projectId() {
|
|
||||||
return this.$store.state.projectId
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
},
|
||||||
open(api, testCaseId) {
|
created() {
|
||||||
this.api = api;
|
this.api = this.currentApi;
|
||||||
// testCaseId 不为空则为用例编辑页面
|
if (this.createCase) {
|
||||||
this.testCaseId = testCaseId;
|
this.sysAddition();
|
||||||
this.condition = {components: API_CASE_CONFIGS};
|
}
|
||||||
this.getApiTest(true);
|
},
|
||||||
this.visible = true;
|
computed: {
|
||||||
},
|
isCaseEdit() {
|
||||||
runTestCase(api, testCaseId) {
|
return this.testCaseId ? true : false;
|
||||||
this.api = api;
|
},
|
||||||
// testCaseId 不为空则为用例编辑页面
|
projectId() {
|
||||||
this.testCaseId = testCaseId;
|
return getCurrentProjectID();
|
||||||
this.condition = {components: API_CASE_CONFIGS};
|
},
|
||||||
this.getApiTestToRunTestCase(testCaseId);
|
},
|
||||||
this.visible = true;
|
methods: {
|
||||||
},
|
open(api, testCaseId) {
|
||||||
saveApiAndCase(api) {
|
this.api = api;
|
||||||
this.visible = true;
|
// testCaseId 不为空则为用例编辑页面
|
||||||
this.api = api;
|
this.testCaseId = testCaseId;
|
||||||
this.currentApi = api;
|
this.condition = {components: API_CASE_CONFIGS};
|
||||||
|
this.getApiTest(true);
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
runTestCase(api, testCaseId) {
|
||||||
|
this.api = api;
|
||||||
|
// testCaseId 不为空则为用例编辑页面
|
||||||
|
this.testCaseId = testCaseId;
|
||||||
|
this.condition = {components: API_CASE_CONFIGS};
|
||||||
|
this.getApiTestToRunTestCase(testCaseId);
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
saveApiAndCase(api) {
|
||||||
|
this.visible = true;
|
||||||
|
this.api = api;
|
||||||
|
this.currentApi = api;
|
||||||
|
this.addCase();
|
||||||
|
},
|
||||||
|
setEnvironment(environment) {
|
||||||
|
this.environment = environment;
|
||||||
|
},
|
||||||
|
sysAddition() {
|
||||||
|
this.condition.projectId = this.projectId;
|
||||||
|
this.condition.apiDefinitionId = this.api.id;
|
||||||
|
this.$post("/api/testcase/list", this.condition, response => {
|
||||||
|
let data = response.data;
|
||||||
|
data.forEach(apiCase => {
|
||||||
|
if (apiCase.tags && apiCase.tags.length > 0) {
|
||||||
|
apiCase.tags = JSON.parse(apiCase.tags);
|
||||||
|
this.$set(apiCase, 'selected', false);
|
||||||
|
}
|
||||||
|
if (Object.prototype.toString.call(apiCase.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
||||||
|
apiCase.request = JSON.parse(apiCase.request);
|
||||||
|
}
|
||||||
|
if (!apiCase.request.hashTree) {
|
||||||
|
apiCase.request.hashTree = [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.apiCaseList = data;
|
||||||
this.addCase();
|
this.addCase();
|
||||||
},
|
});
|
||||||
setEnvironment(environment) {
|
},
|
||||||
this.environment = environment;
|
|
||||||
},
|
apiCaseClose() {
|
||||||
sysAddition() {
|
this.apiCaseList = [];
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refresh');
|
||||||
|
},
|
||||||
|
refreshModule() {
|
||||||
|
this.$emit('refreshModule');
|
||||||
|
},
|
||||||
|
runRefresh() {
|
||||||
|
this.batchLoadingIds = [];
|
||||||
|
this.singleLoading = false;
|
||||||
|
this.singleRunId = "";
|
||||||
|
if (this.$refs.header.isSelectAll) {
|
||||||
|
this.$refs.header.isSelectAll = false;
|
||||||
|
} else {
|
||||||
|
this.apiCaseList.forEach(item => {
|
||||||
|
this.$set(item, 'selected', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 批量更新最后执行环境
|
||||||
|
let obj = {envId: this.environment, show: true};
|
||||||
|
this.batchEdit(obj);
|
||||||
|
this.$success(this.$t('organization.integration.successful_operation'));
|
||||||
|
},
|
||||||
|
errorRefresh() {
|
||||||
|
this.batchLoadingIds = [];
|
||||||
|
this.singleLoading = false;
|
||||||
|
this.singleRunId = "";
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.getApiTest();
|
||||||
|
this.$emit('refresh');
|
||||||
|
},
|
||||||
|
selectAll(isSelectAll) {
|
||||||
|
this.apiCaseList.forEach(item => {
|
||||||
|
this.$set(item, 'selected', isSelectAll);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getApiTest(addCase) {
|
||||||
|
this.environment = "";
|
||||||
|
if (this.api) {
|
||||||
this.condition.projectId = this.projectId;
|
this.condition.projectId = this.projectId;
|
||||||
|
if (this.isCaseEdit) {
|
||||||
|
this.condition.id = this.testCaseId;
|
||||||
|
}
|
||||||
this.condition.apiDefinitionId = this.api.id;
|
this.condition.apiDefinitionId = this.api.id;
|
||||||
this.$post("/api/testcase/list", this.condition, response => {
|
this.result = this.$post("/api/testcase/list", this.condition, response => {
|
||||||
let data = response.data;
|
let data = [];
|
||||||
|
if (response.data) {
|
||||||
|
data = response.data;
|
||||||
|
}
|
||||||
data.forEach(apiCase => {
|
data.forEach(apiCase => {
|
||||||
if (apiCase.tags && apiCase.tags.length > 0) {
|
if (apiCase.tags && apiCase.tags.length > 0) {
|
||||||
apiCase.tags = JSON.parse(apiCase.tags);
|
apiCase.tags = JSON.parse(apiCase.tags);
|
||||||
|
@ -181,271 +248,203 @@
|
||||||
if (!apiCase.request.hashTree) {
|
if (!apiCase.request.hashTree) {
|
||||||
apiCase.request.hashTree = [];
|
apiCase.request.hashTree = [];
|
||||||
}
|
}
|
||||||
})
|
const index = this.runData.findIndex(d => d.name === apiCase.id);
|
||||||
|
if (index !== -1) {
|
||||||
|
apiCase.active = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
this.apiCaseList = data;
|
this.apiCaseList = data;
|
||||||
this.addCase();
|
if (this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
|
||||||
});
|
this.environment = this.apiCaseList[0].request.useEnvironment;
|
||||||
},
|
|
||||||
|
|
||||||
apiCaseClose() {
|
|
||||||
this.apiCaseList = [];
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refresh');
|
|
||||||
},
|
|
||||||
refreshModule() {
|
|
||||||
this.$emit('refreshModule');
|
|
||||||
},
|
|
||||||
runRefresh() {
|
|
||||||
this.batchLoadingIds = [];
|
|
||||||
this.singleLoading = false;
|
|
||||||
this.singleRunId = "";
|
|
||||||
if (this.$refs.header.isSelectAll) {
|
|
||||||
this.$refs.header.isSelectAll = false;
|
|
||||||
} else {
|
|
||||||
this.apiCaseList.forEach(item => {
|
|
||||||
this.$set(item, 'selected', false);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 批量更新最后执行环境
|
|
||||||
let obj = {envId: this.environment, show: true};
|
|
||||||
this.batchEdit(obj);
|
|
||||||
this.$success(this.$t('organization.integration.successful_operation'));
|
|
||||||
},
|
|
||||||
errorRefresh() {
|
|
||||||
this.batchLoadingIds = [];
|
|
||||||
this.singleLoading = false;
|
|
||||||
this.singleRunId = "";
|
|
||||||
},
|
|
||||||
refresh() {
|
|
||||||
this.getApiTest();
|
|
||||||
this.$emit('refresh');
|
|
||||||
},
|
|
||||||
selectAll(isSelectAll) {
|
|
||||||
this.apiCaseList.forEach(item => {
|
|
||||||
this.$set(item, 'selected', isSelectAll);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getApiTest(addCase) {
|
|
||||||
this.environment = "";
|
|
||||||
if (this.api) {
|
|
||||||
this.condition.projectId = this.projectId;
|
|
||||||
if (this.isCaseEdit) {
|
|
||||||
this.condition.id = this.testCaseId;
|
|
||||||
}
|
}
|
||||||
|
if (addCase && this.apiCaseList.length === 0 && !this.loaded) {
|
||||||
|
this.addCase();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getApiTestToRunTestCase(testCaseId) {
|
||||||
|
if (this.api) {
|
||||||
|
this.condition.projectId = this.projectId;
|
||||||
|
if (this.isCaseEdit) {
|
||||||
|
this.condition.id = this.testCaseId;
|
||||||
|
}
|
||||||
|
if (this.api) {
|
||||||
this.condition.apiDefinitionId = this.api.id;
|
this.condition.apiDefinitionId = this.api.id;
|
||||||
this.result = this.$post("/api/testcase/list", this.condition, response => {
|
}
|
||||||
let data = [];
|
|
||||||
if (response.data) {
|
this.result = this.$post("/api/testcase/list", this.condition, response => {
|
||||||
data = response.data;
|
let data = [];
|
||||||
|
if (response.data) {
|
||||||
|
data = response.data;
|
||||||
|
}
|
||||||
|
data.forEach(apiCase => {
|
||||||
|
if (apiCase.tags && apiCase.tags.length > 0) {
|
||||||
|
apiCase.tags = JSON.parse(apiCase.tags);
|
||||||
|
this.$set(apiCase, 'selected', false);
|
||||||
}
|
}
|
||||||
data.forEach(apiCase => {
|
if (Object.prototype.toString.call(apiCase.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
||||||
if (apiCase.tags && apiCase.tags.length > 0) {
|
apiCase.request = JSON.parse(apiCase.request);
|
||||||
apiCase.tags = JSON.parse(apiCase.tags);
|
|
||||||
this.$set(apiCase, 'selected', false);
|
|
||||||
}
|
|
||||||
if (Object.prototype.toString.call(apiCase.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
|
||||||
apiCase.request = JSON.parse(apiCase.request);
|
|
||||||
}
|
|
||||||
if (!apiCase.request.hashTree) {
|
|
||||||
apiCase.request.hashTree = [];
|
|
||||||
}
|
|
||||||
const index = this.runData.findIndex(d => d.name === apiCase.id);
|
|
||||||
if (index !== -1) {
|
|
||||||
apiCase.active = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.apiCaseList = data;
|
|
||||||
if (this.apiCaseList[0] && this.apiCaseList[0].request && this.apiCaseList[0].request.useEnvironment) {
|
|
||||||
this.environment = this.apiCaseList[0].request.useEnvironment;
|
|
||||||
}
|
}
|
||||||
if (addCase && this.apiCaseList.length === 0 && !this.loaded) {
|
if (!apiCase.request.hashTree) {
|
||||||
this.addCase();
|
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;
|
||||||
|
}
|
||||||
|
if (this.apiCaseList.length === 0 && !this.loaded) {
|
||||||
|
this.addCase();
|
||||||
|
}
|
||||||
|
this.apiCaseList.forEach(apicase => {
|
||||||
|
if (apicase.id === testCaseId) {
|
||||||
|
let data = apicase;
|
||||||
|
data.message = true;
|
||||||
|
this.singleRun(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
|
||||||
getApiTestToRunTestCase(testCaseId) {
|
|
||||||
if (this.api) {
|
|
||||||
this.condition.projectId = this.projectId;
|
|
||||||
if (this.isCaseEdit) {
|
|
||||||
this.condition.id = this.testCaseId;
|
|
||||||
}
|
|
||||||
if (this.api) {
|
|
||||||
this.condition.apiDefinitionId = this.api.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.result = this.$post("/api/testcase/list", this.condition, response => {
|
|
||||||
let data = [];
|
|
||||||
if (response.data) {
|
|
||||||
data = response.data;
|
|
||||||
}
|
|
||||||
data.forEach(apiCase => {
|
|
||||||
if (apiCase.tags && apiCase.tags.length > 0) {
|
|
||||||
apiCase.tags = JSON.parse(apiCase.tags);
|
|
||||||
this.$set(apiCase, 'selected', false);
|
|
||||||
}
|
|
||||||
if (Object.prototype.toString.call(apiCase.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
|
||||||
apiCase.request = JSON.parse(apiCase.request);
|
|
||||||
}
|
|
||||||
if (!apiCase.request.hashTree) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
if (this.apiCaseList.length === 0 && !this.loaded) {
|
|
||||||
this.addCase();
|
|
||||||
}
|
|
||||||
this.apiCaseList.forEach(apicase => {
|
|
||||||
if (apicase.id === testCaseId) {
|
|
||||||
let data = apicase;
|
|
||||||
data.message = true;
|
|
||||||
this.singleRun(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addCase() {
|
|
||||||
if (this.api && this.api.request) {
|
|
||||||
// 初始化对象
|
|
||||||
let request = {};
|
|
||||||
if (this.api.request instanceof Object) {
|
|
||||||
request = this.api.request;
|
|
||||||
} else {
|
|
||||||
request = JSON.parse(this.api.request);
|
|
||||||
}
|
|
||||||
if (!request.hashTree) {
|
|
||||||
request.hashTree = [];
|
|
||||||
}
|
|
||||||
if (request.backScript) {
|
|
||||||
request.hashTree.push(request.backScript);
|
|
||||||
}
|
|
||||||
let uuid = getUUID();
|
|
||||||
request.id = uuid;
|
|
||||||
let obj = {apiDefinitionId: this.api.id, name: '', priority: 'P0', active: true, tags: [], uuid: uuid};
|
|
||||||
obj.request = request;
|
|
||||||
this.apiCaseList.unshift(obj);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
copyCase(data) {
|
|
||||||
this.apiCaseList.unshift(data);
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClose() {
|
|
||||||
this.visible = false;
|
|
||||||
},
|
|
||||||
showExecResult(row) {
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('showExecResult', row);
|
|
||||||
},
|
|
||||||
|
|
||||||
singleRun(row) {
|
|
||||||
if (this.currentApi.protocol !== "DUBBO" && this.currentApi.protocol !== "dubbo://" && !this.environment) {
|
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.selectdCases = [];
|
|
||||||
this.selectdCases.push(row.id);
|
|
||||||
this.runData = [];
|
|
||||||
this.singleLoading = true;
|
|
||||||
this.singleRunId = row.id;
|
|
||||||
row.request.name = row.id;
|
|
||||||
row.request.useEnvironment = this.environment;
|
|
||||||
row.request.projectId = this.projectId;
|
|
||||||
this.runData.push(row.request);
|
|
||||||
/*触发执行操作*/
|
|
||||||
this.reportId = getUUID().substring(0, 8);
|
|
||||||
},
|
|
||||||
|
|
||||||
batchRun() {
|
|
||||||
if (this.currentApi.protocol !== "DUBBO" && this.currentApi.protocol !== "dubbo://" && !this.environment) {
|
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.envMap = new Map();
|
|
||||||
this.envMap.set(this.$store.state.projectId, this.environment);
|
|
||||||
this.runData = [];
|
|
||||||
this.batchLoadingIds = [];
|
|
||||||
this.selectdCases = [];
|
|
||||||
if (this.apiCaseList.length > 0) {
|
|
||||||
this.apiCaseList.forEach(item => {
|
|
||||||
if (item.selected && item.id) {
|
|
||||||
item.request.name = item.id;
|
|
||||||
item.request.useEnvironment = this.environment;
|
|
||||||
this.runData.push(item.request);
|
|
||||||
this.batchLoadingIds.push(item.id);
|
|
||||||
this.selectdCases.push(item.id);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (this.runData.length > 0) {
|
|
||||||
/*触发执行操作*/
|
|
||||||
this.reportId = getUUID().substring(0, 8);
|
|
||||||
} else {
|
|
||||||
this.$warning("请勾选要执行的用例!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$warning("没有可执行的用例!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
batchEditCase() {
|
|
||||||
if (this.apiCaseList.length > 0) {
|
|
||||||
this.apiCaseList.forEach(item => {
|
|
||||||
if (item.selected && item.id) {
|
|
||||||
this.selectdCases.push(item.id);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (this.selectdCases.length === 0) {
|
|
||||||
this.$warning("请选择用例!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// //根据不同的接口,注入不同的参数
|
|
||||||
if (this.currentApi.protocol === 'HTTP') {
|
|
||||||
this.valueArr.method = REQ_METHOD;
|
|
||||||
} else if (this.currentApi.protocol === 'TCP') {
|
|
||||||
this.valueArr.method = TCP_METHOD;
|
|
||||||
} else if (this.currentApi.protocol === 'SQL') {
|
|
||||||
this.valueArr.method = SQL_METHOD;
|
|
||||||
} else if (this.currentApi.protocol === 'DUBBO') {
|
|
||||||
this.valueArr.method = DUBBO_METHOD;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs.batchEdit.open();
|
|
||||||
},
|
|
||||||
batchEdit(form) {
|
|
||||||
let param = {};
|
|
||||||
if (form) {
|
|
||||||
param[form.type] = form.value;
|
|
||||||
param.ids = this.selectdCases;
|
|
||||||
param.projectId = this.projectId;
|
|
||||||
param.envId = form.envId;
|
|
||||||
if (this.api) {
|
|
||||||
param.protocol = this.api.protocol;
|
|
||||||
}
|
|
||||||
param.selectAllDate = this.isSelectAllDate;
|
|
||||||
param.unSelectIds = this.unSelection;
|
|
||||||
param = Object.assign(param, this.condition);
|
|
||||||
}
|
|
||||||
this.$post('/api/testcase/batch/editByParam', param, () => {
|
|
||||||
if (!form.show) {
|
|
||||||
this.$success(this.$t('commons.save_success'));
|
|
||||||
}
|
|
||||||
this.selectdCases = [];
|
|
||||||
this.getApiTest();
|
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
}
|
},
|
||||||
|
addCase() {
|
||||||
|
if (this.api && this.api.request) {
|
||||||
|
// 初始化对象
|
||||||
|
let request = {};
|
||||||
|
if (this.api.request instanceof Object) {
|
||||||
|
request = this.api.request;
|
||||||
|
} else {
|
||||||
|
request = JSON.parse(this.api.request);
|
||||||
|
}
|
||||||
|
if (!request.hashTree) {
|
||||||
|
request.hashTree = [];
|
||||||
|
}
|
||||||
|
if (request.backScript) {
|
||||||
|
request.hashTree.push(request.backScript);
|
||||||
|
}
|
||||||
|
let uuid = getUUID();
|
||||||
|
request.id = uuid;
|
||||||
|
let obj = {apiDefinitionId: this.api.id, name: '', priority: 'P0', active: true, tags: [], uuid: uuid};
|
||||||
|
obj.request = request;
|
||||||
|
this.apiCaseList.unshift(obj);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
copyCase(data) {
|
||||||
|
this.apiCaseList.unshift(data);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClose() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
showExecResult(row) {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('showExecResult', row);
|
||||||
|
},
|
||||||
|
|
||||||
|
singleRun(row) {
|
||||||
|
if (this.currentApi.protocol !== "DUBBO" && this.currentApi.protocol !== "dubbo://" && !this.environment) {
|
||||||
|
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.selectdCases = [];
|
||||||
|
this.selectdCases.push(row.id);
|
||||||
|
this.runData = [];
|
||||||
|
this.singleLoading = true;
|
||||||
|
this.singleRunId = row.id;
|
||||||
|
row.request.name = row.id;
|
||||||
|
row.request.useEnvironment = this.environment;
|
||||||
|
row.request.projectId = this.projectId;
|
||||||
|
this.runData.push(row.request);
|
||||||
|
/*触发执行操作*/
|
||||||
|
this.reportId = getUUID().substring(0, 8);
|
||||||
|
},
|
||||||
|
|
||||||
|
batchRun() {
|
||||||
|
if (this.currentApi.protocol !== "DUBBO" && this.currentApi.protocol !== "dubbo://" && !this.environment) {
|
||||||
|
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.envMap = new Map();
|
||||||
|
this.envMap.set(getCurrentProjectID(), this.environment);
|
||||||
|
this.runData = [];
|
||||||
|
this.batchLoadingIds = [];
|
||||||
|
this.selectdCases = [];
|
||||||
|
if (this.apiCaseList.length > 0) {
|
||||||
|
this.apiCaseList.forEach(item => {
|
||||||
|
if (item.selected && item.id) {
|
||||||
|
item.request.name = item.id;
|
||||||
|
item.request.useEnvironment = this.environment;
|
||||||
|
this.runData.push(item.request);
|
||||||
|
this.batchLoadingIds.push(item.id);
|
||||||
|
this.selectdCases.push(item.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (this.runData.length > 0) {
|
||||||
|
/*触发执行操作*/
|
||||||
|
this.reportId = getUUID().substring(0, 8);
|
||||||
|
} else {
|
||||||
|
this.$warning("请勾选要执行的用例!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$warning("没有可执行的用例!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
batchEditCase() {
|
||||||
|
if (this.apiCaseList.length > 0) {
|
||||||
|
this.apiCaseList.forEach(item => {
|
||||||
|
if (item.selected && item.id) {
|
||||||
|
this.selectdCases.push(item.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (this.selectdCases.length === 0) {
|
||||||
|
this.$warning("请选择用例!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// //根据不同的接口,注入不同的参数
|
||||||
|
if (this.currentApi.protocol === 'HTTP') {
|
||||||
|
this.valueArr.method = REQ_METHOD;
|
||||||
|
} else if (this.currentApi.protocol === 'TCP') {
|
||||||
|
this.valueArr.method = TCP_METHOD;
|
||||||
|
} else if (this.currentApi.protocol === 'SQL') {
|
||||||
|
this.valueArr.method = SQL_METHOD;
|
||||||
|
} else if (this.currentApi.protocol === 'DUBBO') {
|
||||||
|
this.valueArr.method = DUBBO_METHOD;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$refs.batchEdit.open();
|
||||||
|
},
|
||||||
|
batchEdit(form) {
|
||||||
|
let param = {};
|
||||||
|
if (form) {
|
||||||
|
param[form.type] = form.value;
|
||||||
|
param.ids = this.selectdCases;
|
||||||
|
param.projectId = this.projectId;
|
||||||
|
param.envId = form.envId;
|
||||||
|
if (this.api) {
|
||||||
|
param.protocol = this.api.protocol;
|
||||||
|
}
|
||||||
|
param.selectAllDate = this.isSelectAllDate;
|
||||||
|
param.unSelectIds = this.unSelection;
|
||||||
|
param = Object.assign(param, this.condition);
|
||||||
|
}
|
||||||
|
this.$post('/api/testcase/batch/editByParam', param, () => {
|
||||||
|
if (!form.show) {
|
||||||
|
this.$success(this.$t('commons.save_success'));
|
||||||
|
}
|
||||||
|
this.selectdCases = [];
|
||||||
|
this.getApiTest();
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.ms-drawer >>> .ms-drawer-body {
|
.ms-drawer >>> .ms-drawer-body {
|
||||||
margin-top: 80px;
|
margin-top: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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'],
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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'],
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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;
|
||||||
},
|
},
|
||||||
|
|
|
@ -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,14 +112,14 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId
|
return getCurrentProjectID();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkTipsType() {
|
checkTipsType() {
|
||||||
let random = Math.floor(Math.random() * (4 - 1 + 1)) + 1;
|
let random = Math.floor(Math.random() * (4 - 1 + 1)) + 1;
|
||||||
this.tipsType = random + "";
|
this.tipsType = random + "";
|
||||||
|
|
||||||
let today = new Date();
|
let today = new Date();
|
||||||
let month = today.getMonth();
|
let month = today.getMonth();
|
||||||
if (9 > month > 4) {
|
if (9 > month > 4) {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -140,7 +140,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
projectId() {
|
projectId() {
|
||||||
return this.$store.state.projectId;
|
return getCurrentProjectID();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue