|
@@ -18,14 +18,30 @@
|
|
|
<el-icon><Refresh /></el-icon> 刷新数据
|
|
<el-icon><Refresh /></el-icon> 刷新数据
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <!-- 组别筛选 -->
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="selectedRankGroupId"
|
|
|
|
|
+ placeholder="按组别筛选"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @change="loadBonusData"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in rankGroupOptions"
|
|
|
|
|
+ :key="item.rgId"
|
|
|
|
|
+ :label="item.rgName"
|
|
|
|
|
+ :value="item.rgId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-col>
|
|
|
<!-- 倒计时显示区域 -->
|
|
<!-- 倒计时显示区域 -->
|
|
|
- <el-col :span="6">
|
|
|
|
|
|
|
+ <el-col :span="4">
|
|
|
<div class="countdown-info">
|
|
<div class="countdown-info">
|
|
|
- <el-button size="default" type="primary">
|
|
|
|
|
- <!-- <el-icon class="countdown-icon"><Timer /></el-icon> -->
|
|
|
|
|
|
|
+ <el-button size="default" type="primary" style="width: 100%">
|
|
|
{{ countdownSeconds }}秒后刷新
|
|
{{ countdownSeconds }}秒后刷新
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <!-- <span class="countdown-description">数据将自动刷新</span> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="loadBonusData" ></right-toolbar> -->
|
|
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="loadBonusData" ></right-toolbar> -->
|
|
@@ -110,10 +126,10 @@
|
|
|
<script setup name="GameScoreBonus" lang="ts">
|
|
<script setup name="GameScoreBonus" lang="ts">
|
|
|
import { ref, onMounted, onUnmounted, getCurrentInstance, toRefs } from 'vue';
|
|
import { ref, onMounted, onUnmounted, getCurrentInstance, toRefs } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { Timer } from '@element-plus/icons-vue';
|
|
|
|
|
import { getBonusData, updateBonusData, exportBonusExcel } from '@/api/system/gameScore';
|
|
import { getBonusData, updateBonusData, exportBonusExcel } from '@/api/system/gameScore';
|
|
|
import { useGameEventStore } from '@/store/modules/gameEvent';
|
|
import { useGameEventStore } from '@/store/modules/gameEvent';
|
|
|
import type { ComponentInternalInstance } from 'vue';
|
|
import type { ComponentInternalInstance } from 'vue';
|
|
|
|
|
+import { listRankGroup } from '@/api/system/rankGroup';
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -130,6 +146,10 @@ const bonusDataList = ref<any[]>([]);
|
|
|
const bonusProjectList = ref<any[]>([]);
|
|
const bonusProjectList = ref<any[]>([]);
|
|
|
const selectedBonusRows = ref<any[]>([]);
|
|
const selectedBonusRows = ref<any[]>([]);
|
|
|
|
|
|
|
|
|
|
+// 分组筛选相关
|
|
|
|
|
+const rankGroupOptions = ref<any[]>([]);
|
|
|
|
|
+const selectedRankGroupId = ref<string | number | null>(null);
|
|
|
|
|
+
|
|
|
// 列显隐数据
|
|
// 列显隐数据
|
|
|
const columns = ref<FieldOption[]>([
|
|
const columns = ref<FieldOption[]>([
|
|
|
{ key: 0, label: '序号', visible: true },
|
|
{ key: 0, label: '序号', visible: true },
|
|
@@ -186,6 +206,22 @@ const startAutoRefresh = () => {
|
|
|
console.log(`自动刷新已开启,每${autoRefreshSeconds.value}秒刷新一次`);
|
|
console.log(`自动刷新已开启,每${autoRefreshSeconds.value}秒刷新一次`);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 获取分组选项
|
|
|
|
|
+const loadRankGroupOptions = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const event = gameEventStore.defaultEventInfo;
|
|
|
|
|
+ if (!event?.eventId) return;
|
|
|
|
|
+
|
|
|
|
|
+ const res = await listRankGroup({
|
|
|
|
|
+ eventId: event.eventId,
|
|
|
|
|
+ status: '0'
|
|
|
|
|
+ });
|
|
|
|
|
+ rankGroupOptions.value = res.rows;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取分组列表失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 加载加分数据
|
|
// 加载加分数据
|
|
|
const loadBonusData = async () => {
|
|
const loadBonusData = async () => {
|
|
|
bonusLoading.value = true;
|
|
bonusLoading.value = true;
|
|
@@ -199,7 +235,8 @@ const loadBonusData = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const response = await getBonusData({
|
|
const response = await getBonusData({
|
|
|
- eventId: eventId
|
|
|
|
|
|
|
+ eventId: eventId,
|
|
|
|
|
+ rgId: selectedRankGroupId.value || undefined
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
bonusDataList.value = response.data.rows || [];
|
|
bonusDataList.value = response.data.rows || [];
|
|
@@ -432,6 +469,8 @@ onUnmounted(() => {
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
// 先加载默认赛事信息
|
|
// 先加载默认赛事信息
|
|
|
await gameEventStore.fetchDefaultEvent();
|
|
await gameEventStore.fetchDefaultEvent();
|
|
|
|
|
+ // 加载分组信息
|
|
|
|
|
+ loadRankGroupOptions();
|
|
|
// 然后加载加分数据
|
|
// 然后加载加分数据
|
|
|
await loadBonusData();
|
|
await loadBonusData();
|
|
|
// 开启自动刷新
|
|
// 开启自动刷新
|