From c07325a955f42e3240b9e2416cc0dd6eafa3d2be Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 25 Sep 2026 00:56:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91=E5=88=A0=E9=99=A4=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/projects/ProjectsPage.vue | 31 +++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) 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 }}重新连接 +