update:赛事管理
This commit is contained in:
parent
5e628f6d1a
commit
ac3e604df1
85
src/api/match/sysorganization.js
Normal file
85
src/api/match/sysorganization.js
Normal file
@ -0,0 +1,85 @@
|
||||
import { BaseApi } from '../baseApi';
|
||||
import { http } from '../../utils/request';
|
||||
|
||||
|
||||
// ==================== 组织机构管理 ====================
|
||||
|
||||
/**
|
||||
* 组织机构列表查询
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {string} [params.name] - 组织机构名称 (模糊查询)
|
||||
* @returns {Promise<Array<{
|
||||
* id: number,
|
||||
* parentId: number,
|
||||
* name: string,
|
||||
* code: string,
|
||||
* status: string,
|
||||
* sort: number,
|
||||
* remark: string,
|
||||
* createdTime: string,
|
||||
* children: Array
|
||||
* }>>} 返回组织机构树形列表
|
||||
*/
|
||||
export const sysorganizationPageGet = (params) => {
|
||||
return http.get('/sysorganization/page', { params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加组织机构
|
||||
* @param {Object} data - 组织机构信息
|
||||
* @param {number} [data.parentId] - 父级ID (0表示顶级)
|
||||
* @param {string} data.name - 组织机构名称
|
||||
* @param {string} data.code - 组织机构编码
|
||||
* @param {string} [data.status] - 状态 (Enable=启用, Disable=禁用,默认Enable)
|
||||
* @param {number} [data.sort] - 排序号
|
||||
* @param {string} [data.remark] - 备注
|
||||
*/
|
||||
export const sysorganizationAddPost = (data) => {
|
||||
return http.post('/sysorganization/add', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新组织机构
|
||||
* @param {Object} data - 组织机构信息
|
||||
* @param {number} data.id - 组织机构ID
|
||||
* @param {number} [data.parentId] - 父级ID
|
||||
* @param {string} data.name - 组织机构名称
|
||||
* @param {string} data.code - 组织机构编码
|
||||
* @param {string} [data.status] - 状态 (Enable, Disable)
|
||||
* @param {number} [data.sort] - 排序号
|
||||
* @param {string} [data.remark] - 备注
|
||||
*/
|
||||
export const sysorganizationEditPut = (data) => {
|
||||
return http.put('/sysorganization/edit', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取机构下拉选项(树形结构)
|
||||
* @returns {Promise<Array<{
|
||||
* label: string,
|
||||
* value: number,
|
||||
* children: Array
|
||||
* }>>} 返回树形下拉选项
|
||||
*/
|
||||
export const sysorganizationTreeselectGet = () => {
|
||||
return http.get('/sysorganization/treeselect');
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除组织机构
|
||||
* @param {Object} data - 删除参数
|
||||
* @param {number} data.id - 组织机构ID
|
||||
*/
|
||||
export const sysorganizationDeleteDelete = (data) => {
|
||||
return http.delete('/sysorganization/delete', { data });
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改组织机构状态
|
||||
* @param {Object} data - 状态参数
|
||||
* @param {number} data.id - 组织机构ID
|
||||
* @param {string} data.status - 状态 (Enable=启用, Disable=禁用)
|
||||
*/
|
||||
export const sysorganizationSetstatusPatch = (data) => {
|
||||
return http.patch('/sysorganization/setstatus', data);
|
||||
};
|
||||
@ -1,169 +0,0 @@
|
||||
import { BaseApi } from '../baseApi';
|
||||
import { http } from '../../utils/request';
|
||||
|
||||
|
||||
// ==================== 系统用户管理 ====================
|
||||
|
||||
/**
|
||||
* 系统用户分页查询
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {string} [params.Account] - 账号 (模糊查询)
|
||||
* @param {string} [params.Name] - 姓名 (模糊查询)
|
||||
* @param {number} [params.RoleId] - 关联角色ID
|
||||
* @param {string} [params.StartTime] - 开始时间 (格式: ISO日期时间)
|
||||
* @param {string} [params.EndTime] - 结束时间 (格式: ISO日期时间)
|
||||
* @param {number} [params.PageNo] - 当前页码
|
||||
* @param {number} [params.PageSize] - 每页条数
|
||||
* @returns {Promise<{
|
||||
* pageNo: number,
|
||||
* pageSize: number,
|
||||
* pages: number,
|
||||
* total: number,
|
||||
* rows: Array<{
|
||||
* id: number,
|
||||
* name: string,
|
||||
* account: string,
|
||||
* roleNames: string,
|
||||
* createdTime: string,
|
||||
* status: string
|
||||
* }>
|
||||
* }>}
|
||||
*/
|
||||
export const sysuserPageGet = (params) => {
|
||||
return http.get('/sysuser/page', { params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加系统用户
|
||||
* @param {Object} data - 用户信息
|
||||
* @param {string} data.name - 姓名
|
||||
* @param {string} data.account - 账号
|
||||
* @param {Array<number>} data.roles - 角色ID列表
|
||||
* @param {string} [data.status] - 状态 (Enable=启用, Disable=禁用,默认Enable)
|
||||
*/
|
||||
export const sysuserUserPost = (data) => {
|
||||
return http.post('/sysuser/user', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新系统用户信息
|
||||
* @param {Object} data - 用户信息
|
||||
* @param {number} data.id - 用户ID
|
||||
* @param {string} data.name - 姓名
|
||||
* @param {string} data.account - 账号
|
||||
* @param {Array<number>} data.roles - 角色ID列表
|
||||
* @param {string} [data.status] - 状态 (Enable=启用, Disable=禁用)
|
||||
*/
|
||||
export const sysuserUserPut = (data) => {
|
||||
return http.put('/sysuser/user', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除系统用户
|
||||
* @param {Object} data - 删除参数
|
||||
* @param {number} data.id - 用户ID
|
||||
*/
|
||||
export const sysuserDelete = (data) => {
|
||||
return http.delete('/sysuser', { data });
|
||||
};
|
||||
|
||||
/**
|
||||
* 关联角色
|
||||
* @param {Object} data - 角色关联信息
|
||||
* @param {number} data.userId - 用户ID
|
||||
* @param {Array<number>} data.roleIds - 角色ID列表
|
||||
*/
|
||||
export const sysuserGrantrolePost = (data) => {
|
||||
return http.post('/sysuser/grantrole', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 系统用户详情
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {number} params.id - 用户ID
|
||||
* @returns {Promise<{
|
||||
* id: number,
|
||||
* name: string,
|
||||
* account: string,
|
||||
* roles: Array<number>,
|
||||
* status: string
|
||||
* }>}
|
||||
*/
|
||||
export const sysuserDetailGet = (params) => {
|
||||
return http.get('/sysuser/detail', { params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置系统用户密码
|
||||
* @param {Object} data - 重置密码参数
|
||||
* @param {number} data.id - 用户ID
|
||||
* @param {string} data.password - 新密码
|
||||
*/
|
||||
export const sysuserResetPatch = (data) => {
|
||||
return http.patch('/sysuser/reset', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的信息
|
||||
* @returns {Promise<{
|
||||
* name: string,
|
||||
* account: string,
|
||||
* avatar: string,
|
||||
* birthday: string,
|
||||
* email: string,
|
||||
* gender: string,
|
||||
* nickName: string,
|
||||
* remark: string,
|
||||
* lastLoginIp: string,
|
||||
* lastLoginAddress: string,
|
||||
* mobile: string,
|
||||
* orgId: number,
|
||||
* orgName: string,
|
||||
* authBtnList: Array<string>
|
||||
* }>}
|
||||
*/
|
||||
export const sysuserCurrentuserinfoGet = () => {
|
||||
return http.get('/sysuser/currentuserinfo');
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户修改账户密码
|
||||
* @param {Object} data - 修改密码参数
|
||||
* @param {string} data.originalPwd - 原密码
|
||||
* @param {string} data.password - 新密码
|
||||
*/
|
||||
export const sysuserChangepasswordPatch = (data) => {
|
||||
return http.patch('/sysuser/changepassword', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户修改头像
|
||||
* @param {string} data - 头像URL
|
||||
*/
|
||||
export const sysuserUploadavatarPatch = (data) => {
|
||||
return http.patch('/sysuser/uploadavatar', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 系统用户修改自己的信息
|
||||
* @param {Object} data - 用户信息
|
||||
* @param {string} [data.name] - 姓名
|
||||
* @param {string} [data.gender] - 性别 (Male=男, Female=女)
|
||||
* @param {string} [data.nickName] - 昵称
|
||||
* @param {string} [data.birthday] - 生日 (格式:2026-03-16)
|
||||
* @param {string} [data.mobile] - 手机号
|
||||
* @param {string} [data.email] - 邮箱
|
||||
*/
|
||||
export const sysuserUpdatecurrentuserPatch = (data) => {
|
||||
return http.patch('/sysuser/updatecurrentuser', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
* @param {Object} data - 状态参数
|
||||
* @param {number} data.id - 用户ID
|
||||
* @param {string} data.status - 状态 (Enable=启用, Disable=禁用)
|
||||
*/
|
||||
export const sysuserSetstatusPatch = (data) => {
|
||||
return http.patch('/sysuser/setstatus', data);
|
||||
};
|
||||
116
src/api/match/unituser.js
Normal file
116
src/api/match/unituser.js
Normal file
@ -0,0 +1,116 @@
|
||||
import { BaseApi } from '../baseApi';
|
||||
import { http } from '../../utils/request';
|
||||
|
||||
|
||||
// ==================== 团队管理服务 ====================
|
||||
|
||||
/**
|
||||
* 分页查询团队
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {string} [params.Name] - 团队名称 (模糊查询)
|
||||
* @param {string} [params.Status] - 状态 (Enable=启用, Disable=禁用)
|
||||
* @param {string} [params.StartTime] - 开始时间
|
||||
* @param {string} [params.EndTime] - 结束时间
|
||||
* @param {number} [params.PageNo] - 当前页码
|
||||
* @param {number} [params.PageSize] - 每页条数
|
||||
* @returns {Promise<{
|
||||
* pageNo: number,
|
||||
* pageSize: number,
|
||||
* pages: number,
|
||||
* total: number,
|
||||
* rows: Array<{
|
||||
* id: number,
|
||||
* name: string,
|
||||
* introduction: string,
|
||||
* establishedDate: string,
|
||||
* status: string,
|
||||
* leaderNames: string,
|
||||
* coachNames: string,
|
||||
* createdTime: string
|
||||
* }>
|
||||
* }>}
|
||||
*/
|
||||
export const teamPageGet = (params) => {
|
||||
return http.get('/team/page', { params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取团队详情
|
||||
* @param {number} id - 团队ID (路径参数)
|
||||
* @returns {Promise<{
|
||||
* id: number,
|
||||
* name: string,
|
||||
* introduction: string,
|
||||
* establishedDate: string,
|
||||
* status: string,
|
||||
* leaderNames: string,
|
||||
* coachNames: string,
|
||||
* createdTime: string,
|
||||
* members: Array<{
|
||||
* userId: number,
|
||||
* name: string,
|
||||
* role: string,
|
||||
* roleName: string,
|
||||
* mobile: string
|
||||
* }>
|
||||
* }>}
|
||||
*/
|
||||
export const teamDetailGet = (id) => {
|
||||
return http.get(`/team/${id}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增团队
|
||||
* @param {Object} data - 团队信息
|
||||
* @param {string} data.name - 团队名称
|
||||
* @param {string} [data.introduction] - 团队介绍
|
||||
* @param {string} data.establishedDate - 成立日期
|
||||
* @param {Array<number>} [data.leaderIds] - 领队ID列表
|
||||
* @param {Array<number>} [data.coachIds] - 教练ID列表
|
||||
* @param {Array<number>} [data.memberIds] - 成员ID列表
|
||||
*/
|
||||
export const teamAddPost = (data) => {
|
||||
return http.post('/team/add', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除团队
|
||||
* @param {Object} data - 删除参数
|
||||
* @param {number} data.id - 团队ID
|
||||
*/
|
||||
export const teamDeleteDelete = (data) => {
|
||||
return http.delete('/team/delete', { data });
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除团队
|
||||
* @param {Array<number>} data - 团队ID数组
|
||||
*/
|
||||
export const teamBatchdeletePost = (data) => {
|
||||
return http.post('/team/batchdelete', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改团队
|
||||
* @param {Object} data - 团队信息
|
||||
* @param {number} data.id - 团队ID
|
||||
* @param {string} data.name - 团队名称
|
||||
* @param {string} [data.introduction] - 团队介绍
|
||||
* @param {string} data.establishedDate - 成立日期
|
||||
* @param {Array<number>} [data.leaderIds] - 领队ID列表
|
||||
* @param {Array<number>} [data.coachIds] - 教练ID列表
|
||||
* @param {Array<number>} [data.memberIds] - 成员ID列表
|
||||
*/
|
||||
export const teamUpdatePut = (data) => {
|
||||
return http.put('/team/update', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改团队状态
|
||||
* @param {Object} data - 状态参数
|
||||
* @param {number} data.id - 团队ID
|
||||
* @param {string} data.status - 状态 (Enable=启用, Disable=禁用)
|
||||
*/
|
||||
export const teamSetstatusPatch = (data) => {
|
||||
return http.patch('/team/setstatus', data);
|
||||
};
|
||||
@ -239,6 +239,21 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'iconfont icon-shouye',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/event',
|
||||
name: 'event',
|
||||
component: () => import('/@/views/match/manage/index.vue'),
|
||||
meta: {
|
||||
title: '赛事管理',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'common'],
|
||||
icon: 'iconfont icon-shouye',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/coupon',
|
||||
|
||||
@ -1,32 +1,24 @@
|
||||
<template>
|
||||
<div class="system-menu-container layout-padding">
|
||||
<ProTable ref="tableRef" :request-api="SysMenuApi.page" :columns="columns" :pagination="false"
|
||||
<ProTable ref="tableRef" :request-api="eventPagePost" :columns="columns" :pagination="true"
|
||||
:tool-button="false">
|
||||
<template #tools>
|
||||
<el-button v-auth="'sysmenu:add'" type="primary" icon="ele-Plus" @click="onOpenMenu"> 新增 </el-button>
|
||||
<el-button v-auth="'sysmenu:add'" type="primary" icon="ele-Plus" @click="onOpenMenu"> 导出 </el-button>
|
||||
<el-button v-auth="'event:add'" type="primary" @click="onOpenMenu"> 新增 </el-button>
|
||||
<el-button v-auth="'event:add'" type="primary" @click="onOpenMenu"> 导出 </el-button>
|
||||
</template>
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #name="scope">
|
||||
<SvgIcon :name="scope.row.icon" />
|
||||
<span class="ml10">{{ $t(scope.row.name) }}</span>
|
||||
</template>
|
||||
<template #type="scope">
|
||||
<el-tag :type="scope.row.type === 0 ? '' : scope.row.type === 1 ? 'success' : 'danger'">
|
||||
{{ scope.row.type === 0 ? '目录' : scope.row.type === 1 ? '菜单' : '按钮' }}</el-tag>
|
||||
</template>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row.status === 0 ? 'success' : 'danger'"> {{ scope.row.status === 0 ? '启用' : '禁用'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
<!-- <template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template> -->
|
||||
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'sysmenu:edit'" icon="ele-Edit" size="small" text type="primary"
|
||||
<el-button v-auth="'event:edit'" icon="ele-Edit" size="small" text type="primary"
|
||||
@click="onOpenMenu(scope.row.id)"> 编辑 </el-button>
|
||||
<el-popconfirm title="确认删除吗?" @confirm="onDeleteMenu(scope.row.id)">
|
||||
<template #reference>
|
||||
<el-button v-auth="'sysmenu:delete'" icon="ele-Delete" size="small" text type="danger"> 删除
|
||||
<el-button v-auth="'event:delete'" icon="ele-Delete" size="small" text type="danger"> 删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
@ -36,26 +28,24 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="sysMenu">
|
||||
<script setup name="event">
|
||||
import { defineAsyncComponent, ref, reactive } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import SysMenuApi from '/@/api/SysMenuApi';
|
||||
import { auths } from '/@/utils/authFunction';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { ColumnProps } from '/@/components/ProTable/interface';
|
||||
|
||||
// 引入组件
|
||||
const MenuDialog = defineAsyncComponent(() => import('/@/views/match/manage/dialog.vue'));
|
||||
import MenuDialog from './dialog.vue';
|
||||
import { eventPagePost } from '/@/api/match/event';
|
||||
//table组件实例
|
||||
const tableRef = ref<InstanceType<typeof ProTable>>();
|
||||
const columns = reactive<ColumnProps[]>([
|
||||
const tableRef = ref();
|
||||
const columns = reactive([
|
||||
{
|
||||
prop: 'index',
|
||||
label: '序号',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
prop: 'eventName',
|
||||
label: '赛事名称',
|
||||
align: 'center',
|
||||
search: {
|
||||
@ -63,49 +53,54 @@ const columns = reactive<ColumnProps[]>([
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '赛事类型',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: 0 },
|
||||
{ label: '线上', value: 1 },
|
||||
{ label: '线下', value: 2 },
|
||||
],
|
||||
prop: 'qrCodeUrl',
|
||||
label: '封面',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'path',
|
||||
prop: 'eventType',
|
||||
label: '赛事类型',
|
||||
// search: {
|
||||
// el: 'select',
|
||||
// },
|
||||
// enum: [
|
||||
// { label: '全部', value: 0 },
|
||||
// { label: '线上', value: 1 },
|
||||
// { label: '线下', value: 2 },
|
||||
// ],
|
||||
},
|
||||
{
|
||||
prop: 'registrationType',
|
||||
label: '报名方式',
|
||||
},
|
||||
{
|
||||
prop: 'component',
|
||||
prop: 'chargeMode',
|
||||
label: '收费模式',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: 0 },
|
||||
{ label: '免费', value: 1 },
|
||||
{ label: '定价', value: 2 },
|
||||
{ label: '单价', value: 3 },
|
||||
],
|
||||
// search: {
|
||||
// el: 'select',
|
||||
// },
|
||||
// enum: [
|
||||
// { label: '全部', value: 0 },
|
||||
// { label: '免费', value: 1 },
|
||||
// { label: '定价', value: 2 },
|
||||
// { label: '单价', value: 3 },
|
||||
// ],
|
||||
},
|
||||
{ prop: 'merchantName', label: '收款账户' },
|
||||
{
|
||||
prop: 'statu',
|
||||
prop: 'eventStatus',
|
||||
label: '赛事状态',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '报名中', value: 0 },
|
||||
{ label: '比赛中', value: 1 },
|
||||
{ label: '已结束', value: 2 },
|
||||
],
|
||||
// search: {
|
||||
// el: 'select',
|
||||
// },
|
||||
// enum: [
|
||||
// { label: '报名中', value: 0 },
|
||||
// { label: '比赛中', value: 1 },
|
||||
// { label: '已结束', value: 2 },
|
||||
// ],
|
||||
},
|
||||
{ prop: 'code', label: '收款账户' },
|
||||
{
|
||||
prop: 'status',
|
||||
prop: 'registrationStartTime',
|
||||
label: '报名起止时间',
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
@ -115,7 +110,7 @@ const columns = reactive<ColumnProps[]>([
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'sort',
|
||||
prop: 'matchStartTime',
|
||||
label: '比赛起止时间',
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
@ -124,19 +119,19 @@ const columns = reactive<ColumnProps[]>([
|
||||
},
|
||||
},
|
||||
},
|
||||
{ prop: 'action', label: '操作', align: 'center', width: 150, fixed: 'right', isShow: auths(['sysmenu:edit', 'sysmenu:delete']) },
|
||||
{ prop: 'action', label: '操作', align: 'center', width: 150, fixed: 'right', isShow: auths(['event:edit', 'event:delete']) },
|
||||
]);
|
||||
|
||||
// 定义变量内容
|
||||
const menuDialogRef = ref<InstanceType<typeof MenuDialog>>();
|
||||
const menuDialogRef = ref();
|
||||
|
||||
// 打开添加编辑菜单弹窗
|
||||
const onOpenMenu = async (id: number = 0) => {
|
||||
await menuDialogRef.value!.openDialog(id);
|
||||
const onOpenMenu = async (id) => {
|
||||
await menuDialogRef.value.openDialog(id);
|
||||
};
|
||||
|
||||
//删除菜单
|
||||
const onDeleteMenu = async (id: number) => {
|
||||
const onDeleteMenu = async (id) => {
|
||||
const { succeeded, errors } = await SysMenuApi.delete({ id });
|
||||
if (succeeded) {
|
||||
ElMessage.success('删除成功');
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="参赛记录" v-model="isShowDialog" width="80%">
|
||||
<ProTable ref="tableRef" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true"
|
||||
<ProTable ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true"
|
||||
:tool-button="false" :initParams="initParamUser">
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
@ -68,7 +68,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="project">
|
||||
<script setup name="general">
|
||||
import { defineAsyncComponent, ref, reactive } from 'vue';
|
||||
import { ElMessage, ElForm } from 'element-plus';
|
||||
import SysMenuApi from '/@/api/SysMenuApi';
|
||||
@ -129,7 +129,7 @@ const columns = ref([
|
||||
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right', isShow: auths(['user:general:record']) },
|
||||
]);
|
||||
|
||||
const tableRef = ref();
|
||||
const handleSelectionChange = (val) => {
|
||||
console.log(val);
|
||||
selectedListIds.value = val.map((item) => item.userId);
|
||||
@ -183,7 +183,9 @@ const onBatchAudit = async () => {
|
||||
const { succeeded, data } = await appuserAuditPost({ ids: selectedListIds.value });
|
||||
if (succeeded) {
|
||||
ElMessage.success('操作成功');
|
||||
initParam.value.refresh = !initParam.value.refresh;
|
||||
// initParam.value.refresh = !initParam.value.refresh;
|
||||
tableRef.value.clearSelection();
|
||||
tableRef.value.getTableList();
|
||||
} else {
|
||||
ElMessage.error(data);
|
||||
}
|
||||
|
||||
@ -1,239 +1,212 @@
|
||||
<template>
|
||||
<div class="system-menu-container layout-padding">
|
||||
<ProTable ref="tableRef" :request-api="SysMenuApi.page" :columns="columns" :pagination="false"
|
||||
:tool-button="false">
|
||||
<ProTable ref="tableRef" :request-api="teamPageGet" @selection-change="handleSelectionChange" :columns="columns" :pagination="true"
|
||||
:tool-button="false" :initParams="initParam" row-key="userId">
|
||||
<template #tools>
|
||||
<el-button v-auth="'sysmenu:add'" type="primary" icon="ele-Plus" @click="onOpenMenu"> 新增 </el-button>
|
||||
</template>
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #name="scope">
|
||||
<SvgIcon :name="scope.row.icon" />
|
||||
<span class="ml10">{{ $t(scope.row.name) }}</span>
|
||||
</template>
|
||||
<template #type="scope">
|
||||
<el-tag :type="scope.row.type === 0 ? '' : scope.row.type === 1 ? 'success' : 'danger'">
|
||||
{{ scope.row.type === 0 ? '目录' : scope.row.type === 1 ? '菜单' : '按钮' }}</el-tag>
|
||||
</template>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row.status === 0 ? 'success' : 'danger'"> {{ scope.row.status === 0 ? '启用' : '禁用'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'sysmenu:edit'" icon="ele-Edit" size="small" text type="primary"
|
||||
@click="onOpenMenu(scope.row.id)"> 编辑 </el-button>
|
||||
<el-popconfirm title="确认删除吗?" @confirm="onDeleteMenu(scope.row.id)">
|
||||
<el-popconfirm title="确认批量审核吗?" @confirm="onBatchAudit">
|
||||
<template #reference>
|
||||
<el-button v-auth="'sysmenu:delete'" icon="ele-Delete" size="small" text type="danger"> 删除
|
||||
<el-button v-auth="'user:general:audit'" size="small" type="primary"> 批量审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #auditStatus="scope">
|
||||
<el-tag :type="statusList[scope.row.auditStatus]">
|
||||
{{ scope.row.auditRemark }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #ss="scope">
|
||||
|
||||
</template>
|
||||
<template #idCardImageUrl="scope">
|
||||
<el-image style="width: 100px;" :src="scope.row.idCardImageUrl" fit="cover"></el-image>
|
||||
</template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="onOpenMenu(scope.row)"> 参赛记录 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="新增" v-model="isShowDialog">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="200px"
|
||||
style="max-width: 600px;margin-bottom: 30px;" v-if="isShowDialog">
|
||||
|
||||
<!-- 商户名称 -->
|
||||
<el-form-item label="商户名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 统一社会信用代码 -->
|
||||
<el-form-item label="统一社会信用代码" prop="projectType">
|
||||
<el-input v-model="formData.projectType" placeholder="请输入项目名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 开户行 -->
|
||||
<el-form-item label="开户行" prop="participantCount">
|
||||
<el-input v-model="formData.participantCount" placeholder="请输入完成人数"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 账号 -->
|
||||
<el-form-item label="账号" prop="description">
|
||||
<el-input v-model="formData.description" placeholder="请输入项目描述"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 营业执照 -->
|
||||
<el-form-item label="营业执照" prop="fee">
|
||||
<el-upload class="avatar-uploader" action="" :show-file-list="false"
|
||||
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
|
||||
<img v-if="formData.fee" :src="formData.fee" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 费用 -->
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入费用" class="fee-input">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-dialog title="参赛记录" v-model="isShowDialog" width="80%">
|
||||
<ProTable ref="table" :request-api="eventrecordPageGet" :columns="columnsUser" :pagination="true"
|
||||
:tool-button="false" :initParams="initParamUser">
|
||||
<template #index="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
<template #startTime="scope">
|
||||
{{ scope.row.startTime }} -- {{ scope.row.endTime }}
|
||||
</template>
|
||||
<template #action="scope">
|
||||
<el-button v-auth="'user:general:record'" size="small" text type="primary"
|
||||
@click="lookBook(scope.row)"> 查看证书 </el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
<el-button type="primary" @click="onCancel">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<el-dialog title="查看证书" v-model="isShowBook" width="80%">
|
||||
<div>
|
||||
证书
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancelB">取消</el-button>
|
||||
<el-button type="primary" @click="onCancelB">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="sysMenu">
|
||||
<script setup name="unit">
|
||||
import { defineAsyncComponent, ref, reactive } from 'vue';
|
||||
import { ElMessage, ElForm } from 'element-plus';
|
||||
import SysMenuApi from '/@/api/SysMenuApi';
|
||||
import { auths } from '/@/utils/authFunction';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { teamPageGet } from '/@/api/match/unitUser';
|
||||
import { appuserAuditPost} from '/@/api/match/appuser';
|
||||
import { eventrecordPageGet , eventrecordCertificatesGet} from '/@/api/match/eventRecord';
|
||||
|
||||
// 定义表单引用类型
|
||||
const formRef = ref();
|
||||
|
||||
const formData = ref({
|
||||
projectName: '30秒单摇',
|
||||
projectType: 'personal_speed',
|
||||
participantCount: '',
|
||||
description: '',
|
||||
fee: '100',
|
||||
durationMinutes: '',
|
||||
phone: '30'
|
||||
})
|
||||
|
||||
const formRules = ref({
|
||||
projectName: [
|
||||
{ required: true, message: '请输入商户名称', trigger: 'blur' }
|
||||
],
|
||||
projectType: [
|
||||
{ required: true, message: '请选择统一社会信用代码', trigger: 'change' }
|
||||
],
|
||||
participantCount: [
|
||||
{ required: true, message: '请输入开户行', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '请输入账号', trigger: 'blur' }
|
||||
],
|
||||
fee: [
|
||||
{ required: true, message: '请上传营业执照', trigger: 'blur' }
|
||||
],
|
||||
|
||||
const initParam = ref({
|
||||
refresh: true,
|
||||
});
|
||||
const selectedListIds = ref([]);
|
||||
const initParamUser = ref({
|
||||
appUserId: '',
|
||||
});
|
||||
const statusList = ['info', 'warning', 'success', 'danger'];
|
||||
|
||||
const columns = ref([
|
||||
{ prop: 'ss', type: 'selection' },
|
||||
{ prop: 'index', label: '序号', align: 'center', },
|
||||
{ prop: 'type', label: '姓名', search: { el: 'input' } },
|
||||
{ prop: 'index', label: '序号', align: 'center' },
|
||||
{ prop: 'name', label: '姓名', search: { el: 'input' } },
|
||||
{
|
||||
prop: 'path', label: '性别', search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: 0 },
|
||||
{ label: '男', value: 1 },
|
||||
{ label: '女', value: 2 },
|
||||
],
|
||||
},
|
||||
{ prop: 'code', label: '联系电话' , search: { el: 'input' }},
|
||||
{ prop: 'card', label: '身份证' },
|
||||
{ prop: 'img', label: '审核状态' ,
|
||||
prop: 'gender',
|
||||
label: '性别',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: 0 },
|
||||
{ label: '已通过', value: 1 },
|
||||
{ label: '未审核', value: 2 },
|
||||
{ label: '未提交', value: 3 },
|
||||
{ label: '未通过', value: 4 },
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '男', value: 1 },
|
||||
{ label: '女', value: 2 },
|
||||
],
|
||||
},
|
||||
{ prop: 'mobile', label: '联系电话', search: { el: 'input' } },
|
||||
{ prop: 'idCardImageUrl', label: '身份证' },
|
||||
{
|
||||
prop: 'auditStatus',
|
||||
label: '审核状态',
|
||||
search: {
|
||||
el: 'select',
|
||||
},
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '未通过', value: 3 },
|
||||
{ label: '已通过', value: 2 },
|
||||
{ label: '未审核', value: 1 },
|
||||
{ label: '未提交', value: 0 },
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'phone', label: '生成时间', search: {
|
||||
prop: 'createdTime',
|
||||
label: '创建时间',
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
props: { type: 'daterange' },
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right', isShow: auths(['sysmenu:delete', 'sysmenu:edit']) },
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right', isShow: auths(['user:general:record']) },
|
||||
]);
|
||||
const tableRef = ref();
|
||||
const handleSelectionChange = (val) => {
|
||||
console.log(val);
|
||||
selectedListIds.value = val.map((item) => item.userId);
|
||||
};
|
||||
|
||||
const columnsUser = ref([
|
||||
{ prop: 'index', label: '序号', align: 'center' },
|
||||
{ prop: 'eventName', label: '赛事名称', search: { el: 'input' } },
|
||||
|
||||
// {
|
||||
// prop: 'auditStatus',
|
||||
// label: '赛事类型',
|
||||
// search: {
|
||||
// el: 'select',
|
||||
// },
|
||||
// enum: [
|
||||
// { label: '全部', value: '' },
|
||||
// { label: '未通过', value: 3 },
|
||||
// { label: '已通过', value: 2 },
|
||||
// { label: '未审核', value: 1 },
|
||||
// { label: '未提交', value: 0 },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '起止时间',
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
props: { type: 'daterange' },
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '起止时间',
|
||||
isShow: false,
|
||||
},
|
||||
|
||||
{ prop: 'action', label: '操作', align: 'center', fixed: 'right'},
|
||||
]);
|
||||
|
||||
const isShowDialog = ref(false);
|
||||
const dialogTitle = ref('新增');
|
||||
|
||||
const onOpenMenu = (id) => {
|
||||
dialogTitle.value = id ? '编辑' : '新增';
|
||||
formData.value = {
|
||||
projectName: '',
|
||||
projectType: '',
|
||||
participantCount: '',
|
||||
description: '',
|
||||
fee: '',
|
||||
durationMinutes: '',
|
||||
phone: ''
|
||||
};
|
||||
const onOpenMenu = (row) => {
|
||||
console.log(row);
|
||||
initParamUser.value.appUserId = row.id;
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
|
||||
//删除菜单
|
||||
const onDeleteMenu = async (id) => {
|
||||
const { succeeded, errors } = await SysMenuApi.delete({ id });
|
||||
const onBatchAudit = async () => {
|
||||
console.log(selectedListIds.value);
|
||||
const { succeeded, data } = await appuserAuditPost({ ids: selectedListIds.value });
|
||||
if (succeeded) {
|
||||
ElMessage.success('删除成功');
|
||||
ElMessage.success('操作成功');
|
||||
// initParam.value.refresh = !initParam.value.refresh;
|
||||
tableRef.value.clearSelection();
|
||||
tableRef.value.getTableList();
|
||||
} else {
|
||||
ElMessage.error(errors);
|
||||
ElMessage.error(data);
|
||||
}
|
||||
};
|
||||
|
||||
const handleAvatarSuccess = (response,
|
||||
uploadFile) => {
|
||||
formData.value.fee = URL.createObjectURL(uploadFile.raw)
|
||||
}
|
||||
|
||||
const beforeAvatarUpload = () => {
|
||||
// if (rawFile.type !== 'image/jpeg') {
|
||||
// ElMessage.error('Avatar picture must be JPG format!')
|
||||
// return false
|
||||
// } else if (rawFile.size / 1024 / 1024 > 2) {
|
||||
// ElMessage.error('Avatar picture size can not exceed 2MB!')
|
||||
// return false
|
||||
// }
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
// 表单提交
|
||||
const onSubmit = () => {
|
||||
if (!formRef.value) return;
|
||||
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
|
||||
// try {
|
||||
// let res;
|
||||
// if (formData.value.id) {
|
||||
// res = await SysMenuApi.add(formData.value);
|
||||
// } else {
|
||||
// res = await SysMenuApi.add(formData.value);
|
||||
// }
|
||||
|
||||
// if (res.succeeded) {
|
||||
// ElMessage.success(dialogTitle.value + '成功');
|
||||
// isShowDialog.value = false;
|
||||
// } else {
|
||||
// ElMessage.error(res.errors);
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.error(error);
|
||||
// }
|
||||
});
|
||||
const onCancelB = () => {
|
||||
isShowBook.value = false;
|
||||
};
|
||||
|
||||
// 查看证书
|
||||
const isShowBook = ref(false);
|
||||
const lookBook = async (row) => {
|
||||
const { succeeded, data } = await eventrecordCertificatesGet(row.id);
|
||||
if (succeeded) {
|
||||
isShowBook.value = true;
|
||||
} else {
|
||||
ElMessage.error(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
isShowDialog.value = false;
|
||||
@ -265,26 +238,3 @@ const onCancel = () => {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user