feat(admin): 恢复按日期生成排期图片,重构多项体验问题
- **导入酷狗功能恢复**:废弃纯文本解析,重写为通过多选日期加载对应排期,并支持“根据日期分别生成图片”的场景。 - **浅色打印主题**:在 SchedulePrinter 和 ScheduleItemPrint 中应用 !important 强制白底黑字,消除系统深色模式对预览与打印效果的干扰。 - **日期选择器精简**:彻底删除 AdminDatePicker 和 AdminMultiDatePicker 中的横向日期盘滚动功能,改用直观的选定日期展示,配合月历面板实现更稳定快捷的选择。 - **自动排入逻辑修复**:严格过滤并匹配歌曲的 `expectedPlayDate` 和 `preferredPlayTimeId`,修复无期望播出时间的歌曲被错误填入的问题。
This commit is contained in:
@@ -2055,7 +2055,13 @@ const saveSequence = async () => {
|
||||
// 一键自动排入期望播出的歌曲
|
||||
const autoScheduleExpected = () => {
|
||||
let count = 0
|
||||
const expectedSongs = [...filteredUnscheduledSongs.value]
|
||||
const expectedSongs = [...allUnscheduledSongs.value].filter(song => {
|
||||
// 严格按期望播出日期排期:如果歌曲有期望播出日期,必须匹配当前选择的日期
|
||||
if (song.expectedPlayDate && song.expectedPlayDate !== selectedDate.value) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
if (expectedSongs.length === 0) {
|
||||
showToast('当前没有待排期的歌曲', 'info')
|
||||
@@ -2088,13 +2094,20 @@ const autoScheduleExpected = () => {
|
||||
if (existingIndex !== -1) return
|
||||
|
||||
let targetPlayTimeId = null
|
||||
if (song.preferredPlayTimeId) {
|
||||
const matched = (playTimes.value || []).find(pt => pt.id === song.preferredPlayTimeId)
|
||||
if (matched) targetPlayTimeId = song.preferredPlayTimeId
|
||||
if (song.preferredPlayTimeId != null) {
|
||||
const matched = (playTimes.value || []).find(pt => String(pt.id) === String(song.preferredPlayTimeId))
|
||||
if (matched) targetPlayTimeId = matched.id
|
||||
}
|
||||
|
||||
// 如果没有明确期望时段,但当前处于特定时段视图下,则排入该时段
|
||||
if (targetPlayTimeId == null && filteredPtId != null) {
|
||||
targetPlayTimeId = filteredPtId
|
||||
}
|
||||
if (!targetPlayTimeId && filteredPtId != null) targetPlayTimeId = filteredPtId
|
||||
|
||||
if (filteredPtId != null && targetPlayTimeId !== filteredPtId) return
|
||||
// 如果处于特定时段视图,但该歌曲的期望时段不是当前时段,则跳过不排入
|
||||
if (filteredPtId != null && targetPlayTimeId != null && String(targetPlayTimeId) !== String(filteredPtId)) {
|
||||
return
|
||||
}
|
||||
const ptKey = String(targetPlayTimeId || '')
|
||||
const nextSeq = (playTimeSeqCounters.get(ptKey) || 0) + 1
|
||||
playTimeSeqCounters.set(ptKey, nextSeq)
|
||||
|
||||
Reference in New Issue
Block a user