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

View File

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

View File

@@ -52,7 +52,7 @@ onMounted(() => {
<template>
<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}`" />
</NSpace>
<NDivider />