fix(admin-web): 修复通知表单类型错误

为 priority 和 targetType 添加正确的类型断言

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-23 22:57:38 -08:00
parent 4b92173e9e
commit ca95c1decf
1 changed files with 6 additions and 4 deletions

View File

@ -9,6 +9,8 @@ import {
notificationService,
NotificationItem,
NotificationType,
NotificationPriority,
TargetType,
NOTIFICATION_TYPE_OPTIONS,
NOTIFICATION_PRIORITY_OPTIONS,
TARGET_TYPE_OPTIONS,
@ -58,8 +60,8 @@ export default function NotificationsPage() {
title: '',
content: '',
type: 'SYSTEM' as NotificationType,
priority: 'NORMAL',
targetType: 'ALL',
priority: 'NORMAL' as NotificationPriority,
targetType: 'ALL' as TargetType,
imageUrl: '',
linkUrl: '',
publishedAt: '',
@ -363,7 +365,7 @@ export default function NotificationsPage() {
<label></label>
<select
value={formData.priority}
onChange={(e) => setFormData({ ...formData, priority: e.target.value })}
onChange={(e) => setFormData({ ...formData, priority: e.target.value as NotificationPriority })}
>
{NOTIFICATION_PRIORITY_OPTIONS.map((opt) => (
<option key={opt.value} value={opt.value}>
@ -377,7 +379,7 @@ export default function NotificationsPage() {
<label></label>
<select
value={formData.targetType}
onChange={(e) => setFormData({ ...formData, targetType: e.target.value })}
onChange={(e) => setFormData({ ...formData, targetType: e.target.value as TargetType })}
>
{TARGET_TYPE_OPTIONS.map((opt) => (
<option key={opt.value} value={opt.value}>