+
-
@@ -3257,6 +3281,13 @@
selectedType: (localStorage.getItem('calendar_selected_type') || 'all'),
nameFilter: '',
taskFilter: '',
+ statusFilter: (() => {
+ try {
+ return localStorage.getItem('calendar_status_filter') || '';
+ } catch (e) {
+ return '';
+ }
+ })(),
taskNames: [],
viewMode: (localStorage.getItem('calendar_view_mode') === 'month' || localStorage.getItem('calendar_view_mode') === 'poster')
? localStorage.getItem('calendar_view_mode')
@@ -3381,6 +3412,9 @@
if (this.calendar.taskFilter && this.calendar.taskFilter.trim() !== '') {
list = list.filter(t => (t.task_name || '') === this.calendar.taskFilter);
}
+ if (this.calendar.statusFilter && this.calendar.statusFilter.trim() !== '') {
+ list = list.filter(t => this.filterTaskByStatus(t, this.calendar.statusFilter));
+ }
// 按匹配状态和任务名称拼音排序:匹配的项目在前,未匹配的项目在后
try {
list.sort((a, b) => {
@@ -3650,6 +3684,14 @@
this.initializeCalendarDates();
}
},
+ 'calendar.statusFilter': function(newVal, oldVal) {
+ if (this.calendar.viewMode === 'month') {
+ this.initializeCalendarDates();
+ }
+ try {
+ localStorage.setItem('calendar_status_filter', newVal || '');
+ } catch (e) {}
+ },
taskStatusFilter(newValue) {
try {
localStorage.setItem('tasklist_status_filter', newValue || '');
@@ -4403,9 +4445,10 @@
return contentType === this.tasklist.selectedType;
} catch (e) { return true; }
},
- tasklistFilterByStatus(task) {
+ // 统一的状态筛选逻辑(任务列表与追剧日历共用)
+ filterTaskByStatus(task, filterValue) {
try {
- const filter = this.taskStatusFilter || '';
+ const filter = filterValue || '';
if (!filter) return true;
if (!task) return false;
const taskName = task.taskname || task.task_name || '';
@@ -4436,6 +4479,9 @@
return true;
}
},
+ tasklistFilterByStatus(task) {
+ return this.filterTaskByStatus(task, this.taskStatusFilter);
+ },
getTasklistFullStatus(task) {
try {
if (!task) return '';
@@ -5009,10 +5055,9 @@
// 先进行基础筛选
let filteredEpisodes = this.calendar.episodes.filter(episode => {
// 根据筛选条件过滤
+ const matchedTask = this.findTaskByShowName(episode.show_name);
if (this.calendar.selectedType !== 'all') {
- // 通过剧集名称匹配任务,获取内容类型
- const matchedTask = this.findTaskByShowName(episode.show_name);
- const episodeContentType = matchedTask ? matchedTask.content_type : 'other';
+ const episodeContentType = matchedTask ? (matchedTask.content_type || 'other') : 'other';
if (episodeContentType !== this.calendar.selectedType) {
return false;
}
@@ -5029,12 +5074,16 @@
// 任务筛选:检查任务名称
if (this.calendar.taskFilter && this.calendar.taskFilter.trim() !== '') {
- const matchedTask = this.findTaskByShowName(episode.show_name);
- const taskName = matchedTask ? matchedTask.task_name : '';
+ const taskName = matchedTask ? (matchedTask.task_name || matchedTask.taskname || '') : '';
if (taskName !== this.calendar.taskFilter) {
return false;
}
}
+
+ // 状态筛选:复用任务列表逻辑
+ if (!this.filterTaskByStatus(matchedTask, this.calendar.statusFilter)) {
+ return false;
+ }
return episode.air_date === date;
});
@@ -5990,6 +6039,8 @@
this.calendar.nameFilter = '';
} else if (filterType === 'taskFilter') {
this.calendar.taskFilter = '';
+ } else if (filterType === 'statusFilter') {
+ this.calendar.statusFilter = '';
}
},