feat(ui): overhaul interface with Nuxt UI

Integrate the Nuxt UI component library and completely revamp the application's user interface to improve usability, aesthetics, and maintainability.

- Replace all custom components and native browser dialogs (`alert`, `prompt`, `confirm`) with Nuxt UI components like `UCard`, `UButton`, `UModal`, and `UNotifications`.
- Refactor the main page by extracting the sidebar into dedicated panel components: `CategoryPanel`, `BoardSummaryPanel`, and `HistoryPanel`.
- Redesign all major components (Toolbar, Board, Stage, Task) for a cleaner layout and improved information hierarchy.
- Implement user-friendly modals for all creation, editing, and deletion flows, providing a more consistent user experience.
- Add toast notifications to provide immediate feedback for user actions.
This commit is contained in:
xiaomai
2025-10-22 17:52:17 +08:00
parent 2384e42933
commit 485d75820b
19 changed files with 1823 additions and 318 deletions

View File

@@ -113,6 +113,28 @@ export const useBoardStore = defineStore('board', () => {
const stageById = (id: string) => board.value.stages.find(s => s.uuid === id)
const categoryById = (id: string) => board.value.categories.find(c => c.uuid === id)
function addCategory(title: string, color: string) {
const c: Category = { uuid: uuid(), title, color }
board.value.categories.push(c)
log('category-add', { id: c.uuid, title, color })
return c
}
function updateCategory(id: string, patch: Partial<Category>) {
const c = categoryById(id)
if (!c) return false
const before = JSON.parse(JSON.stringify(c))
Object.assign(c, patch)
log('category-update', { id, before, after: c })
return true
}
function removeCategory(id: string) {
const used = board.value.tasks.some(t => t.category === id)
if (used) return false
board.value.categories = board.value.categories.filter(c => c.uuid !== id)
log('category-delete', { id })
return true
}
function addStage(title: string, colIndex = 0) {
const s: Stage = { uuid: uuid(), title, tasks: [] }
board.value.stages.push(s)
@@ -188,8 +210,8 @@ export const useBoardStore = defineStore('board', () => {
setBoard, setActor, log, saveToLocal, loadFromLocal, clearLocal,
toJSON, downloadCurrent, applyMerge,
addStage, renameStage, deleteStage, addTask, removeTask, editTask, moveTask,
addCategory, updateCategory, removeCategory,
taskById, stageById, categoryById,
diffBoards
}
})