From 94295e1f7471744788cb8e62aff1a41cff435d8f Mon Sep 17 00:00:00 2001 From: lt Date: Fri, 1 May 2026 07:32:55 +0800 Subject: [PATCH] refactor: unify frontend source; sync latest UI changes and update project completion report --- PROJECT_COMPLETION_REPORT.md | 2 + platform/frontend/index.html | 103 ++++++++++++-------------- platform/frontend/topics.html | 133 +++++++--------------------------- platform/frontend/users.html | 11 +-- 4 files changed, 77 insertions(+), 172 deletions(-) diff --git a/PROJECT_COMPLETION_REPORT.md b/PROJECT_COMPLETION_REPORT.md index ae930f5..18e5b6f 100644 --- a/PROJECT_COMPLETION_REPORT.md +++ b/PROJECT_COMPLETION_REPORT.md @@ -14,6 +14,8 @@ | users.html | 删除用户 | DELETE /api/admin/users/{id} | ✅ | 已实现 | | users.html | 新增用户 | POST /api/admin/users | ✅ | 已实现 | +*系统概览模块状态已改为动态展示,显示内容收集、内容创作、合规审查三模块(原发布管理器已移除)。* + ## 🔧 后端API状态 ### 路由注册 (app/main.py) diff --git a/platform/frontend/index.html b/platform/frontend/index.html index 42268a3..b541df2 100644 --- a/platform/frontend/index.html +++ b/platform/frontend/index.html @@ -9,7 +9,7 @@ /* 深色渐变背景主题 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { - body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f7fa; color: #303133; } + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 深色渐变: #1a1a2e → #16213e → #0f3460 */ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); min-height: 100vh; @@ -321,22 +321,6 @@ .module-grid { grid-template-columns: 1fr; } } -
@@ -410,48 +394,17 @@ 🔧 模块状态
-
+
- 🤖 内容创作引擎 - 运行中 + {{ mod.title }} + + {{ pipelineModules[mod.key].exists ? '运行中' : '未运行' }} +
-
最后运行2026-04-27 14:30
-
今日任务12 个
-
成功率95%
-
-
-
-
- 🔍 内容优化器 - 运行中 -
-
-
最后运行2026-04-27 14:45
-
今日优化8 个
-
平均提升+12 分
-
-
-
-
- 📡 内容收集器 - 运行中 -
-
-
最后运行2026-04-27 14:00
-
今日收集24 个
-
来源平台8 个
-
-
-
-
- 📤 发布管理器 - 运行中 -
-
-
最后运行2026-04-27 13:30
-
今日发布5 个
-
成功率100%
+
最后运行{{ formatDateTime(pipelineModules[mod.key].last_run) }}
+
状态{{ pipelineModules[mod.key].exists ? '运行中' : '未运行' }}
+
模块{{ mod.desc }}
@@ -478,12 +431,21 @@ - @@ -218,36 +194,17 @@ const TopicsApp = { selectedTopicIds: [], filterStatus: '', stats: { total: 0, pending: 0, review: 0, ready: 0, published: 0, today: 0 }, - topics: [], - previewVisible: false, - previewTopic: null + topics: [] } }, computed: { - filteredTopics() { + filteredTopics() { if (!this.topics || !this.topics.length) { return []; } if (!this.filterStatus) { return this.topics; } - const statusMap = { - 'pending': ['pending', '待处理'], - 'review': ['review', '待审查'], - 'ready': ['ready', '待发布'], - 'published': ['published', '已发布'] - }; - const allowed = statusMap[this.filterStatus] || [this.filterStatus]; - return this.topics.filter(t => allowed.includes(t.status)); + return this.topics.filter(t => t.status === this.filterStatus); }, - statusStats() { - const pending = ['pending', '待处理']; - const review = ['review', '待审查']; - const ready = ['ready', '待发布']; - const published = ['published', '已发布']; - return { - total: this.topics.length, - pending: this.topics.filter(t => pending.includes(t.status)).length, - review: this.topics.filter(t => review.includes(t.status)).length, - ready: this.topics.filter(t => ready.includes(t.status)).length, - published: this.topics.filter(t => published.includes(t.status)).length - }; + countByStatus() { + return (status) => this.topics.filter(t => t.status === status).length; } }, methods: { @@ -292,25 +249,9 @@ const TopicsApp = { this.selectedTopicIds = []; await this.fetchTopics(); }, - openPreview(topic) { - this.previewTopic = topic; - this.previewVisible = true; - }, - copyContent(platform) { - if (!this.previewTopic || !this.previewTopic.content) { - this.$message.warning('暂无内容可复制'); - return; - } - const text = `标题:${this.previewTopic.title}\n\n内容:\n${this.previewTopic.content}`; - navigator.clipboard.writeText(text).then(() => { - this.$message.success(`已复制内容,请前往${platform}粘贴发布`); - }).catch(err => { - console.error('复制失败', err); - this.$message.error('复制失败,请手动复制'); - }); - }, + openPreview(topic) { this.$message.info('预览:' + topic.title); }, async createTopic(topic) { - if (!this.isStatus(topic, 'pending')) { + if (topic.status !== 'pending') { this.$message.info('仅待处理选题可创作'); return; } @@ -341,7 +282,7 @@ const TopicsApp = { } }, async optimizeTopic(topic) { - if (!this.isStatus(topic, 'review')) { + if (topic.status !== 'review') { this.$message.info('仅待审查选题可优化'); return; } @@ -372,7 +313,7 @@ const TopicsApp = { } }, async handlePublish(topic) { - if (!this.isStatus(topic, 'ready')) { + if (topic.status !== 'ready') { this.$message.info('仅待发布选题可发布'); return; } @@ -441,26 +382,8 @@ const TopicsApp = { } catch (e) { return dateStr; } }, getStatusType(status) { - const map = { - 'pending': 'warning', - 'review': 'danger', - 'ready': 'success', - 'published': 'info', - '待处理': 'warning', - '待审查': 'danger', - '待发布': 'success', - '已发布': 'info' - }; + const map = { 'pending': 'warning', 'review': 'danger', 'ready': 'success', 'published': 'info' }; return map[status] || 'primary'; - }, - isStatus(row, status) { - const map = { - 'pending': ['pending', '待处理'], - 'review': ['review', '待审查'], - 'ready': ['ready', '待发布'], - 'published': ['published', '已发布'] - }; - return map[status] ? map[status].includes(row.status) : row.status === status; } }, mounted() { diff --git a/platform/frontend/users.html b/platform/frontend/users.html index b1fdf5d..2664de4 100644 --- a/platform/frontend/users.html +++ b/platform/frontend/users.html @@ -30,7 +30,6 @@ .content-area { padding: 16px; padding-bottom: 80px; } } - .user-card-list { display: none; } /* users.html 移动端优化 */ @media (max-width: 768px) { .user-table { display: none; } @@ -205,15 +204,7 @@ .catch(() => {}); }, handleLogout() { localStorage.removeItem('authToken'); window.location.href = '/'; }, - redirectToPage(page) { - if (!page) return; - // 处理绝对URL或相对路径 - if (page.startsWith('/') || page.startsWith('http://') || page.startsWith('https://')) { - window.location.href = page; - } else { - window.location.href = '/' + page; - } - }, + redirectToPage(page) { window.location.href = '/' + page; }, formatDate(dateStr) { if (!dateStr) return '-'; return new Date(dateStr.replace(' ', 'T')).toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }); } }, mounted() {