fix(测试跟踪): 获取不到版本选项

This commit is contained in:
chenjianxing 2022-10-14 13:42:28 +08:00 committed by jianxing
parent 7c2f40a25c
commit 191dac3505
20 changed files with 54 additions and 85 deletions

View File

@ -1,10 +1,10 @@
import {get} from "../plugins/request" import {get} from "../plugins/request"
import {hasLicense} from "../utils/permission";
export function getProjectVersions(projectId) { export function getProjectVersions(projectId) {
return get(`/project/version/get-project-versions/${projectId}`); return get(`/project/version/get-project-versions/${projectId}`);
} }
export function getProjectMembers() { export function getProjectMembers() {
return get('/user/project/member/list'); return get('/user/project/member/list');
} }
@ -12,3 +12,15 @@ export function getProjectMembers() {
export function isProjectVersionEnable(projectId) { export function isProjectVersionEnable(projectId) {
return get(`/project/version/enable/${projectId}`) return get(`/project/version/enable/${projectId}`)
} }
export function getVersionFilters(projectId) {
return hasLicense() && projectId ? new Promise((resolve) => {
getProjectVersions(projectId)
.then((r) => {
let versionFilters = r.data.map(u => {
return {text: u.name, value: u.id};
});
resolve({data: versionFilters});
});
}) : new Promise(resolve => resolve({}));
}

View File

@ -14,13 +14,6 @@ export function getCurrentProject(callback) {
return getProject(getCurrentProjectID(), callback); return getProject(getCurrentProjectID(), callback);
} }
export function getVersionFilters(projectId) {
if (projectId) {
return get('/project/version/get-project-versions/' + projectId);
}
return {};
}
export function getOwnerProjectIds() { export function getOwnerProjectIds() {
let url = '/api/project/get/owner/ids'; let url = '/api/project/get/owner/ids';
@ -32,9 +25,9 @@ export function getMaintainer() {
return get(url); return get(url);
} }
export function getProjectVersions(projectId) { // export function getProjectVersions(projectId) {
return get('/project/version/get-project-versions/' + projectId); // return get('/project/version/get-project-versions/' + projectId);
} // }
export function versionEnableByProjectId(projectId) { export function versionEnableByProjectId(projectId) {
return get('/project/version/enable/' + projectId); return get('/project/version/enable/' + projectId);

View File

@ -257,7 +257,8 @@ import RelationshipGraphDrawer from "metersphere-frontend/src/components/graph/M
import MsSearch from "metersphere-frontend/src/components/search/MsSearch"; import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
import {mapState} from "pinia"; import {mapState} from "pinia";
import {useStore} from "@/store" import {useStore} from "@/store"
import {getProject, getProjectVersions} from "@/api/project"; import {getProject} from "@/api/project";
import {getVersionFilters} from "@/business/utils/sdk-utils";
import {getProjectApplicationConfig} from "@/api/project-application"; import {getProjectApplicationConfig} from "@/api/project-application";
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn"; import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn"; import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
@ -1062,12 +1063,8 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
if (hasLicense()) { if (hasLicense()) {
getProjectVersions(getCurrentProjectID()) getVersionFilters(getCurrentProjectID())
.then(response => { .then(r => this.versionFilters = r.data);
this.versionFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});
});
} }
}, },
generateColumnKey generateColumnKey

View File

@ -75,7 +75,7 @@ import {TEST_CASE_RELEVANCE_API_CASE_CONFIGS} from "metersphere-frontend/src/com
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
import MsTag from "metersphere-frontend/src/components/MsTag"; import MsTag from "metersphere-frontend/src/components/MsTag";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getTestCaseRelevanceApiList} from "@/api/testCase"; import {getTestCaseRelevanceApiList} from "@/api/testCase";
@ -199,9 +199,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.condition.versionId = currentVersion || null; this.condition.versionId = currentVersion || null;

View File

