fix: 今日新增筛选统计不准 + LLM提示词动态当前日期 + 微信配图按选题生成
topics.html:
- 今日新增筛选时全量拉取 allTopics 用于保持 stats 统计正确,todayTopics
存储服务端日期过滤结果
- filteredTopics 对 'today' 返回 todayTopics,不按不存在的 status 过滤
writer.py/research.py/outline.py:
- 所有 LLM 提示词注入今天的动态年月日(datetime.now)
- 禁用过时数据的年份改为动态 {当前年-1}-{当前年}
- 每个论点必须配真实最新案例+数据来源
writer.py WeChat 配图:
- 从 null placeholder 改为动态 SVG,展示选题标题+领域
- 标题自动换行(24字/行),附蓝色装饰条 + 渐变背景
This commit is contained in:
@@ -180,7 +180,7 @@ const TopicsApp = {
|
||||
isLoggedIn: false, isAdmin: false, currentUser: { username: '' },
|
||||
loadingTable: false, selectedTopicIds: [], filterStatus: '',
|
||||
stats: { total: 0, pending: 0, review: 0, ready: 0, published: 0, today: 0 },
|
||||
topics: [], todayCount: 0,
|
||||
topics: [], allTopics: [], todayTopics: [], todayCount: 0,
|
||||
previewVisible: false, previewTopic: null, previewFullscreen: false,
|
||||
previewPlatform: 'zhihu', platformContents: {},
|
||||
publishDialogVisible: false, publishTopic: null,
|
||||
@@ -190,7 +190,8 @@ const TopicsApp = {
|
||||
},
|
||||
computed: {
|
||||
filteredTopics() {
|
||||
if (!this.filterStatus || this.filterStatus === 'today') return this.topics;
|
||||
if (this.filterStatus === 'today') return this.todayTopics;
|
||||
if (!this.filterStatus) return this.topics;
|
||||
const map = { 'pending': ['pending','待处理'], 'review': ['review','待审查'], 'ready': ['ready','待发布'], 'published': ['published','已发布'] };
|
||||
const allowed = map[this.filterStatus] || [this.filterStatus];
|
||||
return this.topics.filter(t => allowed.includes(t.status));
|
||||
@@ -235,9 +236,15 @@ const TopicsApp = {
|
||||
async fetchTopics() {
|
||||
this.loadingTable = true;
|
||||
try {
|
||||
const params = this.filterStatus === 'today' ? '?today=true' : '';
|
||||
const data = await this.api('/api/topics' + params);
|
||||
this.topics = data || [];
|
||||
const token = this.getToken();
|
||||
const allResp = await fetch('/api/topics', { headers: { 'Authorization': 'Bearer ' + token } });
|
||||
this.allTopics = await allResp.json() || [];
|
||||
this.topics = this.allTopics;
|
||||
|
||||
if (this.filterStatus === 'today') {
|
||||
const todayResp = await fetch('/api/topics?today=true', { headers: { 'Authorization': 'Bearer ' + token } });
|
||||
this.todayTopics = await todayResp.json() || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取选题失败:', error);
|
||||
this.$message.error(`获取选题失败: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user