Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(version-diff): 修复新建的网关在生成版本时差异对比无内容的问题 #1079

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const isShow = ref(false);
const dialogShow = ref(false);
const versionList = ref<any>([]);
const formRef = ref(null);
const diffSourceId = ref('');
const diffSourceId = ref<number | string>('');
const diffTargetId = ref('');
const loading = ref(false);
const createError = ref<boolean>(false);
Expand Down Expand Up @@ -324,12 +324,14 @@ const showReleaseSideslider = () => {

// 获取资源版本列表
const getResourceVersions = async () => {
try {
const res = await getResourceVersionsList(apigwId.value, { offset: 0, limit: 999 });
versionList.value = res.results;
const res = await getResourceVersionsList(apigwId.value, { offset: 0, limit: 999 });
versionList.value = res.results;

// 新建的网关,需要传入为 0 的 sourceId 去和空版本做对比
if (formData.version === '1.0.0') {
diffSourceId.value = 0;
} else {
diffSourceId.value = versionList.value[0]?.id || '';
} catch (e) {
console.log(e);
}
};

Expand Down Expand Up @@ -392,13 +394,13 @@ watch(
() => isShow.value,
(val) => {
if (val) {
getResourceVersions();
getSuggestionVersion();
getResourceVersions();
} else {
stepsConfig.value.curStep = 1;
formData.version = '';
formData.comment = '';
};
}
},
);

Expand Down
Loading