前端优先级使用中文(高/中/低),需要转换为英文(high/medium/low) .toLowerCase() 无法转换中文字符
This commit is contained in:
@@ -557,11 +557,18 @@ const handleCreateTask = async () => {
|
|||||||
createLoading.value = true
|
createLoading.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 优先级中文转英文映射
|
||||||
|
const priorityMap: Record<string, string> = {
|
||||||
|
'高': 'high',
|
||||||
|
'中': 'medium',
|
||||||
|
'低': 'low'
|
||||||
|
}
|
||||||
|
|
||||||
// 构建请求数据
|
// 构建请求数据
|
||||||
const taskData = {
|
const taskData = {
|
||||||
title: taskForm.title,
|
title: taskForm.title,
|
||||||
description: taskForm.description,
|
description: taskForm.description,
|
||||||
priority: taskForm.priority.toLowerCase(),
|
priority: priorityMap[taskForm.priority] || 'medium',
|
||||||
deadline: taskForm.deadline,
|
deadline: taskForm.deadline,
|
||||||
course_ids: taskForm.courses,
|
course_ids: taskForm.courses,
|
||||||
user_ids: taskForm.assignType === 'all' ? [] : taskForm.members,
|
user_ids: taskForm.assignType === 'all' ? [] : taskForm.members,
|
||||||
|
|||||||
Reference in New Issue
Block a user