2026-04-01 00:58:42 +08:00
|
|
|
<script setup lang="ts">
|
2026-04-18 13:47:32 +08:00
|
|
|
import {
|
|
|
|
|
AppstoreOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
ArrowRightOutlined,
|
2026-04-01 00:58:42 +08:00
|
|
|
ExperimentOutlined,
|
|
|
|
|
FileTextOutlined,
|
|
|
|
|
NodeIndexOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
PlusOutlined,
|
2026-04-01 00:58:42 +08:00
|
|
|
RocketOutlined,
|
2026-04-18 13:47:32 +08:00
|
|
|
ThunderboltOutlined,
|
2026-04-01 00:58:42 +08:00
|
|
|
TrophyOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
} from '@ant-design/icons-vue'
|
2026-04-18 13:47:32 +08:00
|
|
|
import type {
|
|
|
|
|
ArticleListItem,
|
|
|
|
|
ArticleListParams,
|
|
|
|
|
KolWorkspaceCard,
|
|
|
|
|
RecentArticle,
|
|
|
|
|
TemplateListItem,
|
2026-05-01 20:39:09 +08:00
|
|
|
} from '@geo/shared-types'
|
|
|
|
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
|
|
|
|
|
import type { TableColumnsType } from 'ant-design-vue'
|
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
import type { Dayjs } from 'dayjs'
|
|
|
|
|
import { computed, onBeforeUnmount, reactive, ref, watch } from 'vue'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
import ArticleActionGroup from '@/components/ArticleActionGroup.vue'
|
|
|
|
|
import ArticleDetailDrawer from '@/components/ArticleDetailDrawer.vue'
|
|
|
|
|
import ArticleGenerateStatus from '@/components/ArticleGenerateStatus.vue'
|
|
|
|
|
import ArticlePublishStatus from '@/components/ArticlePublishStatus.vue'
|
|
|
|
|
import ArticleSourceMeta from '@/components/ArticleSourceMeta.vue'
|
|
|
|
|
import PublishArticleModal from '@/components/PublishArticleModal.vue'
|
|
|
|
|
import { articlesApi, templatesApi, workspaceApi } from '@/lib/api'
|
|
|
|
|
import { buildArticleClipboardContent, resolveArticleActionState } from '@/lib/article-list-actions'
|
2026-05-07 10:55:44 +08:00
|
|
|
import { useArticleRegenerateAction } from '@/lib/article-regenerate-action'
|
2026-04-01 00:58:42 +08:00
|
|
|
import {
|
2026-04-18 16:17:11 +08:00
|
|
|
formatDateTime,
|
2026-04-01 00:58:42 +08:00
|
|
|
getGenerateStatusMeta,
|
|
|
|
|
getPublishStatusMeta,
|
2026-05-11 11:11:40 +08:00
|
|
|
hasActiveGenerationStatus,
|
2026-04-01 00:58:42 +08:00
|
|
|
getTemplateMeta,
|
2026-05-01 20:39:09 +08:00
|
|
|
} from '@/lib/display'
|
|
|
|
|
import { formatError } from '@/lib/errors'
|
|
|
|
|
|
|
|
|
|
const queryClient = useQueryClient()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
|
|
const pickerOpen = ref(false)
|
|
|
|
|
const pickerMode = ref<'general' | 'refined' | null>(null)
|
|
|
|
|
const publishModalOpen = ref(false)
|
|
|
|
|
const selectedPublishArticleId = ref<number | null>(null)
|
|
|
|
|
const articleDrawerOpen = ref(false)
|
|
|
|
|
const selectedArticleId = ref<number | null>(null)
|
|
|
|
|
const page = ref(1)
|
|
|
|
|
const pageSize = ref(10)
|
|
|
|
|
const draftGenerationRange = ref<[Dayjs, Dayjs] | null>(null)
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const draftFilters = reactive<{
|
2026-05-01 20:39:09 +08:00
|
|
|
template_filter?: string
|
|
|
|
|
publish_status?: string
|
|
|
|
|
generate_status?: string
|
|
|
|
|
keyword?: string
|
|
|
|
|
created_from?: string
|
|
|
|
|
created_to?: string
|
2026-04-01 00:58:42 +08:00
|
|
|
}>({
|
2026-05-01 20:39:09 +08:00
|
|
|
keyword: '',
|
|
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const appliedFilters = reactive<{
|
2026-05-01 20:39:09 +08:00
|
|
|
template_filter?: string
|
|
|
|
|
publish_status?: string
|
|
|
|
|
generate_status?: string
|
|
|
|
|
keyword?: string
|
|
|
|
|
created_from?: string
|
|
|
|
|
created_to?: string
|
2026-04-01 00:58:42 +08:00
|
|
|
}>({
|
2026-05-01 20:39:09 +08:00
|
|
|
keyword: '',
|
|
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const templateListQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: ['templates', 'list'],
|
2026-04-01 00:58:42 +08:00
|
|
|
queryFn: () => templatesApi.list(),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
const kolCardsQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: ['workspace', 'kol-cards', 'templates'],
|
2026-04-18 13:47:32 +08:00
|
|
|
queryFn: () => workspaceApi.kolCards(),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
const recentArticlesQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: ['workspace', 'recent-articles', 'templates'],
|
2026-04-18 13:47:32 +08:00
|
|
|
queryFn: () => workspaceApi.recentArticles(),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-18 13:47:32 +08:00
|
|
|
|
2026-04-01 00:58:42 +08:00
|
|
|
const articleParams = computed<ArticleListParams>(() => {
|
|
|
|
|
const params: ArticleListParams = {
|
|
|
|
|
page: page.value,
|
|
|
|
|
page_size: pageSize.value,
|
2026-05-01 20:39:09 +08:00
|
|
|
source_type: 'template,kol',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const templateFilter = appliedFilters.template_filter
|
|
|
|
|
if (templateFilter?.startsWith('source:')) {
|
|
|
|
|
params.source_type = templateFilter.replace('source:', '')
|
|
|
|
|
} else if (templateFilter?.startsWith('template:')) {
|
|
|
|
|
params.source_type = 'template'
|
|
|
|
|
params.template_id = Number(templateFilter.replace('template:', ''))
|
|
|
|
|
} else if (templateFilter?.startsWith('kol:')) {
|
|
|
|
|
params.source_type = 'kol'
|
|
|
|
|
params.kol_prompt_id = Number(templateFilter.replace('kol:', ''))
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
if (appliedFilters.publish_status) {
|
2026-05-01 20:39:09 +08:00
|
|
|
params.publish_status = appliedFilters.publish_status
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
if (appliedFilters.generate_status) {
|
2026-05-01 20:39:09 +08:00
|
|
|
params.generate_status = appliedFilters.generate_status
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
if (appliedFilters.keyword?.trim()) {
|
2026-05-01 20:39:09 +08:00
|
|
|
params.keyword = appliedFilters.keyword.trim()
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
2026-04-02 00:31:28 +08:00
|
|
|
if (appliedFilters.created_from) {
|
2026-05-01 20:39:09 +08:00
|
|
|
params.created_from = appliedFilters.created_from
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
if (appliedFilters.created_to) {
|
2026-05-01 20:39:09 +08:00
|
|
|
params.created_to = appliedFilters.created_to
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
return params
|
|
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const articleListQuery = useQuery({
|
2026-05-01 20:39:09 +08:00
|
|
|
queryKey: computed(() => ['articles', 'list', articleParams.value]),
|
2026-04-01 00:58:42 +08:00
|
|
|
queryFn: () => articlesApi.list(articleParams.value),
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
const hasActiveRecordFilters = computed(() =>
|
|
|
|
|
Boolean(
|
|
|
|
|
appliedFilters.template_filter ||
|
2026-05-01 20:39:09 +08:00
|
|
|
appliedFilters.publish_status ||
|
|
|
|
|
appliedFilters.generate_status ||
|
|
|
|
|
appliedFilters.keyword?.trim() ||
|
|
|
|
|
appliedFilters.created_from ||
|
|
|
|
|
appliedFilters.created_to,
|
2026-04-18 13:47:32 +08:00
|
|
|
),
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
const recentTemplateArticles = computed<ArticleListItem[]>(() =>
|
|
|
|
|
(recentArticlesQuery.data.value || [])
|
2026-05-01 20:39:09 +08:00
|
|
|
.filter(
|
|
|
|
|
(article: RecentArticle) =>
|
|
|
|
|
article.source_type === 'template' || article.source_type === 'kol',
|
|
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
.map((article: RecentArticle) => ({
|
|
|
|
|
id: article.id,
|
|
|
|
|
source_type: article.source_type,
|
|
|
|
|
template_id: null,
|
|
|
|
|
kol_prompt_id: null,
|
|
|
|
|
template_name:
|
|
|
|
|
article.template_name ||
|
2026-05-01 20:39:09 +08:00
|
|
|
(article.source_type === 'kol'
|
|
|
|
|
? t('templates.sections.refinedTemplates')
|
|
|
|
|
: t('templates.sections.generalTemplates')),
|
2026-04-18 13:47:32 +08:00
|
|
|
prompt_rule_id: null,
|
|
|
|
|
prompt_rule_name: null,
|
|
|
|
|
generation_mode: article.generation_mode,
|
2026-05-01 11:02:21 +08:00
|
|
|
auto_publish_platforms: [],
|
2026-04-18 13:47:32 +08:00
|
|
|
generate_status: article.generate_status,
|
|
|
|
|
publish_status: article.publish_status,
|
|
|
|
|
title: article.title,
|
|
|
|
|
generation_error_message: null,
|
|
|
|
|
word_count: article.word_count,
|
|
|
|
|
source_label: article.source_label,
|
|
|
|
|
created_at: article.created_at,
|
|
|
|
|
})),
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
const shouldUseRecentFallback = computed(
|
|
|
|
|
() =>
|
|
|
|
|
!hasActiveRecordFilters.value &&
|
|
|
|
|
(articleListQuery.data.value?.total ?? 0) === 0 &&
|
|
|
|
|
recentTemplateArticles.value.length > 0,
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
const displayedArticles = computed<ArticleListItem[]>(() =>
|
2026-05-01 20:39:09 +08:00
|
|
|
shouldUseRecentFallback.value
|
|
|
|
|
? recentTemplateArticles.value
|
|
|
|
|
: articleListQuery.data.value?.items || [],
|
|
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
const displayedArticleTotal = computed(() =>
|
2026-05-01 20:39:09 +08:00
|
|
|
shouldUseRecentFallback.value
|
|
|
|
|
? recentTemplateArticles.value.length
|
|
|
|
|
: articleListQuery.data.value?.total || 0,
|
|
|
|
|
)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
let articlePollingTimer: number | null = null
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const deleteMutation = useMutation({
|
|
|
|
|
mutationFn: (articleId: number) => articlesApi.remove(articleId),
|
|
|
|
|
onSuccess: async () => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.success(t('templates.list.deleteSuccess'))
|
2026-04-01 00:58:42 +08:00
|
|
|
await Promise.all([
|
2026-05-01 20:39:09 +08:00
|
|
|
queryClient.invalidateQueries({ queryKey: ['articles'] }),
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['workspace'] }),
|
|
|
|
|
])
|
2026-04-01 00:58:42 +08:00
|
|
|
},
|
|
|
|
|
onError: (error) => {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.error(formatError(error) || t('templates.list.deleteError'))
|
2026-04-01 00:58:42 +08:00
|
|
|
},
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-05-07 10:55:44 +08:00
|
|
|
const { regeneratingArticleId, handleRegenerate } = useArticleRegenerateAction()
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
const templateFilterOptions = computed(() => {
|
|
|
|
|
return [
|
2026-05-01 20:39:09 +08:00
|
|
|
{ label: t('templates.sections.generalTemplates'), value: 'source:template' },
|
|
|
|
|
{ label: t('templates.sections.refinedTemplates'), value: 'source:kol' },
|
|
|
|
|
]
|
|
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const generateStatusOptions = computed(() => [
|
2026-05-01 20:39:09 +08:00
|
|
|
{ label: getGenerateStatusMeta('draft').label, value: 'draft' },
|
|
|
|
|
{ label: getGenerateStatusMeta('generating').label, value: 'generating' },
|
|
|
|
|
{ label: getGenerateStatusMeta('completed').label, value: 'completed' },
|
|
|
|
|
{ label: getGenerateStatusMeta('failed').label, value: 'failed' },
|
|
|
|
|
])
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const publishStatusOptions = computed(() => [
|
2026-05-01 20:39:09 +08:00
|
|
|
{ label: getPublishStatusMeta('unpublished').label, value: 'unpublished' },
|
|
|
|
|
{ label: getPublishStatusMeta('publishing').label, value: 'publishing' },
|
|
|
|
|
{ label: getPublishStatusMeta('success').label, value: 'success' },
|
|
|
|
|
{ label: getPublishStatusMeta('partial_success').label, value: 'partial_success' },
|
|
|
|
|
{ label: getPublishStatusMeta('failed').label, value: 'failed' },
|
|
|
|
|
])
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
const articleColumns = computed<TableColumnsType<ArticleListItem>>(() => [
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.title'),
|
|
|
|
|
dataIndex: 'title',
|
|
|
|
|
key: 'title',
|
2026-05-13 22:29:46 +08:00
|
|
|
width: 360,
|
2026-04-01 00:58:42 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.templateType'),
|
|
|
|
|
dataIndex: 'template_name',
|
|
|
|
|
key: 'template_name',
|
2026-04-01 00:58:42 +08:00
|
|
|
width: 168,
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.generateStatus'),
|
|
|
|
|
dataIndex: 'generate_status',
|
|
|
|
|
key: 'generate_status',
|
2026-04-01 00:58:42 +08:00
|
|
|
width: 128,
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.publishStatus'),
|
|
|
|
|
dataIndex: 'publish_status',
|
|
|
|
|
key: 'publish_status',
|
2026-04-01 00:58:42 +08:00
|
|
|
width: 128,
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.wordCount'),
|
|
|
|
|
dataIndex: 'word_count',
|
|
|
|
|
key: 'word_count',
|
2026-04-01 00:58:42 +08:00
|
|
|
width: 100,
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-05-01 20:39:09 +08:00
|
|
|
title: t('common.actions'),
|
|
|
|
|
key: 'actions',
|
2026-04-03 00:39:15 +08:00
|
|
|
width: 156,
|
2026-05-01 20:39:09 +08:00
|
|
|
align: 'right',
|
2026-04-01 00:58:42 +08:00
|
|
|
},
|
2026-05-01 20:39:09 +08:00
|
|
|
])
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-05-13 22:29:46 +08:00
|
|
|
const articlePagination = computed(() =>
|
|
|
|
|
shouldUseRecentFallback.value
|
|
|
|
|
? false
|
|
|
|
|
: {
|
|
|
|
|
current: page.value,
|
|
|
|
|
pageSize: pageSize.value,
|
|
|
|
|
total: displayedArticleTotal.value,
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
|
onChange: handleTableChange,
|
|
|
|
|
onShowSizeChange: handleTableChange,
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-01 00:58:42 +08:00
|
|
|
// removed wizard watch effect
|
|
|
|
|
|
|
|
|
|
function applyFilters(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
page.value = 1
|
|
|
|
|
appliedFilters.template_filter = draftFilters.template_filter
|
|
|
|
|
appliedFilters.publish_status = draftFilters.publish_status
|
|
|
|
|
appliedFilters.generate_status = draftFilters.generate_status
|
|
|
|
|
appliedFilters.keyword = draftFilters.keyword?.trim() || ''
|
|
|
|
|
appliedFilters.created_from = draftGenerationRange.value?.[0]?.toISOString()
|
|
|
|
|
appliedFilters.created_to = draftGenerationRange.value?.[1]?.toISOString()
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTemplateCardClass(idx: number): string {
|
2026-05-01 20:39:09 +08:00
|
|
|
const classes = ['card-yellow', 'card-blue-light', 'card-blue-deep', 'card-grey']
|
|
|
|
|
return classes[idx % classes.length]
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTemplateBgColorClass(idx: number): string {
|
2026-05-01 20:39:09 +08:00
|
|
|
const classes = ['bg-yellow', 'bg-blue-light', 'bg-blue-deep', 'bg-grey']
|
|
|
|
|
return classes[idx % classes.length]
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const templateIconMap: Record<string, unknown> = {
|
|
|
|
|
top_x_article: TrophyOutlined,
|
|
|
|
|
product_review: ExperimentOutlined,
|
|
|
|
|
research_report: FileTextOutlined,
|
|
|
|
|
brand_search_expansion: NodeIndexOutlined,
|
2026-05-01 20:39:09 +08:00
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
function resolveTemplateIcon(template: TemplateListItem): unknown {
|
2026-05-01 20:39:09 +08:00
|
|
|
return templateIconMap[template.template_key] ?? RocketOutlined
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function resetFilters(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
draftFilters.template_filter = undefined
|
|
|
|
|
draftFilters.publish_status = undefined
|
|
|
|
|
draftFilters.generate_status = undefined
|
|
|
|
|
draftFilters.keyword = ''
|
|
|
|
|
draftGenerationRange.value = null
|
|
|
|
|
applyFilters()
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openTemplatePicker(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
pickerOpen.value = true
|
|
|
|
|
pickerMode.value = 'general'
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
function choosePickerMode(mode: 'general' | 'refined'): void {
|
|
|
|
|
pickerMode.value = mode
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function startTemplate(template: TemplateListItem): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
pickerOpen.value = false
|
|
|
|
|
pickerMode.value = null
|
|
|
|
|
void router.push({ path: '/articles/wizard', query: { template_id: String(template.id) } })
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
function openRefinedTemplate(card: KolWorkspaceCard): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
pickerOpen.value = false
|
|
|
|
|
pickerMode.value = null
|
2026-04-18 17:17:17 +08:00
|
|
|
void router.push({
|
2026-05-01 20:39:09 +08:00
|
|
|
name: 'kol-generate',
|
2026-04-18 17:17:17 +08:00
|
|
|
params: { subscriptionPromptId: String(card.subscription_prompt_id) },
|
2026-05-01 20:39:09 +08:00
|
|
|
query: { source: 'templates' },
|
|
|
|
|
})
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function openEditor(article: ArticleListItem): Promise<void> {
|
|
|
|
|
try {
|
2026-05-01 20:39:09 +08:00
|
|
|
const detail = await articlesApi.detail(article.id)
|
2026-04-18 13:47:32 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
if (
|
|
|
|
|
detail.generate_status === 'draft' &&
|
|
|
|
|
detail.source_type === 'template' &&
|
|
|
|
|
detail.template_id
|
|
|
|
|
) {
|
2026-04-18 13:47:32 +08:00
|
|
|
await router.push({
|
2026-05-01 20:39:09 +08:00
|
|
|
name: 'article-wizard',
|
2026-04-18 13:47:32 +08:00
|
|
|
query: {
|
|
|
|
|
template_id: String(detail.template_id),
|
|
|
|
|
article_id: String(detail.id),
|
|
|
|
|
},
|
2026-05-01 20:39:09 +08:00
|
|
|
})
|
|
|
|
|
return
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
2026-04-02 00:31:28 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
await router.push({ name: 'article-editor', params: { id: String(detail.id) } })
|
2026-04-18 13:47:32 +08:00
|
|
|
} catch (error) {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.error(formatError(error) || t('common.noData'))
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
2026-04-02 00:31:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-03 00:39:15 +08:00
|
|
|
function openPublish(article: ArticleListItem): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
selectedPublishArticleId.value = article.id
|
|
|
|
|
publishModalOpen.value = true
|
2026-04-03 00:39:15 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-07 16:07:21 +08:00
|
|
|
function openPreview(article: ArticleListItem): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
selectedArticleId.value = article.id
|
|
|
|
|
articleDrawerOpen.value = true
|
2026-04-03 00:39:15 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-01 00:58:42 +08:00
|
|
|
watch(
|
2026-04-18 13:47:32 +08:00
|
|
|
() => displayedArticles.value,
|
2026-04-02 00:31:28 +08:00
|
|
|
(items: ArticleListItem[]) => {
|
|
|
|
|
const hasGeneratingArticles = items.some((item: ArticleListItem) =>
|
2026-04-18 17:17:17 +08:00
|
|
|
hasActiveGenerationStatus(item.generate_status),
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
if (hasGeneratingArticles) {
|
2026-05-01 20:39:09 +08:00
|
|
|
startArticlePolling()
|
|
|
|
|
return
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
stopArticlePolling()
|
2026-04-01 00:58:42 +08:00
|
|
|
},
|
|
|
|
|
{ immediate: true },
|
2026-05-01 20:39:09 +08:00
|
|
|
)
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
2026-05-01 20:39:09 +08:00
|
|
|
stopArticlePolling()
|
|
|
|
|
})
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
function handleTableChange(nextPage: number, nextPageSize: number): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
page.value = nextPage
|
|
|
|
|
pageSize.value = nextPageSize
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function startArticlePolling(): void {
|
|
|
|
|
if (articlePollingTimer !== null) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
articlePollingTimer = window.setInterval(() => {
|
2026-05-11 11:11:40 +08:00
|
|
|
void queryClient.invalidateQueries({ queryKey: ['articles'] })
|
|
|
|
|
void queryClient.invalidateQueries({ queryKey: ['workspace', 'recent-articles'] })
|
2026-05-01 20:39:09 +08:00
|
|
|
void Promise.all([articleListQuery.refetch(), recentArticlesQuery.refetch()])
|
2026-05-11 11:11:40 +08:00
|
|
|
}, 3000)
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function stopArticlePolling(): void {
|
|
|
|
|
if (articlePollingTimer === null) {
|
2026-05-01 20:39:09 +08:00
|
|
|
return
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
window.clearInterval(articlePollingTimer)
|
|
|
|
|
articlePollingTimer = null
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleDelete(articleId: number): Promise<void> {
|
2026-05-01 20:39:09 +08:00
|
|
|
await deleteMutation.mutateAsync(articleId)
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
2026-04-07 16:07:21 +08:00
|
|
|
|
|
|
|
|
async function copyArticle(articleId: number): Promise<void> {
|
|
|
|
|
try {
|
2026-05-01 20:39:09 +08:00
|
|
|
const detail = await articlesApi.detail(articleId)
|
|
|
|
|
const content = buildArticleClipboardContent(detail)
|
2026-04-07 16:07:21 +08:00
|
|
|
|
|
|
|
|
if (!content) {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.warning(t('common.noData'))
|
|
|
|
|
return
|
2026-04-07 16:07:21 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
await navigator.clipboard.writeText(content)
|
|
|
|
|
message.success(t('common.copySuccess'))
|
2026-04-07 16:07:21 +08:00
|
|
|
} catch (error) {
|
2026-05-01 20:39:09 +08:00
|
|
|
message.error(formatError(error) || t('common.noData'))
|
2026-04-07 16:07:21 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
function refreshRecords(): void {
|
2026-05-01 20:39:09 +08:00
|
|
|
void Promise.all([articleListQuery.refetch(), recentArticlesQuery.refetch()])
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="templates-view">
|
2026-04-02 00:31:28 +08:00
|
|
|
<section class="templates-view__top-card">
|
|
|
|
|
<div class="templates-view__header">
|
|
|
|
|
<div class="templates-view__header-title">
|
|
|
|
|
<h2>{{ t('route.templates.title') }}</h2>
|
|
|
|
|
<p>{{ t('route.templates.description') }}</p>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
2026-04-02 00:31:28 +08:00
|
|
|
<div class="templates-view__header-actions">
|
2026-04-18 13:47:32 +08:00
|
|
|
<a-button type="primary" class="templates-view__create-btn" @click="openTemplatePicker">
|
2026-04-02 00:31:28 +08:00
|
|
|
<template #icon><PlusOutlined /></template>
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('templates.actions.chooseTemplate') }}
|
2026-04-02 00:31:28 +08:00
|
|
|
</a-button>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
2026-04-02 00:31:28 +08:00
|
|
|
</div>
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
<a-divider style="margin: 0; border-color: #f0f0f0" />
|
2026-04-02 00:31:28 +08:00
|
|
|
|
|
|
|
|
<div class="templates-view__filters">
|
|
|
|
|
<div class="templates-view__filters-inline">
|
|
|
|
|
<div class="templates-view__filter-item">
|
2026-05-01 20:39:09 +08:00
|
|
|
<label>{{ t('templates.filters.template') }}:</label>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-select
|
2026-04-18 13:47:32 +08:00
|
|
|
v-model:value="draftFilters.template_filter"
|
2026-04-02 00:31:28 +08:00
|
|
|
allow-clear
|
2026-04-18 13:47:32 +08:00
|
|
|
:options="templateFilterOptions"
|
2026-04-02 00:31:28 +08:00
|
|
|
:placeholder="t('common.selectPlease')"
|
|
|
|
|
@change="applyFilters"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
<div class="templates-view__filter-item">
|
2026-05-01 20:39:09 +08:00
|
|
|
<label>{{ t('templates.filters.publishStatus') }}:</label>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-select
|
|
|
|
|
v-model:value="draftFilters.publish_status"
|
|
|
|
|
allow-clear
|
|
|
|
|
:options="publishStatusOptions"
|
|
|
|
|
:placeholder="t('common.selectPlease')"
|
|
|
|
|
@change="applyFilters"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
<div class="templates-view__filter-item">
|
2026-05-01 20:39:09 +08:00
|
|
|
<label>{{ t('templates.filters.generationTime') }}:</label>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-range-picker
|
|
|
|
|
v-model:value="draftGenerationRange"
|
|
|
|
|
allow-clear
|
|
|
|
|
show-time
|
|
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
|
|
:placeholder="[
|
|
|
|
|
t('templates.filters.generationTimeStart'),
|
|
|
|
|
t('templates.filters.generationTimeEnd'),
|
|
|
|
|
]"
|
|
|
|
|
@change="applyFilters"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="templates-view__filter-item">
|
2026-05-01 20:39:09 +08:00
|
|
|
<label>{{ t('templates.filters.generateStatus') }}:</label>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-select
|
|
|
|
|
v-model:value="draftFilters.generate_status"
|
|
|
|
|
allow-clear
|
|
|
|
|
:options="generateStatusOptions"
|
|
|
|
|
:placeholder="t('common.selectPlease')"
|
|
|
|
|
@change="applyFilters"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="templates-view__filter-item">
|
2026-05-01 20:39:09 +08:00
|
|
|
<label>{{ t('templates.filters.keyword') }}:</label>
|
2026-04-02 00:31:28 +08:00
|
|
|
<a-input-search
|
|
|
|
|
v-model:value="draftFilters.keyword"
|
|
|
|
|
:placeholder="t('templates.filters.keywordPlaceholder')"
|
|
|
|
|
@search="applyFilters"
|
|
|
|
|
@pressEnter="applyFilters"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
<a-button class="templates-view__reset-btn" @click="resetFilters">
|
|
|
|
|
{{ t('common.reset') }}
|
|
|
|
|
</a-button>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="templates-view__table-card">
|
|
|
|
|
<div class="templates-view__table-head">
|
|
|
|
|
<div>
|
2026-05-01 20:39:09 +08:00
|
|
|
<p class="eyebrow">{{ t('templates.list.eyebrow') }}</p>
|
|
|
|
|
<h3>{{ t('templates.list.count', { count: displayedArticleTotal }) }}</h3>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
2026-04-18 13:47:32 +08:00
|
|
|
<a-button type="link" @click="refreshRecords">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('common.refresh') }}
|
2026-04-01 00:58:42 +08:00
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a-table
|
2026-05-13 22:29:46 +08:00
|
|
|
class="templates-view__desktop-table"
|
2026-04-01 00:58:42 +08:00
|
|
|
:columns="articleColumns"
|
2026-04-18 13:47:32 +08:00
|
|
|
:data-source="displayedArticles"
|
|
|
|
|
:loading="articleListQuery.isPending.value || recentArticlesQuery.isPending.value"
|
2026-04-01 00:58:42 +08:00
|
|
|
row-key="id"
|
2026-05-13 22:29:46 +08:00
|
|
|
:pagination="articlePagination"
|
|
|
|
|
:scroll="{ x: 1068 }"
|
2026-04-01 00:58:42 +08:00
|
|
|
>
|
2026-05-01 20:39:09 +08:00
|
|
|
<template #emptyText>{{ t('templates.list.empty') }}</template>
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.key === 'title'">
|
|
|
|
|
<div class="templates-view__title-cell">
|
2026-05-01 20:39:09 +08:00
|
|
|
<strong>{{ record.title || t('article.untitled') }}</strong>
|
2026-04-07 16:07:21 +08:00
|
|
|
<ArticleSourceMeta
|
|
|
|
|
:source-type="record.source_type"
|
|
|
|
|
:generation-mode="record.generation_mode"
|
|
|
|
|
:created-at="record.created_at"
|
|
|
|
|
/>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="column.key === 'template_name'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ record.template_name || '--' }}
|
2026-04-01 00:58:42 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="column.key === 'generate_status'">
|
2026-04-07 16:07:21 +08:00
|
|
|
<ArticleGenerateStatus :status="record.generate_status" />
|
2026-04-01 00:58:42 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="column.key === 'publish_status'">
|
2026-05-01 20:39:09 +08:00
|
|
|
<ArticlePublishStatus :status="record.publish_status" :article-id="record.id" />
|
2026-04-01 00:58:42 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="column.key === 'word_count'">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ record.word_count || '--' }}
|
2026-04-01 00:58:42 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else-if="column.key === 'actions'">
|
2026-04-07 16:07:21 +08:00
|
|
|
<ArticleActionGroup
|
2026-05-07 10:55:44 +08:00
|
|
|
v-bind="resolveArticleActionState(record)"
|
2026-04-07 16:07:21 +08:00
|
|
|
:delete-confirm-title="t('templates.list.deleteConfirm')"
|
|
|
|
|
:delete-loading="deleteMutation.isPending.value"
|
2026-05-07 10:55:44 +08:00
|
|
|
:regenerate-confirm-title="t('common.regenerateConfirm')"
|
|
|
|
|
:regenerate-loading="regeneratingArticleId === record.id"
|
2026-04-07 16:07:21 +08:00
|
|
|
@publish="openPublish(record)"
|
|
|
|
|
@edit="openEditor(record)"
|
|
|
|
|
@preview="openPreview(record)"
|
|
|
|
|
@copy="copyArticle(record.id)"
|
2026-05-07 10:55:44 +08:00
|
|
|
@regenerate="handleRegenerate(record)"
|
2026-04-07 16:07:21 +08:00
|
|
|
@delete="handleDelete(record.id)"
|
|
|
|
|
/>
|
2026-04-01 00:58:42 +08:00
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
2026-05-13 22:29:46 +08:00
|
|
|
|
|
|
|
|
<div class="templates-view__mobile-records">
|
|
|
|
|
<a-skeleton
|
|
|
|
|
v-if="articleListQuery.isPending.value || recentArticlesQuery.isPending.value"
|
|
|
|
|
active
|
|
|
|
|
:paragraph="{ rows: 6 }"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<a-empty v-else-if="!displayedArticles.length" :description="t('templates.list.empty')" />
|
|
|
|
|
|
|
|
|
|
<template v-else>
|
|
|
|
|
<article
|
|
|
|
|
v-for="record in displayedArticles"
|
|
|
|
|
:key="record.id"
|
|
|
|
|
class="templates-view__mobile-record"
|
|
|
|
|
>
|
|
|
|
|
<div class="templates-view__mobile-record-main">
|
|
|
|
|
<h4>{{ record.title || t('article.untitled') }}</h4>
|
|
|
|
|
<ArticleSourceMeta
|
|
|
|
|
:source-type="record.source_type"
|
|
|
|
|
:generation-mode="record.generation_mode"
|
|
|
|
|
:created-at="record.created_at"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="templates-view__mobile-record-meta">
|
|
|
|
|
<div class="templates-view__mobile-record-field">
|
|
|
|
|
<span>{{ t('common.templateType') }}</span>
|
|
|
|
|
<strong>{{ record.template_name || '--' }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="templates-view__mobile-record-field">
|
|
|
|
|
<span>{{ t('common.wordCount') }}</span>
|
|
|
|
|
<strong>{{ record.word_count || '--' }}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="templates-view__mobile-record-status">
|
|
|
|
|
<div class="templates-view__mobile-record-field">
|
|
|
|
|
<span>{{ t('common.generateStatus') }}</span>
|
|
|
|
|
<ArticleGenerateStatus :status="record.generate_status" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="templates-view__mobile-record-field">
|
|
|
|
|
<span>{{ t('common.publishStatus') }}</span>
|
|
|
|
|
<ArticlePublishStatus :status="record.publish_status" :article-id="record.id" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="templates-view__mobile-record-actions">
|
|
|
|
|
<span>{{ t('common.actions') }}</span>
|
|
|
|
|
<ArticleActionGroup
|
|
|
|
|
v-bind="resolveArticleActionState(record)"
|
|
|
|
|
:delete-confirm-title="t('templates.list.deleteConfirm')"
|
|
|
|
|
:delete-loading="deleteMutation.isPending.value"
|
|
|
|
|
:regenerate-confirm-title="t('common.regenerateConfirm')"
|
|
|
|
|
:regenerate-loading="regeneratingArticleId === record.id"
|
|
|
|
|
@publish="openPublish(record)"
|
|
|
|
|
@edit="openEditor(record)"
|
|
|
|
|
@preview="openPreview(record)"
|
|
|
|
|
@copy="copyArticle(record.id)"
|
|
|
|
|
@regenerate="handleRegenerate(record)"
|
|
|
|
|
@delete="handleDelete(record.id)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
<a-pagination
|
|
|
|
|
v-if="!shouldUseRecentFallback"
|
|
|
|
|
class="templates-view__mobile-pagination"
|
|
|
|
|
:current="page"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
:total="displayedArticleTotal"
|
|
|
|
|
size="small"
|
|
|
|
|
@change="handleTableChange"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
2026-04-01 00:58:42 +08:00
|
|
|
</section>
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
<a-drawer
|
2026-04-01 00:58:42 +08:00
|
|
|
v-model:open="pickerOpen"
|
2026-04-18 13:47:32 +08:00
|
|
|
:title="t('templates.picker.title')"
|
|
|
|
|
placement="right"
|
2026-04-01 00:58:42 +08:00
|
|
|
width="960"
|
2026-04-18 13:47:32 +08:00
|
|
|
class="templates-view__drawer"
|
2026-04-01 00:58:42 +08:00
|
|
|
>
|
2026-04-18 13:47:32 +08:00
|
|
|
<div class="templates-view__drawer-intro">
|
2026-05-01 20:39:09 +08:00
|
|
|
<p>{{ t('route.templates.description') }}</p>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
<div class="templates-view__drawer-mode-grid">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="templates-view__drawer-mode-card"
|
|
|
|
|
:class="{ 'is-active': pickerMode === 'general' }"
|
|
|
|
|
@click="choosePickerMode('general')"
|
2026-04-01 00:58:42 +08:00
|
|
|
>
|
2026-04-18 13:47:32 +08:00
|
|
|
<span class="templates-view__drawer-mode-icon templates-view__drawer-mode-icon--general">
|
|
|
|
|
<AppstoreOutlined />
|
|
|
|
|
</span>
|
|
|
|
|
<span class="templates-view__drawer-mode-copy">
|
2026-05-01 20:39:09 +08:00
|
|
|
<strong>{{ t('templates.sections.generalTemplates') }}</strong>
|
|
|
|
|
<small>{{ t('templates.picker.generalDescription') }}</small>
|
2026-04-18 13:47:32 +08:00
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="templates-view__drawer-mode-card"
|
|
|
|
|
:class="{ 'is-active': pickerMode === 'refined' }"
|
|
|
|
|
@click="choosePickerMode('refined')"
|
|
|
|
|
>
|
|
|
|
|
<span class="templates-view__drawer-mode-icon templates-view__drawer-mode-icon--refined">
|
|
|
|
|
<ThunderboltOutlined />
|
|
|
|
|
</span>
|
|
|
|
|
<span class="templates-view__drawer-mode-copy">
|
2026-05-01 20:39:09 +08:00
|
|
|
<strong>{{ t('templates.sections.refinedTemplates') }}</strong>
|
|
|
|
|
<small>{{ t('templates.picker.refinedDescription') }}</small>
|
2026-04-18 13:47:32 +08:00
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="pickerMode === 'general'" class="templates-view__drawer-panel">
|
|
|
|
|
<div class="templates-view__drawer-panel-head">
|
2026-05-01 20:39:09 +08:00
|
|
|
<p class="eyebrow">{{ t('templates.sections.generalTemplates') }}</p>
|
|
|
|
|
<h3>{{ t('templates.sections.generalTemplates') }}</h3>
|
2026-04-18 13:47:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="template-cards-container">
|
|
|
|
|
<article
|
|
|
|
|
v-for="(template, idx) in templateListQuery.data.value || []"
|
|
|
|
|
:key="template.id"
|
|
|
|
|
class="template-card"
|
|
|
|
|
:class="getTemplateCardClass(idx)"
|
|
|
|
|
@click="startTemplate(template)"
|
|
|
|
|
>
|
|
|
|
|
<div class="template-icon-wrapper" :class="getTemplateBgColorClass(idx)">
|
|
|
|
|
<component :is="resolveTemplateIcon(template)" class="template-icon" />
|
|
|
|
|
</div>
|
|
|
|
|
<h4 class="template-title">{{ template.template_name }}</h4>
|
|
|
|
|
<p class="template-desc">{{ getTemplateMeta(template.template_key).helper }}</p>
|
|
|
|
|
<div class="template-action">
|
|
|
|
|
<span>{{ getTemplateMeta(template.template_key).action }}</span>
|
|
|
|
|
<ArrowRightOutlined class="template-arrow" />
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
</div>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
<div v-else-if="pickerMode === 'refined'" class="templates-view__drawer-panel">
|
|
|
|
|
<div class="templates-view__drawer-panel-head">
|
2026-05-01 20:39:09 +08:00
|
|
|
<p class="eyebrow">{{ t('templates.sections.refinedTemplates') }}</p>
|
|
|
|
|
<h3>{{ t('templates.sections.refinedTemplates') }}</h3>
|
2026-04-18 13:47:32 +08:00
|
|
|
</div>
|
2026-05-01 20:39:09 +08:00
|
|
|
<div v-if="kolCardsQuery.data.value?.length" class="templates-view__kol-grid">
|
2026-04-18 13:47:32 +08:00
|
|
|
<article
|
|
|
|
|
v-for="card in kolCardsQuery.data.value"
|
|
|
|
|
:key="card.subscription_prompt_id"
|
|
|
|
|
class="templates-view__kol-card"
|
|
|
|
|
@click="openRefinedTemplate(card)"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="templates-view__kol-cover"
|
2026-04-25 23:17:04 +08:00
|
|
|
:style="card.package_cover ? { '--cover-image': `url(${card.package_cover})` } : {}"
|
2026-04-18 13:47:32 +08:00
|
|
|
>
|
2026-04-18 15:01:40 +08:00
|
|
|
<div v-if="!card.package_cover" class="templates-view__kol-cover-fallback">
|
|
|
|
|
<AppstoreOutlined class="templates-view__fallback-icon" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="templates-view__kol-hover-overlay">
|
2026-05-01 20:39:09 +08:00
|
|
|
<ArrowRightOutlined />
|
2026-04-18 15:01:40 +08:00
|
|
|
</div>
|
2026-04-18 13:47:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="templates-view__kol-content">
|
2026-05-01 20:39:09 +08:00
|
|
|
<h4 class="templates-view__kol-title" :title="card.prompt_name">
|
|
|
|
|
{{ card.prompt_name }}
|
|
|
|
|
</h4>
|
2026-04-18 15:01:40 +08:00
|
|
|
<div class="templates-view__kol-meta-row">
|
2026-05-01 20:39:09 +08:00
|
|
|
<span class="templates-view__kol-prompt" :title="card.package_name">
|
|
|
|
|
{{ card.package_name }}
|
|
|
|
|
</span>
|
2026-04-18 16:17:11 +08:00
|
|
|
<span class="templates-view__kol-updated-at">
|
2026-05-01 20:39:09 +08:00
|
|
|
{{ t('common.updatedAt') }}: {{ formatDateTime(card.updated_at) }}
|
2026-04-18 16:17:11 +08:00
|
|
|
</span>
|
2026-04-18 13:47:32 +08:00
|
|
|
</div>
|
2026-05-01 20:39:09 +08:00
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
<div class="templates-view__kol-footer">
|
2026-04-18 15:01:40 +08:00
|
|
|
<div class="templates-view__kol-author">
|
2026-05-01 20:39:09 +08:00
|
|
|
<div class="templates-view__author-avatar">
|
|
|
|
|
{{ card.kol_display_name?.[0]?.toUpperCase() || 'K' }}
|
|
|
|
|
</div>
|
2026-04-18 15:01:40 +08:00
|
|
|
<span>{{ card.kol_display_name }}</span>
|
|
|
|
|
</div>
|
2026-05-01 20:39:09 +08:00
|
|
|
<div v-if="card.platform_hint" class="templates-view__kol-platform">
|
2026-04-18 15:01:40 +08:00
|
|
|
{{ card.platform_hint }}
|
|
|
|
|
</div>
|
2026-04-18 13:47:32 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
</div>
|
|
|
|
|
<a-empty v-else :description="t('kol.marketplace.empty')" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a-empty v-else :description="t('templates.picker.empty')" />
|
|
|
|
|
</a-drawer>
|
2026-04-03 00:39:15 +08:00
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
<PublishArticleModal v-model:open="publishModalOpen" :article-id="selectedPublishArticleId" />
|
2026-04-07 16:07:21 +08:00
|
|
|
|
|
|
|
|
<ArticleDetailDrawer
|
|
|
|
|
:open="articleDrawerOpen"
|
|
|
|
|
:article-id="selectedArticleId"
|
|
|
|
|
@close="articleDrawerOpen = false"
|
|
|
|
|
/>
|
2026-04-01 00:58:42 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.templates-view {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 22px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__top-card {
|
2026-04-01 00:58:42 +08:00
|
|
|
background: #fff;
|
|
|
|
|
border: 1px solid #e6edf5;
|
2026-04-02 00:31:28 +08:00
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
padding: 24px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__header-title h2 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a1a;
|
|
|
|
|
line-height: 1.4;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__header-title p {
|
|
|
|
|
margin: 6px 0 0 0;
|
2026-04-01 00:58:42 +08:00
|
|
|
font-size: 13px;
|
2026-04-02 00:31:28 +08:00
|
|
|
color: #8c8c8c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__header-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
.templates-view__create-btn {
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
box-shadow: none;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__filters {
|
|
|
|
|
padding: 20px 24px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__table-card {
|
|
|
|
|
padding: 24px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border: 1px solid #e6edf5;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-13 22:29:46 +08:00
|
|
|
.templates-view__desktop-table :deep(.ant-table) {
|
|
|
|
|
min-width: 1068px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__filters-inline {
|
2026-04-01 00:58:42 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-04-02 00:31:28 +08:00
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 16px 24px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__reset-btn {
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
margin-left: auto;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
.templates-view__filter-item {
|
2026-04-01 00:58:42 +08:00
|
|
|
display: flex;
|
2026-04-02 00:31:28 +08:00
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__filter-item label {
|
|
|
|
|
color: #101828;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__filter-item :deep(.ant-select) {
|
|
|
|
|
min-width: 140px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__filter-item :deep(.ant-picker) {
|
|
|
|
|
width: 320px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__filter-item :deep(.ant-input-affix-wrapper),
|
|
|
|
|
.templates-view__filter-item :deep(.ant-input-search) {
|
|
|
|
|
width: 240px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__table-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__table-head h3 {
|
|
|
|
|
margin: 6px 0 0;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-13 22:29:46 +08:00
|
|
|
.templates-view__mobile-records {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record {
|
|
|
|
|
padding: 16px 0;
|
|
|
|
|
border-top: 1px solid #eef2f6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record:first-of-type {
|
|
|
|
|
border-top: 0;
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-main {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-main h4 {
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: #101828;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-meta,
|
|
|
|
|
.templates-view__mobile-record-status {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
gap: 12px;
|
|
|
|
|
margin-top: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-field {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-field > span,
|
|
|
|
|
.templates-view__mobile-record-actions > span {
|
|
|
|
|
color: #98a2b3;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-field > strong {
|
|
|
|
|
min-width: 0;
|
|
|
|
|
color: #1f2937;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
line-height: 1.55;
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-status {
|
|
|
|
|
padding: 12px;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
background: #f8fafc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-record-actions :deep(.table-actions-row) {
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-pagination {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
.templates-view__drawer-intro {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-intro p {
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: #667085;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-card {
|
|
|
|
|
width: 100%;
|
2026-04-18 15:01:40 +08:00
|
|
|
background: #ffffff;
|
|
|
|
|
border: 1px solid #e5e7eb;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 20px;
|
2026-04-18 13:47:32 +08:00
|
|
|
display: flex;
|
2026-04-18 15:01:40 +08:00
|
|
|
align-items: flex-start;
|
|
|
|
|
gap: 16px;
|
2026-04-18 13:47:32 +08:00
|
|
|
text-align: left;
|
|
|
|
|
cursor: pointer;
|
2026-04-18 15:01:40 +08:00
|
|
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
|
position: relative;
|
|
|
|
|
outline: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-card:hover {
|
|
|
|
|
border-color: #d1d5db;
|
2026-05-01 20:39:09 +08:00
|
|
|
box-shadow:
|
|
|
|
|
0 4px 6px -1px rgba(0, 0, 0, 0.05),
|
|
|
|
|
0 2px 4px -1px rgba(0, 0, 0, 0.03);
|
2026-04-18 15:01:40 +08:00
|
|
|
transform: translateY(-1px);
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-card.is-active {
|
2026-04-18 15:01:40 +08:00
|
|
|
background: #eff6ff;
|
2026-04-18 13:47:32 +08:00
|
|
|
border-color: #1677ff;
|
2026-04-18 15:01:40 +08:00
|
|
|
box-shadow: 0 0 0 1px #1677ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Radio circle representing selection */
|
|
|
|
|
.templates-view__drawer-mode-card::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 20px;
|
|
|
|
|
right: 20px;
|
|
|
|
|
width: 18px;
|
|
|
|
|
height: 18px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
border: 2px solid #d1d5db;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-card.is-active::before {
|
|
|
|
|
border-color: #1677ff;
|
|
|
|
|
background-color: #1677ff;
|
|
|
|
|
box-shadow: inset 0 0 0 3px #eff6ff;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-icon {
|
|
|
|
|
width: 44px;
|
|
|
|
|
height: 44px;
|
2026-04-18 15:01:40 +08:00
|
|
|
border-radius: 10px;
|
2026-04-18 13:47:32 +08:00
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-04-18 15:01:40 +08:00
|
|
|
font-size: 20px;
|
2026-04-18 13:47:32 +08:00
|
|
|
flex-shrink: 0;
|
2026-04-18 15:01:40 +08:00
|
|
|
transition: all 0.2s;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-icon--general {
|
2026-04-18 15:01:40 +08:00
|
|
|
background: #fff7ed;
|
|
|
|
|
color: #ea580c;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-icon--refined {
|
2026-04-18 15:01:40 +08:00
|
|
|
background: #e0f2fe;
|
|
|
|
|
color: #0284c7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-card.is-active .templates-view__drawer-mode-icon {
|
|
|
|
|
transform: scale(1.05);
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-copy {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-04-18 15:01:40 +08:00
|
|
|
gap: 6px;
|
|
|
|
|
padding-right: 32px;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-copy strong {
|
|
|
|
|
font-size: 16px;
|
2026-04-18 15:01:40 +08:00
|
|
|
font-weight: 600;
|
|
|
|
|
color: #111827;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-copy small {
|
2026-04-18 15:01:40 +08:00
|
|
|
color: #6b7280;
|
2026-04-18 13:47:32 +08:00
|
|
|
font-size: 13px;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-panel {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-panel-head {
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__drawer-panel-head h3 {
|
|
|
|
|
margin: 6px 0 0;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: #101828;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-01 00:58:42 +08:00
|
|
|
.templates-view__title-cell {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-04-07 16:07:21 +08:00
|
|
|
gap: 8px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.template-cards-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
flex: 1;
|
2026-04-18 13:47:32 +08:00
|
|
|
flex-wrap: wrap;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.template-card {
|
2026-04-18 13:47:32 +08:00
|
|
|
flex: 1 1 220px;
|
2026-04-01 00:58:42 +08:00
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 20px 16px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
position: relative;
|
2026-05-01 20:39:09 +08:00
|
|
|
transition:
|
|
|
|
|
transform 0.2s,
|
|
|
|
|
box-shadow 0.2s;
|
2026-04-01 00:58:42 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
.template-card:hover {
|
|
|
|
|
transform: translateY(-4px);
|
2026-05-01 20:39:09 +08:00
|
|
|
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.template-icon-wrapper {
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
.template-icon {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.template-title {
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: #1a1a1a;
|
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
|
}
|
|
|
|
|
.template-desc {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #8c8c8c;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
margin: 0 0 16px 0;
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
.template-action {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
.template-arrow {
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Yellow Top X */
|
|
|
|
|
.card-yellow {
|
|
|
|
|
background: linear-gradient(180deg, #fffbf2 0%, #fff6e0 100%);
|
|
|
|
|
border: 1px solid #ffecb3;
|
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
.bg-yellow {
|
|
|
|
|
background: #ffe58f;
|
|
|
|
|
color: #fa8c16;
|
|
|
|
|
}
|
|
|
|
|
.card-yellow .template-action {
|
|
|
|
|
color: #fa8c16;
|
|
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
/* Light Blue Product Review */
|
|
|
|
|
.card-blue-light {
|
|
|
|
|
background: linear-gradient(180deg, #f0f7ff 0%, #e6f0ff 100%);
|
|
|
|
|
border: 1px solid #d6e4ff;
|
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
.bg-blue-light {
|
|
|
|
|
background: #bae0ff;
|
|
|
|
|
color: #1677ff;
|
|
|
|
|
}
|
|
|
|
|
.card-blue-light .template-action {
|
|
|
|
|
color: #1677ff;
|
|
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
/* Blue Deep Research */
|
|
|
|
|
.card-blue-deep {
|
|
|
|
|
background: linear-gradient(135deg, #e6f4ff 0%, #d4e8ff 100%);
|
|
|
|
|
border: 1px solid #bae0ff;
|
|
|
|
|
}
|
2026-05-01 20:39:09 +08:00
|
|
|
.bg-blue-deep {
|
|
|
|
|
background: #91caff;
|
|
|
|
|
color: #0958d9;
|
|
|
|
|
}
|
|
|
|
|
.card-blue-deep .template-action {
|
|
|
|
|
color: #0958d9;
|
|
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
|
|
|
|
/* Grey Expansion */
|
|
|
|
|
.card-grey {
|
|
|
|
|
background: #fcfcfc;
|
|
|
|
|
border: 1px dashed #d9d9d9;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
.templates-view__kol-grid {
|
|
|
|
|
display: grid;
|
2026-04-18 15:01:40 +08:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
|
|
|
gap: 20px;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card {
|
2026-04-18 15:01:40 +08:00
|
|
|
background: #ffffff;
|
|
|
|
|
border: 1px solid #e5e7eb;
|
2026-04-18 13:47:32 +08:00
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
cursor: pointer;
|
2026-04-18 15:01:40 +08:00
|
|
|
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
2026-04-18 13:47:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-04-18 15:01:40 +08:00
|
|
|
position: relative;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card:hover {
|
|
|
|
|
transform: translateY(-4px);
|
2026-05-01 20:39:09 +08:00
|
|
|
box-shadow:
|
|
|
|
|
0 12px 24px -4px rgba(0, 0, 0, 0.08),
|
|
|
|
|
0 4px 8px -2px rgba(0, 0, 0, 0.04);
|
2026-04-18 15:01:40 +08:00
|
|
|
border-color: #d1d5db;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card::after {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
height: 3px;
|
|
|
|
|
background: linear-gradient(90deg, #1677ff, #0958d9);
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transition: opacity 0.25s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card:hover::after {
|
|
|
|
|
opacity: 1;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-cover {
|
2026-04-18 15:01:40 +08:00
|
|
|
height: 120px;
|
2026-04-25 23:17:04 +08:00
|
|
|
background-color: #f3f6fa;
|
2026-04-18 15:01:40 +08:00
|
|
|
position: relative;
|
|
|
|
|
border-bottom: 1px solid #f1f5f9;
|
|
|
|
|
overflow: hidden;
|
2026-04-25 23:17:04 +08:00
|
|
|
isolation: isolate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-cover::before {
|
2026-05-01 20:39:09 +08:00
|
|
|
content: '';
|
2026-04-25 23:17:04 +08:00
|
|
|
position: absolute;
|
|
|
|
|
inset: -16px;
|
|
|
|
|
z-index: 0;
|
|
|
|
|
background-image: var(--cover-image);
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
filter: blur(16px);
|
|
|
|
|
opacity: 0.55;
|
|
|
|
|
transform: scale(1.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-cover::after {
|
2026-05-01 20:39:09 +08:00
|
|
|
content: '';
|
2026-04-25 23:17:04 +08:00
|
|
|
position: absolute;
|
|
|
|
|
inset: 0;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
background-image: var(--cover-image);
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: contain;
|
|
|
|
|
pointer-events: none;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-cover-fallback {
|
2026-04-25 23:17:04 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 2;
|
2026-04-18 13:47:32 +08:00
|
|
|
height: 100%;
|
2026-04-18 15:01:40 +08:00
|
|
|
width: 100%;
|
|
|
|
|
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 15:01:40 +08:00
|
|
|
.templates-view__fallback-icon {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
color: rgba(22, 119, 255, 0.2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-hover-overlay {
|
|
|
|
|
position: absolute;
|
|
|
|
|
inset: 0;
|
2026-04-25 23:17:04 +08:00
|
|
|
z-index: 3;
|
2026-04-18 15:01:40 +08:00
|
|
|
background: rgba(0, 0, 0, 0.04);
|
2026-04-18 13:47:32 +08:00
|
|
|
display: flex;
|
2026-04-18 15:01:40 +08:00
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transition: opacity 0.2s;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 15:01:40 +08:00
|
|
|
.templates-view__kol-hover-overlay > .anticon {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
color: #fff;
|
2026-05-01 20:39:09 +08:00
|
|
|
background: rgba(0, 0, 0, 0.4);
|
2026-04-18 15:01:40 +08:00
|
|
|
border-radius: 50%;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
transform: translateY(10px);
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
backdrop-filter: blur(4px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card:hover .templates-view__kol-hover-overlay {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-card:hover .templates-view__kol-hover-overlay > .anticon {
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-content {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-04-18 13:47:32 +08:00
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-title {
|
2026-04-18 15:01:40 +08:00
|
|
|
font-size: 15px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #111827;
|
|
|
|
|
margin: 0 0 6px 0;
|
2026-04-18 13:47:32 +08:00
|
|
|
line-height: 1.4;
|
2026-04-18 15:01:40 +08:00
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: 1;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
overflow: hidden;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 15:01:40 +08:00
|
|
|
.templates-view__kol-meta-row {
|
2026-04-18 13:47:32 +08:00
|
|
|
display: flex;
|
2026-04-18 16:17:11 +08:00
|
|
|
flex-direction: column;
|
2026-04-18 15:01:40 +08:00
|
|
|
align-items: flex-start;
|
2026-04-18 16:17:11 +08:00
|
|
|
gap: 6px;
|
2026-04-18 15:01:40 +08:00
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-prompt {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #4b5563;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
font-weight: 400;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 16:17:11 +08:00
|
|
|
.templates-view__kol-updated-at {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #9ca3af;
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-18 13:47:32 +08:00
|
|
|
.templates-view__kol-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2026-04-18 15:01:40 +08:00
|
|
|
align-items: center;
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
padding-top: 12px;
|
|
|
|
|
border-top: 1px solid #f3f4f6;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-author {
|
2026-04-18 15:01:40 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #374151;
|
|
|
|
|
font-weight: 500;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-18 15:01:40 +08:00
|
|
|
.templates-view__author-avatar {
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background: #e5e7eb;
|
|
|
|
|
color: #4b5563;
|
|
|
|
|
display: flex;
|
2026-04-18 13:47:32 +08:00
|
|
|
align-items: center;
|
2026-04-18 15:01:40 +08:00
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__kol-platform {
|
|
|
|
|
background: #eff6ff;
|
|
|
|
|
color: #2563eb;
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
white-space: nowrap;
|
2026-04-18 13:47:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
@media (max-width: 1200px) {
|
|
|
|
|
.templates-view__filter-item :deep(.ant-picker) {
|
|
|
|
|
width: 280px;
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-01 20:39:09 +08:00
|
|
|
.bg-grey {
|
|
|
|
|
background: #f0f0f0;
|
|
|
|
|
color: #8c8c8c;
|
|
|
|
|
}
|
|
|
|
|
.card-grey .template-action {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
|
2026-04-02 00:31:28 +08:00
|
|
|
@media (max-width: 720px) {
|
2026-04-18 13:47:32 +08:00
|
|
|
.templates-view__header,
|
2026-04-01 00:58:42 +08:00
|
|
|
.templates-view__table-head {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
}
|
2026-04-18 13:47:32 +08:00
|
|
|
|
|
|
|
|
.templates-view__drawer-mode-grid {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
2026-05-13 22:29:46 +08:00
|
|
|
|
|
|
|
|
.templates-view__table-card {
|
|
|
|
|
padding: 24px 16px 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__desktop-table {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.templates-view__mobile-records {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 420px) {
|
|
|
|
|
.templates-view__mobile-record-meta,
|
|
|
|
|
.templates-view__mobile-record-status {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
2026-04-01 00:58:42 +08:00
|
|
|
}
|
|
|
|
|
</style>
|