From c5841066d5e2e0a84705ad2dc52cbe4de4c91e99 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 19 Jan 2022 12:15:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=97=B6=E5=80=99=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=88=97=E4=B8=8D=E8=83=BD=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009766 --user=刘瑞斌 【接口测试】场景 添加接口定义/用例,版本下拉框没有数据 https://www.tapd.cn/55049933/s/1094089 --- .../automation/scenario/api/ApiRelevance.vue | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue index 5b6fc4c8b6..c9966242b7 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue @@ -67,6 +67,7 @@ import MsMainContainer from "../../../../common/components/MsMainContainer"; import ScenarioRelevanceApiList from "./RelevanceApiList"; import RelevanceDialog from "../../../../track/plan/view/comonents/base/RelevanceDialog"; import TestCaseRelevanceBase from "@/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase"; +import {hasLicense} from "@/common/js/utils"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {}; @@ -98,6 +99,7 @@ export default { projectId() { this.refresh(); this.$refs.nodeTree.list(this.projectId); + this.getVersionOptions(); } }, methods: { @@ -157,6 +159,7 @@ export default { open() { this.buttonIsWorking = false; this.$refs.baseRelevance.open(); + this.getVersionOptions(); }, isApiListEnableChange(data) { this.isApiListEnable = data; @@ -183,6 +186,24 @@ export default { setProject(projectId) { this.projectId = projectId; }, + getVersionOptions(currentVersion) { + if (hasLicense()) { + if (!this.projectId) { + return; + } + this.$get('/project/version/get-project-versions/' + this.projectId, response => { + if (currentVersion) { + this.versionFilters = response.data.filter(u => u.id === currentVersion).map(u => { + return {text: u.name, value: u.id}; + }); + } else { + this.versionFilters = response.data.map(u => { + return {text: u.name, value: u.id}; + }); + } + }); + } + }, } };