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; } }