From 088e922ec915a958bc245a67e1ffcc4d72f7784c Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 26 Jun 2026 16:29:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(push-config):=20=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E5=8E=82=E5=95=86=E5=8D=A1=E7=89=87=E5=86=85=E5=B5=8C=20Profil?= =?UTF-8?q?es=EF=BC=8C=E7=8B=AC=E7=AB=8B=E4=BF=9D=E5=AD=98=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除全局"厂商凭据"包裹卡和底部"平台 Profiles"卡 - 每个厂商独立一张卡:凭据 + 通知渠道 Profiles + 保存按钮 - Profiles 按厂商过滤展示,支持在对应厂商卡内添加/删除 - iOS APNs 卡额外显示 Thread ID 和中断级别列 - savingMap 替代独立的 saving ref,各厂商 loading 状态独立 Co-Authored-By: Claude Sonnet 4.6 --- .../src/views/push/PushConfigView.vue | 269 ++++++------------ 1 file changed, 86 insertions(+), 183 deletions(-) diff --git a/tenant-platform/src/views/push/PushConfigView.vue b/tenant-platform/src/views/push/PushConfigView.vue index 7410e3b..3733ca7 100644 --- a/tenant-platform/src/views/push/PushConfigView.vue +++ b/tenant-platform/src/views/push/PushConfigView.vue @@ -33,175 +33,127 @@ - + -
- - -
{{ vendor.hint }}
- - - - - - - -
+ +
{{ vendor.hint }}
+ + + + + + + + + + 通知渠道 Profiles + + 添加 + + +
+ 暂无 Profiles,点击「+ 添加」创建
- - - - - - - - - + + - + - + - + - + - - - - - - - + - + - + - + - + - - - - + - + - - - - - - - -
- 刷新 - 保存 Profiles -
+ +
+ 刷新配置 +
@@ -266,8 +218,7 @@ const route = useRoute() const app = ref(null) const services = ref([]) const loading = ref(false) -const savingVendors = ref(false) -const savingProfiles = ref(false) +const savingMap = reactive>({}) const isMobile = ref(window.innerWidth < 768) const selectedPlatform = ref<'ANDROID' | 'IOS' | 'HARMONY'>('ANDROID') @@ -562,32 +513,24 @@ function buildPayload(): PushServiceConfig { } } -async function saveVendors() { +async function saveVendorConfig(vendorKey: PushVendorKey) { if (!app.value) return - savingVendors.value = true + savingMap[vendorKey] = true try { await appApi.updateServiceConfig(app.value.appKey, selectedPlatform.value, 'PUSH', { pushConfig: buildPayload() }) - ElMessage.success('厂商凭据已保存') + ElMessage.success('配置已保存') await loadData() } catch { ElMessage.error('保存失败') } finally { - savingVendors.value = false + savingMap[vendorKey] = false } } -async function saveProfiles() { - if (!app.value) return - savingProfiles.value = true - try { - await appApi.updateServiceConfig(app.value.appKey, selectedPlatform.value, 'PUSH', { pushConfig: buildPayload() }) - ElMessage.success('Profiles 已保存') - await loadData() - } catch { - ElMessage.error('保存失败') - } finally { - savingProfiles.value = false - } +function vendorProfilesWithIndex(vendorKey: PushVendorKey) { + return pushConfig.profiles + .map((profile, index) => ({ profile, index })) + .filter(({ profile }) => profile.vendor === vendorKey) } function addProfile(vendor: PushVendorKey = 'xiaomi') { @@ -627,16 +570,6 @@ onBeforeUnmount(() => window.removeEventListener('resize', updateViewport)) overflow-x: auto; } -.vendor-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); - gap: 16px; -} - -.vendor-card { - min-height: 100%; -} - .vendor-hint { margin-bottom: 12px; font-size: 12px; @@ -644,44 +577,14 @@ onBeforeUnmount(() => window.removeEventListener('resize', updateViewport)) line-height: 1.5; } -.profiles-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - flex-wrap: wrap; -} - -.profiles-actions { - display: flex; - flex-wrap: wrap; - gap: 8px; -} - -.toolbar { - margin-top: 16px; - display: flex; - gap: 8px; - flex-wrap: wrap; -} - -.profiles-table :deep(.el-select), -.profiles-table :deep(.el-input), -.profiles-table :deep(.el-input-number) { +/* Profile 嵌入表格内的 select / input 撑满列宽 */ +:deep(.el-table .el-select), +:deep(.el-table .el-input) { width: 100%; } @media (max-width: 767px) { - .vendor-grid { - grid-template-columns: 1fr; - } - - .toolbar :deep(.el-button), - .profiles-actions :deep(.el-button) { - width: 100%; - } - - .vendor-card :deep(.el-form-item__label) { + :deep(.el-form-item__label) { padding-bottom: 4px; } }