|
|
@@ -11,6 +11,19 @@
|
|
|
<div>比赛时间:{{ tournamentInfo.startTime }} ~ {{ tournamentInfo.endTime }}</div>
|
|
|
<div>参加人数:{{ tournamentInfo.signNum }}人</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 玩家名称和玩家ID搜索框 -->
|
|
|
+ <div class="mb-[20px]">
|
|
|
+ <el-form :inline="true" @submit.prevent>
|
|
|
+ <el-form-item label="">
|
|
|
+ <el-input v-model="queryParams.playerNameOrId" placeholder="请输入玩家名称或选手ID" clearable @keyup.enter="handlePlayerSearch" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handlePlayerSearch">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- 桌次信息展示区域 -->
|
|
|
<div v-if="tableData.length > 0" class="mb-[20px]">
|
|
|
<div class="section-title">桌次:</div>
|
|
|
@@ -254,7 +267,8 @@ const data = reactive<PageData<HistoryForm, HistoryQuery>>({
|
|
|
handDetails: undefined,
|
|
|
createdAt: undefined,
|
|
|
historyId: undefined,
|
|
|
- params: {}
|
|
|
+ params: {},
|
|
|
+ playerNameOrId: undefined
|
|
|
},
|
|
|
rules: {
|
|
|
id: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
|
@@ -565,6 +579,61 @@ const handleTableNumberClick = async (table: any) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const handlePlayerSearch = async () => {
|
|
|
+ // 获取当前赛事的 tournamentId
|
|
|
+ const tournamentId = tournamentInfo.value.id;
|
|
|
+ if (!tournamentId) {
|
|
|
+ proxy?.$modal.msgError('请先选择赛事');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置 queryParams 的 tournamentId
|
|
|
+ queryParams.value.tournamentId = tournamentId;
|
|
|
+
|
|
|
+ // 获取玩家名称或ID
|
|
|
+ const playerNameOrId = queryParams.value.playerNameOrId;
|
|
|
+ if (!playerNameOrId) {
|
|
|
+ proxy?.$modal.msgError('请输入玩家名称或选手ID');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 调用 API 获取桌次数据
|
|
|
+ const res = await selectAllHandZhuoCi2(queryParams.value);
|
|
|
+ if (res.code === 200) {
|
|
|
+ tableData.value = res.data;
|
|
|
+
|
|
|
+ // 如果有桌次数据,进一步获取局数数据
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
+ const firstTable = tableData.value[0];
|
|
|
+ selectedTableId.value = firstTable.tableId;
|
|
|
+
|
|
|
+ // 更新 queryParams 以获取局数数据
|
|
|
+ queryParams.value.tableId = firstTable.tableId;
|
|
|
+ const res = await selectAllHandNumber(queryParams.value);
|
|
|
+ tableNumberData.value = res.data;
|
|
|
+
|
|
|
+ // 默认选中第一个局数
|
|
|
+ if (tableNumberData.value.length > 0) {
|
|
|
+ const firstHandTable = tableNumberData.value[0];
|
|
|
+ selectedTableHandNumberId.value = firstHandTable.handNumber;
|
|
|
+ queryParams.value.historyId = firstHandTable.id;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tableNumberData.value = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 刷新历史列表
|
|
|
+ await getList();
|
|
|
+ } else {
|
|
|
+ proxy?.$modal.msgError('获取桌次数据失败');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('搜索玩家数据失败', error);
|
|
|
+ proxy?.$modal.msgError('搜索玩家数据失败');
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 高亮小盲、大盲
|
|
|
function highlightBlinds(text: string): string {
|
|
|
if (!text) return '';
|