diff --git a/src/features/projects/ProjectsPage.vue b/src/features/projects/ProjectsPage.vue index c0aa8bf..b5abc2a 100644 --- a/src/features/projects/ProjectsPage.vue +++ b/src/features/projects/ProjectsPage.vue @@ -11,7 +11,7 @@ import { type DataTableColumns, type DataTableInst } from 'naive-ui' -import { RefreshCw, Search } from '@lucide/vue' +import { MoreHorizontal, RefreshCw, Search } from '@lucide/vue' import WorkspacePage from '../../components/ui/WorkspacePage.vue' import { useQuery } from '../../composables/useQuery' import { StatusBadge } from '../../components/ui' @@ -19,6 +19,7 @@ import { formatDate } from '../../lib/format' import { projectsApi } from './api' import type { Project } from './types' import CreateProjectDialog from './components/CreateProjectDialog.vue' +import ProjectManageDialog from './components/ProjectManageDialog.vue' /** 项目表格使用固定表头与独立滚动;搜索筛选仍作用于真实接口数据。 */ const router = useRouter() @@ -31,6 +32,13 @@ const PAGE_SIZE = 20 const visibleCount = ref(PAGE_SIZE) const table = ref(null) const projects = computed(() => query.data.value ?? []) +const manageOpen = ref(false) +const managedProject = ref(null) +/** 打开项目管理,不影响行本身的项目跳转。 */ +function manageProject(project: Project) { + managedProject.value = project + manageOpen.value = true +} const filtered = computed(() => projects.value.filter(item => { const matches = ((item.title ?? '') + ' ' + item.topic + ' ' + (item.style ?? '')) @@ -75,7 +83,18 @@ const columns: DataTableColumns = [ }, { title: '风格', key: 'style', width: 200, ellipsis: { tooltip: true }, render: row => row.style || '未设置' }, { title: '状态', key: 'status', width: 120, render: row => h(StatusBadge, { status: row.status }) }, - { title: '最近更新', key: 'updatedAt', width: 165, render: row => formatDate(row.updatedAt) } + { title: '最近更新', key: 'updatedAt', width: 165, render: row => formatDate(row.updatedAt) }, + { + title: '', + key: 'actions', + width: 64, + render: row => + h( + NButton, + { quaternary: true, circle: true, title: '管理项目', 'aria-label': `管理 ${row.title || row.topic}`, onClick: () => manageProject(row) }, + { icon: () => h(MoreHorizontal, { size: 16 }) } + ) + } ] /** 创建回执只用于跳转,生成进度以后端查询为准。 */ function openProject(id: string) { @@ -136,6 +155,12 @@ function clearFilters() { {{ query.error.value }}重新连接 +