zs 2 lat temu
rodzic
commit
f0e5d20df0

+ 22 - 12
src/router/index.ts

@@ -1,6 +1,6 @@
-import { createRouter, createWebHistory } from 'vue-router'
-import store from '@/stores/counter'
-import axios from 'axios'
+import { createRouter, createWebHistory } from 'vue-router';
+import store from '@/stores/counter';
+import axios from 'axios';
 const router = createRouter({
 const router = createRouter({
   history: createWebHistory(import.meta.env.BASE_URL),
   history: createWebHistory(import.meta.env.BASE_URL),
   routes: [
   routes: [
@@ -79,11 +79,21 @@ const router = createRouter({
           meta: { title: '团队报名情况' },
           meta: { title: '团队报名情况' },
           component: () => import('@/views/match/enroll/index.vue')
           component: () => import('@/views/match/enroll/index.vue')
         },
         },
+        {
+          path: '/match/enroll/detail',
+          meta: { title: '团队报名查看' },
+          component: () => import('@/views/match/enroll/detail.vue')
+        },
         {
         {
           path: '/match/course',
           path: '/match/course',
           meta: { title: '赛程安排' },
           meta: { title: '赛程安排' },
           component: () => import('@/views/match/course/index.vue')
           component: () => import('@/views/match/course/index.vue')
         },
         },
+        {
+          path: '/match/course/detail',
+          meta: { title: '赛程安排信息管理' },
+          component: () => import('@/views/match/course/detail.vue')
+        },
         {
         {
           path: '/match/ranking',
           path: '/match/ranking',
           meta: { title: '团队排名' },
           meta: { title: '团队排名' },
@@ -114,8 +124,8 @@ const router = createRouter({
   ]
   ]
 });
 });
 router.beforeEach(async (to, from, next) => {
 router.beforeEach(async (to, from, next) => {
-  document.title = `${to.meta.title} `
-  const token = localStorage.getItem('token')
+  document.title = `${to.meta.title} `;
+  const token = localStorage.getItem('token');
   if (to.name != 'login') {
   if (to.name != 'login') {
     if (token) {
     if (token) {
       const res = await axios.request({
       const res = await axios.request({
@@ -125,13 +135,13 @@ router.beforeEach(async (to, from, next) => {
         headers: {
         headers: {
           token: token
           token: token
         }
         }
-      })
+      });
       if (res.data.errcode == '0') {
       if (res.data.errcode == '0') {
-        store.commit('setUser', res.data.data, { root: true })
+        store.commit('setUser', res.data.data, { root: true });
       }
       }
-      next()
-    } else next('/login')
-  } else next()
-})
+      next();
+    } else next('/login');
+  } else next();
+});
 
 
-export default router
+export default router;

+ 52 - 0
src/stores/match/application.ts

@@ -0,0 +1,52 @@
+import { ref, computed } from 'vue';
+import { defineStore } from 'pinia';
+import { AxiosWrapper } from '@/util/axios-wrapper';
+import _ from 'lodash';
+
+import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
+const axios = new AxiosWrapper();
+const api = {
+  url: `/ball/v1/api/application`
+};
+export const ApplicationStore = defineStore('application', () => {
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
+  function increment() {
+    count.value++;
+  }
+  const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
+    let cond: IQueryType = {};
+    if (skip) cond.skip = skip;
+    if (limit) cond.limit = limit;
+    cond = { ...cond, ...info };
+    const res = await axios.$get(`${api.url}`, cond);
+    return res;
+  };
+  const fetch = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$get(`${api.url}/${payload}`);
+    return res;
+  };
+  const create = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}`, payload);
+    return res;
+  };
+  const update = async (payload: any): Promise<IQueryResult> => {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  };
+  const del = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$delete(`${api.url}/${payload}`);
+    return res;
+  };
+  return {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 56 - 0
src/stores/match/course.ts

@@ -0,0 +1,56 @@
+import { ref, computed } from 'vue';
+import { defineStore } from 'pinia';
+import { AxiosWrapper } from '@/util/axios-wrapper';
+import _ from 'lodash';
+
+import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
+const axios = new AxiosWrapper();
+const api = {
+  url: `/ball/v1/api/course`
+};
+export const CourseStore = defineStore('course', () => {
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
+  function increment() {
+    count.value++;
+  }
+  const query = async ({
+    skip = 0,
+    limit = undefined,
+    ...info
+  }: IQueryParams = {}): Promise<IQueryResult> => {
+    let cond: IQueryType = {};
+    if (skip) cond.skip = skip;
+    if (limit) cond.limit = limit;
+    cond = { ...cond, ...info };
+    const res = await axios.$get(`${api.url}`, cond);
+    return res;
+  };
+  const fetch = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$get(`${api.url}/${payload}`);
+    return res;
+  };
+  const create = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}`, payload);
+    return res;
+  };
+  const update = async (payload: any): Promise<IQueryResult> => {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  };
+  const del = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$delete(`${api.url}/${payload}`);
+    return res;
+  };
+  return {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 125 - 0
src/views/match/course/detail.vue

@@ -0,0 +1,125 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="fields" :form="form" :rules="rules" @save="toSave" label-width="auto">
+            <template #red_team_id>
+              <el-option v-for="i in applicationList" :key="i.team_id" :label="i.team_name" :value="i.team_id"></el-option>
+            </template>
+            <template #blue_team_id>
+              <el-option v-for="i in applicationList" :key="i.team_id" :label="i.team_name" :value="i.team_id"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+// 基础
+import type { Ref } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
+import type { FormRules } from 'element-plus';
+import { ElMessage } from 'element-plus';
+import { useRoute } from 'vue-router';
+// 接口
+import { MatchStore } from '@/stores/match/match';
+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 matchAxios = MatchStore();
+const dictAxios = DictDataStore();
+const route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+let form: Ref<any> = ref({});
+let match_id: Ref<any> = ref(route.query.match_id);
+const rules = reactive<FormRules>({
+  red_team_id: [{ required: true, message: '红方团队名称', trigger: 'blur' }],
+  blue_team_id: [{ required: true, message: '蓝方团队名称', trigger: 'blur' }],
+  match_time: [{ required: true, message: '比赛时间', trigger: 'blur' }]
+});
+let fields: Ref<any[]> = ref([
+  { label: '比赛名称', model: 'match_name', options: { disabled: true } },
+  { label: '红方团队名称', model: 'red_team_id', type: 'select' },
+  { label: '蓝方团队名称', model: 'blue_team_id', type: 'select' },
+  { label: '比赛时间', model: 'match_time', type: 'datetime' },
+  { label: '状态', model: 'status', type: 'select' }
+]);
+// 字典表
+const statusList: Ref<any> = ref([]);
+const applicationList: Ref<any> = ref([]);
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  let id = route.query.id;
+  if (id) {
+    let res: IQueryResult = await courseAxios.fetch(id);
+    if (res.errcode == '0') {
+      let info: any = res.data as {};
+      form.value = info;
+    }
+  } else {
+    let res: any = await matchAxios.fetch(match_id.value);
+    if (res.errcode == '0') {
+      form.value.match_id = res.data._id;
+      form.value.match_name = res.data.name;
+    }
+  }
+};
+// 保存
+const toSave = async (data) => {
+  const red = applicationList.value.find((i) => i.team_id == data.red_team_id);
+  if (red) {
+    data.red_team_name = red.team_name;
+    data.red_person = red.user_id;
+    data.red_score = '0';
+  }
+  const blue = applicationList.value.find((i) => i.team_id == data.blue_team_id);
+  if (blue) {
+    data.blue_team_name = blue.team_name;
+    data.blue_person = blue.user_id;
+    data.blue_score = '0';
+  }
+  data.winner = '';
+  let res: IQueryResult;
+  if (data._id) res = await courseAxios.update(data);
+  else res = await courseAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictAxios.query({ type: 'course_status' });
+  if (res.errcode == '0') statusList.value = res.data;
+  // 报名情况
+  res = await applicationAxios.query({ match_id: match_id.value, status: '1' });
+  if (res.errcode == '0') applicationList.value = res.data;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+<style scoped lang="scss"></style>

+ 105 - 15
src/views/match/course/index.vue

@@ -2,7 +2,23 @@
   <div id="index">
   <div id="index">
     <el-row>
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cButton @toAdd="toAdd()">
+            <template v-slot:custom>
+              <el-button type="primary" @click="toBack">返回</el-button>
+            </template>
+          </cButton>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel"> </cTable>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -11,28 +27,102 @@
 <script setup lang="ts">
 <script setup lang="ts">
 // 基础
 // 基础
 import type { Ref } from 'vue';
 import type { Ref } from 'vue';
-// reactive,
 import { onMounted, ref, getCurrentInstance } from 'vue';
 import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter, useRoute } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { CourseStore } from '@/stores/match/course';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const courseAxios = CourseStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
+const route = useRoute();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+let id: Ref<any> = ref(route.query.id);
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '红方团队名称', model: 'red_team_name', isSearch: true },
+  { label: '红方分数', model: 'red_score' },
+  { label: '蓝方团队名称', model: 'blue_team_name' },
+  { label: '蓝方分数', model: 'blue_score' },
+  { label: '比赛时间', model: 'match_time' },
+  { label: '胜者', model: 'winner' },
+  { label: '状态', model: 'status', type: 'select', isSearch: true, format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const statusList: Ref<any> = ref([]);
 // 请求
 // 请求
 onMounted(async () => {
 onMounted(async () => {
   loading.value = true;
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
   loading.value = false;
 });
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, match_id: id.value };
+  const res: IQueryResult = await courseAxios.query(info);
+  if (res.errcode == '0') {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (e, model) => {
+  if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 添加
+const toAdd = () => {
+  router.push({ path: '/match/course/detail', query: { match_id: id.value } });
+};
+// 修改
+const toEdit = (data) => {
+  router.push({ path: '/match/course/detail', query: { id: data._id, match_id: id.value } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await courseAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictAxios.query({ type: 'course_status' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 1 - 1
src/views/match/detail.vue

@@ -80,7 +80,7 @@ const toSave = async (data) => {
 // 查询其他信息
 // 查询其他信息
 const searchOther = async () => {
 const searchOther = async () => {
   let res: IQueryResult;
   let res: IQueryResult;
-  // 性别
+  // 状态
   res = await dictAxios.query({ type: 'match_status' });
   res = await dictAxios.query({ type: 'match_status' });
   if (res.errcode == '0') statusList.value = res.data;
   if (res.errcode == '0') statusList.value = res.data;
 };
 };

+ 93 - 0
src/views/match/enroll/detail.vue

@@ -0,0 +1,93 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="fields" :form="form" :rules="{}" :isSave="false" label-width="auto" :disabled="true">
+            <template #user_id>
+              <cTable :fields="memberfields" :opera="[]" :list="form.user_id" :usePage="false"> </cTable>
+            </template>
+          </cForm>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+// 基础
+import type { Ref } from 'vue';
+import { ref, onMounted } from 'vue';
+import { useRoute } from 'vue-router';
+// 接口
+import { ApplicationStore } from '@/stores/match/application';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const applicationAxios = ApplicationStore();
+const dictAxios = DictDataStore();
+const route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+let form: Ref<any> = ref({});
+let fields: Ref<any[]> = ref([
+  { label: '比赛名称', model: 'match_name' },
+  { label: '团队名称', model: 'team_name', isSearch: true },
+  { label: '参赛人数', model: 'num' },
+  { label: '报名时间', model: 'apply_time' },
+  { label: '分数', model: 'score' },
+  { label: '团队成员', model: 'user_id', custom: true }
+]);
+// 字典表
+const genderList: Ref<any> = ref([]);
+
+const memberfields: Ref<any> = ref([
+  { label: '姓名', model: 'name' },
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
+  { label: '年龄', model: 'age' },
+  { label: '手机号', model: 'phone' }
+]);
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  let id = route.query.id;
+  if (id) {
+    let res: IQueryResult = await applicationAxios.fetch(id);
+    if (res.errcode == '0') {
+      let info: any = res.data as {};
+      form.value = info;
+    }
+  }
+};
+const getDict = (e, model) => {
+  if (model == 'gender') {
+    let data: any = genderList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 性别
+  res = await dictAxios.query({ type: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+};
+// 图片预览
+const imgView = (url: any) => {
+  window.open(url);
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+<style scoped lang="scss"></style>

+ 117 - 14
src/views/match/enroll/index.vue

@@ -2,37 +2,140 @@
   <div id="index">
   <div id="index">
     <el-row>
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @view="toView" @del="toDel"> </cTable>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <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 #status>
+              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
 // 基础
 // 基础
 import type { Ref } from 'vue';
 import type { Ref } from 'vue';
-// reactive,
 import { onMounted, ref, getCurrentInstance } from 'vue';
 import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter, useRoute } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { ApplicationStore } from '@/stores/match/application';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const applicationAxios = ApplicationStore();
+const dictAxios = DictDataStore();
+const route = useRoute();
+// 路由
+const router = useRouter();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+let id: Ref<any> = ref(route.query.id);
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '比赛名称', model: 'match_name' },
+  { label: '团队名称', model: 'team_name', isSearch: true },
+  { label: '参赛人数', model: 'num' },
+  { label: '报名时间', model: 'apply_time' },
+  { label: '分数', model: 'score' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '审核', method: 'exam', type: 'warning' },
+  { label: '查看', method: 'view' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 字典表
+const statusList: 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' }]);
 // 请求
 // 请求
 onMounted(async () => {
 onMounted(async () => {
   loading.value = true;
   loading.value = true;
-  //  await search({ skip, limit });
+  id.value = route.query.id;
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
   loading.value = false;
 });
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const info = { skip: e.skip, limit: e.limit, match_id: id.value };
+  const res: IQueryResult = await applicationAxios.query(info);
+  if (res.errcode == '0') {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const getDict = (e, model) => {
+  if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 保存
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) res = await applicationAxios.update(data);
+  else res = await applicationAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toClose();
+  }
+};
+// 审核
+const toExam = async (data) => {
+  let res: IQueryResult = await applicationAxios.fetch(data._id);
+  if (res.errcode == '0') {
+    form.value = res.data;
+    dialog.value = { title: '审核管理', show: true, type: '1' };
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/match/enroll/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await applicationAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 关闭弹框
+const toClose = () => {
+  form.value = {};
+  dialog.value = { show: false };
+  search({ skip, limit });
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictAxios.query({ type: 'status' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
 </script>
 </script>
 <style scoped lang="scss"></style>
 <style scoped lang="scss"></style>

+ 28 - 1
src/views/match/index.vue

@@ -13,7 +13,19 @@
           <cButton @toAdd="toAdd()"> </cButton>
           <cButton @toAdd="toAdd()"> </cButton>
         </el-col>
         </el-col>
         <el-col :span="24" class="thr">
         <el-col :span="24" class="thr">
-          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel"> </cTable>
+          <cTable
+            :fields="fields"
+            :opera="opera"
+            :list="list"
+            @query="search"
+            :total="total"
+            @edit="toEdit"
+            @del="toDel"
+            @enroll="toEnroll"
+            @course="toCourse"
+            @rank="toRank"
+          >
+          </cTable>
         </el-col>
         </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
@@ -52,6 +64,9 @@ let fields: Ref<any[]> = ref([
 // 操作
 // 操作
 let opera: Ref<any[]> = ref([
 let opera: Ref<any[]> = ref([
   { label: '修改', method: 'edit' },
   { label: '修改', method: 'edit' },
+  { label: '团队报名', method: 'enroll' },
+  { label: '赛程安排', method: 'course' },
+  { label: '排名', method: 'rank' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
 ]);
 ]);
 // 查询数据
 // 查询数据
@@ -100,6 +115,18 @@ const toDel = async (data: any) => {
     search({ skip, limit });
     search({ skip, limit });
   }
   }
 };
 };
+// 报名情况
+const toEnroll = async (data: any) => {
+   router.push({ path: '/match/enroll', query: { id: data._id } });
+};
+// 赛程
+const toCourse = async (data: any) => {
+   router.push({ path: '/match/course', query: { id: data._id } });
+};
+// 排名
+const toRank = async (data: any) => {
+   router.push({ path: '/match/ranking', query: { id: data._id } });
+};
 // 查询其他信息
 // 查询其他信息
 const searchOther = async () => {
 const searchOther = async () => {
   let res: IQueryResult;
   let res: IQueryResult;