|
@@ -32,9 +32,11 @@ import { ElMessage } from 'element-plus';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
// 接口
|
|
|
import { CourseStore } from '@/stores/match/course';
|
|
|
+import { ApplicationStore } from '@/stores/match/application';
|
|
|
import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
|
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
|
const courseAxios = CourseStore();
|
|
|
+const applicationAxios = ApplicationStore();
|
|
|
const dictAxios = DictDataStore();
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
// 路由
|
|
@@ -53,7 +55,7 @@ let fields: Ref<any[]> = ref([
|
|
|
{ label: '蓝方团队名称', model: 'blue_team_name' },
|
|
|
{ label: '蓝方分数', model: 'blue_score' },
|
|
|
{ label: '比赛时间', model: 'match_time' },
|
|
|
- { label: '胜者', model: 'winner' },
|
|
|
+ { label: '胜者', model: 'winner', format: (i: any) => getDict(i, 'winner') },
|
|
|
{ label: '状态', model: 'status', type: 'select', isSearch: true, format: (i: any) => getDict(i, 'status') }
|
|
|
]);
|
|
|
// 操作
|
|
@@ -65,6 +67,7 @@ let opera: Ref<any[]> = ref([
|
|
|
let searchForm: Ref<any> = ref({});
|
|
|
// 字典表
|
|
|
const statusList: Ref<any> = ref([]);
|
|
|
+const applicationList: Ref<any> = ref([]);
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
|
loading.value = true;
|
|
@@ -89,6 +92,10 @@ const getDict = (e, model) => {
|
|
|
let data: any = statusList.value.find((i: any) => i.value == e);
|
|
|
if (data) return data.label;
|
|
|
else return '暂无';
|
|
|
+ } else if (model == 'winner') {
|
|
|
+ let data: any = applicationList.value.find((i: any) => i.team_id == e);
|
|
|
+ if (data) return data.team_name;
|
|
|
+ else return '暂无';
|
|
|
}
|
|
|
};
|
|
|
// 添加
|
|
@@ -113,6 +120,9 @@ const searchOther = async () => {
|
|
|
// 状态
|
|
|
res = await dictAxios.query({ type: 'course_status' });
|
|
|
if (res.errcode == '0') statusList.value = res.data;
|
|
|
+ // 报名情况
|
|
|
+ res = await applicationAxios.query({ match_id: id.value, status: '1' });
|
|
|
+ if (res.errcode == '0') applicationList.value = res.data;
|
|
|
};
|
|
|
// 返回上一页
|
|
|
const toBack = () => {
|