From 8abcf591474b1ab2a1aef6767366a0c535c04665 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Thu, 11 Jun 2026 13:04:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=8C=85=E5=90=8D=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E4=BF=A1=E6=81=AF=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端增加至少填写一个平台包名的验证逻辑 - 前端调整应用数据模型,将包名字段改为可选类型 - 添加应用详情页的编辑功能和表单验证 - 优化应用列表页包名显示逻辑,支持多平台包名展示 - 重构应用配置指引页面,按平台分类展示商店配置指南 - 在版本管理页面增加包名配置检查和相应提示 - 新增应用信息编辑弹窗组件和相关业务逻辑 --- tenant-platform/src/api/app.ts | 4 +- .../src/views/apps/AppDetailView.vue | 95 +++- .../src/views/apps/AppListView.vue | 42 +- .../src/views/update/StoreGuideView.vue | 487 +++++++++--------- .../views/update/VersionManagementView.vue | 210 ++++++-- 5 files changed, 546 insertions(+), 292 deletions(-) diff --git a/tenant-platform/src/api/app.ts b/tenant-platform/src/api/app.ts index 7eaacd4..8b50b31 100644 --- a/tenant-platform/src/api/app.ts +++ b/tenant-platform/src/api/app.ts @@ -3,7 +3,7 @@ import client from './client' export interface App { id: string tenantId: string - packageName: string + packageName?: string iosBundleId?: string harmonyBundleName?: string name: string @@ -15,7 +15,7 @@ export interface App { } export interface CreateAppRequest { - packageName: string + packageName?: string iosBundleId?: string harmonyBundleName?: string name: string diff --git a/tenant-platform/src/views/apps/AppDetailView.vue b/tenant-platform/src/views/apps/AppDetailView.vue index ad5b675..5fad9e0 100644 --- a/tenant-platform/src/views/apps/AppDetailView.vue +++ b/tenant-platform/src/views/apps/AppDetailView.vue @@ -3,11 +3,17 @@ + {{ app.name }} {{ app.packageName }} - {{ app.iosBundleId ?? '-' }} - {{ app.harmonyBundleName ?? '-' }} + {{ app.iosBundleId || '-' }} + {{ app.harmonyBundleName || '-' }} {{ app.appKey }} @@ -22,7 +28,7 @@ 重置 - {{ app.description ?? '-' }} + {{ app.description || '-' }} 下载 重新生成 @@ -193,6 +199,35 @@ + + + + + + + + + + + + + + + + + + + + + + +
至少填写一个平台的包名
+ +
+ @@ -243,6 +278,59 @@ const submittingActivation = ref(false) const activationForm = ref({ platform: '', serviceType: '', reason: '' }) const regenerating = ref(false) +const showEditDialog = ref(false) +const savingEdit = ref(false) +const editForm = ref({ + name: '', + packageName: '', + iosBundleId: '', + harmonyBundleName: '', + description: '', + iconUrl: '', +}) + +function openEditDialog() { + if (!app.value) return + editForm.value = { + name: app.value.name || '', + packageName: app.value.packageName || '', + iosBundleId: app.value.iosBundleId || '', + harmonyBundleName: app.value.harmonyBundleName || '', + description: app.value.description || '', + iconUrl: app.value.iconUrl || '', + } + showEditDialog.value = true +} + +async function submitEdit() { + if (!editForm.value.name.trim()) { + ElMessage.warning('应用名称不能为空') + return + } + if (!editForm.value.packageName.trim() && !editForm.value.iosBundleId.trim() && !editForm.value.harmonyBundleName.trim()) { + ElMessage.warning('至少填写一个平台的包名') + return + } + savingEdit.value = true + try { + await appApi.update(app.value!.appKey, { + packageName: editForm.value.packageName.trim() || undefined, + name: editForm.value.name.trim(), + iosBundleId: editForm.value.iosBundleId.trim() || undefined, + harmonyBundleName: editForm.value.harmonyBundleName.trim() || undefined, + description: editForm.value.description.trim() || undefined, + iconUrl: editForm.value.iconUrl.trim() || undefined, + }) + ElMessage.success('应用信息已更新') + showEditDialog.value = false + await loadData() + } catch (e: any) { + ElMessage.error(e?.response?.data?.message || '保存失败') + } finally { + savingEdit.value = false + } +} + function isServiceEnabled(svcType: string) { return services.value.some(s => s.serviceType === svcType && s.enabled) } @@ -435,6 +523,7 @@ onBeforeUnmount(() => {