guoyuqi 2022-12-14 23:05:26 +08:00 committed by xiaomeinvG
parent 080d01417a
commit b9e209999e
2 changed files with 14 additions and 7 deletions

View File

@ -290,6 +290,7 @@
api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time, api_definition.status, api_definition.user_id, api_definition.create_time, api_definition.update_time,
api_definition.delete_user_id, api_definition.create_user,api_definition.delete_time, api_definition.remark, api_definition.delete_user_id, api_definition.create_user,api_definition.delete_time, api_definition.remark,
api_definition.version_id, api_definition.version_id,
api_definition.latest,
project_version.name as version_name, api_definition.ref_id, user.name as user_name project_version.name as version_name, api_definition.ref_id, user.name as user_name
from api_definition from api_definition
left join user on api_definition.user_id = user.id left join user on api_definition.user_id = user.id

View File

@ -12,6 +12,9 @@
<font-awesome-icon v-if="scope.row.isCurrent" <font-awesome-icon v-if="scope.row.isCurrent"
class="icon global focusing" :icon="['fas', 'tag']"/> class="icon global focusing" :icon="['fas', 'tag']"/>
{{ scope.row.name }} {{ scope.row.name }}
<el-tag v-if="scope.row.id === dataLatestId" size="mini" type="primary">
{{ $t('api_test.api_import.latest_version') }}&nbsp;
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" column-key="status" <el-table-column prop="status" column-key="status"
@ -52,11 +55,11 @@
placement="bottom" placement="bottom"
width="100" width="100"
trigger="hover" trigger="hover"
v-if="!scope.row.latest" v-if="scope.row.isCheckout || scope.row.status !== 'open'"
> >
<div style="text-align: left;"> <div style="text-align: left;">
<el-link @click="setLatest(scope.row)" v-if="hasLatest && !scope.row.isCurrent && scope.row.isCheckout" <el-link @click="setLatest(scope.row)" v-if="hasLatest && scope.row.isCheckout"
:disabled="scope.row.isCurrent || isRead"> :disabled="isRead || scope.row.id === dataLatestId">
{{ $t('project.version.set_new') }}&nbsp; {{ $t('project.version.set_new') }}&nbsp;
</el-link> </el-link>
<br/> <br/>
@ -66,8 +69,6 @@
</div> </div>
<span slot="reference">...</span> <span slot="reference">...</span>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -109,7 +110,7 @@ export default {
hasLatest: { hasLatest: {
type: Boolean, type: Boolean,
default: false default: false
}, }
}, },
data() { data() {
return { return {
@ -118,6 +119,7 @@ export default {
versionOptions: [], versionOptions: [],
userData: {}, userData: {},
currentVersion: {}, currentVersion: {},
dataLatestId: ''
}; };
}, },
methods: { methods: {
@ -176,6 +178,10 @@ export default {
this.loading = false; this.loading = false;
return; return;
} }
let latestData = versionData.filter((v) => v.latest === true);
if (latestData) {
this.dataLatestId = latestData[0].versionId;
}
this.versionOptions.forEach(version => { this.versionOptions.forEach(version => {
let vs = versionData.filter(v => v.versionId === version.id); let vs = versionData.filter(v => v.versionId === version.id);
version.isCheckout = vs.length > 0; // version.isCheckout = vs.length > 0; //
@ -210,7 +216,7 @@ export default {
testUsers() { testUsers() {
this.updateUserDataByExternal(); this.updateUserDataByExternal();
} }
} },
}; };
</script> </script>