feat(frontend): update schedule center and war room pages
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -4,7 +4,7 @@ import { animate } from 'motion'
|
||||
import { goalApi, type Goal } from '@/api/goal'
|
||||
import { reminderApi, type Reminder } from '@/api/reminder'
|
||||
import { scheduleCenterApi, type ScheduleCenterDateResponse, type ScheduleCenterDaySummary } from '@/api/scheduleCenter'
|
||||
import { taskApi, type Task, type TaskPriority, type TaskStatus } from '@/api/task'
|
||||
import { taskApi, type Task, type TaskAssigneeType, type TaskPriority, type TaskQuadrant, type TaskStatus } from '@/api/task'
|
||||
import { todoApi, type Todo } from '@/api/todo'
|
||||
|
||||
type TimelineItem =
|
||||
@@ -28,7 +28,12 @@ export function useScheduleCenterPage() {
|
||||
|
||||
const newTodoTitle = ref('')
|
||||
const newTaskTitle = ref('')
|
||||
const newTaskDescription = ref('')
|
||||
const newTaskPriority = ref<TaskPriority>('medium')
|
||||
const newTaskQuadrant = ref<TaskQuadrant>('not-urgent-important')
|
||||
const newTaskAssigneeType = ref<TaskAssigneeType | ''>('commander')
|
||||
const newTaskAssigneeId = ref('')
|
||||
const newTaskDispatchToCommander = ref(false)
|
||||
const newReminderTitle = ref('')
|
||||
const newReminderTime = ref('09:00')
|
||||
const newGoalTitle = ref('')
|
||||
@@ -319,9 +324,24 @@ export function useScheduleCenterPage() {
|
||||
async function addTask() {
|
||||
if (!newTaskTitle.value.trim()) return
|
||||
try {
|
||||
await taskApi.create({ title: newTaskTitle.value.trim(), priority: newTaskPriority.value, due_date: `${selectedDate.value}T09:00:00Z` })
|
||||
await taskApi.create({
|
||||
title: newTaskTitle.value.trim(),
|
||||
description: newTaskDescription.value.trim() || undefined,
|
||||
priority: newTaskPriority.value,
|
||||
quadrant: newTaskQuadrant.value,
|
||||
assignee_type: newTaskAssigneeType.value || undefined,
|
||||
assignee_id: newTaskAssigneeId.value.trim() || undefined,
|
||||
due_date: `${selectedDate.value}T09:00:00Z`,
|
||||
source: 'schedule_center',
|
||||
dispatch_to_commander: newTaskDispatchToCommander.value,
|
||||
})
|
||||
newTaskTitle.value = ''
|
||||
newTaskDescription.value = ''
|
||||
newTaskPriority.value = 'medium'
|
||||
newTaskQuadrant.value = 'not-urgent-important'
|
||||
newTaskAssigneeType.value = 'commander'
|
||||
newTaskAssigneeId.value = ''
|
||||
newTaskDispatchToCommander.value = false
|
||||
await Promise.all([loadDateDetail(), loadMonth()])
|
||||
} catch (error) {
|
||||
console.error('新增任务失败', error)
|
||||
@@ -506,7 +526,12 @@ export function useScheduleCenterPage() {
|
||||
loadingDetail,
|
||||
newTodoTitle,
|
||||
newTaskTitle,
|
||||
newTaskDescription,
|
||||
newTaskPriority,
|
||||
newTaskQuadrant,
|
||||
newTaskAssigneeType,
|
||||
newTaskAssigneeId,
|
||||
newTaskDispatchToCommander,
|
||||
newReminderTitle,
|
||||
newReminderTime,
|
||||
newGoalTitle,
|
||||
|
||||
@@ -10,7 +10,12 @@ const {
|
||||
loadingDetail,
|
||||
newTodoTitle,
|
||||
newTaskTitle,
|
||||
newTaskDescription,
|
||||
newTaskPriority,
|
||||
newTaskQuadrant,
|
||||
newTaskAssigneeType,
|
||||
newTaskAssigneeId,
|
||||
newTaskDispatchToCommander,
|
||||
newReminderTitle,
|
||||
newReminderTime,
|
||||
newGoalTitle,
|
||||
@@ -100,7 +105,6 @@ const {
|
||||
<span class="day-num">{{ day.dayNumber }}</span>
|
||||
<span class="risk">{{ day.risk }}</span>
|
||||
</div>
|
||||
<div class="state">{{ day.state }}</div>
|
||||
<div class="bars">
|
||||
<div v-for="bar in day.bars" :key="bar.key" class="bar">
|
||||
<span>{{ bar.key }}</span>
|
||||
@@ -187,6 +191,31 @@ const {
|
||||
<Plus :size="14" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="create-row">
|
||||
<input v-model="newTaskDescription" placeholder="任务描述..." />
|
||||
</div>
|
||||
<div class="create-row split">
|
||||
<select v-model="newTaskQuadrant">
|
||||
<option value="urgent-important">重要且紧急</option>
|
||||
<option value="not-urgent-important">重要不紧急</option>
|
||||
<option value="urgent-not-important">紧急不重要</option>
|
||||
<option value="not-urgent-not-important">不重要不紧急</option>
|
||||
</select>
|
||||
<select v-model="newTaskAssigneeType">
|
||||
<option value="">UNASSIGNED</option>
|
||||
<option value="commander">COMMANDER</option>
|
||||
<option value="planner">PLANNER</option>
|
||||
<option value="executor">EXECUTOR</option>
|
||||
<option value="analyst">ANALYST</option>
|
||||
<option value="coder">CODER</option>
|
||||
<option value="researcher">RESEARCHER</option>
|
||||
</select>
|
||||
<input v-model="newTaskAssigneeId" placeholder="ASSIGNEE ID" />
|
||||
</div>
|
||||
<label class="create-row create-checkbox">
|
||||
<input v-model="newTaskDispatchToCommander" type="checkbox" />
|
||||
<span>创建后直接派发给 Commander</span>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section class="create-card">
|
||||
|
||||
@@ -1,56 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
// 战情室 - War Room
|
||||
import JarvisOfficeStage from '@/components/war-room/JarvisOfficeStage.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="war-room-page">
|
||||
<div class="page-header">
|
||||
<h1>🗺️ 战情室</h1>
|
||||
<p class="subtitle">运筹帷幄,决胜千里</p>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<div class="placeholder-content">
|
||||
<div class="war-icon">⚔️</div>
|
||||
<p>战情室 - 敬请期待</p>
|
||||
</div>
|
||||
</div>
|
||||
<JarvisOfficeStage />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.war-room-page {
|
||||
padding: 24px;
|
||||
min-height: 100vh;
|
||||
background: var(--bg-primary);
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
text-align: center;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
font-size: 28px;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: var(--text-secondary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.placeholder-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 400px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.war-icon {
|
||||
font-size: 64px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user