修复退出应用不关闭浏览器,和删除主播的调用优化

This commit is contained in:
2026-02-28 16:13:35 +08:00
parent 3276e7d5cb
commit b6f8586efa

View File

@@ -120,10 +120,10 @@
<!-- 主播列表 -->
<div class="flex-1 overflow-auto p-4">
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3">
<div v-for="host in filteredHosts" :key="host.anchorId" @click="toggleSelect(host.anchorId)"
<div v-for="host in filteredHosts" :key="host.id" @click="toggleSelect(host.id)"
:class="[
'p-3 rounded-lg border cursor-pointer transition-all',
selected.has(host.anchorId) ? 'border-blue-500 bg-blue-50 shadow' : 'border-gray-200 hover:border-gray-300 hover:shadow-sm'
selected.has(host.id) ? 'border-blue-500 bg-blue-50 shadow' : 'border-gray-200 hover:border-gray-300 hover:shadow-sm'
]">
<div class="flex items-center justify-between mb-1">
<span class="font-medium text-sm truncate flex-1" :title="host.anchorId">
@@ -532,7 +532,7 @@ const toggleSelect = (id) => {
}
const selectAll = () => {
selected.value = new Set(filteredHosts.value.map(h => h.anchorId))
selected.value = new Set(filteredHosts.value.map(h => h.id))
}
const selectNone = () => {
@@ -550,7 +550,7 @@ const invertSelect = () => {
const deleteSelected = async () => {
if (!selected.value.size) return
if (!confirm(`确认删除选中的 ${selected.value.size} 项吗?`)) return
console.log(selected.value)
if (isElectron()) {
try {
const ids = Array.from(selected.value)