guhongwei hai 1 ano
pai
achega
aa6253c249
Modificáronse 1 ficheiros con 13 adicións e 7 borrados
  1. 13 7
      src/views/match/course/index.vue

+ 13 - 7
src/views/match/course/index.vue

@@ -50,11 +50,13 @@ import { useRouter, useRoute } from 'vue-router';
 // 接口
 import { CourseStore } from '@/stores/match/course';
 import { TeamStore } from '@/stores/team/team';
+import { ApplicationStore } from '@/stores/match/application';
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const courseAxios = CourseStore();
 const dictAxios = DictDataStore();
 const teamAxios = TeamStore();
+const applicationAxios = ApplicationStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -85,8 +87,8 @@ let opera: Ref<any[]> = ref([
 let searchForm: Ref<any> = ref({});
 // 字典表
 const statusList: Ref<any> = ref([]);
+const applicaList: Ref<any> = ref([]);
 const winnerList: Ref<any> = ref([]);
-const teamList: Ref<any> = ref([]);
 // 弹框
 const dialog: Ref<any> = ref({ title: '赛程状态', show: false, type: '1' });
 const form: Ref<any> = ref({ file: [] });
@@ -132,11 +134,15 @@ const getDict = (e, model) => {
     if (data) return data.label;
     else return '暂无';
   } else if (model == 'winner') {
-    let data: any = teamList.value.find((i: any) => i._id == e);
-    if (data) return data.name;
-    else return '暂无';
+    let name = '暂无';
+    if (e) {
+      let data: any = applicaList.value.find((i: any) => i.team_id == e);
+      if (data) name = data.team_name;
+    }
+    return name;
   }
 };
+
 // 赛程状态
 const toStatus = async (data) => {
   let res: any = await courseAxios.fetch(data._id);
@@ -188,9 +194,9 @@ const searchOther = async () => {
   // 状态
   res = await dictAxios.query({ type: 'course_status' });
   if (res.errcode == '0') statusList.value = res.data;
-  // 团队
-  res = await teamAxios.query({ status: '1' });
-  if (res.errcode == '0') teamList.value = res.data;
+  // 报名团队
+  res = await applicationAxios.query({ match_id: id.value });
+  if (res.errcode == '0') applicaList.value = res.data;
 };
 // 提交保存
 const toSave = async (data) => {