refactor: 编辑api时显现当前版本

This commit is contained in:
CaptainB 2021-12-30 15:08:48 +08:00 committed by 刘瑞斌
parent 4863ed0682
commit 407b2e5484
7 changed files with 33 additions and 4 deletions

View File

@ -91,6 +91,7 @@
<api-case-simple-list
class="api-case-simple-list"
:apiDefinitionId="currentApi.id"
:current-version="currentApi.versionId"
:trash-enable="false"
@changeSelectDataRangeAll="changeSelectDataRangeAll"
@handleCase="handleCase"
@ -239,6 +240,7 @@ export default {
this.$post('/mockConfig/genMockConfig', mockParam, response => {
let mockConfig = response.data;
mockConfig.apiName = this.currentApi.name;
mockConfig.versionName = this.currentApi.versionName;
this.baseMockConfigData = mockConfig;
});
}
@ -359,4 +361,13 @@ export default {
height: calc(100vh - 262px) !important;
}
/deep/ .ms-opt-btn {
position: fixed;
right: 50px;
z-index: 1;
top: 128px;
float: right;
margin-right: 20px;
margin-top: 5px;
}
</style>

View File

@ -1,9 +1,9 @@
<template>
<span>
<span>
<el-link type="primary" style="float:right;margin-top: 5px" @click="open">{{ $t('commons.adv_search.title') }}
</el-link>
<div class="ms-opt-btn" v-if="apiDefinitionId">
{{ $t('project.version.name') }}: {{ versionName }}
</div>
<el-input :placeholder="$t('commons.search_by_id_name_tag')" @blur="search" @keyup.enter.native="search"
class="search-input" size="small"
v-model="condition.name"/>
@ -404,6 +404,7 @@ export default {
response: {},
timeoutIndex: 0,
versionFilters: [],
versionName: '',
};
},
props: {
@ -1165,6 +1166,7 @@ export default {
getVersionOptions() {
if (hasLicense()) {
this.$get('/project/version/get-project-versions/' + getCurrentProjectID(), response => {
this.versionName = response.data.filter(v => v.id === this.currentVersion)[0].name;
this.versionFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});

View File

@ -1,6 +1,9 @@
<template>
<div>
<div>
<div class="ms-opt-btn">
{{ $t('project.version.name') }}: {{ mockConfigData.versionName }}
</div>
<el-input :placeholder="$t('commons.search_by_name')" class="search-input" size="small"
:clearable="true"
v-model="tableSearch"/>

View File

@ -1,6 +1,9 @@
<template>
<div class="card-container">
<div class="ms-opt-btn">
{{ $t('project.version.name') }}: {{ apiData.versionName }}
</div>
<el-card class="card-content">
<!-- 操作按钮 -->
<el-dropdown split-button type="primary" class="ms-api-buttion" @click="handleCommand('add')"

View File

@ -1,6 +1,9 @@
<template>
<div class="card-container">
<div class="ms-opt-btn">
{{ $t('project.version.name') }}: {{ apiData.versionName }}
</div>
<el-card class="card-content">
<el-form :model="api" :rules="rules" ref="apiData" :inline="true" label-position="right">
@ -116,7 +119,8 @@ export default {
runData: [],
reportId: "",
envMap: new Map,
runLoading: false
runLoading: false,
versionName: '',
}
},
props: {apiData: {}, currentProtocol: String, syncTabs: Array, projectId: String},

View File

@ -1,6 +1,9 @@
<template>
<div class="card-container">
<div class="ms-opt-btn">
{{ $t('project.version.name') }}: {{ apiData.versionName }}
</div>
<el-card class="card-content">
<!-- 操作按钮 -->
<el-dropdown split-button type="primary" class="ms-api-buttion" @click="handleCommand('add')"

View File

@ -1,6 +1,9 @@
<template>
<div class="card-container">
<div class="ms-opt-btn">
{{ $t('project.version.name') }}: {{ apiData.versionName }}
</div>
<el-card class="card-content">
<el-form :model="api" :rules="rules" ref="apiData" :inline="true" label-position="right">