|
@@ -26,7 +26,7 @@
|
|
|
<el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
|
|
|
<cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
|
|
|
<template #winner>
|
|
|
- <el-option v-for="i in applicationList" :key="i.team_id" :label="i.team_name" :value="i.team_id"></el-option>
|
|
|
+ <el-option v-for="i in winnerList" :key="i._id" :label="i.name" :value="i._id"></el-option>
|
|
|
</template>
|
|
|
<template #status>
|
|
|
<el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
@@ -46,12 +46,12 @@ import { ElMessage } from 'element-plus';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
// 接口
|
|
|
import { CourseStore } from '@/stores/match/course';
|
|
|
-import { ApplicationStore } from '@/stores/match/application';
|
|
|
+import { TeamStore } from '@/stores/team/team';
|
|
|
import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
|
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
|
const courseAxios = CourseStore();
|
|
|
-const applicationAxios = ApplicationStore();
|
|
|
const dictAxios = DictDataStore();
|
|
|
+const teamAxios = TeamStore();
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
// 路由
|
|
|
const router = useRouter();
|
|
@@ -82,15 +82,15 @@ let opera: Ref<any[]> = ref([
|
|
|
let searchForm: Ref<any> = ref({});
|
|
|
// 字典表
|
|
|
const statusList: Ref<any> = ref([]);
|
|
|
-const applicationList: Ref<any> = ref([]);
|
|
|
+const winnerList: Ref<any> = ref([]);
|
|
|
// 弹框
|
|
|
const dialog: Ref<any> = ref({ title: '赛程状态', show: false, type: '1' });
|
|
|
const form: Ref<any> = ref({ file: [] });
|
|
|
const formFields: Ref<any> = ref([
|
|
|
+ { label: '状态', model: 'status', type: 'select' },
|
|
|
{ label: '红方分数', model: 'red_score' },
|
|
|
{ label: '蓝方分数', model: 'blue_score' },
|
|
|
- { label: '胜者', model: 'winner', type: 'select' },
|
|
|
- { label: '状态', model: 'status', type: 'select' }
|
|
|
+ { label: '胜者', model: 'winner', type: 'select' }
|
|
|
]);
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
@@ -117,16 +117,24 @@ const getDict = (e, model) => {
|
|
|
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;
|
|
|
+ let data: any = winnerList.value.find((i: any) => i._id == e);
|
|
|
+ if (data) return data.name;
|
|
|
else return '暂无';
|
|
|
}
|
|
|
};
|
|
|
// 赛程状态
|
|
|
const toStatus = async (data) => {
|
|
|
- let res: IQueryResult = await courseAxios.fetch(data._id);
|
|
|
+ let res: any = await courseAxios.fetch(data._id);
|
|
|
if (res.errcode == '0') {
|
|
|
form.value = res.data;
|
|
|
+ // 胜者
|
|
|
+ const { red_team_id, blue_team_id } = res.data;
|
|
|
+ const red: any = await teamAxios.fetch(red_team_id);
|
|
|
+ const blue: any = await teamAxios.fetch(blue_team_id);
|
|
|
+ let list = [];
|
|
|
+ list.push(red.data);
|
|
|
+ list.push(blue.data);
|
|
|
+ winnerList.value = list;
|
|
|
dialog.value = { title: '赛程状态', show: true, type: '1' };
|
|
|
}
|
|
|
};
|
|
@@ -152,9 +160,6 @@ 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 toSave = async (data) => {
|