zs 2 jaren geleden
bovenliggende
commit
9b35c07a67

+ 11 - 1
src/router/index.ts

@@ -40,7 +40,7 @@ const router = createRouter({
           component: () => import('@/views/users/team/index.vue')
           component: () => import('@/views/users/team/index.vue')
         },
         },
         {
         {
-          path: '/users/detail',
+          path: '/users/team/detail',
           meta: { title: '团队管理人员信息管理' },
           meta: { title: '团队管理人员信息管理' },
           component: () => import('@/views/users/team/detail.vue')
           component: () => import('@/views/users/team/detail.vue')
         },
         },
@@ -49,6 +49,11 @@ const router = createRouter({
           meta: { title: '信息审批' },
           meta: { title: '信息审批' },
           component: () => import('@/views/team/examine/index.vue')
           component: () => import('@/views/team/examine/index.vue')
         },
         },
+        {
+          path: '/team/examine/detail',
+          meta: { title: '信息审批查看' },
+          component: () => import('@/views/team/examine/detail.vue')
+        },
         {
         {
           path: '/team/team',
           path: '/team/team',
           meta: { title: '信息列表' },
           meta: { title: '信息列表' },
@@ -59,6 +64,11 @@ const router = createRouter({
           meta: { title: '比赛管理' },
           meta: { title: '比赛管理' },
           component: () => import('@/views/match/index.vue')
           component: () => import('@/views/match/index.vue')
         },
         },
+        {
+          path: '/match/detail',
+          meta: { title: '信息管理' },
+          component: () => import('@/views/match/detail.vue')
+        },
         {
         {
           path: '/match/enroll',
           path: '/match/enroll',
           meta: { title: '团队报名情况' },
           meta: { title: '团队报名情况' },

+ 52 - 0
src/stores/match/match.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/match`
+};
+export const MatchStore = defineStore('match', () => {
+  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/team/team.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/team`
+};
+export const TeamStore = defineStore('team', () => {
+  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
+  };
+});

+ 63 - 0
src/stores/users/user.ts

@@ -0,0 +1,63 @@
+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/user`
+};
+export const UserStore = defineStore('user', () => {
+  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;
+  };
+  const login = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}/login`, payload);
+    return res;
+  };
+  //password
+  const rp = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}/rp`, payload);
+    return res;
+  };
+  return {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del,
+    login,
+    rp
+  };
+});

+ 38 - 0
src/views/match/detail.vue

@@ -0,0 +1,38 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">系统首页</el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+// 基础
+import type { Ref } from 'vue';
+// reactive,
+import { onMounted, ref, getCurrentInstance } from 'vue';
+// 接口
+//import { TestStore } from '@common/src/stores/test';
+//import type { IQueryResult } from '@/util/types.util';
+//const testAxios = TestStore();
+const { proxy } = getCurrentInstance() as any;
+// 加载中
+const loading: Ref<any> = ref(false);
+// 分页数据
+//  const skip = 0;
+//  const limit = proxy.limit;;
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  //  await search({ skip, limit });
+  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);
+//};
+</script>
+<style scoped lang="scss"></style>

+ 90 - 16
src/views/match/index.vue

@@ -2,7 +2,15 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cButton @toAdd="toAdd()"> </cButton>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @del="toDel"> </cTable>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -11,29 +19,95 @@
 <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 } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { MatchStore } from '@/stores/match/match';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const matchAxios = MatchStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+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: 'name', isSearch: true },
+  { label: '开始时间', model: 'start_time' },
+  { label: '结束时间', model: 'end_time' },
+  { label: '比赛地点', model: 'address' },
+  { label: '报名截止时间', model: 'sign_deadline' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '查看', method: 'view', tpye: 'Info' },
+  { 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, status: '0' };
+  const res: IQueryResult = await matchAxios.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/detail' });
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/match/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await matchAxios.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: 'match_status' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
-d
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 131 - 0
src/views/team/examine/detail.vue

@@ -0,0 +1,131 @@
+<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 #administrator>
+              <el-option v-for="i in userList" :key="i._id" :label="i.name" :value="i._id"></el-option>
+            </template>
+            <template #logo>
+              <cUpload :model="`${'logo'}`" :limit="1" url="/files/ball/team/upload" :list="form.logo" @change="onUpload"></cUpload>
+            </template>
+            <template #member>
+              <cTable :fields="memberfields" :opera="opera" :list="form.member" :usePage="false" @del="toDel"> </cTable>
+            </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 { TeamStore } from '@/stores/team/team';
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const teamAxios = TeamStore();
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
+const route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+let form: Ref<any> = ref({});
+const rules = reactive<FormRules>({});
+let fields: Ref<any[]> = ref([
+  { label: '所属管理员', model: 'administrator', type: 'select' },
+  { label: '团队名称', model: 'name' },
+  { label: '成立时间', model: 'create_time' },
+  { label: '单位地址', model: 'address' },
+  { label: '手机号', model: 'phone' },
+  { label: '团队logo', model: 'logo', custom: true },
+  { label: '团队人数', model: 'number' },
+  { label: '团队成员', model: 'member', custom: true }
+]);
+// 字典表
+const userList: Ref<any> = ref([]);
+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' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([{ label: '删除', method: 'del', confirm: true, type: 'danger' }]);
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  let openid = route.query.openid;
+  if (openid) {
+    let res: IQueryResult = await teamAxios.fetch(openid);
+    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 onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 删除
+const toDel = async (data: any) => {
+  console.log(data);
+  ElMessage({ type: `success`, message: `刪除信息成功` });
+};
+// 保存
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) res = await teamAxios.update(data);
+  else res = await teamAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 管理员
+  res = await userAxios.query({ status: '1' });
+  if (res.errcode == '0') userList.value = res.data;
+  // 性别
+  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>

+ 144 - 15
src/views/team/examine/index.vue

@@ -2,37 +2,166 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @exam="toExam" @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 } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { TeamStore } from '@/stores/team/team';
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const teamAxios = TeamStore();
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+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: 'administrator', format: (i: any) => getDict(i, 'administrator') },
+  { label: '团队名称', model: 'name', isSearch: true },
+  { label: '单位地址', model: 'address' },
+  { label: '手机号', model: 'phone', isSearch: true },
+  { label: '团队人数', model: 'number' },
+  { label: '成立时间', model: 'create_time' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '查看', method: 'view', tpye: 'Info' },
+  { label: '审核', method: 'exam', type: 'warning' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+const statusList: Ref<any> = ref([]);
+const userList: 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 });
+  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, status: '0' };
+  const res: IQueryResult = await teamAxios.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 == 'administrator') {
+    let data: any = userList.value.find((i: any) => i._id == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/team/examine/detail', query: { id: data._id } });
+};
+// 审核
+const toExam = async (data) => {
+  let res: IQueryResult = await teamAxios.fetch(data.openid);
+  if (res.errcode == '0') {
+    form.value = res.data;
+    dialog.value = { title: '审核管理', show: true, type: '1' };
+  }
+};
+// 提交保存
+const toSave = async (data) => {
+  let res: IQueryResult = await teamAxios.update(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: '信息审核成功', type: 'success' });
+    toClose();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await teamAxios.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: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'ststus' });
+  if (res.errcode == '0') statusList.value = res.data;
+  // 管理员
+  res = await userAxios.query({ status: '1' });
+  if (res.errcode == '0') userList.value = res.data;
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 107 - 0
src/views/team/team/detail.vue

@@ -0,0 +1,107 @@
+<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 #administrator>
+              <el-option v-for="i in userList" :key="i._id" :label="i.name" :value="i._id"></el-option>
+            </template>
+            <template #logo>
+              <el-image class="image" v-for="i in form.logo" :key="i.uri" :src="i.url" @click="imgView(i.url)"></el-image>
+            </template>
+            <template #member>
+              <cTable :fields="memberfields" :opera="[]" :list="form.member" :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 { TeamStore } from '@/stores/team/team';
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const teamAxios = TeamStore();
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
+const route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+let form: Ref<any> = ref({});
+let fields: Ref<any[]> = ref([
+  { label: '所属管理员', model: 'administrator', type: 'select' },
+  { label: '团队名称', model: 'name' },
+  { label: '成立时间', model: 'create_time' },
+  { label: '单位地址', model: 'address' },
+  { label: '手机号', model: 'phone' },
+  { label: '团队logo', model: 'logo', custom: true },
+  { label: '团队人数', model: 'number' },
+  { label: '团队成员', model: 'member', custom: true }
+]);
+// 字典表
+const userList: Ref<any> = ref([]);
+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 openid = route.query.openid;
+  if (openid) {
+    let res: IQueryResult = await teamAxios.fetch(openid);
+    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 userAxios.query({ status: '1' });
+  if (res.errcode == '0') userList.value = res.data;
+  // 性别
+  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>

+ 98 - 15
src/views/team/team/index.vue

@@ -2,7 +2,12 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView"> </cTable>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -11,28 +16,106 @@
 <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 { useRouter } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { TeamStore } from '@/stores/team/team';
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const teamAxios = TeamStore();
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+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: 'administrator', format: (i: any) => getDict(i, 'administrator') },
+  { label: '团队名称', model: 'name', isSearch: true },
+  { label: '单位地址', model: 'address' },
+  { label: '手机号', model: 'phone', isSearch: true },
+  { label: '团队人数', model: 'number' },
+  { label: '成立时间', model: 'create_time' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([{ label: '查看', method: 'view', tpye: 'Info' }]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+const statusList: Ref<any> = ref([]);
+const userList: 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, status: '1' };
+  const res: IQueryResult = await teamAxios.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 == 'administrator') {
+    let data: any = userList.value.find((i: any) => i._id == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 查看
+const toView = (data) => {
+  router.push({ path: '/team/examine/detail', query: { id: data._id } });
+};
+
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 性别
+  res = await dictAxios.query({ type: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'ststus' });
+  if (res.errcode == '0') statusList.value = res.data;
+  // 管理员
+  res = await userAxios.query({ status: '1' });
+  if (res.errcode == '0') userList.value = res.data;
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+.dialog_one {
+  .image {
+    width: 120px;
+    height: 120px;
+    border-radius: 5px;
+  }
+}
+</style>

+ 135 - 18
src/views/users/match/detail.vue

@@ -1,8 +1,23 @@
 <template>
 <template>
-  <div id="index">
+  <div id="detail">
     <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_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 #gender>
+              <el-option v-for="i in genderList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #icon>
+              <cUpload :model="`${'icon'}`" :limit="1" url="/files/ball/match/upload" :list="form.icon" @change="onUpload"></cUpload>
+            </template>
+          </cForm>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -11,28 +26,130 @@
 <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 { ref, reactive, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
+import type { FormRules } from 'element-plus';
+import { useRoute } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
-const { proxy } = getCurrentInstance() as any;
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
+// 路由
+const route = useRoute();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+// 表单
+let form: Ref<any> = ref({});
+let fields: Ref<any[]> = ref([
+  { label: '账号', model: 'account', options: { disabled: true } },
+  { label: '类别', model: 'type', type: 'select', options: { disabled: true } },
+  { label: '姓名', model: 'name' },
+  { label: '头像', model: 'icon', custom: true },
+  { label: '性别', model: 'gender', type: 'select' },
+  { label: '年龄', model: 'age' },
+  { label: '手机号', model: 'phone' },
+  { label: '电子邮箱', model: 'email' },
+  { label: '工作单位', model: 'work' }
+]);
+const rules = reactive<FormRules>({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+
 // 请求
 // 请求
 onMounted(async () => {
 onMounted(async () => {
   loading.value = true;
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search();
   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 () => {
+  let id = route.query.id;
+  if (id) {
+    let res: IQueryResult = await userAxios.fetch(id);
+    if (res.errcode == '0') {
+      let info: any = res.data as {};
+      form.value = info;
+    }
+  }
+};
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 保存
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) res = await userAxios.update(data);
+  else res = await userAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 性别
+  res = await dictAxios.query({ type: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.study {
+  width: 100%;
+  .study_1 {
+    margin: 0 0 10px 0;
+    span {
+      font-size: 16px;
+    }
+    span:first-child {
+      color: #ff0000;
+    }
+  }
+  .study_2 {
+    .study_2_info {
+      width: 100%;
+      display: flex;
+      .info_1 {
+        position: relative;
+        max-width: 24%;
+        border: 1px solid #67c23a;
+        padding: 0 10px;
+        border-radius: 5px;
+        margin: 0 10px 0 0;
+        .txt {
+          position: absolute;
+          top: -15px;
+          left: 10px;
+          span {
+            display: inline-block;
+            padding: 6px 15px;
+            background: #67c23a;
+            color: #fff;
+            border-radius: 5px;
+            font-size: 16px;
+            font-weight: bold;
+            line-height: 1;
+          }
+        }
+        .info {
+          margin: 15px 0 0 0;
+          .label {
+            margin: 0 0 10px 0;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 139 - 15
src/views/users/match/index.vue

@@ -2,37 +2,161 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @edit="toEdit" @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 } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+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: 'openid' },
+  { label: '姓名', model: 'name', isSearch: true },
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
+  { label: '年龄', model: 'age' },
+  { label: '手机号', model: 'phone', isSearch: true },
+  { label: '电子邮箱', model: 'email' },
+  { label: '工作单位', model: 'work' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '审核', method: 'exam', type: 'warning' },
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+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 });
+  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, type: '0' };
+  const res: IQueryResult = await userAxios.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 == 'gender') {
+    let data: any = genderList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 审核
+const toExam = async (data) => {
+  let res: IQueryResult = await userAxios.fetch(data.openid);
+  if (res.errcode == '0') {
+    form.value = res.data;
+    dialog.value = { title: '审核管理', show: true, type: '1' };
+  }
+};
+// 提交保存
+const toSave = async (data) => {
+  let res: IQueryResult = await userAxios.update(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: '信息审核成功', type: 'success' });
+    toClose();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 修改
+const toEdit = (data) => {
+  router.push({ path: '/users/match/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await userAxios.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: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'ststus' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 135 - 18
src/views/users/team/detail.vue

@@ -1,8 +1,23 @@
 <template>
 <template>
-  <div id="index">
+  <div id="detail">
     <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_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 #gender>
+              <el-option v-for="i in genderList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #icon>
+              <cUpload :model="`${'icon'}`" :limit="1" url="/files/ball/match/upload" :list="form.icon" @change="onUpload"></cUpload>
+            </template>
+          </cForm>
+        </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -11,28 +26,130 @@
 <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 { ref, reactive, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
+import type { FormRules } from 'element-plus';
+import { useRoute } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
-const { proxy } = getCurrentInstance() as any;
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
+// 路由
+const route = useRoute();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+// 表单
+let form: Ref<any> = ref({});
+let fields: Ref<any[]> = ref([
+  { label: '账号', model: 'account', options: { disabled: true } },
+  { label: '类别', model: 'type', type: 'select', options: { disabled: true } },
+  { label: '姓名', model: 'name' },
+  { label: '头像', model: 'icon', custom: true },
+  { label: '性别', model: 'gender', type: 'select' },
+  { label: '年龄', model: 'age' },
+  { label: '手机号', model: 'phone' },
+  { label: '电子邮箱', model: 'email' },
+  { label: '工作单位', model: 'work' }
+]);
+const rules = reactive<FormRules>({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+
 // 请求
 // 请求
 onMounted(async () => {
 onMounted(async () => {
   loading.value = true;
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search();
   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 () => {
+  let id = route.query.id;
+  if (id) {
+    let res: IQueryResult = await userAxios.fetch(id);
+    if (res.errcode == '0') {
+      let info: any = res.data as {};
+      form.value = info;
+    }
+  }
+};
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 保存
+const toSave = async (data) => {
+  let res: IQueryResult;
+  if (data._id) res = await userAxios.update(data);
+  else res = await userAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 性别
+  res = await dictAxios.query({ type: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.study {
+  width: 100%;
+  .study_1 {
+    margin: 0 0 10px 0;
+    span {
+      font-size: 16px;
+    }
+    span:first-child {
+      color: #ff0000;
+    }
+  }
+  .study_2 {
+    .study_2_info {
+      width: 100%;
+      display: flex;
+      .info_1 {
+        position: relative;
+        max-width: 24%;
+        border: 1px solid #67c23a;
+        padding: 0 10px;
+        border-radius: 5px;
+        margin: 0 10px 0 0;
+        .txt {
+          position: absolute;
+          top: -15px;
+          left: 10px;
+          span {
+            display: inline-block;
+            padding: 6px 15px;
+            background: #67c23a;
+            color: #fff;
+            border-radius: 5px;
+            font-size: 16px;
+            font-weight: bold;
+            line-height: 1;
+          }
+        }
+        .info {
+          margin: 15px 0 0 0;
+          .label {
+            margin: 0 0 10px 0;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 139 - 15
src/views/users/team/index.vue

@@ -2,37 +2,161 @@
   <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"> </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @exam="toExam" @edit="toEdit" @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 } from 'vue-router';
 // 接口
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { UserStore } from '@/stores/users/user';
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const userAxios = UserStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 // 加载中
 const loading: Ref<any> = ref(false);
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+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: 'openid' },
+  { label: '姓名', model: 'name', isSearch: true },
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
+  { label: '年龄', model: 'age' },
+  { label: '手机号', model: 'phone', isSearch: true },
+  { label: '电子邮箱', model: 'email' },
+  { label: '工作单位', model: 'work' },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '审核', method: 'exam', type: 'warning' },
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const genderList: Ref<any> = ref([]);
+const typeList: Ref<any> = ref([]);
+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 });
+  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, type: '1' };
+  const res: IQueryResult = await userAxios.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 == 'gender') {
+    let data: any = genderList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 审核
+const toExam = async (data) => {
+  let res: IQueryResult = await userAxios.fetch(data.openid);
+  if (res.errcode == '0') {
+    form.value = res.data;
+    dialog.value = { title: '审核管理', show: true, type: '1' };
+  }
+};
+// 提交保存
+const toSave = async (data) => {
+  let res: IQueryResult = await userAxios.update(data);
+  if (res.errcode == '0') {
+    ElMessage({ message: '信息审核成功', type: 'success' });
+    toClose();
+  } else {
+    ElMessage({ message: `${res.errmsg}`, type: 'error' });
+  }
+};
+// 修改
+const toEdit = (data) => {
+  router.push({ path: '/users/team/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await userAxios.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: 'gender' });
+  if (res.errcode == '0') genderList.value = res.data;
+  // 类别
+  res = await dictAxios.query({ type: 'type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 状态
+  res = await dictAxios.query({ type: 'ststus' });
+  if (res.errcode == '0') statusList.value = res.data;
+};
 </script>
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>