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:
parent
4b92173e9e
commit
ca95c1decf
|
|
@ -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}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue