From 416783047c7e019aceff58e48b54fce6d752e4c6 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Mon, 18 May 2026 16:48:20 +0800 Subject: [PATCH] feat(tenant-platform): editable changelog with audit trail in version table Adds an edit button (pencil icon) on each row's changelog cell. Clicking it opens a dialog pre-filled with the current text; saving calls PATCH /app/{id}/changelog and refreshes the list and op-log. Co-Authored-By: Claude Sonnet 4.6 --- tenant-platform/src/api/update.ts | 4 ++ .../views/update/VersionManagementView.vue | 55 ++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/tenant-platform/src/api/update.ts b/tenant-platform/src/api/update.ts index 362018f..10f470f 100644 --- a/tenant-platform/src/api/update.ts +++ b/tenant-platform/src/api/update.ts @@ -236,6 +236,10 @@ export const updateAdminApi = { return updateClient.post(`/api/v1/updates/app/${id}/unpublish`, { reason }) }, + patchChangeLog(id: string, changeLog: string) { + return updateClient.patch<{ data: AppVersion }>(`/api/v1/updates/app/${id}/changelog`, { changeLog }) + }, + grayAppVersion(id: string, body: { enabled: boolean grayMode: GrayMode diff --git a/tenant-platform/src/views/update/VersionManagementView.vue b/tenant-platform/src/views/update/VersionManagementView.vue index 22136ba..dcd2e0a 100644 --- a/tenant-platform/src/views/update/VersionManagementView.vue +++ b/tenant-platform/src/views/update/VersionManagementView.vue @@ -106,7 +106,16 @@ - + + + @@ -670,6 +679,22 @@ + + + + + + ('IMMEDIATE') const publishScheduleAt = ref('') const updatingPublishSchedule = ref(false) +const showChangelogEdit = ref(false) +const changelogEditId = ref('') +const changelogEditValue = ref('') +const savingChangelog = ref(false) + +function openChangelogEdit(row: AppVersion) { + changelogEditId.value = row.id + changelogEditValue.value = row.changeLog ?? '' + showChangelogEdit.value = true +} + +async function submitChangelogEdit() { + savingChangelog.value = true + try { + await updateAdminApi.patchChangeLog(changelogEditId.value, changelogEditValue.value) + ElMessage.success('更新说明已保存') + showChangelogEdit.value = false + await loadAppVersions() + await loadOperationLogs() + } catch { + ElMessage.error('保存失败') + } finally { + savingChangelog.value = false + } +} + async function handleCancelReview(storeType?: string) { if (!storeReviewDetailVersion.value) return const stores = storeType