mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +08:00
refactor(通用功能): 版本置新修改
--bug=1020864 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020864 --bug=1020866 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020866 --bug=1020869 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020869
This commit is contained in:
parent
669ccb261c
commit
33a17a3c4e
@ -290,6 +290,7 @@
|
||||
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.version_id,
|
||||
api_definition.latest,
|
||||
project_version.name as version_name, api_definition.ref_id, user.name as user_name
|
||||
from api_definition
|
||||
left join user on api_definition.user_id = user.id
|
||||
|
@ -12,6 +12,9 @@
|
||||
<font-awesome-icon v-if="scope.row.isCurrent"
|
||||
class="icon global focusing" :icon="['fas', 'tag']"/>
|
||||
{{ scope.row.name }}
|
||||
<el-tag v-if="scope.row.id === dataLatestId" size="mini" type="primary">
|
||||
{{ $t('api_test.api_import.latest_version') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" column-key="status"
|
||||
@ -52,11 +55,11 @@
|
||||
placement="bottom"
|
||||
width="100"
|
||||
trigger="hover"
|
||||
v-if="!scope.row.latest"
|
||||
v-if="scope.row.isCheckout || scope.row.status !== 'open'"
|
||||
>
|
||||
<div style="text-align: left;">
|
||||
<el-link @click="setLatest(scope.row)" v-if="hasLatest && !scope.row.isCurrent && scope.row.isCheckout"
|
||||
:disabled="scope.row.isCurrent || isRead">
|
||||
<el-link @click="setLatest(scope.row)" v-if="hasLatest && scope.row.isCheckout"
|
||||
:disabled="isRead || scope.row.id === dataLatestId">
|
||||
{{ $t('project.version.set_new') }}
|
||||
</el-link>
|
||||
<br/>
|
||||
@ -66,8 +69,6 @@
|
||||
</div>
|
||||
<span slot="reference">...</span>
|
||||
</el-popover>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -109,7 +110,7 @@ export default {
|
||||
hasLatest: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -118,6 +119,7 @@ export default {
|
||||
versionOptions: [],
|
||||
userData: {},
|
||||
currentVersion: {},
|
||||
dataLatestId: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -176,6 +178,10 @@ export default {
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
let latestData = versionData.filter((v) => v.latest === true);
|
||||
if (latestData) {
|
||||
this.dataLatestId = latestData[0].versionId;
|
||||
}
|
||||
this.versionOptions.forEach(version => {
|
||||
let vs = versionData.filter(v => v.versionId === version.id);
|
||||
version.isCheckout = vs.length > 0; // 已存在可以切换,不存在则创建
|
||||
@ -210,7 +216,7 @@ export default {
|
||||
testUsers() {
|
||||
this.updateUserDataByExternal();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user