refactor: 接口依赖关系可以选择版本

This commit is contained in:
CaptainB 2022-01-14 15:11:45 +08:00 committed by 刘瑞斌
parent 9e9f206507
commit b4b102de4d
1 changed files with 16 additions and 1 deletions

View File

@ -16,8 +16,12 @@
ref="nodeTree"/>
</template>
<version-select v-xpack :project-id="projectId" :default-version="currentVersion"
@changeVersion="currentVersionChange"/>
<api-table-list
:table-data="tableData"
:project-id="projectId"
:total="total"
:condition="condition"
:select-node-ids="selectNodeIds"
@ -36,9 +40,13 @@
import TestCaseRelevanceBase from "@/business/components/track/plan/view/comonents/base/TestCaseRelevanceBase";
import ApiTableList from "@/business/components/api/definition/components/complete/ApiTableList";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {};
export default {
name: "ApiRelationshipRelevance",
components: {
'VersionSelect': VersionSelect.default,
ApiTableList,
TestCaseRelevanceBase,
MsApiModule,
@ -55,7 +63,8 @@
projectId: "",
result: {},
total: 0,
tableData: []
tableData: [],
currentVersion: null,
};
},
watch: {
@ -89,6 +98,8 @@
this.condition.protocol = "HTTP";
}
this.condition.versionId = this.currentVersion;
this.$nextTick(() => {
if (this.apiDefinitionId) {
this.condition.id = this.apiDefinitionId;
@ -134,6 +145,10 @@
this.$emit('refresh');
});
},
currentVersionChange(currentVersion) {
this.currentVersion = currentVersion || null;
this.initTable();
},
}
}
</script>