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 { goalApi, type Goal } from '@/api/goal'
|
||||||
import { reminderApi, type Reminder } from '@/api/reminder'
|
import { reminderApi, type Reminder } from '@/api/reminder'
|
||||||
import { scheduleCenterApi, type ScheduleCenterDateResponse, type ScheduleCenterDaySummary } from '@/api/scheduleCenter'
|
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'
|
import { todoApi, type Todo } from '@/api/todo'
|
||||||
|
|
||||||
type TimelineItem =
|
type TimelineItem =
|
||||||
@@ -28,7 +28,12 @@ export function useScheduleCenterPage() {
|
|||||||
|
|
||||||
const newTodoTitle = ref('')
|
const newTodoTitle = ref('')
|
||||||
const newTaskTitle = ref('')
|
const newTaskTitle = ref('')
|
||||||
|
const newTaskDescription = ref('')
|
||||||
const newTaskPriority = ref<TaskPriority>('medium')
|
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 newReminderTitle = ref('')
|
||||||
const newReminderTime = ref('09:00')
|
const newReminderTime = ref('09:00')
|
||||||
const newGoalTitle = ref('')
|
const newGoalTitle = ref('')
|
||||||
@@ -319,9 +324,24 @@ export function useScheduleCenterPage() {
|
|||||||
async function addTask() {
|
async function addTask() {
|
||||||
if (!newTaskTitle.value.trim()) return
|
if (!newTaskTitle.value.trim()) return
|
||||||
try {
|
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 = ''
|
newTaskTitle.value = ''
|
||||||
|
newTaskDescription.value = ''
|
||||||
newTaskPriority.value = 'medium'
|
newTaskPriority.value = 'medium'
|
||||||
|
newTaskQuadrant.value = 'not-urgent-important'
|
||||||
|
newTaskAssigneeType.value = 'commander'
|
||||||
|
newTaskAssigneeId.value = ''
|
||||||
|
newTaskDispatchToCommander.value = false
|
||||||
await Promise.all([loadDateDetail(), loadMonth()])
|
await Promise.all([loadDateDetail(), loadMonth()])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('新增任务失败', error)
|
console.error('新增任务失败', error)
|
||||||
@@ -506,7 +526,12 @@ export function useScheduleCenterPage() {
|
|||||||
loadingDetail,
|
loadingDetail,
|
||||||
newTodoTitle,
|
newTodoTitle,
|
||||||
newTaskTitle,
|
newTaskTitle,
|
||||||
|
newTaskDescription,
|
||||||
newTaskPriority,
|
newTaskPriority,
|
||||||
|
newTaskQuadrant,
|
||||||
|
newTaskAssigneeType,
|
||||||
|
newTaskAssigneeId,
|
||||||
|
newTaskDispatchToCommander,
|
||||||
newReminderTitle,
|
newReminderTitle,
|
||||||
newReminderTime,
|
newReminderTime,
|
||||||
newGoalTitle,
|
newGoalTitle,
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ const {
|
|||||||
loadingDetail,
|
loadingDetail,
|
||||||
newTodoTitle,
|
newTodoTitle,
|
||||||
newTaskTitle,
|
newTaskTitle,
|
||||||
|
newTaskDescription,
|
||||||
newTaskPriority,
|
newTaskPriority,
|
||||||
|
newTaskQuadrant,
|
||||||
|
newTaskAssigneeType,
|
||||||
|
newTaskAssigneeId,
|
||||||
|
newTaskDispatchToCommander,
|
||||||
newReminderTitle,
|
newReminderTitle,
|
||||||
newReminderTime,
|
newReminderTime,
|
||||||
newGoalTitle,
|
newGoalTitle,
|
||||||
@@ -100,7 +105,6 @@ const {
|
|||||||
<span class="day-num">{{ day.dayNumber }}</span>
|
<span class="day-num">{{ day.dayNumber }}</span>
|
||||||
<span class="risk">{{ day.risk }}</span>
|
<span class="risk">{{ day.risk }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="state">{{ day.state }}</div>
|
|
||||||
<div class="bars">
|
<div class="bars">
|
||||||
<div v-for="bar in day.bars" :key="bar.key" class="bar">
|
<div v-for="bar in day.bars" :key="bar.key" class="bar">
|
||||||
<span>{{ bar.key }}</span>
|
<span>{{ bar.key }}</span>
|
||||||
@@ -187,6 +191,31 @@ const {
|
|||||||
<Plus :size="14" />
|
<Plus :size="14" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<section class="create-card">
|
<section class="create-card">
|
||||||
|
|||||||
@@ -1,56 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 战情室 - War Room
|
import JarvisOfficeStage from '@/components/war-room/JarvisOfficeStage.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="war-room-page">
|
<div class="war-room-page">
|
||||||
<div class="page-header">
|
<JarvisOfficeStage />
|
||||||
<h1>🗺️ 战情室</h1>
|
|
||||||
<p class="subtitle">运筹帷幄,决胜千里</p>
|
|
||||||
</div>
|
|
||||||
<div class="page-content">
|
|
||||||
<div class="placeholder-content">
|
|
||||||
<div class="war-icon">⚔️</div>
|
|
||||||
<p>战情室 - 敬请期待</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.war-room-page {
|
.war-room-page {
|
||||||
padding: 24px;
|
min-height: 100%;
|
||||||
min-height: 100vh;
|
|
||||||
background: var(--bg-primary);
|
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
.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>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user