'commit'
This commit is contained in:
@@ -154,12 +154,34 @@
|
||||
|
||||
<!-- Douyin Tab -->
|
||||
<div class="douyin-container" v-show="activeTab==='douyin'" style="padding: 24px; max-width: 95%; margin: 0 auto;">
|
||||
<!-- Summary Dialog -->
|
||||
<el-dialog v-model="showSummaryDialog" title="💡 知识精华总结" width="60%" :before-close="handleSummaryClose">
|
||||
<div class="dialog-content" style="max-height: 60vh; overflow-y: auto; padding: 10px;">
|
||||
<div v-if="summaryLoading && !summaryText" style="text-align: center; padding: 20px; color: #6b7280;">
|
||||
<p>⚡ AI正在阅读您的知识库并提炼精华,请稍候...</p>
|
||||
</div>
|
||||
<div class="markdown-body" v-html="renderedSummary" style="font-size: 15px; line-height: 1.8; color: #1f2937;"></div>
|
||||
<span v-if="summaryLoading && summaryText" class="cursor-blink">|</span>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleSummaryClose">关闭</el-button>
|
||||
<el-button type="primary" @click="fetchDouyinSummary" :loading="summaryLoading">
|
||||
{{ summaryText ? '重新生成' : '开始总结' }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<div class="douyin-header" style="text-align: center; margin-bottom: 40px;">
|
||||
<h1 style="font-size: 2.5rem; font-weight: bold; color: #f1f5f9; margin-bottom: 0.5rem;">
|
||||
抖音知识库
|
||||
<button class="btn-primary" @click="fetchDouyinRecords" style="font-size: 1rem; padding: 4px 12px; margin-left: 12px; vertical-align: middle;">
|
||||
🔄 刷新列表
|
||||
</button>
|
||||
<button class="btn-primary" @click="openSummaryDialog" style="font-size: 1rem; padding: 4px 12px; margin-left: 12px; vertical-align: middle; background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); border: none;">
|
||||
✨ 提取知识精华
|
||||
</button>
|
||||
</h1>
|
||||
<p style="color: #94a3b8;">自动解析视频、提取文案,构建企业充电知识图谱</p>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,12 @@ createApp({
|
||||
const douyinLoading = ref(false);
|
||||
const douyinRecords = ref([]);
|
||||
let douyinTimer = null;
|
||||
|
||||
|
||||
// Douyin Summary State
|
||||
const showSummaryDialog = ref(false);
|
||||
const summaryLoading = ref(false);
|
||||
const summaryText = ref('');
|
||||
|
||||
// Handle window resize
|
||||
window.addEventListener('resize', () => {
|
||||
isMobile.value = window.innerWidth <= 768;
|
||||
@@ -468,6 +473,15 @@ createApp({
|
||||
}
|
||||
});
|
||||
|
||||
const renderedSummary = computed(() => {
|
||||
if (!summaryText.value) return '';
|
||||
try {
|
||||
return marked.parse(summaryText.value);
|
||||
} catch (e) {
|
||||
return summaryText.value;
|
||||
}
|
||||
});
|
||||
|
||||
// ==========================================
|
||||
// Watchers
|
||||
// ==========================================
|
||||
|
||||
Reference in New Issue
Block a user