@ -81,7 +81,7 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
import {TEST_CASE_RELEVANCE_LOAD_CASE} from "metersphere-frontend/src/components/search/search-components"; import {TEST_CASE_RELEVANCE_LOAD_CASE} from "metersphere-frontend/src/components/search/search-components";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import {getTestCaseRelevanceLoadList} from "@/api/testCase"; import {getTestCaseRelevanceLoadList} from "@/api/testCase";
export default { export default {
@ -172,9 +172,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.condition.versionId = currentVersion || null; this.condition.versionId = currentVersion || null;

View File

@ -86,7 +86,7 @@ import PlanStatusTableItem from "@/business/common/tableItems/plan/PlanStatusTab
import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar"; import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTableAdvSearchBar";
import MsTag from "metersphere-frontend/src/components/MsTag"; import MsTag from "metersphere-frontend/src/components/MsTag";
import {TEST_CASE_RELEVANCE_API_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components"; import {TEST_CASE_RELEVANCE_API_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getTestCaseRelevanceScenarioList} from "@/api/testCase"; import {getTestCaseRelevanceScenarioList} from "@/api/testCase";
@ -195,9 +195,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.condition.versionId = currentVersion || null; this.condition.versionId = currentVersion || null;

View File

@ -103,7 +103,7 @@ import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTa
import TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS from "metersphere-frontend/src/components/search/search-components"; import TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS from "metersphere-frontend/src/components/search/search-components";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants"; import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTable from "metersphere-frontend/src/components/table/MsTable";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getOwnerProjects} from "@/business/utils/sdk-utils"; import {getOwnerProjects} from "@/business/utils/sdk-utils";
import {getProjectApplicationConfig} from "@/api/project-application"; import {getProjectApplicationConfig} from "@/api/project-application";
@ -273,9 +273,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
filter(field) { filter(field) {
this.condition.filters = field || null; this.condition.filters = field || null;

View File

@ -64,13 +64,13 @@
<script> <script>
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase"; import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
import {getVersionFilters} from "@/api/project";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {apiDefinitionListBatch, apiDefinitionRelevance} from "@/api/remote/api/api-definition"; import {apiDefinitionListBatch, apiDefinitionRelevance} from "@/api/remote/api/api-definition";
import {apiTestCaseListBlobs, apiTestCaseRelevance} from "@/api/remote/api/api-case"; import {apiTestCaseListBlobs, apiTestCaseRelevance} from "@/api/remote/api/api-case";
import RelevanceApiList from "@/business/plan/view/comonents/api/RelevanceApiList"; import RelevanceApiList from "@/business/plan/view/comonents/api/RelevanceApiList";
import RelevanceCaseList from "@/business/plan/view/comonents/api/RelevanceCaseList"; import RelevanceCaseList from "@/business/plan/view/comonents/api/RelevanceCaseList";
import MsApiModule from "@/business/plan/view/comonents/api/module/ApiModule"; import MsApiModule from "@/business/plan/view/comonents/api/module/ApiModule";
import {getVersionFilters} from "@/business/utils/sdk-utils";
export default { export default {
name: "TestCaseApiRelevance", name: "TestCaseApiRelevance",
@ -227,9 +227,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion, type) { changeVersion(currentVersion, type) {
if (type == 'api') { if (type == 'api') {

View File

@ -36,7 +36,7 @@ import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
import RelevanceScenarioList from "./RelevanceScenarioList"; import RelevanceScenarioList from "./RelevanceScenarioList";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants"; import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
import {getCurrentProjectID, hasLicense, strMapToObj} from "@/business/utils/sdk-utils"; import {getCurrentProjectID, hasLicense, strMapToObj} from "@/business/utils/sdk-utils";
import {getProjectVersions} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import {testPlanAutoCheck} from "@/api/remote/plan/test-plan"; import {testPlanAutoCheck} from "@/api/remote/plan/test-plan";
import {scenarioRelevance} from "@/api/remote/plan/test-plan-scenario"; import {scenarioRelevance} from "@/api/remote/plan/test-plan-scenario";
import MsApiScenarioModule from "@/business/plan/view/comonents/api/module/ApiScenarioModule"; import MsApiScenarioModule from "@/business/plan/view/comonents/api/module/ApiScenarioModule";
@ -175,12 +175,8 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
if (hasLicense()) { if (hasLicense()) {
getProjectVersions(getCurrentProjectID()) getVersionFilters(getCurrentProjectID())
.then(response => { .then(r => this.versionFilters = r.data);
this.versionFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});
});
} }
}, },
} }

View File

@ -205,7 +205,6 @@ import MsPlanRunMode from "@/business/plan/common/PlanRunModeWithEnv";
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn"; import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn"; import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
import {editTestPlanApiCaseOrder, testPlanAutoCheck} from "@/api/remote/plan/test-plan"; import {editTestPlanApiCaseOrder, testPlanAutoCheck} from "@/api/remote/plan/test-plan";
import {getProjectVersions} from "@/api/project";
import {getProjectMemberUserFilter} from "@/api/user"; import {getProjectMemberUserFilter} from "@/api/user";
import {apiTestCaseGet, apiTestCaseReduction} from "@/api/remote/api/api-case"; import {apiTestCaseGet, apiTestCaseReduction} from "@/api/remote/api/api-case";
import { import {
@ -217,6 +216,7 @@ import {
import {apiDefinitionPlanReportGetByCaseId} from "@/api/remote/api/api-definition-report"; import {apiDefinitionPlanReportGetByCaseId} from "@/api/remote/api/api-definition-report";
import {reportSocket, run} from "@/api/remote/plan/test-plan"; import {reportSocket, run} from "@/api/remote/plan/test-plan";
import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus"; import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus";
import {getProjectVersions} from "@/business/utils/sdk-utils";
export default { export default {
name: "TestPlanApiCaseList", name: "TestPlanApiCaseList",

View File

@ -232,10 +232,10 @@ import {
testPlanScenarioList testPlanScenarioList
} from "@/api/remote/plan/test-plan-scenario"; } from "@/api/remote/plan/test-plan-scenario";
import {environmentGroupGetProjectMapName} from "@/api/environment-group"; import {environmentGroupGetProjectMapName} from "@/api/environment-group";
import {getProjectVersions} from "@/api/project";
import {apiAutomationReduction} from "@/api/remote/api/api-automation"; import {apiAutomationReduction} from "@/api/remote/api/api-automation";
import MicroApp from "metersphere-frontend/src/components/MicroApp"; import MicroApp from "metersphere-frontend/src/components/MicroApp";
import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus"; import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus";
import {getVersionFilters} from "@/business/utils/sdk-utils";
export default { export default {
name: "MsTestPlanApiScenarioList", name: "MsTestPlanApiScenarioList",
@ -566,12 +566,8 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
if (hasLicense()) { if (hasLicense()) {
getProjectVersions(getCurrentProjectID()) getVersionFilters(getCurrentProjectID())
.then(response => { .then(r => this.versionFilters = r.data);
this.versionFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});
});
} }
}, },
openById(item) { openById(item) {

View File

@ -114,7 +114,6 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
import MsTag from "metersphere-frontend/src/components/MsTag"; import MsTag from "metersphere-frontend/src/components/MsTag";
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn"; import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn"; import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
import {getVersionFilters} from "@/api/project";
import StatusTableItem from "@/business/common/tableItems/planview/StatusTableItem"; import StatusTableItem from "@/business/common/tableItems/planview/StatusTableItem";
import ReviewStatus from "@/business/case/components/ReviewStatus"; import ReviewStatus from "@/business/case/components/ReviewStatus";
import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem"; import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem";
@ -122,6 +121,7 @@ import TestPlanCaseStatusTableItem from "@/business/common/tableItems/TestPlanCa
import {TEST_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components"; import {TEST_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getProjectApplicationConfig} from "@/api/project-application"; import {getProjectApplicationConfig} from "@/api/project-application";
import {getVersionFilters} from "@/business/utils/sdk-utils";
export default { export default {
name: "FunctionalRelevance", name: "FunctionalRelevance",
@ -281,9 +281,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.page.condition.versionId = currentVersion || null; this.page.condition.versionId = currentVersion || null;

View File

@ -305,8 +305,7 @@ import {
import {SYSTEM_FIELD_NAME_MAP} from "metersphere-frontend/src/utils/table-constants"; import {SYSTEM_FIELD_NAME_MAP} from "metersphere-frontend/src/utils/table-constants";
import {getTestPlanTestCase} from "@/api/testCase"; import {getTestPlanTestCase} from "@/api/testCase";
import TestPlanCaseIssueItem from "@/business/plan/view/comonents/functional/TestPlanCaseIssueItem"; import TestPlanCaseIssueItem from "@/business/plan/view/comonents/functional/TestPlanCaseIssueItem";
import {getProjectVersions} from "@/api/project"; import {getCustomFieldValueForTrack, getProjectMemberOption, getProjectVersions} from "@/business/utils/sdk-utils";
import {getCustomFieldValueForTrack, getProjectMemberOption} from "@/business/utils/sdk-utils";
import { import {
testPlanTestCaseBatchDelete, testPlanTestCaseBatchDelete,
testPlanTestCaseBatchEdit, testPlanTestCaseBatchEdit,

View File

@ -109,7 +109,7 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
import {_filter, buildBatchParam} from "metersphere-frontend/src/utils/tableUtils"; import {_filter, buildBatchParam} from "metersphere-frontend/src/utils/tableUtils";
import {TEST_PLAN_RELEVANCE_LOAD_CASE} from "metersphere-frontend/src/components/search/search-components"; import {TEST_PLAN_RELEVANCE_LOAD_CASE} from "metersphere-frontend/src/components/search/search-components";
import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTable from "metersphere-frontend/src/components/table/MsTable";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import MsPerformanceTestStatus from "@/business/performance/PerformanceTestStatus"; import MsPerformanceTestStatus from "@/business/performance/PerformanceTestStatus";
import {testPlanLoadRelevance, testPlanLoadRelevanceList} from "@/api/remote/plan/test-plan-load-case"; import {testPlanLoadRelevance, testPlanLoadRelevanceList} from "@/api/remote/plan/test-plan-load-case";
@ -288,9 +288,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
changeVersion(currentVersion) { changeVersion(currentVersion) {
this.condition.versionId = currentVersion || null; this.condition.versionId = currentVersion || null;

View File

@ -165,14 +165,13 @@ import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpda
import LoadCaseConfig from "@/business/plan/view/comonents/load/LoadCaseConfig"; import LoadCaseConfig from "@/business/plan/view/comonents/load/LoadCaseConfig";
import MsTaskCenter from "metersphere-frontend/src/components/task/TaskCenter"; import MsTaskCenter from "metersphere-frontend/src/components/task/TaskCenter";
import {editTestPlanLoadCaseOrder, testPlanAutoCheck, testPlanLoadCaseEditStatus} from "@/api/remote/plan/test-plan"; import {editTestPlanLoadCaseOrder, testPlanAutoCheck, testPlanLoadCaseEditStatus} from "@/api/remote/plan/test-plan";
import {hasLicense} from "@/business/utils/sdk-utils"; import {getProjectVersions, hasLicense} from "@/business/utils/sdk-utils";
import { import {
testPlanLoadCaseBatchDelete, testPlanLoadCaseBatchDelete,
testPlanLoadCaseDelete, testPlanLoadCaseReportExist, testPlanLoadCaseRun, testPlanLoadCaseDelete, testPlanLoadCaseReportExist, testPlanLoadCaseRun,
testPlanLoadCaseRunBatch, testPlanLoadCaseRunBatch,
testPlanLoadCaseSelectAllTableRows, testPlanLoadCaseUpdate, testPlanLoadList testPlanLoadCaseSelectAllTableRows, testPlanLoadCaseUpdate, testPlanLoadList
} from "@/api/remote/plan/test-plan-load-case"; } from "@/api/remote/plan/test-plan-load-case";
import {getProjectVersions} from "@/api/project";
import MicroApp from "metersphere-frontend/src/components/MicroApp"; import MicroApp from "metersphere-frontend/src/components/MicroApp";

View File

@ -81,8 +81,7 @@ import MsTableAdvSearchBar from "metersphere-frontend/src/components/search/MsTa
import TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS from "metersphere-frontend/src/components/search/search-components"; import TEST_PLAN_RELEVANCE_API_SCENARIO_CONFIGS from "metersphere-frontend/src/components/search/search-components";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants"; import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTable from "metersphere-frontend/src/components/table/MsTable";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import {getApiScenarioEnvByProjectId} from "@/api/remote/api/api-automation";
import {getOwnerProjects} from "@/business/utils/sdk-utils"; import {getOwnerProjects} from "@/business/utils/sdk-utils";
import {getProjectApplicationConfig} from "@/api/project-application"; import {getProjectApplicationConfig} from "@/api/project-application";
import {testPlanUiScenarioRelevanceList} from "@/api/remote/ui/test-plan-ui-scenario-case"; import {testPlanUiScenarioRelevanceList} from "@/api/remote/ui/test-plan-ui-scenario-case";
@ -232,9 +231,7 @@ export default {
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId) getVersionFilters(this.projectId)
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
}, },
filter(field) { filter(field) {
this.condition.filters = field || null; this.condition.filters = field || null;

View File

@ -212,7 +212,7 @@ import {
testPlanUiScenarioCaseRun, testPlanUiScenarioCaseSelectAllTableRows, testPlanUiScenarioEnv, testPlanUiScenarioCaseRun, testPlanUiScenarioCaseSelectAllTableRows, testPlanUiScenarioEnv,
testPlanUiScenarioList testPlanUiScenarioList
} from "@/api/remote/ui/test-plan-ui-scenario-case"; } from "@/api/remote/ui/test-plan-ui-scenario-case";
import {getVersionFilters} from "@/api/project"; import {getVersionFilters} from "@/business/utils/sdk-utils";
import {uiAutomationReduction, uiAutomationVerifySeleniumServer} from "@/api/remote/ui/api-scenario"; import {uiAutomationReduction, uiAutomationVerifySeleniumServer} from "@/api/remote/ui/api-scenario";
import {environmentGroupGetProjectMapName} from "@/api/environment-group"; import {environmentGroupGetProjectMapName} from "@/api/environment-group";
import i18n from "@/i18n"; import i18n from "@/i18n";
@ -646,9 +646,7 @@ export default {
getVersionOptions() { getVersionOptions() {
if (hasLicense()) { if (hasLicense()) {
getVersionFilters(getCurrentProjectID()) getVersionFilters(getCurrentProjectID())
.then((data) => { .then(r => this.versionFilters = r.data);
this.versionFilters = data;
});
} }
}, },
} }

View File

@ -130,10 +130,10 @@ import MsTablePagination from "metersphere-frontend/src/components/pagination/Ta
import MsDialogHeader from "metersphere-frontend/src/components/MsDialogHeader"; import MsDialogHeader from "metersphere-frontend/src/components/MsDialogHeader";
import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTable from "metersphere-frontend/src/components/table/MsTable";
import TableSelectCountBar from "metersphere-frontend/src/components/table/TableSelectCountBar"; import TableSelectCountBar from "metersphere-frontend/src/components/table/TableSelectCountBar";
import {getVersionFilters, projectRelated} from "@/api/project";
import VersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import VersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import {getTestCaseReviewRelevance, getTestCaseReviewsCasePage} from "@/api/test-review"; import {getTestCaseReviewRelevance, getTestCaseReviewsCasePage} from "@/api/test-review";
import {testCaseNodeListReviewRelate} from "@/api/test-case-node"; import {testCaseNodeListReviewRelate} from "@/api/test-case-node";
import {getVersionFilters} from "@/business/utils/sdk-utils";
export default { export default {
name: "TestReviewRelevance", name: "TestReviewRelevance",
@ -360,9 +360,8 @@ export default {
this.selectNodeIds = []; this.selectNodeIds = [];
}, },
getVersionOptions() { getVersionOptions() {
getVersionFilters(this.projectId, (data) => { getVersionFilters(this.projectId)
this.versionFilters = data; .then(r => this.versionFilters = r.data);
});
}, },
changeVersion(version) { changeVersion(version) {
this.condition.versionId = version || null; this.condition.versionId = version || null;

View File

@ -204,13 +204,14 @@ import {editTestReviewTestCaseOrder, getTestReviewTestCase} from "@/api/testCase
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {hasLicense} from "metersphere-frontend/src/utils/permission"; import {hasLicense} from "metersphere-frontend/src/utils/permission";
import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem"; import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem";
import {getProjectConfig, getVersionFilters} from "@/api/project"; import {getProjectConfig} from "@/api/project";
import { import {
batchDeleteTestReviewCase, batchDeleteTestReviewCase,
batchEditTestReviewCaseStatus, batchEditTestReviewCaseStatus,
deleteTestReviewCase, getTesReviewById deleteTestReviewCase, getTesReviewById
} from "@/api/test-review"; } from "@/api/test-review";
import {useStore} from "@/store"; import {useStore} from "@/store";
import {getVersionFilters} from "@/business/utils/sdk-utils";
export default { export default {
name: "TestReviewTestCaseList", name: "TestReviewTestCaseList",
@ -563,11 +564,7 @@ export default {
getVersionOptions() { getVersionOptions() {
if (hasLicense()) { if (hasLicense()) {
getVersionFilters(getCurrentProjectID()) getVersionFilters(getCurrentProjectID())
.then((response) => { .then(r => this.versionFilters = r.data);
this.versionFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});
})
} }
}, },
} }

View File

@ -15,7 +15,7 @@ export {deleteMarkDownImgByName} from "metersphere-frontend/src/api/img";
export {getApiDefinitionById, getApiTestCasePages} from "metersphere-frontend/src/api/environment"; export {getApiDefinitionById, getApiTestCasePages} from "metersphere-frontend/src/api/environment";
export {getOwnerProjects, getProjectListAll} from "metersphere-frontend/src/api/project"; export {getOwnerProjects, getProjectListAll} from "metersphere-frontend/src/api/project";
export {deleteRelationshipEdge} from "metersphere-frontend/src/api/relationship-edge"; export {deleteRelationshipEdge} from "metersphere-frontend/src/api/relationship-edge";
export {isProjectVersionEnable} from "metersphere-frontend/src/api/version"; export {isProjectVersionEnable, getProjectVersions, getVersionFilters} from "metersphere-frontend/src/api/version";
import { import {