通知系统-1

This commit is contained in:
yml2213
2026-05-14 17:29:12 +08:00
parent 91d74b3e59
commit b6c493d5e7
22 changed files with 1314 additions and 11 deletions
@@ -4,16 +4,19 @@ import { onMounted, ref } from 'vue'
import AdminPlatformAgisoSection from '@/components/admin/AdminPlatformAgisoSection.vue'
import AdminPlatformCloudtentaclesSection from '@/components/admin/AdminPlatformCloudtentaclesSection.vue'
import AdminPlatformNinetyoneSection from '@/components/admin/AdminPlatformNinetyoneSection.vue'
import AdminPlatformNotificationSection from '@/components/admin/AdminPlatformNotificationSection.vue'
import AdminPlatformKuaishouEticketSection from '@/components/admin/AdminPlatformKuaishouEticketSection.vue'
import { useAdminAgisoPlatform } from '@/composables/admin/platform-shops/useAdminAgisoPlatform'
import { useAdminCloudtentaclesPlatform } from '@/composables/admin/platform-shops/useAdminCloudtentaclesPlatform'
import { useAdminNinetyonePlatform } from '@/composables/admin/platform-shops/useAdminNinetyonePlatform'
import { useAdminNotificationPlatform } from '@/composables/admin/platform-shops/useAdminNotificationPlatform'
import { useAdminKuaishouEticketPlatform } from '@/composables/admin/platform-shops/useAdminKuaishouEticketPlatform'
import type { PlatformTab } from '@/composables/admin/platform-shops/types'
import {
fetchAdminAgisoShopConfigs,
fetchAdminCloudtentaclesSourceConfig,
fetchAdminKuaishouEticketSourceConfig,
fetchAdminNotificationConfig,
} from '@/services/admin'
import { hasAdminRole } from '@/utils/admin-auth'
import '@/styles/admin-platform-shops.css'
@@ -55,6 +58,22 @@ const {
handleNinetyoneFailOrder,
} = useAdminNinetyonePlatform()
const {
notificationFilePath,
notificationForm,
notificationRecipients,
notificationSaving,
notificationTesting,
notificationResultError,
notificationTestResult,
notificationStats,
hydrateNotificationConfig,
addNotificationRecipient,
removeNotificationRecipient,
handleNotificationSaveConfig,
handleNotificationTest,
} = useAdminNotificationPlatform()
const {
kuaishouEticketFilePath,
kuaishouEticketShops,
@@ -132,13 +151,15 @@ async function loadConfigs() {
errorMessage.value = ''
try {
const [agisoResponse, kuaishouEticketResponse, cloudtentaclesResponse] = await Promise.all([
const [agisoResponse, notificationResponse, kuaishouEticketResponse, cloudtentaclesResponse] = await Promise.all([
fetchAdminAgisoShopConfigs(),
fetchAdminNotificationConfig(),
fetchAdminKuaishouEticketSourceConfig(),
fetchAdminCloudtentaclesSourceConfig(),
])
hydrateAgisoConfig(agisoResponse.data)
hydrateNotificationConfig(notificationResponse.data)
hydrateKuaishouEticketConfig(kuaishouEticketResponse.data)
hydrateCloudtentaclesConfig(cloudtentaclesResponse.data)
await loadNinetyoneOrders(1)
@@ -198,6 +219,23 @@ onMounted(loadConfigs)
</div>
</button>
<button
type="button"
:class="['platform-overview-card', { 'is-active': activePlatform === 'notifications' }]"
@click="switchPlatform('notifications')"
>
<div class="platform-head">
<span class="platform-badge">内部通知</span>
<span class="platform-tag">Bark / 值班</span>
</div>
<strong>{{ notificationStats.enabledRecipientCount }}</strong>
<span>启用接收人</span>
<div class="platform-metrics">
<span>配置 {{ notificationStats.configuredRecipientCount }} </span>
<span>最近成功 {{ notificationStats.lastSuccessCount }} </span>
</div>
</button>
<button
type="button"
:class="['platform-overview-card', { 'is-active': activePlatform === 'ninetyone' }]"
@@ -266,6 +304,13 @@ onMounted(loadConfigs)
>
91卡券接入
</button>
<button
type="button"
:class="['switch-chip', { 'is-active': activePlatform === 'notifications' }]"
@click="switchPlatform('notifications')"
>
内部通知
</button>
<button
type="button"
:class="['switch-chip', { 'is-active': activePlatform === 'kuaishouEticket' }]"
@@ -314,6 +359,22 @@ onMounted(loadConfigs)
:handle-ninetyone-fail-order="handleNinetyoneFailOrder"
/>
<AdminPlatformNotificationSection
v-else-if="activePlatform === 'notifications'"
:notification-file-path="notificationFilePath"
:notification-form="notificationForm"
:notification-recipients="notificationRecipients"
:notification-saving="notificationSaving"
:notification-testing="notificationTesting"
:notification-result-error="notificationResultError"
:notification-test-result="notificationTestResult"
:notification-stats="notificationStats"
:add-notification-recipient="addNotificationRecipient"
:remove-notification-recipient="removeNotificationRecipient"
:handle-notification-save-config="handleNotificationSaveConfig"
:handle-notification-test="handleNotificationTest"
/>
<AdminPlatformKuaishouEticketSection
v-else-if="activePlatform === 'kuaishouEticket'"
:kuaishou-eticket-file-path="kuaishouEticketFilePath"