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
080d01417a
commit
b9e209999e
|
@ -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
|
||||||
|
|
|
@ -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') }}
|
||||||
|
</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') }}
|
{{ $t('project.version.set_new') }}
|
||||||
</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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue