feat(kol): workspace KOL card area

This commit is contained in:
2026-04-17 15:23:38 +08:00
parent b6bd4f02fb
commit 614ca4a2ea
+124
View File
@@ -51,6 +51,10 @@ const templateCardsQuery = useQuery({
queryKey: ["workspace", "template-cards"],
queryFn: () => workspaceApi.templateCards(),
});
const kolCardsQuery = useQuery({
queryKey: ["workspace", "kol-cards"],
queryFn: () => workspaceApi.kolCards(),
});
const statIcons = [
FileDoneOutlined,
@@ -201,6 +205,7 @@ function refreshDashboard(): void {
overviewQuery.refetch(),
recentArticlesQuery.refetch(),
templateCardsQuery.refetch(),
kolCardsQuery.refetch(),
]);
}
</script>
@@ -261,6 +266,38 @@ function refreshDashboard(): void {
</section>
</div>
<!-- KOL Section -->
<section class="panel panel-kol" v-if="kolCardsQuery.data.value?.length">
<h3 class="panel-title">{{ t("kol.marketplace.title") }}</h3>
<div class="kol-cards-container">
<div
v-for="card in kolCardsQuery.data.value"
:key="card.subscription_prompt_id"
class="kol-card"
@click="router.push(`/kol/generate/${card.subscription_prompt_id}`)"
>
<div class="kol-card-cover" :style="card.package_cover ? { backgroundImage: `url(${card.package_cover})` } : {}">
<div v-if="!card.package_cover" class="kol-card-cover-fallback"></div>
</div>
<div class="kol-card-content">
<div class="kol-card-header">
<h4 class="kol-card-title">{{ card.package_name }}</h4>
<div class="kol-card-subtitle">
<span>{{ card.prompt_name }}</span>
<a-tag v-if="card.platform_hint" color="blue" size="small">{{ card.platform_hint }}</a-tag>
</div>
</div>
<div class="kol-card-footer">
<span class="kol-card-author">{{ card.kol_display_name }}</span>
<div class="kol-card-action">
<ArrowRightOutlined />
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Recent Table Section -->
<section class="panel panel-recent">
<div class="recent-header">
@@ -546,6 +583,93 @@ function refreshDashboard(): void {
color: #141414;
}
/* --- KOL Section --- */
.kol-cards-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 16px;
}
.kol-card {
background: #fcfcfc;
border: 1px solid #f0f0f0;
border-radius: 12px;
overflow: hidden;
cursor: pointer;
transition: all 0.2s;
display: flex;
flex-direction: column;
}
.kol-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
border-color: #1677ff;
}
.kol-card-cover {
height: 100px;
background-size: cover;
background-position: center;
background-color: #f5f5f5;
position: relative;
}
.kol-card-cover-fallback {
height: 100%;
background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
}
.kol-card-content {
padding: 12px;
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
}
.kol-card-header {
flex: 1;
}
.kol-card-title {
font-size: 14px;
font-weight: 700;
color: #1a1a1a;
margin: 0 0 4px 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.kol-card-subtitle {
font-size: 12px;
color: #8c8c8c;
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap;
}
.kol-card-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 4px;
}
.kol-card-author {
font-size: 11px;
color: #bfbfbf;
}
.kol-card-action {
color: #1677ff;
font-size: 12px;
}
@media (max-width: 1200px) {
.workspace-header-grid {
grid-template-columns: 1fr;