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,
|
notificationService,
|
||||||
NotificationItem,
|
NotificationItem,
|
||||||
NotificationType,
|
NotificationType,
|
||||||
|
NotificationPriority,
|
||||||
|
TargetType,
|
||||||
NOTIFICATION_TYPE_OPTIONS,
|
NOTIFICATION_TYPE_OPTIONS,
|
||||||
NOTIFICATION_PRIORITY_OPTIONS,
|
NOTIFICATION_PRIORITY_OPTIONS,
|
||||||
TARGET_TYPE_OPTIONS,
|
TARGET_TYPE_OPTIONS,
|
||||||
|
|
@ -58,8 +60,8 @@ export default function NotificationsPage() {
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
type: 'SYSTEM' as NotificationType,
|
type: 'SYSTEM' as NotificationType,
|
||||||
priority: 'NORMAL',
|
priority: 'NORMAL' as NotificationPriority,
|
||||||
targetType: 'ALL',
|
targetType: 'ALL' as TargetType,
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
linkUrl: '',
|
linkUrl: '',
|
||||||
publishedAt: '',
|
publishedAt: '',
|
||||||
|
|
@ -363,7 +365,7 @@ export default function NotificationsPage() {
|
||||||
<label>优先级</label>
|
<label>优先级</label>
|
||||||
<select
|
<select
|
||||||
value={formData.priority}
|
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) => (
|
{NOTIFICATION_PRIORITY_OPTIONS.map((opt) => (
|
||||||
<option key={opt.value} value={opt.value}>
|
<option key={opt.value} value={opt.value}>
|
||||||
|
|
@ -377,7 +379,7 @@ export default function NotificationsPage() {
|
||||||
<label>目标用户</label>
|
<label>目标用户</label>
|
||||||
<select
|
<select
|
||||||
value={formData.targetType}
|
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) => (
|
{TARGET_TYPE_OPTIONS.map((opt) => (
|
||||||
<option key={opt.value} value={opt.value}>
|
<option key={opt.value} value={opt.value}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue