Initial commit: Vue rewrite frontend
This commit is contained in:
@@ -0,0 +1,482 @@
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import {
|
||||
Archive,
|
||||
Bot,
|
||||
Clapperboard,
|
||||
FileText,
|
||||
Film,
|
||||
Play,
|
||||
RotateCcw,
|
||||
Plus,
|
||||
Search,
|
||||
Sparkles,
|
||||
Trash2,
|
||||
} from "lucide-vue-next";
|
||||
import {
|
||||
useCreateProjectMutation,
|
||||
useProjectLifecycleMutation,
|
||||
useProjectsQuery,
|
||||
} from "@/queries/projects";
|
||||
|
||||
const router = useRouter();
|
||||
const search = ref("");
|
||||
const status = ref("active");
|
||||
const createDialogOpen = ref(false);
|
||||
const projectName = ref("");
|
||||
const { data, isLoading } = useProjectsQuery();
|
||||
const createProject = useCreateProjectMutation();
|
||||
const archiveProject = useProjectLifecycleMutation("archive");
|
||||
const unarchiveProject = useProjectLifecycleMutation("unarchive");
|
||||
const deleteProject = useProjectLifecycleMutation("delete");
|
||||
const restoreProject = useProjectLifecycleMutation("restore");
|
||||
const createPending = computed(() => createProject.isPending.value);
|
||||
|
||||
const rawProjects = computed(() => data.value?.data || data.value || []);
|
||||
const projects = computed(() => {
|
||||
const q = search.value.trim().toLowerCase();
|
||||
return rawProjects.value.filter((item) => {
|
||||
const matchesStatus = (item.status || "active") === status.value;
|
||||
const label = `${item.name || ""} ${item.displayName || ""}`.toLowerCase();
|
||||
const matchesSearch = q ? label.includes(q) : true;
|
||||
return matchesStatus && matchesSearch;
|
||||
});
|
||||
});
|
||||
|
||||
const counts = computed(() =>
|
||||
rawProjects.value.reduce(
|
||||
(acc, item) => {
|
||||
const key = item.status || "active";
|
||||
acc[key] = (acc[key] || 0) + 1;
|
||||
return acc;
|
||||
},
|
||||
{ active: 0, archived: 0, deleted: 0 },
|
||||
),
|
||||
);
|
||||
|
||||
const totalEpisodes = computed(() =>
|
||||
rawProjects.value.reduce((sum, item) => sum + Number(item.episodeCount || item.episode_count || 0), 0),
|
||||
);
|
||||
const recentlyUpdated = computed(() =>
|
||||
[...rawProjects.value]
|
||||
.filter((item) => (item.status || "active") === "active")
|
||||
.sort((a, b) => new Date(b.updatedAt || 0) - new Date(a.updatedAt || 0))[0],
|
||||
);
|
||||
|
||||
const statusOptions = computed(() => [
|
||||
{ label: `活跃 ${counts.value.active}`, value: "active" },
|
||||
{ label: `归档 ${counts.value.archived}`, value: "archived" },
|
||||
{ label: `回收站 ${counts.value.deleted}`, value: "deleted" },
|
||||
]);
|
||||
|
||||
const workflowSteps = [
|
||||
{ label: "导入小说", icon: FileText },
|
||||
{ label: "AI 拆解剧集", icon: Bot },
|
||||
{ label: "生成分镜", icon: Clapperboard },
|
||||
{ label: "合成视频", icon: Film },
|
||||
];
|
||||
|
||||
function openProject(project) {
|
||||
router.push(`/projects/${project.id || project.name}/overview`);
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value) return "暂无更新";
|
||||
return new Intl.DateTimeFormat("zh-CN", {
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
async function handleCreateProject() {
|
||||
const name = projectName.value.trim() || `mock_project_${Date.now().toString().slice(-5)}`;
|
||||
const response = await createProject.mutateAsync(name);
|
||||
const project = response.data || response;
|
||||
projectName.value = "";
|
||||
createDialogOpen.value = false;
|
||||
openProject(project);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page project-dashboard-page">
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<div class="page-kicker">
|
||||
<Sparkles :size="14" />
|
||||
AI Novel-to-Video
|
||||
</div>
|
||||
<h1 class="page-title">项目工作台</h1>
|
||||
<p class="page-subtitle">
|
||||
从小说导入到成片发布,按项目管理你的 AI 短剧生产流程。选择一个项目继续创作,或新建项目开始新的故事。
|
||||
</p>
|
||||
</div>
|
||||
<el-button type="primary" :icon="Plus" :loading="createPending" @click="createDialogOpen = true">
|
||||
新建项目
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<section class="dashboard-hero">
|
||||
<div class="hero-main">
|
||||
<span>创作空间</span>
|
||||
<strong>{{ counts.active }} 个活跃项目</strong>
|
||||
<p>{{ recentlyUpdated ? `最近更新:${recentlyUpdated.displayName || recentlyUpdated.name}` : "还没有活跃项目,创建一个开始创作。" }}</p>
|
||||
<div class="hero-actions">
|
||||
<el-button type="primary" :icon="Plus" @click="createDialogOpen = true">创建新项目</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:icon="Play"
|
||||
:disabled="!recentlyUpdated"
|
||||
@click="recentlyUpdated && openProject(recentlyUpdated)"
|
||||
>
|
||||
继续最近项目
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-metrics">
|
||||
<article>
|
||||
<span>项目总数</span>
|
||||
<strong>{{ rawProjects.length }}</strong>
|
||||
</article>
|
||||
<article>
|
||||
<span>剧集规划</span>
|
||||
<strong>{{ totalEpisodes }}</strong>
|
||||
</article>
|
||||
<article>
|
||||
<span>归档</span>
|
||||
<strong>{{ counts.archived }}</strong>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="workflow-strip">
|
||||
<div v-for="step in workflowSteps" :key="step.label" class="workflow-step">
|
||||
<component :is="step.icon" :size="18" />
|
||||
<span>{{ step.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-toolbar">
|
||||
<el-segmented v-model="status" :options="statusOptions" />
|
||||
<el-input v-model="search" class="search-box" :prefix-icon="Search" placeholder="搜索项目" clearable />
|
||||
</div>
|
||||
|
||||
<el-skeleton v-if="isLoading" :rows="6" animated />
|
||||
<el-empty v-else-if="projects.length === 0" description="暂无项目" />
|
||||
<div v-else class="project-grid">
|
||||
<article v-for="project in projects" :key="project.id || project.name" class="project-card">
|
||||
<button class="project-main" @click="status !== 'deleted' && openProject(project)">
|
||||
<span class="project-cover">
|
||||
<span>{{ (project.displayName || project.name || "?").slice(0, 1).toUpperCase() }}</span>
|
||||
</span>
|
||||
<span class="project-copy">
|
||||
<strong>{{ project.displayName || project.name }}</strong>
|
||||
<small>{{ project.name }}</small>
|
||||
</span>
|
||||
<span class="project-meta">
|
||||
<Clapperboard :size="14" />
|
||||
{{ project.episodeCount || project.episode_count || 0 }} 集
|
||||
</span>
|
||||
<span class="project-meta">
|
||||
<Sparkles :size="14" />
|
||||
{{ formatDate(project.updatedAt || project.updated_at) }}
|
||||
</span>
|
||||
</button>
|
||||
<div class="project-actions">
|
||||
<el-button size="small" @click="openProject(project)" :disabled="status === 'deleted'">打开</el-button>
|
||||
<el-button size="small" @click="router.push(`/projects/${project.id || project.name}/freezone`)" :disabled="status === 'deleted'">
|
||||
画布
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="status === 'active'"
|
||||
size="small"
|
||||
:icon="Archive"
|
||||
@click="archiveProject.mutate(project.id || project.name)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="status === 'archived'"
|
||||
size="small"
|
||||
:icon="RotateCcw"
|
||||
@click="unarchiveProject.mutate(project.id || project.name)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="status !== 'deleted'"
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
:icon="Trash2"
|
||||
@click="deleteProject.mutate(project.id || project.name)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="status === 'deleted'"
|
||||
size="small"
|
||||
:icon="RotateCcw"
|
||||
@click="restoreProject.mutate(project.id || project.name)"
|
||||
>
|
||||
恢复
|
||||
</el-button>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="createDialogOpen" title="新建项目" width="420px">
|
||||
<el-form label-position="top" @submit.prevent="handleCreateProject">
|
||||
<el-form-item label="项目名称">
|
||||
<el-input v-model="projectName" placeholder="例如 my_new_drama" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="createDialogOpen = false">取消</el-button>
|
||||
<el-button type="primary" :loading="createPending" @click="handleCreateProject">
|
||||
创建并打开
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.project-dashboard-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.dashboard-hero,
|
||||
.workflow-step,
|
||||
.project-card {
|
||||
border: 1px solid var(--app-border);
|
||||
border-radius: 8px;
|
||||
background:
|
||||
linear-gradient(145deg, rgba(79, 140, 255, 0.12), transparent 42%),
|
||||
var(--app-card);
|
||||
box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
|
||||
}
|
||||
|
||||
.dashboard-hero {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 360px;
|
||||
gap: 16px;
|
||||
border-color: rgba(125, 211, 252, 0.22);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.hero-main {
|
||||
span {
|
||||
color: var(--app-cyan);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
color: #f4f7fb;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0 0;
|
||||
color: var(--app-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.hero-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
|
||||
article {
|
||||
border: 1px solid rgba(148, 163, 184, 0.13);
|
||||
border-radius: 8px;
|
||||
background: rgba(8, 12, 22, 0.42);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
span,
|
||||
strong {
|
||||
display: block;
|
||||
}
|
||||
|
||||
span {
|
||||
color: var(--app-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 760;
|
||||
}
|
||||
|
||||
strong {
|
||||
margin-top: 6px;
|
||||
color: #f4f7fb;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.workflow-strip {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.workflow-step {
|
||||
display: flex;
|
||||
min-height: 66px;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(79, 140, 255, 0.14), rgba(45, 212, 191, 0.06)),
|
||||
rgba(255, 255, 255, 0.035);
|
||||
padding: 14px;
|
||||
color: #dce8ff;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
|
||||
svg {
|
||||
color: var(--app-cyan);
|
||||
}
|
||||
}
|
||||
|
||||
.search-box {
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.project-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.project-card {
|
||||
display: flex;
|
||||
min-height: 246px;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
padding: 16px;
|
||||
transition:
|
||||
border-color 180ms ease,
|
||||
background 180ms ease,
|
||||
box-shadow 180ms ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--app-border-strong);
|
||||
background:
|
||||
linear-gradient(145deg, rgba(79, 140, 255, 0.18), rgba(45, 212, 191, 0.07)),
|
||||
var(--app-card-hover);
|
||||
box-shadow: 0 22px 50px rgba(79, 140, 255, 0.13);
|
||||
}
|
||||
}
|
||||
|
||||
.project-main {
|
||||
display: grid;
|
||||
cursor: pointer;
|
||||
flex: 1;
|
||||
gap: 12px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.project-cover {
|
||||
display: grid;
|
||||
width: 58px;
|
||||
height: 58px;
|
||||
place-items: center;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(135deg, rgba(79, 140, 255, 0.95), rgba(45, 212, 191, 0.76));
|
||||
box-shadow: 0 18px 38px rgba(79, 140, 255, 0.24);
|
||||
font-weight: 700;
|
||||
|
||||
span {
|
||||
display: grid;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
place-items: center;
|
||||
border: 1px solid rgba(255, 255, 255, 0.28);
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
.project-copy {
|
||||
min-width: 0;
|
||||
|
||||
strong,
|
||||
small {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: #f4f7fb;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
small {
|
||||
margin-top: 5px;
|
||||
color: var(--app-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.project-meta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #b9c7de;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.project-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-top: 14px;
|
||||
|
||||
.el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.dashboard-hero,
|
||||
.workflow-strip {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.hero-metrics {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.hero-metrics {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.dashboard-toolbar .el-segmented,
|
||||
.dashboard-toolbar .el-input {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,670 @@
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import {
|
||||
ArrowRight,
|
||||
Box,
|
||||
CheckCircle2,
|
||||
Clapperboard,
|
||||
Film,
|
||||
Image as ImageIcon,
|
||||
Palette,
|
||||
ScrollText,
|
||||
Sparkles,
|
||||
Upload,
|
||||
Users,
|
||||
} from "lucide-vue-next";
|
||||
import { useSceneAssetsQuery, usePropAssetsQuery } from "@/queries/assets";
|
||||
import { useCharactersQuery } from "@/queries/characters";
|
||||
import { useEpisodesQuery } from "@/queries/episodes";
|
||||
import { useChaptersQuery } from "@/queries/ingest";
|
||||
import { useProjectQuery } from "@/queries/projects";
|
||||
import { useStylesQuery } from "@/queries/styles";
|
||||
import { useTasksQuery } from "@/queries/tasks";
|
||||
import { usePublicWorksQuery } from "@/queries/watch";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const projectId = computed(() => String(route.params.project || ""));
|
||||
|
||||
const projectQuery = useProjectQuery(projectId.value);
|
||||
const chaptersQuery = useChaptersQuery(projectId.value);
|
||||
const charactersQuery = useCharactersQuery(projectId.value);
|
||||
const scenesQuery = useSceneAssetsQuery(projectId.value);
|
||||
const propsQuery = usePropAssetsQuery(projectId.value);
|
||||
const stylesQuery = useStylesQuery(projectId.value);
|
||||
const episodesQuery = useEpisodesQuery(projectId.value);
|
||||
const tasksQuery = useTasksQuery(projectId.value);
|
||||
const worksQuery = usePublicWorksQuery();
|
||||
|
||||
const project = computed(() => projectQuery.data.value?.data || {});
|
||||
const chapters = computed(() => chaptersQuery.data.value?.data?.chapters || []);
|
||||
const characters = computed(() => charactersQuery.data.value?.data || charactersQuery.data.value || []);
|
||||
const scenes = computed(() => scenesQuery.data.value?.data || scenesQuery.data.value || []);
|
||||
const props = computed(() => propsQuery.data.value?.data || propsQuery.data.value || []);
|
||||
const styles = computed(() => stylesQuery.data.value?.data || stylesQuery.data.value || []);
|
||||
const episodes = computed(() => episodesQuery.data.value?.data || episodesQuery.data.value || []);
|
||||
const tasks = computed(() => tasksQuery.data.value?.data || tasksQuery.data.value || []);
|
||||
const publishedWorks = computed(() =>
|
||||
(worksQuery.data.value || []).filter((work) => work.project === projectId.value),
|
||||
);
|
||||
const selectedStyle = computed(() => styles.value.find((style) => style.selected) || styles.value[0] || null);
|
||||
const runningTasks = computed(() => tasks.value.filter((task) => task.status === "running"));
|
||||
const failedTasks = computed(() => tasks.value.filter((task) => task.status === "failed"));
|
||||
const readySceneCount = computed(() => scenes.value.filter((scene) => scene.status === "ready").length);
|
||||
const readyPropCount = computed(() => props.value.filter((prop) => prop.status === "ready").length);
|
||||
const assetTotal = computed(() => scenes.value.length + props.value.length);
|
||||
|
||||
const workflowSteps = computed(() => [
|
||||
{
|
||||
key: "ingest",
|
||||
title: "导入小说",
|
||||
description: chapters.value.length ? `已识别 ${chapters.value.length} 个章节` : "先导入小说文本",
|
||||
icon: Upload,
|
||||
done: chapters.value.length > 0,
|
||||
path: `/projects/${projectId.value}/ingest`,
|
||||
},
|
||||
{
|
||||
key: "characters",
|
||||
title: "角色资产",
|
||||
description: characters.value.length ? `${characters.value.length} 个角色已建档` : "识别主角和关键角色",
|
||||
icon: Users,
|
||||
done: characters.value.length > 0,
|
||||
path: `/projects/${projectId.value}/characters`,
|
||||
},
|
||||
{
|
||||
key: "assets",
|
||||
title: "场景道具",
|
||||
description: `${readySceneCount.value}/${scenes.value.length} 场景 · ${readyPropCount.value}/${props.value.length} 道具`,
|
||||
icon: Box,
|
||||
done: assetTotal.value > 0,
|
||||
path: `/projects/${projectId.value}/assets`,
|
||||
},
|
||||
{
|
||||
key: "styles",
|
||||
title: "视觉风格",
|
||||
description: selectedStyle.value?.name || "选择项目风格",
|
||||
icon: Palette,
|
||||
done: Boolean(selectedStyle.value),
|
||||
path: `/projects/${projectId.value}/styles`,
|
||||
},
|
||||
{
|
||||
key: "episodes",
|
||||
title: "剧集制作",
|
||||
description: episodes.value.length ? `${episodes.value.length} 集已规划` : "规划剧集和分镜",
|
||||
icon: Clapperboard,
|
||||
done: episodes.value.length > 0,
|
||||
path: `/projects/${projectId.value}/episodes`,
|
||||
},
|
||||
{
|
||||
key: "publish",
|
||||
title: "发布试看",
|
||||
description: publishedWorks.value.length ? `${publishedWorks.value.length} 个试看作品` : "合成后发布试看",
|
||||
icon: Film,
|
||||
done: publishedWorks.value.length > 0,
|
||||
path: episodes.value[0]
|
||||
? `/projects/${projectId.value}/episodes/${episodes.value[0].number}/compose`
|
||||
: `/projects/${projectId.value}/episodes`,
|
||||
},
|
||||
]);
|
||||
|
||||
const completedSteps = computed(() => workflowSteps.value.filter((step) => step.done).length);
|
||||
const progressPercent = computed(() => Math.round((completedSteps.value / workflowSteps.value.length) * 100));
|
||||
const nextStep = computed(() => workflowSteps.value.find((step) => !step.done) || workflowSteps.value[workflowSteps.value.length - 1]);
|
||||
const latestTasks = computed(() => tasks.value.slice(0, 5));
|
||||
const visibleWorks = computed(() => publishedWorks.value.slice(0, 4));
|
||||
|
||||
const overviewMetrics = computed(() => [
|
||||
{ label: "章节", value: chapters.value.length, hint: "小说结构" },
|
||||
{ label: "角色", value: characters.value.length, hint: "人物资产" },
|
||||
{ label: "资产", value: assetTotal.value, hint: `${readySceneCount.value + readyPropCount.value} 个可用` },
|
||||
{ label: "剧集", value: episodes.value.length, hint: "视频生产" },
|
||||
]);
|
||||
|
||||
function statusType(status) {
|
||||
if (status === "completed") return "success";
|
||||
if (status === "failed") return "danger";
|
||||
if (status === "running") return "primary";
|
||||
return "info";
|
||||
}
|
||||
|
||||
function statusLabel(status) {
|
||||
return {
|
||||
completed: "完成",
|
||||
failed: "异常",
|
||||
running: "生成中",
|
||||
pending: "排队",
|
||||
}[status] || status;
|
||||
}
|
||||
|
||||
function go(path) {
|
||||
router.push(path);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="page project-overview-page">
|
||||
<div class="overview-shell">
|
||||
<section class="overview-hero">
|
||||
<div class="hero-copy">
|
||||
<div class="page-kicker">
|
||||
<Sparkles :size="14" />
|
||||
项目总览
|
||||
</div>
|
||||
<h1>{{ project.displayName || project.name || projectId }}</h1>
|
||||
<p>从小说导入到成片发布的全流程控制台。按建议步骤推进,也可以直接进入任意生产模块。</p>
|
||||
<div class="hero-actions">
|
||||
<el-button type="primary" :icon="ArrowRight" @click="go(nextStep.path)">
|
||||
继续:{{ nextStep.title }}
|
||||
</el-button>
|
||||
<el-button plain @click="go(`/projects/${projectId}/tasks`)">查看任务</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hero-progress">
|
||||
<el-progress type="dashboard" :width="132" :percentage="progressPercent" />
|
||||
<strong>{{ completedSteps }}/{{ workflowSteps.length }}</strong>
|
||||
<span>关键步骤完成</span>
|
||||
</div>
|
||||
|
||||
<div class="hero-signal">
|
||||
<span>生产状态</span>
|
||||
<strong>{{ runningTasks.length }} 生成中 / {{ failedTasks.length }} 异常</strong>
|
||||
<p>{{ publishedWorks.length ? "已有试看作品,可以继续打磨。" : "暂无发布作品,完成合成后即可发布试看。" }}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="metric-console">
|
||||
<article v-for="metric in overviewMetrics" :key="metric.label">
|
||||
<span>{{ metric.label }}</span>
|
||||
<strong>{{ metric.value }}</strong>
|
||||
<small>{{ metric.hint }}</small>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="workflow-track">
|
||||
<button
|
||||
v-for="(step, index) in workflowSteps"
|
||||
:key="step.key"
|
||||
class="workflow-card"
|
||||
:class="{ done: step.done, current: nextStep.key === step.key }"
|
||||
@click="go(step.path)"
|
||||
>
|
||||
<span class="step-index">{{ String(index + 1).padStart(2, "0") }}</span>
|
||||
<span class="workflow-icon">
|
||||
<component :is="step.done ? CheckCircle2 : step.icon" :size="19" />
|
||||
</span>
|
||||
<span class="workflow-content">
|
||||
<strong>{{ step.title }}</strong>
|
||||
<small>{{ step.description }}</small>
|
||||
</span>
|
||||
<ArrowRight :size="16" />
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section class="overview-panels">
|
||||
<div class="overview-panel activity-panel">
|
||||
<div class="panel-title">
|
||||
<ScrollText :size="17" />
|
||||
<strong>最近任务</strong>
|
||||
</div>
|
||||
<div v-if="latestTasks.length" class="compact-list">
|
||||
<button v-for="task in latestTasks" :key="task.id" @click="go(`/projects/${projectId}/tasks`)">
|
||||
<span>
|
||||
<strong>{{ task.title || task.task_type }}</strong>
|
||||
<small>{{ task.current_task || "等待生产节点更新" }}</small>
|
||||
</span>
|
||||
<el-tag size="small" effect="dark" :type="statusType(task.status)">
|
||||
{{ statusLabel(task.status) }}
|
||||
</el-tag>
|
||||
</button>
|
||||
</div>
|
||||
<el-empty v-else description="暂无任务" />
|
||||
</div>
|
||||
|
||||
<div class="overview-panel works-panel">
|
||||
<div class="panel-title">
|
||||
<ImageIcon :size="17" />
|
||||
<strong>发布作品</strong>
|
||||
</div>
|
||||
<div v-if="visibleWorks.length" class="work-grid">
|
||||
<button v-for="work in visibleWorks" :key="work.id" @click="router.push(`/watch/${work.id}`)">
|
||||
<span class="work-poster" :style="{ background: work.gradient }">
|
||||
<Film :size="18" />
|
||||
</span>
|
||||
<span>
|
||||
<strong>{{ work.title }}</strong>
|
||||
<small>试看作品</small>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<el-empty v-else description="暂无试看作品" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.project-overview-page {
|
||||
min-height: 100%;
|
||||
--overview-card: rgba(12, 18, 32, 0.78);
|
||||
--overview-card-strong: rgba(15, 23, 42, 0.9);
|
||||
--overview-line: rgba(125, 211, 252, 0.22);
|
||||
--overview-line-soft: rgba(148, 163, 184, 0.14);
|
||||
--overview-cyan: #2dd4bf;
|
||||
--overview-blue: #4f8cff;
|
||||
--overview-green: #22c55e;
|
||||
}
|
||||
|
||||
.overview-shell {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.overview-hero,
|
||||
.metric-console,
|
||||
.overview-panel,
|
||||
.workflow-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--overview-line-soft);
|
||||
border-radius: 8px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
|
||||
var(--overview-card);
|
||||
box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
background:
|
||||
linear-gradient(90deg, rgba(79, 140, 255, 0.16), transparent 34%),
|
||||
linear-gradient(180deg, rgba(45, 212, 191, 0.08), transparent 42%);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
> * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.overview-hero {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.32fr) 178px minmax(240px, 0.68fr);
|
||||
align-items: stretch;
|
||||
gap: 16px;
|
||||
border-color: rgba(125, 211, 252, 0.26);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(79, 140, 255, 0.2), transparent 36%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
|
||||
rgba(8, 13, 25, 0.88);
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.hero-copy {
|
||||
min-width: 0;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
color: #f4f7fb;
|
||||
font-size: clamp(28px, 3vw, 42px);
|
||||
line-height: 1.08;
|
||||
text-shadow: 0 0 22px rgba(79, 140, 255, 0.18);
|
||||
}
|
||||
|
||||
p {
|
||||
max-width: 680px;
|
||||
margin: 12px 0 0;
|
||||
color: var(--app-muted);
|
||||
line-height: 1.65;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.hero-progress,
|
||||
.hero-signal {
|
||||
border: 1px solid var(--overview-line-soft);
|
||||
border-radius: 8px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(8, 12, 22, 0.66)),
|
||||
rgba(255, 255, 255, 0.035);
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.hero-progress {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
text-align: center;
|
||||
|
||||
strong {
|
||||
margin-top: 4px;
|
||||
color: #edf5ff;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #91a4be;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-signal {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
span {
|
||||
color: var(--overview-cyan);
|
||||
font-size: 12px;
|
||||
font-weight: 760;
|
||||
}
|
||||
|
||||
strong {
|
||||
margin-top: 10px;
|
||||
color: #edf5ff;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0 0;
|
||||
color: var(--app-muted);
|
||||
line-height: 1.55;
|
||||
}
|
||||
}
|
||||
|
||||
.metric-console {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
article {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--overview-line-soft);
|
||||
border-radius: 8px;
|
||||
background:
|
||||
linear-gradient(145deg, rgba(79, 140, 255, 0.13), transparent 48%),
|
||||
var(--overview-card);
|
||||
padding: 14px 16px;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 10px;
|
||||
width: 42px;
|
||||
height: 2px;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, transparent, var(--overview-cyan));
|
||||
content: "";
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
span,
|
||||
small {
|
||||
display: block;
|
||||
color: var(--app-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
margin: 6px 0 4px;
|
||||
color: #f4f7fb;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-track {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, minmax(150px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.workflow-card {
|
||||
display: grid;
|
||||
min-height: 150px;
|
||||
cursor: pointer;
|
||||
grid-template-rows: auto 1fr auto;
|
||||
gap: 10px;
|
||||
border-color: var(--overview-line-soft);
|
||||
padding: 13px;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
transition:
|
||||
border-color 180ms ease,
|
||||
background 180ms ease,
|
||||
box-shadow 180ms ease;
|
||||
|
||||
&:hover,
|
||||
&.done,
|
||||
&.current {
|
||||
border-color: var(--overview-line);
|
||||
background:
|
||||
linear-gradient(145deg, rgba(79, 140, 255, 0.18), rgba(45, 212, 191, 0.07)),
|
||||
var(--overview-card-strong);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 22px 48px rgba(79, 140, 255, 0.13);
|
||||
}
|
||||
|
||||
> svg {
|
||||
justify-self: end;
|
||||
color: var(--app-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.step-index {
|
||||
color: rgba(226, 232, 240, 0.46);
|
||||
font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.workflow-icon {
|
||||
display: grid;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
place-items: center;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(125, 211, 252, 0.2);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(79, 140, 255, 0.24), rgba(45, 212, 191, 0.12)),
|
||||
rgba(255, 255, 255, 0.04);
|
||||
color: #cde0ff;
|
||||
}
|
||||
|
||||
.workflow-card.done .workflow-icon {
|
||||
border-color: rgba(34, 197, 94, 0.28);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(45, 212, 191, 0.12)),
|
||||
rgba(255, 255, 255, 0.04);
|
||||
color: #b8f7c6;
|
||||
}
|
||||
|
||||
.workflow-card.current {
|
||||
box-shadow: 0 18px 44px rgba(45, 212, 191, 0.1);
|
||||
|
||||
.step-index {
|
||||
color: var(--overview-cyan);
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-content {
|
||||
align-self: end;
|
||||
|
||||
strong,
|
||||
small {
|
||||
display: block;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: #edf5ff;
|
||||
}
|
||||
|
||||
small {
|
||||
margin-top: 6px;
|
||||
color: var(--app-muted);
|
||||
line-height: 1.45;
|
||||
}
|
||||
}
|
||||
|
||||
.overview-panels {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.overview-panel {
|
||||
border-color: rgba(125, 211, 252, 0.18);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
color: #edf5ff;
|
||||
}
|
||||
|
||||
.compact-list {
|
||||
display: grid;
|
||||
gap: 9px;
|
||||
|
||||
button {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
border: 1px solid var(--app-border);
|
||||
border-radius: 8px;
|
||||
background: rgba(8, 12, 22, 0.42);
|
||||
padding: 10px 12px;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
transition: border-color 180ms ease, background 180ms ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--overview-line);
|
||||
background: rgba(79, 140, 255, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
span,
|
||||
strong,
|
||||
small {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
strong,
|
||||
small {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
small {
|
||||
margin-top: 4px;
|
||||
color: var(--app-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.work-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
|
||||
button {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
grid-template-columns: 54px minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border: 1px solid var(--app-border);
|
||||
border-radius: 8px;
|
||||
background: rgba(8, 12, 22, 0.42);
|
||||
padding: 9px;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
transition: border-color 180ms ease, background 180ms ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--overview-line);
|
||||
background: rgba(79, 140, 255, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
strong,
|
||||
small {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
small {
|
||||
margin-top: 4px;
|
||||
color: var(--app-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.work-poster {
|
||||
display: grid;
|
||||
width: 54px;
|
||||
aspect-ratio: 16 / 10;
|
||||
place-items: center;
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
border-radius: 6px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@media (max-width: 1240px) {
|
||||
.overview-hero,
|
||||
.overview-panels {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.workflow-track {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.metric-console,
|
||||
.workflow-track,
|
||||
.work-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.overview-hero {
|
||||
padding: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user