fix schedule select

This commit is contained in:
2023-12-27 18:28:40 +08:00
parent 840dc080a0
commit cc13d7280e
3 changed files with 16 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ import {
SelectOption, SelectOption,
useMessage, useMessage,
} from 'naive-ui' } from 'naive-ui'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import APlayer from 'vue3-aplayer' import APlayer from 'vue3-aplayer'
import { clearInterval, setInterval } from 'worker-timers' import { clearInterval, setInterval } from 'worker-timers'
import MusicRequestOBS from '../obs/MusicRequestOBS.vue' import MusicRequestOBS from '../obs/MusicRequestOBS.vue'
@@ -357,7 +357,8 @@ function onMusicEnd() {
currentOriginMusic.value = undefined currentOriginMusic.value = undefined
setTimeout(() => { setTimeout(() => {
if (!settings.value.playMusicWhenFree) { if (!settings.value.playMusicWhenFree) {
aplayer.value?.pause() message.info('根据配置,已暂停播放音乐')
pauseMusic()
} }
}, 10) }, 10)
} }
@@ -368,15 +369,16 @@ function playWaitingMusic(music: WaitMusicInfo) {
if (index > -1) { if (index > -1) {
waitingMusics.value.splice(index, 1) waitingMusics.value.splice(index, 1)
} }
aplayer.value?.pause() pauseMusic()
currentOriginMusic.value = music currentOriginMusic.value = music
aplayer.value?.audio.addEventListener( nextTick(() => {
'loadeddata',
() => {
aplayer.value?.play() aplayer.value?.play()
}, })
{ once: true }, }
) function pauseMusic() {
if (!aplayer.value?.audio.paused) {
aplayer.value?.pause()
}
} }
function setSinkId() { function setSinkId() {
try { try {

View File

@@ -200,6 +200,9 @@ async function getAll() {
} }
} }
async function add(danmaku: EventModel) { async function add(danmaku: EventModel) {
if (!accountInfo.value?.settings.enableFunctions.includes(FunctionTypes.Queue)) {
return
}
if (!checkMessage(danmaku)) { if (!checkMessage(danmaku)) {
return return
} }

View File

@@ -52,7 +52,7 @@ onMounted(() => {
<template> <template>
<NSpace> <NSpace>
<NSelect :options="options" v-model:value="selectedDate" style="max-width: 200px" placeholder="选择其他周表" /> <NSelect :options="options" v-model:value="selectedDate" style="width: 200px" placeholder="选择其他周表" />
<SaveCompoent :compoent="table" :file-name="`周表_${selectedDate}_${userInfo?.name}`" /> <SaveCompoent :compoent="table" :file-name="`周表_${selectedDate}_${userInfo?.name}`" />
</NSpace> </NSpace>
<NDivider /> <NDivider />