feat: 玩家黑名单 - 记录外部平台坑玩家

- 新增 player_blacklist collection 迁移
- 添加 PlayerTag/PlayerBlacklistEntry 类型定义和 API
- 创建 PlayerBlacklistMain + CreatePlayerBlacklistDialog 组件
- BlacklistView 支持 Tab 切换游戏/玩家黑名单
- 支持搜索、标签筛选、严重程度筛选、实时订阅

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
congsh
2026-04-19 13:03:55 +08:00
parent 60ad9a04cd
commit d528358867
6 changed files with 1202 additions and 4 deletions
+72 -4
View File
@@ -1,9 +1,10 @@
<!-- src/views/BlacklistView.vue -->
<script setup lang="ts">
import { onMounted, computed } from 'vue'
import { onMounted, computed, ref } from 'vue'
import { useRoute } from 'vue-router'
import { useGroupStore } from '@/stores/group'
import BlacklistMain from '@/components/gameBlacklist/BlacklistMain.vue'
import PlayerBlacklistMain from '@/components/playerBlacklist/PlayerBlacklistMain.vue'
import { ArrowLeft } from '@element-plus/icons-vue'
const route = useRoute()
@@ -12,6 +13,8 @@ const groupId = route.params.groupId as string
const group = computed(() => groupStore.currentGroup)
const activeTab = ref<'game' | 'player'>('game')
onMounted(async () => {
await groupStore.setCurrentGroup(groupId)
})
@@ -25,13 +28,39 @@ onMounted(async () => {
<el-icon><ArrowLeft /></el-icon> 返回群组
</router-link>
<div class="header-content">
<h1 class="page-title">游戏黑名单</h1>
<h1 class="page-title">黑名单</h1>
<span class="group-badge">{{ group?.name }}</span>
</div>
</section>
<!-- 黑名单内容 -->
<BlacklistMain />
<!-- Tab 切换 -->
<div class="blacklist-tabs">
<button
:class="['blacklist-tab', { 'blacklist-tab--active': activeTab === 'game' }]"
@click="activeTab = 'game'"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="blacklist-tab__icon">
<rect x="2" y="6" width="20" height="12" rx="2" />
<path d="M6 12h4" />
<path d="M6 9h4" />
</svg>
游戏黑名单
</button>
<button
:class="['blacklist-tab', { 'blacklist-tab--active': activeTab === 'player' }]"
@click="activeTab = 'player'"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="blacklist-tab__icon">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
<circle cx="12" cy="7" r="4" />
</svg>
玩家黑名单
</button>
</div>
<!-- 内容 -->
<BlacklistMain v-if="activeTab === 'game'" />
<PlayerBlacklistMain v-else />
</div>
</template>
@@ -99,4 +128,43 @@ onMounted(async () => {
color: var(--gg-primary-light);
font-weight: 500;
}
/* Tab */
.blacklist-tabs {
display: flex;
gap: 8px;
}
.blacklist-tab {
display: flex;
align-items: center;
gap: 6px;
padding: 10px 20px;
border: 1px solid var(--gg-border);
border-radius: var(--gg-radius-md);
background: var(--gg-bg-card);
color: var(--gg-text-secondary);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
-webkit-tap-highlight-color: transparent;
}
.blacklist-tab:hover {
border-color: var(--gg-primary-light);
color: var(--gg-primary);
}
.blacklist-tab--active {
border-color: var(--gg-primary);
background: rgba(5, 150, 105, 0.08);
color: var(--gg-primary);
font-weight: 600;
}
.blacklist-tab__icon {
width: 16px;
height: 16px;
}
</style>