0823
This commit is contained in:
1 parent
e5029688e5
commit
0db0a99c85
288 files changed
+41335
-11400
No files matched your search
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglActivityVO, StglActivityForm, StglActivityQuery, ClubOption, ActivityCopyParams, ActivitySummaryParams, ActivityRatingVO } from './types';
|
||||
|
||||
/**
|
||||
* 查询活动信息列表
|
||||
* @param query 查询参数
|
||||
* @returns 活动信息列表
|
||||
*/
|
||||
export const listStglActivity = (query?: StglActivityQuery): AxiosPromise<StglActivityVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询活动信息详细
|
||||
* @param id 活动主键
|
||||
* @returns 活动信息详情
|
||||
*/
|
||||
export const getStglActivity = (id: string | number): AxiosPromise<StglActivityVO> => {
|
||||
return request({
|
||||
url: '/stgl/activity/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增活动信息
|
||||
* @param data 活动信息
|
||||
* @returns 操作结果
|
||||
*/
|
||||
export const addStglActivity = (data: StglActivityForm) => {
|
||||
return request({
|
||||
url: '/stgl/activity',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改活动信息
|
||||
* @param data 活动信息
|
||||
* @returns 操作结果
|
||||
*/
|
||||
export const updateStglActivity = (data: StglActivityForm) => {
|
||||
return request({
|
||||
url: '/stgl/activity',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除活动信息
|
||||
* @param id 活动主键
|
||||
* @returns 操作结果
|
||||
*/
|
||||
export const delStglActivity = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/stgl/activity/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出活动信息
|
||||
* @param query 查询参数
|
||||
* @returns 导出文件
|
||||
*/
|
||||
export const exportStglActivity = (query?: StglActivityQuery) => {
|
||||
return request({
|
||||
url: '/stgl/activity/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 复制活动信息
|
||||
* @param params 复制参数
|
||||
* @returns 操作结果
|
||||
*/
|
||||
export const copyStglActivity = (params: ActivityCopyParams) => {
|
||||
return request({
|
||||
url: '/stgl/activity/copy',
|
||||
method: 'post',
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 活动总结
|
||||
* @param params 总结参数
|
||||
* @returns 操作结果
|
||||
*/
|
||||
export const summarizeActivity = (params: ActivitySummaryParams) => {
|
||||
return request({
|
||||
url: '/stgl/activity/summarize',
|
||||
method: 'put',
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询社团选择器选项
|
||||
* @returns 社团选项列表
|
||||
*/
|
||||
export const getClubOptions = (): AxiosPromise<ClubOption[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/club/options',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询志愿者队伍选择器选项
|
||||
* @returns 志愿者队伍选项列表
|
||||
*/
|
||||
export const getVolunteerTeamOptions = (): AxiosPromise<ClubOption[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/volunteer/options',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询活动评分列表
|
||||
* @param activityId 活动ID
|
||||
* @returns 活动评分列表
|
||||
*/
|
||||
export const getActivityRatings = (activityId: string | number): AxiosPromise<ActivityRatingVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/' + activityId + '/ratings',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,650 @@
|
||||
export interface StglActivityVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 活动主题
|
||||
*/
|
||||
activityTheme?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
location?: string;
|
||||
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 活动海报路径
|
||||
*/
|
||||
posterUrl?: string;
|
||||
|
||||
/**
|
||||
* 关联社团ID
|
||||
*/
|
||||
relatedClubId?: string | number;
|
||||
|
||||
/**
|
||||
* 关联社团名称
|
||||
*/
|
||||
relatedClubName?: string;
|
||||
|
||||
/**
|
||||
* 关联类型(1-社团 2-志愿者队伍)
|
||||
*/
|
||||
relatedType?: number;
|
||||
|
||||
/**
|
||||
* 主办方名称
|
||||
*/
|
||||
organizerName?: string;
|
||||
|
||||
/**
|
||||
* 主办方类型
|
||||
*/
|
||||
organizerType?: string;
|
||||
|
||||
/**
|
||||
* 主办方联系人
|
||||
*/
|
||||
organizerContact?: string;
|
||||
|
||||
/**
|
||||
* 主办方电话
|
||||
*/
|
||||
organizerPhone?: string;
|
||||
|
||||
/**
|
||||
* 承办方信息(JSON格式存储多个承办方)
|
||||
*/
|
||||
coOrganizers?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表(JSON格式)
|
||||
*/
|
||||
instructors?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表(AdvisorManager组件使用)
|
||||
*/
|
||||
advisors?: any[];
|
||||
|
||||
/**
|
||||
* 报名方式(1-个人 2-团队 3-两者均可)
|
||||
*/
|
||||
registrationType?: string;
|
||||
|
||||
/**
|
||||
* 报名开始时间
|
||||
*/
|
||||
registrationStart?: string;
|
||||
|
||||
/**
|
||||
* 报名结束时间
|
||||
*/
|
||||
registrationEnd?: string;
|
||||
|
||||
/**
|
||||
* 报名状态(0-未开始 1-报名中 2-已截止 3-已关闭)
|
||||
*/
|
||||
registrationStatus?: number;
|
||||
|
||||
/**
|
||||
* 总人数上限
|
||||
*/
|
||||
maxParticipants?: number;
|
||||
|
||||
/**
|
||||
* 团队数量上限
|
||||
*/
|
||||
maxTeams?: number;
|
||||
|
||||
/**
|
||||
* 每队最小人数
|
||||
*/
|
||||
teamSizeMin?: number;
|
||||
|
||||
/**
|
||||
* 每队最大人数
|
||||
*/
|
||||
teamSizeMax?: number;
|
||||
|
||||
/**
|
||||
* 是否需要审核(0-无需 1-需要)
|
||||
*/
|
||||
needApproval?: number;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
activityStatus?: string;
|
||||
|
||||
/**
|
||||
* 是否为已办活动
|
||||
*/
|
||||
isFinished?: number;
|
||||
|
||||
/**
|
||||
* 活动总结报告
|
||||
*/
|
||||
summary?: string;
|
||||
|
||||
/**
|
||||
* 活动成果
|
||||
*/
|
||||
achievements?: string;
|
||||
|
||||
/**
|
||||
* 总结报告附件
|
||||
*/
|
||||
summaryAttachments?: string;
|
||||
|
||||
/**
|
||||
* 活动成果附件
|
||||
*/
|
||||
achievementsAttachments?: string;
|
||||
|
||||
/**
|
||||
* 导入来源信息
|
||||
*/
|
||||
importSource?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy?: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy?: number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
createByName?: string;
|
||||
|
||||
/**
|
||||
* 报名人数统计
|
||||
*/
|
||||
registrationCount?: number;
|
||||
|
||||
/**
|
||||
* 平均评分
|
||||
*/
|
||||
averageRating?: number;
|
||||
}
|
||||
|
||||
export interface StglActivityForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 活动主题
|
||||
*/
|
||||
activityTheme?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
location?: string;
|
||||
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 活动海报路径
|
||||
*/
|
||||
posterUrl?: string;
|
||||
|
||||
/**
|
||||
* 关联社团ID
|
||||
*/
|
||||
relatedClubId?: string | number;
|
||||
|
||||
/**
|
||||
* 关联类型 (1: 社团, 2: 志愿者队伍)
|
||||
*/
|
||||
relatedType?: number;
|
||||
|
||||
/**
|
||||
* 关联对象(用于选择器绑定)
|
||||
*/
|
||||
relatedClub?: ClubOption | null;
|
||||
|
||||
/**
|
||||
* 主办方名称
|
||||
*/
|
||||
organizerName?: string;
|
||||
|
||||
/**
|
||||
* 主办方类型
|
||||
*/
|
||||
organizerType?: string;
|
||||
|
||||
/**
|
||||
* 主办方联系人
|
||||
*/
|
||||
organizerContact?: string;
|
||||
|
||||
/**
|
||||
* 主办方电话
|
||||
*/
|
||||
organizerPhone?: string;
|
||||
|
||||
/**
|
||||
* 承办方信息列表
|
||||
*/
|
||||
coOrganizerList?: CoOrganizerInfo[];
|
||||
|
||||
/**
|
||||
* 承办方信息(JSON格式存储多个承办方)
|
||||
*/
|
||||
coOrganizers?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表
|
||||
*/
|
||||
instructorList?: InstructorInfo[];
|
||||
|
||||
/**
|
||||
* 指导老师列表(JSON格式)
|
||||
*/
|
||||
instructors?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表(AdvisorManager组件使用)
|
||||
*/
|
||||
advisors?: any[];
|
||||
|
||||
/**
|
||||
* 报名方式(1-个人 2-团队 3-两者均可)
|
||||
*/
|
||||
registrationType?: string;
|
||||
|
||||
/**
|
||||
* 报名开始时间
|
||||
*/
|
||||
registrationStart?: string;
|
||||
|
||||
/**
|
||||
* 报名结束时间
|
||||
*/
|
||||
registrationEnd?: string;
|
||||
|
||||
/**
|
||||
* 报名状态(0-未开始 1-报名中 2-已截止 3-已关闭)
|
||||
*/
|
||||
registrationStatus?: number;
|
||||
|
||||
/**
|
||||
* 总人数上限
|
||||
*/
|
||||
maxParticipants?: number;
|
||||
|
||||
/**
|
||||
* 团队数量上限
|
||||
*/
|
||||
maxTeams?: number;
|
||||
|
||||
/**
|
||||
* 每队最小人数
|
||||
*/
|
||||
teamSizeMin?: number;
|
||||
|
||||
/**
|
||||
* 每队最大人数
|
||||
*/
|
||||
teamSizeMax?: number;
|
||||
|
||||
/**
|
||||
* 是否需要审核(0-无需 1-需要)
|
||||
*/
|
||||
needApproval?: number;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
activityStatus?: string;
|
||||
|
||||
/**
|
||||
* 是否为已办活动
|
||||
*/
|
||||
isFinished?: number;
|
||||
|
||||
/**
|
||||
* 活动总结报告
|
||||
*/
|
||||
summary?: string;
|
||||
|
||||
/**
|
||||
* 活动成果
|
||||
*/
|
||||
achievements?: string;
|
||||
|
||||
/**
|
||||
* 总结报告附件
|
||||
*/
|
||||
summaryAttachments?: string;
|
||||
|
||||
/**
|
||||
* 活动成果附件
|
||||
*/
|
||||
achievementsAttachments?: string;
|
||||
|
||||
/**
|
||||
* 导入来源信息
|
||||
*/
|
||||
importSource?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface StglActivityQuery extends PageQuery {
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
activityType?: string;
|
||||
|
||||
/**
|
||||
* 活动主题
|
||||
*/
|
||||
activityTheme?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
location?: string;
|
||||
|
||||
/**
|
||||
* 关联社团ID
|
||||
*/
|
||||
relatedClubId?: string | number;
|
||||
|
||||
/**
|
||||
* 主办方名称
|
||||
*/
|
||||
organizerName?: string;
|
||||
|
||||
/**
|
||||
* 报名方式(1-个人 2-团队 3-两者均可)
|
||||
*/
|
||||
registrationType?: string;
|
||||
|
||||
/**
|
||||
* 报名开始时间
|
||||
*/
|
||||
registrationStart?: string;
|
||||
|
||||
/**
|
||||
* 报名结束时间
|
||||
*/
|
||||
registrationEnd?: string;
|
||||
|
||||
/**
|
||||
* 报名状态(0-未开始 1-报名中 2-已截止 3-已关闭)
|
||||
*/
|
||||
registrationStatus?: number;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
activityStatus?: string;
|
||||
|
||||
/**
|
||||
* 是否为已办活动
|
||||
*/
|
||||
isFinished?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 社团/志愿者队伍选择器选项
|
||||
*/
|
||||
export interface ClubOption {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
relatedClubId: string | number;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
relatedClubName: string;
|
||||
|
||||
/**
|
||||
* 类型(1-社团 2-志愿者队伍)
|
||||
*/
|
||||
relatedType: number;
|
||||
|
||||
/**
|
||||
* 唯一标识(用于组件对象比较)
|
||||
*/
|
||||
uniqueKey?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 承办方信息
|
||||
*/
|
||||
export interface CoOrganizerInfo {
|
||||
/**
|
||||
* 承办方名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 承办方类型
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
contact?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指导老师信息
|
||||
*/
|
||||
export interface InstructorInfo {
|
||||
/**
|
||||
* 老师姓名
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
dept?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 指导学时
|
||||
*/
|
||||
hours?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动复制参数
|
||||
*/
|
||||
export interface ActivityCopyParams {
|
||||
/**
|
||||
* 源活动ID
|
||||
*/
|
||||
sourceId: string | number;
|
||||
|
||||
/**
|
||||
* 新活动名称
|
||||
*/
|
||||
newActivityName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动总结参数
|
||||
*/
|
||||
export interface ActivitySummaryParams {
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 总结报告
|
||||
*/
|
||||
summary?: string;
|
||||
|
||||
/**
|
||||
* 活动成果
|
||||
*/
|
||||
achievements?: string;
|
||||
|
||||
/**
|
||||
* 总结报告附件
|
||||
*/
|
||||
summaryAttachments?: string;
|
||||
|
||||
/**
|
||||
* 活动成果附件
|
||||
*/
|
||||
achievementsAttachments?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动评分信息
|
||||
*/
|
||||
export interface ActivityRatingVO {
|
||||
/**
|
||||
* 评分ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 评分人ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 评分人姓名
|
||||
*/
|
||||
userName?: string;
|
||||
|
||||
/**
|
||||
* 评分(1-5分)
|
||||
*/
|
||||
ratingScore: number;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
ratingComment?: string;
|
||||
|
||||
/**
|
||||
* 评分时间
|
||||
*/
|
||||
ratingTime?: string;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglActivityAttendanceVO, StglActivityAttendanceForm, StglActivityAttendanceQuery } from './types';
|
||||
|
||||
/**
|
||||
* 查询活动考勤签到列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listStglActivityAttendance = (query?: StglActivityAttendanceQuery): AxiosPromise<StglActivityAttendanceVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询活动考勤签到详细
|
||||
* @param id
|
||||
*/
|
||||
export const getStglActivityAttendance = (id: string | number): AxiosPromise<StglActivityAttendanceVO> => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增活动考勤签到
|
||||
* @param data
|
||||
*/
|
||||
export const addStglActivityAttendance = (data: StglActivityAttendanceForm) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改活动考勤签到
|
||||
* @param data
|
||||
*/
|
||||
export const updateStglActivityAttendance = (data: StglActivityAttendanceForm) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除活动考勤签到
|
||||
* @param id
|
||||
*/
|
||||
export const delStglActivityAttendance = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出活动考勤签到
|
||||
* @param query
|
||||
*/
|
||||
export const exportStglActivityAttendance = (query?: StglActivityAttendanceQuery) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询用户已报名成功且进行中的活动列表
|
||||
*/
|
||||
export const getUserAvailableActivities = (): AxiosPromise<StglActivityAttendanceVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/userAvailableActivities',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据活动ID查询当前用户签到记录
|
||||
* @param activityId
|
||||
*/
|
||||
export const getAttendanceByActivity = (activityId: string | number): AxiosPromise<StglActivityAttendanceVO> => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/getByActivityAndUser',
|
||||
method: 'get',
|
||||
params: { activityId }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户签到
|
||||
* @param data
|
||||
*/
|
||||
export const signIn = (data: StglActivityAttendanceForm) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/signIn',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户签退
|
||||
* @param data
|
||||
*/
|
||||
export const signOut = (data: StglActivityAttendanceForm) => {
|
||||
return request({
|
||||
url: '/stgl/activityAttendance/signOut',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,332 @@
|
||||
export interface StglActivityAttendanceVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID(关联stgl_activity表)
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID(关联sys_user表)
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* 签到时间
|
||||
*/
|
||||
signInTime: string;
|
||||
|
||||
/**
|
||||
* 签到状态(0-未签到 1-已签到)
|
||||
*/
|
||||
signInStatus: number;
|
||||
|
||||
/**
|
||||
* 签到地点
|
||||
*/
|
||||
signInLocation: string;
|
||||
|
||||
/**
|
||||
* 签到设备信息
|
||||
*/
|
||||
signInDevice: string;
|
||||
|
||||
/**
|
||||
* 签到备注
|
||||
*/
|
||||
signInRemark: string;
|
||||
|
||||
/**
|
||||
* 签退时间
|
||||
*/
|
||||
signOutTime: string;
|
||||
|
||||
/**
|
||||
* 签退状态(0-未签退 1-已签退)
|
||||
*/
|
||||
signOutStatus: number;
|
||||
|
||||
/**
|
||||
* 签退地点
|
||||
*/
|
||||
signOutLocation: string;
|
||||
|
||||
/**
|
||||
* 签退设备信息
|
||||
*/
|
||||
signOutDevice: string;
|
||||
|
||||
/**
|
||||
* 签退备注
|
||||
*/
|
||||
signOutRemark: string;
|
||||
|
||||
/**
|
||||
* 签到状态(0-未签到 1-已签到 2-已签退)
|
||||
*/
|
||||
overallStatus: number;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy: string | number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
// ===== 关联查询字段 =====
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
activityType: string;
|
||||
|
||||
/**
|
||||
* 活动主题
|
||||
*/
|
||||
activityTheme: string;
|
||||
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
location: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 记录时间(根据签到状态取sign_in_time或sign_out_time)
|
||||
*/
|
||||
recordTime: string;
|
||||
}
|
||||
|
||||
export interface StglActivityAttendanceForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID(关联stgl_activity表)
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID(关联sys_user表)
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 签到时间
|
||||
*/
|
||||
signInTime?: string;
|
||||
|
||||
/**
|
||||
* 签到状态(0-未签到 1-已签到)
|
||||
*/
|
||||
signInStatus?: number;
|
||||
|
||||
/**
|
||||
* 签到地点
|
||||
*/
|
||||
signInLocation?: string;
|
||||
|
||||
/**
|
||||
* 签到设备信息
|
||||
*/
|
||||
signInDevice?: string;
|
||||
|
||||
/**
|
||||
* 签到备注
|
||||
*/
|
||||
signInRemark?: string;
|
||||
|
||||
/**
|
||||
* 签退时间
|
||||
*/
|
||||
signOutTime?: string;
|
||||
|
||||
/**
|
||||
* 签退状态(0-未签退 1-已签退)
|
||||
*/
|
||||
signOutStatus?: number;
|
||||
|
||||
/**
|
||||
* 签退地点
|
||||
*/
|
||||
signOutLocation?: string;
|
||||
|
||||
/**
|
||||
* 签退设备信息
|
||||
*/
|
||||
signOutDevice?: string;
|
||||
|
||||
/**
|
||||
* 签退备注
|
||||
*/
|
||||
signOutRemark?: string;
|
||||
|
||||
/**
|
||||
* 签到状态(0-未签到 1-已签到 2-已签退)
|
||||
*/
|
||||
overallStatus?: number;
|
||||
}
|
||||
|
||||
export interface StglActivityAttendanceQuery {
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
|
||||
/**
|
||||
* 活动ID(关联stgl_activity表)
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 用户ID(关联sys_user表)
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 签到状态(0-未签到 1-已签到 2-已签退)
|
||||
*/
|
||||
overallStatus?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
StglMaterialTaskVO,
|
||||
StglMaterialTaskForm,
|
||||
StglMaterialTaskQuery,
|
||||
StglMaterialSubmissionVO,
|
||||
StglMaterialSubmissionForm,
|
||||
StglMaterialSubmissionQuery
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 查询材料收集任务列表
|
||||
*/
|
||||
export function listStglMaterialTask(query: StglMaterialTaskQuery): AxiosPromise<StglMaterialTaskVO[]> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询材料收集任务详细
|
||||
*/
|
||||
export function getStglMaterialTask(id: string | number): AxiosPromise<StglMaterialTaskVO> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增材料收集任务
|
||||
*/
|
||||
export function addStglMaterialTask(data: StglMaterialTaskForm) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改材料收集任务
|
||||
*/
|
||||
export function updateStglMaterialTask(data: StglMaterialTaskForm) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除材料收集任务
|
||||
*/
|
||||
export function delStglMaterialTask(id: string | number | Array<string | number>) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出材料收集任务
|
||||
*/
|
||||
export function exportStglMaterialTask(query: StglMaterialTaskQuery) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务状态(开启/关闭)
|
||||
*/
|
||||
export function updateTaskStatus(id: string | number, taskStatus: number) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/status',
|
||||
method: 'put',
|
||||
params: {
|
||||
id: id,
|
||||
taskStatus: taskStatus
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户可上传的材料收集任务
|
||||
*/
|
||||
export function getUploadableTasks(userId: string | number, activityId?: string | number): AxiosPromise<StglMaterialTaskVO[]> {
|
||||
const params: any = { userId };
|
||||
if (activityId) {
|
||||
params.activityId = activityId;
|
||||
}
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/uploadable',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户上传权限
|
||||
*/
|
||||
export function validateUploadPermission(taskId: string | number, userId: string | number): AxiosPromise<boolean> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/validate',
|
||||
method: 'get',
|
||||
params: {
|
||||
taskId: taskId,
|
||||
userId: userId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动的材料收集任务
|
||||
*/
|
||||
export function getTasksByActivityId(activityId: string | number): AxiosPromise<StglMaterialTaskVO[]> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/activity/' + activityId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务统计信息
|
||||
*/
|
||||
export function updateTaskStatistics(taskId: string | number) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/statistics/' + taskId,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据活动名称查询活动选项(用于选择器)
|
||||
*/
|
||||
export function getActivityOptions(activityName?: string): AxiosPromise<StglMaterialTaskVO[]> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/activity/options',
|
||||
method: 'get',
|
||||
params: activityName ? { activityName } : {}
|
||||
});
|
||||
}
|
||||
|
||||
// ==================== 材料提交相关API ====================
|
||||
|
||||
/**
|
||||
* 查询材料提交记录列表
|
||||
*/
|
||||
export function listStglMaterialSubmission(query: StglMaterialSubmissionQuery): AxiosPromise<StglMaterialSubmissionVO[]> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询材料提交记录详细
|
||||
*/
|
||||
export function getStglMaterialSubmission(id: string | number): AxiosPromise<StglMaterialSubmissionVO> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增材料提交记录
|
||||
*/
|
||||
export function addStglMaterialSubmission(data: StglMaterialSubmissionForm) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改材料提交记录
|
||||
*/
|
||||
export function updateStglMaterialSubmission(data: StglMaterialSubmissionForm) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除材料提交记录
|
||||
*/
|
||||
export function delStglMaterialSubmission(id: string | number | Array<string | number>) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出材料提交记录
|
||||
*/
|
||||
export function exportStglMaterialSubmission(query: StglMaterialSubmissionQuery) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料上传
|
||||
*/
|
||||
export function uploadMaterial(data: StglMaterialSubmissionForm) {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/upload',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务ID查询提交记录
|
||||
*/
|
||||
export function getSubmissionsByTaskId(taskId: string | number): AxiosPromise<StglMaterialSubmissionVO[]> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/task/' + taskId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户在指定任务的提交记录
|
||||
*/
|
||||
export function getSubmissionByTaskIdAndUserId(taskId: string | number, userId: string | number): AxiosPromise<StglMaterialSubmissionVO> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/task/' + taskId + '/user/' + userId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询团队在指定任务的提交记录
|
||||
*/
|
||||
export function getSubmissionByTaskIdAndTeamId(taskId: string | number, teamId: string | number): AxiosPromise<StglMaterialSubmissionVO> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/task/' + taskId + '/team/' + teamId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务的提交统计信息
|
||||
*/
|
||||
export function getSubmissionStatistics(taskId: string | number): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/statistics/' + taskId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核材料
|
||||
*/
|
||||
export function reviewSubmission(id: string | number, reviewStatus: number, reviewRemark?: string) {
|
||||
const params: any = {
|
||||
reviewStatus: reviewStatus
|
||||
};
|
||||
if (reviewRemark) {
|
||||
params.reviewRemark = reviewRemark;
|
||||
}
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/review/' + id,
|
||||
method: 'put',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核材料
|
||||
*/
|
||||
export function batchReviewSubmissions(ids: string, reviewStatus: number, reviewRemark?: string) {
|
||||
const params: any = {
|
||||
ids: ids,
|
||||
reviewStatus: reviewStatus
|
||||
};
|
||||
if (reviewRemark) {
|
||||
params.reviewRemark = reviewRemark;
|
||||
}
|
||||
return request({
|
||||
url: '/stgl/activitymaterial/submission/review/batch',
|
||||
method: 'put',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,536 @@
|
||||
export interface StglMaterialTaskVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 关联活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName: string;
|
||||
|
||||
/**
|
||||
* 收集类型(多选,逗号分隔)
|
||||
*/
|
||||
collectionTypes: string;
|
||||
|
||||
/**
|
||||
* 收集类型显示名称
|
||||
*/
|
||||
collectionTypesDisplay: string;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
taskDescription: string;
|
||||
|
||||
/**
|
||||
* 任务状态(1-开启 0-关闭)
|
||||
*/
|
||||
taskStatus: number;
|
||||
|
||||
/**
|
||||
* 任务状态显示名称
|
||||
*/
|
||||
taskStatusDisplay: string;
|
||||
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
deadline: string;
|
||||
|
||||
/**
|
||||
* 收集轮次
|
||||
*/
|
||||
roundNumber: number;
|
||||
|
||||
/**
|
||||
* 文件大小限制(MB)
|
||||
*/
|
||||
fileSizeLimit: number;
|
||||
|
||||
/**
|
||||
* 文件数量限制
|
||||
*/
|
||||
fileCountLimit: number;
|
||||
|
||||
/**
|
||||
* 允许的文件类型
|
||||
*/
|
||||
allowedFileTypes: string;
|
||||
|
||||
/**
|
||||
* 总参与人数
|
||||
*/
|
||||
totalParticipants: number;
|
||||
|
||||
/**
|
||||
* 已提交人数
|
||||
*/
|
||||
submittedCount: number;
|
||||
|
||||
/**
|
||||
* 待提交人数
|
||||
*/
|
||||
pendingCount: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy: string | number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
createByName: string;
|
||||
}
|
||||
|
||||
export interface StglMaterialTaskForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 关联活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName: string;
|
||||
|
||||
/**
|
||||
* 收集类型(多选,逗号分隔)
|
||||
*/
|
||||
collectionTypes: string;
|
||||
|
||||
/**
|
||||
* 任务描述
|
||||
*/
|
||||
taskDescription: string;
|
||||
|
||||
/**
|
||||
* 任务状态(1-开启 0-关闭)
|
||||
*/
|
||||
taskStatus?: number;
|
||||
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
deadline: string;
|
||||
|
||||
/**
|
||||
* 收集轮次
|
||||
*/
|
||||
roundNumber?: number;
|
||||
|
||||
/**
|
||||
* 文件大小限制(MB)
|
||||
*/
|
||||
fileSizeLimit: number;
|
||||
|
||||
/**
|
||||
* 文件数量限制
|
||||
*/
|
||||
fileCountLimit: number;
|
||||
|
||||
/**
|
||||
* 允许的文件类型
|
||||
*/
|
||||
allowedFileTypes?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface StglMaterialTaskQuery {
|
||||
/**
|
||||
* 分页页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
|
||||
/**
|
||||
* 关联活动ID
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName?: string;
|
||||
|
||||
/**
|
||||
* 收集类型
|
||||
*/
|
||||
collectionTypes?: string;
|
||||
|
||||
/**
|
||||
* 任务状态(1-开启 0-关闭)
|
||||
*/
|
||||
taskStatus?: number;
|
||||
|
||||
/**
|
||||
* 截止时间开始
|
||||
*/
|
||||
deadlineStart?: string;
|
||||
|
||||
/**
|
||||
* 截止时间结束
|
||||
*/
|
||||
deadlineEnd?: string;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
creatorName?: string;
|
||||
|
||||
/**
|
||||
* 时间范围参数(用于日期筛选)
|
||||
*/
|
||||
params?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface StglMaterialSubmissionVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 收集任务ID
|
||||
*/
|
||||
taskId: string | number;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
taskName: string;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 提交类型(1-个人 2-团队)
|
||||
*/
|
||||
submissionType: number;
|
||||
|
||||
/**
|
||||
* 提交类型显示名称
|
||||
*/
|
||||
submissionTypeDisplay: string;
|
||||
|
||||
/**
|
||||
* 团队ID
|
||||
*/
|
||||
teamId: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName: string;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
contentText: string;
|
||||
|
||||
/**
|
||||
* 附件路径(JSON格式)
|
||||
*/
|
||||
fileUrls: string;
|
||||
|
||||
/**
|
||||
* 图片路径(JSON格式)
|
||||
*/
|
||||
imageUrls: string;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
submissionTime: string;
|
||||
|
||||
/**
|
||||
* 提交轮次
|
||||
*/
|
||||
roundNumber: number;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
reviewStatus: number;
|
||||
|
||||
/**
|
||||
* 审核状态显示名称
|
||||
*/
|
||||
reviewStatusDisplay: string;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
reviewTime: string;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
reviewBy: string | number;
|
||||
|
||||
/**
|
||||
* 审核人姓名
|
||||
*/
|
||||
reviewByName: string;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
reviewRemark: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy: string | number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
export interface StglMaterialSubmissionForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 收集任务ID
|
||||
*/
|
||||
taskId: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 提交类型(1-个人 2-团队)
|
||||
*/
|
||||
submissionType: number;
|
||||
|
||||
/**
|
||||
* 团队ID
|
||||
*/
|
||||
teamId?: string | number;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
contentText?: string;
|
||||
|
||||
/**
|
||||
* 附件路径(JSON格式)
|
||||
*/
|
||||
fileUrls?: string;
|
||||
|
||||
/**
|
||||
* 图片路径(JSON格式)
|
||||
*/
|
||||
imageUrls?: string;
|
||||
|
||||
/**
|
||||
* 提交轮次
|
||||
*/
|
||||
roundNumber?: number;
|
||||
}
|
||||
|
||||
export interface StglMaterialSubmissionQuery {
|
||||
/**
|
||||
* 分页页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
|
||||
/**
|
||||
* 收集任务ID
|
||||
*/
|
||||
taskId?: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 提交类型(1-个人 2-团队)
|
||||
*/
|
||||
submissionType?: number;
|
||||
|
||||
/**
|
||||
* 团队ID
|
||||
*/
|
||||
teamId?: string | number;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
reviewStatus?: number;
|
||||
|
||||
/**
|
||||
* 提交轮次
|
||||
*/
|
||||
roundNumber?: number;
|
||||
|
||||
/**
|
||||
* 时间范围参数(用于日期筛选)
|
||||
*/
|
||||
params?: Record<string, any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动选项类型(用于选择器)
|
||||
*/
|
||||
export interface ActivityOption {
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
activityStatus: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料类型选项(用于多选)
|
||||
*/
|
||||
export interface MaterialTypeOption {
|
||||
/**
|
||||
* 类型值
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* 类型标签
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
checked?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglActivityRegistrationVo, StglActivityRegistrationBo, StglActivityRegistrationForm } from './types';
|
||||
|
||||
/**
|
||||
* 查询活动报名管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listActivityRegister = (query?: any): AxiosPromise<StglActivityRegistrationVo[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/register/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询活动报名管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getActivityRegister = (id: string | number): AxiosPromise<StglActivityRegistrationVo> => {
|
||||
return request({
|
||||
url: '/stgl/activity/register/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增活动报名管理
|
||||
* @param data
|
||||
*/
|
||||
export const addActivityRegister = (data: StglActivityRegistrationForm) => {
|
||||
return request({
|
||||
url: '/stgl/activity/register',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改活动报名管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateActivityRegister = (data: StglActivityRegistrationForm) => {
|
||||
return request({
|
||||
url: '/stgl/activity/register',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除活动报名管理
|
||||
* @param id
|
||||
*/
|
||||
export const delActivityRegister = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/stgl/activity/register/' + id,
|
||||
method: 'delete',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 审核活动报名
|
||||
* @param id 报名ID
|
||||
* @param approvalStatus 审核状态 1-通过 2-驳回
|
||||
* @param approvalRemark 审核意见
|
||||
*/
|
||||
export const approveActivityRegister = (id: string | number, approvalStatus: number, approvalRemark?: string) => {
|
||||
return request({
|
||||
url: `/stgl/activity/register/approve/${id}`,
|
||||
method: 'post',
|
||||
params: {
|
||||
approvalStatus,
|
||||
approvalRemark,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量审核活动报名
|
||||
* @param ids 报名ID数组
|
||||
* @param approvalStatus 审核状态 1-通过 2-驳回
|
||||
* @param approvalRemark 审核意见
|
||||
*/
|
||||
export const batchApproveActivityRegister = (ids: Array<string | number>, approvalStatus: number, approvalRemark?: string) => {
|
||||
return request({
|
||||
url: '/stgl/activity/register/batchApprove',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids,
|
||||
approvalStatus,
|
||||
approvalRemark,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出活动报名管理
|
||||
* @param query 查询参数
|
||||
* @returns 导出文件
|
||||
*/
|
||||
export const exportActivityRegister = (query?: any) => {
|
||||
return request({
|
||||
url: '/stgl/activity/register/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 录入活动报名成绩
|
||||
* @param id 报名ID
|
||||
* @param score 成绩内容
|
||||
*/
|
||||
export const recordActivityScore = (id: string | number, score: string) => {
|
||||
return request({
|
||||
url: `/stgl/activity/register/score/${id}`,
|
||||
method: 'post',
|
||||
params: {
|
||||
score,
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,344 @@
|
||||
export interface StglActivityRegistrationVo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType: number;
|
||||
|
||||
/**
|
||||
* 团队ID(团队报名时)
|
||||
*/
|
||||
teamId: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName: string;
|
||||
|
||||
/**
|
||||
* 报名时间
|
||||
*/
|
||||
registrationTime: string;
|
||||
|
||||
/**
|
||||
* 申请理由(非必填)
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
approvalStatus: number;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
approvalTime: string;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
approvalBy: string | number;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
approvalRemark: string;
|
||||
|
||||
/**
|
||||
* 获得成绩
|
||||
*/
|
||||
score: string;
|
||||
|
||||
/**
|
||||
* 成绩录入时间
|
||||
*/
|
||||
scoreTime: string;
|
||||
|
||||
/**
|
||||
* 成绩录入人
|
||||
*/
|
||||
scoreBy: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
export interface StglActivityRegistrationBo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType?: number;
|
||||
|
||||
/**
|
||||
* 团队ID(团队报名时)
|
||||
*/
|
||||
teamId?: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName?: string;
|
||||
|
||||
/**
|
||||
* 申请理由(非必填)
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
approvalStatus?: number;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
approvalTime?: string;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
approvalBy?: string | number;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
approvalRemark?: string;
|
||||
|
||||
/**
|
||||
* 获得成绩
|
||||
*/
|
||||
score?: string;
|
||||
|
||||
/**
|
||||
* 成绩录入人
|
||||
*/
|
||||
scoreBy?: string | number;
|
||||
}
|
||||
|
||||
export interface StglActivityRegistrationForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType: number;
|
||||
|
||||
/**
|
||||
* 团队ID(团队报名时)
|
||||
*/
|
||||
teamId?: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName?: string;
|
||||
|
||||
/**
|
||||
* 申请理由(非必填)
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
approvalStatus?: number;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
approvalRemark?: string;
|
||||
|
||||
/**
|
||||
* 获得成绩
|
||||
*/
|
||||
score?: string;
|
||||
}
|
||||
|
||||
export interface StglActivityRegistrationQuery extends PageQuery {
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType?: string;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName?: string;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
approvalStatus?: string;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface TeamMemberInfo {
|
||||
/**
|
||||
* 成员姓名
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 是否为负责人
|
||||
*/
|
||||
isLeader?: boolean;
|
||||
}
|
||||
|
||||
export interface PageQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglActivityVo, StglActivityRegistrationVo, StglActivityRegistrationForm } from './types';
|
||||
|
||||
/**
|
||||
* 查询可报名活动列表(仅显示报名状态为0和1的活动)
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listRegistrableActivities = (query?: any): AxiosPromise<StglActivityVo[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/registerhall/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取活动详细信息
|
||||
* @param id
|
||||
*/
|
||||
export const getActivityDetail = (id: string | number): AxiosPromise<StglActivityVo> => {
|
||||
return request({
|
||||
url: '/stgl/activity/registerhall/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 学生报名活动
|
||||
* @param data
|
||||
*/
|
||||
export const registerActivity = (data: StglActivityRegistrationForm) => {
|
||||
return request({
|
||||
url: '/stgl/activity/registerhall/register',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 检查用户是否已报名某活动
|
||||
* @param activityId
|
||||
*/
|
||||
export const checkRegistration = (activityId: string | number): AxiosPromise<boolean> => {
|
||||
return request({
|
||||
url: `/stgl/activity/registerhall/checkRegistration/${activityId}`,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取用户的报名记录
|
||||
* @param query
|
||||
*/
|
||||
export const getMyRegistrations = (query?: any): AxiosPromise<StglActivityRegistrationVo[]> => {
|
||||
return request({
|
||||
url: '/stgl/activity/registerhall/myRegistrations',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,425 @@
|
||||
// 活动相关类型定义
|
||||
export interface StglActivityVo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
activityType: string;
|
||||
|
||||
/**
|
||||
* 活动主题
|
||||
*/
|
||||
activityTheme: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
location: string;
|
||||
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* 活动海报路径
|
||||
*/
|
||||
posterUrl: string;
|
||||
|
||||
/**
|
||||
* 关联社团ID
|
||||
*/
|
||||
relatedClubId: string | number;
|
||||
|
||||
/**
|
||||
* 关联社团名称
|
||||
*/
|
||||
relatedClubName?: string;
|
||||
|
||||
/**
|
||||
* 关联类型(1-社团 2-志愿者队伍)
|
||||
*/
|
||||
relatedType?: number;
|
||||
|
||||
/**
|
||||
* 主办方名称
|
||||
*/
|
||||
organizerName: string;
|
||||
|
||||
/**
|
||||
* 主办方类型
|
||||
*/
|
||||
organizerType: string;
|
||||
|
||||
/**
|
||||
* 主办方联系人
|
||||
*/
|
||||
organizerContact: string;
|
||||
|
||||
/**
|
||||
* 主办方电话
|
||||
*/
|
||||
organizerPhone: string;
|
||||
|
||||
/**
|
||||
* 承办方信息(JSON格式存储多个承办方)
|
||||
*/
|
||||
coOrganizers: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表(JSON格式)
|
||||
*/
|
||||
instructors: string;
|
||||
|
||||
/**
|
||||
* 报名方式(1-个人 2-团队 3-两者均可)
|
||||
*/
|
||||
registrationType: number;
|
||||
|
||||
/**
|
||||
* 报名开始时间
|
||||
*/
|
||||
registrationStart: string;
|
||||
|
||||
/**
|
||||
* 报名结束时间
|
||||
*/
|
||||
registrationEnd: string;
|
||||
|
||||
/**
|
||||
* 报名状态(0-未开始 1-报名中 2-已截止 3-已关闭)
|
||||
*/
|
||||
registrationStatus: number;
|
||||
|
||||
/**
|
||||
* 总人数上限
|
||||
*/
|
||||
maxParticipants: number;
|
||||
|
||||
/**
|
||||
* 团队数量上限
|
||||
*/
|
||||
maxTeams: number;
|
||||
|
||||
/**
|
||||
* 每队最小人数
|
||||
*/
|
||||
teamSizeMin: number;
|
||||
|
||||
/**
|
||||
* 每队最大人数
|
||||
*/
|
||||
teamSizeMax: number;
|
||||
|
||||
/**
|
||||
* 是否需要审核(0-无需 1-需要)
|
||||
*/
|
||||
needApproval: number;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
activityStatus: string;
|
||||
|
||||
/**
|
||||
* 是否为已办活动
|
||||
*/
|
||||
isFinished: number;
|
||||
|
||||
/**
|
||||
* 活动总结报告
|
||||
*/
|
||||
summary: string;
|
||||
|
||||
/**
|
||||
* 活动成果
|
||||
*/
|
||||
achievements: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
createByName?: string;
|
||||
|
||||
/**
|
||||
* 报名人数统计
|
||||
*/
|
||||
registrationCount?: number;
|
||||
|
||||
/**
|
||||
* 平均评分
|
||||
*/
|
||||
averageRating?: number;
|
||||
}
|
||||
|
||||
// 活动报名相关类型定义
|
||||
export interface StglActivityRegistrationVo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 活动名称
|
||||
*/
|
||||
activityName: string;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType: number;
|
||||
|
||||
/**
|
||||
* 团队ID(团队报名时)
|
||||
*/
|
||||
teamId: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName: string;
|
||||
|
||||
/**
|
||||
* 报名时间
|
||||
*/
|
||||
registrationTime: string;
|
||||
|
||||
/**
|
||||
* 申请理由(非必填)
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 审核状态(0-待审核 1-通过 2-驳回)
|
||||
*/
|
||||
approvalStatus: number;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
approvalTime: string;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
approvalBy: string | number;
|
||||
|
||||
/**
|
||||
* 审核意见
|
||||
*/
|
||||
approvalRemark: string;
|
||||
|
||||
/**
|
||||
* 获得成绩
|
||||
*/
|
||||
score: string;
|
||||
|
||||
/**
|
||||
* 成绩录入时间
|
||||
*/
|
||||
scoreTime: string;
|
||||
|
||||
/**
|
||||
* 成绩录入人
|
||||
*/
|
||||
scoreBy: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
export interface StglActivityRegistrationForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
activityId: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 报名类型(1-个人 2-团队)
|
||||
*/
|
||||
registrationType: number;
|
||||
|
||||
/**
|
||||
* 团队ID(团队报名时)
|
||||
*/
|
||||
teamId?: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
teamName?: string;
|
||||
|
||||
/**
|
||||
* 申请理由(非必填)
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 团队成员信息(用于团队报名)
|
||||
*/
|
||||
teamMembers?: TeamMemberInfo[];
|
||||
|
||||
/**
|
||||
* 团队描述
|
||||
*/
|
||||
teamDescription?: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
}
|
||||
|
||||
// 团队成员信息
|
||||
export interface TeamMemberInfo {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 是否为队长(0-否 1-是)
|
||||
*/
|
||||
isLeader: number;
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglClubVO, StglClubForm, StglClubQuery } from '@/api/stgl/club/types';
|
||||
|
||||
/**
|
||||
* 查询社团信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listStglClub = (query?: StglClubQuery): AxiosPromise<StglClubVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/club/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询社团信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getStglClub = (id: string | number): AxiosPromise<StglClubVO> => {
|
||||
return request({
|
||||
url: '/stgl/club/' + id,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增社团信息
|
||||
* @param data
|
||||
*/
|
||||
export const addStglClub = (data: StglClubForm) => {
|
||||
return request({
|
||||
url: '/stgl/club',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改社团信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateStglClub = (data: StglClubForm) => {
|
||||
return request({
|
||||
url: '/stgl/club',
|
||||
method: 'put',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除社团信息
|
||||
* @param id
|
||||
*/
|
||||
export const delStglClub = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/stgl/club/' + id,
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取社团类型选项
|
||||
*/
|
||||
export const getClubTypeOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/stgl/club/typeOptions',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 社团转让
|
||||
* @param id 社团ID
|
||||
* @param newPresidentUserId 新社长用户ID
|
||||
*/
|
||||
export const transferClub = (id: string | number, newPresidentUserId: number) => {
|
||||
return request({
|
||||
url: `/stgl/club/transfer/${id}`,
|
||||
method: 'post',
|
||||
params: {
|
||||
newPresidentUserId: newPresidentUserId
|
||||
},
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 验证当前用户是否为社团社长
|
||||
* @param id 社团ID
|
||||
*/
|
||||
export const checkPresidentRole = (id: string | number) => {
|
||||
return request({
|
||||
url: `/stgl/club/checkPresident/${id}`,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,415 @@
|
||||
import { StudentVO } from '@/api/xg/student/types';
|
||||
import { TeacherVO } from '@/api/system/teacher/types';
|
||||
import { VicePresidentVO } from '@/components/VicePresidentManager/index.vue';
|
||||
import { AdvisorVO } from '@/components/AdvisorManager/index.vue';
|
||||
|
||||
export interface StglClubVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName: string;
|
||||
|
||||
/**
|
||||
* 社团类型
|
||||
*/
|
||||
clubType: string;
|
||||
|
||||
/**
|
||||
* 成立日期
|
||||
*/
|
||||
establishDate: string;
|
||||
|
||||
/**
|
||||
* 社团简介
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* logo图片路径
|
||||
*/
|
||||
logoUrl: string;
|
||||
|
||||
/**
|
||||
* 社长信息对象
|
||||
*/
|
||||
presidentStudent: StudentVO;
|
||||
|
||||
/**
|
||||
* 社长姓名
|
||||
*/
|
||||
presidentName: string;
|
||||
|
||||
/**
|
||||
* 社长学号
|
||||
*/
|
||||
presidentStudentNo: string;
|
||||
|
||||
/**
|
||||
* 社长院系
|
||||
*/
|
||||
presidentDept: string;
|
||||
|
||||
/**
|
||||
* 社长专业
|
||||
*/
|
||||
presidentMajor: string;
|
||||
|
||||
/**
|
||||
* 社长班级
|
||||
*/
|
||||
presidentClass: string;
|
||||
|
||||
/**
|
||||
* 社长联系方式
|
||||
*/
|
||||
presidentPhone: string;
|
||||
|
||||
/**
|
||||
* 副社长列表
|
||||
*/
|
||||
vicePresidents: VicePresidentVO[];
|
||||
|
||||
/**
|
||||
* 副社长姓名(兼容旧版本)
|
||||
*/
|
||||
vicePresidentName: string;
|
||||
|
||||
/**
|
||||
* 副社长学号(兼容旧版本)
|
||||
*/
|
||||
vicePresidentStudentNo: string;
|
||||
|
||||
/**
|
||||
* 副社长院系(兼容旧版本)
|
||||
*/
|
||||
vicePresidentDept: string;
|
||||
|
||||
/**
|
||||
* 副社长专业(兼容旧版本)
|
||||
*/
|
||||
vicePresidentMajor: string;
|
||||
|
||||
/**
|
||||
* 副社长班级(兼容旧版本)
|
||||
*/
|
||||
vicePresidentClass: string;
|
||||
|
||||
/**
|
||||
* 副社长联系方式(兼容旧版本)
|
||||
*/
|
||||
vicePresidentPhone: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表
|
||||
*/
|
||||
advisors: AdvisorVO[];
|
||||
|
||||
/**
|
||||
* 指导老师姓名(兼容旧版本)
|
||||
*/
|
||||
advisorName: string;
|
||||
|
||||
/**
|
||||
* 指导老师所属院系(兼容旧版本)
|
||||
*/
|
||||
advisorDept: string;
|
||||
|
||||
/**
|
||||
* 指导老师联系电话(兼容旧版本)
|
||||
*/
|
||||
advisorPhone: string;
|
||||
|
||||
/**
|
||||
* 指导老师邮箱(兼容旧版本)
|
||||
*/
|
||||
advisorEmail: string;
|
||||
|
||||
/**
|
||||
* 副社长列表JSON格式存储
|
||||
*/
|
||||
vicePresidentsJson?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表JSON格式存储
|
||||
*/
|
||||
advisorsJson?: string;
|
||||
|
||||
/**
|
||||
* 成员规模上限
|
||||
*/
|
||||
memberLimit: number;
|
||||
|
||||
/**
|
||||
* 组织架构
|
||||
*/
|
||||
departments: string;
|
||||
|
||||
/**
|
||||
* 招新周期
|
||||
*/
|
||||
recruitCycle: string;
|
||||
|
||||
/**
|
||||
* 招新时间
|
||||
*/
|
||||
recruitTime: string;
|
||||
|
||||
/**
|
||||
* 活动频率
|
||||
*/
|
||||
activityFrequency: string;
|
||||
|
||||
/**
|
||||
* 经费来源(多选数组)
|
||||
*/
|
||||
fundingSources: string[];
|
||||
|
||||
/**
|
||||
* 章程文档路径
|
||||
*/
|
||||
charterUrl: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 当前成员数量
|
||||
*/
|
||||
memberCount: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
export interface StglClubForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName?: string;
|
||||
|
||||
/**
|
||||
* 社团类型
|
||||
*/
|
||||
clubType?: string;
|
||||
|
||||
/**
|
||||
* 成立日期
|
||||
*/
|
||||
establishDate?: string;
|
||||
|
||||
/**
|
||||
* 社团简介
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* logo图片路径
|
||||
*/
|
||||
logoUrl?: string;
|
||||
|
||||
/**
|
||||
* 社长信息对象
|
||||
*/
|
||||
presidentStudent?: StudentVO | null;
|
||||
|
||||
/**
|
||||
* 社长姓名
|
||||
*/
|
||||
presidentName?: string;
|
||||
|
||||
/**
|
||||
* 社长学号
|
||||
*/
|
||||
presidentStudentNo?: string;
|
||||
|
||||
/**
|
||||
* 社长院系
|
||||
*/
|
||||
presidentDept?: string;
|
||||
|
||||
/**
|
||||
* 社长专业
|
||||
*/
|
||||
presidentMajor?: string;
|
||||
|
||||
/**
|
||||
* 社长班级
|
||||
*/
|
||||
presidentClass?: string;
|
||||
|
||||
/**
|
||||
* 社长联系方式
|
||||
*/
|
||||
presidentPhone?: string;
|
||||
|
||||
/**
|
||||
* 副社长列表
|
||||
*/
|
||||
vicePresidents?: VicePresidentVO[];
|
||||
|
||||
/**
|
||||
* 副社长姓名(兼容旧版本)
|
||||
*/
|
||||
vicePresidentName?: string;
|
||||
|
||||
/**
|
||||
* 副社长学号(兼容旧版本)
|
||||
*/
|
||||
vicePresidentStudentNo?: string;
|
||||
|
||||
/**
|
||||
* 副社长院系(兼容旧版本)
|
||||
*/
|
||||
vicePresidentDept?: string;
|
||||
|
||||
/**
|
||||
* 副社长专业(兼容旧版本)
|
||||
*/
|
||||
vicePresidentMajor?: string;
|
||||
|
||||
/**
|
||||
* 副社长班级(兼容旧版本)
|
||||
*/
|
||||
vicePresidentClass?: string;
|
||||
|
||||
/**
|
||||
* 副社长联系方式(兼容旧版本)
|
||||
*/
|
||||
vicePresidentPhone?: string;
|
||||
|
||||
/**
|
||||
* 指导老师列表
|
||||
*/
|
||||
advisors?: AdvisorVO[];
|
||||
|
||||
/**
|
||||
* 指导老师姓名(兼容旧版本)
|
||||
*/
|
||||
advisorName?: string;
|
||||
|
||||
/**
|
||||
* 指导老师所属院系(兼容旧版本)
|
||||
*/
|
||||
advisorDept?: string;
|
||||
|
||||
/**
|
||||
* 指导老师联系电话(兼容旧版本)
|
||||
*/
|
||||
advisorPhone?: string;
|
||||
|
||||
/**
|
||||
* 指导老师邮箱(兼容旧版本)
|
||||
*/
|
||||
advisorEmail?: string;
|
||||
|
||||
/**
|
||||
* 成员规模上限
|
||||
*/
|
||||
memberLimit?: number;
|
||||
|
||||
/**
|
||||
* 组织架构
|
||||
*/
|
||||
departments?: string;
|
||||
|
||||
/**
|
||||
* 招新周期
|
||||
*/
|
||||
recruitCycle?: string;
|
||||
|
||||
/**
|
||||
* 招新时间
|
||||
*/
|
||||
recruitTime?: string;
|
||||
|
||||
/**
|
||||
* 活动频率
|
||||
*/
|
||||
activityFrequency?: string;
|
||||
|
||||
/**
|
||||
* 经费来源(多选数组)
|
||||
*/
|
||||
fundingSources?: string[];
|
||||
|
||||
/**
|
||||
* 章程文档路径
|
||||
*/
|
||||
charterUrl?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 当前成员数量
|
||||
*/
|
||||
memberCount?: number;
|
||||
}
|
||||
|
||||
export interface StglClubQuery extends PageQuery {
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName?: string;
|
||||
|
||||
/**
|
||||
* 社团类型
|
||||
*/
|
||||
clubType?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglMemberVO, StglMemberForm, StglMemberQuery } from '@/api/stgl/member/types';
|
||||
|
||||
/**
|
||||
* 查询社团成员列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listStglMember = (query?: StglMemberQuery): AxiosPromise<StglMemberVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/member/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询社团成员详细
|
||||
* @param id
|
||||
*/
|
||||
export const getStglMember = (id: string | number): AxiosPromise<StglMemberVO> => {
|
||||
return request({
|
||||
url: '/stgl/member/' + id,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增社团成员
|
||||
* @param data
|
||||
*/
|
||||
export const addStglMember = (data: StglMemberForm) => {
|
||||
return request({
|
||||
url: '/stgl/member',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改社团成员
|
||||
* @param data
|
||||
*/
|
||||
export const updateStglMember = (data: StglMemberForm) => {
|
||||
return request({
|
||||
url: '/stgl/member',
|
||||
method: 'put',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除社团成员
|
||||
* @param id
|
||||
*/
|
||||
export const delStglMember = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/stgl/member/' + id,
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取角色类型选项
|
||||
*/
|
||||
export const getRoleTypeOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/stgl/member/roleOptions',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 审核成员申请
|
||||
* @param id 成员ID
|
||||
* @param approved 是否通过(true-通过,false-拒绝)
|
||||
*/
|
||||
export const approveMember = (id: string | number, approved: boolean) => {
|
||||
return request({
|
||||
url: `/stgl/member/approve/${id}`,
|
||||
method: 'put',
|
||||
params: { approved },
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,232 @@
|
||||
import { StudentVO } from '@/api/xg/student/types';
|
||||
|
||||
export interface StglMemberVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 成员类型(1-社团成员 2-志愿者)
|
||||
*/
|
||||
memberType: number;
|
||||
|
||||
/**
|
||||
* 关联ID(社团ID)
|
||||
*/
|
||||
relationId: string | number;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName: string;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* 角色类型
|
||||
*/
|
||||
roleType: number;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
roleName: string;
|
||||
|
||||
/**
|
||||
* 加入时间
|
||||
*/
|
||||
joinTime: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
export interface StglMemberForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 成员类型(1-社团成员 2-志愿者)
|
||||
*/
|
||||
memberType?: number;
|
||||
|
||||
/**
|
||||
* 关联ID(社团ID)
|
||||
*/
|
||||
relationId?: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 选择的学生对象
|
||||
*/
|
||||
selectedStudent?: StudentVO | null;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 角色类型
|
||||
*/
|
||||
roleType?: number;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
roleName?: string;
|
||||
|
||||
/**
|
||||
* 加入时间
|
||||
*/
|
||||
joinTime?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface StglMemberQuery extends PageQuery {
|
||||
/**
|
||||
* 成员类型(1-社团成员 2-志愿者)
|
||||
*/
|
||||
memberType?: number;
|
||||
|
||||
/**
|
||||
* 关联ID(社团ID)
|
||||
*/
|
||||
relationId?: string | number;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 角色类型
|
||||
*/
|
||||
roleType?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MyClubVO, MyVolunteerTeamVO, MyActivityVO, MyRegistrationVO, ActivityRatingForm, MyRegistrationQuery, MyClubQuery, MyVolunteerQuery, MyActivityQuery } from './types';
|
||||
|
||||
/**
|
||||
* 查询我参与的社团列表
|
||||
*/
|
||||
export function getMyClubs(query?: MyClubQuery): AxiosPromise<MyClubVO[]> {
|
||||
return request({
|
||||
url: '/stgl/my/clubs',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我参与的志愿团队列表
|
||||
*/
|
||||
export function getMyVolunteerTeams(query?: MyVolunteerQuery): AxiosPromise<MyVolunteerTeamVO[]> {
|
||||
return request({
|
||||
url: '/stgl/my/volunteerTeams',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我报名的活动列表
|
||||
*/
|
||||
export function getMyActivities(query?: MyActivityQuery): AxiosPromise<MyActivityVO[]> {
|
||||
return request({
|
||||
url: '/stgl/my/activities',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询我的报名记录
|
||||
*/
|
||||
export function getMyRegistrations(query: MyRegistrationQuery): AxiosPromise<MyRegistrationVO[]> {
|
||||
return request({
|
||||
url: '/stgl/my/registrations',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对活动进行评分
|
||||
*/
|
||||
export function rateActivity(activityId: string | number, data: ActivityRatingForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: `/stgl/my/activities/${activityId}/rate`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否可以对活动评分
|
||||
*/
|
||||
export function canRateActivity(activityId: string | number): AxiosPromise<boolean> {
|
||||
return request({
|
||||
url: `/stgl/my/activities/${activityId}/canRate`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
export interface MyClubVO {
|
||||
/** 社团ID */
|
||||
id: string | number;
|
||||
/** 社团名称 */
|
||||
clubName: string;
|
||||
/** 社团类型 */
|
||||
clubType: string;
|
||||
/** LOGO地址 */
|
||||
logoUrl?: string;
|
||||
/** 社长姓名 */
|
||||
presidentName?: string;
|
||||
/** 社长院系 */
|
||||
presidentDept?: string;
|
||||
/** 指导老师姓名 */
|
||||
advisorName?: string;
|
||||
/** 指导老师部门 */
|
||||
advisorDept?: string;
|
||||
/** 成员数量 */
|
||||
memberCount?: number;
|
||||
/** 成员限制 */
|
||||
memberLimit?: number;
|
||||
/** 社团状态 */
|
||||
status: string;
|
||||
/** 我的角色 */
|
||||
myRole: string;
|
||||
/** 加入时间 */
|
||||
joinTime: string;
|
||||
/** 成员状态 */
|
||||
memberStatus: string;
|
||||
/** 社团简介 */
|
||||
description?: string;
|
||||
/** 成立日期 */
|
||||
establishDate?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface MyVolunteerTeamVO {
|
||||
/** 团队ID */
|
||||
id: string | number;
|
||||
/** 队伍名称 */
|
||||
teamName: string;
|
||||
/** 队长姓名 */
|
||||
leaderName?: string;
|
||||
/** 队长院系 */
|
||||
leaderDept?: string;
|
||||
/** 指导老师姓名 */
|
||||
advisorName?: string;
|
||||
/** 指导老师部门 */
|
||||
advisorDept?: string;
|
||||
/** 当前成员数量 */
|
||||
currentMemberCount?: number;
|
||||
/** 成员限制 */
|
||||
memberLimit?: number;
|
||||
/** 团队状态 */
|
||||
status: string;
|
||||
/** 我的角色 */
|
||||
myRole: string;
|
||||
/** 加入时间 */
|
||||
joinTime: string;
|
||||
/** 成员状态 */
|
||||
memberStatus: string;
|
||||
/** 队伍简介 */
|
||||
description?: string;
|
||||
/** 成立日期 */
|
||||
establishDate?: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface MyActivityVO {
|
||||
/** 活动ID */
|
||||
id: string | number;
|
||||
/** 活动名称 */
|
||||
activityName: string;
|
||||
/** 活动类型 */
|
||||
activityType: string;
|
||||
/** 活动主题 */
|
||||
activityTheme?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: string;
|
||||
/** 结束时间 */
|
||||
endTime?: string;
|
||||
/** 活动地点 */
|
||||
location?: string;
|
||||
/** 主办方名称 */
|
||||
organizerName?: string;
|
||||
/** 关联类型(1-社团 2-志愿者队伍) */
|
||||
relatedType?: number;
|
||||
/** 关联组织名称(社团名称或志愿者团队名称) */
|
||||
organizationName?: string;
|
||||
/** 指导老师 */
|
||||
instructors?: string;
|
||||
/** 活动状态 */
|
||||
activityStatus: string;
|
||||
/** 报名状态 */
|
||||
registrationStatus?: string;
|
||||
/** 海报地址 */
|
||||
posterUrl?: string;
|
||||
/** 活动简介 */
|
||||
description?: string;
|
||||
/** 我的报名时间 */
|
||||
myRegistrationTime: string;
|
||||
/** 我的报名状态 */
|
||||
myRegistrationStatus: string;
|
||||
/** 我的评分状态(0-未评分 1-已评分) */
|
||||
myRatingStatus: number;
|
||||
/** 我的综合评分 */
|
||||
myRatingScore?: number;
|
||||
/** 我的评分时间 */
|
||||
myRatingTime?: string;
|
||||
/** 活动平均评分 */
|
||||
averageRating?: number;
|
||||
/** 是否可以评分 */
|
||||
canRate: boolean;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface MyRegistrationVO {
|
||||
/** 记录ID */
|
||||
id: string | number;
|
||||
/** 报名类型(1-社团 2-志愿团队 3-活动) */
|
||||
registrationType: string;
|
||||
/** 目标ID */
|
||||
targetId: string | number;
|
||||
/** 名称 */
|
||||
targetName: string;
|
||||
/** 类型 */
|
||||
targetType?: string;
|
||||
/** 报名时间 */
|
||||
registrationTime: string;
|
||||
/** 审核状态 */
|
||||
approvalStatus: string;
|
||||
/** 审核时间 */
|
||||
approvalTime?: string;
|
||||
/** 审核人 */
|
||||
approvalBy?: string;
|
||||
/** 备注信息 */
|
||||
remark?: string;
|
||||
/** 当前状态 */
|
||||
currentStatus: string;
|
||||
/** 角色 */
|
||||
role?: string;
|
||||
/** 组织者/负责人 */
|
||||
organizer?: string;
|
||||
/** 时间信息 */
|
||||
timeInfo?: string;
|
||||
/** 地点信息 */
|
||||
location?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface ActivityRatingForm {
|
||||
/** 活动ID */
|
||||
activityId: string | number;
|
||||
/** 学号 */
|
||||
studentNo?: string;
|
||||
/** 学生姓名 */
|
||||
studentName?: string;
|
||||
/** 内容评分(1-5分) */
|
||||
contentScore: number;
|
||||
/** 组织评分(1-5分) */
|
||||
organizationScore: number;
|
||||
/** 体验评分(1-5分) */
|
||||
experienceScore: number;
|
||||
/** 评价意见 */
|
||||
ratingComment?: string;
|
||||
}
|
||||
|
||||
export interface MyClubQuery {
|
||||
/** 社团名称 */
|
||||
clubName?: string;
|
||||
/** 社团类型 */
|
||||
clubType?: string;
|
||||
}
|
||||
|
||||
export interface MyVolunteerQuery {
|
||||
/** 队伍名称 */
|
||||
teamName?: string;
|
||||
}
|
||||
|
||||
export interface MyActivityQuery {
|
||||
/** 活动名称 */
|
||||
activityName?: string;
|
||||
/** 活动类型 */
|
||||
activityType?: string;
|
||||
/** 是否评分 */
|
||||
isRated?: string;
|
||||
}
|
||||
|
||||
export interface MyRegistrationQuery {
|
||||
/** 页码 */
|
||||
pageNum?: number;
|
||||
/** 每页显示记录数 */
|
||||
pageSize?: number;
|
||||
/** 报名类型 */
|
||||
registrationType?: string;
|
||||
/** 审核状态 */
|
||||
approvalStatus?: string;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StglClubRegisterVO, StglClubRegisterQuery, StglRegisterForm } from '@/api/stgl/register/types';
|
||||
|
||||
/**
|
||||
* 查询社团报名大厅列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listStglClubRegister = (query?: StglClubRegisterQuery): AxiosPromise<StglClubRegisterVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/clubRegister/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询推荐社团列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listRecommendedClubs = (query?: StglClubRegisterQuery): AxiosPromise<StglClubRegisterVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/clubRegister/recommend',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询我的社团列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listMyClubs = (query?: StglClubRegisterQuery): AxiosPromise<StglClubRegisterVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/clubRegister/myClubs',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 申请加入社团
|
||||
* @param data
|
||||
*/
|
||||
export const applyJoinClub = (data: StglRegisterForm) => {
|
||||
return request({
|
||||
url: `/stgl/clubRegister/apply?clubId=${data.clubId}`,
|
||||
method: 'post',
|
||||
data: { reason: data.reason },
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 退出社团
|
||||
* @param clubId
|
||||
*/
|
||||
export const quitClub = (clubId: string | number) => {
|
||||
return request({
|
||||
url: '/stgl/clubRegister/quit/' + clubId,
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,261 @@
|
||||
export interface StglClubRegisterVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName: string;
|
||||
|
||||
/**
|
||||
* 社团类型
|
||||
*/
|
||||
clubType: string;
|
||||
|
||||
/**
|
||||
* 社团简介
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* logo图片路径
|
||||
*/
|
||||
logoUrl: string;
|
||||
|
||||
/**
|
||||
* 社长姓名
|
||||
*/
|
||||
presidentName: string;
|
||||
|
||||
/**
|
||||
* 指导老师姓名
|
||||
*/
|
||||
advisorName: string;
|
||||
|
||||
/**
|
||||
* 成员规模上限
|
||||
*/
|
||||
memberLimit: number;
|
||||
|
||||
/**
|
||||
* 当前成员数量
|
||||
*/
|
||||
currentMemberCount: number;
|
||||
|
||||
/**
|
||||
* 是否可报名
|
||||
*/
|
||||
canRegister: boolean;
|
||||
|
||||
/**
|
||||
* 招新周期
|
||||
*/
|
||||
recruitCycle: string;
|
||||
|
||||
/**
|
||||
* 招新时间
|
||||
*/
|
||||
recruitTime: string;
|
||||
|
||||
/**
|
||||
* 活动频率
|
||||
*/
|
||||
activityFrequency: string;
|
||||
|
||||
/**
|
||||
* 我在该社团的角色类型
|
||||
*/
|
||||
myRoleType?: number;
|
||||
|
||||
/**
|
||||
* 我加入该社团的时间
|
||||
*/
|
||||
myJoinTime?: string;
|
||||
|
||||
/**
|
||||
* 我在该社团的角色名称
|
||||
*/
|
||||
myRoleName?: string;
|
||||
|
||||
/**
|
||||
* 是否已报名/加入
|
||||
*/
|
||||
hasRegistered?: boolean;
|
||||
|
||||
// ========== 新增字段 ==========
|
||||
|
||||
/**
|
||||
* 成立日期
|
||||
*/
|
||||
establishDate?: string;
|
||||
|
||||
/**
|
||||
* 经费来源
|
||||
*/
|
||||
fundingSources?: string[];
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 社长院系
|
||||
*/
|
||||
presidentDept?: string;
|
||||
|
||||
/**
|
||||
* 社长专业
|
||||
*/
|
||||
presidentMajor?: string;
|
||||
|
||||
/**
|
||||
* 社长班级
|
||||
*/
|
||||
presidentClass?: string;
|
||||
|
||||
/**
|
||||
* 社长联系方式
|
||||
*/
|
||||
presidentPhone?: string;
|
||||
|
||||
/**
|
||||
* 社长学号
|
||||
*/
|
||||
presidentStudentNo?: string;
|
||||
|
||||
/**
|
||||
* 副社长姓名
|
||||
*/
|
||||
vicePresidentName?: string;
|
||||
|
||||
/**
|
||||
* 副社长院系
|
||||
*/
|
||||
vicePresidentDept?: string;
|
||||
|
||||
/**
|
||||
* 副社长专业
|
||||
*/
|
||||
vicePresidentMajor?: string;
|
||||
|
||||
/**
|
||||
* 副社长班级
|
||||
*/
|
||||
vicePresidentClass?: string;
|
||||
|
||||
/**
|
||||
* 副社长联系方式
|
||||
*/
|
||||
vicePresidentPhone?: string;
|
||||
|
||||
/**
|
||||
* 副社长学号
|
||||
*/
|
||||
vicePresidentStudentNo?: string;
|
||||
|
||||
/**
|
||||
* 副社长信息数组(支持多个副社长)
|
||||
*/
|
||||
vicePresidents?: Array<{
|
||||
name: string;
|
||||
dept?: string;
|
||||
major?: string;
|
||||
className?: string;
|
||||
phone?: string;
|
||||
studentNo?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* 指导老师部门
|
||||
*/
|
||||
advisorDept?: string;
|
||||
|
||||
/**
|
||||
* 指导老师电话
|
||||
*/
|
||||
advisorPhone?: string;
|
||||
|
||||
/**
|
||||
* 指导老师邮箱
|
||||
*/
|
||||
advisorEmail?: string;
|
||||
|
||||
/**
|
||||
* 指导老师信息数组(支持多个指导老师)
|
||||
*/
|
||||
advisors?: Array<{
|
||||
name: string;
|
||||
dept?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* 组织架构
|
||||
*/
|
||||
organizationStructure?: string;
|
||||
|
||||
/**
|
||||
* 部门信息(组织架构的另一种表示)
|
||||
*/
|
||||
departments?: string;
|
||||
|
||||
/**
|
||||
* 章程文件
|
||||
*/
|
||||
charterUrl?: string;
|
||||
constitutionFile?: string;
|
||||
constitutionFileUrl?: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 备注信息(另一种表示)
|
||||
*/
|
||||
remarks?: string;
|
||||
}
|
||||
|
||||
export interface StglClubRegisterQuery extends PageQuery {
|
||||
/**
|
||||
* 社团名称
|
||||
*/
|
||||
clubName?: string;
|
||||
|
||||
/**
|
||||
* 社团类型
|
||||
*/
|
||||
clubType?: string;
|
||||
|
||||
/**
|
||||
* 是否可报名
|
||||
*/
|
||||
canRegister?: boolean;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface StglRegisterForm {
|
||||
/**
|
||||
* 社团ID
|
||||
*/
|
||||
clubId: string | number;
|
||||
|
||||
/**
|
||||
* 申请理由
|
||||
*/
|
||||
reason?: string;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 统计相关API接口
|
||||
export function getStatisticsData() {
|
||||
return request({
|
||||
url: '/stgl/statistics/data',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
VolunteerMemberVO,
|
||||
VolunteerMemberForm,
|
||||
VolunteerMemberQuery,
|
||||
VolunteerTeamOption,
|
||||
VolunteerMemberStats,
|
||||
BatchAssignTeamForm
|
||||
} from '@/api/stgl/volunteermember/types';
|
||||
|
||||
/**
|
||||
* 查询志愿者成员列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listVolunteerMember = (query?: VolunteerMemberQuery): AxiosPromise<VolunteerMemberVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询志愿者成员详细
|
||||
* @param id
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getVolunteerMember = (id: string | number): AxiosPromise<VolunteerMemberVO> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/' + id,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增志愿者成员
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export const addVolunteerMember = (data: VolunteerMemberForm): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改志愿者成员
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export const updateVolunteerMember = (data: VolunteerMemberForm): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member',
|
||||
method: 'put',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除志愿者成员
|
||||
* @param ids
|
||||
* @returns {*}
|
||||
*/
|
||||
export const delVolunteerMember = (ids: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/' + ids,
|
||||
method: 'delete',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入志愿者成员
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export const importVolunteerMember = (data: FormData): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/importData',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出志愿者成员
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const exportVolunteerMember = (query?: VolunteerMemberQuery): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/export',
|
||||
method: 'post',
|
||||
params: query,
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据队伍ID查询成员
|
||||
* @param teamId
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getMembersByTeamId = (teamId: string | number): AxiosPromise<VolunteerMemberVO[]> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/team/' + teamId,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量分配队伍
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export const batchAssignTeam = (data: BatchAssignTeamForm): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/batchAdd',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取成员统计信息
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getVolunteerMemberStats = (): AxiosPromise<VolunteerMemberStats> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/stats',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
* @returns {*}
|
||||
*/
|
||||
export const downloadTemplate = (): AxiosPromise<Blob> => {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/importTemplate',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取志愿者团队选项列表
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getVolunteerTeamOptions = (): AxiosPromise<VolunteerTeamOption[]> => {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/options',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 审核志愿者成员申请
|
||||
* @param id 成员ID
|
||||
* @param approved 是否通过(true-通过,false-拒绝)
|
||||
* @returns {*}
|
||||
*/
|
||||
export const approveVolunteerMember = (id: string | number, approved: boolean): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: `/stgl/volunteer/member/approve/${id}?approved=${approved}`,
|
||||
method: 'put',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,275 @@
|
||||
export interface VolunteerMemberVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* 关联ID(志愿者队伍ID)
|
||||
*/
|
||||
relationId: string | number;
|
||||
|
||||
/**
|
||||
* 志愿者队伍名称
|
||||
*/
|
||||
relationName?: string;
|
||||
|
||||
/**
|
||||
* 成员角色(0队长 1队员)
|
||||
*/
|
||||
roleType: string;
|
||||
|
||||
/**
|
||||
* 加入时间
|
||||
*/
|
||||
joinTime: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy?: string | number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy?: string | number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface VolunteerMemberForm {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 院系
|
||||
*/
|
||||
department?: string;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
major?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 关联ID(志愿者队伍ID)
|
||||
*/
|
||||
relationId: string | number;
|
||||
|
||||
/**
|
||||
* 成员角色(0队长 1队员)
|
||||
*/
|
||||
roleType: string;
|
||||
|
||||
/**
|
||||
* 加入时间
|
||||
*/
|
||||
joinTime?: string;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface VolunteerMemberQuery {
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 页面大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 班级
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 关联ID(志愿者队伍ID)
|
||||
*/
|
||||
relationId?: string | number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
params?: {
|
||||
beginTime?: string;
|
||||
endTime?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface VolunteerTeamOption {
|
||||
/**
|
||||
* 团队ID
|
||||
*/
|
||||
value: string | number;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface VolunteerMemberStats {
|
||||
/**
|
||||
* 总成员数
|
||||
*/
|
||||
totalMembers: number;
|
||||
|
||||
/**
|
||||
* 活跃成员数
|
||||
*/
|
||||
activeMembers: number;
|
||||
|
||||
/**
|
||||
* 各团队成员分布
|
||||
*/
|
||||
teamDistribution: {
|
||||
teamName: string;
|
||||
memberCount: number;
|
||||
}[];
|
||||
|
||||
/**
|
||||
* 性别分布
|
||||
*/
|
||||
genderDistribution: {
|
||||
male: number;
|
||||
female: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BatchAssignTeamForm {
|
||||
/**
|
||||
* 成员ID列表
|
||||
*/
|
||||
memberIds: (string | number)[];
|
||||
|
||||
/**
|
||||
* 目标团队ID
|
||||
*/
|
||||
teamId: string | number;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 查询志愿者队伍列表(报名大厅专用)
|
||||
export function listVolunteerTeamForRegistration(query: any) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/registration/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询志愿者队伍列表(学生专用,新权限)
|
||||
export function listVolunteerTeamForStudentRegistration(query: any) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/registration/student/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询志愿者队伍详细信息(报名大厅专用)
|
||||
export function getVolunteerTeamDetail(id: number) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取志愿者队伍详细信息(学生报名大厅专用)
|
||||
export function getVolunteerRegistrationInfo(id: number) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/registration/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 申请加入志愿者队伍
|
||||
export function applyJoinVolunteerTeam(data: any) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/apply',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 查询我的志愿者申请记录
|
||||
export function getMyVolunteerApplications() {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/myApplications',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 撤销志愿者申请
|
||||
export function quitVolunteerApplication(applicationId: number) {
|
||||
return request({
|
||||
url: '/stgl/volunteer/member/quitApplication/' + applicationId,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 查询志愿者队伍列表
|
||||
export function listVolunteerTeam(query) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询志愿者队伍详细
|
||||
export function getVolunteerTeam(id) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 新增志愿者队伍
|
||||
export function addVolunteerTeam(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改志愿者队伍
|
||||
export function updateVolunteerTeam(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除志愿者队伍
|
||||
export function delVolunteerTeam(ids) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/' + ids,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 导出志愿者队伍
|
||||
export function exportVolunteerTeam(query) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 获取志愿者队伍可用选项
|
||||
export function getVolunteerTeamOptions() {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/options',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 我的队伍数据
|
||||
export function getMyVolunteerTeams() {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/my',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 待处理队伍
|
||||
export function getPendingVolunteerTeams() {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/pending',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 队伍规则检查
|
||||
export function checkVolunteerTeamRules(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/check',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 队伍审批
|
||||
export function approveVolunteerTeam(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/approve',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 启用队伍
|
||||
export function enableVolunteerTeam(ids) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/enable/' + ids,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 禁用队伍
|
||||
export function disableVolunteerTeam(ids) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/disable/' + ids,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取队伍统计信息
|
||||
export function getVolunteerTeamStats() {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/stats',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 批量操作
|
||||
export function batchVolunteerTeam(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/batch',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 申请加入志愿者队伍
|
||||
export function applyJoinVolunteerTeam(data) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/apply',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 根据姓名搜索学生信息(用于队长选择)
|
||||
export function searchStudentByName(name) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/searchStudentByName',
|
||||
method: 'get',
|
||||
params: { name }
|
||||
});
|
||||
}
|
||||
|
||||
// 根据学号获取学生详细信息(用于自动填充)
|
||||
export function getStudentByNo(studentNo) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/getStudentByNo',
|
||||
method: 'get',
|
||||
params: { studentNo }
|
||||
});
|
||||
}
|
||||
|
||||
// 根据姓名搜索指导老师信息
|
||||
export function searchTeacherByName(name) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/searchTeacherByName',
|
||||
method: 'get',
|
||||
params: { name }
|
||||
});
|
||||
}
|
||||
|
||||
// 根据用户ID获取教师详细信息(用于自动填充)
|
||||
export function getTeacherById(userId) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/getTeacherById',
|
||||
method: 'get',
|
||||
params: { userId }
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证当前用户是否为志愿者队伍队长
|
||||
* @param id 队伍ID
|
||||
*/
|
||||
export const checkTeamLeader = (id) => {
|
||||
return request({
|
||||
url: `/stgl/volunteerTeam/checkLeader/${id}`,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 志愿者队伍转让
|
||||
* @param id 队伍ID
|
||||
* @param newLeaderUserId 新队长用户ID
|
||||
*/
|
||||
export const transferVolunteerTeam = (id, newLeaderUserId) => {
|
||||
return request({
|
||||
url: `/stgl/volunteerTeam/transfer/${id}`,
|
||||
method: 'post',
|
||||
params: {
|
||||
newLeaderUserId: newLeaderUserId
|
||||
},
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查询志愿者队伍报名大厅列表(学生专用)
|
||||
export function listVolunteerTeamForRegistration(query) {
|
||||
return request({
|
||||
url: '/stgl/volunteerTeam/registration/student/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
@@ -58,7 +58,6 @@ export interface DormRoomVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormRoomForm extends BaseEntity {
|
||||
@@ -116,11 +115,9 @@ export interface DormRoomForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormRoomQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 房间编号
|
||||
*/
|
||||
@@ -166,11 +163,8 @@ export interface DormRoomQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ export interface DormManagerSourceVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerSourceForm extends BaseEntity {
|
||||
@@ -81,11 +80,9 @@ export interface DormManagerSourceForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerSourceQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@@ -116,11 +113,8 @@ export interface DormManagerSourceQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ export interface DormManagerBuildingVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerBuildingForm extends BaseEntity {
|
||||
@@ -61,11 +60,9 @@ export interface DormManagerBuildingForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerBuildingQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@@ -86,11 +83,8 @@ export interface DormManagerBuildingQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ export interface DormManagerVO {
|
||||
* 授权范围名称(逗号分隔的字符串)
|
||||
*/
|
||||
scopeNames?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerForm extends BaseEntity {
|
||||
@@ -106,11 +105,9 @@ export interface DormManagerForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormManagerQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
@@ -151,11 +148,8 @@ export interface DormManagerQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ export interface DormBuildingVO {
|
||||
floors: number;
|
||||
}
|
||||
|
||||
export interface DormBuildingForm extends Omit<DormBuildingVO, 'createTime' | 'createBy' | 'updateTime' | 'updateBy' | 'areaName' | 'campusName'> {
|
||||
}
|
||||
export interface DormBuildingForm extends Omit<DormBuildingVO, 'createTime' | 'createBy' | 'updateTime' | 'updateBy' | 'areaName' | 'campusName'> {}
|
||||
|
||||
export interface DormBuildingQuery {
|
||||
buildingCode?: string;
|
||||
@@ -45,6 +44,3 @@ export interface BuildingTreeSelectVo {
|
||||
floors?: number;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ export interface DormAreaVO {
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormAreaForm extends BaseEntity {
|
||||
@@ -61,11 +60,9 @@ export interface DormAreaForm extends BaseEntity {
|
||||
* 排序号
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface DormAreaQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 宿舍区编码
|
||||
*/
|
||||
@@ -81,10 +78,10 @@ export interface DormAreaQuery extends PageQuery {
|
||||
*/
|
||||
areaDescription?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,6 +99,3 @@ export interface TreeSelectVo {
|
||||
/** 子节点 */
|
||||
children?: TreeSelectVo[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ export interface DormCampusVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormCampusForm extends BaseEntity {
|
||||
@@ -61,11 +60,9 @@ export interface DormCampusForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface DormCampusQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
@@ -76,11 +73,8 @@ export interface DormCampusQuery extends PageQuery {
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ export function getMockDormTree(): { data: DormTreeNode[] } {
|
||||
}
|
||||
|
||||
// 生成房间数据的模拟数据
|
||||
export function getMockRooms(buildingId: string | number, floorNumber?: number): { rows: RoomInfo[], total: number } {
|
||||
export function getMockRooms(buildingId: string | number, floorNumber?: number): { rows: RoomInfo[]; total: number } {
|
||||
const rooms: RoomInfo[] = [];
|
||||
|
||||
// 根据buildingId判断楼层数
|
||||
@@ -233,7 +233,7 @@ export function getMockRooms(buildingId: string | number, floorNumber?: number):
|
||||
}
|
||||
|
||||
return {
|
||||
rows: rooms.filter(room => !floorNumber || room.floorNumber === floorNumber),
|
||||
rows: rooms.filter((room) => !floorNumber || room.floorNumber === floorNumber),
|
||||
total: rooms.length
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ export interface StuColBatchVO {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchForm extends BaseEntity {
|
||||
@@ -71,11 +70,9 @@ export interface StuColBatchForm extends BaseEntity {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
@@ -91,11 +88,8 @@ export interface StuColBatchQuery extends PageQuery {
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ export interface ClassMsgVO {
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClassMsgForm extends BaseEntity {
|
||||
@@ -291,11 +290,9 @@ export interface ClassMsgForm extends BaseEntity {
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClassMsgQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
@@ -326,11 +323,8 @@ export interface ClassMsgQuery extends PageQuery {
|
||||
*/
|
||||
classStatus?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ export interface StuColBatchClassVO {
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchClassForm extends BaseEntity {
|
||||
@@ -101,11 +100,9 @@ export interface StuColBatchClassForm extends BaseEntity {
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchClassQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@@ -146,11 +143,8 @@ export interface StuColBatchClassQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ export interface StuColBatchVO {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchForm extends BaseEntity {
|
||||
@@ -71,11 +70,9 @@ export interface StuColBatchForm extends BaseEntity {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
@@ -91,11 +88,8 @@ export interface StuColBatchQuery extends PageQuery {
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ export interface StuColBatchVO {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchForm extends BaseEntity {
|
||||
@@ -71,11 +70,9 @@ export interface StuColBatchForm extends BaseEntity {
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StuColBatchQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
@@ -91,11 +88,8 @@ export interface StuColBatchQuery extends PageQuery {
|
||||
*/
|
||||
collectionType?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StudentQuery, StudentVO, StudentForm, XgDeptTreeVO, R, TableDataInfo } from './types';
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门下拉树结构
|
||||
* @param deptId 部门ID
|
||||
@@ -32,7 +31,6 @@ export const XgDeptTreeSelect = (belongDeptId?: number): AxiosPromise<XgDeptTree
|
||||
// }) as any;
|
||||
};
|
||||
|
||||
|
||||
// 查询学生列表
|
||||
export function listStudent(query?: StudentQuery): AxiosPromise<R<TableDataInfo<StudentVO[]>>> {
|
||||
// 实际使用时连接后端接口
|
||||
@@ -56,11 +54,13 @@ export function listStudent(query?: StudentQuery): AxiosPromise<R<TableDataInfo<
|
||||
}
|
||||
|
||||
// 查询学生详细
|
||||
export function getStudent(studentId?: string | number): AxiosPromise<R<{
|
||||
student: StudentVO;
|
||||
majors: any[];
|
||||
classes: any[];
|
||||
}>> {
|
||||
export function getStudent(studentId?: string | number): AxiosPromise<
|
||||
R<{
|
||||
student: StudentVO;
|
||||
majors: any[];
|
||||
classes: any[];
|
||||
}>
|
||||
> {
|
||||
if (studentId) {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
@@ -69,7 +69,7 @@ export function getStudent(studentId?: string | number): AxiosPromise<R<{
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
const student = mockStudentData.find(item => item.studentId === studentId);
|
||||
const student = mockStudentData.find((item) => item.studentId === studentId);
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
@@ -435,4 +435,14 @@ const mockClasses = [
|
||||
}
|
||||
];
|
||||
|
||||
export default { listStudent, getStudent, addStudent, updateStudent, delStudent, deptTreeSelect, exportStudent, changeStudentStatus, XgDeptTreeSelect };
|
||||
export default {
|
||||
listStudent,
|
||||
getStudent,
|
||||
addStudent,
|
||||
updateStudent,
|
||||
delStudent,
|
||||
deptTreeSelect,
|
||||
exportStudent,
|
||||
changeStudentStatus,
|
||||
XgDeptTreeSelect
|
||||
};
|
||||
@@ -45,7 +45,7 @@ export interface StudentMsgVO {
|
||||
birthDate: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality: string;
|
||||
|
||||
@@ -140,7 +140,7 @@ export interface StudentMsgVO {
|
||||
wechat: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus: string;
|
||||
|
||||
@@ -518,7 +518,6 @@ export interface StudentMsgVO {
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentMsgForm extends BaseEntity {
|
||||
@@ -568,7 +567,7 @@ export interface StudentMsgForm extends BaseEntity {
|
||||
birthDate?: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality?: string;
|
||||
|
||||
@@ -663,7 +662,7 @@ export interface StudentMsgForm extends BaseEntity {
|
||||
wechat?: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus?: string;
|
||||
|
||||
@@ -1041,11 +1040,9 @@ export interface StudentMsgForm extends BaseEntity {
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentMsgQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -1087,7 +1084,7 @@ export interface StudentMsgQuery extends PageQuery {
|
||||
birthDate?: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality?: string;
|
||||
|
||||
@@ -1182,7 +1179,7 @@ export interface StudentMsgQuery extends PageQuery {
|
||||
wechat?: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus?: string;
|
||||
|
||||
@@ -1556,11 +1553,8 @@ export interface StudentMsgQuery extends PageQuery {
|
||||
*/
|
||||
extField5?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface StudentMsgBatchVO {
|
||||
birthDate: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality: string;
|
||||
|
||||
@@ -140,7 +140,7 @@ export interface StudentMsgBatchVO {
|
||||
wechat: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus: string;
|
||||
|
||||
@@ -523,7 +523,6 @@ export interface StudentMsgBatchVO {
|
||||
* 正在进行中的批次id
|
||||
*/
|
||||
batchId: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentMsgBatchForm extends BaseEntity {
|
||||
@@ -573,7 +572,7 @@ export interface StudentMsgBatchForm extends BaseEntity {
|
||||
birthDate?: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality?: string;
|
||||
|
||||
@@ -668,7 +667,7 @@ export interface StudentMsgBatchForm extends BaseEntity {
|
||||
wechat?: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus?: string;
|
||||
|
||||
@@ -1051,11 +1050,9 @@ export interface StudentMsgBatchForm extends BaseEntity {
|
||||
* 正在进行中的批次id
|
||||
*/
|
||||
batchId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentMsgBatchQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -1097,7 +1094,7 @@ export interface StudentMsgBatchQuery extends PageQuery {
|
||||
birthDate?: string;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
nationality?: string;
|
||||
|
||||
@@ -1192,7 +1189,7 @@ export interface StudentMsgBatchQuery extends PageQuery {
|
||||
wechat?: string;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
maritalStatus?: string;
|
||||
|
||||
@@ -1571,11 +1568,8 @@ export interface StudentMsgBatchQuery extends PageQuery {
|
||||
*/
|
||||
batchId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ export interface XgClassPosDictVO {
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface XgClassPosDictForm extends BaseEntity {
|
||||
@@ -111,11 +110,9 @@ export interface XgClassPosDictForm extends BaseEntity {
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface XgClassPosDictQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -161,11 +158,8 @@ export interface XgClassPosDictQuery extends PageQuery {
|
||||
*/
|
||||
sortOrder?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ export interface XgClassPosMsgVO {
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface XgClassPosMsgForm extends BaseEntity {
|
||||
@@ -246,11 +245,9 @@ export interface XgClassPosMsgForm extends BaseEntity {
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface XgClassPosMsgQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -336,11 +333,8 @@ export interface XgClassPosMsgQuery extends PageQuery {
|
||||
*/
|
||||
deptId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ export interface XgLeaveTypeConfigVO {
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
cancelOverdueReminder: number;
|
||||
|
||||
}
|
||||
|
||||
export interface XgLeaveTypeConfigForm extends BaseEntity {
|
||||
@@ -131,11 +130,9 @@ export interface XgLeaveTypeConfigForm extends BaseEntity {
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
cancelOverdueReminder?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface XgLeaveTypeConfigQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -156,11 +153,8 @@ export interface XgLeaveTypeConfigQuery extends PageQuery {
|
||||
*/
|
||||
isEnabled?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ export interface StudentManagerVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentManagerForm extends BaseEntity {
|
||||
@@ -101,11 +100,9 @@ export interface StudentManagerForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentManagerQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员姓名
|
||||
*/
|
||||
@@ -146,11 +143,8 @@ export interface StudentManagerQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StudentManagerSourceVO, StudentManagerSourceForm, StudentManagerSourceQuery } from '@/api/xg/xsjcxx/xgStudentManagerSource/studentManagerSource/types';
|
||||
import {
|
||||
StudentManagerSourceVO,
|
||||
StudentManagerSourceForm,
|
||||
StudentManagerSourceQuery
|
||||
} from '@/api/xg/xsjcxx/xgStudentManagerSource/studentManagerSource/types';
|
||||
|
||||
/**
|
||||
* 查询学生管理员授权关系列表
|
||||
|
||||
@@ -38,7 +38,6 @@ export interface StudentManagerSourceVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentManagerSourceForm extends BaseEntity {
|
||||
@@ -81,11 +80,9 @@ export interface StudentManagerSourceForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentManagerSourceQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 管理员ID
|
||||
*/
|
||||
@@ -116,11 +113,8 @@ export interface StudentManagerSourceQuery extends PageQuery {
|
||||
*/
|
||||
deleted?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
XljkConsultationScheduleVO,
|
||||
XljkConsultationScheduleForm,
|
||||
@@ -14,44 +15,44 @@ import {
|
||||
// ===== 预约时段管理 API =====
|
||||
|
||||
// 查询预约时段列表
|
||||
export const listSchedule = (query: XljkConsultationScheduleQuery) => {
|
||||
export const listXljkSchedule = (query: XljkConsultationScheduleQuery): AxiosPromise<XljkConsultationScheduleVO[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/schedule/list',
|
||||
url: '/xljk/consultation/schedule/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询预约时段详细信息
|
||||
export const getSchedule = (id: string | number) => {
|
||||
export const getXljkSchedule = (id: string | number): AxiosPromise<XljkConsultationScheduleVO> => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/schedule/${id}`,
|
||||
url: `/xljk/consultation/schedule/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 新增预约时段
|
||||
export const addSchedule = (data: any) => {
|
||||
export const addXljkSchedule = (data: any) => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/schedule',
|
||||
url: '/xljk/consultation/schedule',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改预约时段
|
||||
export const updateSchedule = (data: XljkConsultationScheduleForm) => {
|
||||
export const updateXljkSchedule = (data: XljkConsultationScheduleForm) => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/schedule',
|
||||
url: '/xljk/consultation/schedule',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除预约时段
|
||||
export const delSchedule = (ids: string | number | Array<string | number>) => {
|
||||
export const delXljkSchedule = (ids: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/schedule/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
url: `/xljk/consultation/schedule/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -59,59 +60,59 @@ export const delSchedule = (ids: string | number | Array<string | number>) => {
|
||||
// ===== 预约记录管理 API =====
|
||||
|
||||
// 查询预约记录列表
|
||||
export const listAppointment = (query: XljkConsultationAppointmentQuery) => {
|
||||
export const listXljkAppointment = (query: XljkConsultationAppointmentQuery): AxiosPromise<XljkConsultationAppointmentVO[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/list',
|
||||
url: '/xljk/consultation/appointment/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询预约记录详细信息
|
||||
export const getAppointment = (id: string | number) => {
|
||||
export const getXljkAppointment = (id: string | number): AxiosPromise<XljkConsultationAppointmentVO> => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/appointment/${id}`,
|
||||
url: `/xljk/consultation/appointment/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 修改预约记录
|
||||
export const updateAppointment = (data: XljkConsultationAppointmentForm) => {
|
||||
export const updateXljkAppointment = (data: XljkConsultationAppointmentForm) => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment',
|
||||
url: '/xljk/consultation/appointment',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除预约记录
|
||||
export const delAppointment = (ids: string | number | Array<string | number>) => {
|
||||
export const delXljkAppointment = (ids: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/appointment/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
url: `/xljk/consultation/appointment/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取可预约时段列表(用于日历视图)
|
||||
export const getAvailableTimeSlots = (startDate: string, endDate: string) => {
|
||||
export const getXljkAvailableTimeSlots = (startDate: string, endDate: string): AxiosPromise<AvailableTimeSlot[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/available-slots',
|
||||
url: '/xljk/consultation/appointment/available-slots',
|
||||
method: 'get',
|
||||
params: { startDate, endDate }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取可用的详细时段列表(30分钟一个时段)
|
||||
export const getAvailableDetailSlots = (date: string, timeSlot: string) => {
|
||||
export const getXljkAvailableDetailSlots = (date: string, timeSlot: string): AxiosPromise<TimeSlotDetail[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/available-detail-slots',
|
||||
url: '/xljk/consultation/appointment/available-detail-slots',
|
||||
method: 'get',
|
||||
params: { date, timeSlot }
|
||||
});
|
||||
};
|
||||
|
||||
// 学生提交预约
|
||||
export const submitAppointment = async (data: XljkConsultationAppointmentForm) => {
|
||||
export const submitXljkAppointment = async (data: XljkConsultationAppointmentForm) => {
|
||||
// 检查是否被限制预约
|
||||
try {
|
||||
const { checkLimitation } = await import('./noshow');
|
||||
@@ -129,27 +130,27 @@ export const submitAppointment = async (data: XljkConsultationAppointmentForm) =
|
||||
console.error('检查预约限制失败', error);
|
||||
// 检查失败不阻止预约,继续提交
|
||||
}
|
||||
|
||||
|
||||
// 提交预约申请
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/submit',
|
||||
url: '/xljk/consultation/appointment/submit',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 获取我的预约记录(学生用)
|
||||
export const getMyAppointments = (studentId: string | number, forceRefresh: boolean = false) => {
|
||||
let url = `/api/xljk/consultation/appointment/my-appointments/${studentId}`;
|
||||
|
||||
export const getXljkMyAppointments = (studentId: string | number, forceRefresh: boolean = false): AxiosPromise<XljkConsultationAppointmentVO[]> => {
|
||||
let url = `/xljk/consultation/appointment/my-appointments/${studentId}`;
|
||||
|
||||
// 强制添加时间戳参数,确保绕过浏览器缓存
|
||||
url += `?_t=${new Date().getTime()}`;
|
||||
|
||||
|
||||
// 如果需要额外强制刷新(如用户手动点击刷新按钮)
|
||||
if (forceRefresh) {
|
||||
url += `&force=true`;
|
||||
}
|
||||
|
||||
|
||||
return request({
|
||||
url,
|
||||
method: 'get',
|
||||
@@ -163,52 +164,52 @@ export const getMyAppointments = (studentId: string | number, forceRefresh: bool
|
||||
};
|
||||
|
||||
// 记录咨询结果
|
||||
export const recordConsultation = (id: string | number, data: any) => {
|
||||
export const recordXljkConsultation = (id: string | number, data: any) => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/appointment/record-consultation/${id}`,
|
||||
url: `/xljk/consultation/appointment/record-consultation/${id}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 获取咨询师选项
|
||||
export const getCounselorOptions = () => {
|
||||
export const getXljkCounselorOptions = (): AxiosPromise<CounselorOption[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/schedule/options/counselors',
|
||||
url: '/xljk/consultation/schedule/options/counselors',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取学生信息(通过学号)
|
||||
export const getStudentByNo = (studentNo: string) => {
|
||||
export const getXljkStudentByNo = (studentNo: string): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/student/${studentNo}`,
|
||||
url: `/xljk/consultation/student/${studentNo}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取院系选项
|
||||
export const getCollegeOptions = () => {
|
||||
export const getXljkConsultationCollegeOptions = (): AxiosPromise<Array<{ value: string; label: string }>> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/options/colleges',
|
||||
url: '/xljk/consultation/appointment/options/colleges',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取专业选项
|
||||
export const getMajorOptions = (collegeName?: string) => {
|
||||
export const getXljkConsultationMajorOptions = (collegeName?: string): AxiosPromise<Array<{ value: string; label: string }>> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/options/majors',
|
||||
url: '/xljk/consultation/appointment/options/majors',
|
||||
method: 'get',
|
||||
params: { collegeName }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取班级选项
|
||||
export const getClassOptions = (collegeName?: string, majorName?: string) => {
|
||||
export const getXljkConsultationClassOptions = (collegeName?: string, majorName?: string): AxiosPromise<Array<{ value: string; label: string }>> => {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/appointment/options/classes',
|
||||
url: '/xljk/consultation/appointment/options/classes',
|
||||
method: 'get',
|
||||
params: { collegeName, majorName }
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -9,14 +9,14 @@ import { NoShowQuery, NoShowVO } from './types';
|
||||
export function listNoShow(query: NoShowQuery) {
|
||||
// 创建一个新的查询对象,避免修改原始对象
|
||||
const params = { ...query };
|
||||
|
||||
|
||||
// 如果状态是'all',表示"全部",则从参数中移除
|
||||
if (params.status === 'all') {
|
||||
delete params.status;
|
||||
}
|
||||
|
||||
|
||||
return request({
|
||||
url: '/api/xljk/consultation/no-show/list',
|
||||
url: '/xljk/consultation/no-show/list',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
@@ -29,7 +29,7 @@ export function listNoShow(query: NoShowQuery) {
|
||||
*/
|
||||
export function getNoShow(id: string | number) {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/no-show/${id}`,
|
||||
url: `/xljk/consultation/no-show/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -41,7 +41,7 @@ export function getNoShow(id: string | number) {
|
||||
*/
|
||||
export function releaseNoShowLimitation(id: string | number) {
|
||||
return request({
|
||||
url: `/api/xljk/consultation/no-show/${id}/release`,
|
||||
url: `/xljk/consultation/no-show/${id}/release`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
@@ -53,8 +53,8 @@ export function releaseNoShowLimitation(id: string | number) {
|
||||
*/
|
||||
export function checkLimitation(studentId: string | number) {
|
||||
return request({
|
||||
url: '/api/xljk/consultation/no-show/check-limitation',
|
||||
url: '/xljk/consultation/no-show/check-limitation',
|
||||
method: 'get',
|
||||
params: { studentId }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -556,17 +556,17 @@ export interface NoShowVO {
|
||||
* 咨询师名称
|
||||
*/
|
||||
counselorName?: string;
|
||||
|
||||
|
||||
/**
|
||||
* 预约日期
|
||||
*/
|
||||
appointmentDate?: string;
|
||||
|
||||
|
||||
/**
|
||||
* 预约时段
|
||||
*/
|
||||
appointmentDetailTime?: string;
|
||||
|
||||
|
||||
/**
|
||||
* 咨询原因
|
||||
*/
|
||||
@@ -601,4 +601,4 @@ export interface NoShowVO {
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
XljkEvaluationVO,
|
||||
XljkEvaluationForm,
|
||||
@@ -13,179 +14,179 @@ import {
|
||||
} from './types';
|
||||
|
||||
// 查询心理健康测评列表
|
||||
export const listEvaluation = (query: XljkEvaluationQuery) => {
|
||||
export const listXljkEvaluation = (query: XljkEvaluationQuery): AxiosPromise<XljkEvaluationVO[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/list',
|
||||
url: '/xljk/evaluation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询心理健康测评详细信息
|
||||
export const getEvaluation = (id: string | number) => {
|
||||
export const getXljkEvaluation = (id: string | number): AxiosPromise<XljkEvaluationVO> => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/${id}`,
|
||||
url: `/xljk/evaluation/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 新增心理健康测评
|
||||
export const addEvaluation = (data: XljkEvaluationForm) => {
|
||||
export const addXljkEvaluation = (data: XljkEvaluationForm) => {
|
||||
// 确保必填字段都有值,避免数据库插入错误
|
||||
if (data.departmentName && !data.departmentId) {
|
||||
data.departmentId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
|
||||
if (data.majorName && !data.majorId) {
|
||||
data.majorId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
|
||||
if (data.className && !data.classId) {
|
||||
data.classId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
|
||||
return request({
|
||||
url: '/api/xljk/evaluation',
|
||||
url: '/xljk/evaluation',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改心理健康测评
|
||||
export const updateEvaluation = (data: XljkEvaluationForm) => {
|
||||
export const updateXljkEvaluation = (data: XljkEvaluationForm) => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation',
|
||||
url: '/xljk/evaluation',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除心理健康测评
|
||||
export const delEvaluation = (ids: string | number | Array<string | number>) => {
|
||||
export const delXljkEvaluation = (ids: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
url: `/xljk/evaluation/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取院系选项
|
||||
export const getDepartmentOptions = () => {
|
||||
export const getXljkDepartmentOptions = (): AxiosPromise<Array<{ value: string | number; label: string }>> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/options/department',
|
||||
url: '/xljk/evaluation/options/department',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取院系选项(新接口)
|
||||
export const getCollegeOptions = () => {
|
||||
export const getXljkCollegeOptions = (): AxiosPromise<CollegeOption[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/options/colleges',
|
||||
url: '/xljk/evaluation/options/colleges',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取专业选项
|
||||
export const getMajorOptions = (collegeName?: string) => {
|
||||
export const getXljkMajorOptions = (collegeName?: string): AxiosPromise<MajorOption[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/options/majors',
|
||||
url: '/xljk/evaluation/options/majors',
|
||||
method: 'get',
|
||||
params: { collegeName }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取班级选项
|
||||
export const getClassOptions = (collegeName?: string, majorName?: string) => {
|
||||
export const getXljkClassOptions = (collegeName?: string, majorName?: string): AxiosPromise<ClassOption[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/options/classes',
|
||||
url: '/xljk/evaluation/options/classes',
|
||||
method: 'get',
|
||||
params: { collegeName, majorName }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取班级学生列表
|
||||
export const getStudentsByClass = (collegeName?: string, majorName?: string, className?: string) => {
|
||||
export const getXljkStudentsByClass = (collegeName?: string, majorName?: string, className?: string): AxiosPromise<StudentInfo[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/students',
|
||||
url: '/xljk/evaluation/students',
|
||||
method: 'get',
|
||||
params: { collegeName, majorName, className }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取学期选项
|
||||
export const getSemesterOptions = () => {
|
||||
export const getXljkSemesterOptions = (): AxiosPromise<Array<{ value: string; label: string }>> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/options/semester',
|
||||
url: '/xljk/evaluation/options/semester',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 发布测评(已废弃,改为提交功能)
|
||||
export const publishEvaluation = (id: string | number) => {
|
||||
export const publishXljkEvaluation = (id: string | number) => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/${id}/publish`,
|
||||
url: `/xljk/evaluation/${id}/publish`,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 提交测评
|
||||
export const completeEvaluation = (id: string | number) => {
|
||||
export const completeXljkEvaluation = (id: string | number) => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/${id}/complete`,
|
||||
url: `/xljk/evaluation/${id}/complete`,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取测评统计数据
|
||||
export const getEvaluationStatistics = (id: string | number) => {
|
||||
export const getXljkEvaluationStatistics = (id: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/${id}/statistics`,
|
||||
url: `/xljk/evaluation/${id}/statistics`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取重点关注学生统计
|
||||
export const getFocusStudentsStatistics = (query: XljkEvaluationQuery) => {
|
||||
export const getXljkFocusStudentsStatistics = (query: XljkEvaluationQuery): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/statistics/focus',
|
||||
url: '/xljk/evaluation/statistics/focus',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询测评明细列表
|
||||
export const listEvaluationDetail = (query: XljkEvaluationDetailQuery) => {
|
||||
export const listXljkEvaluationDetail = (query: XljkEvaluationDetailQuery): AxiosPromise<XljkEvaluationDetailVO[]> => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/detail/list',
|
||||
url: '/xljk/evaluation/detail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取测评明细列表
|
||||
export const getEvaluationDetailsByEvaluationId = (evaluationId: string | number) => {
|
||||
export const getXljkEvaluationDetailsByEvaluationId = (evaluationId: string | number): AxiosPromise<XljkEvaluationDetailVO[]> => {
|
||||
return request({
|
||||
url: `/api/xljk/evaluation/detail/evaluation/${evaluationId}`,
|
||||
url: `/xljk/evaluation/detail/evaluation/${evaluationId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 批量新增测评明细
|
||||
export const batchAddEvaluationDetails = (data: XljkEvaluationDetailForm[]) => {
|
||||
export const batchAddXljkEvaluationDetails = (data: XljkEvaluationDetailForm[]) => {
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/detail/batch',
|
||||
url: '/xljk/evaluation/detail/batch',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 批量更新学生心理状态
|
||||
export const batchUpdateMentalStatus = (data: XljkEvaluationDetailForm[]) => {
|
||||
export const batchUpdateXljkMentalStatus = (data: XljkEvaluationDetailForm[]) => {
|
||||
// 确保数据中的ID字段保持原有格式,不做Number转换
|
||||
console.log('批量更新数据 - 第一条记录evaluationId:', data[0]?.evaluationId);
|
||||
|
||||
|
||||
return request({
|
||||
url: '/api/xljk/evaluation/detail/batch/mentalStatus',
|
||||
url: '/xljk/evaluation/detail/batch/mentalStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -198,6 +198,16 @@ export interface XljkEvaluationQuery extends PageQuery {
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
orderByColumn?: string;
|
||||
|
||||
/**
|
||||
* 排序方式(asc/desc)
|
||||
*/
|
||||
isAsc?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
@@ -525,4 +535,4 @@ export interface EvaluationStatistics {
|
||||
* 重点关注学生百分比
|
||||
*/
|
||||
focusPercent: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* 心理健康模块 API 接口入口
|
||||
*
|
||||
* 统一导出心理健康测评和心理咨询预约相关的API接口和类型定义
|
||||
* 与后勤管理模块保持一致的导出方式
|
||||
*/
|
||||
|
||||
// ===== 心理健康测评相关接口 =====
|
||||
export {
|
||||
// 测评管理
|
||||
listXljkEvaluation,
|
||||
getXljkEvaluation,
|
||||
addXljkEvaluation,
|
||||
updateXljkEvaluation,
|
||||
delXljkEvaluation,
|
||||
|
||||
// 选项获取
|
||||
getXljkDepartmentOptions,
|
||||
getXljkCollegeOptions,
|
||||
getXljkMajorOptions,
|
||||
getXljkClassOptions,
|
||||
getXljkStudentsByClass,
|
||||
getXljkSemesterOptions,
|
||||
|
||||
// 测评操作
|
||||
publishXljkEvaluation,
|
||||
completeXljkEvaluation,
|
||||
getXljkEvaluationStatistics,
|
||||
getXljkFocusStudentsStatistics,
|
||||
|
||||
// 测评明细
|
||||
listXljkEvaluationDetail,
|
||||
getXljkEvaluationDetailsByEvaluationId,
|
||||
batchAddXljkEvaluationDetails,
|
||||
batchUpdateXljkMentalStatus
|
||||
} from './evaluation';
|
||||
|
||||
// ===== 心理咨询预约相关接口 =====
|
||||
export {
|
||||
// 预约时段管理
|
||||
listXljkSchedule,
|
||||
getXljkSchedule,
|
||||
addXljkSchedule,
|
||||
updateXljkSchedule,
|
||||
delXljkSchedule,
|
||||
|
||||
// 预约记录管理
|
||||
listXljkAppointment,
|
||||
getXljkAppointment,
|
||||
updateXljkAppointment,
|
||||
delXljkAppointment,
|
||||
|
||||
// 预约相关操作
|
||||
getXljkAvailableTimeSlots,
|
||||
getXljkAvailableDetailSlots,
|
||||
submitXljkAppointment,
|
||||
getXljkMyAppointments,
|
||||
recordXljkConsultation,
|
||||
|
||||
// 选项获取
|
||||
getXljkCounselorOptions,
|
||||
getXljkStudentByNo,
|
||||
getXljkConsultationCollegeOptions,
|
||||
getXljkConsultationMajorOptions,
|
||||
getXljkConsultationClassOptions
|
||||
} from './consultation';
|
||||
|
||||
// ===== 类型定义导出 =====
|
||||
|
||||
// 心理健康测评类型
|
||||
export type {
|
||||
XljkEvaluationVO,
|
||||
XljkEvaluationForm,
|
||||
XljkEvaluationQuery,
|
||||
XljkEvaluationDetailVO,
|
||||
XljkEvaluationDetailForm,
|
||||
XljkEvaluationDetailQuery,
|
||||
CollegeOption,
|
||||
MajorOption,
|
||||
ClassOption,
|
||||
StudentInfo
|
||||
} from './evaluation/types';
|
||||
|
||||
// 心理咨询预约类型
|
||||
export type {
|
||||
XljkConsultationScheduleVO,
|
||||
XljkConsultationScheduleForm,
|
||||
XljkConsultationScheduleQuery,
|
||||
XljkConsultationAppointmentVO,
|
||||
XljkConsultationAppointmentForm,
|
||||
XljkConsultationAppointmentQuery,
|
||||
AvailableTimeSlot,
|
||||
TimeSlotDetail,
|
||||
CounselorOption
|
||||
} from './consultation/types';
|
||||
@@ -58,7 +58,7 @@ export const updateEnrollmentInfo = (data: EnrollmentInfoForm) => {
|
||||
export const updateEnrollmentStatus = (id: string | number | Array<string | number>, status: string) => {
|
||||
const data = Array.isArray(id)
|
||||
? { ids: id, status } // 批量更新
|
||||
: { id, status }; // 单个更新
|
||||
: { id, status }; // 单个更新
|
||||
|
||||
return request({
|
||||
url: '/zsjy/enrollment/info/updateStatus',
|
||||
@@ -132,7 +132,7 @@ export const submitEnrollmentApplication = (data: EnrollmentInfoForm) => {
|
||||
* 查询我的报名状态(供学生端使用)
|
||||
* @param params 查询参数
|
||||
*/
|
||||
export const queryMyEnrollmentStatus = (params: { idCard?: string, examNumber?: string }): AxiosPromise<EnrollmentInfoVO> => {
|
||||
export const queryMyEnrollmentStatus = (params: { idCard?: string; examNumber?: string }): AxiosPromise<EnrollmentInfoVO> => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/info/myStatus',
|
||||
method: 'get',
|
||||
|
||||
@@ -1,365 +1,365 @@
|
||||
import request from '@/utils/request'
|
||||
import { AxiosPromise } from 'axios'
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
export interface EnrollmentProcessVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 报名信息ID,关联zsjy_enrollment_info.id
|
||||
*/
|
||||
enrollmentId: number
|
||||
enrollmentId: number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
idCard: string
|
||||
idCard: string;
|
||||
|
||||
/**
|
||||
* 当前状态(0-待审核 1-信息审核中 2-录取处理中 3-待最终确认 4-录取完成 9-已驳回)
|
||||
*/
|
||||
currentStatus: string
|
||||
currentStatus: string;
|
||||
|
||||
/**
|
||||
* 当前处理人ID
|
||||
*/
|
||||
currentHandler: number
|
||||
currentHandler: number;
|
||||
|
||||
/**
|
||||
* 当前处理人姓名
|
||||
*/
|
||||
currentHandlerName: string
|
||||
currentHandlerName: string;
|
||||
|
||||
/**
|
||||
* 信息审核状态(0-待审核 1-审核通过 9-审核驳回)
|
||||
*/
|
||||
infoAuditStatus: string
|
||||
infoAuditStatus: string;
|
||||
|
||||
/**
|
||||
* 信息审核人ID
|
||||
*/
|
||||
infoAuditUser: number
|
||||
infoAuditUser: number;
|
||||
|
||||
/**
|
||||
* 信息审核人姓名
|
||||
*/
|
||||
infoAuditUserName: string
|
||||
infoAuditUserName: string;
|
||||
|
||||
/**
|
||||
* 信息审核时间
|
||||
*/
|
||||
infoAuditTime: string
|
||||
infoAuditTime: string;
|
||||
|
||||
/**
|
||||
* 信息审核意见
|
||||
*/
|
||||
infoAuditOpinion: string
|
||||
infoAuditOpinion: string;
|
||||
|
||||
/**
|
||||
* 录取处理状态(0-待处理 1-处理完成 9-处理驳回)
|
||||
*/
|
||||
admissionStatus: string
|
||||
admissionStatus: string;
|
||||
|
||||
/**
|
||||
* 录取处理人ID
|
||||
*/
|
||||
admissionUser: number
|
||||
admissionUser: number;
|
||||
|
||||
/**
|
||||
* 录取处理人姓名
|
||||
*/
|
||||
admissionUserName: string
|
||||
admissionUserName: string;
|
||||
|
||||
/**
|
||||
* 录取处理时间
|
||||
*/
|
||||
admissionTime: string
|
||||
admissionTime: string;
|
||||
|
||||
/**
|
||||
* 缴费状态(0-未缴费 1-已缴费)
|
||||
*/
|
||||
paymentStatus: string
|
||||
paymentStatus: string;
|
||||
|
||||
/**
|
||||
* 缴费确认时间
|
||||
*/
|
||||
paymentConfirmTime: string
|
||||
paymentConfirmTime: string;
|
||||
|
||||
/**
|
||||
* 录取通知书号码
|
||||
*/
|
||||
noticeNumber: string
|
||||
noticeNumber: string;
|
||||
|
||||
/**
|
||||
* 录取处理意见
|
||||
*/
|
||||
admissionOpinion: string
|
||||
admissionOpinion: string;
|
||||
|
||||
/**
|
||||
* 最终审核状态(0-待确认 1-确认通过 9-确认驳回)
|
||||
*/
|
||||
finalAuditStatus: string
|
||||
finalAuditStatus: string;
|
||||
|
||||
/**
|
||||
* 最终审核人ID
|
||||
*/
|
||||
finalAuditUser: number
|
||||
finalAuditUser: number;
|
||||
|
||||
/**
|
||||
* 最终审核人姓名
|
||||
*/
|
||||
finalAuditUserName: string
|
||||
finalAuditUserName: string;
|
||||
|
||||
/**
|
||||
* 最终审核时间
|
||||
*/
|
||||
finalAuditTime: string
|
||||
finalAuditTime: string;
|
||||
|
||||
/**
|
||||
* 最终审核意见
|
||||
*/
|
||||
finalAuditOpinion: string
|
||||
finalAuditOpinion: string;
|
||||
|
||||
/**
|
||||
* 是否完成录取(0-未完成 1-已完成)
|
||||
*/
|
||||
isCompleted: number
|
||||
isCompleted: number;
|
||||
|
||||
/**
|
||||
* 录取完成时间
|
||||
*/
|
||||
completionTime: string
|
||||
completionTime: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string
|
||||
updateTime: string;
|
||||
|
||||
/**
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
gender?: string
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 地区/省份
|
||||
*/
|
||||
province?: string
|
||||
province?: string;
|
||||
|
||||
/**
|
||||
* 学院名称(驼峰命名)
|
||||
*/
|
||||
collegeName?: string
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 学院代码(驼峰命名)
|
||||
*/
|
||||
collegeId?: string
|
||||
collegeId?: string;
|
||||
|
||||
/**
|
||||
* 学院名称(下划线命名)
|
||||
*/
|
||||
college_name?: string
|
||||
college_name?: string;
|
||||
|
||||
/**
|
||||
* 学院代码(下划线命名)
|
||||
*/
|
||||
college_id?: string
|
||||
college_id?: string;
|
||||
|
||||
/**
|
||||
* 学院名称(拼写变体 - collage)
|
||||
*/
|
||||
collage_name?: string
|
||||
collage_name?: string;
|
||||
|
||||
/**
|
||||
* 学院代码(拼写变体 - collage)
|
||||
*/
|
||||
collage_id?: string
|
||||
collage_id?: string;
|
||||
|
||||
/**
|
||||
* 专业名称(驼峰命名)
|
||||
*/
|
||||
majorName?: string
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 专业代码(驼峰命名)
|
||||
*/
|
||||
majorCode?: string
|
||||
majorCode?: string;
|
||||
|
||||
/**
|
||||
* 专业名称(下划线命名)
|
||||
*/
|
||||
major_name?: string
|
||||
major_name?: string;
|
||||
|
||||
/**
|
||||
* 专业代码(下划线命名)
|
||||
*/
|
||||
major_code?: string
|
||||
major_code?: string;
|
||||
|
||||
/**
|
||||
* 报考专业(来自报名信息表)
|
||||
*/
|
||||
appliedMajor?: string
|
||||
appliedMajor?: string;
|
||||
|
||||
/**
|
||||
* 关联的报名信息对象
|
||||
*/
|
||||
enrollmentInfo?: any
|
||||
enrollmentInfo?: any;
|
||||
}
|
||||
|
||||
export interface EnrollmentProcessForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 报名信息ID,关联zsjy_enrollment_info.id
|
||||
*/
|
||||
enrollmentId?: number
|
||||
enrollmentId?: number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
idCard?: string
|
||||
idCard?: string;
|
||||
|
||||
/**
|
||||
* 当前状态(0-待审核 1-信息审核中 2-录取处理中 3-待最终确认 4-录取完成 9-已驳回)
|
||||
*/
|
||||
currentStatus?: string
|
||||
currentStatus?: string;
|
||||
|
||||
/**
|
||||
* 当前处理人ID
|
||||
*/
|
||||
currentHandler?: number
|
||||
currentHandler?: number;
|
||||
|
||||
/**
|
||||
* 当前处理人姓名
|
||||
*/
|
||||
currentHandlerName?: string
|
||||
currentHandlerName?: string;
|
||||
|
||||
/**
|
||||
* 信息审核状态(0-待审核 1-审核通过 9-审核驳回)
|
||||
*/
|
||||
infoAuditStatus?: string
|
||||
infoAuditStatus?: string;
|
||||
|
||||
/**
|
||||
* 信息审核意见
|
||||
*/
|
||||
infoAuditOpinion?: string
|
||||
infoAuditOpinion?: string;
|
||||
|
||||
/**
|
||||
* 录取处理状态(0-待处理 1-处理完成 9-处理驳回)
|
||||
*/
|
||||
admissionStatus?: string
|
||||
admissionStatus?: string;
|
||||
|
||||
/**
|
||||
* 缴费状态(0-未缴费 1-已缴费)
|
||||
*/
|
||||
paymentStatus?: string
|
||||
paymentStatus?: string;
|
||||
|
||||
/**
|
||||
* 录取通知书号码
|
||||
*/
|
||||
noticeNumber?: string
|
||||
noticeNumber?: string;
|
||||
|
||||
/**
|
||||
* 录取处理意见
|
||||
*/
|
||||
admissionOpinion?: string
|
||||
admissionOpinion?: string;
|
||||
|
||||
/**
|
||||
* 最终审核状态(0-待确认 1-确认通过 9-确认驳回)
|
||||
*/
|
||||
finalAuditStatus?: string
|
||||
finalAuditStatus?: string;
|
||||
|
||||
/**
|
||||
* 最终审核意见
|
||||
*/
|
||||
finalAuditOpinion?: string
|
||||
finalAuditOpinion?: string;
|
||||
|
||||
/**
|
||||
* 是否完成录取(0-未完成 1-已完成)
|
||||
*/
|
||||
isCompleted?: number
|
||||
isCompleted?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface EnrollmentProcessQuery extends PageQuery {
|
||||
/**
|
||||
* 报名信息ID,关联zsjy_enrollment_info.id
|
||||
*/
|
||||
enrollmentId?: number
|
||||
enrollmentId?: number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
idCard?: string
|
||||
idCard?: string;
|
||||
|
||||
/**
|
||||
* 当前状态(0-待审核 1-信息审核中 2-录取处理中 3-待最终确认 4-录取完成 9-已驳回)
|
||||
*/
|
||||
currentStatus?: string
|
||||
currentStatus?: string;
|
||||
|
||||
/**
|
||||
* 当前处理人ID
|
||||
*/
|
||||
currentHandler?: number
|
||||
currentHandler?: number;
|
||||
|
||||
/**
|
||||
* 信息审核状态(0-待审核 1-审核通过 9-审核驳回)
|
||||
*/
|
||||
infoAuditStatus?: string
|
||||
infoAuditStatus?: string;
|
||||
|
||||
/**
|
||||
* 录取处理状态(0-待处理 1-处理完成 9-处理驳回)
|
||||
*/
|
||||
admissionStatus?: string
|
||||
admissionStatus?: string;
|
||||
|
||||
/**
|
||||
* 最终审核状态(0-待确认 1-确认通过 9-确认驳回)
|
||||
*/
|
||||
finalAuditStatus?: string
|
||||
finalAuditStatus?: string;
|
||||
|
||||
/**
|
||||
* 是否完成录取(0-未完成 1-已完成)
|
||||
*/
|
||||
isCompleted?: number
|
||||
isCompleted?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// 查询录取流程状态列表
|
||||
@@ -368,8 +368,8 @@ export const listEnrollmentProcess = (query: EnrollmentProcessQuery): AxiosPromi
|
||||
url: '/zsjy/enrollment/process/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查询我的待审核列表
|
||||
export const listMyAuditProcess = (query: EnrollmentProcessQuery): AxiosPromise<EnrollmentProcessVO[]> => {
|
||||
@@ -377,16 +377,16 @@ export const listMyAuditProcess = (query: EnrollmentProcessQuery): AxiosPromise<
|
||||
url: '/zsjy/enrollment/process/myAudit',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查询录取流程状态详细
|
||||
export const getEnrollmentProcess = (id: string | number): AxiosPromise<EnrollmentProcessVO> => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 新增录取流程状态
|
||||
export const addEnrollmentProcess = (data: EnrollmentProcessForm) => {
|
||||
@@ -394,8 +394,8 @@ export const addEnrollmentProcess = (data: EnrollmentProcessForm) => {
|
||||
url: '/zsjy/enrollment/process',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 从报名信息创建流程
|
||||
export const createProcessFromEnrollment = (enrollmentId: number) => {
|
||||
@@ -403,8 +403,8 @@ export const createProcessFromEnrollment = (enrollmentId: number) => {
|
||||
url: '/zsjy/enrollment/process/createFromEnrollment',
|
||||
method: 'post',
|
||||
params: { enrollmentId }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 同步流程状态
|
||||
export const syncProcessStatus = (id: string | number) => {
|
||||
@@ -412,8 +412,8 @@ export const syncProcessStatus = (id: string | number) => {
|
||||
url: '/zsjy/enrollment/process/syncStatus',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 修改录取流程状态
|
||||
export const updateEnrollmentProcess = (data: EnrollmentProcessForm) => {
|
||||
@@ -421,24 +421,24 @@ export const updateEnrollmentProcess = (data: EnrollmentProcessForm) => {
|
||||
url: '/zsjy/enrollment/process',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 删除录取流程状态
|
||||
export const delEnrollmentProcess = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 根据报名信息ID查询流程状态
|
||||
export const getProcessByEnrollmentId = (enrollmentId: number): AxiosPromise<EnrollmentProcessVO> => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/enrollment/' + enrollmentId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查询待处理的流程列表
|
||||
export const getPendingProcessList = (query: EnrollmentProcessQuery): AxiosPromise<EnrollmentProcessVO[]> => {
|
||||
@@ -446,8 +446,8 @@ export const getPendingProcessList = (query: EnrollmentProcessQuery): AxiosPromi
|
||||
url: '/zsjy/enrollment/process/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 根据状态查询流程列表
|
||||
export const getProcessListByStatus = (status: string, query: EnrollmentProcessQuery): AxiosPromise<EnrollmentProcessVO[]> => {
|
||||
@@ -455,16 +455,16 @@ export const getProcessListByStatus = (status: string, query: EnrollmentProcessQ
|
||||
url: '/zsjy/enrollment/process/status/' + status,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 获取流程统计数据
|
||||
export const getProcessStatistics = (): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/statistics',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索流程
|
||||
export const searchProcess = (keyword: string, query: EnrollmentProcessQuery): AxiosPromise<EnrollmentProcessVO[]> => {
|
||||
@@ -472,35 +472,26 @@ export const searchProcess = (keyword: string, query: EnrollmentProcessQuery): A
|
||||
url: '/zsjy/enrollment/process/search',
|
||||
method: 'get',
|
||||
params: { keyword, ...query }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 信息审核
|
||||
export const infoAudit = (data: {
|
||||
processId: number;
|
||||
auditResult: string;
|
||||
auditOpinion?: string;
|
||||
}) => {
|
||||
export const infoAudit = (data: { processId: number; auditResult: string; auditOpinion?: string }) => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/infoAudit',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 录取处理
|
||||
export const admissionProcess = (data: {
|
||||
processId: number;
|
||||
admissionResult: string;
|
||||
admissionOpinion?: string;
|
||||
noticeNumber?: string;
|
||||
}) => {
|
||||
export const admissionProcess = (data: { processId: number; admissionResult: string; admissionOpinion?: string; noticeNumber?: string }) => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/admissionProcess',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 确认缴费
|
||||
export const confirmPayment = (processId: number) => {
|
||||
@@ -508,21 +499,17 @@ export const confirmPayment = (processId: number) => {
|
||||
url: '/zsjy/enrollment/process/confirmPayment',
|
||||
method: 'post',
|
||||
params: { processId }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 最终审核
|
||||
export const finalAudit = (data: {
|
||||
processId: number;
|
||||
finalResult: string;
|
||||
finalOpinion?: string;
|
||||
}) => {
|
||||
export const finalAudit = (data: { processId: number; finalResult: string; finalOpinion?: string }) => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/finalConfirm',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 完成流程
|
||||
export const completeProcess = (processId: number) => {
|
||||
@@ -530,20 +517,17 @@ export const completeProcess = (processId: number) => {
|
||||
url: '/zsjy/enrollment/process/complete',
|
||||
method: 'post',
|
||||
params: { processId }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 驳回流程
|
||||
export const rejectProcess = (data: {
|
||||
processId: number;
|
||||
rejectReason: string;
|
||||
}) => {
|
||||
export const rejectProcess = (data: { processId: number; rejectReason: string }) => {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/process/reject',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 重置流程
|
||||
export const resetProcess = (processId: number) => {
|
||||
@@ -551,8 +535,8 @@ export const resetProcess = (processId: number) => {
|
||||
url: '/zsjy/enrollment/process/reset',
|
||||
method: 'post',
|
||||
params: { processId }
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 导出录取流程状态
|
||||
export const exportEnrollmentProcess = (query: EnrollmentProcessQuery) => {
|
||||
@@ -560,5 +544,5 @@ export const exportEnrollmentProcess = (query: EnrollmentProcessQuery) => {
|
||||
url: '/zsjy/enrollment/process/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
import type { PageQuery } from '@/types/page'
|
||||
import type { EnrollmentProcessVO } from './enrollmentProcess'
|
||||
import request from '@/utils/request';
|
||||
import type { PageQuery } from '@/types/page';
|
||||
import type { EnrollmentProcessVO } from './enrollmentProcess';
|
||||
|
||||
/**
|
||||
* 查询招生录取统计列表
|
||||
@@ -12,7 +12,7 @@ export function listEnrollmentStatistics(query: PageQuery) {
|
||||
url: '/zsjy/enrollment/statistics/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ export function exportEnrollmentStatistics(query: PageQuery) {
|
||||
method: 'post',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ export function getEnrollmentStatistics(id: string | number) {
|
||||
return request({
|
||||
url: `/zsjy/enrollment/statistics/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ export function getEnrollmentStatisticsChartData() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/chart',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ export function getEnrollmentStatisticsOverview() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/overview',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ export function getEnrollmentStatisticsByMajor() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/major',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ export function getEnrollmentStatisticsByCollege() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/college',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ export function getEnrollmentStatisticsByRegion() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/region',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +103,7 @@ export function getEnrollmentStatisticsByGender() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/gender',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ export function getEnrollmentStatisticsByPayment() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/payment',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,5 +125,5 @@ export function getEnrollmentStatisticsByStatus() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/status',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
GraduateInfoVO,
|
||||
GraduateInfoForm,
|
||||
GraduateInfoQuery,
|
||||
GraduateStatisticsVO
|
||||
} from '@/api/zsjy/types';
|
||||
import { GraduateInfoVO, GraduateInfoForm, GraduateInfoQuery, GraduateStatisticsVO } from '@/api/zsjy/types';
|
||||
|
||||
/**
|
||||
* 查询毕业生信息列表
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 导出招生就业管理模块相关的所有API接口
|
||||
export * from './enterprise'; // 企业信息管理
|
||||
export * from './enterprise'; // 企业信息管理
|
||||
// export * from './jobPosition'; // 招聘岗位管理 (待开发)
|
||||
// export * from './recruitmentPoster'; // 招聘海报管理 (待开发)
|
||||
|
||||
// 现有导出
|
||||
export * from './statistics'; // 统计分析
|
||||
export * from './enrollmentProcess'; // 录取流程管理
|
||||
export * from './enrollmentStatistics'; // 报名统计
|
||||
export * from './statistics'; // 统计分析
|
||||
export * from './enrollmentProcess'; // 录取流程管理
|
||||
export * from './enrollmentStatistics'; // 报名统计
|
||||
|
||||
// 类型导出
|
||||
export * from './types'; // 类型定义
|
||||
export * from './types'; // 类型定义
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
import { JobPositionVO, JobPositionForm, JobPositionQuery, TableDataInfo } from './types'
|
||||
import { AxiosPromise } from 'axios'
|
||||
import request from '@/utils/request';
|
||||
import { JobPositionVO, JobPositionForm, JobPositionQuery, TableDataInfo } from './types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 查询招聘岗位列表
|
||||
@@ -12,7 +12,7 @@ export function listJobPosition(query?: JobPositionQuery): AxiosPromise<TableDat
|
||||
url: '/zsjy/position/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ export function getJobPosition(id: string | number): AxiosPromise<JobPositionVO>
|
||||
return request({
|
||||
url: '/zsjy/position/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ export function addJobPosition(data: JobPositionForm) {
|
||||
url: '/zsjy/position',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ export function updateJobPosition(data: JobPositionForm) {
|
||||
url: '/zsjy/position',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ export function delJobPosition(id: string | number | Array<string | number>) {
|
||||
return request({
|
||||
url: '/zsjy/position/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ export function exportJobPosition(query: JobPositionQuery) {
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,5 +87,5 @@ export function listEnterpriseOptions() {
|
||||
return request({
|
||||
url: '/zsjy/enterprise/options',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
import { RecruitmentPosterVO, RecruitmentPosterForm, RecruitmentPosterQuery, TableDataInfo } from './types'
|
||||
import { AxiosPromise } from 'axios'
|
||||
import request from '@/utils/request';
|
||||
import { RecruitmentPosterVO, RecruitmentPosterForm, RecruitmentPosterQuery, TableDataInfo } from './types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 查询招聘海报列表
|
||||
@@ -12,7 +12,7 @@ export function listRecruitmentPoster(query?: RecruitmentPosterQuery): AxiosProm
|
||||
url: '/zsjy/poster/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ export function getRecruitmentPoster(id: string | number): AxiosPromise<Recruitm
|
||||
return request({
|
||||
url: '/zsjy/poster/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ export function addRecruitmentPoster(data: RecruitmentPosterForm) {
|
||||
url: '/zsjy/poster',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ export function updateRecruitmentPoster(data: RecruitmentPosterForm) {
|
||||
url: '/zsjy/poster',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ export function delRecruitmentPoster(id: string | number | Array<string | number
|
||||
return request({
|
||||
url: '/zsjy/poster/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ export function exportRecruitmentPoster(query: RecruitmentPosterQuery) {
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,5 +89,5 @@ export function listPositionOptions(enterpriseId?: number | string) {
|
||||
url: '/zsjy/position/options',
|
||||
method: 'get',
|
||||
params: { enterpriseId }
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export function getStatisticsOverview() {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取统计概览数据失败:', error);
|
||||
ElMessage.error('获取统计数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -28,7 +28,7 @@ export function getMajorDistribution() {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取专业分布数据失败:', error);
|
||||
ElMessage.error('获取专业分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -45,7 +45,7 @@ export function getRegionDistribution() {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取地区分布数据失败:', error);
|
||||
ElMessage.error('获取地区分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -62,7 +62,7 @@ export function getGenderRatio() {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取性别比例数据失败:', error);
|
||||
ElMessage.error('获取性别比例数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -81,7 +81,7 @@ export function getEnrollmentTrend(days?: number) {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取报名趋势数据失败:', error);
|
||||
ElMessage.error('获取报名趋势数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -98,7 +98,7 @@ export function getStatusDistribution() {
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch((error) => {
|
||||
console.error('获取状态分布数据失败:', error);
|
||||
ElMessage.error('获取状态分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
@@ -113,9 +113,9 @@ export interface StatisticsOverview {
|
||||
paymentRate: string;
|
||||
admittedCount: number;
|
||||
admissionRate: string;
|
||||
majorDistribution: Array<{[key: string]: any}>;
|
||||
regionDistribution: Array<{[key: string]: any}>;
|
||||
genderRatio: {[key: string]: number};
|
||||
weeklyTrend: Array<{[key: string]: any}>;
|
||||
statusDistribution: {[key: string]: number};
|
||||
majorDistribution: Array<{ [key: string]: any }>;
|
||||
regionDistribution: Array<{ [key: string]: any }>;
|
||||
genderRatio: { [key: string]: number };
|
||||
weeklyTrend: Array<{ [key: string]: any }>;
|
||||
statusDistribution: { [key: string]: number };
|
||||
}
|
||||
@@ -96,14 +96,19 @@ watch(
|
||||
if (Array.isArray(val)) {
|
||||
list = val;
|
||||
} else {
|
||||
const res = await listByIds(val);
|
||||
list = res.data.map((oss) => {
|
||||
return {
|
||||
name: oss.originalName,
|
||||
url: oss.url,
|
||||
ossId: oss.ossId
|
||||
};
|
||||
});
|
||||
try {
|
||||
const res = await listByIds(String(val));
|
||||
list = res.data.map((oss) => {
|
||||
return {
|
||||
name: oss.originalName,
|
||||
url: oss.url,
|
||||
ossId: oss.ossId
|
||||
};
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('FileUpload - 获取附件信息失败:', error);
|
||||
list = [];
|
||||
}
|
||||
}
|
||||
// 然后将数组转为对象数组
|
||||
fileList.value = list.map((item) => {
|
||||
@@ -121,8 +126,8 @@ watch(
|
||||
|
||||
/** 下载附件 */
|
||||
const handleDownloadAttachment = async (file: any) => {
|
||||
let downloadUrl = file.ossId;
|
||||
let fileName = file.name || 'attachment';
|
||||
const downloadUrl = file.ossId;
|
||||
const fileName = file.name || 'attachment';
|
||||
|
||||
if (!downloadUrl) {
|
||||
proxy?.$modal.msgError('无法获取文件下载地址');
|
||||
@@ -240,7 +245,8 @@ const handleDelete = (index: number) => {
|
||||
const ossId = fileList.value[index].ossId;
|
||||
delOss(ossId);
|
||||
fileList.value.splice(index, 1);
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
const newValue = listToString(fileList.value);
|
||||
emit('update:modelValue', newValue);
|
||||
};
|
||||
|
||||
// 上传结束处理
|
||||
@@ -249,7 +255,8 @@ const uploadedSuccessfully = () => {
|
||||
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
|
||||
uploadList.value = [];
|
||||
number.value = 0;
|
||||
emit('update:modelValue', listToString(fileList.value));
|
||||
const newValue = listToString(fileList.value);
|
||||
emit('update:modelValue', newValue);
|
||||
proxy?.$modal.closeLoading();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -312,8 +312,6 @@ const performUpload = async (options: any) => {
|
||||
|
||||
// 上传成功回调
|
||||
const handleUploadSuccess = (res: any, file: any) => {
|
||||
|
||||
|
||||
// 确保res存在且有正确的结构
|
||||
if (res && res.code === 200) {
|
||||
// 避免重复添加,检查是否已经存在
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div class="poster-preview">
|
||||
<!-- 海报画布容器 -->
|
||||
<div
|
||||
ref="posterRef"
|
||||
class="poster-canvas"
|
||||
:style="canvasStyle"
|
||||
>
|
||||
<div ref="posterRef" class="poster-canvas" :style="canvasStyle">
|
||||
<!-- 企业信息叠加 -->
|
||||
<div class="info-overlay">
|
||||
<!-- 顶部企业标题 -->
|
||||
@@ -15,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 中间内容区域 - 根据海报类型显示不同内容 -->
|
||||
|
||||
|
||||
<!-- 企业海报:展示企业文化和优势 -->
|
||||
<div v-if="posterData.posterType === '1'" class="position-info">
|
||||
<div class="position-title">加入我们 · 共创辉煌</div>
|
||||
@@ -26,7 +22,7 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
<div class="detail-item" v-if="enterpriseDetail.mainBusiness">
|
||||
<span class="icon">🏢</span>
|
||||
<span>{{ enterpriseDetail.mainBusiness }}</span>
|
||||
@@ -44,16 +40,16 @@
|
||||
|
||||
<!-- 岗位海报:展示具体岗位信息 -->
|
||||
<div v-else-if="posterData.posterType === '2'" class="position-info">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div class="position-title">
|
||||
{{ posterData.positionName || positionDetail?.positionName || '招聘岗位' }}
|
||||
</div>
|
||||
@@ -89,7 +85,6 @@
|
||||
<!-- 底部联系信息 - 根据海报类型显示不同内容 -->
|
||||
<div class="company-footer">
|
||||
<div v-if="enterpriseDetail" class="company-info">
|
||||
|
||||
<!-- 企业海报:重点显示联系方式 -->
|
||||
<template v-if="posterData.posterType === '1'">
|
||||
<div class="info-row" v-if="enterpriseDetail.contactPhone">
|
||||
@@ -125,7 +120,6 @@
|
||||
<span class="value">{{ enterpriseDetail.email }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -133,56 +127,52 @@
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="action-buttons">
|
||||
<el-button type="primary" icon="Download" @click="exportToPDF" :loading="exporting">
|
||||
导出PDF
|
||||
</el-button>
|
||||
<el-button icon="Picture" @click="exportToImage" :loading="exporting">
|
||||
导出图片
|
||||
</el-button>
|
||||
<el-button type="primary" icon="Download" @click="exportToPDF" :loading="exporting"> 导出PDF </el-button>
|
||||
<el-button icon="Picture" @click="exportToImage" :loading="exporting"> 导出图片 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
import jsPDF from 'jspdf'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, computed } from 'vue';
|
||||
import html2canvas from 'html2canvas';
|
||||
import jsPDF from 'jspdf';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
// 定义接口
|
||||
interface PosterData {
|
||||
posterPath: string
|
||||
enterpriseName: string
|
||||
positionName?: string
|
||||
posterType: string
|
||||
posterPath: string;
|
||||
enterpriseName: string;
|
||||
positionName?: string;
|
||||
posterType: string;
|
||||
}
|
||||
|
||||
interface EnterpriseDetail {
|
||||
mainBusiness?: string
|
||||
enterpriseScale?: string
|
||||
contactPhone?: string
|
||||
email?: string
|
||||
address?: string
|
||||
mainBusiness?: string;
|
||||
enterpriseScale?: string;
|
||||
contactPhone?: string;
|
||||
email?: string;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
interface PositionDetail {
|
||||
positionName?: string
|
||||
workAddress?: string
|
||||
salary?: string
|
||||
workTime?: string
|
||||
requiredSkills?: string
|
||||
positionName?: string;
|
||||
workAddress?: string;
|
||||
salary?: string;
|
||||
workTime?: string;
|
||||
requiredSkills?: string;
|
||||
}
|
||||
|
||||
// Props定义
|
||||
const props = defineProps<{
|
||||
posterData: PosterData
|
||||
enterpriseDetail?: EnterpriseDetail
|
||||
positionDetail?: PositionDetail
|
||||
}>()
|
||||
posterData: PosterData;
|
||||
enterpriseDetail?: EnterpriseDetail;
|
||||
positionDetail?: PositionDetail;
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const posterRef = ref<HTMLElement>()
|
||||
const exporting = ref(false)
|
||||
const posterRef = ref<HTMLElement>();
|
||||
const exporting = ref(false);
|
||||
|
||||
// 计算样式
|
||||
const canvasStyle = computed(() => ({
|
||||
@@ -190,7 +180,7 @@ const canvasStyle = computed(() => ({
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
backgroundRepeat: 'no-repeat'
|
||||
}))
|
||||
}));
|
||||
|
||||
// 企业规模字典
|
||||
const scaleDict = {
|
||||
@@ -199,79 +189,79 @@ const scaleDict = {
|
||||
'3': '200-500人',
|
||||
'4': '500-1000人',
|
||||
'5': '1000人以上'
|
||||
}
|
||||
};
|
||||
|
||||
// 获取规模标签
|
||||
const getScaleLabel = (value: string) => {
|
||||
return scaleDict[value as keyof typeof scaleDict] || value
|
||||
}
|
||||
return scaleDict[value as keyof typeof scaleDict] || value;
|
||||
};
|
||||
|
||||
// 导出为PDF
|
||||
const exportToPDF = async () => {
|
||||
if (!posterRef.value) return
|
||||
|
||||
if (!posterRef.value) return;
|
||||
|
||||
try {
|
||||
exporting.value = true
|
||||
|
||||
exporting.value = true;
|
||||
|
||||
const canvas = await html2canvas(posterRef.value, {
|
||||
backgroundColor: null,
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true,
|
||||
foreignObjectRendering: false
|
||||
})
|
||||
|
||||
const imgData = canvas.toDataURL('image/png')
|
||||
});
|
||||
|
||||
const imgData = canvas.toDataURL('image/png');
|
||||
const pdf = new jsPDF({
|
||||
orientation: 'portrait',
|
||||
unit: 'mm',
|
||||
format: 'a4'
|
||||
})
|
||||
|
||||
const imgWidth = 190
|
||||
const imgHeight = (canvas.height * imgWidth) / canvas.width
|
||||
|
||||
pdf.addImage(imgData, 'PNG', 10, 10, imgWidth, imgHeight)
|
||||
|
||||
const fileName = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.pdf`
|
||||
pdf.save(fileName)
|
||||
|
||||
ElMessage.success('PDF导出成功')
|
||||
});
|
||||
|
||||
const imgWidth = 190;
|
||||
const imgHeight = (canvas.height * imgWidth) / canvas.width;
|
||||
|
||||
pdf.addImage(imgData, 'PNG', 10, 10, imgWidth, imgHeight);
|
||||
|
||||
const fileName = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.pdf`;
|
||||
pdf.save(fileName);
|
||||
|
||||
ElMessage.success('PDF导出成功');
|
||||
} catch (error) {
|
||||
console.error('PDF导出失败:', error)
|
||||
ElMessage.error('PDF导出失败,请重试')
|
||||
console.error('PDF导出失败:', error);
|
||||
ElMessage.error('PDF导出失败,请重试');
|
||||
} finally {
|
||||
exporting.value = false
|
||||
exporting.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 导出为图片
|
||||
const exportToImage = async () => {
|
||||
if (!posterRef.value) return
|
||||
|
||||
if (!posterRef.value) return;
|
||||
|
||||
try {
|
||||
exporting.value = true
|
||||
|
||||
exporting.value = true;
|
||||
|
||||
const canvas = await html2canvas(posterRef.value, {
|
||||
backgroundColor: null,
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true
|
||||
})
|
||||
|
||||
const link = document.createElement('a')
|
||||
link.download = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.png`
|
||||
link.href = canvas.toDataURL('image/png')
|
||||
link.click()
|
||||
|
||||
ElMessage.success('图片导出成功')
|
||||
});
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.download = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.png`;
|
||||
link.href = canvas.toDataURL('image/png');
|
||||
link.click();
|
||||
|
||||
ElMessage.success('图片导出成功');
|
||||
} catch (error) {
|
||||
console.error('图片导出失败:', error)
|
||||
ElMessage.error('图片导出失败,请重试')
|
||||
console.error('图片导出失败:', error);
|
||||
ElMessage.error('图片导出失败,请重试');
|
||||
} finally {
|
||||
exporting.value = false
|
||||
exporting.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -304,12 +294,7 @@ const exportToImage = async () => {
|
||||
padding: 40px;
|
||||
color: white;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(0, 0, 0, 0.3) 0%,
|
||||
rgba(0, 0, 0, 0.1) 50%,
|
||||
rgba(0, 0, 0, 0.4) 100%
|
||||
);
|
||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.4) 100%);
|
||||
}
|
||||
|
||||
.company-header {
|
||||
@@ -440,22 +425,22 @@ const exportToImage = async () => {
|
||||
max-width: 450px;
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
|
||||
.info-overlay {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
.company-name {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
|
||||
.position-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
.detail-item {
|
||||
font-size: 14px;
|
||||
padding: 8px 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
// const { data: downloadUrl } = await getFileDownloadUrl(String(ossId));
|
||||
|
||||
const response = await request({
|
||||
url: "/resource/oss/download/" + ossId,
|
||||
url: '/resource/oss/download/' + ossId,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
timeout: 300000 // 300秒超时
|
||||
@@ -30,9 +30,11 @@ export default {
|
||||
if (!blob) {
|
||||
throw new Error('响应数据为空');
|
||||
}
|
||||
const filename = response.headers.get('content-disposition')?.split('filename=')[1]?.replace(/"/g, '') || `file_${ossId}`;
|
||||
|
||||
FileSaver.saveAs(blob, decodeURIComponent(filename));
|
||||
// 由于响应拦截器直接返回blob,无法获取headers,使用默认文件名
|
||||
const filename = `file_${ossId}`;
|
||||
|
||||
FileSaver.saveAs(blob, filename);
|
||||
downloadLoadingInstance.close();
|
||||
} catch (r) {
|
||||
console.error(r);
|
||||
@@ -50,7 +52,7 @@ export default {
|
||||
// const { data: downloadUrl } = await getFileDownloadUrl(String(ossId));
|
||||
|
||||
const response = await request({
|
||||
url: "/resource/oss/download/" + ossId,
|
||||
url: '/resource/oss/download/' + ossId,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
timeout: 300000 // 300秒超时
|
||||
@@ -64,9 +66,10 @@ export default {
|
||||
throw new Error('响应数据为空');
|
||||
}
|
||||
|
||||
const finalFileName = fileName || response.headers.get('content-disposition')?.split('filename=')[1]?.replace(/"/g, '') || `file_${ossId}`;
|
||||
// 由于响应拦截器直接返回blob,无法获取headers,使用传入的文件名或默认文件名
|
||||
const finalFileName = fileName || `file_${ossId}`;
|
||||
|
||||
FileSaver.saveAs(blob, decodeURIComponent(finalFileName));
|
||||
FileSaver.saveAs(blob, finalFileName);
|
||||
downloadLoadingInstance.close();
|
||||
} catch (r) {
|
||||
console.error(r);
|
||||
@@ -83,7 +86,7 @@ export default {
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
timeout: 300000 ,// 300秒超时
|
||||
timeout: 300000, // 300秒超时
|
||||
headers: globalHeaders()
|
||||
});
|
||||
const isBlob = blobValidate(res.data);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { App } from 'vue'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
import { App } from 'vue';
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
||||
|
||||
export default function registerIcons(app: App) {
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
app.component(key, component);
|
||||
}
|
||||
|
||||
|
||||
// 移除重复的Close组件注册
|
||||
// app.component('Close', ElementPlusIconsVue.Close);
|
||||
|
||||
|
||||
// 注册常用图标的别名
|
||||
app.component('CircleCloseIcon', ElementPlusIconsVue.CircleClose);
|
||||
}
|
||||
Vendored
+2
-2
@@ -87,12 +87,12 @@ declare global {
|
||||
declare interface PageQuery {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
orderByColumn?: string;
|
||||
|
||||
|
||||
/**
|
||||
* 排序方式(asc/desc)
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
timeout: 300000 // 增加到5分钟,适合大数据量导出
|
||||
timeout: 300000 // 增加到5分钟,适合大数据量导出
|
||||
});
|
||||
|
||||
// 请求拦截器
|
||||
@@ -177,7 +177,7 @@ service.interceptors.response.use(
|
||||
console.log('404错误被静默处理,不显示用户提示');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
|
||||
// 对心理健康测评详情页面的403错误进行特殊处理
|
||||
if (statusCode === '403') {
|
||||
const url = error.config.url;
|
||||
@@ -187,7 +187,7 @@ service.interceptors.response.use(
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
message = '系统接口' + statusCode + '异常';
|
||||
}
|
||||
ElMessage({ message: message, type: 'error', duration: 5 * 1000 });
|
||||
|
||||
@@ -17,39 +17,24 @@
|
||||
<span>产出指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- 数量指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">数量指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.quantity.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quantity.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.quantity.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quantity.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.quantity.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quantity.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -67,12 +52,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.quantity.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quantity.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -84,32 +64,17 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.quality.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quality.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.quality.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quality.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.quality.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quality.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -127,12 +92,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.quality.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.quality.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -144,32 +104,17 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.timeliness.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.timeliness.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.timeliness.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -187,12 +132,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.timeliness.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -204,32 +144,17 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.cost.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.cost.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.cost.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.cost.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.cost.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.cost.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -247,12 +172,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.cost.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.cost.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -267,39 +187,24 @@
|
||||
<span>效益指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- 经济效益指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">经济效益指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.economic.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.economic.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.economic.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.economic.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.economic.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.economic.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -317,12 +222,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.economic.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.economic.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -334,32 +234,17 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.social.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.social.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.social.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.social.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.social.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.social.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -377,12 +262,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.social.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.social.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -394,32 +274,17 @@
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.ecological.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.ecological.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.ecological.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.ecological.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.ecological.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.ecological.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -437,12 +302,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.ecological.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.ecological.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -457,39 +317,24 @@
|
||||
<span>满意度指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- 服务对象满意度指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">服务对象满意度指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.service_satisfaction.goalName" placeholder="请输入绩效目标名称" maxlength="200" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.service_satisfaction.targetValue" placeholder="目标值" maxlength="100" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.service_satisfaction.unit" placeholder="单位" maxlength="20" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
@@ -507,12 +352,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
<el-input v-model="indicators.service_satisfaction.description" placeholder="详细说明" maxlength="500" @input="emitChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -531,22 +371,22 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, computed, watch } from 'vue'
|
||||
import { TrendCharts, Money, Star } from '@element-plus/icons-vue'
|
||||
import { defineComponent, ref, computed, watch } from 'vue';
|
||||
import { TrendCharts, Money, Star } from '@element-plus/icons-vue';
|
||||
|
||||
interface PerformanceIndicator {
|
||||
indicatorType: string
|
||||
indicatorTypeName: string
|
||||
goalName: string
|
||||
targetValue: string
|
||||
unit: string
|
||||
weightPercentage: number
|
||||
description: string
|
||||
measurementMethod: string
|
||||
dataSource: string
|
||||
isQuantitative: boolean
|
||||
sortOrder: number
|
||||
status: string
|
||||
indicatorType: string;
|
||||
indicatorTypeName: string;
|
||||
goalName: string;
|
||||
targetValue: string;
|
||||
unit: string;
|
||||
weightPercentage: number;
|
||||
description: string;
|
||||
measurementMethod: string;
|
||||
dataSource: string;
|
||||
isQuantitative: boolean;
|
||||
sortOrder: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
@@ -582,7 +422,7 @@ export default defineComponent({
|
||||
isQuantitative: true,
|
||||
sortOrder: 0,
|
||||
status: '1'
|
||||
})
|
||||
});
|
||||
|
||||
// 8种固定的指标类型
|
||||
const indicators = ref({
|
||||
@@ -594,46 +434,46 @@ export default defineComponent({
|
||||
social: createIndicator('social', '社会效益指标'),
|
||||
ecological: createIndicator('ecological', '生态效益指标'),
|
||||
service_satisfaction: createIndicator('service_satisfaction', '服务对象满意度指标')
|
||||
})
|
||||
});
|
||||
|
||||
// 计算总分值占比
|
||||
const totalWeight = computed(() => {
|
||||
let total = 0
|
||||
Object.values(indicators.value).forEach(indicator => {
|
||||
total += indicator.weightPercentage || 0
|
||||
})
|
||||
return Math.round(total * 10) / 10
|
||||
})
|
||||
let total = 0;
|
||||
Object.values(indicators.value).forEach((indicator) => {
|
||||
total += indicator.weightPercentage || 0;
|
||||
});
|
||||
return Math.round(total * 10) / 10;
|
||||
});
|
||||
|
||||
// 收集有效的指标数据
|
||||
const collectValidIndicators = () => {
|
||||
const validIndicators: PerformanceIndicator[] = []
|
||||
let sortOrder = 0
|
||||
|
||||
Object.values(indicators.value).forEach(indicator => {
|
||||
const validIndicators: PerformanceIndicator[] = [];
|
||||
let sortOrder = 0;
|
||||
|
||||
Object.values(indicators.value).forEach((indicator) => {
|
||||
// 只有填写了目标名称的指标才被认为是有效的
|
||||
if (indicator.goalName?.trim()) {
|
||||
validIndicators.push({
|
||||
...indicator,
|
||||
sortOrder: sortOrder++
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
return validIndicators
|
||||
}
|
||||
});
|
||||
|
||||
return validIndicators;
|
||||
};
|
||||
|
||||
// 发出变化事件
|
||||
const emitChange = () => {
|
||||
const validIndicators = collectValidIndicators()
|
||||
emit('update:modelValue', validIndicators)
|
||||
emit('change', validIndicators)
|
||||
}
|
||||
const validIndicators = collectValidIndicators();
|
||||
emit('update:modelValue', validIndicators);
|
||||
emit('change', validIndicators);
|
||||
};
|
||||
|
||||
// 从传入的数据初始化指标
|
||||
const initializeFromData = (data: any[]) => {
|
||||
if (!data || data.length === 0) return
|
||||
|
||||
if (!data || data.length === 0) return;
|
||||
|
||||
// 重置所有指标
|
||||
indicators.value = {
|
||||
quantity: createIndicator('quantity', '数量指标'),
|
||||
@@ -644,57 +484,61 @@ export default defineComponent({
|
||||
social: createIndicator('social', '社会效益指标'),
|
||||
ecological: createIndicator('ecological', '生态效益指标'),
|
||||
service_satisfaction: createIndicator('service_satisfaction', '服务对象满意度指标')
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 将数据填入对应的指标类型
|
||||
data.forEach(item => {
|
||||
data.forEach((item) => {
|
||||
if (indicators.value[item.indicatorType]) {
|
||||
indicators.value[item.indicatorType] = { ...item }
|
||||
indicators.value[item.indicatorType] = { ...item };
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 监听外部数据变化
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
initializeFromData(newValue)
|
||||
}, { deep: true, immediate: true })
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
initializeFromData(newValue);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
// 校验方法
|
||||
const validate = () => {
|
||||
const validIndicators = collectValidIndicators()
|
||||
const errors = []
|
||||
|
||||
const validIndicators = collectValidIndicators();
|
||||
const errors = [];
|
||||
|
||||
if (validIndicators.length === 0) {
|
||||
errors.push('请至少填写一个绩效指标')
|
||||
errors.push('请至少填写一个绩效指标');
|
||||
}
|
||||
|
||||
|
||||
validIndicators.forEach((indicator, index) => {
|
||||
if (!indicator.goalName?.trim()) {
|
||||
errors.push(`第${index + 1}个指标未填写绩效目标名称`)
|
||||
errors.push(`第${index + 1}个指标未填写绩效目标名称`);
|
||||
}
|
||||
if (!indicator.targetValue?.trim()) {
|
||||
errors.push(`第${index + 1}个指标未填写目标值`)
|
||||
errors.push(`第${index + 1}个指标未填写目标值`);
|
||||
}
|
||||
if (!indicator.weightPercentage || indicator.weightPercentage <= 0) {
|
||||
errors.push(`第${index + 1}个指标未设置分值占比`)
|
||||
errors.push(`第${index + 1}个指标未设置分值占比`);
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
if (Math.abs(totalWeight.value - 100) > 0.1) {
|
||||
errors.push(`分值占比总和必须等于100%,当前为${totalWeight.value}%`)
|
||||
errors.push(`分值占比总和必须等于100%,当前为${totalWeight.value}%`);
|
||||
}
|
||||
|
||||
|
||||
if (errors.length > 0) {
|
||||
return { valid: false, message: errors.join(';') }
|
||||
return { valid: false, message: errors.join(';') };
|
||||
}
|
||||
|
||||
return { valid: true }
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
};
|
||||
|
||||
// 获取所有有效指标数据
|
||||
const getAllIndicators = () => {
|
||||
return collectValidIndicators()
|
||||
}
|
||||
return collectValidIndicators();
|
||||
};
|
||||
|
||||
return {
|
||||
indicators,
|
||||
@@ -702,9 +546,9 @@ export default defineComponent({
|
||||
emitChange,
|
||||
validate,
|
||||
getAllIndicators
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -715,34 +559,33 @@ export default defineComponent({
|
||||
gap: 8px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
|
||||
|
||||
.el-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.indicator-item {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background-color: #fafafa;
|
||||
border-radius: 6px;
|
||||
border-left: 4px solid #409eff;
|
||||
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.indicator-title {
|
||||
margin: 0 0 15px 0;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,12 +16,7 @@
|
||||
<!-- 审批流程 -->
|
||||
<el-divider content-position="left">审批流程</el-divider>
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(item, index) in approvalTimeline"
|
||||
:key="index"
|
||||
:type="item.type"
|
||||
:timestamp="item.timestamp"
|
||||
>
|
||||
<el-timeline-item v-for="(item, index) in approvalTimeline" :key="index" :type="item.type" :timestamp="item.timestamp">
|
||||
<div class="timeline-content">
|
||||
<h4>{{ item.title }}</h4>
|
||||
<p>{{ item.description }}</p>
|
||||
@@ -33,36 +28,25 @@
|
||||
<!-- 操作日志 -->
|
||||
<el-divider content-position="left">操作日志</el-divider>
|
||||
<el-table :data="operationLogs" style="width: 100%">
|
||||
<el-table-column prop="operation" label="操作" width="120"/>
|
||||
<el-table-column prop="operator" label="操作人" width="100"/>
|
||||
<el-table-column prop="operation" label="操作" width="120" />
|
||||
<el-table-column prop="operator" label="操作人" width="100" />
|
||||
<el-table-column prop="operateTime" label="操作时间" width="180">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="operation-buttons">
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'draft'"
|
||||
type="primary"
|
||||
@click="handleEdit"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'draft'"
|
||||
type="success"
|
||||
@click="handleSubmit"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
>提交</el-button>
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'pending'"
|
||||
type="warning"
|
||||
@click="handleWithdraw"
|
||||
v-hasPermi="['cw:application:withdraw']"
|
||||
>撤回</el-button>
|
||||
<el-button v-if="detail.approvalStatus === 'draft'" type="primary" @click="handleEdit" v-hasPermi="['cw:application:edit']">编辑</el-button>
|
||||
<el-button v-if="detail.approvalStatus === 'draft'" type="success" @click="handleSubmit" v-hasPermi="['cw:application:submit']"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button v-if="detail.approvalStatus === 'pending'" type="warning" @click="handleWithdraw" v-hasPermi="['cw:application:withdraw']"
|
||||
>撤回</el-button
|
||||
>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -72,9 +56,9 @@
|
||||
<script setup name="CwApplicationDetail">
|
||||
import { ref, getCurrentInstance, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getProjectApplication, submitApplication, withdrawApplication } from "@/api/cw/projectApplication";
|
||||
import ApplicationSummary from "./summary.vue";
|
||||
import { parseTime } from "@/utils/ruoyi";
|
||||
import { getProjectApplication, submitApplication, withdrawApplication } from '@/api/cw/projectApplication';
|
||||
import ApplicationSummary from './summary.vue';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
console.log('=== detail.vue 组件开始加载 ===');
|
||||
|
||||
@@ -120,32 +104,40 @@ function getStatusText(status) {
|
||||
|
||||
/** 编辑按钮操作 */
|
||||
function handleEdit() {
|
||||
router.push("/cw/application/form?id=" + detail.value.id);
|
||||
router.push('/cw/application/form?id=' + detail.value.id);
|
||||
}
|
||||
|
||||
/** 提交按钮操作 */
|
||||
function handleSubmit() {
|
||||
proxy.$modal.confirm('是否确认提交申报编号为"' + detail.value.applicationNo + '"的数据项?').then(function() {
|
||||
return submitApplication(detail.value.id);
|
||||
}).then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess("提交成功");
|
||||
}).catch(() => {});
|
||||
proxy.$modal
|
||||
.confirm('是否确认提交申报编号为"' + detail.value.applicationNo + '"的数据项?')
|
||||
.then(function () {
|
||||
return submitApplication(detail.value.id);
|
||||
})
|
||||
.then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess('提交成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 撤回按钮操作 */
|
||||
function handleWithdraw() {
|
||||
proxy.$modal.confirm('是否确认撤回申报编号为"' + detail.value.applicationNo + '"的数据项?').then(function() {
|
||||
return withdrawApplication(detail.value.id);
|
||||
}).then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess("撤回成功");
|
||||
}).catch(() => {});
|
||||
proxy.$modal
|
||||
.confirm('是否确认撤回申报编号为"' + detail.value.applicationNo + '"的数据项?')
|
||||
.then(function () {
|
||||
return withdrawApplication(detail.value.id);
|
||||
})
|
||||
.then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess('撤回成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 返回按钮操作 */
|
||||
function goBack() {
|
||||
router.push("/cw/application");
|
||||
router.push('/cw/application');
|
||||
}
|
||||
|
||||
/** 获取详情数据 */
|
||||
@@ -154,78 +146,80 @@ function getDetail() {
|
||||
console.log('=== 开始获取详情数据 ===');
|
||||
console.log('URL参数中的ID:', id);
|
||||
console.log('完整query参数:', route.query);
|
||||
|
||||
|
||||
if (id) {
|
||||
console.log('开始调用API:getProjectApplication, ID:', id);
|
||||
getProjectApplication(id).then(response => {
|
||||
console.log('=== API调用成功 ===');
|
||||
console.log('API响应:', response);
|
||||
console.log('响应代码:', response.code);
|
||||
console.log('响应数据:', response.data);
|
||||
|
||||
detail.value = response.data;
|
||||
getProjectApplication(id)
|
||||
.then((response) => {
|
||||
console.log('=== API调用成功 ===');
|
||||
console.log('API响应:', response);
|
||||
console.log('响应代码:', response.code);
|
||||
console.log('响应数据:', response.data);
|
||||
|
||||
// 调试日志:查看返回的数据
|
||||
console.log('=== 项目申报详情数据 ===');
|
||||
console.log('完整数据:', response.data);
|
||||
console.log('绩效指标数据:', response.data.performanceIndicators);
|
||||
console.log('绩效指标数量:', response.data.performanceIndicators ? response.data.performanceIndicators.length : 0);
|
||||
detail.value = response.data;
|
||||
|
||||
// 模拟审批流程数据
|
||||
approvalTimeline.value = [
|
||||
{
|
||||
type: 'success',
|
||||
timestamp: detail.value.createTime,
|
||||
title: '申报提交',
|
||||
description: '申报人提交预算申报',
|
||||
user: detail.value.applicantName
|
||||
// 调试日志:查看返回的数据
|
||||
console.log('=== 项目申报详情数据 ===');
|
||||
console.log('完整数据:', response.data);
|
||||
console.log('绩效指标数据:', response.data.performanceIndicators);
|
||||
console.log('绩效指标数量:', response.data.performanceIndicators ? response.data.performanceIndicators.length : 0);
|
||||
|
||||
// 模拟审批流程数据
|
||||
approvalTimeline.value = [
|
||||
{
|
||||
type: 'success',
|
||||
timestamp: detail.value.createTime,
|
||||
title: '申报提交',
|
||||
description: '申报人提交预算申报',
|
||||
user: detail.value.applicantName
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
approvalTimeline.value.push({
|
||||
type: 'primary',
|
||||
timestamp: detail.value.submitTime,
|
||||
title: '提交审批',
|
||||
description: '申报已提交,等待部门审批',
|
||||
user: detail.value.applicantName
|
||||
});
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
approvalTimeline.value.push({
|
||||
type: 'primary',
|
||||
timestamp: detail.value.submitTime,
|
||||
title: '提交审批',
|
||||
description: '申报已提交,等待部门审批',
|
||||
user: detail.value.applicantName
|
||||
});
|
||||
}
|
||||
|
||||
if (detail.value.approveTime && detail.value.approvalStatus === 'approved') {
|
||||
approvalTimeline.value.push({
|
||||
type: 'success',
|
||||
timestamp: detail.value.approveTime,
|
||||
title: '审批通过',
|
||||
description: '所有审批节点已通过',
|
||||
user: '系统管理员'
|
||||
});
|
||||
}
|
||||
|
||||
// 模拟操作日志数据
|
||||
operationLogs.value = [
|
||||
{
|
||||
operation: '创建申报',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.createTime,
|
||||
remark: '创建项目预算申报'
|
||||
if (detail.value.approveTime && detail.value.approvalStatus === 'approved') {
|
||||
approvalTimeline.value.push({
|
||||
type: 'success',
|
||||
timestamp: detail.value.approveTime,
|
||||
title: '审批通过',
|
||||
description: '所有审批节点已通过',
|
||||
user: '系统管理员'
|
||||
});
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
operationLogs.value.push({
|
||||
operation: '提交审批',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.submitTime,
|
||||
remark: '提交预算申报进入审批流程'
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('=== API调用失败 ===');
|
||||
console.error('错误信息:', error);
|
||||
console.error('错误响应:', error.response);
|
||||
proxy.$modal.msgError('获取申报详情失败:' + (error.message || '未知错误'));
|
||||
});
|
||||
// 模拟操作日志数据
|
||||
operationLogs.value = [
|
||||
{
|
||||
operation: '创建申报',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.createTime,
|
||||
remark: '创建项目预算申报'
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
operationLogs.value.push({
|
||||
operation: '提交审批',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.submitTime,
|
||||
remark: '提交预算申报进入审批流程'
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('=== API调用失败 ===');
|
||||
console.error('错误信息:', error);
|
||||
console.error('错误响应:', error.response);
|
||||
proxy.$modal.msgError('获取申报详情失败:' + (error.message || '未知错误'));
|
||||
});
|
||||
} else {
|
||||
console.error('=== URL参数错误 ===');
|
||||
console.error('缺少ID参数,无法获取详情数据');
|
||||
|
||||
@@ -64,22 +64,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="form.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
size="large"
|
||||
:prefix-icon="Document"
|
||||
/>
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" size="large" :prefix-icon="Document" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目负责人" prop="principal">
|
||||
<el-input
|
||||
v-model="form.principal"
|
||||
placeholder="请输入项目负责人"
|
||||
size="large"
|
||||
:prefix-icon="User"
|
||||
/>
|
||||
<el-input v-model="form.principal" placeholder="请输入项目负责人" size="large" :prefix-icon="User" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -87,24 +77,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input
|
||||
v-model="form.contactPhone"
|
||||
placeholder="请输入联系电话"
|
||||
size="large"
|
||||
:prefix-icon="Phone"
|
||||
/>
|
||||
<el-input v-model="form.contactPhone" placeholder="请输入联系电话" size="large" :prefix-icon="Phone" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预算年度" prop="year">
|
||||
<el-date-picker
|
||||
v-model="form.year"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
value-format="YYYY"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-date-picker v-model="form.year" type="year" placeholder="选择年份" value-format="YYYY" size="large" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -142,32 +120,17 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="feature-item">
|
||||
<el-switch
|
||||
v-model="form.targetSme"
|
||||
size="large"
|
||||
active-text="面向中小企业"
|
||||
inactive-text="不面向中小企业"
|
||||
/>
|
||||
<el-switch v-model="form.targetSme" size="large" active-text="面向中小企业" inactive-text="不面向中小企业" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="feature-item">
|
||||
<el-switch
|
||||
v-model="form.targetMicroSme"
|
||||
size="large"
|
||||
active-text="面向小微企业"
|
||||
inactive-text="不面向小微企业"
|
||||
/>
|
||||
<el-switch v-model="form.targetMicroSme" size="large" active-text="面向小微企业" inactive-text="不面向小微企业" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="feature-item">
|
||||
<el-switch
|
||||
v-model="form.importEquipment"
|
||||
size="large"
|
||||
active-text="采购进口设备"
|
||||
inactive-text="不采购进口设备"
|
||||
/>
|
||||
<el-switch v-model="form.importEquipment" size="large" active-text="采购进口设备" inactive-text="不采购进口设备" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -314,50 +277,22 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年度执行合计" prop="yearlyTotal">
|
||||
<el-input-number
|
||||
v-model="form.yearlyTotal"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input-number v-model="form.yearlyTotal" :precision="2" :min="0" placeholder="万元" size="large" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年度财政资金" prop="yearlyMunicipalFiscal">
|
||||
<el-input-number
|
||||
v-model="form.yearlyMunicipalFiscal"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input-number v-model="form.yearlyMunicipalFiscal" :precision="2" :min="0" placeholder="万元" size="large" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年度自筹资金" prop="yearlySelfFunding">
|
||||
<el-input-number
|
||||
v-model="form.yearlySelfFunding"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input-number v-model="form.yearlySelfFunding" :precision="2" :min="0" placeholder="万元" size="large" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年度其他资金" prop="yearlyOtherFunding">
|
||||
<el-input-number
|
||||
v-model="form.yearlyOtherFunding"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input-number v-model="form.yearlyOtherFunding" :precision="2" :min="0" placeholder="万元" size="large" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -366,12 +301,12 @@
|
||||
<!-- 资金分配图表 -->
|
||||
<div class="budget-chart" v-if="hasBudgetData">
|
||||
<h4 class="section-title">资金分配可视化</h4>
|
||||
<div ref="budgetChart" style="height: 300px;"></div>
|
||||
<div ref="budgetChart" style="height: 300px"></div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 第四步:绩效指标 -->
|
||||
<!-- 第四步:绩效指标 -->
|
||||
<el-card shadow="never" class="form-card" v-show="currentStep === 3">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
@@ -381,11 +316,7 @@
|
||||
</template>
|
||||
|
||||
<el-form ref="performanceFormRef" :model="form" label-width="120px" label-position="top">
|
||||
<PerformanceIndicators
|
||||
ref="performanceIndicatorsRef"
|
||||
v-model="form.performanceIndicators"
|
||||
@change="handlePerformanceIndicatorsChange"
|
||||
/>
|
||||
<PerformanceIndicators ref="performanceIndicatorsRef" v-model="form.performanceIndicators" @change="handlePerformanceIndicatorsChange" />
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@@ -450,49 +381,40 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus'
|
||||
import {
|
||||
Document, User, Phone, Money, TrendCharts, Check, Calendar,
|
||||
ArrowLeft, ArrowRight
|
||||
} from '@element-plus/icons-vue'
|
||||
import * as echarts from 'echarts'
|
||||
import {
|
||||
getProjectApplication,
|
||||
addProjectApplication,
|
||||
updateProjectApplication,
|
||||
submitApplication,
|
||||
saveDraft
|
||||
} from '@/api/cw/projectApplication'
|
||||
import PerformanceIndicators from './components/PerformanceIndicators.vue'
|
||||
import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { Document, User, Phone, Money, TrendCharts, Check, Calendar, ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { getProjectApplication, addProjectApplication, updateProjectApplication, submitApplication, saveDraft } from '@/api/cw/projectApplication';
|
||||
import PerformanceIndicators from './components/PerformanceIndicators.vue';
|
||||
|
||||
// 接收父组件传递的数据
|
||||
const props = defineProps<{
|
||||
formData?: any
|
||||
}>()
|
||||
formData?: any;
|
||||
}>();
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 表单引用
|
||||
const basicFormRef = ref()
|
||||
const contentFormRef = ref()
|
||||
const budgetFormRef = ref()
|
||||
const performanceFormRef = ref()
|
||||
const performanceIndicatorsRef = ref()
|
||||
const basicFormRef = ref();
|
||||
const contentFormRef = ref();
|
||||
const budgetFormRef = ref();
|
||||
const performanceFormRef = ref();
|
||||
const performanceIndicatorsRef = ref();
|
||||
|
||||
// 当前步骤
|
||||
const currentStep = ref(0)
|
||||
const activeTab = ref('quantity')
|
||||
const currentStep = ref(0);
|
||||
const activeTab = ref('quantity');
|
||||
|
||||
// 加载状态
|
||||
const savingDraft = ref(false)
|
||||
const submitting = ref(false)
|
||||
const savingDraft = ref(false);
|
||||
const submitting = ref(false);
|
||||
|
||||
// 图表引用
|
||||
const budgetChart = ref()
|
||||
let budgetChartInstance: echarts.ECharts | null = null
|
||||
const budgetChart = ref();
|
||||
let budgetChartInstance: echarts.ECharts | null = null;
|
||||
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
@@ -534,52 +456,63 @@ const form = reactive({
|
||||
// 绩效指标
|
||||
performanceIndicators: [],
|
||||
approvalStatus: 'draft'
|
||||
})
|
||||
});
|
||||
|
||||
// 监听父组件传递的数据变化
|
||||
watch(() => props.formData, (newData) => {
|
||||
if (newData && typeof newData === 'object' && Object.keys(newData).length > 0) {
|
||||
console.log('接收到父组件传递的数据:', newData)
|
||||
// 安全地更新form数据
|
||||
Object.keys(form).forEach(key => {
|
||||
if (newData.hasOwnProperty(key) && newData[key] !== null && newData[key] !== undefined) {
|
||||
// 特殊处理不同类型的字段
|
||||
if (key === 'year' && newData[key]) {
|
||||
form[key] = newData[key].toString()
|
||||
} else if (key === 'startDate' || key === 'endDate') {
|
||||
form[key] = newData[key] ? formatDateString(newData[key]) : ''
|
||||
} else if (key.includes('Investment') || key.includes('Fiscal') || key.includes('Funding') ||
|
||||
key.includes('Total') || key.includes('Municipal') || key.includes('Self') || key.includes('Other')) {
|
||||
// 金额字段
|
||||
form[key] = Number(newData[key]) || 0
|
||||
} else {
|
||||
form[key] = newData[key]
|
||||
watch(
|
||||
() => props.formData,
|
||||
(newData) => {
|
||||
if (newData && typeof newData === 'object' && Object.keys(newData).length > 0) {
|
||||
console.log('接收到父组件传递的数据:', newData);
|
||||
// 安全地更新form数据
|
||||
Object.keys(form).forEach((key) => {
|
||||
if (newData.hasOwnProperty(key) && newData[key] !== null && newData[key] !== undefined) {
|
||||
// 特殊处理不同类型的字段
|
||||
if (key === 'year' && newData[key]) {
|
||||
form[key] = newData[key].toString();
|
||||
} else if (key === 'startDate' || key === 'endDate') {
|
||||
form[key] = newData[key] ? formatDateString(newData[key]) : '';
|
||||
} else if (
|
||||
key.includes('Investment') ||
|
||||
key.includes('Fiscal') ||
|
||||
key.includes('Funding') ||
|
||||
key.includes('Total') ||
|
||||
key.includes('Municipal') ||
|
||||
key.includes('Self') ||
|
||||
key.includes('Other')
|
||||
) {
|
||||
// 金额字段
|
||||
form[key] = Number(newData[key]) || 0;
|
||||
} else {
|
||||
form[key] = newData[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log('form数据更新完成:', form)
|
||||
}
|
||||
}, { deep: true, immediate: true })
|
||||
});
|
||||
console.log('form数据更新完成:', form);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
// 日期格式化函数
|
||||
const formatDateString = (dateValue: any): string => {
|
||||
if (!dateValue) return ''
|
||||
let date: Date
|
||||
if (!dateValue) return '';
|
||||
let date: Date;
|
||||
if (typeof dateValue === 'string') {
|
||||
date = new Date(dateValue)
|
||||
date = new Date(dateValue);
|
||||
} else if (dateValue instanceof Date) {
|
||||
date = dateValue
|
||||
date = dateValue;
|
||||
} else {
|
||||
return ''
|
||||
return '';
|
||||
}
|
||||
|
||||
if (isNaN(date.getTime())) return ''
|
||||
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
if (isNaN(date.getTime())) return '';
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = {
|
||||
@@ -587,57 +520,47 @@ const rules = {
|
||||
{ required: true, message: '请输入项目名称', trigger: 'blur' },
|
||||
{ min: 2, max: 100, message: '项目名称长度在 2 到 100 个字符', trigger: 'blur' }
|
||||
],
|
||||
principal: [
|
||||
{ required: true, message: '请输入项目负责人', trigger: 'blur' }
|
||||
],
|
||||
principal: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
|
||||
contactPhone: [
|
||||
{ required: true, message: '请输入联系电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
year: [
|
||||
{ required: true, message: '请选择预算年度', trigger: 'change' }
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: '请选择项目开始日期', trigger: 'change' }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message: '请选择项目结束日期', trigger: 'change' }
|
||||
],
|
||||
year: [{ required: true, message: '请选择预算年度', trigger: 'change' }],
|
||||
startDate: [{ required: true, message: '请选择项目开始日期', trigger: 'change' }],
|
||||
endDate: [{ required: true, message: '请选择项目结束日期', trigger: 'change' }],
|
||||
totalInvestment: [
|
||||
{ required: true, message: '请填写项目总投资', trigger: 'blur' },
|
||||
{ type: 'number', min: 0.01, message: '投资金额必须大于0', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// 计算属性
|
||||
const canSubmit = computed(() => {
|
||||
return form.projectName && form.principal && form.totalInvestment > 0
|
||||
})
|
||||
return form.projectName && form.principal && form.totalInvestment > 0;
|
||||
});
|
||||
|
||||
const hasBudgetData = computed(() => {
|
||||
return form.totalMunicipalFiscal > 0 || form.totalSelfFunding > 0 || form.totalOtherFunding > 0
|
||||
})
|
||||
return form.totalMunicipalFiscal > 0 || form.totalSelfFunding > 0 || form.totalOtherFunding > 0;
|
||||
});
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount: number): string => {
|
||||
return amount ? amount.toFixed(2) : '0.00'
|
||||
}
|
||||
return amount ? amount.toFixed(2) : '0.00';
|
||||
};
|
||||
|
||||
// 计算总投资
|
||||
const calculateTotalInvestment = () => {
|
||||
form.totalInvestment = (form.totalMunicipalFiscal || 0) +
|
||||
(form.totalSelfFunding || 0) +
|
||||
(form.totalOtherFunding || 0)
|
||||
form.totalInvestment = (form.totalMunicipalFiscal || 0) + (form.totalSelfFunding || 0) + (form.totalOtherFunding || 0);
|
||||
|
||||
// 更新图表
|
||||
if (budgetChartInstance && hasBudgetData.value) {
|
||||
renderBudgetChart()
|
||||
renderBudgetChart();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染预算图表
|
||||
const renderBudgetChart = () => {
|
||||
if (!budgetChartInstance) return
|
||||
if (!budgetChartInstance) return;
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
@@ -669,7 +592,7 @@ const renderBudgetChart = () => {
|
||||
name: '其他资金',
|
||||
itemStyle: { color: '#E6A23C' }
|
||||
}
|
||||
].filter(item => item.value > 0),
|
||||
].filter((item) => item.value > 0),
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
@@ -679,106 +602,106 @@ const renderBudgetChart = () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
budgetChartInstance.setOption(option)
|
||||
}
|
||||
budgetChartInstance.setOption(option);
|
||||
};
|
||||
|
||||
// 初始化图表
|
||||
const initBudgetChart = async () => {
|
||||
await nextTick()
|
||||
await nextTick();
|
||||
if (budgetChart.value) {
|
||||
budgetChartInstance = echarts.init(budgetChart.value)
|
||||
budgetChartInstance = echarts.init(budgetChart.value);
|
||||
if (hasBudgetData.value) {
|
||||
renderBudgetChart()
|
||||
renderBudgetChart();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 验证绩效指标分值占比总和
|
||||
const validatePerformanceIndicators = () => {
|
||||
console.log('=== 校验绩效指标 ===')
|
||||
console.log('=== 校验绩效指标 ===');
|
||||
|
||||
// 直接使用绩效指标组件的校验方法
|
||||
if (performanceIndicatorsRef?.value && typeof performanceIndicatorsRef.value.validate === 'function') {
|
||||
const validationResult = performanceIndicatorsRef.value.validate()
|
||||
console.log('绩效指标校验结果:', validationResult)
|
||||
return validationResult
|
||||
const validationResult = performanceIndicatorsRef.value.validate();
|
||||
console.log('绩效指标校验结果:', validationResult);
|
||||
return validationResult;
|
||||
}
|
||||
|
||||
// 回退方案:检查form中的数据
|
||||
if (!form.performanceIndicators || form.performanceIndicators.length === 0) {
|
||||
return { valid: false, message: '请至少添加一个绩效指标' }
|
||||
return { valid: false, message: '请至少添加一个绩效指标' };
|
||||
}
|
||||
|
||||
const totalWeight = form.performanceIndicators.reduce((sum, item) => {
|
||||
return sum + (Number(item.weightPercentage) || 0)
|
||||
}, 0)
|
||||
return sum + (Number(item.weightPercentage) || 0);
|
||||
}, 0);
|
||||
|
||||
if (Math.abs(totalWeight - 100) > 0.1) {
|
||||
return {
|
||||
valid: false,
|
||||
message: `绩效指标分值占比总和必须等于100%,当前为${totalWeight}%`
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true }
|
||||
}
|
||||
return { valid: true };
|
||||
};
|
||||
|
||||
// 步骤操作
|
||||
const handleNextStep = async () => {
|
||||
const formRefs = [basicFormRef, contentFormRef, budgetFormRef, performanceFormRef]
|
||||
const currentFormRef = formRefs[currentStep.value]
|
||||
const formRefs = [basicFormRef, contentFormRef, budgetFormRef, performanceFormRef];
|
||||
const currentFormRef = formRefs[currentStep.value];
|
||||
|
||||
if (currentFormRef?.value) {
|
||||
try {
|
||||
await currentFormRef.value.validate()
|
||||
await currentFormRef.value.validate();
|
||||
|
||||
// 如果是绩效指标步骤(第3步),额外校验分值占比
|
||||
if (currentStep.value === 3) {
|
||||
const validationResult = validatePerformanceIndicators()
|
||||
const validationResult = validatePerformanceIndicators();
|
||||
if (!validationResult.valid) {
|
||||
ElMessage.error(validationResult.message)
|
||||
return
|
||||
ElMessage.error(validationResult.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
currentStep.value++
|
||||
currentStep.value++;
|
||||
|
||||
// 初始化图表
|
||||
if (currentStep.value === 2) {
|
||||
setTimeout(initBudgetChart, 100)
|
||||
setTimeout(initBudgetChart, 100);
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('请完善当前步骤的必填信息')
|
||||
ElMessage.error('请完善当前步骤的必填信息');
|
||||
}
|
||||
} else {
|
||||
// 如果是绩效指标步骤(第3步),即使没有表单ref也要校验分值占比
|
||||
if (currentStep.value === 3) {
|
||||
const validationResult = validatePerformanceIndicators()
|
||||
const validationResult = validatePerformanceIndicators();
|
||||
if (!validationResult.valid) {
|
||||
ElMessage.error(validationResult.message)
|
||||
return
|
||||
ElMessage.error(validationResult.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
currentStep.value++
|
||||
currentStep.value++;
|
||||
|
||||
// 初始化图表
|
||||
if (currentStep.value === 2) {
|
||||
setTimeout(initBudgetChart, 100)
|
||||
setTimeout(initBudgetChart, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const handlePrevStep = () => {
|
||||
currentStep.value--
|
||||
}
|
||||
currentStep.value--;
|
||||
};
|
||||
|
||||
// 处理绩效指标变化
|
||||
const handlePerformanceIndicatorsChange = (indicators) => {
|
||||
console.log('=== 绩效指标数据变化 ===')
|
||||
console.log('接收到的indicators:', indicators)
|
||||
console.log('=== 绩效指标数据变化 ===');
|
||||
console.log('接收到的indicators:', indicators);
|
||||
|
||||
// 为每个指标添加必要的字段
|
||||
const processedIndicators = indicators.map((item, index) => ({
|
||||
@@ -800,147 +723,145 @@ const handlePerformanceIndicatorsChange = (indicators) => {
|
||||
measurementMethod: item.measurementMethod || '',
|
||||
dataSource: item.dataSource || '',
|
||||
isQuantitative: item.isQuantitative !== undefined ? item.isQuantitative : true
|
||||
}))
|
||||
}));
|
||||
|
||||
form.performanceIndicators = processedIndicators
|
||||
console.log('处理后的绩效指标数据:', form.performanceIndicators)
|
||||
form.performanceIndicators = processedIndicators;
|
||||
console.log('处理后的绩效指标数据:', form.performanceIndicators);
|
||||
|
||||
// 自动生成总绩效目标和当年目标(如果有目标值)
|
||||
const totalGoals = processedIndicators
|
||||
.filter(item => item.targetValue && !isNaN(Number(item.targetValue)))
|
||||
.reduce((sum, item) => sum + Number(item.targetValue), 0)
|
||||
.filter((item) => item.targetValue && !isNaN(Number(item.targetValue)))
|
||||
.reduce((sum, item) => sum + Number(item.targetValue), 0);
|
||||
|
||||
if (totalGoals > 0) {
|
||||
form.totalPerformanceGoal = totalGoals
|
||||
form.currentYearGoal = totalGoals
|
||||
console.log('自动生成总绩效目标:', form.totalPerformanceGoal)
|
||||
form.totalPerformanceGoal = totalGoals;
|
||||
form.currentYearGoal = totalGoals;
|
||||
console.log('自动生成总绩效目标:', form.totalPerformanceGoal);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 保存草稿
|
||||
const handleSaveDraft = async () => {
|
||||
try {
|
||||
savingDraft.value = true
|
||||
savingDraft.value = true;
|
||||
|
||||
// 如果当前在绩效指标步骤(第3步),校验分值占比总和
|
||||
if (currentStep.value === 3 && form.performanceIndicators && form.performanceIndicators.length > 0) {
|
||||
const validationResult = validatePerformanceIndicators()
|
||||
const validationResult = validatePerformanceIndicators();
|
||||
if (!validationResult.valid) {
|
||||
ElMessage.warning(`保存提醒:${validationResult.message}`)
|
||||
ElMessage.warning(`保存提醒:${validationResult.message}`);
|
||||
// 注意:这里只是警告,不阻止保存草稿
|
||||
}
|
||||
}
|
||||
|
||||
// 详细调试信息
|
||||
console.log('=== 前端保存草稿调试信息 ===')
|
||||
console.log('form.performanceIndicators 是否存在:', !!form.performanceIndicators)
|
||||
console.log('form.performanceIndicators 长度:', form.performanceIndicators ? form.performanceIndicators.length : 'undefined')
|
||||
console.log('form.performanceIndicators 数据:', form.performanceIndicators)
|
||||
console.log('完整的form数据:', form)
|
||||
console.log('=== 前端保存草稿调试信息 ===');
|
||||
console.log('form.performanceIndicators 是否存在:', !!form.performanceIndicators);
|
||||
console.log('form.performanceIndicators 长度:', form.performanceIndicators ? form.performanceIndicators.length : 'undefined');
|
||||
console.log('form.performanceIndicators 数据:', form.performanceIndicators);
|
||||
console.log('完整的form数据:', form);
|
||||
|
||||
const result = form.id
|
||||
? await updateProjectApplication(form as any)
|
||||
: await saveDraft(form as any)
|
||||
const result = form.id ? await updateProjectApplication(form as any) : await saveDraft(form as any);
|
||||
|
||||
if (result.code === 200) {
|
||||
// 如果是新建草稿,获取生成的ID和申报编号
|
||||
if (!form.id && result.data?.id) {
|
||||
form.id = result.data.id
|
||||
form.applicationNo = result.data.applicationNo
|
||||
console.log('草稿保存成功,获得ID:', form.id, '申报编号:', form.applicationNo)
|
||||
form.id = result.data.id;
|
||||
form.applicationNo = result.data.applicationNo;
|
||||
console.log('草稿保存成功,获得ID:', form.id, '申报编号:', form.applicationNo);
|
||||
}
|
||||
|
||||
// 绩效指标数据已经作为form的一部分传递给后端,无需单独处理
|
||||
console.log('绩效指标数据已随草稿数据一起保存,数量:', form.performanceIndicators ? form.performanceIndicators.length : 0)
|
||||
console.log('绩效指标数据已随草稿数据一起保存,数量:', form.performanceIndicators ? form.performanceIndicators.length : 0);
|
||||
|
||||
ElMessage.success('草稿保存成功')
|
||||
ElMessage.success('草稿保存成功');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('保存草稿失败:', error)
|
||||
ElMessage.error('保存草稿失败')
|
||||
console.error('保存草稿失败:', error);
|
||||
ElMessage.error('保存草稿失败');
|
||||
} finally {
|
||||
savingDraft.value = false
|
||||
savingDraft.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 提交申报
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
submitting.value = true
|
||||
submitting.value = true;
|
||||
|
||||
console.log('开始提交申报流程,form.id:', form.id)
|
||||
console.log('开始提交申报流程,form.id:', form.id);
|
||||
|
||||
// 先保存数据
|
||||
if (!form.id) {
|
||||
console.log('新增申报,调用addProjectApplication')
|
||||
const saveResult = await addProjectApplication(form as any)
|
||||
console.log('新增申报结果:', saveResult)
|
||||
console.log('新增申报,调用addProjectApplication');
|
||||
const saveResult = await addProjectApplication(form as any);
|
||||
console.log('新增申报结果:', saveResult);
|
||||
if (saveResult.code === 200) {
|
||||
if (saveResult.data && saveResult.data.id) {
|
||||
form.id = saveResult.data.id
|
||||
form.applicationNo = saveResult.data.applicationNo
|
||||
console.log('新增成功,获得ID:', form.id, '申报编号:', form.applicationNo)
|
||||
form.id = saveResult.data.id;
|
||||
form.applicationNo = saveResult.data.applicationNo;
|
||||
console.log('新增成功,获得ID:', form.id, '申报编号:', form.applicationNo);
|
||||
} else {
|
||||
console.error('新增申报返回的数据异常:', saveResult)
|
||||
ElMessage.error('保存申报数据失败: 返回数据格式异常')
|
||||
return
|
||||
console.error('新增申报返回的数据异常:', saveResult);
|
||||
ElMessage.error('保存申报数据失败: 返回数据格式异常');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
console.error('新增申报失败:', saveResult)
|
||||
ElMessage.error('保存申报数据失败: ' + (saveResult.msg || '未知错误'))
|
||||
return
|
||||
console.error('新增申报失败:', saveResult);
|
||||
ElMessage.error('保存申报数据失败: ' + (saveResult.msg || '未知错误'));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
console.log('更新申报,调用updateProjectApplication,ID:', form.id)
|
||||
const updateResult = await updateProjectApplication(form as any)
|
||||
console.log('更新申报结果:', updateResult)
|
||||
console.log('更新申报,调用updateProjectApplication,ID:', form.id);
|
||||
const updateResult = await updateProjectApplication(form as any);
|
||||
console.log('更新申报结果:', updateResult);
|
||||
if (updateResult.code !== 200) {
|
||||
console.error('更新申报失败:', updateResult)
|
||||
ElMessage.error('更新申报数据失败: ' + (updateResult.msg || '未知错误'))
|
||||
return
|
||||
console.error('更新申报失败:', updateResult);
|
||||
ElMessage.error('更新申报数据失败: ' + (updateResult.msg || '未知错误'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 绩效指标数据会作为form的一部分自动传递给后端,无需单独保存
|
||||
console.log('绩效指标数据将随申报数据一起提交,数量:', form.performanceIndicators ? form.performanceIndicators.length : 0)
|
||||
console.log('绩效指标数据将随申报数据一起提交,数量:', form.performanceIndicators ? form.performanceIndicators.length : 0);
|
||||
|
||||
// 再提交审批
|
||||
if (!form.id) {
|
||||
console.error('申报ID为空,无法提交审批')
|
||||
ElMessage.error('申报ID为空,无法提交审批')
|
||||
return
|
||||
console.error('申报ID为空,无法提交审批');
|
||||
ElMessage.error('申报ID为空,无法提交审批');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('开始提交审批,ID:', form.id)
|
||||
const submitResult = await submitApplication(form.id)
|
||||
console.log('提交审批结果:', submitResult)
|
||||
console.log('开始提交审批,ID:', form.id);
|
||||
const submitResult = await submitApplication(form.id);
|
||||
console.log('提交审批结果:', submitResult);
|
||||
|
||||
if (submitResult.code === 200) {
|
||||
ElMessage.success('申报提交成功')
|
||||
router.push('/cw/application')
|
||||
ElMessage.success('申报提交成功');
|
||||
router.push('/cw/application');
|
||||
} else {
|
||||
console.error('提交审批失败:', submitResult)
|
||||
ElMessage.error('提交申报失败: ' + (submitResult.msg || '未知错误'))
|
||||
console.error('提交审批失败:', submitResult);
|
||||
ElMessage.error('提交申报失败: ' + (submitResult.msg || '未知错误'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交申报失败详细错误:', error)
|
||||
console.error('提交申报失败详细错误:', error);
|
||||
|
||||
// 解析错误信息
|
||||
let errorMessage = '提交申报失败'
|
||||
let errorMessage = '提交申报失败';
|
||||
if (error?.response?.data?.msg) {
|
||||
errorMessage += ': ' + error.response.data.msg
|
||||
errorMessage += ': ' + error.response.data.msg;
|
||||
} else if (error?.message) {
|
||||
errorMessage += ': ' + error.message
|
||||
errorMessage += ': ' + error.message;
|
||||
} else if (typeof error === 'string') {
|
||||
errorMessage += ': ' + error
|
||||
errorMessage += ': ' + error;
|
||||
}
|
||||
|
||||
console.error('最终错误信息:', errorMessage)
|
||||
ElMessage.error(errorMessage)
|
||||
console.error('最终错误信息:', errorMessage);
|
||||
ElMessage.error(errorMessage);
|
||||
} finally {
|
||||
submitting.value = false
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 取消操作
|
||||
const handleCancel = () => {
|
||||
@@ -949,54 +870,54 @@ const handleCancel = () => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
router.push('/cw/application')
|
||||
})
|
||||
}
|
||||
router.push('/cw/application');
|
||||
});
|
||||
};
|
||||
|
||||
// 加载数据
|
||||
const loadData = async () => {
|
||||
const id = route.params.id as string
|
||||
const id = route.params.id as string;
|
||||
if (id && id !== 'add') {
|
||||
try {
|
||||
console.log('开始加载申报数据,ID:', id)
|
||||
const response = await getProjectApplication(id)
|
||||
console.log('开始加载申报数据,ID:', id);
|
||||
const response = await getProjectApplication(id);
|
||||
if (response.code === 200) {
|
||||
console.log('申报基础数据加载成功:', response.data)
|
||||
Object.assign(form, response.data)
|
||||
console.log('申报基础数据加载成功:', response.data);
|
||||
Object.assign(form, response.data);
|
||||
|
||||
// 检查是否有绩效指标数据
|
||||
if (response.data.performanceIndicators && response.data.performanceIndicators.length > 0) {
|
||||
console.log('发现绩效指标数据,数量:', response.data.performanceIndicators.length)
|
||||
form.performanceIndicators = response.data.performanceIndicators
|
||||
console.log('绩效指标数据已加载到form.performanceIndicators:', form.performanceIndicators)
|
||||
console.log('发现绩效指标数据,数量:', response.data.performanceIndicators.length);
|
||||
form.performanceIndicators = response.data.performanceIndicators;
|
||||
console.log('绩效指标数据已加载到form.performanceIndicators:', form.performanceIndicators);
|
||||
} else {
|
||||
console.log('没有绩效指标数据')
|
||||
form.performanceIndicators = []
|
||||
console.log('没有绩效指标数据');
|
||||
form.performanceIndicators = [];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载数据失败:', error)
|
||||
ElMessage.error('加载数据失败')
|
||||
console.error('加载数据失败:', error);
|
||||
ElMessage.error('加载数据失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露给父组件的方法
|
||||
const validate = (callback: (valid: boolean) => void) => {
|
||||
// 简单的验证逻辑,检查必填字段
|
||||
const isValid = !!(form.projectName && form.principal && form.totalInvestment > 0)
|
||||
callback(isValid)
|
||||
}
|
||||
const isValid = !!(form.projectName && form.principal && form.totalInvestment > 0);
|
||||
callback(isValid);
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
validate
|
||||
})
|
||||
});
|
||||
|
||||
// 组件挂载
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
loadData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -64,71 +64,50 @@
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申报编号" prop="applicationNo">
|
||||
<el-input
|
||||
v-model="queryParams.applicationNo"
|
||||
placeholder="请输入申报编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目负责人" prop="principal">
|
||||
<el-input
|
||||
v-model="queryParams.principal"
|
||||
placeholder="请输入项目负责人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批状态" prop="approvalStatus">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申报编号" prop="applicationNo">
|
||||
<el-input v-model="queryParams.applicationNo" placeholder="请输入申报编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目负责人" prop="principal">
|
||||
<el-input v-model="queryParams.principal" placeholder="请输入项目负责人" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择审批状态" clearable style="width: 100%">
|
||||
<el-option label="草稿" value="draft"/>
|
||||
<el-option label="已提交" value="submitted"/>
|
||||
<el-option label="审批中" value="approving"/>
|
||||
<el-option label="已通过" value="approved"/>
|
||||
<el-option label="已拒绝" value="rejected"/>
|
||||
<el-option label="已退回" value="returned"/>
|
||||
<el-option label="已取消" value="cancelled"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="预算年度" prop="year">
|
||||
<el-date-picker
|
||||
v-model="queryParams.year"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-option label="草稿" value="draft" />
|
||||
<el-option label="已提交" value="submitted" />
|
||||
<el-option label="审批中" value="approving" />
|
||||
<el-option label="已通过" value="approved" />
|
||||
<el-option label="已拒绝" value="rejected" />
|
||||
<el-option label="已退回" value="returned" />
|
||||
<el-option label="已取消" value="cancelled" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="预算年度" prop="year">
|
||||
<el-date-picker v-model="queryParams.year" type="year" placeholder="选择年份" value-format="YYYY" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
@@ -137,40 +116,14 @@
|
||||
<div class="card-header">
|
||||
<span class="toolbar-title">项目申报管理</span>
|
||||
<div class="toolbar-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['cw:application:add']"
|
||||
>新增申报</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['cw:application:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
type="info"
|
||||
icon="Upload"
|
||||
@click="handleSubmit"
|
||||
:disabled="multiple"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
>提交审批</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['cw:application:export']"
|
||||
>导出</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['cw:application:add']">新增申报</el-button>
|
||||
<el-button type="success" icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['cw:application:edit']">修改</el-button>
|
||||
<el-button type="danger" icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:application:remove']">删除</el-button>
|
||||
<el-button type="info" icon="Upload" @click="handleSubmit" :disabled="multiple" v-hasPermi="['cw:application:submit']"
|
||||
>提交审批</el-button
|
||||
>
|
||||
<el-button type="warning" icon="Download" @click="handleExport" v-hasPermi="['cw:application:export']">导出</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -179,13 +132,8 @@
|
||||
<!-- 数据表格区域 -->
|
||||
<el-card class="table-card">
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="applicationList"
|
||||
@selection-change="handleSelectionChange"
|
||||
class="scroll-table"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table v-loading="loading" :data="applicationList" @selection-change="handleSelectionChange" class="scroll-table">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="申报编号" align="center" prop="applicationNo" min-width="140" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="项目负责人" align="center" prop="principal" min-width="100" />
|
||||
@@ -197,43 +145,26 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批状态" align="center" prop="approvalStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getStatusTagType(scope.row.approvalStatus)"
|
||||
effect="light"
|
||||
>
|
||||
{{ getStatusText(scope.row.approvalStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusTagType(scope.row.approvalStatus)" effect="light">
|
||||
{{ getStatusText(scope.row.approvalStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" min-width="160">
|
||||
<template #default="scope">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<template #default="scope">
|
||||
<div class="action-buttons">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="View"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['cw:application:query']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button type="primary" icon="View" circle size="small" @click="handleView(scope.row)" v-hasPermi="['cw:application:query']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑" placement="top" v-if="scope.row.approvalStatus === 'draft'">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="Edit"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-button type="success" icon="Edit" circle size="small" @click="handleUpdate(scope.row)" v-hasPermi="['cw:application:edit']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="提交审批" placement="top" v-if="scope.row.approvalStatus === 'draft'">
|
||||
<el-button
|
||||
type="warning"
|
||||
@@ -243,7 +174,7 @@
|
||||
@click="handleSubmit(scope.row)"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="撤回" placement="top" v-if="scope.row.approvalStatus === 'submitted'">
|
||||
<el-button
|
||||
type="info"
|
||||
@@ -253,7 +184,7 @@
|
||||
@click="handleWithdraw(scope.row)"
|
||||
v-hasPermi="['cw:application:withdraw']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="['draft', 'cancelled'].includes(scope.row.approvalStatus)">
|
||||
<el-button
|
||||
type="danger"
|
||||
@@ -263,22 +194,16 @@
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cw:application:remove']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -306,12 +231,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProjectApplication, getProjectApplication, delProjectApplication, addProjectApplication, updateProjectApplication, submitApplication, getApplicationStatistics } from "@/api/cw/projectApplication"
|
||||
import ApplicationForm from "./form.vue"
|
||||
import ApplicationSummary from "./summary.vue"
|
||||
import {
|
||||
listProjectApplication,
|
||||
getProjectApplication,
|
||||
delProjectApplication,
|
||||
addProjectApplication,
|
||||
updateProjectApplication,
|
||||
submitApplication,
|
||||
getApplicationStatistics
|
||||
} from '@/api/cw/projectApplication';
|
||||
import ApplicationForm from './form.vue';
|
||||
import ApplicationSummary from './summary.vue';
|
||||
|
||||
export default {
|
||||
name: "ProjectApplication",
|
||||
name: 'ProjectApplication',
|
||||
components: {
|
||||
ApplicationForm,
|
||||
ApplicationSummary
|
||||
@@ -333,7 +266,7 @@ export default {
|
||||
// 项目申报表格数据
|
||||
applicationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示查看对话框
|
||||
@@ -359,45 +292,47 @@ export default {
|
||||
approvedCount: 0,
|
||||
pendingCount: 0,
|
||||
draftCount: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getStatistics()
|
||||
this.getList();
|
||||
this.getStatistics();
|
||||
},
|
||||
methods: {
|
||||
/** 查询项目申报列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listProjectApplication(this.queryParams).then(response => {
|
||||
this.applicationList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
this.loading = true;
|
||||
listProjectApplication(this.queryParams).then((response) => {
|
||||
this.applicationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 获取统计数据 */
|
||||
getStatistics() {
|
||||
// 调用专门的统计API接口
|
||||
const year = this.queryParams.year ? parseInt(this.queryParams.year) : null
|
||||
getApplicationStatistics(year).then(response => {
|
||||
const data = response.data
|
||||
this.totalCount = data.totalCount || 0
|
||||
this.approvedCount = data.approvedCount || 0
|
||||
this.pendingCount = data.approvingCount || 0 // 注意:后端返回的是approvingCount
|
||||
this.draftCount = data.draftCount || 0
|
||||
}).catch(error => {
|
||||
console.error('获取统计数据失败:', error)
|
||||
// 如果API失败,使用本地计算作为后备方案
|
||||
this.totalCount = this.applicationList.length
|
||||
this.approvedCount = this.applicationList.filter(item => item.approvalStatus === 'approved').length
|
||||
this.pendingCount = this.applicationList.filter(item => item.approvalStatus === 'approving').length
|
||||
this.draftCount = this.applicationList.filter(item => item.approvalStatus === 'draft').length
|
||||
})
|
||||
const year = this.queryParams.year ? parseInt(this.queryParams.year) : null;
|
||||
getApplicationStatistics(year)
|
||||
.then((response) => {
|
||||
const data = response.data;
|
||||
this.totalCount = data.totalCount || 0;
|
||||
this.approvedCount = data.approvedCount || 0;
|
||||
this.pendingCount = data.approvingCount || 0; // 注意:后端返回的是approvingCount
|
||||
this.draftCount = data.draftCount || 0;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取统计数据失败:', error);
|
||||
// 如果API失败,使用本地计算作为后备方案
|
||||
this.totalCount = this.applicationList.length;
|
||||
this.approvedCount = this.applicationList.filter((item) => item.approvalStatus === 'approved').length;
|
||||
this.pendingCount = this.applicationList.filter((item) => item.approvalStatus === 'approving').length;
|
||||
this.draftCount = this.applicationList.filter((item) => item.approvalStatus === 'draft').length;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
@@ -438,113 +373,130 @@ export default {
|
||||
futureYearOther: 0,
|
||||
performanceIndicators: [],
|
||||
approvalStatus: 'draft'
|
||||
}
|
||||
};
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
this.getStatistics() // 搜索时也更新统计数据
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.getStatistics(); // 搜索时也更新统计数据
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryRef")
|
||||
this.handleQuery()
|
||||
this.resetForm('queryRef');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加项目申报"
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加项目申报';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getProjectApplication(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改项目申报"
|
||||
})
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getProjectApplication(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改项目申报';
|
||||
});
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
this.currentId = row.id
|
||||
this.viewOpen = true
|
||||
this.currentId = row.id;
|
||||
this.viewOpen = true;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["applicationFormRef"].validate((valid) => {
|
||||
this.$refs['applicationFormRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateProjectApplication(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
this.getStatistics() // 修改后更新统计
|
||||
})
|
||||
updateProjectApplication(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getStatistics(); // 修改后更新统计
|
||||
});
|
||||
} else {
|
||||
addProjectApplication(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
this.getStatistics() // 新增后更新统计
|
||||
})
|
||||
addProjectApplication(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getStatistics(); // 新增后更新统计
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除项目申报编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delProjectApplication(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.getStatistics() // 删除后更新统计
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除项目申报编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delProjectApplication(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.getStatistics(); // 删除后更新统计
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 提交审批 */
|
||||
handleSubmit(row) {
|
||||
const applications = row?.applicationNo ? [row.applicationNo] : this.applicationList.filter(item => this.ids.includes(item.id)).map(item => item.applicationNo)
|
||||
const applications = row?.applicationNo
|
||||
? [row.applicationNo]
|
||||
: this.applicationList.filter((item) => this.ids.includes(item.id)).map((item) => item.applicationNo);
|
||||
|
||||
this.$modal.confirm('是否确认提交申报编号为"' + applications.join('", "') + '"的数据项?').then(() => {
|
||||
return submitApplication(row?.id || this.ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.getStatistics() // 提交后更新统计
|
||||
this.$modal.msgSuccess("提交成功")
|
||||
}).catch(() => {})
|
||||
this.$modal
|
||||
.confirm('是否确认提交申报编号为"' + applications.join('", "') + '"的数据项?')
|
||||
.then(() => {
|
||||
return submitApplication(row?.id || this.ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.getStatistics(); // 提交后更新统计
|
||||
this.$modal.msgSuccess('提交成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 撤回申请 */
|
||||
handleWithdraw(row) {
|
||||
this.$modal.confirm('是否确认撤回该申报?').then(() => {
|
||||
// 调用撤回接口
|
||||
this.$modal.msgSuccess("撤回成功")
|
||||
this.getList()
|
||||
this.getStatistics() // 撤回后更新统计
|
||||
}).catch(() => {})
|
||||
this.$modal
|
||||
.confirm('是否确认撤回该申报?')
|
||||
.then(() => {
|
||||
// 调用撤回接口
|
||||
this.$modal.msgSuccess('撤回成功');
|
||||
this.getList();
|
||||
this.getStatistics(); // 撤回后更新统计
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cw/application/export', {
|
||||
...this.queryParams
|
||||
}, `application_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'cw/application/export',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`application_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 格式化金额 */
|
||||
formatAmount(amount) {
|
||||
if (!amount) return '0.00'
|
||||
if (!amount) return '0.00';
|
||||
return parseFloat(amount).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
})
|
||||
});
|
||||
},
|
||||
/** 获取状态标签类型 */
|
||||
getStatusTagType(status) {
|
||||
@@ -556,8 +508,8 @@ export default {
|
||||
rejected: 'danger',
|
||||
returned: 'warning',
|
||||
cancelled: 'info'
|
||||
}
|
||||
return statusMap[status] || 'info'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
},
|
||||
/** 获取状态文本 */
|
||||
getStatusText(status) {
|
||||
@@ -569,11 +521,11 @@ export default {
|
||||
rejected: '已拒绝',
|
||||
returned: '已退回',
|
||||
cancelled: '已取消'
|
||||
}
|
||||
return statusMap[status] || '未知'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -598,8 +550,8 @@ export default {
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 16px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
@@ -621,7 +573,7 @@ export default {
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
font-size: 14px;
|
||||
opacity: 0.8;
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -650,7 +602,8 @@ export default {
|
||||
}
|
||||
|
||||
/* 卡片样式 */
|
||||
.button-card, .table-card {
|
||||
.button-card,
|
||||
.table-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-tag :type="currentApplication.targetSme ? 'success' : 'info'">
|
||||
小微企业发展: {{ currentApplication.targetSme ? '是' : '否' }}
|
||||
</el-tag>
|
||||
<el-tag :type="currentApplication.targetSme ? 'success' : 'info'"> 小微企业发展: {{ currentApplication.targetSme ? '是' : '否' }} </el-tag>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-tag :type="currentApplication.targetMicroSme ? 'success' : 'info'">
|
||||
@@ -122,7 +120,7 @@
|
||||
<div class="budget-section">
|
||||
<h4>分年度预算明细</h4>
|
||||
<el-table :data="budgetBreakdown" border>
|
||||
<el-table-column prop="year" label="年度" width="120" align="center"/>
|
||||
<el-table-column prop="year" label="年度" width="120" align="center" />
|
||||
<el-table-column prop="total" label="总投资" align="right">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.total) }}
|
||||
@@ -155,7 +153,7 @@
|
||||
<el-tag type="warning" size="small">分值占比总和:{{ performanceIndicatorTotal }}%</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<el-table :data="validPerformanceIndicators" border style="width: 100%">
|
||||
<el-table-column label="指标类型" width="120" align="center">
|
||||
<template #default="scope">
|
||||
@@ -229,7 +227,7 @@ const currentApplication = computed(() => {
|
||||
console.log('application数据:', props.application);
|
||||
return props.application;
|
||||
}
|
||||
|
||||
|
||||
// 否则使用内部获取的数据
|
||||
console.log('=== 使用内部获取的application数据 ===');
|
||||
console.log('internalApplication数据:', internalApplication.value);
|
||||
@@ -239,10 +237,10 @@ const currentApplication = computed(() => {
|
||||
// 获取申报详情数据
|
||||
const fetchApplicationData = async (id) => {
|
||||
if (!id) return;
|
||||
|
||||
|
||||
console.log('=== ApplicationSummary 开始获取数据 ===');
|
||||
console.log('applicationId:', id);
|
||||
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await getProjectApplication(id);
|
||||
@@ -250,25 +248,25 @@ const fetchApplicationData = async (id) => {
|
||||
console.log('API响应:', response);
|
||||
console.log('响应数据:', response.data);
|
||||
console.log('响应数据类型:', typeof response.data);
|
||||
|
||||
|
||||
// 特别检查绩效指标字段
|
||||
if (response.data) {
|
||||
console.log('=== API响应中的绩效指标检查 ===');
|
||||
console.log('response.data.performanceIndicators:', response.data.performanceIndicators);
|
||||
console.log('performanceIndicators类型:', typeof response.data.performanceIndicators);
|
||||
console.log('是否为数组:', Array.isArray(response.data.performanceIndicators));
|
||||
|
||||
|
||||
// 检查所有可能的绩效指标字段名
|
||||
console.log('可能的字段名检查:');
|
||||
console.log('- performanceIndicators:', response.data.performanceIndicators);
|
||||
console.log('- performance_indicators:', response.data.performance_indicators);
|
||||
console.log('- indicators:', response.data.indicators);
|
||||
console.log('- performanceIndicatorList:', response.data.performanceIndicatorList);
|
||||
|
||||
|
||||
// 列出所有字段
|
||||
console.log('响应数据的所有字段:', Object.keys(response.data));
|
||||
}
|
||||
|
||||
|
||||
internalApplication.value = response.data || {};
|
||||
} catch (error) {
|
||||
console.error('=== ApplicationSummary API调用失败 ===');
|
||||
@@ -280,18 +278,22 @@ const fetchApplicationData = async (id) => {
|
||||
};
|
||||
|
||||
// 监听applicationId变化
|
||||
watch(() => props.applicationId, (newId) => {
|
||||
if (newId && (!props.application || Object.keys(props.application).length === 0)) {
|
||||
fetchApplicationData(newId);
|
||||
}
|
||||
}, { immediate: true });
|
||||
watch(
|
||||
() => props.applicationId,
|
||||
(newId) => {
|
||||
if (newId && (!props.application || Object.keys(props.application).length === 0)) {
|
||||
fetchApplicationData(newId);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 组件挂载时检查是否需要获取数据
|
||||
onMounted(() => {
|
||||
console.log('=== ApplicationSummary 组件挂载 ===');
|
||||
console.log('props.application:', props.application);
|
||||
console.log('props.applicationId:', props.applicationId);
|
||||
|
||||
|
||||
// 如果没有传入application但有applicationId,则获取数据
|
||||
if (props.applicationId && (!props.application || Object.keys(props.application).length === 0)) {
|
||||
fetchApplicationData(props.applicationId);
|
||||
@@ -301,10 +303,7 @@ onMounted(() => {
|
||||
// 判断是否有项目内容
|
||||
const hasProjectContent = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
return app.applicationReason ||
|
||||
app.constructionContent ||
|
||||
app.totalPerformanceGoal ||
|
||||
app.currentYearGoal;
|
||||
return app.applicationReason || app.constructionContent || app.totalPerformanceGoal || app.currentYearGoal;
|
||||
});
|
||||
|
||||
// 判断是否有绩效指标
|
||||
@@ -315,14 +314,14 @@ const hasPerformanceIndicators = computed(() => {
|
||||
console.log('app.performanceIndicators类型:', typeof app.performanceIndicators);
|
||||
console.log('app.performanceIndicators值:', app.performanceIndicators);
|
||||
console.log('是否为数组:', Array.isArray(app.performanceIndicators));
|
||||
|
||||
|
||||
if (app.performanceIndicators) {
|
||||
console.log('绩效指标数组长度:', app.performanceIndicators.length);
|
||||
console.log('绩效指标数组内容:', JSON.stringify(app.performanceIndicators, null, 2));
|
||||
} else {
|
||||
console.log('绩效指标数据为空或未定义');
|
||||
}
|
||||
|
||||
|
||||
const hasIndicators = app.performanceIndicators && app.performanceIndicators.length > 0;
|
||||
console.log('最终判断 - 是否有绩效指标:', hasIndicators);
|
||||
return hasIndicators;
|
||||
@@ -346,18 +345,18 @@ const validPerformanceIndicators = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
console.log('=== validPerformanceIndicators 计算 ===');
|
||||
console.log('app.performanceIndicators:', app.performanceIndicators);
|
||||
|
||||
|
||||
if (!app.performanceIndicators) {
|
||||
console.log('没有绩效指标数据,返回空数组');
|
||||
return [];
|
||||
}
|
||||
|
||||
const validIndicators = app.performanceIndicators.filter(indicator => {
|
||||
|
||||
const validIndicators = app.performanceIndicators.filter((indicator) => {
|
||||
const weight = parseFloat(indicator.weightPercentage) || 0;
|
||||
console.log(`指标 ${indicator.goalName}: 权重=${indicator.weightPercentage}, 解析后权重=${weight}, 是否有效=${weight > 0}`);
|
||||
return weight > 0;
|
||||
});
|
||||
|
||||
|
||||
console.log('有效绩效指标数量:', validIndicators.length);
|
||||
console.log('有效绩效指标详情:', validIndicators);
|
||||
return validIndicators;
|
||||
@@ -397,7 +396,7 @@ const budgetBreakdown = computed(() => {
|
||||
self: app.futureYearSelf || 0,
|
||||
other: app.futureYearOther || 0
|
||||
}
|
||||
].filter(item => item.total > 0); // 只显示有预算的年度
|
||||
].filter((item) => item.total > 0); // 只显示有预算的年度
|
||||
});
|
||||
|
||||
// 格式化金额
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-form-item label="审批状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择审批状态" clearable style="width: 100%">
|
||||
<template v-if="cw_approval_status && cw_approval_status.length > 0">
|
||||
<el-option v-for="dict in cw_approval_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in cw_approval_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -104,24 +104,14 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Check"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchApprove"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
>批量通过</el-button>
|
||||
<el-button type="success" plain icon="Check" :disabled="multiple" @click="handleBatchApprove" v-hasPermi="['cw:application:approve']"
|
||||
>批量通过</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Close"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchReject"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
>批量拒绝</el-button>
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReject" v-hasPermi="['cw:application:approve']"
|
||||
>批量拒绝</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExport" v-hasPermi="['cw:approvalRecord:export']">导出</el-button>
|
||||
@@ -169,38 +159,26 @@
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="info" icon="View" @click="handleView(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
<!-- 待审批状态可以进行审批操作 -->
|
||||
<template v-if="scope.row.approvalStatus === 'submitted' || scope.row.approvalStatus === 'approving'">
|
||||
<el-tooltip content="通过" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
@click="handleApprove(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
<el-button link type="success" icon="Check" @click="handleApprove(scope.row)" v-hasPermi="['cw:application:approve']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="拒绝" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Close"
|
||||
@click="handleReject(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
<el-button link type="danger" icon="Close" @click="handleReject(scope.row)" v-hasPermi="['cw:application:approve']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="退回" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="RefreshLeft"
|
||||
@click="handleReturn(scope.row)"
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="RefreshLeft"
|
||||
@click="handleReturn(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- 所有状态都可以查看审批记录 -->
|
||||
<el-tooltip content="审批记录" placement="top">
|
||||
<el-button link type="primary" icon="Document" @click="handleApprovalHistory(scope.row)"></el-button>
|
||||
@@ -209,25 +187,19 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="queryParams.pageNum = $event"
|
||||
@update:limit="queryParams.pageSize = $event"
|
||||
@pagination="getList"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 审批对话框 -->
|
||||
<el-dialog
|
||||
v-model="approvalDialog.visible"
|
||||
:title="approvalDialog.title"
|
||||
width="800px"
|
||||
append-to-body
|
||||
@close="closeApprovalDialog"
|
||||
>
|
||||
<el-dialog v-model="approvalDialog.visible" :title="approvalDialog.title" width="800px" append-to-body @close="closeApprovalDialog">
|
||||
<el-form ref="approvalFormRef" :model="approvalForm" :rules="approvalRules" label-width="120px">
|
||||
<!-- 申报信息展示 -->
|
||||
<el-form-item label="申报信息">
|
||||
@@ -240,7 +212,7 @@
|
||||
<el-descriptions-item label="预算年度">{{ currentApplication.year }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 审批决定 -->
|
||||
<el-form-item label="审批决定" prop="approvalResult">
|
||||
<el-radio-group v-model="approvalForm.approvalResult">
|
||||
@@ -258,32 +230,27 @@
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 审批意见 -->
|
||||
<el-form-item label="审批意见" prop="approvalComment">
|
||||
<el-input
|
||||
v-model="approvalForm.approvalComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
<el-input
|
||||
v-model="approvalForm.approvalComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入审批意见(必填)"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 下一审批人(如果需要) -->
|
||||
<el-form-item label="下一审批人" prop="nextApprover" v-if="showNextApprover">
|
||||
<el-select v-model="approvalForm.nextApprover" placeholder="请选择下一审批人" style="width: 100%">
|
||||
<el-option
|
||||
v-for="approver in approverList"
|
||||
:key="approver.userId"
|
||||
:label="approver.userName"
|
||||
:value="approver.userId"
|
||||
/>
|
||||
<el-option v-for="approver in approverList" :key="approver.userId" :label="approver.userName" :value="approver.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeApprovalDialog">取消</el-button>
|
||||
@@ -293,32 +260,18 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog
|
||||
v-model="detailDialog.visible"
|
||||
:title="detailDialog.title"
|
||||
width="90%"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-dialog v-model="detailDialog.visible" :title="detailDialog.title" width="90%" :close-on-click-modal="false">
|
||||
<application-summary :application="currentApplication" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button
|
||||
v-if="canApprove(currentApplication)"
|
||||
type="primary"
|
||||
@click="approveFromDetail"
|
||||
>审批</el-button>
|
||||
<el-button v-if="canApprove(currentApplication)" type="primary" @click="approveFromDetail">审批</el-button>
|
||||
<el-button @click="detailDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审批记录对话框 -->
|
||||
<el-dialog
|
||||
v-model="historyDialog.visible"
|
||||
title="审批记录"
|
||||
width="900px"
|
||||
append-to-body
|
||||
>
|
||||
<el-dialog v-model="historyDialog.visible" title="审批记录" width="900px" append-to-body>
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(record, index) in approvalHistory"
|
||||
@@ -341,7 +294,7 @@
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="historyDialog.visible = false">关闭</el-button>
|
||||
@@ -352,7 +305,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
listApprovalRecord,
|
||||
getApprovalRecord,
|
||||
approveApplication,
|
||||
@@ -363,9 +316,9 @@ import {
|
||||
getDepartmentApprovals,
|
||||
getAvailableApprovers,
|
||||
exportApprovalRecord
|
||||
} from "@/api/cw/approvalRecord";
|
||||
import { useDict } from "@/utils/dict";
|
||||
import ApplicationSummary from "../application/summary.vue";
|
||||
} from '@/api/cw/approvalRecord';
|
||||
import { useDict } from '@/utils/dict';
|
||||
import ApplicationSummary from '../application/summary.vue';
|
||||
|
||||
export default {
|
||||
name: 'CwApprovalRecord',
|
||||
@@ -416,7 +369,7 @@ export default {
|
||||
visible: false,
|
||||
title: ''
|
||||
},
|
||||
// 详情对话框
|
||||
// 详情对话框
|
||||
detailDialog: {
|
||||
visible: false,
|
||||
title: ''
|
||||
@@ -436,9 +389,7 @@ export default {
|
||||
},
|
||||
// 审批表单验证
|
||||
approvalRules: {
|
||||
approvalResult: [
|
||||
{ required: true, message: '请选择审批结果', trigger: 'change' }
|
||||
],
|
||||
approvalResult: [{ required: true, message: '请选择审批结果', trigger: 'change' }],
|
||||
approvalComment: [
|
||||
{ required: true, message: '请输入审批意见', trigger: 'blur' },
|
||||
{ min: 5, max: 500, message: '审批意见长度在 5 到 500 个字符', trigger: 'blur' }
|
||||
@@ -468,9 +419,13 @@ export default {
|
||||
try {
|
||||
const dictData = useDict('cw_approval_status');
|
||||
// 监听字典数据变化
|
||||
this.$watch(() => dictData.cw_approval_status, (newVal) => {
|
||||
this.cw_approval_status = newVal || [];
|
||||
}, { immediate: true });
|
||||
this.$watch(
|
||||
() => dictData.cw_approval_status,
|
||||
(newVal) => {
|
||||
this.cw_approval_status = newVal || [];
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('加载审批状态字典数据失败:', error);
|
||||
}
|
||||
@@ -482,37 +437,39 @@ export default {
|
||||
// 处理时间范围
|
||||
this.queryParams.submitTimeBegin = this.daterangeSubmitTime[0] || '';
|
||||
this.queryParams.submitTimeEnd = this.daterangeSubmitTime[1] || '';
|
||||
|
||||
listApprovalRecord(this.queryParams).then(response => {
|
||||
this.approvalList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}).catch(error => {
|
||||
console.error('获取审批列表失败:', error);
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
listApprovalRecord(this.queryParams)
|
||||
.then((response) => {
|
||||
this.approvalList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取审批列表失败:', error);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeSubmitTime = [];
|
||||
this.$refs.queryFormRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
|
||||
/** 快捷操作 */
|
||||
showPendingApprovals() {
|
||||
this.queryParams = {
|
||||
@@ -522,7 +479,7 @@ export default {
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
showMyApprovals() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
@@ -530,7 +487,7 @@ export default {
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
showDepartmentApprovals() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
@@ -538,45 +495,47 @@ export default {
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
showApprovalStatistics() {
|
||||
this.$router.push('/cw/approvalRecord/statistics');
|
||||
},
|
||||
|
||||
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
const id = row.id || row.applicationId;
|
||||
getApprovalRecord(id).then(response => {
|
||||
this.currentApplication = response.data;
|
||||
this.detailDialog.visible = true;
|
||||
this.detailDialog.title = "申报详情";
|
||||
}).catch(error => {
|
||||
console.error('获取详情失败:', error);
|
||||
this.$modal.msgError('获取详情失败');
|
||||
});
|
||||
getApprovalRecord(id)
|
||||
.then((response) => {
|
||||
this.currentApplication = response.data;
|
||||
this.detailDialog.visible = true;
|
||||
this.detailDialog.title = '申报详情';
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取详情失败:', error);
|
||||
this.$modal.msgError('获取详情失败');
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 从详情页审批 */
|
||||
approveFromDetail() {
|
||||
this.detailDialog.visible = false;
|
||||
this.handleApprove(this.currentApplication);
|
||||
},
|
||||
|
||||
|
||||
/** 单个审批通过 */
|
||||
handleApprove(row) {
|
||||
this.openApprovalDialog('approved', row, '审批通过');
|
||||
},
|
||||
|
||||
|
||||
/** 单个审批拒绝 */
|
||||
handleReject(row) {
|
||||
this.openApprovalDialog('rejected', row, '审批拒绝');
|
||||
},
|
||||
|
||||
|
||||
/** 单个审批退回 */
|
||||
handleReturn(row) {
|
||||
this.openApprovalDialog('returned', row, '审批退回');
|
||||
},
|
||||
|
||||
|
||||
/** 批量审批通过 */
|
||||
handleBatchApprove() {
|
||||
if (this.ids.length === 0) {
|
||||
@@ -585,7 +544,7 @@ export default {
|
||||
}
|
||||
this.openBatchApprovalDialog('approved', '批量审批通过');
|
||||
},
|
||||
|
||||
|
||||
/** 批量审批拒绝 */
|
||||
handleBatchReject() {
|
||||
if (this.ids.length === 0) {
|
||||
@@ -594,7 +553,7 @@ export default {
|
||||
}
|
||||
this.openBatchApprovalDialog('rejected', '批量审批拒绝');
|
||||
},
|
||||
|
||||
|
||||
/** 打开审批对话框 */
|
||||
openApprovalDialog(result, row, title) {
|
||||
this.currentApplication = row;
|
||||
@@ -604,16 +563,16 @@ export default {
|
||||
approvalComment: '',
|
||||
nextApprover: null
|
||||
};
|
||||
|
||||
|
||||
// 如果是通过状态,加载可选审批人
|
||||
if (result === 'approved') {
|
||||
this.loadAvailableApprovers(row.id);
|
||||
}
|
||||
|
||||
|
||||
this.approvalDialog.visible = true;
|
||||
this.approvalDialog.title = title;
|
||||
},
|
||||
|
||||
|
||||
/** 打开批量审批对话框 */
|
||||
openBatchApprovalDialog(result, title) {
|
||||
this.approvalForm = {
|
||||
@@ -625,17 +584,19 @@ export default {
|
||||
this.approvalDialog.visible = true;
|
||||
this.approvalDialog.title = title;
|
||||
},
|
||||
|
||||
|
||||
/** 加载可选审批人 */
|
||||
loadAvailableApprovers(applicationId) {
|
||||
getAvailableApprovers(applicationId).then(response => {
|
||||
this.approverList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取审批人列表失败:', error);
|
||||
this.approverList = [];
|
||||
});
|
||||
getAvailableApprovers(applicationId)
|
||||
.then((response) => {
|
||||
this.approverList = response.data || [];
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取审批人列表失败:', error);
|
||||
this.approverList = [];
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 关闭审批对话框 */
|
||||
closeApprovalDialog() {
|
||||
this.approvalDialog.visible = false;
|
||||
@@ -650,74 +611,79 @@ export default {
|
||||
this.$refs.approvalFormRef.resetFields();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 提交审批 */
|
||||
submitApproval() {
|
||||
this.$refs.approvalFormRef.validate(valid => {
|
||||
this.$refs.approvalFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.approvalSubmitting = true;
|
||||
|
||||
const apiCall = this.approvalForm.applicationIds
|
||||
? batchApproveApplication(this.approvalForm)
|
||||
: approveApplication(this.approvalForm);
|
||||
|
||||
apiCall.then(response => {
|
||||
this.$modal.msgSuccess("审批成功");
|
||||
this.closeApprovalDialog();
|
||||
this.getList();
|
||||
}).catch(error => {
|
||||
console.error('审批失败:', error);
|
||||
this.$modal.msgError('审批失败');
|
||||
}).finally(() => {
|
||||
this.approvalSubmitting = false;
|
||||
});
|
||||
|
||||
const apiCall = this.approvalForm.applicationIds ? batchApproveApplication(this.approvalForm) : approveApplication(this.approvalForm);
|
||||
|
||||
apiCall
|
||||
.then((response) => {
|
||||
this.$modal.msgSuccess('审批成功');
|
||||
this.closeApprovalDialog();
|
||||
this.getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('审批失败:', error);
|
||||
this.$modal.msgError('审批失败');
|
||||
})
|
||||
.finally(() => {
|
||||
this.approvalSubmitting = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 查看审批历史 */
|
||||
handleApprovalHistory(row) {
|
||||
getApprovalHistory(row.id || row.applicationId).then(response => {
|
||||
this.approvalHistory = response.data || [];
|
||||
this.historyDialog.visible = true;
|
||||
}).catch(error => {
|
||||
console.error('获取审批历史失败:', error);
|
||||
this.$modal.msgError('获取审批历史失败');
|
||||
// 显示模拟数据
|
||||
this.approvalHistory = [
|
||||
{
|
||||
approverName: '系统',
|
||||
approvalResult: 'submitted',
|
||||
approvalComment: '申报材料已提交,等待审批',
|
||||
approvalTime: new Date().toISOString(),
|
||||
stepName: '申报提交',
|
||||
stepOrder: 1
|
||||
}
|
||||
];
|
||||
this.historyDialog.visible = true;
|
||||
});
|
||||
getApprovalHistory(row.id || row.applicationId)
|
||||
.then((response) => {
|
||||
this.approvalHistory = response.data || [];
|
||||
this.historyDialog.visible = true;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取审批历史失败:', error);
|
||||
this.$modal.msgError('获取审批历史失败');
|
||||
// 显示模拟数据
|
||||
this.approvalHistory = [
|
||||
{
|
||||
approverName: '系统',
|
||||
approvalResult: 'submitted',
|
||||
approvalComment: '申报材料已提交,等待审批',
|
||||
approvalTime: new Date().toISOString(),
|
||||
stepName: '申报提交',
|
||||
stepOrder: 1
|
||||
}
|
||||
];
|
||||
this.historyDialog.visible = true;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 导出 */
|
||||
handleExport() {
|
||||
exportApprovalRecord(this.queryParams).then(() => {
|
||||
this.$modal.msgSuccess('导出成功');
|
||||
}).catch(error => {
|
||||
console.error('导出失败:', error);
|
||||
this.$modal.msgError('导出失败');
|
||||
});
|
||||
exportApprovalRecord(this.queryParams)
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('导出成功');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('导出失败:', error);
|
||||
this.$modal.msgError('导出失败');
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 判断是否可以审批 */
|
||||
canApprove(row) {
|
||||
return row.approvalStatus === 'submitted' || row.approvalStatus === 'approving';
|
||||
},
|
||||
|
||||
|
||||
/** 格式化金额 */
|
||||
formatAmount(amount) {
|
||||
return amount ? amount.toFixed(2) : '0.00';
|
||||
},
|
||||
|
||||
|
||||
/** 获取历史记录图标 */
|
||||
getHistoryIcon(result) {
|
||||
const iconMap = {
|
||||
@@ -728,7 +694,7 @@ export default {
|
||||
};
|
||||
return iconMap[result] || 'Document';
|
||||
},
|
||||
|
||||
|
||||
/** 获取历史记录类型 */
|
||||
getHistoryType(result) {
|
||||
const typeMap = {
|
||||
@@ -739,7 +705,7 @@ export default {
|
||||
};
|
||||
return typeMap[result] || 'info';
|
||||
},
|
||||
|
||||
|
||||
/** 获取状态标签类型 */
|
||||
getStatusTagType(status) {
|
||||
const statusMap = {
|
||||
@@ -750,7 +716,7 @@ export default {
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批结果文本 */
|
||||
getApprovalResultText(result) {
|
||||
const textMap = {
|
||||
@@ -775,25 +741,25 @@ export default {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
@@ -811,22 +777,22 @@ export default {
|
||||
// 金额文本
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #E6A23C;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
// 审批对话框样式
|
||||
.approve-icon {
|
||||
color: #67C23A;
|
||||
color: #67c23a;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.reject-icon {
|
||||
color: #F56C6C;
|
||||
color: #f56c6c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.return-icon {
|
||||
color: #E6A23C;
|
||||
color: #e6a23c;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
@@ -836,7 +802,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
|
||||
.approver-name {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
@@ -846,7 +812,7 @@ export default {
|
||||
.history-content {
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
@@ -856,14 +822,14 @@ export default {
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -32,7 +32,7 @@
|
||||
{{ parseTime(config.createTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<div v-if="config.description" class="mt-4">
|
||||
<h4 class="section-title">配置描述</h4>
|
||||
<p class="description-text">{{ config.description }}</p>
|
||||
@@ -48,22 +48,18 @@
|
||||
<el-tag type="info" size="small">共 {{ config.steps.length }} 个步骤</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<el-steps :active="config.steps.length" finish-status="success" align-center>
|
||||
<el-step
|
||||
v-for="(step, index) in config.steps"
|
||||
<el-step
|
||||
v-for="(step, index) in config.steps"
|
||||
:key="index"
|
||||
:title="step.stepName"
|
||||
:description="`${getApprovalModeText(step.approvalMode)} | ${step.timeoutHours}小时`"
|
||||
/>
|
||||
</el-steps>
|
||||
|
||||
|
||||
<div class="steps-detail mt-6">
|
||||
<div
|
||||
v-for="(step, index) in config.steps"
|
||||
:key="index"
|
||||
class="step-detail-item"
|
||||
>
|
||||
<div v-for="(step, index) in config.steps" :key="index" class="step-detail-item">
|
||||
<el-card shadow="hover" class="step-detail-card">
|
||||
<template #header>
|
||||
<div class="step-header">
|
||||
@@ -74,7 +70,7 @@
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="step-info">
|
||||
@@ -95,34 +91,24 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<div class="approvers-section mt-4" v-if="step.approvers && step.approvers.length > 0">
|
||||
<label class="info-label">审批人员:</label>
|
||||
<div class="approvers-list">
|
||||
<el-tag
|
||||
v-for="(approver, approverIndex) in step.approverNames"
|
||||
:key="approverIndex"
|
||||
class="approver-tag"
|
||||
>
|
||||
<el-tag v-for="(approver, approverIndex) in step.approverNames" :key="approverIndex" class="approver-tag">
|
||||
{{ approver }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-else-if="config.approvalType === 'custom'" class="custom-approver-notice">
|
||||
<el-alert
|
||||
title="自选审批人"
|
||||
description="申报人在提交时自行选择审批人"
|
||||
type="info"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert title="自选审批人" description="申报人在提交时自行选择审批人" type="info" show-icon :closable="false" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<!-- 无流程步骤时的提示 -->
|
||||
<el-card class="detail-card" v-else>
|
||||
<el-empty description="暂无配置的审批流程步骤" />
|
||||
@@ -144,13 +130,13 @@ export default {
|
||||
getApprovalTypeTag(type) {
|
||||
const typeMap = {
|
||||
'fixed': 'success',
|
||||
'role': 'warning',
|
||||
'role': 'warning',
|
||||
'dept': 'info',
|
||||
'custom': 'primary'
|
||||
};
|
||||
return typeMap[type] || 'info';
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批类型文本 */
|
||||
getApprovalTypeText(type) {
|
||||
const textMap = {
|
||||
@@ -161,7 +147,7 @@ export default {
|
||||
};
|
||||
return textMap[type] || type;
|
||||
},
|
||||
|
||||
|
||||
/** 获取适用范围文本 */
|
||||
getScopeText(scope) {
|
||||
const scopeMap = {
|
||||
@@ -172,7 +158,7 @@ export default {
|
||||
};
|
||||
return scopeMap[scope] || scope;
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批方式文本 */
|
||||
getApprovalModeText(mode) {
|
||||
const modeMap = {
|
||||
@@ -182,7 +168,7 @@ export default {
|
||||
};
|
||||
return modeMap[mode] || mode;
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批方式标签类型 */
|
||||
getModeTagType(mode) {
|
||||
const typeMap = {
|
||||
@@ -201,7 +187,7 @@ export default {
|
||||
.detail-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -210,14 +196,14 @@ export default {
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.section-title {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
|
||||
.description-text {
|
||||
margin: 0;
|
||||
padding: 12px;
|
||||
@@ -226,24 +212,24 @@ export default {
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
|
||||
.steps-detail {
|
||||
.step-detail-item {
|
||||
margin-bottom: 16px;
|
||||
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.step-detail-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.step-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
|
||||
.step-number {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
@@ -252,7 +238,7 @@ export default {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
.step-name {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
@@ -260,12 +246,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.step-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
|
||||
.info-label {
|
||||
font-weight: 600;
|
||||
color: #909399;
|
||||
@@ -273,23 +259,23 @@ export default {
|
||||
min-width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.approvers-section {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
padding-top: 16px;
|
||||
|
||||
|
||||
.info-label {
|
||||
font-weight: 600;
|
||||
color: #909399;
|
||||
margin-bottom: 8px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.approvers-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
|
||||
|
||||
.approver-tag {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
@@ -297,7 +283,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.custom-approver-notice {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
padding-top: 16px;
|
||||
@@ -316,4 +302,4 @@ export default {
|
||||
.mt-6 {
|
||||
margin-top: 24px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -85,10 +85,14 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['cw:approverConfig:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['cw:approverConfig:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['cw:approverConfig:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:approverConfig:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:approverConfig:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
@@ -125,12 +129,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="审批人" align="center" prop="approverNames" min-width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-for="(name, index) in scope.row.approverNames"
|
||||
:key="index"
|
||||
size="small"
|
||||
class="mr-1"
|
||||
>
|
||||
<el-tag v-for="(name, index) in scope.row.approverNames" :key="index" size="small" class="mr-1">
|
||||
{{ name }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -178,13 +177,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改审批人配置对话框 -->
|
||||
@@ -241,13 +234,9 @@
|
||||
<el-button type="primary" size="small" icon="Plus" @click="addStep">添加步骤</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<div v-if="form.steps && form.steps.length > 0" class="steps-container">
|
||||
<div
|
||||
v-for="(step, index) in form.steps"
|
||||
:key="index"
|
||||
class="step-item"
|
||||
>
|
||||
<div v-for="(step, index) in form.steps" :key="index" class="step-item">
|
||||
<el-card shadow="hover" class="step-card">
|
||||
<template #header>
|
||||
<div class="step-header">
|
||||
@@ -268,7 +257,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="步骤名称" :prop="`steps.${index}.stepName`" :rules="stepRules.stepName">
|
||||
@@ -290,46 +279,25 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审批人设置" :prop="`steps.${index}.approvers`" :rules="stepRules.approvers">
|
||||
<div class="approvers-container">
|
||||
<!-- 固定审批人 -->
|
||||
<div v-if="form.approvalType === 'fixed'">
|
||||
<el-select
|
||||
v-model="step.approvers"
|
||||
multiple
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
@change="updateApproverNames"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.userId"
|
||||
:label="user.nickName"
|
||||
:value="user.userId"
|
||||
/>
|
||||
<el-select v-model="step.approvers" multiple placeholder="请选择审批人" style="width: 100%" @change="updateApproverNames">
|
||||
<el-option v-for="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 角色审批 -->
|
||||
<div v-else-if="form.approvalType === 'role'">
|
||||
<el-select
|
||||
v-model="step.approvers"
|
||||
multiple
|
||||
placeholder="请选择审批角色"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="role in roleList"
|
||||
:key="role.roleId"
|
||||
:label="role.roleName"
|
||||
:value="role.roleId"
|
||||
/>
|
||||
<el-select v-model="step.approvers" multiple placeholder="请选择审批角色" style="width: 100%">
|
||||
<el-option v-for="role in roleList" :key="role.roleId" :label="role.roleName" :value="role.roleId" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 部门审批 -->
|
||||
<div v-else-if="form.approvalType === 'dept'">
|
||||
<el-tree-select
|
||||
@@ -341,7 +309,7 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 自选审批人 -->
|
||||
<div v-else-if="form.approvalType === 'custom'">
|
||||
<el-alert
|
||||
@@ -359,12 +327,12 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-empty v-else description="暂无审批步骤,请添加步骤" />
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
@@ -385,7 +353,7 @@
|
||||
|
||||
<!-- 流程图对话框 -->
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程图" width="1200px" append-to-body>
|
||||
<div ref="flowChartRef" style="height: 500px; border: 1px solid #e4e7ed;"></div>
|
||||
<div ref="flowChartRef" style="height: 500px; border: 1px solid #e4e7ed"></div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="flowDialog.visible = false">关闭</el-button>
|
||||
@@ -396,13 +364,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listApproverConfig,
|
||||
getApproverConfig,
|
||||
addApproverConfig,
|
||||
updateApproverConfig,
|
||||
delApproverConfig
|
||||
} from "@/api/cw/projectApplication";
|
||||
import { listApproverConfig, getApproverConfig, addApproverConfig, updateApproverConfig, delApproverConfig } from '@/api/cw/projectApplication';
|
||||
|
||||
export default {
|
||||
name: 'CwApproverConfig',
|
||||
@@ -454,27 +416,17 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
configName: [
|
||||
{ required: true, message: "配置名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 50, message: "配置名称长度在 2 到 50 个字符", trigger: "blur" }
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
{ min: 2, max: 50, message: '配置名称长度在 2 到 50 个字符', trigger: 'blur' }
|
||||
],
|
||||
approvalType: [
|
||||
{ required: true, message: "审批类型不能为空", trigger: "change" }
|
||||
],
|
||||
applicableScope: [
|
||||
{ required: true, message: "适用范围不能为空", trigger: "change" }
|
||||
]
|
||||
approvalType: [{ required: true, message: '审批类型不能为空', trigger: 'change' }],
|
||||
applicableScope: [{ required: true, message: '适用范围不能为空', trigger: 'change' }]
|
||||
},
|
||||
// 步骤表单校验
|
||||
stepRules: {
|
||||
stepName: [
|
||||
{ required: true, message: "步骤名称不能为空", trigger: "blur" }
|
||||
],
|
||||
approvalMode: [
|
||||
{ required: true, message: "审批方式不能为空", trigger: "change" }
|
||||
],
|
||||
approvers: [
|
||||
{ required: true, message: "请设置审批人", trigger: "change" }
|
||||
]
|
||||
stepName: [{ required: true, message: '步骤名称不能为空', trigger: 'blur' }],
|
||||
approvalMode: [{ required: true, message: '审批方式不能为空', trigger: 'change' }],
|
||||
approvers: [{ required: true, message: '请设置审批人', trigger: 'change' }]
|
||||
},
|
||||
// 用户列表
|
||||
userList: [],
|
||||
@@ -492,37 +444,35 @@ export default {
|
||||
/** 查询审批人配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listApproverConfig(this.queryParams).then(response => {
|
||||
this.configList = this.handleTree(response.data, "id", "parentId");
|
||||
listApproverConfig(this.queryParams).then((response) => {
|
||||
this.configList = this.handleTree(response.data, 'id', 'parentId');
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 加载基础数据 */
|
||||
loadBasicData() {
|
||||
// 加载用户列表
|
||||
// listUser().then(response => {
|
||||
// this.userList = response.rows;
|
||||
// });
|
||||
|
||||
// 加载角色列表
|
||||
// listRole().then(response => {
|
||||
// this.roleList = response.rows;
|
||||
// });
|
||||
|
||||
// 加载部门树
|
||||
// listDept().then(response => {
|
||||
// this.deptTreeData = this.handleTree(response.data, "deptId");
|
||||
// });
|
||||
},
|
||||
|
||||
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.dialog.visible = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
@@ -532,92 +482,92 @@ export default {
|
||||
applicableScope: 'all',
|
||||
orderNum: 0,
|
||||
description: null,
|
||||
status: "1",
|
||||
status: '1',
|
||||
steps: []
|
||||
};
|
||||
if (this.$refs.formRef) {
|
||||
this.$refs.formRef.resetFields();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryFormRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
toggleExpandAll() {
|
||||
this.isExpandAll = !this.isExpandAll;
|
||||
this.toggleExpandAllTree(this.configList, this.isExpandAll);
|
||||
},
|
||||
|
||||
|
||||
/** 快捷操作 */
|
||||
showFlowDesigner() {
|
||||
this.$modal.msgInfo("流程设计器功能开发中...");
|
||||
this.$modal.msgInfo('流程设计器功能开发中...');
|
||||
},
|
||||
|
||||
|
||||
showTemplates() {
|
||||
this.$modal.msgInfo("配置模板功能开发中...");
|
||||
this.$modal.msgInfo('配置模板功能开发中...');
|
||||
},
|
||||
|
||||
|
||||
showTestFlow() {
|
||||
this.$modal.msgInfo("流程测试功能开发中...");
|
||||
this.$modal.msgInfo('流程测试功能开发中...');
|
||||
},
|
||||
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "添加审批人配置";
|
||||
this.dialog.title = '添加审批人配置';
|
||||
},
|
||||
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row?.id || this.ids[0];
|
||||
getApproverConfig(id).then(response => {
|
||||
getApproverConfig(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "修改审批人配置";
|
||||
this.dialog.title = '修改审批人配置';
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 复制配置 */
|
||||
handleCopy(row) {
|
||||
getApproverConfig(row.id).then(response => {
|
||||
getApproverConfig(row.id).then((response) => {
|
||||
this.form = {
|
||||
...response.data,
|
||||
id: null,
|
||||
configName: response.data.configName + '_副本'
|
||||
};
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "复制审批人配置";
|
||||
this.dialog.title = '复制审批人配置';
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 查看详情 */
|
||||
handleDetail(row) {
|
||||
getApproverConfig(row.id).then(response => {
|
||||
getApproverConfig(row.id).then((response) => {
|
||||
this.currentConfig = response.data;
|
||||
this.detailDialog.visible = true;
|
||||
this.detailDialog.title = "配置详情";
|
||||
this.detailDialog.title = '配置详情';
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 查看流程图 */
|
||||
handleViewFlow(row) {
|
||||
this.flowDialog.visible = true;
|
||||
@@ -625,45 +575,55 @@ export default {
|
||||
this.renderFlowChart(row);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 状态变更 */
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "1" ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.configName + '"配置吗?').then(() => {
|
||||
return updateApproverConfig(row);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(() => {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
const text = row.status === '1' ? '启用' : '停用';
|
||||
this.$modal
|
||||
.confirm('确认要"' + text + '""' + row.configName + '"配置吗?')
|
||||
.then(() => {
|
||||
return updateApproverConfig(row);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess(text + '成功');
|
||||
})
|
||||
.catch(() => {
|
||||
row.status = row.status === '0' ? '1' : '0';
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row?.id ? [row.id] : this.ids;
|
||||
const configs = row?.configName ? [row.configName] : this.configList.filter(item => this.ids.includes(item.id)).map(item => item.configName);
|
||||
|
||||
this.$modal.confirm('是否确认删除配置名称为"' + configs.join('", "') + '"的数据项?').then(() => {
|
||||
return delApproverConfig(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
const configs = row?.configName
|
||||
? [row.configName]
|
||||
: this.configList.filter((item) => this.ids.includes(item.id)).map((item) => item.configName);
|
||||
|
||||
this.$modal
|
||||
.confirm('是否确认删除配置名称为"' + configs.join('", "') + '"的数据项?')
|
||||
.then(() => {
|
||||
return delApproverConfig(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateApproverConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateApproverConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.dialog.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addApproverConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addApproverConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.dialog.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -671,17 +631,17 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 审批类型变更 */
|
||||
handleTypeChange(value) {
|
||||
// 清空已配置的审批人
|
||||
if (this.form.steps) {
|
||||
this.form.steps.forEach(step => {
|
||||
this.form.steps.forEach((step) => {
|
||||
step.approvers = [];
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 添加步骤 */
|
||||
addStep() {
|
||||
if (!this.form.steps) {
|
||||
@@ -694,12 +654,12 @@ export default {
|
||||
approvers: []
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 删除步骤 */
|
||||
removeStep(index) {
|
||||
this.form.steps.splice(index, 1);
|
||||
},
|
||||
|
||||
|
||||
/** 上移步骤 */
|
||||
moveStepUp(index) {
|
||||
if (index > 0) {
|
||||
@@ -708,7 +668,7 @@ export default {
|
||||
this.form.steps[index - 1] = temp;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 下移步骤 */
|
||||
moveStepDown(index) {
|
||||
if (index < this.form.steps.length - 1) {
|
||||
@@ -717,36 +677,40 @@ export default {
|
||||
this.form.steps[index + 1] = temp;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** 更新审批人名称 */
|
||||
updateApproverNames() {
|
||||
// 更新审批人名称用于显示
|
||||
},
|
||||
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cw/approverConfig/export', {
|
||||
...this.queryParams
|
||||
}, `approver_config_${new Date().getTime()}.xlsx`);
|
||||
this.download(
|
||||
'cw/approverConfig/export',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`approver_config_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
/** 渲染流程图 */
|
||||
renderFlowChart(row) {
|
||||
// 使用流程图库渲染流程图
|
||||
this.$modal.msgInfo("流程图功能开发中...");
|
||||
this.$modal.msgInfo('流程图功能开发中...');
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批类型标签 */
|
||||
getApprovalTypeTag(type) {
|
||||
const typeMap = {
|
||||
'fixed': 'success',
|
||||
'role': 'warning',
|
||||
'role': 'warning',
|
||||
'dept': 'info',
|
||||
'custom': 'primary'
|
||||
};
|
||||
return typeMap[type] || 'info';
|
||||
},
|
||||
|
||||
|
||||
/** 获取审批类型文本 */
|
||||
getApprovalTypeText(type) {
|
||||
const textMap = {
|
||||
@@ -771,25 +735,25 @@ export default {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
@@ -807,14 +771,14 @@ export default {
|
||||
// 步骤徽章
|
||||
.step-badge {
|
||||
:deep(.el-badge__content) {
|
||||
background-color: #409EFF;
|
||||
background-color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤配置卡片
|
||||
.steps-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.steps-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -827,32 +791,32 @@ export default {
|
||||
.steps-container {
|
||||
.step-item {
|
||||
margin-bottom: 16px;
|
||||
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.step-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.step-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.step-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.step-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -877,14 +841,14 @@ export default {
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -154,17 +154,12 @@
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>月度申报趋势</span>
|
||||
<el-select v-model="selectedYear" @change="handleYearChange" style="width: 120px;">
|
||||
<el-option
|
||||
v-for="year in yearOptions"
|
||||
:key="year"
|
||||
:label="year + '年'"
|
||||
:value="year"
|
||||
/>
|
||||
<el-select v-model="selectedYear" @change="handleYearChange" style="width: 120px">
|
||||
<el-option v-for="year in yearOptions" :key="year" :label="year + '年'" :value="year" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="trendChart" style="height: 350px;"></div>
|
||||
<div ref="trendChart" style="height: 350px"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
@@ -174,7 +169,7 @@
|
||||
<template #header>
|
||||
<span>状态分布</span>
|
||||
</template>
|
||||
<div ref="statusChart" style="height: 350px;"></div>
|
||||
<div ref="statusChart" style="height: 350px"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -187,13 +182,8 @@
|
||||
<el-button type="primary" icon="Download" @click="handleExportDeptStatistics">导出部门统计</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
:data="statistics.deptStatistics"
|
||||
border
|
||||
style="width: 100%"
|
||||
v-loading="statisticsLoading"
|
||||
>
|
||||
|
||||
<el-table :data="statistics.deptStatistics" border style="width: 100%" v-loading="statisticsLoading">
|
||||
<el-table-column prop="deptName" label="部门名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="totalCount" label="申报数量" align="center" width="100" />
|
||||
<el-table-column prop="approvingCount" label="审批中" align="center" width="100">
|
||||
@@ -223,11 +213,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="审批率" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-progress
|
||||
:percentage="calculateApprovalRate(scope.row)"
|
||||
:status="getProgressStatus(scope.row)"
|
||||
:show-text="false"
|
||||
/>
|
||||
<el-progress :percentage="calculateApprovalRate(scope.row)" :status="getProgressStatus(scope.row)" :show-text="false" />
|
||||
<span class="rate-text">{{ calculateApprovalRate(scope.row) }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -247,18 +233,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
Plus, User, Clock, DataAnalysis, Files, CircleCheck, CircleClose,
|
||||
Money, Timer, TrendCharts, Finished
|
||||
} from '@element-plus/icons-vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getApplicationStatistics, getStatisticsByDept, getStatisticsByMonth } from '@/api/cw/projectApplication'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Plus, User, Clock, DataAnalysis, Files, CircleCheck, CircleClose, Money, Timer, TrendCharts, Finished } from '@element-plus/icons-vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { getApplicationStatistics, getStatisticsByDept, getStatisticsByMonth } from '@/api/cw/projectApplication';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
|
||||
// 响应式数据
|
||||
const statistics = reactive({
|
||||
@@ -271,138 +254,135 @@ const statistics = reactive({
|
||||
monthlyNew: 0,
|
||||
monthlyApproved: 0,
|
||||
deptStatistics: [] as any[]
|
||||
})
|
||||
});
|
||||
|
||||
const selectedYear = ref(new Date().getFullYear())
|
||||
const yearOptions = ref<number[]>([])
|
||||
const statisticsLoading = ref(false)
|
||||
const selectedYear = ref(new Date().getFullYear());
|
||||
const yearOptions = ref<number[]>([]);
|
||||
const statisticsLoading = ref(false);
|
||||
|
||||
// 图表引用
|
||||
const trendChart = ref()
|
||||
const statusChart = ref()
|
||||
let trendChartInstance: echarts.ECharts | null = null
|
||||
let statusChartInstance: echarts.ECharts | null = null
|
||||
const trendChart = ref();
|
||||
const statusChart = ref();
|
||||
let trendChartInstance: echarts.ECharts | null = null;
|
||||
let statusChartInstance: echarts.ECharts | null = null;
|
||||
|
||||
// 生成年份选项
|
||||
const generateYearOptions = () => {
|
||||
const currentYear = new Date().getFullYear()
|
||||
const currentYear = new Date().getFullYear();
|
||||
for (let i = currentYear - 4; i <= currentYear + 1; i++) {
|
||||
yearOptions.value.push(i)
|
||||
yearOptions.value.push(i);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 快捷操作
|
||||
const handleAdd = () => {
|
||||
router.push('/cw/application')
|
||||
}
|
||||
router.push('/cw/application');
|
||||
};
|
||||
|
||||
const showMyApplications = () => {
|
||||
router.push({ path: '/cw/application', query: { tab: 'my' } })
|
||||
}
|
||||
router.push({ path: '/cw/application', query: { tab: 'my' } });
|
||||
};
|
||||
|
||||
const showPendingApplications = () => {
|
||||
router.push({ path: '/cw/application', query: { tab: 'pending' } })
|
||||
}
|
||||
router.push({ path: '/cw/application', query: { tab: 'pending' } });
|
||||
};
|
||||
|
||||
const showStatistics = () => {
|
||||
router.push('/cw/application/summary')
|
||||
}
|
||||
router.push('/cw/application/summary');
|
||||
};
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount: number | undefined): string => {
|
||||
if (!amount) return '0.00'
|
||||
return amount.toFixed(2)
|
||||
}
|
||||
if (!amount) return '0.00';
|
||||
return amount.toFixed(2);
|
||||
};
|
||||
|
||||
// 计算审批率
|
||||
const calculateApprovalRate = (row: any): number => {
|
||||
if (!row.totalCount || row.totalCount === 0) return 0
|
||||
return Math.round((row.approvedCount / row.totalCount) * 100)
|
||||
}
|
||||
if (!row.totalCount || row.totalCount === 0) return 0;
|
||||
return Math.round((row.approvedCount / row.totalCount) * 100);
|
||||
};
|
||||
|
||||
// 获取进度条状态
|
||||
const getProgressStatus = (row: any): string => {
|
||||
const rate = calculateApprovalRate(row)
|
||||
if (rate >= 80) return 'success'
|
||||
if (rate >= 60) return 'warning'
|
||||
return 'exception'
|
||||
}
|
||||
const rate = calculateApprovalRate(row);
|
||||
if (rate >= 80) return 'success';
|
||||
if (rate >= 60) return 'warning';
|
||||
return 'exception';
|
||||
};
|
||||
|
||||
// 查看部门详情
|
||||
const viewDepartmentDetail = (row: any) => {
|
||||
router.push({
|
||||
path: '/cw/application',
|
||||
query: { deptId: row.deptId, deptName: row.deptName }
|
||||
})
|
||||
}
|
||||
router.push({
|
||||
path: '/cw/application',
|
||||
query: { deptId: row.deptId, deptName: row.deptName }
|
||||
});
|
||||
};
|
||||
|
||||
// 导出部门数据
|
||||
const exportDepartmentData = (row: any) => {
|
||||
ElMessage.success(`导出部门【${row.deptName}】数据功能开发中...`)
|
||||
}
|
||||
ElMessage.success(`导出部门【${row.deptName}】数据功能开发中...`);
|
||||
};
|
||||
|
||||
// 导出部门统计
|
||||
const handleExportDeptStatistics = () => {
|
||||
ElMessage.success('导出部门统计功能开发中...')
|
||||
}
|
||||
ElMessage.success('导出部门统计功能开发中...');
|
||||
};
|
||||
|
||||
// 获取统计数据
|
||||
const loadStatistics = async () => {
|
||||
try {
|
||||
statisticsLoading.value = true
|
||||
const [statsRes, deptRes] = await Promise.all([
|
||||
getApplicationStatistics(selectedYear.value),
|
||||
getStatisticsByDept()
|
||||
])
|
||||
|
||||
statisticsLoading.value = true;
|
||||
const [statsRes, deptRes] = await Promise.all([getApplicationStatistics(selectedYear.value), getStatisticsByDept()]);
|
||||
|
||||
if (statsRes.code === 200) {
|
||||
Object.assign(statistics, statsRes.data)
|
||||
Object.assign(statistics, statsRes.data);
|
||||
}
|
||||
|
||||
|
||||
if (deptRes.code === 200) {
|
||||
statistics.deptStatistics = deptRes.data || []
|
||||
statistics.deptStatistics = deptRes.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error)
|
||||
ElMessage.error('获取统计数据失败')
|
||||
console.error('获取统计数据失败:', error);
|
||||
ElMessage.error('获取统计数据失败');
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
statisticsLoading.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 年份变化处理
|
||||
const handleYearChange = () => {
|
||||
loadStatistics()
|
||||
loadTrendChart()
|
||||
}
|
||||
loadStatistics();
|
||||
loadTrendChart();
|
||||
};
|
||||
|
||||
// 加载趋势图表
|
||||
const loadTrendChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByMonth(selectedYear.value)
|
||||
const response = await getStatisticsByMonth(selectedYear.value);
|
||||
if (response.code === 200) {
|
||||
renderTrendChart(response.data)
|
||||
renderTrendChart(response.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取月度统计失败:', error)
|
||||
console.error('获取月度统计失败:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染趋势图表
|
||||
const renderTrendChart = (data: any[]) => {
|
||||
if (!trendChartInstance) return
|
||||
|
||||
const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
||||
const applicationCounts = new Array(12).fill(0)
|
||||
const approvedCounts = new Array(12).fill(0)
|
||||
|
||||
data.forEach(item => {
|
||||
const monthIndex = item.month - 1
|
||||
if (!trendChartInstance) return;
|
||||
|
||||
const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
const applicationCounts = new Array(12).fill(0);
|
||||
const approvedCounts = new Array(12).fill(0);
|
||||
|
||||
data.forEach((item) => {
|
||||
const monthIndex = item.month - 1;
|
||||
if (monthIndex >= 0 && monthIndex < 12) {
|
||||
applicationCounts[monthIndex] = item.applicationCount || 0
|
||||
approvedCounts[monthIndex] = item.approvedCount || 0
|
||||
applicationCounts[monthIndex] = item.applicationCount || 0;
|
||||
approvedCounts[monthIndex] = item.approvedCount || 0;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
@@ -437,15 +417,15 @@ const renderTrendChart = (data: any[]) => {
|
||||
itemStyle: { color: '#67C23A' }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
trendChartInstance.setOption(option)
|
||||
}
|
||||
};
|
||||
|
||||
trendChartInstance.setOption(option);
|
||||
};
|
||||
|
||||
// 渲染状态分布图
|
||||
const renderStatusChart = () => {
|
||||
if (!statusChartInstance) return
|
||||
|
||||
if (!statusChartInstance) return;
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@@ -474,38 +454,38 @@ const renderStatusChart = () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
statusChartInstance.setOption(option)
|
||||
}
|
||||
};
|
||||
|
||||
statusChartInstance.setOption(option);
|
||||
};
|
||||
|
||||
// 初始化图表
|
||||
const initCharts = async () => {
|
||||
await nextTick()
|
||||
|
||||
await nextTick();
|
||||
|
||||
if (trendChart.value) {
|
||||
trendChartInstance = echarts.init(trendChart.value)
|
||||
loadTrendChart()
|
||||
trendChartInstance = echarts.init(trendChart.value);
|
||||
loadTrendChart();
|
||||
}
|
||||
|
||||
|
||||
if (statusChart.value) {
|
||||
statusChartInstance = echarts.init(statusChart.value)
|
||||
renderStatusChart()
|
||||
statusChartInstance = echarts.init(statusChart.value);
|
||||
renderStatusChart();
|
||||
}
|
||||
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
trendChartInstance?.resize()
|
||||
statusChartInstance?.resize()
|
||||
})
|
||||
}
|
||||
trendChartInstance?.resize();
|
||||
statusChartInstance?.resize();
|
||||
});
|
||||
};
|
||||
|
||||
// 组件挂载
|
||||
onMounted(() => {
|
||||
generateYearOptions()
|
||||
loadStatistics()
|
||||
initCharts()
|
||||
})
|
||||
generateYearOptions();
|
||||
loadStatistics();
|
||||
initCharts();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -518,25 +498,25 @@ onMounted(() => {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
@@ -550,32 +530,32 @@ onMounted(() => {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
&.stat-card-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
&.stat-card-success {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
&.stat-card-warning {
|
||||
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
&.stat-card-danger {
|
||||
background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
@@ -585,13 +565,13 @@ onMounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.stat-icon {
|
||||
font-size: 32px;
|
||||
margin-right: 16px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
|
||||
.stat-info {
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
@@ -599,7 +579,7 @@ onMounted(() => {
|
||||
line-height: 1.2;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
opacity: 0.9;
|
||||
@@ -612,7 +592,7 @@ onMounted(() => {
|
||||
.chart-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -626,7 +606,7 @@ onMounted(() => {
|
||||
.table-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -634,16 +614,16 @@ onMounted(() => {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
|
||||
|
||||
&.success {
|
||||
color: #67C23A;
|
||||
color: #67c23a;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.rate-text {
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
@@ -674,24 +654,24 @@ onMounted(() => {
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.stat-content {
|
||||
padding: 15px;
|
||||
|
||||
|
||||
.stat-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
|
||||
.stat-info .stat-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
@@ -4,37 +4,38 @@
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form-item label="测试数据1">
|
||||
<el-button @click="loadTestData1" type="primary">加载单个OSS ID</el-button>
|
||||
<span style="margin-left: 10px; color: #666;">测试单个OSS文件回显</span>
|
||||
<span style="margin-left: 10px; color: #666">测试单个OSS文件回显</span>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="测试数据2">
|
||||
<el-button @click="loadTestData2" type="primary">加载多个OSS ID</el-button>
|
||||
<span style="margin-left: 10px; color: #666;">测试多个OSS文件回显</span>
|
||||
<span style="margin-left: 10px; color: #666">测试多个OSS文件回显</span>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="测试数据3">
|
||||
<el-button @click="loadTestData3" type="primary">加载URL格式</el-button>
|
||||
<span style="margin-left: 10px; color: #666;">测试直接URL回显</span>
|
||||
<span style="margin-left: 10px; color: #666">测试直接URL回显</span>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="清空数据">
|
||||
<el-button @click="clearData" type="danger">清空</el-button>
|
||||
<span style="margin-left: 10px; color: #666;">清空所有图片数据</span>
|
||||
<span style="margin-left: 10px; color: #666">清空所有图片数据</span>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="当前值">
|
||||
<el-input v-model="form.images" type="textarea" :rows="3" readonly />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="图片上传">
|
||||
<ImageUpload v-model="form.images" :limit="5" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<div class="test-info">
|
||||
<h3>测试说明</h3>
|
||||
<ul>
|
||||
<li><strong>功能验证</strong>:
|
||||
<li>
|
||||
<strong>功能验证</strong>:
|
||||
<ol>
|
||||
<li>界面打开时历史图片是否正常显示(通过认证接口获取blob URL)</li>
|
||||
<li>点击图片预览是否正常工作</li>
|
||||
@@ -42,7 +43,8 @@
|
||||
<li>删除图片功能是否正常</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><strong>技术要点</strong>:
|
||||
<li>
|
||||
<strong>技术要点</strong>:
|
||||
<ul>
|
||||
<li>使用 Promise.all 并行处理多个文件的blob URL转换</li>
|
||||
<li>缓存机制避免重复请求相同图片的认证数据</li>
|
||||
@@ -89,30 +91,31 @@ const clearData = () => {
|
||||
<style lang="scss" scoped>
|
||||
.image-upload-test {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.test-info {
|
||||
margin-top: 30px;
|
||||
padding: 20px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
|
||||
|
||||
h3 {
|
||||
margin-top: 0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin-left: 20px;
|
||||
|
||||
|
||||
li {
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
strong {
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1871,8 +1871,8 @@ const submitForm = () => {
|
||||
/** 处理待关联的附件 */
|
||||
const handlePendingAttachments = async (orderId: string | number) => {
|
||||
let hasOperations = false;
|
||||
let successMessages: string[] = [];
|
||||
let errorMessages: string[] = [];
|
||||
const successMessages: string[] = [];
|
||||
const errorMessages: string[] = [];
|
||||
|
||||
// 处理待删除的附件(编辑模式)
|
||||
if (pendingDeleteAttachmentIds.value.length > 0) {
|
||||
|
||||
@@ -0,0 +1,704 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="queryParams.activityName" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签到状态" prop="overallStatus">
|
||||
<el-select v-model="queryParams.overallStatus" placeholder="请选择签到状态" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_activity_sign_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="queryParams.department" placeholder="请输入院系" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="queryParams.major" placeholder="请输入专业" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="queryParams.className" placeholder="请输入班级" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:activityAttendance:add']">新建签到</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" icon="Download" @click="handleExport" v-hasPermi="['stgl:activityAttendance:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="attendanceList" @selection-change="handleSelectionChange" @row-dblclick="handleView">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="活动名称" align="center" prop="activityName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="活动类型" align="center" prop="activityType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_activity_type" :value="scope.row.activityType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动主题" align="center" prop="activityTheme" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="活动地点" align="center" prop="location" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="活动时间" align="center" width="160">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.startTime && scope.row.endTime">
|
||||
<div>{{ formatDate(scope.row.startTime) }}</div>
|
||||
<div class="text-sm text-gray-500">{{ formatDate(scope.row.endTime) }}</div>
|
||||
</div>
|
||||
<span v-else class="text-gray-400">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="studentName" width="100" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
|
||||
<el-table-column label="签到状态" align="center" prop="overallStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_activity_sign_status" :value="scope.row.overallStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="记录时间" align="center" prop="recordTime" width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.recordTime">{{ parseTime(scope.row.recordTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
<span v-else class="text-gray-400">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="院系" align="center" prop="department" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="专业" align="center" prop="major" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="班级" align="center" prop="className" width="100" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" width="120" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" width="180" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['stgl:activityAttendance:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 新建签到对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
||||
<el-form ref="attendanceFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="选择活动" prop="activityId">
|
||||
<el-select v-model="form.activityId" placeholder="请选择活动" style="width: 100%" @change="handleActivityChange">
|
||||
<el-option
|
||||
v-for="activity in availableActivities"
|
||||
:key="activity.activityId"
|
||||
:label="activity.activityName"
|
||||
:value="activity.activityId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 活动信息展示 -->
|
||||
<div v-if="selectedActivity" class="activity-info-section">
|
||||
<h4 class="section-title">活动信息</h4>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动名称">
|
||||
<el-input v-model="selectedActivity.activityName" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动类型">
|
||||
<div class="readonly-field">
|
||||
<dict-tag :options="stgl_activity_type" :value="selectedActivity.activityType" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动主题">
|
||||
<el-input v-model="selectedActivity.activityTheme" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动地点">
|
||||
<el-input v-model="selectedActivity.location" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间">
|
||||
<el-input v-model="selectedActivity.startTime" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间">
|
||||
<el-input v-model="selectedActivity.endTime" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 用户信息展示 -->
|
||||
<div v-if="form.studentName" class="user-info-section">
|
||||
<h4 class="section-title">用户信息</h4>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="form.studentName" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号">
|
||||
<el-input v-model="form.studentNo" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系">
|
||||
<el-input v-model="form.department" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业">
|
||||
<el-input v-model="form.major" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级">
|
||||
<el-input v-model="form.className" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="form.phone" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="form.email" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 签到操作区域 -->
|
||||
<div v-if="form.activityId" class="sign-action-section">
|
||||
<h4 class="section-title">签到操作</h4>
|
||||
<el-row :gutter="20" style="text-align: center;">
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:disabled="currentAttendance && currentAttendance.signInStatus === 1"
|
||||
@click="handleSignIn"
|
||||
:loading="signInLoading"
|
||||
>
|
||||
{{ currentAttendance && currentAttendance.signInStatus === 1 ? '已签到' : '签到' }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button
|
||||
type="success"
|
||||
size="large"
|
||||
:disabled="!currentAttendance || currentAttendance.signInStatus !== 1 || currentAttendance.signOutStatus === 1"
|
||||
@click="handleSignOut"
|
||||
:loading="signOutLoading"
|
||||
>
|
||||
{{ currentAttendance && currentAttendance.signOutStatus === 1 ? '已签退' : '签退' }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看签到详细信息对话框 -->
|
||||
<el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="800px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<!-- 活动信息 -->
|
||||
<el-descriptions-item label="活动名称">{{ viewForm.activityName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动类型">
|
||||
<dict-tag :options="stgl_activity_type" :value="viewForm.activityType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动主题">{{ viewForm.activityTheme }}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动地点">{{ viewForm.location }}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{ parseTime(viewForm.startTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{ parseTime(viewForm.endTime) }}</el-descriptions-item>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<el-descriptions-item label="姓名">{{ viewForm.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ viewForm.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="院系">{{ viewForm.department }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ viewForm.major }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ viewForm.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ viewForm.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ viewForm.email }}</el-descriptions-item>
|
||||
|
||||
<!-- 签到信息 -->
|
||||
<el-descriptions-item label="签到状态">
|
||||
<dict-tag :options="stgl_activity_sign_status" :value="viewForm.overallStatus" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签到时间">{{ parseTime(viewForm.signInTime) || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签退时间">{{ parseTime(viewForm.signOutTime) || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签到地点">{{ viewForm.signInLocation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签退地点">{{ viewForm.signOutLocation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签到备注" :span="2">{{ viewForm.signInRemark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="签退备注" :span="2">{{ viewForm.signOutRemark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="viewDialog.visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="StglActivityAttendance" lang="ts">
|
||||
import { nextTick } from 'vue';
|
||||
import {
|
||||
listStglActivityAttendance,
|
||||
getStglActivityAttendance,
|
||||
addStglActivityAttendance,
|
||||
updateStglActivityAttendance,
|
||||
delStglActivityAttendance,
|
||||
exportStglActivityAttendance,
|
||||
getUserAvailableActivities,
|
||||
getAttendanceByActivity,
|
||||
signIn,
|
||||
signOut
|
||||
} from '@/api/stgl/activityattendance';
|
||||
import { StglActivityAttendanceVO, StglActivityAttendanceQuery, StglActivityAttendanceForm } from '@/api/stgl/activityattendance/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_activity_type, stgl_activity_sign_status } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_activity_sign_status')
|
||||
);
|
||||
|
||||
const attendanceList = ref<StglActivityAttendanceVO[]>([]);
|
||||
const availableActivities = ref<StglActivityAttendanceVO[]>([]);
|
||||
const selectedActivity = ref<StglActivityAttendanceVO | null>(null);
|
||||
const currentAttendance = ref<StglActivityAttendanceVO | null>(null);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const signInLoading = ref(false);
|
||||
const signOutLoading = ref(false);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const attendanceFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const viewDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: StglActivityAttendanceForm = {
|
||||
id: undefined,
|
||||
activityId: undefined,
|
||||
userId: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
signInTime: undefined,
|
||||
signInStatus: 0,
|
||||
signInLocation: undefined,
|
||||
signInDevice: undefined,
|
||||
signInRemark: undefined,
|
||||
signOutTime: undefined,
|
||||
signOutStatus: 0,
|
||||
signOutLocation: undefined,
|
||||
signOutDevice: undefined,
|
||||
signOutRemark: undefined,
|
||||
overallStatus: 0
|
||||
};
|
||||
|
||||
const data = reactive<PageData<StglActivityAttendanceForm, StglActivityAttendanceQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
activityId: undefined,
|
||||
userId: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
overallStatus: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
activityId: [{ required: true, message: '请选择活动', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const viewForm = ref<StglActivityAttendanceVO>({} as StglActivityAttendanceVO);
|
||||
|
||||
/** 查询活动考勤签到列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listStglActivityAttendance(queryParams.value);
|
||||
attendanceList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
console.error('查询签到列表失败:', error);
|
||||
proxy?.$modal.msgError('查询签到列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
nextTick(() => {
|
||||
form.value = { ...initFormData };
|
||||
selectedActivity.value = null;
|
||||
currentAttendance.value = null;
|
||||
nextTick(() => {
|
||||
attendanceFormRef.value?.resetFields();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: StglActivityAttendanceVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新建签到按钮操作 */
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
try {
|
||||
// 获取可用活动列表
|
||||
const res = await getUserAvailableActivities();
|
||||
availableActivities.value = res.data;
|
||||
if (availableActivities.value.length === 0) {
|
||||
proxy?.$modal.msgWarning('暂无可签到的活动,请确保您已报名成功且活动正在进行中');
|
||||
return;
|
||||
}
|
||||
dialog.visible = true;
|
||||
dialog.title = '新建签到';
|
||||
} catch (error) {
|
||||
console.error('获取可用活动失败:', error);
|
||||
proxy?.$modal.msgError('获取可用活动失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 活动选择变化处理 */
|
||||
const handleActivityChange = async (activityId: string | number) => {
|
||||
if (!activityId) {
|
||||
selectedActivity.value = null;
|
||||
currentAttendance.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置选中的活动信息
|
||||
const activity = availableActivities.value.find(item => item.activityId === activityId);
|
||||
if (activity) {
|
||||
selectedActivity.value = activity;
|
||||
|
||||
// 填充用户信息
|
||||
form.value.studentName = activity.studentName;
|
||||
form.value.studentNo = activity.studentNo;
|
||||
form.value.department = activity.department;
|
||||
form.value.major = activity.major;
|
||||
form.value.className = activity.className;
|
||||
form.value.phone = activity.phone;
|
||||
form.value.email = activity.email;
|
||||
|
||||
// 查询当前用户是否已有签到记录
|
||||
try {
|
||||
const res = await getAttendanceByActivity(activityId);
|
||||
currentAttendance.value = res.data;
|
||||
} catch (error) {
|
||||
// 没有签到记录,这是正常的
|
||||
currentAttendance.value = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 签到操作 */
|
||||
const handleSignIn = async () => {
|
||||
if (!form.value.activityId) {
|
||||
proxy?.$modal.msgError('请先选择活动');
|
||||
return;
|
||||
}
|
||||
|
||||
signInLoading.value = true;
|
||||
try {
|
||||
const signInData = {
|
||||
activityId: form.value.activityId,
|
||||
studentName: form.value.studentName,
|
||||
studentNo: form.value.studentNo,
|
||||
department: form.value.department,
|
||||
major: form.value.major,
|
||||
className: form.value.className,
|
||||
phone: form.value.phone,
|
||||
email: form.value.email,
|
||||
signInLocation: '前端签到',
|
||||
signInDevice: navigator.userAgent.substring(0, 50)
|
||||
};
|
||||
|
||||
await signIn(signInData);
|
||||
proxy?.$modal.msgSuccess('签到成功');
|
||||
|
||||
// 刷新当前签到状态
|
||||
await handleActivityChange(form.value.activityId);
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('签到失败:', error);
|
||||
proxy?.$modal.msgError('签到失败');
|
||||
} finally {
|
||||
signInLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 签退操作 */
|
||||
const handleSignOut = async () => {
|
||||
if (!form.value.activityId) {
|
||||
proxy?.$modal.msgError('请先选择活动');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentAttendance.value || currentAttendance.value.signInStatus !== 1) {
|
||||
proxy?.$modal.msgError('请先完成签到');
|
||||
return;
|
||||
}
|
||||
|
||||
signOutLoading.value = true;
|
||||
try {
|
||||
const signOutData = {
|
||||
activityId: form.value.activityId,
|
||||
signOutLocation: '前端签退',
|
||||
signOutDevice: navigator.userAgent.substring(0, 50)
|
||||
};
|
||||
|
||||
await signOut(signOutData);
|
||||
proxy?.$modal.msgSuccess('签退成功');
|
||||
|
||||
// 刷新当前签到状态
|
||||
await handleActivityChange(form.value.activityId);
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('签退失败:', error);
|
||||
proxy?.$modal.msgError('签退失败');
|
||||
} finally {
|
||||
signOutLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = async (row: StglActivityAttendanceVO) => {
|
||||
const res = await getStglActivityAttendance(row.id);
|
||||
viewForm.value = res.data;
|
||||
viewDialog.visible = true;
|
||||
viewDialog.title = '查看签到信息';
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportStglActivityAttendance(queryParams.value);
|
||||
proxy?.$download.excel(res, '活动考勤签到.xlsx');
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
proxy?.$modal.msgError('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 章节分隔样式 */
|
||||
.activity-info-section,
|
||||
.user-info-section,
|
||||
.sign-action-section {
|
||||
margin: 24px 0 16px 0;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 0 0 16px 0;
|
||||
color: #303133;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
border-bottom: 2px solid #409eff;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 签到操作区域样式 */
|
||||
.sign-action-section .el-button {
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 只读字段样式 */
|
||||
.readonly-field {
|
||||
min-height: 32px;
|
||||
padding: 5px 11px;
|
||||
background-color: #f5f7fa;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,660 @@
|
||||
<template>
|
||||
<div class="activity-detail-view">
|
||||
<el-tabs type="border-card" v-model="activeTab">
|
||||
<!-- 基本信息标签页 -->
|
||||
<el-tab-pane label="基本信息" name="basic">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动名称</label>
|
||||
<div class="detail-value">{{ activity.activityName || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动类型</label>
|
||||
<div class="detail-value">
|
||||
<dict-tag :options="stgl_activity_type" :value="activity.activityType" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动主题</label>
|
||||
<div class="detail-value">{{ activity.activityTheme || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动地点</label>
|
||||
<div class="detail-value">{{ activity.location || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">开始时间</label>
|
||||
<div class="detail-value">{{ activity.startTime || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">结束时间</label>
|
||||
<div class="detail-value">{{ activity.endTime || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动状态</label>
|
||||
<div class="detail-value">
|
||||
<dict-tag :options="stgl_activity_status" :value="activity.activityStatus" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">关联社团</label>
|
||||
<div class="detail-value">{{ activity.relatedClubName || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动海报</label>
|
||||
<div class="detail-value">
|
||||
<div v-if="activity.posterUrl" class="view-poster">
|
||||
<image-preview :src="activity.posterUrl" :width="200" :height="150" />
|
||||
</div>
|
||||
<div v-else class="no-poster">
|
||||
<span class="no-poster-text">暂无海报</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动简介</label>
|
||||
<div class="detail-value">
|
||||
<div class="view-description">
|
||||
{{ activity.description || '暂无简介' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主办方信息 -->
|
||||
<div class="section-divider">
|
||||
<h4 class="section-title">主办方信息</h4>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">主办方名称</label>
|
||||
<div class="detail-value">{{ activity.organizerName || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">联系人</label>
|
||||
<div class="detail-value">{{ activity.organizerContact || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">联系电话</label>
|
||||
<div class="detail-value">{{ activity.organizerPhone || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 承办方信息 -->
|
||||
<div class="section-divider">
|
||||
<h4 class="section-title">承办方信息</h4>
|
||||
</div>
|
||||
<div v-if="coOrganizerList.length > 0">
|
||||
<div v-for="(organizer, index) in coOrganizerList" :key="index" class="co-organizer-item">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">承办方名称</label>
|
||||
<div class="detail-value">{{ organizer.name || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">承办方类型</label>
|
||||
<div class="detail-value">{{ organizer.type || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">联系人</label>
|
||||
<div class="detail-value">{{ organizer.contact || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">联系电话</label>
|
||||
<div class="detail-value">{{ organizer.phone || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="no-data">暂无承办方信息</div>
|
||||
|
||||
<!-- 指导老师信息 -->
|
||||
<div class="section-divider">
|
||||
<h4 class="section-title">指导老师信息</h4>
|
||||
</div>
|
||||
<div v-if="instructorList.length > 0">
|
||||
<div v-for="(instructor, index) in instructorList" :key="index" class="instructor-item">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">姓名</label>
|
||||
<div class="detail-value">{{ instructor.name || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">部门</label>
|
||||
<div class="detail-value">{{ instructor.dept || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">电话</label>
|
||||
<div class="detail-value">{{ instructor.phone || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">邮箱</label>
|
||||
<div class="detail-value">{{ instructor.email || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="no-data">暂无指导老师信息</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 报名设置标签页 -->
|
||||
<el-tab-pane label="报名设置" name="registration">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">报名方式</label>
|
||||
<div class="detail-value">
|
||||
<dict-tag :options="stgl_registration_type" :value="activity.registrationType" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">是否需要审核</label>
|
||||
<div class="detail-value">
|
||||
<dict-tag :options="sys_yes_no" :value="activity.needApproval" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">报名开始时间</label>
|
||||
<div class="detail-value">{{ activity.registrationStart || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">报名结束时间</label>
|
||||
<div class="detail-value">{{ activity.registrationEnd || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="activity.maxParticipants">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">总人数上限</label>
|
||||
<div class="detail-value">{{ activity.maxParticipants }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="activity.maxTeams || activity.teamSizeMin || activity.teamSizeMax">
|
||||
<el-col :span="8" v-if="activity.maxTeams">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">团队数量上限</label>
|
||||
<div class="detail-value">{{ activity.maxTeams }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="activity.teamSizeMin">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">每队最小人数</label>
|
||||
<div class="detail-value">{{ activity.teamSizeMin }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="activity.teamSizeMax">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">每队最大人数</label>
|
||||
<div class="detail-value">{{ activity.teamSizeMax }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">报名状态</label>
|
||||
<div class="detail-value">
|
||||
<dict-tag :options="stgl_registration_status" :value="activity.registrationStatus" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">报名人数</label>
|
||||
<div class="detail-value">{{ activity.registrationCount || 0 }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 其他信息标签页(仅已办活动显示) -->
|
||||
<el-tab-pane label="其他信息" name="other" v-if="activity.isFinished === 1">
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动总结报告</label>
|
||||
<div class="detail-value">
|
||||
<div class="view-description">
|
||||
{{ activity.summary || '暂无总结报告' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item" v-if="summaryAttachmentList.length > 0">
|
||||
<label class="detail-label">总结报告附件</label>
|
||||
<div class="detail-value">
|
||||
<div class="attachment-list">
|
||||
<el-tag
|
||||
v-for="(file, index) in summaryAttachmentList"
|
||||
:key="index"
|
||||
type="info"
|
||||
size="small"
|
||||
class="attachment-item"
|
||||
@click="downloadAttachment(file)"
|
||||
>
|
||||
<el-icon class="attachment-icon"><Document /></el-icon>
|
||||
{{ file.name }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item">
|
||||
<label class="detail-label">活动成果</label>
|
||||
<div class="detail-value">
|
||||
<div class="view-description">
|
||||
{{ activity.achievements || '暂无活动成果' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item" v-if="achievementsAttachmentList.length > 0">
|
||||
<label class="detail-label">成果附件</label>
|
||||
<div class="detail-value">
|
||||
<div class="attachment-list">
|
||||
<el-tag
|
||||
v-for="(file, index) in achievementsAttachmentList"
|
||||
:key="index"
|
||||
type="success"
|
||||
size="small"
|
||||
class="attachment-item"
|
||||
@click="downloadAttachment(file)"
|
||||
>
|
||||
<el-icon class="attachment-icon"><Document /></el-icon>
|
||||
{{ file.name }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 活动评分标签页 -->
|
||||
<el-tab-pane label="活动评分" name="rating" v-if="activity.id">
|
||||
<ActivityRatingView :activity-id="activity.id" />
|
||||
|
||||
<!-- 统计信息区域(只在活动评分标签页显示) -->
|
||||
<div class="statistics-section">
|
||||
<el-divider content-position="left">统计信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-statistic title="报名人数" :value="activity.registrationCount || 0" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic title="平均评分" :value="activity.averageRating || 0" :precision="1" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="statistic-item">
|
||||
<div class="statistic-title">创建时间</div>
|
||||
<div class="statistic-value">{{ activity.createTime || '暂无' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, onMounted, watch } from 'vue';
|
||||
import { StglActivityVO, CoOrganizerInfo, InstructorInfo } from '@/api/stgl/activity/types';
|
||||
import ActivityRatingView from './ActivityRatingView.vue';
|
||||
import { listByIds } from '@/api/system/oss';
|
||||
|
||||
interface Props {
|
||||
activity: StglActivityVO;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_activity_type, stgl_activity_status, stgl_registration_type, stgl_registration_status, sys_yes_no } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_activity_status', 'stgl_registration_type', 'stgl_registration_status', 'sys_yes_no')
|
||||
);
|
||||
|
||||
// 当前激活的Tab页签
|
||||
const activeTab = ref('basic');
|
||||
|
||||
// 附件列表状态
|
||||
const summaryAttachmentList = ref<any[]>([]);
|
||||
const achievementsAttachmentList = ref<any[]>([]);
|
||||
|
||||
// 解析承办方信息
|
||||
const coOrganizerList = computed<CoOrganizerInfo[]>(() => {
|
||||
if (!props.activity.coOrganizers) return [];
|
||||
try {
|
||||
return JSON.parse(props.activity.coOrganizers);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
// 解析指导老师信息
|
||||
const instructorList = computed<InstructorInfo[]>(() => {
|
||||
if (!props.activity.instructors) return [];
|
||||
try {
|
||||
return JSON.parse(props.activity.instructors);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
// 加载附件信息
|
||||
const loadAttachments = async () => {
|
||||
|
||||
// 重置附件列表
|
||||
summaryAttachmentList.value = [];
|
||||
achievementsAttachmentList.value = [];
|
||||
|
||||
// 加载总结报告附件
|
||||
if (props.activity.summaryAttachments) {
|
||||
// 检查数据格式:如果以 [ 开头,说明是JSON格式;否则是ossId格式
|
||||
const attachmentStr = String(props.activity.summaryAttachments);
|
||||
if (attachmentStr.trim().startsWith('[')) {
|
||||
try {
|
||||
// JSON格式:直接解析
|
||||
summaryAttachmentList.value = JSON.parse(attachmentStr);
|
||||
} catch (error) {
|
||||
console.error('总结报告附件JSON解析失败:', error);
|
||||
summaryAttachmentList.value = [];
|
||||
}
|
||||
} else {
|
||||
// ossId格式:通过API获取真实附件信息
|
||||
const ossIds = attachmentStr.split(',').filter(id => id.trim());
|
||||
if (ossIds.length > 0) {
|
||||
try {
|
||||
const res = await listByIds(ossIds.join(','));
|
||||
summaryAttachmentList.value = res.data.map((oss: any) => ({
|
||||
name: oss.originalName,
|
||||
url: oss.url,
|
||||
ossId: oss.ossId
|
||||
}));
|
||||
} catch (apiError) {
|
||||
console.error('获取总结报告附件信息失败:', apiError);
|
||||
summaryAttachmentList.value = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 加载活动成果附件
|
||||
if (props.activity.achievementsAttachments) {
|
||||
// 检查数据格式:如果以 [ 开头,说明是JSON格式;否则是ossId格式
|
||||
const attachmentStr = String(props.activity.achievementsAttachments);
|
||||
if (attachmentStr.trim().startsWith('[')) {
|
||||
try {
|
||||
// JSON格式:直接解析
|
||||
achievementsAttachmentList.value = JSON.parse(attachmentStr);
|
||||
} catch (error) {
|
||||
console.error('活动成果附件JSON解析失败:', error);
|
||||
achievementsAttachmentList.value = [];
|
||||
}
|
||||
} else {
|
||||
// ossId格式:通过API获取真实附件信息
|
||||
const ossIds = attachmentStr.split(',').filter(id => id.trim());
|
||||
if (ossIds.length > 0) {
|
||||
try {
|
||||
const res = await listByIds(ossIds.join(','));
|
||||
achievementsAttachmentList.value = res.data.map((oss: any) => ({
|
||||
name: oss.originalName,
|
||||
url: oss.url,
|
||||
ossId: oss.ossId
|
||||
}));
|
||||
} catch (apiError) {
|
||||
console.error('获取活动成果附件信息失败:', apiError);
|
||||
achievementsAttachmentList.value = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 下载附件
|
||||
const downloadAttachment = (file: any) => {
|
||||
if (file.url) {
|
||||
window.open(file.url, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
// 监听props变化,重新加载附件信息
|
||||
watch(() => props.activity, (newActivity) => {
|
||||
if (newActivity && newActivity.id) {
|
||||
loadAttachments();
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// 组件挂载时加载附件信息
|
||||
onMounted(() => {
|
||||
loadAttachments();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.activity-detail-view {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
/* 详情项样式 */
|
||||
.detail-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
margin-bottom: 8px;
|
||||
text-align: right;
|
||||
padding-right: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 120px);
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.view-poster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.no-poster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.no-poster-text {
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
min-height: 80px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
/* 章节分隔样式 */
|
||||
.section-divider {
|
||||
margin: 24px 0 16px 0;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 0 0 16px 0;
|
||||
color: #303133;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
border-bottom: 2px solid #409eff;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 承办方项目样式 */
|
||||
.co-organizer-item {
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.co-organizer-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 指导老师项目样式 */
|
||||
.instructor-item {
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: #fafafa;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.instructor-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.no-data {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.statistics-section {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.statistic-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.statistic-title {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.statistic-value {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 附件显示区域样式 */
|
||||
.attachment-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.attachment-item:hover {
|
||||
opacity: 0.8;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.attachment-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div class="activity-rating-view">
|
||||
<div v-if="ratings.length === 0" class="empty-state">
|
||||
<el-empty description="暂无评分信息" :image-size="80" />
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div class="rating-summary">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-statistic title="总评分数" :value="ratings.length" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic title="平均评分" :value="averageRating" :precision="1" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic title="最高评分" :value="maxRating" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<el-table :data="ratings" height="400" border>
|
||||
<el-table-column label="评分人" prop="userName" width="120" />
|
||||
<el-table-column label="评分" prop="ratingScore" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-rate :model-value="scope.row.ratingScore" disabled size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分备注" prop="ratingComment" show-overflow-tooltip />
|
||||
<el-table-column label="评分时间" prop="ratingTime" width="160" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { getActivityRatings } from '@/api/stgl/activity';
|
||||
import { ActivityRatingVO } from '@/api/stgl/activity/types';
|
||||
|
||||
interface Props {
|
||||
activityId: string | number;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const ratings = ref<ActivityRatingVO[]>([]);
|
||||
const loading = ref(false);
|
||||
|
||||
// 计算平均评分
|
||||
const averageRating = computed(() => {
|
||||
if (ratings.value.length === 0) return 0;
|
||||
const sum = ratings.value.reduce((total, rating) => total + rating.ratingScore, 0);
|
||||
return sum / ratings.value.length;
|
||||
});
|
||||
|
||||
// 计算最高评分
|
||||
const maxRating = computed(() => {
|
||||
if (ratings.value.length === 0) return 0;
|
||||
return Math.max(...ratings.value.map(rating => rating.ratingScore));
|
||||
});
|
||||
|
||||
// 加载评分数据
|
||||
const loadRatings = async () => {
|
||||
if (!props.activityId) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getActivityRatings(props.activityId);
|
||||
ratings.value = res.data || [];
|
||||
} catch (error: any) {
|
||||
// 如果是404错误,说明后端暂未实现该功能,静默处理
|
||||
if (error.response?.status === 404) {
|
||||
console.log('活动评分功能暂未实现');
|
||||
} else {
|
||||
console.error('加载评分数据失败:', error);
|
||||
}
|
||||
ratings.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadRatings();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.activity-rating-view {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.rating-summary {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 60px 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,795 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="queryParams.activityName" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select v-model="queryParams.activityType" placeholder="请选择活动类型" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_activity_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="主办方" prop="organizerName">
|
||||
<el-input v-model="queryParams.organizerName" placeholder="请输入主办方名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="报名方式" prop="registrationType">
|
||||
<el-select v-model="queryParams.registrationType" placeholder="请选择报名方式" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_registration_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<span class="page-title">活动报名大厅</span>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="activityList" @row-dblclick="handleView">
|
||||
<el-table-column label="活动名称" align="center" prop="activityName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="活动类型" align="center" prop="activityType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_activity_type" :value="scope.row.activityType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主办方" align="center" prop="organizerName" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="关联社团" align="center" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.relatedClubName">{{ scope.row.relatedClubName }}</span>
|
||||
<span v-else class="text-gray-400">未关联</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动时间" align="center" width="160">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.startTime && scope.row.endTime">
|
||||
<div>{{ formatDate(scope.row.startTime) }}</div>
|
||||
<div class="text-sm text-gray-500">{{ formatDate(scope.row.endTime) }}</div>
|
||||
</div>
|
||||
<span v-else class="text-gray-400">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名时间" align="center" width="160">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.registrationStart && scope.row.registrationEnd">
|
||||
<div>{{ formatDate(scope.row.registrationStart) }}</div>
|
||||
<div class="text-sm text-gray-500">{{ formatDate(scope.row.registrationEnd) }}</div>
|
||||
</div>
|
||||
<span v-else class="text-gray-400">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名方式" align="center" prop="registrationType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_registration_type" :value="scope.row.registrationType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名状态" align="center" prop="registrationStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_registration_status" :value="scope.row.registrationStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名人数" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="info" size="small">{{ scope.row.registrationCount || 0 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="活动报名" placement="top" v-if="canRegister(scope.row)">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Plus"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleRegister(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="已报名" placement="top" v-else-if="isRegistered(scope.row)">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="Check"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
disabled
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="报名已结束" placement="top" v-else>
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="Clock"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
disabled
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 查看活动详细信息对话框 -->
|
||||
<el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="1200px" append-to-body>
|
||||
<ActivityDetailView :activity="viewForm" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleRegister(viewForm)" v-if="canRegister(viewForm)">立即报名</el-button>
|
||||
<el-button @click="viewDialog.visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 活动报名对话框 -->
|
||||
<el-dialog title="活动报名" v-model="registerDialog.visible" width="1000px" append-to-body>
|
||||
<el-form ref="registerFormRef" :model="registerForm" :rules="registerRules" label-width="120px">
|
||||
<el-form-item label="活动名称">
|
||||
<el-input v-model="selectedActivity.activityName" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="报名类型" prop="registrationType">
|
||||
<el-radio-group v-model="registerForm.registrationType" @change="handleRegistrationTypeChange">
|
||||
<el-radio v-if="isRegistrationTypeAllowed(1)" :value="1">个人报名</el-radio>
|
||||
<el-radio v-if="isRegistrationTypeAllowed(2)" :value="2">团队报名</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 个人报名信息 -->
|
||||
<div v-if="registerForm.registrationType === 1">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="studentName">
|
||||
<el-input v-model="registerForm.studentName" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="registerForm.studentNo" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="registerForm.gender" disabled style="width: 100%">
|
||||
<el-option label="男" value="0" />
|
||||
<el-option label="女" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="registerForm.phone" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="registerForm.department" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="registerForm.major" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="registerForm.className" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="registerForm.email" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 团队报名信息 -->
|
||||
<div v-if="registerForm.registrationType === 2">
|
||||
<el-form-item label="团队名称" prop="teamName">
|
||||
<el-input v-model="registerForm.teamName" placeholder="请输入团队名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="团队描述" prop="teamDescription">
|
||||
<el-input v-model="registerForm.teamDescription" type="textarea" :rows="3" placeholder="请输入团队描述" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 团队负责人信息 -->
|
||||
<el-divider content-position="left">团队负责人</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人姓名" prop="presidentStudent">
|
||||
<StudentSelector
|
||||
v-model="registerForm.presidentStudent"
|
||||
placeholder="请选择团队负责人"
|
||||
:showStudentNo="false"
|
||||
@change="handlePresidentChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人学号" prop="studentNo">
|
||||
<el-input v-model="registerForm.studentNo" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="registerForm.gender" disabled style="width: 100%">
|
||||
<el-option label="男" value="0" />
|
||||
<el-option label="女" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="registerForm.phone" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="registerForm.department" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="registerForm.major" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="registerForm.className" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="registerForm.email" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 团队成员管理 -->
|
||||
<el-divider content-position="left" style="margin-left: 0px;">团队成员</el-divider>
|
||||
<VicePresidentManager
|
||||
:model-value="registerForm.teamMembersNew"
|
||||
title="团队管理"
|
||||
addButtonText="添加团队成员"
|
||||
emptyTip="暂无团队成员,点击上方按钮添加"
|
||||
selectPlaceholder="选择团队成员"
|
||||
@change="handleTeamMembersNewChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-form-item label="申请理由" prop="remark" style="margin-top: 24px;">
|
||||
<el-input v-model="registerForm.remark" type="textarea" :rows="4" placeholder="请简要说明您的申请理由和个人优势(选填)" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="registerLoading" type="primary" @click="submitRegister">提交报名</el-button>
|
||||
<el-button @click="registerDialog.visible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="StglActivityRegisterHall" lang="ts">
|
||||
import { nextTick } from 'vue';
|
||||
import {
|
||||
listRegistrableActivities,
|
||||
getActivityDetail,
|
||||
registerActivity,
|
||||
checkRegistration,
|
||||
getMyRegistrations
|
||||
} from '@/api/stgl/activityregisterhall';
|
||||
import { StglActivityVO, StglActivityQuery } from '@/api/stgl/activity/types';
|
||||
import { StglActivityRegistrationForm, TeamMemberInfo } from '@/api/stgl/activityregisterhall/types';
|
||||
import ActivityDetailView from '@/views/stgl/activity/components/ActivityDetailView.vue';
|
||||
import TeamMemberManager from '@/components/TeamMemberManager/index.vue';
|
||||
import VicePresidentManager from '@/components/VicePresidentManager/index.vue';
|
||||
import StudentSelector from '@/components/StudentSelector/index.vue';
|
||||
import { getPersonalInfo } from '@/api/xg/xsjcxx/studentMsg/studentMsg/index';
|
||||
import type { StudentMsgForm } from '@/api/xg/xsjcxx/studentMsg/studentMsg/types';
|
||||
import { StudentVO } from '@/api/xg/student/types';
|
||||
import { VicePresidentVO } from '@/components/VicePresidentManager/index.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_activity_type, stgl_registration_type, stgl_registration_status } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_registration_type', 'stgl_registration_status')
|
||||
);
|
||||
|
||||
const activityList = ref<StglActivityVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const registerLoading = ref(false);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const registerFormRef = ref<ElFormInstance>();
|
||||
|
||||
const viewDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const registerDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const selectedActivity = ref<StglActivityVO>({} as StglActivityVO);
|
||||
const viewForm = ref<StglActivityVO>({} as StglActivityVO);
|
||||
|
||||
// 用户报名状态缓存
|
||||
const userRegistrationStatus = ref<Record<number, boolean>>({});
|
||||
|
||||
const data = reactive<PageData<StglActivityRegistrationForm, StglActivityQuery>>({
|
||||
form: {
|
||||
activityId: undefined,
|
||||
registrationType: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined
|
||||
} as StglActivityRegistrationForm,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
activityName: undefined,
|
||||
activityType: undefined,
|
||||
organizerName: undefined,
|
||||
registrationType: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
// 报名表单
|
||||
const registerForm = reactive<StglActivityRegistrationForm & {
|
||||
presidentStudent?: StudentVO | null;
|
||||
teamMembersNew?: VicePresidentVO[];
|
||||
}>({
|
||||
activityId: undefined,
|
||||
registrationType: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
gender: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
teamName: undefined,
|
||||
teamDescription: undefined,
|
||||
teamMembers: [], // 保留原有字段,用于兼容
|
||||
teamMembersNew: [], // 新增:使用VicePresidentVO结构的团队成员
|
||||
remark: undefined,
|
||||
presidentStudent: null // 新增:团队负责人学生对象
|
||||
});
|
||||
|
||||
const registerRules = reactive({
|
||||
registrationType: [{ required: true, message: '请选择报名类型', trigger: 'change' }],
|
||||
presidentStudent: [{ required: true, message: '请选择团队负责人', trigger: 'change' }],
|
||||
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
phone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^1[3-9]\d{9}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur'
|
||||
} as any
|
||||
],
|
||||
teamName: [{ required: true, message: '团队名称不能为空', trigger: 'blur' }]
|
||||
} as any);
|
||||
|
||||
/** 查询活动列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listRegistrableActivities(queryParams.value);
|
||||
activityList.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
||||
// 批量检查用户报名状态
|
||||
await checkUserRegistrationStatus();
|
||||
} catch (error) {
|
||||
console.error('查询活动列表失败:', error);
|
||||
proxy?.$modal.msgError('查询活动列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 批量检查用户报名状态 */
|
||||
const checkUserRegistrationStatus = async () => {
|
||||
const promises = activityList.value.map(async (activity) => {
|
||||
try {
|
||||
const registered = await checkRegistration(activity.id as number);
|
||||
userRegistrationStatus.value[activity.id as number] = registered.data;
|
||||
} catch (error) {
|
||||
console.error(`检查活动${activity.id}报名状态失败:`, error);
|
||||
userRegistrationStatus.value[activity.id as number] = false;
|
||||
}
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = async (row: StglActivityVO) => {
|
||||
const res = await getActivityDetail(row.id);
|
||||
viewForm.value = res.data;
|
||||
viewDialog.visible = true;
|
||||
viewDialog.title = '查看活动信息';
|
||||
};
|
||||
|
||||
/** 报名按钮操作 */
|
||||
const handleRegister = async (row: StglActivityVO) => {
|
||||
selectedActivity.value = row;
|
||||
resetRegisterForm();
|
||||
|
||||
registerDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 重置报名表单 */
|
||||
const resetRegisterForm = () => {
|
||||
Object.assign(registerForm, {
|
||||
activityId: selectedActivity.value.id,
|
||||
registrationType: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
gender: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
teamName: undefined,
|
||||
teamDescription: undefined,
|
||||
teamMembers: [],
|
||||
teamMembersNew: [],
|
||||
remark: undefined,
|
||||
presidentStudent: null
|
||||
});
|
||||
|
||||
nextTick(() => {
|
||||
registerFormRef.value?.resetFields();
|
||||
});
|
||||
};
|
||||
|
||||
/** 加载用户信息到报名表单 */
|
||||
const loadUserInfoToForm = async () => {
|
||||
try {
|
||||
const response = await getPersonalInfo();
|
||||
const studentInfo: StudentMsgForm = response.data;
|
||||
|
||||
if (studentInfo) {
|
||||
registerForm.studentName = studentInfo.name || '';
|
||||
registerForm.studentNo = studentInfo.studentNo || '';
|
||||
registerForm.gender = studentInfo.gender || '';
|
||||
registerForm.phone = studentInfo.phone || '';
|
||||
registerForm.email = studentInfo.email || '';
|
||||
registerForm.department = studentInfo.collegeName || '';
|
||||
registerForm.major = studentInfo.majorName || '';
|
||||
registerForm.className = studentInfo.className || '';
|
||||
} else {
|
||||
proxy?.$modal.msgWarning('未能获取到用户信息,请手动填写报名表单');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error);
|
||||
proxy?.$modal.msgWarning('获取用户信息失败,请联系管理员或手动填写');
|
||||
}
|
||||
};
|
||||
|
||||
/** 报名类型变化处理 */
|
||||
const handleRegistrationTypeChange = async (value: number) => {
|
||||
if (value === 1) {
|
||||
// 个人报名,清空团队相关信息并自动填充当前用户信息
|
||||
registerForm.teamName = undefined;
|
||||
registerForm.teamDescription = undefined;
|
||||
registerForm.teamMembers = [];
|
||||
registerForm.teamMembersNew = [];
|
||||
registerForm.presidentStudent = null;
|
||||
|
||||
// 自动填充当前用户信息
|
||||
await loadUserInfoToForm();
|
||||
} else if (value === 2) {
|
||||
// 团队报名,清空个人信息,让用户选择团队负责人
|
||||
registerForm.studentName = undefined;
|
||||
registerForm.studentNo = undefined;
|
||||
registerForm.gender = undefined;
|
||||
registerForm.phone = undefined;
|
||||
registerForm.email = undefined;
|
||||
registerForm.department = undefined;
|
||||
registerForm.major = undefined;
|
||||
registerForm.className = undefined;
|
||||
registerForm.presidentStudent = null;
|
||||
}
|
||||
};
|
||||
|
||||
/** 团队负责人选择变化处理 */
|
||||
const handlePresidentChange = async (student: StudentVO | null) => {
|
||||
if (student) {
|
||||
// 自动填充负责人信息
|
||||
registerForm.studentName = student.name || '';
|
||||
registerForm.studentNo = student.studentNo || '';
|
||||
registerForm.gender = student.gender || '';
|
||||
registerForm.phone = student.phone || '';
|
||||
registerForm.department = student.collegeName || '';
|
||||
registerForm.major = student.majorName || '';
|
||||
registerForm.className = student.className || '';
|
||||
|
||||
// 清空email,让用户手动填写或通过其他方式获取
|
||||
registerForm.email = undefined;
|
||||
} else {
|
||||
// 清空负责人信息
|
||||
registerForm.studentName = undefined;
|
||||
registerForm.studentNo = undefined;
|
||||
registerForm.gender = undefined;
|
||||
registerForm.phone = undefined;
|
||||
registerForm.email = undefined;
|
||||
registerForm.department = undefined;
|
||||
registerForm.major = undefined;
|
||||
registerForm.className = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/** 新版团队成员变化处理 */
|
||||
const handleTeamMembersNewChange = (members: VicePresidentVO[]) => {
|
||||
registerForm.teamMembersNew = members;
|
||||
|
||||
// 同步到原有字段,用于兼容后端
|
||||
registerForm.teamMembers = members.map(member => ({
|
||||
userId: member.student?.id || 0,
|
||||
studentNo: member.student?.studentNo || '',
|
||||
studentName: member.name || member.student?.name || '',
|
||||
gender: member.student?.gender || '',
|
||||
phone: member.phone || member.student?.phone || '',
|
||||
email: '', // VicePresidentVO可能没有email字段
|
||||
department: member.dept || member.student?.collegeName || '',
|
||||
major: member.major || member.student?.majorName || '',
|
||||
className: member.class || member.student?.className || '',
|
||||
isLeader: 0 // 团队成员,非负责人
|
||||
}));
|
||||
|
||||
// 验证团队人数限制
|
||||
const totalMembers = members.length + 1; // 包含负责人
|
||||
if (selectedActivity.value.teamSizeMin && totalMembers < selectedActivity.value.teamSizeMin) {
|
||||
proxy?.$modal.msgWarning(`团队人数不能少于${selectedActivity.value.teamSizeMin}人`);
|
||||
}
|
||||
if (selectedActivity.value.teamSizeMax && totalMembers > selectedActivity.value.teamSizeMax) {
|
||||
proxy?.$modal.msgWarning(`团队人数不能超过${selectedActivity.value.teamSizeMax}人`);
|
||||
}
|
||||
};
|
||||
|
||||
/** 团队成员变化处理(兼容原有方法) */
|
||||
const handleTeamMembersChange = (members: TeamMemberInfo[]) => {
|
||||
registerForm.teamMembers = members;
|
||||
|
||||
// 验证团队人数限制
|
||||
const totalMembers = members.length + 1; // 包含负责人
|
||||
if (selectedActivity.value.teamSizeMin && totalMembers < selectedActivity.value.teamSizeMin) {
|
||||
proxy?.$modal.msgWarning(`团队人数不能少于${selectedActivity.value.teamSizeMin}人`);
|
||||
}
|
||||
if (selectedActivity.value.teamSizeMax && totalMembers > selectedActivity.value.teamSizeMax) {
|
||||
proxy?.$modal.msgWarning(`团队人数不能超过${selectedActivity.value.teamSizeMax}人`);
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交报名 */
|
||||
const submitRegister = () => {
|
||||
registerFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
// 团队报名时验证人数限制
|
||||
if (registerForm.registrationType === 2) {
|
||||
const totalMembers = (registerForm.teamMembersNew?.length || 0) + 1;
|
||||
if (selectedActivity.value.teamSizeMin && totalMembers < selectedActivity.value.teamSizeMin) {
|
||||
proxy?.$modal.msgError(`团队人数不能少于${selectedActivity.value.teamSizeMin}人,当前${totalMembers}人`);
|
||||
return;
|
||||
}
|
||||
if (selectedActivity.value.teamSizeMax && totalMembers > selectedActivity.value.teamSizeMax) {
|
||||
proxy?.$modal.msgError(`团队人数不能超过${selectedActivity.value.teamSizeMax}人,当前${totalMembers}人`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
registerLoading.value = true;
|
||||
try {
|
||||
// 根据报名类型准备不同的提交数据
|
||||
const submitData: any = {
|
||||
activityId: registerForm.activityId,
|
||||
registrationType: registerForm.registrationType,
|
||||
studentName: registerForm.studentName,
|
||||
studentNo: registerForm.studentNo,
|
||||
gender: registerForm.gender,
|
||||
phone: registerForm.phone,
|
||||
email: registerForm.email,
|
||||
department: registerForm.department,
|
||||
major: registerForm.major,
|
||||
className: registerForm.className,
|
||||
remark: registerForm.remark
|
||||
};
|
||||
|
||||
// 只有团队报名时才发送团队相关字段
|
||||
if (registerForm.registrationType === 2) {
|
||||
submitData.teamName = registerForm.teamName;
|
||||
submitData.teamDescription = registerForm.teamDescription;
|
||||
|
||||
// 将团队成员数组转换为JSON字符串(后端期望String类型)
|
||||
if (registerForm.teamMembers && Array.isArray(registerForm.teamMembers)) {
|
||||
submitData.teamMembers = JSON.stringify(registerForm.teamMembers);
|
||||
} else {
|
||||
submitData.teamMembers = JSON.stringify([]);
|
||||
}
|
||||
}
|
||||
// 个人报名时不发送任何团队相关字段
|
||||
|
||||
await registerActivity(submitData);
|
||||
proxy?.$modal.msgSuccess('报名成功,请等待审核');
|
||||
registerDialog.visible = false;
|
||||
|
||||
// 更新报名状态
|
||||
userRegistrationStatus.value[selectedActivity.value.id as number] = true;
|
||||
} catch (error) {
|
||||
console.error('报名失败:', error);
|
||||
const errorMsg = (error as any)?.response?.data?.msg || (error as any)?.message || '报名失败,请稍后重试';
|
||||
proxy?.$modal.msgError(errorMsg);
|
||||
} finally {
|
||||
registerLoading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 判断是否可以报名 */
|
||||
const canRegister = (activity: StglActivityVO): boolean => {
|
||||
// 报名状态为0(未开始)或1(报名中),且用户未报名
|
||||
return [0, 1].includes(activity.registrationStatus || 0) && !isRegistered(activity);
|
||||
};
|
||||
|
||||
/** 判断用户是否已报名 */
|
||||
const isRegistered = (activity: StglActivityVO): boolean => {
|
||||
return userRegistrationStatus.value[activity.id as number] || false;
|
||||
};
|
||||
|
||||
/** 判断报名类型是否允许 */
|
||||
const isRegistrationTypeAllowed = (type: number): boolean => {
|
||||
const activityType = Number(selectedActivity.value.registrationType);
|
||||
return activityType === 3 || activityType === type; // 3表示两者均可
|
||||
};
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
/* 页面标题 */
|
||||
.page-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,373 @@
|
||||
<template>
|
||||
<div class="material-task-detail">
|
||||
<el-tabs v-model="activeTab" type="border-card">
|
||||
<!-- 任务信息标签页 -->
|
||||
<el-tab-pane label="任务信息" name="task">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="活动名称">
|
||||
{{ task.activityName || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="任务名称">
|
||||
{{ task.taskName || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="任务状态">
|
||||
<el-tag :type="task.taskStatus === 1 ? 'success' : 'danger'">
|
||||
{{ task.taskStatus === 1 ? '开启' : '关闭' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="截止时间">
|
||||
{{ formatDate(task.deadline) || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="文件大小限制">
|
||||
{{ task.fileSizeLimit || 0 }} MB
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="文件数量限制">
|
||||
{{ task.fileCountLimit || 0 }} 个
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总参与人数">
|
||||
{{ task.totalParticipants || 0 }} 人
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已提交人数">
|
||||
{{ task.submittedCount || 0 }} 人
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建者">
|
||||
{{ task.createByName || '未知' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ formatDate(task.createTime) || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="材料收集类型" :span="2">
|
||||
<div class="collection-types">
|
||||
<el-tag
|
||||
v-for="type in parseCollectionTypes(task.collectionTypes)"
|
||||
:key="type"
|
||||
type="info"
|
||||
size="small"
|
||||
class="mr-2"
|
||||
>
|
||||
{{ getMaterialTypeLabel(type) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="收集说明" :span="2">
|
||||
<div class="task-description">
|
||||
{{ task.taskDescription || '无' }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2" v-if="task.remark">
|
||||
<div class="task-remark">
|
||||
{{ task.remark }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 上传信息标签页 -->
|
||||
<el-tab-pane label="上传信息" name="submissions">
|
||||
<div class="submissions-section">
|
||||
<!-- 统计信息 -->
|
||||
<el-card shadow="never" class="mb-4">
|
||||
<div class="statistics-row">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">总提交数:</span>
|
||||
<span class="stat-value">{{ statistics.totalSubmissions || 0 }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">待审核:</span>
|
||||
<span class="stat-value pending">{{ statistics.pendingCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">已通过:</span>
|
||||
<span class="stat-value approved">{{ statistics.approvedCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">已驳回:</span>
|
||||
<span class="stat-value rejected">{{ statistics.rejectedCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">个人提交:</span>
|
||||
<span class="stat-value">{{ statistics.individualCount || 0 }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">团队提交:</span>
|
||||
<span class="stat-value">{{ statistics.teamCount || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 提交记录列表 -->
|
||||
<el-table
|
||||
v-loading="submissionsLoading"
|
||||
:data="submissions"
|
||||
border
|
||||
style="width: 100%"
|
||||
max-height="400px"
|
||||
>
|
||||
<el-table-column label="学号" prop="studentNo" width="120" />
|
||||
<el-table-column label="学生姓名" prop="studentName" width="100" />
|
||||
<el-table-column label="提交类型" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.submissionType === 1 ? 'primary' : 'success'" size="small">
|
||||
{{ scope.row.submissionType === 1 ? '个人' : '团队' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="团队名称" prop="teamName" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="提交时间" width="160">
|
||||
<template #default="scope">
|
||||
{{ formatDate(scope.row.submissionTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getReviewStatusType(scope.row.reviewStatus) as any"
|
||||
size="small"
|
||||
>
|
||||
{{ getReviewStatusText(scope.row.reviewStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核时间" width="160">
|
||||
<template #default="scope">
|
||||
{{ scope.row.reviewTime ? formatDate(scope.row.reviewTime) : '未审核' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文本内容" min-width="200" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.contentText || '无' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="viewSubmissionDetail(scope.row)"
|
||||
>
|
||||
查看详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container mt-4" v-if="submissionTotal > 0">
|
||||
<el-pagination
|
||||
v-model:current-page="submissionQuery.pageNum"
|
||||
v-model:page-size="submissionQuery.pageSize"
|
||||
:total="submissionTotal"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="getSubmissions"
|
||||
@current-change="getSubmissions"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 提交详情对话框 -->
|
||||
<el-dialog
|
||||
v-model="submissionDetailVisible"
|
||||
title="提交详情"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<SubmissionDetailView :submission="selectedSubmission" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getSubmissionsByTaskId, getSubmissionStatistics } from '@/api/stgl/activitymaterial';
|
||||
import { StglMaterialTaskVO, StglMaterialSubmissionVO } from '@/api/stgl/activitymaterial/types';
|
||||
import SubmissionDetailView from './SubmissionDetailView.vue';
|
||||
|
||||
interface Props {
|
||||
task: StglMaterialTaskVO;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_material_type } = toRefs<any>(
|
||||
proxy?.useDict('stgl_material_type')
|
||||
);
|
||||
|
||||
const activeTab = ref('task');
|
||||
const submissionsLoading = ref(false);
|
||||
const submissions = ref<StglMaterialSubmissionVO[]>([]);
|
||||
const submissionTotal = ref(0);
|
||||
const statistics = ref<any>({});
|
||||
const submissionDetailVisible = ref(false);
|
||||
const selectedSubmission = ref<StglMaterialSubmissionVO>({} as StglMaterialSubmissionVO);
|
||||
|
||||
const submissionQuery = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskId: ''
|
||||
});
|
||||
|
||||
/** 获取提交记录 */
|
||||
const getSubmissions = async () => {
|
||||
if (!props.task.id) return;
|
||||
|
||||
submissionsLoading.value = true;
|
||||
try {
|
||||
submissionQuery.taskId = String(props.task.id);
|
||||
const res = await getSubmissionsByTaskId(props.task.id);
|
||||
submissions.value = res.data || [];
|
||||
submissionTotal.value = res.data?.length || 0;
|
||||
} catch (error) {
|
||||
console.error('获取提交记录失败:', error);
|
||||
} finally {
|
||||
submissionsLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取统计信息 */
|
||||
const getStatistics = async () => {
|
||||
if (!props.task.id) return;
|
||||
|
||||
try {
|
||||
const res = await getSubmissionStatistics(props.task.id);
|
||||
statistics.value = res.data || {};
|
||||
} catch (error) {
|
||||
console.error('获取统计信息失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 查看提交详情 */
|
||||
const viewSubmissionDetail = (submission: StglMaterialSubmissionVO) => {
|
||||
selectedSubmission.value = submission;
|
||||
submissionDetailVisible.value = true;
|
||||
};
|
||||
|
||||
/** 解析收集类型 */
|
||||
const parseCollectionTypes = (types: string): string[] => {
|
||||
if (!types) return [];
|
||||
return types.split(',').filter(type => type.trim());
|
||||
};
|
||||
|
||||
/** 获取材料类型标签 */
|
||||
const getMaterialTypeLabel = (value: string): string => {
|
||||
const dict = stgl_material_type.value?.find((item: any) => item.value === value);
|
||||
return dict ? dict.label : value;
|
||||
};
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取审核状态类型 */
|
||||
const getReviewStatusType = (status: number): string => {
|
||||
const statusMap: Record<number, string> = {
|
||||
0: 'warning', // 待审核
|
||||
1: 'success', // 通过
|
||||
2: 'danger' // 驳回
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 获取审核状态文本 */
|
||||
const getReviewStatusText = (status: number): string => {
|
||||
const statusMap: Record<number, string> = {
|
||||
0: '待审核',
|
||||
1: '通过',
|
||||
2: '驳回'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
};
|
||||
|
||||
/** 监听标签页切换 */
|
||||
watch(activeTab, (newTab) => {
|
||||
if (newTab === 'submissions') {
|
||||
getSubmissions();
|
||||
getStatistics();
|
||||
}
|
||||
});
|
||||
|
||||
/** 监听任务变化 */
|
||||
watch(() => props.task.id, (newId) => {
|
||||
if (newId && activeTab.value === 'submissions') {
|
||||
getSubmissions();
|
||||
getStatistics();
|
||||
}
|
||||
}, { immediate: true });
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.material-task-detail {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.collection-types {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.task-description,
|
||||
.task-remark {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.submissions-section {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.statistics-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 24px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.stat-value.pending {
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
.stat-value.approved {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
.stat-value.rejected {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<div class="material-upload-form">
|
||||
<el-form ref="uploadFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="提交类型" prop="submissionType">
|
||||
<el-radio-group v-model="form.submissionType">
|
||||
<el-radio :label="1">个人提交</el-radio>
|
||||
<el-radio :label="2">团队提交</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="文本内容" prop="contentText">
|
||||
<el-input
|
||||
v-model="form.contentText"
|
||||
type="textarea"
|
||||
placeholder="请输入文本内容"
|
||||
:rows="4"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="附件上传">
|
||||
<file-upload v-model="form.fileUrls" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="loading">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { uploadMaterial } from '@/api/stgl/activitymaterial';
|
||||
import { StglMaterialSubmissionForm } from '@/api/stgl/activitymaterial/types';
|
||||
|
||||
interface Props {
|
||||
taskId: string | number;
|
||||
activityId: string | number;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
(e: 'cancel'): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const uploadFormRef = ref<ElFormInstance>();
|
||||
const loading = ref(false);
|
||||
|
||||
const form = reactive<StglMaterialSubmissionForm>({
|
||||
taskId: props.taskId,
|
||||
activityId: props.activityId,
|
||||
submissionType: 1,
|
||||
contentText: '',
|
||||
fileUrls: ''
|
||||
});
|
||||
|
||||
const rules = {
|
||||
submissionType: [{ required: true, message: '请选择提交类型', trigger: 'change' }],
|
||||
contentText: [{ required: true, message: '请输入文本内容', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
uploadFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
try {
|
||||
await uploadMaterial(form);
|
||||
ElMessage.success('上传成功');
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('上传失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('cancel');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.material-upload-form {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div class="submission-detail">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="学号">
|
||||
{{ submission.studentNo || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学生姓名">
|
||||
{{ submission.studentName || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="提交类型">
|
||||
<el-tag :type="submission.submissionType === 1 ? 'primary' : 'success'" size="small">
|
||||
{{ submission.submissionType === 1 ? '个人' : '团队' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="团队名称" v-if="submission.submissionType === 2">
|
||||
{{ submission.teamName || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="提交时间">
|
||||
{{ formatDate(submission.submissionTime) || '未设置' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
<el-tag :type="getReviewStatusType(submission.reviewStatus) as any" size="small">
|
||||
{{ getReviewStatusText(submission.reviewStatus) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间" v-if="submission.reviewTime">
|
||||
{{ formatDate(submission.reviewTime) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核人" v-if="submission.reviewByName">
|
||||
{{ submission.reviewByName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="文本内容" :span="2">
|
||||
<div class="content-text">
|
||||
{{ submission.contentText || '无' }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="2" v-if="submission.reviewRemark">
|
||||
<div class="review-remark">
|
||||
{{ submission.reviewRemark }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { StglMaterialSubmissionVO } from '@/api/stgl/activitymaterial/types';
|
||||
|
||||
interface Props {
|
||||
submission: StglMaterialSubmissionVO;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取审核状态类型 */
|
||||
const getReviewStatusType = (status: number): string => {
|
||||
const statusMap: Record<number, string> = {
|
||||
0: 'warning', // 待审核
|
||||
1: 'success', // 通过
|
||||
2: 'danger' // 驳回
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 获取审核状态文本 */
|
||||
const getReviewStatusText = (status: number): string => {
|
||||
const statusMap: Record<number, string> = {
|
||||
0: '待审核',
|
||||
1: '通过',
|
||||
2: '驳回'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.submission-detail {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.content-text,
|
||||
.review-remark {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,609 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="queryParams.activityName" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="收集类型" prop="collectionTypes">
|
||||
<el-select v-model="queryParams.collectionTypes" placeholder="请选择收集类型" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_material_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="任务状态" prop="taskStatus">
|
||||
<el-select v-model="queryParams.taskStatus" placeholder="请选择任务状态" clearable style="width: 100%">
|
||||
<el-option label="开启" :value="1" />
|
||||
<el-option label="关闭" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="创建者" prop="creatorName">
|
||||
<el-input v-model="queryParams.creatorName" placeholder="请输入创建者姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="截止时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:activitymaterial:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['stgl:activitymaterial:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['stgl:activitymaterial:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="Open"
|
||||
:disabled="single"
|
||||
@click="handleStatusChange(1)"
|
||||
v-hasPermi="['stgl:activitymaterial:status']"
|
||||
>开启</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
icon="TurnOff"
|
||||
:disabled="single"
|
||||
@click="handleStatusChange(0)"
|
||||
v-hasPermi="['stgl:activitymaterial:status']"
|
||||
>关闭</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="Upload"
|
||||
:disabled="single || !canUpload"
|
||||
@click="handleUpload()"
|
||||
v-hasPermi="['stgl:activitymaterial:upload']"
|
||||
>上传</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" icon="Download" @click="handleExport" v-hasPermi="['stgl:activitymaterial:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange" @row-dblclick="handleView">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="活动名称" align="center" prop="activityName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="收集说明" align="center" prop="taskDescription" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="创建者" align="center" prop="createByName" width="100" />
|
||||
<el-table-column label="截止时间" align="center" prop="deadline" width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.deadline">{{ formatDate(scope.row.deadline) }}</span>
|
||||
<span v-else class="text-gray-400">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料收集类型" align="center" prop="collectionTypesDisplay" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="文件大小限制(MB)" align="center" prop="fileSizeLimit" width="120" />
|
||||
<el-table-column label="文件数量限制" align="center" prop="fileCountLimit" width="100" />
|
||||
<el-table-column label="任务状态" align="center" prop="taskStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.taskStatus === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.taskStatus === 1 ? '开启' : '关闭' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交人数" align="center" prop="submittedCount" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="info" size="small">{{ scope.row.submittedCount || 0 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['stgl:activitymaterial:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stgl:activitymaterial:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="scope.row.taskStatus === 1 ? '关闭' : '开启'" placement="top">
|
||||
<el-button
|
||||
link
|
||||
:type="scope.row.taskStatus === 1 ? 'warning' : 'success'"
|
||||
:icon="scope.row.taskStatus === 1 ? 'TurnOff' : 'Open'"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleStatusChange(scope.row.taskStatus === 1 ? 0 : 1, scope.row)"
|
||||
v-hasPermi="['stgl:activitymaterial:status']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="上传" placement="top" v-if="scope.row.taskStatus === 1">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Upload"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleUpload(scope.row)"
|
||||
v-hasPermi="['stgl:activitymaterial:upload']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stgl:activitymaterial:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改材料收集任务对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
||||
<el-form ref="materialFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="活动名称" prop="activityId">
|
||||
<ActivitySelector v-model="form.activityId" @change="handleActivityChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称" prop="taskName">
|
||||
<el-input
|
||||
v-model="form.taskName"
|
||||
placeholder="请输入任务名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收集说明" prop="taskDescription">
|
||||
<el-input
|
||||
v-model="form.taskDescription"
|
||||
type="textarea"
|
||||
placeholder="请输入收集说明"
|
||||
:rows="3"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="截止时间" prop="deadline">
|
||||
<el-date-picker
|
||||
v-model="form.deadline"
|
||||
type="datetime"
|
||||
placeholder="请选择截止时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="材料收集类型" prop="collectionTypes">
|
||||
<MaterialTypeSelector v-model="form.collectionTypes" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件大小要求(MB)" prop="fileSizeLimit">
|
||||
<el-input-number
|
||||
v-model="form.fileSizeLimit"
|
||||
:min="1"
|
||||
:max="1024"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传数量上限" prop="fileCountLimit">
|
||||
<el-input-number
|
||||
v-model="form.fileCountLimit"
|
||||
:min="1"
|
||||
:max="100"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
:rows="2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看材料收集任务详情对话框 -->
|
||||
<el-dialog title="材料收集任务详情" v-model="viewDialog.visible" width="1000px" append-to-body>
|
||||
<MaterialTaskDetailView :task="viewDialog.task" v-if="viewDialog.task" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 上传材料对话框 -->
|
||||
<el-dialog title="上传材料" v-model="uploadDialog.visible" width="600px" append-to-body>
|
||||
<MaterialUploadForm
|
||||
:task-id="uploadDialog.taskId"
|
||||
:activity-id="uploadDialog.activityId"
|
||||
@success="handleUploadSuccess"
|
||||
@cancel="uploadDialog.visible = false"
|
||||
v-if="uploadDialog.visible"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
listStglMaterialTask,
|
||||
getStglMaterialTask,
|
||||
delStglMaterialTask,
|
||||
addStglMaterialTask,
|
||||
updateStglMaterialTask,
|
||||
updateTaskStatus,
|
||||
exportStglMaterialTask
|
||||
} from '@/api/stgl/activitymaterial';
|
||||
import { StglMaterialTaskVO, StglMaterialTaskForm, StglMaterialTaskQuery } from '@/api/stgl/activitymaterial/types';
|
||||
import ActivitySelector from '@/components/ActivitySelector/index.vue';
|
||||
import MaterialTypeSelector from '@/components/MaterialTypeSelector/index.vue';
|
||||
import MaterialTaskDetailView from './components/MaterialTaskDetailView.vue';
|
||||
import MaterialUploadForm from './components/MaterialUploadForm.vue';
|
||||
import { ComponentInternalInstance } from 'vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_material_type } = toRefs<any>(proxy?.useDict('stgl_material_type'));
|
||||
|
||||
const taskList = ref<StglMaterialTaskVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
|
||||
const materialFormRef = ref<ElFormInstance>();
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const viewDialog = reactive({
|
||||
visible: false,
|
||||
task: null as StglMaterialTaskVO | null
|
||||
});
|
||||
|
||||
const uploadDialog = reactive({
|
||||
visible: false,
|
||||
taskId: '',
|
||||
activityId: ''
|
||||
});
|
||||
|
||||
const initFormData: StglMaterialTaskForm = {
|
||||
id: undefined,
|
||||
activityId: '',
|
||||
taskName: '',
|
||||
taskDescription: '',
|
||||
collectionTypes: '',
|
||||
deadline: '',
|
||||
fileSizeLimit: 10,
|
||||
fileCountLimit: 5,
|
||||
remark: ''
|
||||
};
|
||||
|
||||
const data = reactive<PageData<StglMaterialTaskForm, StglMaterialTaskQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
activityName: '',
|
||||
collectionTypes: '',
|
||||
taskStatus: undefined,
|
||||
creatorName: '',
|
||||
deadlineStart: '',
|
||||
deadlineEnd: ''
|
||||
},
|
||||
rules: {
|
||||
activityId: [{ required: true, message: '活动名称不能为空', trigger: 'change' }],
|
||||
taskName: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
||||
taskDescription: [{ required: true, message: '收集说明不能为空', trigger: 'blur' }],
|
||||
deadline: [{ required: true, message: '截止时间不能为空', trigger: 'change' }],
|
||||
collectionTypes: [{ required: true, message: '材料收集类型不能为空', trigger: 'change' }],
|
||||
fileSizeLimit: [{ required: true, message: '文件大小要求不能为空', trigger: 'blur' }],
|
||||
fileCountLimit: [{ required: true, message: '上传数量上限不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询材料收集任务列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const params = { ...queryParams.value };
|
||||
if (dateRange.value && dateRange.value[0] && dateRange.value[1]) {
|
||||
params.deadlineStart = dateRange.value[0];
|
||||
params.deadlineEnd = dateRange.value[1];
|
||||
} else {
|
||||
params.deadlineStart = '';
|
||||
params.deadlineEnd = '';
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await listStglMaterialTask(params);
|
||||
taskList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
dateRange.value = ['', ''];
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: StglMaterialTaskVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 计算是否可以上传 */
|
||||
const canUpload = computed(() => {
|
||||
if (single.value) return false;
|
||||
const selectedTask = taskList.value.find(item => ids.value.includes(item.id));
|
||||
return selectedTask?.taskStatus === 1;
|
||||
});
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加材料收集任务';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: StglMaterialTaskVO) => {
|
||||
loading.value = true;
|
||||
reset();
|
||||
const id = row?.id || ids.value[0];
|
||||
try {
|
||||
const res = await getStglMaterialTask(id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改材料收集任务';
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
materialFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateStglMaterialTask(form.value);
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
} else {
|
||||
await addStglMaterialTask(form.value);
|
||||
proxy?.$modal.msgSuccess('新增成功');
|
||||
}
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: StglMaterialTaskVO) => {
|
||||
const taskIds = row?.id ? [row.id] : ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除材料收集任务编号为"' + taskIds + '"的数据项?');
|
||||
loading.value = true;
|
||||
try {
|
||||
await delStglMaterialTask(taskIds);
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 状态修改 */
|
||||
const handleStatusChange = async (status: number, row?: StglMaterialTaskVO) => {
|
||||
const taskIds = row?.id ? [row.id] : ids.value;
|
||||
const statusText = status === 1 ? '开启' : '关闭';
|
||||
await proxy?.$modal.confirm(`确认要${statusText}所选的材料收集任务吗?`);
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
// 处理单个或多个任务状态更新
|
||||
const promises = Array.isArray(taskIds)
|
||||
? taskIds.map(id => updateTaskStatus(id, status))
|
||||
: [updateTaskStatus(taskIds, status)];
|
||||
await Promise.all(promises);
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess(`${statusText}成功`);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 查看详情 */
|
||||
const handleView = (row: StglMaterialTaskVO) => {
|
||||
viewDialog.task = row;
|
||||
viewDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 上传材料 */
|
||||
const handleUpload = (row?: StglMaterialTaskVO) => {
|
||||
const taskId = row?.id || ids.value[0];
|
||||
let activityId = '';
|
||||
|
||||
if (row) {
|
||||
activityId = String(row.activityId);
|
||||
} else {
|
||||
// 如果没有传row,从选中的任务中获取activityId
|
||||
const selectedTask = taskList.value.find(item => item.id === ids.value[0]);
|
||||
activityId = selectedTask ? String(selectedTask.activityId) : '';
|
||||
}
|
||||
|
||||
uploadDialog.taskId = String(taskId);
|
||||
uploadDialog.activityId = activityId;
|
||||
uploadDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 上传成功回调 */
|
||||
const handleUploadSuccess = () => {
|
||||
uploadDialog.visible = false;
|
||||
getList();
|
||||
proxy?.$modal.msgSuccess('上传成功');
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportStglMaterialTask(queryParams.value);
|
||||
proxy?.$download.excel(res, `材料收集任务_${new Date().getTime()}.xlsx`);
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
proxy?.$modal.msgError('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 活动选择变化 */
|
||||
const handleActivityChange = (activityId: string) => {
|
||||
// 可以在这里根据活动信息做一些处理
|
||||
console.log('Selected activity:', activityId);
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
materialFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-btn-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.button-card {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__header) {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="queryParams.activityName" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="报名类型" prop="registrationType">
|
||||
<el-select v-model="queryParams.registrationType" placeholder="请选择报名类型" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_registration_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择审核状态" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_approval_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Check" :disabled="multiple" @click="handleBatchApprove()" v-hasPermi="['stgl:activityRegister:approve']">批量审核</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['stgl:activityRegister:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="registerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="55" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动名称" align="center" prop="activityName" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" width="120" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
|
||||
<el-table-column label="报名类型" align="center" prop="registrationType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_registration_type" :value="scope.row.registrationType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="团队名称" align="center" prop="teamName" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="审核状态" align="center" prop="approvalStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_approval_status" :value="scope.row.approvalStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名时间" align="center" prop="registrationTime" width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.registrationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" align="center" prop="remark" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="审核意见" align="center" prop="approvalRemark" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="成绩" align="center" prop="score" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.score || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['stgl:activityRegister:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 待审核状态显示审核按钮 -->
|
||||
<template v-if="Number(scope.row.approvalStatus) === 0">
|
||||
<el-tooltip content="审核" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleApprove(scope.row)"
|
||||
v-hasPermi="['stgl:activityRegister:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 审核通过状态显示成绩录入按钮 -->
|
||||
<template v-if="Number(scope.row.approvalStatus) === 1">
|
||||
<el-tooltip content="录入成绩" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="Edit"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleRecordScore(scope.row)"
|
||||
v-hasPermi="['stgl:activityRegister:recordScore']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 查看活动报名详情对话框 -->
|
||||
<el-dialog title="活动报名详情" v-model="viewOpen" width="800px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="活动名称" :span="2">{{ viewForm.activityName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学生姓名">{{ viewForm.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ viewForm.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报名类型">
|
||||
<dict-tag :options="stgl_registration_type" :value="viewForm.registrationType" v-if="viewForm.registrationType !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="团队名称">{{ viewForm.teamName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态" :span="2">
|
||||
<dict-tag :options="stgl_approval_status" :value="viewForm.approvalStatus" v-if="viewForm.approvalStatus !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报名时间">{{ parseTime(viewForm.registrationTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">{{ viewForm.approvalTime ? parseTime(viewForm.approvalTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请理由" :span="2">{{ viewForm.remark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="2">{{ viewForm.approvalRemark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="获得成绩">{{ viewForm.score || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成绩录入时间">{{ viewForm.scoreTime ? parseTime(viewForm.scoreTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog :title="approvalTitle" v-model="approvalOpen" width="500px" append-to-body>
|
||||
<el-form ref="approvalRef" :model="approvalForm" :rules="approvalRules" label-width="80px">
|
||||
<!-- 显示状态选择 -->
|
||||
<el-form-item label="审核结果" prop="approvalStatus" v-if="approvalTitle === '审核' || approvalTitle === '批量审核'">
|
||||
<el-select v-model="approvalForm.approvalStatus" placeholder="请选择审核结果" style="width: 100%">
|
||||
<el-option
|
||||
:value="1"
|
||||
label="审核通过"
|
||||
>
|
||||
<span style="display: flex; align-items: center;">
|
||||
<el-icon style="color: #67c23a; margin-right: 8px"><Check /></el-icon>
|
||||
审核通过
|
||||
</span>
|
||||
</el-option>
|
||||
<el-option
|
||||
:value="2"
|
||||
label="审核不通过"
|
||||
>
|
||||
<span style="display: flex; align-items: center;">
|
||||
<el-icon style="color: #f56c6c; margin-right: 8px"><Close /></el-icon>
|
||||
审核不通过
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="approvalRemark">
|
||||
<el-input v-model="approvalForm.approvalRemark" type="textarea" placeholder="请输入审核意见" :rows="4" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitApproval">确 定</el-button>
|
||||
<el-button @click="approvalOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 成绩录入对话框 -->
|
||||
<el-dialog title="录入成绩" v-model="scoreOpen" width="500px" append-to-body>
|
||||
<el-form ref="scoreRef" :model="scoreForm" :rules="scoreRules" label-width="80px">
|
||||
<!-- 根据报名类型显示不同的标签 -->
|
||||
<el-form-item :label="scoreForm.registrationType === '2' ? '团队名称' : '学生姓名'">
|
||||
<span>{{ scoreForm.registrationType === '2' ? scoreForm.teamName : scoreForm.studentName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动名称">
|
||||
<span>{{ scoreForm.activityName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="成绩" prop="score">
|
||||
<el-input v-model="scoreForm.score" placeholder="请输入成绩" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitScore">确 定</el-button>
|
||||
<el-button @click="scoreOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ActivityRegister">
|
||||
import { getCurrentInstance, ref, reactive, toRefs, onMounted } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import {
|
||||
listActivityRegister,
|
||||
approveActivityRegister,
|
||||
batchApproveActivityRegister,
|
||||
exportActivityRegister,
|
||||
recordActivityScore
|
||||
} from '@/api/stgl/activityregister';
|
||||
import { Check, Close } from '@element-plus/icons-vue';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_registration_type, stgl_approval_status } = toRefs<any>(proxy?.useDict('stgl_registration_type', 'stgl_approval_status'));
|
||||
|
||||
// 表单引用
|
||||
const queryFormRef = ref();
|
||||
const approvalRef = ref();
|
||||
const scoreRef = ref();
|
||||
|
||||
const registerList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const viewOpen = ref(false);
|
||||
const scoreOpen = ref(false);
|
||||
const viewForm = reactive({
|
||||
activityName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
registrationType: undefined,
|
||||
teamName: '',
|
||||
approvalStatus: undefined,
|
||||
registrationTime: '',
|
||||
approvalTime: '',
|
||||
remark: '',
|
||||
approvalRemark: '',
|
||||
score: '',
|
||||
scoreTime: ''
|
||||
});
|
||||
const approvalOpen = ref(false);
|
||||
const approvalTitle = ref('');
|
||||
const approvalForm = reactive({
|
||||
id: undefined,
|
||||
approvalStatus: undefined,
|
||||
approvalRemark: ''
|
||||
});
|
||||
const scoreForm = reactive({
|
||||
id: undefined,
|
||||
studentName: '',
|
||||
activityName: '',
|
||||
score: '',
|
||||
registrationType: '',
|
||||
teamName: ''
|
||||
});
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
activityName: null,
|
||||
studentName: null,
|
||||
studentNo: null,
|
||||
registrationType: null,
|
||||
approvalStatus: null
|
||||
},
|
||||
approvalRules: {
|
||||
approvalRemark: [{ required: true, message: '请输入审核意见', trigger: 'blur' }],
|
||||
approvalStatus: [{ required: true, message: '请选择审核结果', trigger: 'change' }]
|
||||
},
|
||||
scoreRules: {
|
||||
score: [{ required: true, message: '请输入成绩', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, approvalRules, scoreRules } = toRefs(data);
|
||||
|
||||
/** 查询活动报名管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listActivityRegister(queryParams.value).then((response) => {
|
||||
registerList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
function handleView(row) {
|
||||
Object.assign(viewForm, row);
|
||||
viewOpen.value = true;
|
||||
}
|
||||
|
||||
/** 审核按钮操作 */
|
||||
function handleApprove(row) {
|
||||
approvalForm.id = row.id;
|
||||
approvalForm.approvalStatus = undefined;
|
||||
approvalForm.approvalRemark = '';
|
||||
approvalTitle.value = '审核';
|
||||
approvalOpen.value = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 批量审核操作 */
|
||||
function handleBatchApprove() {
|
||||
if (ids.value.length === 0) {
|
||||
proxy.$modal.msgError('请选择要审核的数据');
|
||||
return;
|
||||
}
|
||||
|
||||
approvalForm.id = undefined; // 标识为批量审核
|
||||
approvalForm.approvalStatus = undefined;
|
||||
approvalForm.approvalRemark = '';
|
||||
approvalTitle.value = '批量审核';
|
||||
approvalOpen.value = true;
|
||||
}
|
||||
|
||||
/** 提交审核 */
|
||||
function submitApproval() {
|
||||
// 所有审核都需要验证审核状态和审核意见
|
||||
const validateFields = ['approvalStatus', 'approvalRemark'];
|
||||
|
||||
approvalRef.value.validateField(validateFields, (valid) => {
|
||||
if (valid) {
|
||||
if (approvalForm.id) {
|
||||
// 单个审核(包括重新审核)
|
||||
approveActivityRegister(approvalForm.id, approvalForm.approvalStatus, approvalForm.approvalRemark)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
// 批量审核
|
||||
batchApproveActivityRegister(ids.value, approvalForm.approvalStatus, approvalForm.approvalRemark)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('批量审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportActivityRegister(queryParams.value);
|
||||
proxy?.$download.excel(res, '活动报名信息.xlsx');
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
proxy?.$modal.msgError('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 录入成绩按钮操作 */
|
||||
function handleRecordScore(row) {
|
||||
scoreForm.id = row.id;
|
||||
scoreForm.studentName = row.studentName;
|
||||
scoreForm.activityName = row.activityName;
|
||||
scoreForm.score = row.score || '';
|
||||
scoreForm.registrationType = row.registrationType;
|
||||
scoreForm.teamName = row.teamName || '';
|
||||
scoreOpen.value = true;
|
||||
}
|
||||
|
||||
/** 提交成绩录入 */
|
||||
function submitScore() {
|
||||
scoreRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
recordActivityScore(scoreForm.id, scoreForm.score)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('成绩录入成功');
|
||||
scoreOpen.value = false;
|
||||
getList();
|
||||
})
|
||||
.catch(() => {
|
||||
proxy.$modal.msgError('成绩录入失败');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 样式可以参考志愿者成员管理的样式 */
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,907 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div class="search" v-show="showSearch">
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="社团名称" prop="clubName">
|
||||
<el-input v-model="queryParams.clubName" placeholder="请输入社团名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色类型" prop="roleType">
|
||||
<el-select v-model="queryParams.roleType" placeholder="请选择角色类型" clearable style="width: 200px">
|
||||
<el-option v-for="dict in stgl_role_type" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in stgl_member_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:clubmember:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:clubmember:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:clubmember:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-dropdown class="mt-[1px]">
|
||||
<el-button>
|
||||
更多
|
||||
<el-icon class="el-icon--right"><ArrowDown /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
|
||||
<el-dropdown-item icon="Top" @click="handleImport" v-hasPermi="['stgl:clubmember:import']">导入数据</el-dropdown-item>
|
||||
<el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['stgl:clubmember:export']">导出数据</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="memberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="55" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="社团名称" align="center" prop="clubName" width="120" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
|
||||
<el-table-column label="姓名" align="center" prop="studentName" width="80" />
|
||||
<el-table-column label="性别" align="center" prop="gender" width="60">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_user_sex" :value="scope.row.gender" v-if="scope.row.gender" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" align="center" prop="phone" width="120" />
|
||||
<el-table-column label="院系" align="center" prop="department" width="120" />
|
||||
<el-table-column label="专业" align="center" prop="major" width="180" />
|
||||
<el-table-column label="班级" align="center" prop="className" width="120" />
|
||||
<el-table-column label="角色类型" align="center" prop="roleType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_role_type" :value="scope.row.roleType" v-if="scope.row.roleType" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加入时间" align="center" prop="joinTime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.joinTime ? parseTime(scope.row.joinTime, '{y}-{m}-{d}') : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_member_status" :value="scope.row.status" v-if="scope.row.status !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['stgl:clubmember:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stgl:clubmember:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="审核" placement="top" v-if="scope.row.status === 0">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleApprove(scope.row)"
|
||||
v-hasPermi="['stgl:clubmember:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stgl:clubmember:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改社团成员对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body>
|
||||
<el-form ref="memberFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="社团" prop="relationId">
|
||||
<el-select v-model="form.relationId" placeholder="请选择社团" style="width: 100%" @change="handleClubChange">
|
||||
<el-option v-for="club in clubOptions" :key="club.id" :label="club.clubName" :value="club.id"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="selectedStudent">
|
||||
<StudentSelector v-model="form.selectedStudent" placeholder="请选择学生" :showStudentNo="false" @change="handleStudentChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="学号" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="form.gender" placeholder="性别" disabled>
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="form.department" placeholder="院系" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="form.major" placeholder="专业" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="form.className" placeholder="班级" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="联系方式" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色类型" prop="roleType">
|
||||
<el-select v-model="form.roleType" placeholder="请选择角色类型">
|
||||
<el-option v-for="dict in stgl_role_type" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加入时间" prop="joinTime">
|
||||
<el-date-picker clearable v-model="form.joinTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择加入时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看社团成员详情对话框 -->
|
||||
<el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="800px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="社团名称">{{ viewForm.clubName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ viewForm.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ viewForm.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<dict-tag :options="sys_user_sex" :value="viewForm.gender" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="院系">{{ viewForm.department }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ viewForm.major }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ viewForm.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">{{ viewForm.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ viewForm.email }}</el-descriptions-item>
|
||||
<el-descriptions-item label="角色类型">
|
||||
<dict-tag :options="stgl_role_type" :value="viewForm.roleType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="加入时间">{{ parseTime(viewForm.joinTime, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="stgl_member_status" :value="viewForm.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ parseTime(viewForm.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-divider content-position="left">备注信息</el-divider>
|
||||
<div class="view-description">
|
||||
{{ viewForm.remark || '暂无备注' }}
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelView">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 社团成员导入对话框 -->
|
||||
<el-dialog v-model="upload.open" :title="upload.title" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="getImportUrl()"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:on-error="handleFileError"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<i-ep-upload-filled />
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="text-center el-upload__tip">
|
||||
<div class="el-upload__tip" style="color: red">仅支持新增成员数据,不更新已存在的成员</div>
|
||||
<div class="el-upload__tip" style="color: #409eff; margin-top: 5px">
|
||||
<el-icon style="margin-right: 4px"><InfoFilled /></el-icon>
|
||||
请按照模板格式填写:社团名称、学号、姓名、加入时间
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="StglMember" lang="ts">
|
||||
import { listStglMember, getStglMember, delStglMember, addStglMember, updateStglMember, approveMember } from '@/api/stgl/member';
|
||||
import { listStglClub } from '@/api/stgl/club';
|
||||
import { getUser } from '@/api/system/user';
|
||||
import { StglMemberVO, StglMemberQuery, StglMemberForm } from '@/api/stgl/member/types';
|
||||
import { StudentVO } from '@/api/xg/student/types';
|
||||
import StudentSelector from '@/components/StudentSelector/index.vue';
|
||||
import request from '@/utils/request';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { globalHeaders } from '@/utils/request';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_role_type, stgl_member_status, sys_user_sex } = toRefs<any>(proxy?.useDict('stgl_role_type', 'stgl_member_status', 'sys_user_sex'));
|
||||
|
||||
const memberList = ref<StglMemberVO[]>([]);
|
||||
const clubOptions = ref<any[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const memberFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const viewDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const viewForm = reactive<StglMemberVO>({
|
||||
id: undefined,
|
||||
memberType: 1,
|
||||
relationId: undefined,
|
||||
clubName: '',
|
||||
userId: undefined,
|
||||
studentNo: '',
|
||||
studentName: '',
|
||||
gender: '',
|
||||
department: '',
|
||||
major: '',
|
||||
className: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
roleType: 1,
|
||||
roleName: '',
|
||||
joinTime: '',
|
||||
status: '0',
|
||||
remark: '',
|
||||
createTime: ''
|
||||
});
|
||||
|
||||
const initFormData: StglMemberForm = {
|
||||
id: undefined,
|
||||
memberType: 1, // 社团成员
|
||||
relationId: undefined,
|
||||
userId: undefined,
|
||||
selectedStudent: null, // 新增:选择的学生对象
|
||||
studentNo: undefined,
|
||||
studentName: undefined,
|
||||
gender: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
roleType: 4,
|
||||
roleName: undefined,
|
||||
joinTime: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
|
||||
const data = reactive<PageData<StglMemberForm, StglMemberQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
memberType: 1, // 固定为社团成员类型
|
||||
relationId: undefined,
|
||||
clubName: undefined,
|
||||
studentNo: undefined,
|
||||
studentName: undefined,
|
||||
roleType: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
relationId: [{ required: true, message: '社团不能为空', trigger: 'change' }],
|
||||
selectedStudent: [{ required: true, message: '请选择学生', trigger: 'change' }],
|
||||
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
gender: [{ required: true, message: '性别不能为空', trigger: 'change' }],
|
||||
department: [{ required: true, message: '院系不能为空', trigger: 'blur' }],
|
||||
major: [{ required: true, message: '专业不能为空', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '班级不能为空', trigger: 'blur' }],
|
||||
phone: [{ required: true, message: '联系方式不能为空', trigger: 'blur' }],
|
||||
roleType: [{ required: true, message: '角色类型不能为空', trigger: 'change' }],
|
||||
joinTime: [{ required: true, message: '加入时间不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 获取社团选项 */
|
||||
const getClubOptions = async () => {
|
||||
try {
|
||||
const res = await listStglClub({ pageNum: 1, pageSize: 1000, status: '0' });
|
||||
clubOptions.value = res.rows || [];
|
||||
} catch (error) {
|
||||
console.error('获取社团选项失败:', error);
|
||||
clubOptions.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
/** 社团选择变化 */
|
||||
const handleClubChange = (relationId: string | number) => {
|
||||
// 清空关联字段
|
||||
form.value.selectedStudent = null;
|
||||
form.value.userId = undefined;
|
||||
form.value.studentNo = undefined;
|
||||
form.value.studentName = undefined;
|
||||
form.value.gender = undefined;
|
||||
form.value.department = undefined;
|
||||
form.value.major = undefined;
|
||||
form.value.className = undefined;
|
||||
form.value.phone = undefined;
|
||||
form.value.email = undefined;
|
||||
};
|
||||
|
||||
/** 学生选择变化处理 */
|
||||
const handleStudentChange = async (student: StudentVO | null) => {
|
||||
if (student) {
|
||||
// 自动填充学生信息
|
||||
form.value.userId = student.id; // 将学生ID映射到userId字段
|
||||
form.value.studentName = student.name;
|
||||
form.value.studentNo = student.studentNo;
|
||||
form.value.gender = student.gender;
|
||||
form.value.department = student.collegeName;
|
||||
form.value.major = student.majorName;
|
||||
form.value.className = student.className;
|
||||
form.value.phone = student.phone;
|
||||
|
||||
// 通过用户ID获取邮箱信息(学生ID就是用户ID)
|
||||
try {
|
||||
const userRes = await getUser(student.id);
|
||||
if (userRes.data && userRes.data.user) {
|
||||
form.value.email = userRes.data.user.email || '';
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('获取用户邮箱失败:', error);
|
||||
form.value.email = '';
|
||||
}
|
||||
} else {
|
||||
// 清空相关字段
|
||||
form.value.userId = undefined;
|
||||
form.value.studentName = undefined;
|
||||
form.value.studentNo = undefined;
|
||||
form.value.gender = undefined;
|
||||
form.value.department = undefined;
|
||||
form.value.major = undefined;
|
||||
form.value.className = undefined;
|
||||
form.value.phone = undefined;
|
||||
form.value.email = undefined;
|
||||
}
|
||||
|
||||
// 手动触发相关字段的验证,确保表单验证状态正确更新
|
||||
nextTick(() => {
|
||||
memberFormRef.value?.validateField(['selectedStudent', 'studentNo']);
|
||||
});
|
||||
};
|
||||
|
||||
/** 查询社团成员列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listStglMember(queryParams.value);
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
memberFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
// 重置查询参数,但保留memberType=1的设置
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
memberType: 1, // 固定为社团成员类型
|
||||
relationId: undefined,
|
||||
clubName: undefined,
|
||||
studentNo: undefined,
|
||||
studentName: undefined,
|
||||
roleType: undefined,
|
||||
params: {}
|
||||
};
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: StglMemberVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
// 设置默认加入时间为当前时间
|
||||
form.value.joinTime = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}');
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加社团成员';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: StglMemberVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getStglMember(_id);
|
||||
|
||||
// 添加调试信息
|
||||
console.log('获取的数据:', res.data);
|
||||
console.log('字典数据:', stgl_member_status.value);
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
// 构造学生选择器需要的StudentVO对象
|
||||
if (res.data) {
|
||||
form.value.selectedStudent = {
|
||||
id: res.data.userId,
|
||||
studentNo: res.data.studentNo,
|
||||
name: res.data.studentName,
|
||||
gender: res.data.gender,
|
||||
phone: res.data.phone,
|
||||
collegeId: '', // 这些ID字段可能需要从其他接口获取,暂时留空
|
||||
collegeName: res.data.department,
|
||||
majorId: '',
|
||||
majorName: res.data.major,
|
||||
classId: '',
|
||||
className: res.data.className,
|
||||
grade: '', // 年级信息,暂时留空
|
||||
studentStatus: '', // 学籍状态,暂时留空
|
||||
enrollmentYear: new Date().getFullYear() // 入学年份,暂时使用当前年份
|
||||
};
|
||||
}
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改社团成员';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
memberFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateStglMember(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addStglMember(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 审核按钮操作 */
|
||||
const handleApprove = async (row: StglMemberVO) => {
|
||||
const result = await proxy?.$modal
|
||||
.confirm(`是否通过成员"${row.studentName}(${row.studentNo})"的申请?`, '审核确认', {
|
||||
confirmButtonText: '通过',
|
||||
cancelButtonText: '拒绝',
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
.catch((action: string) => {
|
||||
return action; // 返回 'cancel' 或 'close'
|
||||
});
|
||||
|
||||
let approved: boolean;
|
||||
if (result === 'confirm') {
|
||||
approved = true;
|
||||
} else if (result === 'cancel') {
|
||||
approved = false;
|
||||
} else {
|
||||
return; // 用户点击了关闭按钮
|
||||
}
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
await approveMember(row.id, approved);
|
||||
proxy?.$modal.msgSuccess(approved ? '审核通过' : '审核拒绝');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('审核失败:', error);
|
||||
proxy?.$modal.msgError('审核失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: StglMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
let confirmMessage = '';
|
||||
|
||||
if (row) {
|
||||
confirmMessage = `是否确认删除成员"${row.studentName}(${row.studentNo})"的数据项?`;
|
||||
} else {
|
||||
const selectedItems = memberList.value.filter((item) => ids.value.includes(item.id));
|
||||
if (selectedItems.length === 1) {
|
||||
confirmMessage = `是否确认删除成员"${selectedItems[0].studentName}(${selectedItems[0].studentNo})"的数据项?`;
|
||||
} else {
|
||||
const names = selectedItems.map((item) => `${item.studentName}(${item.studentNo})`).join('、');
|
||||
confirmMessage = `是否确认删除成员"${names}"的数据项?`;
|
||||
}
|
||||
}
|
||||
|
||||
await proxy?.$modal.confirm(confirmMessage).finally(() => (loading.value = false));
|
||||
await delStglMember(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'stgl/member/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`社团成员信息_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = async (row: StglMemberVO) => {
|
||||
Object.assign(viewForm, row);
|
||||
viewDialog.visible = true;
|
||||
viewDialog.title = '查看社团成员信息';
|
||||
};
|
||||
|
||||
/** 取消查看对话框 */
|
||||
const cancelView = () => {
|
||||
viewDialog.visible = false;
|
||||
};
|
||||
|
||||
/********** 导入功能相关 **********/
|
||||
const uploadRef = ref<ElUploadInstance>();
|
||||
|
||||
// 导入参数
|
||||
const upload = reactive<{
|
||||
open: boolean;
|
||||
title: string;
|
||||
isUploading: boolean;
|
||||
url: string;
|
||||
headers: { Authorization: string };
|
||||
}>({
|
||||
open: false,
|
||||
title: '',
|
||||
isUploading: false,
|
||||
url: import.meta.env.VITE_APP_BASE_API + '/stgl/member/importData',
|
||||
headers: globalHeaders()
|
||||
});
|
||||
|
||||
/** 导入按钮操作 */
|
||||
const handleImport = () => {
|
||||
upload.title = '社团成员导入';
|
||||
upload.open = true;
|
||||
};
|
||||
|
||||
/** 下载模板操作 */
|
||||
const importTemplate = () => {
|
||||
proxy?.download('stgl/member/importTemplate', {}, `社团成员导入模板_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
/** 文件上传中处理 */
|
||||
const handleFileUploadProgress = () => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response: any) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value?.clearFiles();
|
||||
|
||||
// 关闭所有loading消息
|
||||
ElMessage.closeAll();
|
||||
|
||||
ElMessageBox.alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 文件上传失败处理 */
|
||||
const handleFileError = (error: any) => {
|
||||
upload.isUploading = false;
|
||||
uploadRef.value?.clearFiles();
|
||||
|
||||
// 关闭所有loading消息
|
||||
ElMessage.closeAll();
|
||||
|
||||
console.error('文件上传失败:', error);
|
||||
ElMessage.error('导入失败,请检查文件格式或网络连接');
|
||||
};
|
||||
|
||||
/** 获取导入URL */
|
||||
const getImportUrl = () => {
|
||||
const baseUrl = upload.url;
|
||||
const params = new URLSearchParams();
|
||||
params.append('updateSupport', 'false');
|
||||
|
||||
return `${baseUrl}?${params.toString()}`;
|
||||
};
|
||||
|
||||
/** 提交上传文件 */
|
||||
const submitFileForm = () => {
|
||||
// 显示导入loading效果
|
||||
ElMessage({
|
||||
message: '正在导入数据,请耐心等待...',
|
||||
type: 'info',
|
||||
duration: 0,
|
||||
zIndex: 4000
|
||||
});
|
||||
|
||||
// 设置上传中状态
|
||||
upload.isUploading = true;
|
||||
|
||||
// 提交文件上传
|
||||
uploadRef.value?.submit();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getClubOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.stats-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
height: 90px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 12px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-value {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 13px;
|
||||
opacity: 0.7;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-success {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-warning {
|
||||
background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
/* 查看对话框样式 */
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
min-height: 60px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,524 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="queryParams.activityName" placeholder="请输入活动名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select
|
||||
v-model="queryParams.activityType"
|
||||
placeholder="请选择活动类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="dict in stgl_activity_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否评分" prop="isRated">
|
||||
<el-select
|
||||
v-model="queryParams.isRated"
|
||||
placeholder="请选择是否评分"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="已评分" value="1" />
|
||||
<el-option label="未评分" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-icon class="mr-2"><Calendar /></el-icon>
|
||||
<span class="card-title">我的活动</span>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="activityList" @row-dblclick="handleView">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="活动名称" align="center" prop="activityName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="活动类型" align="center" prop="activityType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_activity_type" :value="scope.row.activityType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主办方" align="center" prop="organizerName" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="关联组织" align="center" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.organizationName">{{ scope.row.organizationName }}</span>
|
||||
<span v-else class="text-gray-400">未关联</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动时间" align="center" width="160">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.startTime && scope.row.endTime">
|
||||
<div>{{ formatDate(scope.row.startTime) }}</div>
|
||||
<div class="text-sm text-gray-500">{{ formatDate(scope.row.endTime) }}</div>
|
||||
</div>
|
||||
<span v-else class="text-gray-400">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动地点" align="center" prop="location" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="活动状态" align="center" prop="activityStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_activity_status" :value="scope.row.activityStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名时间" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.myRegistrationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="我的评分" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.myRatingStatus === 1" class="rating-cell">
|
||||
<el-rate :model-value="scope.row.myRatingScore" disabled size="small" />
|
||||
<span class="rating-text">{{ scope.row.myRatingScore }}</span>
|
||||
</div>
|
||||
<el-tag v-else type="info" size="small">未评分</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平均评分" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.averageRating" class="rating-cell">
|
||||
<el-rate :model-value="scope.row.averageRating" disabled size="small" />
|
||||
<span class="rating-text">{{ scope.row.averageRating?.toFixed(1) }}</span>
|
||||
</div>
|
||||
<span v-else class="text-gray-400">暂无评分</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="活动评分" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="Star"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
:disabled="!scope.row.canRate"
|
||||
@click="handleRate(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 查看活动详情对话框 -->
|
||||
<el-dialog title="活动详情" v-model="detailOpen" width="1000px" append-to-body>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="活动名称">{{ detailForm.activityName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动类型">
|
||||
<dict-tag :options="stgl_activity_type" :value="detailForm.activityType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动主题">{{ detailForm.activityTheme || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主办方">{{ detailForm.organizerName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关联组织">
|
||||
<span v-if="detailForm.organizationName">
|
||||
{{ detailForm.organizationName }}
|
||||
<el-tag size="small" type="info" class="ml-1">
|
||||
{{ detailForm.relatedType === 1 ? '社团' : detailForm.relatedType === 2 ? '志愿团队' : '未知' }}
|
||||
</el-tag>
|
||||
</span>
|
||||
<span v-else>未关联</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动地点">{{ detailForm.location || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{ parseTime(detailForm.startTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{ parseTime(detailForm.endTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动状态">
|
||||
<dict-tag :options="stgl_activity_status" :value="detailForm.activityStatus" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报名状态">
|
||||
<dict-tag :options="stgl_registration_status" :value="detailForm.registrationStatus" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="我的报名信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="报名时间">{{ parseTime(detailForm.myRegistrationTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报名状态">
|
||||
<dict-tag :options="stgl_my_registration_status" :value="detailForm.myRegistrationStatus" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="评分状态">
|
||||
<el-tag v-if="detailForm.myRatingStatus === 1" type="success">已评分</el-tag>
|
||||
<el-tag v-else type="info">未评分</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="我的评分" v-if="detailForm.myRatingStatus === 1">
|
||||
<div class="rating-cell">
|
||||
<el-rate :model-value="detailForm.myRatingScore" disabled size="small" />
|
||||
<span class="rating-text">{{ detailForm.myRatingScore }}</span>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="评分时间" v-if="detailForm.myRatingTime">{{ parseTime(detailForm.myRatingTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动平均评分" v-if="detailForm.averageRating">
|
||||
<div class="rating-cell">
|
||||
<el-rate :model-value="detailForm.averageRating" disabled size="small" />
|
||||
<span class="rating-text">{{ detailForm.averageRating?.toFixed(1) }}</span>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="活动海报" v-if="detailForm.posterUrl">
|
||||
<div class="view-poster">
|
||||
<image-preview :src="detailForm.posterUrl" :width="300" :height="400" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="活动简介">
|
||||
<div class="view-description">
|
||||
{{ detailForm.description || '暂无简介' }}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 活动评分对话框 -->
|
||||
<el-dialog title="活动评分" v-model="ratingOpen" width="600px" append-to-body>
|
||||
<el-form ref="ratingFormRef" :model="ratingForm" :rules="ratingRules" label-width="120px">
|
||||
<el-form-item label="活动名称">
|
||||
<el-input v-model="ratingForm.activityName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名">
|
||||
<el-input v-model="ratingForm.studentName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号">
|
||||
<el-input v-model="ratingForm.studentNo" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容评分" prop="contentScore">
|
||||
<el-rate v-model="ratingForm.contentScore" :max="5" size="large" show-text :texts="ratingTexts" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组织评分" prop="organizationScore">
|
||||
<el-rate v-model="ratingForm.organizationScore" :max="5" size="large" show-text :texts="ratingTexts" />
|
||||
</el-form-item>
|
||||
<el-form-item label="体验评分" prop="experienceScore">
|
||||
<el-rate v-model="ratingForm.experienceScore" :max="5" size="large" show-text :texts="ratingTexts" />
|
||||
</el-form-item>
|
||||
<el-form-item label="综合得分">
|
||||
<el-input :value="averageScore" readonly>
|
||||
<template #append>分</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="评价意见">
|
||||
<el-input
|
||||
v-model="ratingForm.ratingComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入您对本次活动的评价意见(选填)"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="ratingOpen = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitRating" :loading="ratingLoading">确认评分</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyActivity" lang="ts">
|
||||
import { getMyActivities, rateActivity } from '@/api/stgl/my';
|
||||
import type { MyActivityVO, ActivityRatingForm, MyActivityQuery } from '@/api/stgl/my/types';
|
||||
import { Calendar } from '@element-plus/icons-vue';
|
||||
import { getInfo } from '@/api/login'; // 添加获取用户详细信息的API
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_activity_type, stgl_activity_status, stgl_registration_status, stgl_my_registration_status } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_activity_status', 'stgl_registration_status', 'stgl_my_registration_status')
|
||||
);
|
||||
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
const queryParams = ref<MyActivityQuery>({
|
||||
activityName: '',
|
||||
activityType: '',
|
||||
isRated: ''
|
||||
});
|
||||
const activityList = ref<MyActivityVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const detailOpen = ref(false);
|
||||
const detailForm = ref<MyActivityVO>({} as MyActivityVO);
|
||||
const ratingOpen = ref(false);
|
||||
const ratingLoading = ref(false);
|
||||
const ratingFormRef = ref<ElFormInstance>();
|
||||
|
||||
const ratingForm = ref<ActivityRatingForm & { activityName?: string; studentName?: string; studentNo?: string }>({
|
||||
activityId: '',
|
||||
contentScore: 0,
|
||||
organizationScore: 0,
|
||||
experienceScore: 0,
|
||||
ratingComment: ''
|
||||
});
|
||||
|
||||
const ratingRules = reactive({
|
||||
contentScore: [{ required: true, message: '请选择内容评分', trigger: 'change' }],
|
||||
organizationScore: [{ required: true, message: '请选择组织评分', trigger: 'change' }],
|
||||
experienceScore: [{ required: true, message: '请选择体验评分', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 评分文本配置
|
||||
const ratingTexts = ref(['非常差', '较差', '一般', '满意', '非常满意']);
|
||||
|
||||
/** 获取当前用户详细信息 */
|
||||
const getCurrentUserDetailInfo = async () => {
|
||||
try {
|
||||
const res = await getInfo();
|
||||
console.log('用户详细信息:', res.data);
|
||||
return res.data.user;
|
||||
} catch (error) {
|
||||
console.error('获取用户详细信息失败:', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
/** 计算综合得分 */
|
||||
const averageScore = computed(() => {
|
||||
const { contentScore, organizationScore, experienceScore } = ratingForm.value;
|
||||
if (contentScore && organizationScore && experienceScore) {
|
||||
return ((contentScore + organizationScore + experienceScore) / 3).toFixed(1);
|
||||
}
|
||||
return '0.0';
|
||||
});
|
||||
|
||||
/** 查询我的活动列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 过滤空值参数
|
||||
const params = Object.fromEntries(
|
||||
Object.entries(queryParams.value).filter(([_, value]) => value !== '' && value !== undefined && value !== null)
|
||||
);
|
||||
const res = await getMyActivities(params);
|
||||
activityList.value = res.data;
|
||||
} catch (error) {
|
||||
console.error('查询我的活动列表失败:', error);
|
||||
proxy?.$modal.msgError('查询我的活动列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
const handleView = (row: MyActivityVO) => {
|
||||
detailForm.value = { ...row };
|
||||
detailOpen.value = true;
|
||||
};
|
||||
|
||||
/** 活动评分按钮操作 */
|
||||
const handleRate = async (row: MyActivityVO) => {
|
||||
try {
|
||||
// 获取当前用户详细信息
|
||||
const userInfo = await getCurrentUserDetailInfo();
|
||||
|
||||
ratingForm.value = {
|
||||
activityId: row.id,
|
||||
activityName: row.activityName,
|
||||
studentName: userInfo?.nickName || userInfo?.userName || '',
|
||||
studentNo: userInfo?.userName || '',
|
||||
contentScore: 0,
|
||||
organizationScore: 0,
|
||||
experienceScore: 0,
|
||||
ratingComment: ''
|
||||
};
|
||||
|
||||
console.log('评分表单数据:', ratingForm.value);
|
||||
ratingOpen.value = true;
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error);
|
||||
proxy?.$modal.msgError('获取用户信息失败,请稍后重试');
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交评分 */
|
||||
const submitRating = async () => {
|
||||
if (!ratingFormRef.value) return;
|
||||
|
||||
await ratingFormRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
ratingLoading.value = true;
|
||||
try {
|
||||
const { activityName, studentName, studentNo, ...submitData } = ratingForm.value;
|
||||
await rateActivity(ratingForm.value.activityId, submitData);
|
||||
proxy?.$modal.msgSuccess('评分成功');
|
||||
ratingOpen.value = false;
|
||||
await getList(); // 刷新列表
|
||||
} catch (error) {
|
||||
console.error('评分失败:', error);
|
||||
proxy?.$modal.msgError('评分失败,请稍后重试');
|
||||
} finally {
|
||||
ratingLoading.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 格式化日期 */
|
||||
const formatDate = (dateStr: string): string => {
|
||||
if (!dateStr) return '';
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 评分单元格样式 */
|
||||
.rating-cell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.rating-text {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格固定列优化 */
|
||||
:deep(.el-table) {
|
||||
.el-table__fixed-right {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.el-table__fixed-right-patch {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
/* 查看对话框样式 */
|
||||
.view-poster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
min-height: 80px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="社团名称" prop="clubName">
|
||||
<el-input v-model="queryParams.clubName" placeholder="请输入社团名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="社团类型" prop="clubType">
|
||||
<el-select
|
||||
v-model="queryParams.clubType"
|
||||
placeholder="请选择社团类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in stgl_club_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-icon class="mr-2"><UserFilled /></el-icon>
|
||||
<span class="card-title">我的社团</span>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="clubList" @row-dblclick="handleView">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="社团LOGO" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.logoUrl" class="table-image">
|
||||
<image-preview :src="scope.row.logoUrl" :width="50" :height="50" />
|
||||
</div>
|
||||
<div v-else class="table-no-image">
|
||||
<span class="table-no-image-text">暂无图片</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="社团名称" align="center" prop="clubName" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="社团类型" align="center" prop="clubType" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_club_type" :value="scope.row.clubType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="我的角色" align="center" prop="myRole" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_member_role" :value="scope.row.myRole" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="社长姓名" align="center" prop="presidentName" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="指导老师" align="center" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.advisorName">{{ scope.row.advisorName }}</span>
|
||||
<span v-else class="text-gray-400">暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成员数量" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<span class="member-count">{{ scope.row.memberCount || 0 }}</span>
|
||||
<span v-if="scope.row.memberLimit" class="member-limit">/ {{ scope.row.memberLimit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加入时间" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.joinTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 查看社团详情对话框 -->
|
||||
<el-dialog title="社团详情" v-model="detailOpen" width="800px" append-to-body>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="社团名称">{{ detailForm.clubName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="社团类型">
|
||||
<dict-tag :options="stgl_club_type" :value="detailForm.clubType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="成立日期">{{ parseTime(detailForm.establishDate, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成员数量">
|
||||
<span class="member-count">{{ detailForm.memberCount || 0 }}</span>
|
||||
<span v-if="detailForm.memberLimit" class="member-limit">/ {{ detailForm.memberLimit }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="sys_normal_disable" :value="detailForm.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="我的角色">
|
||||
<dict-tag :options="stgl_member_role" :value="detailForm.myRole" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="加入时间">{{ parseTime(detailForm.joinTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成员状态">
|
||||
<dict-tag :options="stgl_member_status" :value="detailForm.memberStatus" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="人员信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="社长姓名">{{ detailForm.presidentName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="社长院系">{{ detailForm.presidentDept || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师">{{ detailForm.advisorName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师部门">{{ detailForm.advisorDept || '暂无' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="社团LOGO" v-if="detailForm.logoUrl">
|
||||
<div class="view-logo">
|
||||
<image-preview :src="detailForm.logoUrl" :width="200" :height="200" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="社团简介">
|
||||
<div class="view-description">
|
||||
{{ detailForm.description || '暂无简介' }}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyClub" lang="ts">
|
||||
import { getMyClubs } from '@/api/stgl/my';
|
||||
import type { MyClubVO, MyClubQuery } from '@/api/stgl/my/types';
|
||||
import { UserFilled } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_club_type, sys_normal_disable, stgl_member_role, stgl_member_status } = toRefs<any>(
|
||||
proxy?.useDict('stgl_club_type', 'sys_normal_disable', 'stgl_member_role', 'stgl_member_status')
|
||||
);
|
||||
|
||||
const queryRef = ref();
|
||||
const showSearch = ref(true);
|
||||
const queryParams = ref<MyClubQuery>({
|
||||
clubName: '',
|
||||
clubType: ''
|
||||
});
|
||||
const clubList = ref<MyClubVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const detailOpen = ref(false);
|
||||
const detailForm = ref<MyClubVO>({} as MyClubVO);
|
||||
|
||||
/** 查询我的社团列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 过滤空值参数
|
||||
const params = Object.fromEntries(
|
||||
Object.entries(queryParams.value).filter(([_, value]) => value !== '' && value !== undefined && value !== null)
|
||||
);
|
||||
const res = await getMyClubs(params);
|
||||
clubList.value = res.data;
|
||||
} catch (error) {
|
||||
console.error('查询我的社团列表失败:', error);
|
||||
proxy?.$modal.msgError('查询我的社团列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
const handleView = (row: MyClubVO) => {
|
||||
detailForm.value = { ...row };
|
||||
detailOpen.value = true;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
.table-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.table-no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-no-image-text {
|
||||
color: #909399;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.member-count {
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.member-limit {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 查看对话框样式 */
|
||||
.view-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
min-height: 80px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格固定列优化 */
|
||||
:deep(.el-table) {
|
||||
.el-table__fixed-right {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.el-table__fixed-right-patch {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="报名类型" prop="registrationType">
|
||||
<el-select
|
||||
v-model="queryParams.registrationType"
|
||||
placeholder="请选择报名类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="社团" value="1" />
|
||||
<el-option label="志愿团队" value="2" />
|
||||
<el-option label="活动" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态" prop="approvalStatus">
|
||||
<el-select
|
||||
v-model="queryParams.approvalStatus"
|
||||
placeholder="请选择审核状态"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="待审核" value="待审核" />
|
||||
<el-option label="已通过" value="已通过" />
|
||||
<el-option label="已拒绝" value="已拒绝" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-icon class="mr-2"><Document /></el-icon>
|
||||
<span class="card-title">我的报名记录</span>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="recordList">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="报名类型" align="center" prop="registrationType" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getRegistrationTypeTag(scope.row.registrationType)"
|
||||
size="small"
|
||||
>
|
||||
{{ getRegistrationTypeText(scope.row.registrationType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="targetName" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="类型" align="center" prop="targetType" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="我的角色" align="center" prop="role" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="组织者" align="center" prop="organizer" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="报名时间" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.registrationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" align="center" prop="approvalStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getApprovalStatusTag(scope.row.approvalStatus)"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.approvalStatus }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前状态" align="center" prop="currentStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getCurrentStatusTag(scope.row.currentStatus)"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.currentStatus }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时间信息" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.timeInfo">
|
||||
{{ parseTime(scope.row.timeInfo, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</span>
|
||||
<span v-else class="text-gray-400">暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地点" align="center" prop="location" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.location">{{ scope.row.location }}</span>
|
||||
<span v-else class="text-gray-400">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 查看详情对话框 -->
|
||||
<el-dialog title="报名记录详情" v-model="detailOpen" width="800px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="报名类型">
|
||||
<el-tag
|
||||
:type="getRegistrationTypeTag(detailForm.registrationType)"
|
||||
size="small"
|
||||
>
|
||||
{{ getRegistrationTypeText(detailForm.registrationType) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="名称">{{ detailForm.targetName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="类型">{{ detailForm.targetType || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="我的角色">{{ detailForm.role || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="组织者">{{ detailForm.organizer || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报名时间">{{ parseTime(detailForm.registrationTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
<el-tag
|
||||
:type="getApprovalStatusTag(detailForm.approvalStatus)"
|
||||
size="small"
|
||||
>
|
||||
{{ detailForm.approvalStatus }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前状态">
|
||||
<el-tag
|
||||
:type="getCurrentStatusTag(detailForm.currentStatus)"
|
||||
size="small"
|
||||
>
|
||||
{{ detailForm.currentStatus }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间" v-if="detailForm.approvalTime">
|
||||
{{ parseTime(detailForm.approvalTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核人" v-if="detailForm.approvalBy">{{ detailForm.approvalBy }}</el-descriptions-item>
|
||||
<el-descriptions-item label="时间信息" v-if="detailForm.timeInfo">
|
||||
{{ parseTime(detailForm.timeInfo, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="地点" v-if="detailForm.location">{{ detailForm.location }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注信息" v-if="detailForm.remark" :span="2">
|
||||
<div class="remark-content">{{ detailForm.remark }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyRecord" lang="ts">
|
||||
import { getMyRegistrations } from '@/api/stgl/my';
|
||||
import type { MyRegistrationVO, MyRegistrationQuery } from '@/api/stgl/my/types';
|
||||
import { Document } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const recordList = ref<MyRegistrationVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const detailOpen = ref(false);
|
||||
const detailForm = ref<MyRegistrationVO>({} as MyRegistrationVO);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const queryParams = ref<MyRegistrationQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
registrationType: '',
|
||||
approvalStatus: ''
|
||||
});
|
||||
|
||||
/** 查询我的报名记录列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getMyRegistrations(queryParams.value);
|
||||
recordList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
console.error('查询我的报名记录失败:', error);
|
||||
proxy?.$modal.msgError('查询我的报名记录失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
const handleView = (row: MyRegistrationVO) => {
|
||||
detailForm.value = { ...row };
|
||||
detailOpen.value = true;
|
||||
};
|
||||
|
||||
/** 获取报名类型文本 */
|
||||
const getRegistrationTypeText = (type: string): string => {
|
||||
const typeMap: Record<string, string> = {
|
||||
'1': '社团',
|
||||
'2': '志愿团队',
|
||||
'3': '活动'
|
||||
};
|
||||
return typeMap[type] || '未知';
|
||||
};
|
||||
|
||||
/** 获取报名类型标签样式 */
|
||||
const getRegistrationTypeTag = (type: string) => {
|
||||
const tagMap = {
|
||||
'1': 'primary' as const,
|
||||
'2': 'success' as const,
|
||||
'3': 'warning' as const
|
||||
};
|
||||
return tagMap[type as keyof typeof tagMap] || 'info' as const;
|
||||
};
|
||||
|
||||
/** 获取审核状态标签样式 */
|
||||
const getApprovalStatusTag = (status: string) => {
|
||||
const tagMap = {
|
||||
'已通过': 'success' as const,
|
||||
'已拒绝': 'danger' as const,
|
||||
'待审核': 'warning' as const
|
||||
};
|
||||
return tagMap[status as keyof typeof tagMap] || 'info' as const;
|
||||
};
|
||||
|
||||
/** 获取当前状态标签样式 */
|
||||
const getCurrentStatusTag = (status: string) => {
|
||||
const tagMap = {
|
||||
'正常': 'success' as const,
|
||||
'已报名': 'primary' as const,
|
||||
'待审核': 'warning' as const
|
||||
};
|
||||
return tagMap[status as keyof typeof tagMap] || 'info' as const;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格固定列优化 */
|
||||
:deep(.el-table) {
|
||||
.el-table__fixed-right {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.el-table__fixed-right-patch {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
/* 备注内容样式 */
|
||||
.remark-content {
|
||||
max-height: 100px;
|
||||
overflow-y: auto;
|
||||
padding: 8px;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="队伍名称" prop="teamName">
|
||||
<el-input v-model="queryParams.teamName" placeholder="请输入队伍名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-icon class="mr-2"><User /></el-icon>
|
||||
<span class="card-title">我的志愿团队</span>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="teamList" @row-dblclick="handleView">
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="队伍名称" align="center" prop="teamName" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="我的角色" align="center" prop="myRole" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_volunteer_role" :value="scope.row.myRole" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="队长姓名" align="center" prop="leaderName" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="指导老师" align="center" width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.advisorName">{{ scope.row.advisorName }}</span>
|
||||
<span v-else class="text-gray-400">暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成员数量" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<span class="member-count">{{ scope.row.currentMemberCount || 0 }}</span>
|
||||
<span v-if="scope.row.memberLimit" class="member-limit">/ {{ scope.row.memberLimit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加入时间" align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.joinTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="队伍简介" align="center" prop="description" min-width="200">
|
||||
<template #default="scope">
|
||||
<div class="description-cell">{{ scope.row.description || '暂无简介' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 查看志愿团队详情对话框 -->
|
||||
<el-dialog title="志愿团队详情" v-model="detailOpen" width="800px" append-to-body>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="队伍名称">{{ detailForm.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成立日期">{{ parseTime(detailForm.establishDate, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成员数量">
|
||||
<span class="member-count">{{ detailForm.currentMemberCount || 0 }}</span>
|
||||
<span v-if="detailForm.memberLimit" class="member-limit">/ {{ detailForm.memberLimit }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="sys_normal_disable" :value="detailForm.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="我的角色">
|
||||
<dict-tag :options="stgl_volunteer_role" :value="detailForm.myRole" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="成员状态">
|
||||
<dict-tag :options="stgl_volunteer_status" :value="detailForm.memberStatus" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="加入时间">{{ parseTime(detailForm.joinTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ detailForm.contactPhone || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ detailForm.email || '暂无' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="人员信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="队长姓名">{{ detailForm.leaderName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长院系">{{ detailForm.leaderDept || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师">{{ detailForm.advisorName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师部门">{{ detailForm.advisorDept || '暂无' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="队伍简介">
|
||||
<div class="view-description">
|
||||
{{ detailForm.description || '暂无简介' }}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MyVolunteer" lang="ts">
|
||||
import { getMyVolunteerTeams } from '@/api/stgl/my';
|
||||
import type { MyVolunteerTeamVO, MyVolunteerQuery } from '@/api/stgl/my/types';
|
||||
import { User } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable, stgl_volunteer_role, stgl_volunteer_status } = toRefs<any>(
|
||||
proxy?.useDict('sys_normal_disable', 'stgl_volunteer_role', 'stgl_volunteer_status')
|
||||
);
|
||||
|
||||
const teamList = ref<MyVolunteerTeamVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const detailOpen = ref(false);
|
||||
const detailForm = ref<MyVolunteerTeamVO>({} as MyVolunteerTeamVO);
|
||||
|
||||
const queryParams = ref<MyVolunteerQuery>({
|
||||
teamName: undefined
|
||||
});
|
||||
const queryRef = ref<ElFormInstance>();
|
||||
|
||||
/** 查询我的志愿团队列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 过滤空值参数
|
||||
const params = Object.entries(queryParams.value)
|
||||
.filter(([_, value]) => value !== undefined && value !== null && value !== '')
|
||||
.reduce((acc, [key, value]) => {
|
||||
acc[key as keyof MyVolunteerQuery] = value;
|
||||
return acc;
|
||||
}, {} as MyVolunteerQuery);
|
||||
|
||||
const res = await getMyVolunteerTeams(Object.keys(params).length > 0 ? params : undefined);
|
||||
teamList.value = res.data;
|
||||
} catch (error) {
|
||||
console.error('查询我的志愿团队列表失败:', error);
|
||||
proxy?.$modal.msgError('查询我的志愿团队列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
const handleView = (row: MyVolunteerTeamVO) => {
|
||||
detailForm.value = { ...row };
|
||||
detailOpen.value = true;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.member-count {
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.member-limit {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 队伍简介字段样式 */
|
||||
.description-cell {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.5;
|
||||
max-height: 4.5em;
|
||||
text-align: left;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
/* 查看对话框样式 */
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
min-height: 80px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格固定列优化 */
|
||||
:deep(.el-table) {
|
||||
.el-table__fixed-right {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.el-table__fixed-right-patch {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20" class="mb8">
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card">
|
||||
<div class="statistics-item">
|
||||
<div class="statistics-value">{{ statisticsData.clubCount }}</div>
|
||||
<div class="statistics-label">社团总数</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card">
|
||||
<div class="statistics-item">
|
||||
<div class="statistics-value">{{ statisticsData.volunteerCount }}</div>
|
||||
<div class="statistics-label">志愿者队伍</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card">
|
||||
<div class="statistics-item">
|
||||
<div class="statistics-value">{{ statisticsData.activityCount }}</div>
|
||||
<div class="statistics-label">活动总数</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card">
|
||||
<div class="statistics-item">
|
||||
<div class="statistics-value">{{ statisticsData.memberCount }}</div>
|
||||
<div class="statistics-label">参与人数</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>社团参与度统计</span>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="clubChart" style="height: 300px"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>活动类型分布</span>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="activityChart" style="height: 300px"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" class="mt20">
|
||||
<el-col :span="24">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>月度活动趋势</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="monthrange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始月份"
|
||||
end-placeholder="结束月份"
|
||||
@change="updateTrendChart"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="trendChart" style="height: 400px"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Statistics" lang="ts">
|
||||
import * as echarts from 'echarts';
|
||||
import { getStatisticsData } from '@/api/stgl/statistics';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const statisticsData = ref({
|
||||
clubCount: 0,
|
||||
volunteerCount: 0,
|
||||
activityCount: 0,
|
||||
memberCount: 0
|
||||
});
|
||||
|
||||
const dateRange = ref([]);
|
||||
const clubChart = ref(null);
|
||||
const activityChart = ref(null);
|
||||
const trendChart = ref(null);
|
||||
|
||||
let clubChartInstance = null;
|
||||
let activityChartInstance = null;
|
||||
let trendChartInstance = null;
|
||||
|
||||
/** 获取统计数据 */
|
||||
function getStatistics() {
|
||||
getStatisticsData().then((response) => {
|
||||
statisticsData.value = response.data;
|
||||
initCharts();
|
||||
});
|
||||
}
|
||||
|
||||
/** 初始化图表 */
|
||||
function initCharts() {
|
||||
nextTick(() => {
|
||||
initClubChart();
|
||||
initActivityChart();
|
||||
initTrendChart();
|
||||
});
|
||||
}
|
||||
|
||||
/** 初始化社团参与度图表 */
|
||||
function initClubChart() {
|
||||
if (clubChartInstance) {
|
||||
clubChartInstance.dispose();
|
||||
}
|
||||
clubChartInstance = echarts.init(clubChart.value);
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
text: '社团参与度',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '参与度',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{ value: 35, name: '文艺社团' },
|
||||
{ value: 25, name: '体育社团' },
|
||||
{ value: 20, name: '学术社团' },
|
||||
{ value: 15, name: '公益社团' },
|
||||
{ value: 5, name: '其他社团' }
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
clubChartInstance.setOption(option);
|
||||
}
|
||||
|
||||
/** 初始化活动类型分布图表 */
|
||||
function initActivityChart() {
|
||||
if (activityChartInstance) {
|
||||
activityChartInstance.dispose();
|
||||
}
|
||||
activityChartInstance = echarts.init(activityChart.value);
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
text: '活动类型分布',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['文化活动', '体育活动', '学术讲座', '志愿服务', '社会实践'],
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '活动数量',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: [45, 32, 28, 25, 18],
|
||||
itemStyle: {
|
||||
color: '#409EFF'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
activityChartInstance.setOption(option);
|
||||
}
|
||||
|
||||
/** 初始化趋势图表 */
|
||||
function initTrendChart() {
|
||||
if (trendChartInstance) {
|
||||
trendChartInstance.dispose();
|
||||
}
|
||||
trendChartInstance = echarts.init(trendChart.value);
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
text: '月度活动趋势',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['社团活动', '志愿活动', '校园活动']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
saveAsImage: {}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '社团活动',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: [12, 8, 15, 18, 22, 25, 20, 18, 24, 28, 22, 16]
|
||||
},
|
||||
{
|
||||
name: '志愿活动',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: [8, 6, 10, 12, 15, 18, 16, 14, 18, 20, 16, 12]
|
||||
},
|
||||
{
|
||||
name: '校园活动',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: [5, 4, 8, 10, 12, 15, 12, 10, 14, 16, 12, 8]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
trendChartInstance.setOption(option);
|
||||
}
|
||||
|
||||
/** 更新趋势图表 */
|
||||
function updateTrendChart() {
|
||||
// 根据选择的日期范围更新图表数据
|
||||
initTrendChart();
|
||||
}
|
||||
|
||||
/** 监听窗口大小变化 */
|
||||
function handleResize() {
|
||||
if (clubChartInstance) {
|
||||
clubChartInstance.resize();
|
||||
}
|
||||
if (activityChartInstance) {
|
||||
activityChartInstance.resize();
|
||||
}
|
||||
if (trendChartInstance) {
|
||||
trendChartInstance.resize();
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getStatistics();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
if (clubChartInstance) {
|
||||
clubChartInstance.dispose();
|
||||
}
|
||||
if (activityChartInstance) {
|
||||
activityChartInstance.dispose();
|
||||
}
|
||||
if (trendChartInstance) {
|
||||
trendChartInstance.dispose();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.statistics-card {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.statistics-item {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.statistics-value {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.statistics-label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mt20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,795 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="成员姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入成员姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="队伍名称" prop="teamName">
|
||||
<el-input v-model="queryParams.teamName" placeholder="请输入队伍名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 100%">
|
||||
<el-option v-for="dict in stgl_member_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:volunteerMember:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:volunteerMember:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:volunteerMember:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-dropdown class="mt-[1px]">
|
||||
<el-button>
|
||||
更多
|
||||
<el-icon class="el-icon--right"><ArrowDown /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
|
||||
<el-dropdown-item icon="Top" @click="handleImport" v-hasPermi="['stgl:volunteerMember:import']">导入数据</el-dropdown-item>
|
||||
<el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['stgl:volunteerMember:export']">导出数据</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="memberList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" type="index" width="55" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属队伍" align="center" prop="relationName" width="120" />
|
||||
<el-table-column label="成员姓名" align="center" prop="studentName" width="100" />
|
||||
<el-table-column label="学号" align="center" prop="studentNo" width="120" />
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.gender === '男' ? '男' : scope.row.gender === '女' ? '女' : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系电话" align="center" prop="phone" width="120" />
|
||||
<el-table-column label="院系" align="center" prop="department" width="120" />
|
||||
<el-table-column label="专业" align="center" prop="major" width="180" />
|
||||
<el-table-column label="班级" align="center" prop="className" width="120" />
|
||||
<el-table-column label="成员角色" align="center" prop="roleType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_volunteer_role" :value="scope.row.roleType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="stgl_member_status" :value="scope.row.status" v-if="scope.row.status !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加入时间" align="center" prop="joinTime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.joinTime ? parseTime(scope.row.joinTime, '{y}-{m}-{d}') : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="View"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: blue"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['stgl:volunteerMember:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 待审核状态显示审核按钮 -->
|
||||
<template v-if="scope.row.status === 0">
|
||||
<el-tooltip content="通过" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: green"
|
||||
@click="handleApprove(scope.row, true)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="驳回" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Close"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px; color: red"
|
||||
@click="handleApprove(scope.row, false)"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 非待审核状态显示常规操作按钮 -->
|
||||
<template v-else>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="default"
|
||||
style="font-size: 16px; margin-right: 8px"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stgl:volunteerMember:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="default"
|
||||
style="font-size: 16px"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stgl:volunteerMember:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改志愿者成员对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="memberRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="志愿者队伍" prop="teamId">
|
||||
<el-select v-model="form.teamId" placeholder="请选择志愿者队伍" style="width: 100%" @change="handleTeamChange">
|
||||
<el-option v-for="team in teamOptions" :key="team.id" :label="team.teamName" :value="team.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="selectedStudent">
|
||||
<StudentSelector v-model="form.selectedStudent" placeholder="请选择学生" :showStudentNo="false" @change="handleStudentChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="学号" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="form.gender" placeholder="性别" disabled>
|
||||
<el-option label="男" value="男" />
|
||||
<el-option label="女" value="女" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="form.department" placeholder="院系" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="form.major" placeholder="专业" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="form.className" placeholder="班级" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="联系方式" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成员角色" prop="roleType">
|
||||
<el-select v-model="form.roleType" placeholder="请选择成员角色">
|
||||
<el-option v-for="dict in stgl_volunteer_role" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加入时间" prop="joinTime">
|
||||
<el-date-picker clearable v-model="form.joinTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择加入时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看志愿者成员详情对话框 -->
|
||||
<el-dialog title="志愿者成员详情" v-model="viewOpen" width="600px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="成员姓名">{{ viewForm.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ viewForm.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ viewForm.gender === '男' ? '男' : viewForm.gender === '女' ? '女' : '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ viewForm.phone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="院系">{{ viewForm.department || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ viewForm.major || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ viewForm.className || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属队伍">{{ viewForm.relationName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成员角色">
|
||||
<dict-tag :options="stgl_volunteer_role" :value="viewForm.roleType" v-if="viewForm.roleType !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ viewForm.email || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="stgl_member_status" :value="viewForm.status" v-if="viewForm.status !== undefined" />
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="加入时间" :span="2">{{ parseTime(viewForm.joinTime, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ viewForm.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入数据对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="text-center el-upload__tip">
|
||||
<div class="el-upload__tip" style="color: red">仅支持新增成员数据,不更新已存在的成员</div>
|
||||
<div class="el-upload__tip" style="color: #409eff; margin-top: 5px">
|
||||
<el-icon style="margin-right: 4px"><InfoFilled /></el-icon>
|
||||
请按照模板格式填写:队伍名称、学号、姓名、加入时间
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="VolunteerMember">
|
||||
// 导入必要的Vue组合式API和其他依赖
|
||||
import { getCurrentInstance, ref, reactive, toRefs, onMounted, nextTick, watch } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import {
|
||||
listVolunteerMember,
|
||||
getVolunteerMember,
|
||||
delVolunteerMember,
|
||||
addVolunteerMember,
|
||||
updateVolunteerMember,
|
||||
getVolunteerTeamOptions,
|
||||
approveVolunteerMember
|
||||
} from '@/api/stgl/volunteermember';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { ArrowDown, UploadFilled, InfoFilled, Check, Close } from '@element-plus/icons-vue';
|
||||
import { StudentVO } from '@/api/xg/student/types';
|
||||
import StudentSelector from '@/components/StudentSelector/index.vue';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { getUser } from '@/api/system/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_member_status } = toRefs<any>(proxy?.useDict('stgl_member_status'));
|
||||
|
||||
// 手动定义志愿者角色字典,统一使用:队长=0,队员=1
|
||||
const stgl_volunteer_role = ref([
|
||||
{ value: '0', label: '队长' },
|
||||
{ value: '1', label: '队员' }
|
||||
]);
|
||||
|
||||
// 手动定义成员状态字典,确保与后端一致
|
||||
const stgl_member_status_manual = ref([
|
||||
{ value: '0', label: '待审核' },
|
||||
{ value: '1', label: '审核中' },
|
||||
{ value: '2', label: '已加入' },
|
||||
{ value: '3', label: '已驳回' },
|
||||
{ value: '4', label: '已退出' }
|
||||
]);
|
||||
|
||||
// 字典数据初始化完成
|
||||
console.log('志愿者角色字典数据已手动定义:', stgl_volunteer_role.value);
|
||||
|
||||
// 添加更详细的字典调试
|
||||
watch(
|
||||
stgl_volunteer_role,
|
||||
(newVal) => {
|
||||
console.log('stgl_volunteer_role 字典变化:', newVal);
|
||||
if (newVal && newVal.length > 0) {
|
||||
console.log('字典详细信息:');
|
||||
newVal.forEach((item, index) => {
|
||||
console.log(` [${index}] value: "${item.value}" (${typeof item.value}), label: "${item.label}"`);
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 表单引用
|
||||
const queryFormRef = ref();
|
||||
const memberRef = ref();
|
||||
const uploadRef = ref();
|
||||
|
||||
const memberList = ref([]);
|
||||
const teamOptions = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref('');
|
||||
const viewOpen = ref(false);
|
||||
const viewForm = reactive({});
|
||||
|
||||
// 上传参数
|
||||
const upload = reactive({
|
||||
open: false,
|
||||
title: '',
|
||||
isUploading: false,
|
||||
updateSupport: 0,
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
clientid: import.meta.env.VITE_APP_CLIENT_ID || 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
||||
},
|
||||
url: import.meta.env.VITE_APP_BASE_API + '/stgl/volunteer/member/importData'
|
||||
});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
gender: undefined,
|
||||
phone: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
teamId: undefined,
|
||||
userId: undefined, // 用户ID
|
||||
roleType: '1', // 默认为队员(1)
|
||||
email: undefined,
|
||||
joinTime: undefined, // 加入时间
|
||||
remark: undefined,
|
||||
selectedStudent: null // 新增:选择的学生对象
|
||||
};
|
||||
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentName: null,
|
||||
studentNo: null,
|
||||
teamName: null,
|
||||
status: null
|
||||
},
|
||||
rules: {
|
||||
teamId: [{ required: true, message: '志愿者队伍不能为空', trigger: 'change' }],
|
||||
roleType: [{ required: true, message: '成员角色不能为空', trigger: 'change' }],
|
||||
selectedStudent: [{ required: true, message: '请选择学生', trigger: 'change' }],
|
||||
joinTime: [{ required: true, message: '加入时间不能为空', trigger: 'blur' }],
|
||||
phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
|
||||
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询志愿者成员列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listVolunteerMember(queryParams.value).then((response) => {
|
||||
memberList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取队伍选项 */
|
||||
function getTeamOptions() {
|
||||
getVolunteerTeamOptions()
|
||||
.then((response) => {
|
||||
console.log('志愿者队伍选项API响应:', response);
|
||||
teamOptions.value = response.data;
|
||||
console.log('设置队伍选项数据:', teamOptions.value);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取志愿者队伍选项失败:', error);
|
||||
proxy.$modal.msgError('获取志愿者队伍选项失败: ' + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = { ...initFormData };
|
||||
memberRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 队伍选择变化 */
|
||||
function handleTeamChange(teamId) {
|
||||
// 清空关联字段
|
||||
form.value.selectedStudent = null;
|
||||
form.value.studentName = undefined;
|
||||
form.value.studentNo = undefined;
|
||||
form.value.gender = undefined;
|
||||
form.value.department = undefined;
|
||||
form.value.major = undefined;
|
||||
form.value.className = undefined;
|
||||
form.value.phone = undefined;
|
||||
}
|
||||
|
||||
/** 学生选择变化处理 */
|
||||
async function handleStudentChange(student: StudentVO | null) {
|
||||
if (student) {
|
||||
// 自动填充学生信息
|
||||
form.value.studentName = student.name;
|
||||
form.value.studentNo = student.studentNo;
|
||||
form.value.userId = student.id; // 用户ID(学生ID就是用户ID)
|
||||
form.value.gender = student.gender;
|
||||
form.value.department = student.collegeName;
|
||||
form.value.major = student.majorName;
|
||||
form.value.className = student.className;
|
||||
form.value.phone = student.phone;
|
||||
|
||||
// 通过用户ID获取邮箱信息(学生ID就是用户ID)
|
||||
try {
|
||||
const userRes = await getUser(student.id);
|
||||
if (userRes.data && userRes.data.user) {
|
||||
form.value.email = userRes.data.user.email || '';
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('获取用户邮箱失败:', error);
|
||||
form.value.email = '';
|
||||
}
|
||||
} else {
|
||||
// 清空相关字段
|
||||
form.value.studentName = undefined;
|
||||
form.value.studentNo = undefined;
|
||||
form.value.userId = undefined;
|
||||
form.value.gender = undefined;
|
||||
form.value.department = undefined;
|
||||
form.value.major = undefined;
|
||||
form.value.className = undefined;
|
||||
form.value.phone = undefined;
|
||||
form.value.email = undefined;
|
||||
}
|
||||
|
||||
// 手动触发相关字段的验证,确保表单验证状态正确更新
|
||||
nextTick(() => {
|
||||
memberRef.value?.validateField(['selectedStudent', 'studentNo']);
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
// 设置默认加入时间为当前日期
|
||||
form.value.joinTime = parseTime(new Date(), '{y}-{m}-{d}');
|
||||
open.value = true;
|
||||
title.value = '添加志愿者成员';
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value[0];
|
||||
getVolunteerMember(id).then((response) => {
|
||||
// 将后端数据映射到前端表单字段
|
||||
const memberData = response.data;
|
||||
form.value = {
|
||||
...memberData,
|
||||
// 后端relationId映射为前端teamId
|
||||
teamId: memberData.relationId,
|
||||
// 重建学生选择器对象
|
||||
selectedStudent: {
|
||||
id: memberData.userId,
|
||||
studentNo: memberData.studentNo,
|
||||
name: memberData.studentName,
|
||||
gender: memberData.gender,
|
||||
collegeName: memberData.department,
|
||||
majorName: memberData.major,
|
||||
className: memberData.className,
|
||||
phone: memberData.phone
|
||||
}
|
||||
};
|
||||
open.value = true;
|
||||
title.value = '修改志愿者成员';
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
function handleView(row) {
|
||||
Object.assign(viewForm, row);
|
||||
viewOpen.value = true;
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
memberRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
// 准备提交的数据,过滤掉显示字段,保留API字段
|
||||
const submitData = {
|
||||
...form.value,
|
||||
// 移除selectedStudent等非API字段
|
||||
selectedStudent: undefined,
|
||||
// 移除显示字段,保留API字段
|
||||
contactPhone: undefined,
|
||||
// 保留studentNo字段(后端需要)
|
||||
// 将teamId映射为relationId(后端需要的字段名)
|
||||
relationId: form.value.teamId || form.value.relationId,
|
||||
teamId: undefined, // 移除teamId,因为后端不需要
|
||||
// 设置必需的后端字段
|
||||
memberType: 2, // 志愿者成员类型
|
||||
// 确保roleType为字符串类型
|
||||
roleType: form.value.roleType ? String(form.value.roleType) : '1' // 默认为队员
|
||||
};
|
||||
|
||||
// 调试信息:检查关键字段
|
||||
console.log('提交志愿者成员数据:', {
|
||||
id: submitData.id,
|
||||
studentNo: submitData.studentNo,
|
||||
studentName: submitData.studentName,
|
||||
userId: submitData.userId,
|
||||
relationId: submitData.relationId,
|
||||
memberType: submitData.memberType,
|
||||
roleType: submitData.roleType
|
||||
});
|
||||
|
||||
if (form.value.id != null) {
|
||||
updateVolunteerMember(submitData).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addVolunteerMember(submitData).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const memberIds = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除志愿者成员编号为"' + memberIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delVolunteerMember(memberIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 审核按钮操作 */
|
||||
function handleApprove(row, approved) {
|
||||
const action = approved ? '通过' : '驳回';
|
||||
const memberName = row.studentName || '该成员';
|
||||
|
||||
proxy.$modal
|
||||
.confirm(`是否确认${action}${memberName}的申请?`)
|
||||
.then(function () {
|
||||
return approveVolunteerMember(row.id, approved);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(`${action}成功`);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'stgl/volunteer/member/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`volunteer_member_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 导入按钮操作 */
|
||||
function handleImport() {
|
||||
upload.title = '志愿者成员导入';
|
||||
// 动态更新Token,确保使用最新的认证信息
|
||||
upload.headers = {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
clientid: import.meta.env.VITE_APP_CLIENT_ID || 'e5cd7e4891bf95d1d19206ce24a7b32e',
|
||||
referer: window.location.origin + '/login?redirect=' + encodeURIComponent(window.location.pathname)
|
||||
};
|
||||
upload.open = true;
|
||||
}
|
||||
|
||||
/** 下载模板操作 */
|
||||
function importTemplate() {
|
||||
proxy.download('stgl/volunteer/member/importTemplate', {}, `志愿者队伍成员导入模板_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
function handleFileUploadProgress(event, file, fileList) {
|
||||
upload.isUploading = true;
|
||||
}
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
function handleFileSuccess(response, file, fileList) {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value.clearFiles();
|
||||
ElMessageBox.alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
/** 获取角色显示文本 */
|
||||
function getRoleText(roleType) {
|
||||
if (roleType === undefined || roleType === null) return '-';
|
||||
|
||||
// 调试信息
|
||||
console.log('获取角色文本:', {
|
||||
roleType,
|
||||
type: typeof roleType,
|
||||
dictData: stgl_volunteer_role.value
|
||||
});
|
||||
|
||||
if (!stgl_volunteer_role.value || stgl_volunteer_role.value.length === 0) {
|
||||
return `未知角色(${roleType})`;
|
||||
}
|
||||
|
||||
// 尝试匹配字典
|
||||
const dictItem = stgl_volunteer_role.value.find((item) => item.value === String(roleType) || item.value === roleType);
|
||||
|
||||
return dictItem ? dictItem.label : `未知角色(${roleType})`;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getTeamOptions();
|
||||
|
||||
// 监听字典数据加载完成
|
||||
nextTick(() => {
|
||||
console.log('字典数据加载完成:', {
|
||||
stgl_volunteer_role: stgl_volunteer_role.value,
|
||||
stgl_member_status: stgl_member_status.value
|
||||
});
|
||||
|
||||
// 志愿者角色字典加载完成
|
||||
console.log('志愿者角色字典已加载,总数:', stgl_volunteer_role.value?.length || 0);
|
||||
// 成员状态字典加载完成
|
||||
console.log('成员状态字典已加载,总数:', stgl_member_status.value?.length || 0);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,837 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索条件 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryRef" :model="queryParams" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="队伍名称" prop="teamName">
|
||||
<el-input v-model="queryParams.teamName" placeholder="请输入队伍名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="报名状态" prop="registerStatus">
|
||||
<el-select v-model="queryParams.registerStatus" placeholder="请选择报名状态" clearable style="width: 100%">
|
||||
<el-option label="可报名" value="available" />
|
||||
<el-option label="已满员" value="full" />
|
||||
<el-option label="已申请" value="applied" />
|
||||
<el-option label="已加入" value="joined" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 功能标签页 -->
|
||||
<el-card shadow="never" class="tab-card">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="志愿者大厅" name="all">
|
||||
<template #label>
|
||||
<span class="tab-label">
|
||||
<i class="el-icon-s-home"></i>
|
||||
志愿者大厅
|
||||
</span>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="我的申请" name="my">
|
||||
<template #label>
|
||||
<span class="tab-label">
|
||||
<i class="el-icon-user-solid"></i>
|
||||
我的申请
|
||||
</span>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 工具栏 -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<span class="team-count">共找到 {{ total }} 个志愿者队伍</span>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="teamList" class="modern-table" border>
|
||||
<el-table-column label="队伍名称" align="center" prop="teamName" min-width="150" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span @click="handleViewDetail(scope.row)" style="cursor: pointer">{{ scope.row.teamName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="队伍简介" align="center" min-width="200" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.description || scope.row.teamDescription }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="队长姓名" align="center" prop="leaderName" width="100" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" align="center" width="130" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.phone || scope.row.contactPhone }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="指导老师" align="center" width="150" :resizable="true" :show-overflow-tooltip="false">
|
||||
<template #default="scope">
|
||||
<div class="advisor-cell">
|
||||
<span v-if="!scope.row.advisorName" class="no-advisor">暂无</span>
|
||||
<div v-else class="advisor-list">
|
||||
<el-tag type="info" size="small" class="advisor-tag" :title="scope.row.advisorName">
|
||||
{{ scope.row.advisorName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成员数量" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<span class="member-count">{{ scope.row.currentMemberCount || 0 }}</span>
|
||||
<span v-if="scope.row.memberLimit" class="member-limit">/ {{ scope.row.memberLimit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名状态" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<!-- 1. 已加入 - 蓝色 -->
|
||||
<el-tag v-if="calculateRegisterStatus(scope.row) === 'joined'" type="primary" size="small">已加入</el-tag>
|
||||
|
||||
<!-- 2. 已申请 - 黄色 -->
|
||||
<el-tag v-else-if="calculateRegisterStatus(scope.row) === 'applied'" type="warning" size="small">已申请</el-tag>
|
||||
|
||||
<!-- 3. 已满员 - 红色 -->
|
||||
<el-tag v-else-if="calculateRegisterStatus(scope.row) === 'full'" type="danger" size="small">已满员</el-tag>
|
||||
|
||||
<!-- 4. 可报名 - 绿色(默认状态) -->
|
||||
<el-tag v-else type="success" size="small">可报名</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="150">
|
||||
<template #default="scope">
|
||||
<div class="action-buttons">
|
||||
<!-- 申请报名按钮 - 仅可报名状态显示 -->
|
||||
<el-tooltip content="申请报名" placement="top" v-if="calculateRegisterStatus(scope.row) === 'available'">
|
||||
<el-button link type="success" icon="Plus" @click="handleApply(scope.row)" />
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 已申请状态 - 黄色禁用按钮 -->
|
||||
<el-tooltip content="申请审核中" placement="top" v-else-if="calculateRegisterStatus(scope.row) === 'applied'">
|
||||
<el-button link type="warning" icon="Clock" disabled />
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 已加入状态 - 蓝色禁用按钮 -->
|
||||
<el-tooltip content="已成功加入" placement="top" v-else-if="calculateRegisterStatus(scope.row) === 'joined'">
|
||||
<el-button link type="primary" icon="Check" disabled />
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 已满员状态 - 红色禁用按钮 -->
|
||||
<el-tooltip content="队伍已满员" placement="top" v-else-if="calculateRegisterStatus(scope.row) === 'full'">
|
||||
<el-button link type="danger" icon="Close" disabled />
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 查看详情按钮 - 始终显示 -->
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleViewDetail(scope.row)" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 队伍详情对话框 -->
|
||||
<el-dialog title="志愿者队伍详情" v-model="detailOpen" width="800px" append-to-body>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="队伍名称">{{ detailForm.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成立日期">{{ parseTime(detailForm.establishDate, '{y}-{m}-{d}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成员规模上限">{{ detailForm.memberLimit }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前成员数">{{ detailForm.currentMemberCount || 0 }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ detailForm.phone || detailForm.contactPhone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ detailForm.email }}</el-descriptions-item>
|
||||
<el-descriptions-item label="我的状态">
|
||||
<el-tag v-if="calculateRegisterStatus(detailForm) === 'joined'" type="primary">已加入队伍</el-tag>
|
||||
<el-tag v-else-if="calculateRegisterStatus(detailForm) === 'applied'" type="warning">申请审核中</el-tag>
|
||||
<el-tag v-else-if="calculateRegisterStatus(detailForm) === 'full'" type="danger">队伍已满员</el-tag>
|
||||
<el-tag v-else type="success">可申请报名</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="剩余名额">
|
||||
<span v-if="detailForm.memberLimit && detailForm.memberLimit > 0">
|
||||
{{ Math.max(0, detailForm.memberLimit - (detailForm.currentMemberCount || 0)) }}
|
||||
</span>
|
||||
<span v-else class="text-gray-500">不限</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="队伍简介" :span="2">{{ detailForm.description || detailForm.teamDescription }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="人员信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="队长姓名">{{ detailForm.leaderName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长学号">{{ detailForm.leaderStudentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长联系方式">{{ detailForm.leaderPhone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长院系">{{ detailForm.leaderDept }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长专业">{{ detailForm.leaderMajor }}</el-descriptions-item>
|
||||
<el-descriptions-item label="队长班级">{{ detailForm.leaderClass }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师姓名">{{ detailForm.advisorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师电话">{{ detailForm.advisorPhone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师部门">{{ detailForm.advisorDept }}</el-descriptions-item>
|
||||
<el-descriptions-item label="指导老师邮箱">{{ detailForm.advisorEmail }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<!-- 只在可报名状态显示申请按钮 -->
|
||||
<el-button type="primary" @click="handleApply(detailForm)" v-if="calculateRegisterStatus(detailForm) === 'available'"> 申请报名 </el-button>
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 报名申请对话框 -->
|
||||
<el-dialog title="志愿者报名申请" v-model="applyOpen" width="600px" append-to-body>
|
||||
<el-form ref="applyRef" :model="applyForm" :rules="applyRules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="申请队伍">
|
||||
<el-input v-model="selectedTeam.teamName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="studentName">
|
||||
<el-input v-model="applyForm.studentName" placeholder="系统自动填充" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="applyForm.studentNo" placeholder="系统自动填充" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="applyForm.gender" placeholder="系统自动填充" disabled style="width: 100%">
|
||||
<el-option label="男" value="0" />
|
||||
<el-option label="女" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="applyForm.phone" placeholder="系统自动填充,可修改">
|
||||
<template #suffix>
|
||||
<el-tooltip content="此信息已自动填充,如有误可直接修改" placement="top">
|
||||
<el-icon class="el-input__icon"><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="院系" prop="department">
|
||||
<el-input v-model="applyForm.department" placeholder="系统自动填充" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="major">
|
||||
<el-input v-model="applyForm.major" placeholder="系统自动填充" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="applyForm.className" placeholder="系统自动填充" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="applyForm.email" placeholder="系统自动填充,可修改">
|
||||
<template #suffix>
|
||||
<el-tooltip content="此信息已自动填充,如有误可直接修改" placement="top">
|
||||
<el-icon class="el-input__icon"><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="申请理由" prop="applyReason">
|
||||
<el-input v-model="applyForm.applyReason" type="textarea" :rows="4" placeholder="请简要说明您的申请理由和个人优势" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitApply">提交申请</el-button>
|
||||
<el-button @click="applyOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 我的申请对话框 -->
|
||||
<el-dialog title="我的志愿者申请" v-model="myApplicationsOpen" width="1000px" append-to-body>
|
||||
<el-table :data="myApplicationsList" style="width: 100%">
|
||||
<el-table-column label="队伍名称" align="center" prop="teamName" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" align="center" prop="applyTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请状态" align="center" prop="applyStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.applyStatus === '0'" type="warning">待审核</el-tag>
|
||||
<el-tag v-else-if="scope.row.applyStatus === '1'" type="success">已通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.applyStatus === '2'" type="danger">已拒绝</el-tag>
|
||||
<el-tag v-else type="info">未知状态</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" align="center" prop="applyReason" show-overflow-tooltip />
|
||||
<el-table-column label="审核意见" align="center" prop="reviewComment" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-button link type="danger" @click="handleCancelApply(scope.row)" v-if="scope.row.applyStatus === '0'">撤销申请</el-button>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="VolunteerRegistration" lang="ts">
|
||||
import {
|
||||
listVolunteerTeamForStudentRegistration,
|
||||
getVolunteerRegistrationInfo,
|
||||
applyJoinVolunteerTeam,
|
||||
getMyVolunteerApplications,
|
||||
quitVolunteerApplication
|
||||
} from '@/api/stgl/volunteerregistration';
|
||||
// 导入学生个人信息API
|
||||
import { getPersonalInfo } from '@/api/xg/xsjcxx/studentMsg/studentMsg/index';
|
||||
import type { StudentMsgForm } from '@/api/xg/xsjcxx/studentMsg/studentMsg/types';
|
||||
// 导入图标
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
|
||||
// 类型定义
|
||||
interface TeamInfo {
|
||||
id?: number;
|
||||
teamName?: string;
|
||||
establishDate?: string;
|
||||
leaderName?: string;
|
||||
advisorName?: string;
|
||||
currentMemberCount?: number;
|
||||
memberLimit?: number;
|
||||
contactPhone?: string;
|
||||
phone?: string; // 后端返回的联系电话字段
|
||||
teamDescription?: string;
|
||||
description?: string; // 后端返回的描述字段
|
||||
leaderStudentNo?: string; // 后端字段名
|
||||
leaderPhone?: string; // 后端字段名
|
||||
leaderDept?: string; // 后端字段名
|
||||
leaderMajor?: string;
|
||||
leaderClass?: string;
|
||||
advisorPhone?: string;
|
||||
advisorDept?: string; // 后端字段名
|
||||
advisorEmail?: string;
|
||||
email?: string;
|
||||
status?: number | string; // 队伍状态(sys_normal_disable字典:0-正常 1-停用)
|
||||
|
||||
// 用户申请状态字段(后端已支持)
|
||||
hasApplied?: boolean; // 是否已申请
|
||||
hasJoined?: boolean; // 是否已加入(审核通过)
|
||||
userApplicationStatus?: number; // 用户申请状态(0-待审核 2-已通过 3-已驳回)
|
||||
}
|
||||
|
||||
interface ApplyForm {
|
||||
teamId?: number;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
gender?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
department?: string;
|
||||
major?: string;
|
||||
className?: string;
|
||||
applyReason?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
interface QueryParams {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
teamName?: string;
|
||||
registerStatus?: string; // 报名状态筛选(前端实现)
|
||||
status?: string;
|
||||
}
|
||||
|
||||
interface ApplicationInfo {
|
||||
id?: number;
|
||||
teamName?: string;
|
||||
applyTime?: Date;
|
||||
applyStatus?: string;
|
||||
applyReason?: string;
|
||||
reviewComment?: string;
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance()!;
|
||||
|
||||
const teamList = ref<TeamInfo[]>([]);
|
||||
const myApplicationsList = ref<ApplicationInfo[]>([]);
|
||||
const detailOpen = ref(false);
|
||||
const applyOpen = ref(false);
|
||||
const myApplicationsOpen = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
const activeTab = ref('all');
|
||||
|
||||
const selectedTeam = ref<TeamInfo>({});
|
||||
|
||||
const data = reactive({
|
||||
detailForm: {} as TeamInfo,
|
||||
applyForm: {} as ApplyForm,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
teamName: undefined,
|
||||
registerStatus: undefined, // 报名状态筛选(前端实现)
|
||||
status: '0' // 只显示正常状态的队伍(0-正常)
|
||||
} as QueryParams,
|
||||
applyRules: {
|
||||
studentName: [{ required: true, message: '系统未能获取到姓名信息', trigger: 'blur' }],
|
||||
studentNo: [{ required: true, message: '系统未能获取到学号信息', trigger: 'blur' }],
|
||||
gender: [{ required: true, message: '系统未能获取到性别信息', trigger: 'change' }],
|
||||
phone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
department: [{ required: true, message: '系统未能获取到院系信息', trigger: 'blur' }],
|
||||
major: [{ required: true, message: '系统未能获取到专业信息', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '系统未能获取到班级信息', trigger: 'blur' }],
|
||||
email: [{ type: 'email' as const, message: '请输入正确的邮箱地址', trigger: 'blur' }],
|
||||
applyReason: [{ required: true, message: '申请理由不能为空', trigger: 'blur' }]
|
||||
} as any
|
||||
});
|
||||
|
||||
const { queryParams, detailForm, applyForm, applyRules } = toRefs(data);
|
||||
|
||||
/** 计算队伍的报名状态 */
|
||||
function calculateRegisterStatus(row: TeamInfo): string {
|
||||
// 优先级1:用户状态检查(使用后端返回的用户申请状态)
|
||||
if (row.hasJoined) {
|
||||
return 'joined'; // 已加入
|
||||
}
|
||||
|
||||
if (row.hasApplied) {
|
||||
return 'applied'; // 已申请
|
||||
}
|
||||
|
||||
// 优先级2:队伍成员数量检查
|
||||
const currentCount = row.currentMemberCount || 0;
|
||||
const limit = row.memberLimit || 0;
|
||||
|
||||
if (limit > 0 && currentCount >= limit) {
|
||||
return 'full'; // 已满员
|
||||
}
|
||||
|
||||
return 'available'; // 可报名
|
||||
}
|
||||
|
||||
/** 查询志愿者队伍列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
const params = { ...queryParams.value };
|
||||
|
||||
// 暂时移除registerStatus参数,因为后端API暂不支持
|
||||
const { registerStatus, ...backendParams } = params;
|
||||
|
||||
listVolunteerTeamForStudentRegistration(backendParams).then((response) => {
|
||||
let filteredData = response.rows;
|
||||
|
||||
// 前端实现报名状态筛选(临时方案)
|
||||
if (registerStatus) {
|
||||
filteredData = response.rows.filter((item: any) => {
|
||||
return calculateRegisterStatus(item) === registerStatus;
|
||||
});
|
||||
}
|
||||
|
||||
teamList.value = filteredData;
|
||||
total.value = filteredData.length;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
(proxy!.$refs['queryRef'] as any).resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 标签页切换 */
|
||||
function handleTabChange(tabName: string) {
|
||||
activeTab.value = tabName;
|
||||
queryParams.value.pageNum = 1;
|
||||
if (tabName === 'my') {
|
||||
// 切换到"我的申请"页签时,直接打开申请列表对话框
|
||||
handleMyApplications();
|
||||
// 切换回"志愿者大厅"页签
|
||||
setTimeout(() => {
|
||||
activeTab.value = 'all';
|
||||
}, 100);
|
||||
} else {
|
||||
// 切换到"志愿者大厅"页签时,刷新队伍列表
|
||||
getList();
|
||||
}
|
||||
}
|
||||
|
||||
/** 查看详情 */
|
||||
function handleViewDetail(row: TeamInfo) {
|
||||
const id = row.id;
|
||||
getVolunteerRegistrationInfo(id!).then((response) => {
|
||||
detailForm.value = response.data;
|
||||
detailOpen.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
/** 申请报名 */
|
||||
function handleApply(row: TeamInfo) {
|
||||
selectedTeam.value = row;
|
||||
resetApplyForm();
|
||||
// 获取用户信息并自动填充
|
||||
loadUserInfoToForm();
|
||||
applyOpen.value = true;
|
||||
}
|
||||
|
||||
/** 重置申请表单 */
|
||||
function resetApplyForm() {
|
||||
applyForm.value = {
|
||||
teamId: selectedTeam.value.id,
|
||||
studentName: undefined,
|
||||
studentNo: undefined,
|
||||
gender: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
department: undefined,
|
||||
major: undefined,
|
||||
className: undefined,
|
||||
applyReason: undefined,
|
||||
status: '0' // 默认正常状态
|
||||
};
|
||||
(proxy!.$refs['applyRef'] as any)?.resetFields();
|
||||
}
|
||||
|
||||
/** 加载用户信息到申请表单 */
|
||||
async function loadUserInfoToForm() {
|
||||
try {
|
||||
// 获取当前用户的学生信息
|
||||
const response = await getPersonalInfo();
|
||||
const studentInfo: StudentMsgForm = response.data;
|
||||
|
||||
if (studentInfo) {
|
||||
// 自动填充用户基本信息
|
||||
applyForm.value.studentName = studentInfo.name || '';
|
||||
applyForm.value.studentNo = studentInfo.studentNo || '';
|
||||
applyForm.value.gender = studentInfo.gender || '';
|
||||
applyForm.value.phone = studentInfo.phone || '';
|
||||
applyForm.value.email = studentInfo.email || '';
|
||||
applyForm.value.department = studentInfo.collegeName || ''; // 院系使用学院名称
|
||||
applyForm.value.major = studentInfo.majorName || '';
|
||||
applyForm.value.className = studentInfo.className || '';
|
||||
} else {
|
||||
proxy!.$modal.msgWarning('未能获取到用户信息,请手动填写申请表单');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error);
|
||||
proxy!.$modal.msgWarning('获取用户信息失败,请联系管理员或手动填写');
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交申请 */
|
||||
function submitApply() {
|
||||
(proxy!.$refs['applyRef'] as any).validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
applyForm.value.teamId = selectedTeam.value.id;
|
||||
applyJoinVolunteerTeam(applyForm.value).then((response) => {
|
||||
proxy!.$modal.msgSuccess('申请提交成功,请等待审核');
|
||||
applyOpen.value = false;
|
||||
getList(); // 刷新列表
|
||||
}).catch((error) => {
|
||||
console.error('申请提交失败:', error);
|
||||
// 显示具体的错误信息
|
||||
const errorMsg = error?.response?.data?.msg || error?.message || '申请提交失败,请稍后重试';
|
||||
proxy!.$modal.msgError(errorMsg);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 申请报名按钮 */
|
||||
function handleRegister() {
|
||||
proxy?.$modal?.msgWarning('请从队伍列表中选择要申请的志愿者队伍');
|
||||
}
|
||||
|
||||
/** 我的申请 */
|
||||
function handleMyApplications() {
|
||||
getMyVolunteerApplications()
|
||||
.then((response) => {
|
||||
myApplicationsList.value = response.rows || response.data || [];
|
||||
myApplicationsOpen.value = true;
|
||||
})
|
||||
.catch(() => {
|
||||
// 如果接口出错,显示空列表
|
||||
myApplicationsList.value = [];
|
||||
myApplicationsOpen.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
/** 撤销申请 */
|
||||
function handleCancelApply(row: ApplicationInfo) {
|
||||
proxy!.$modal
|
||||
.confirm('是否确认撤销该申请?')
|
||||
.then(function () {
|
||||
if (row.id) {
|
||||
quitVolunteerApplication(row.id).then(() => {
|
||||
proxy!.$modal.msgSuccess('申请已撤销');
|
||||
handleMyApplications(); // 刷新我的申请列表
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 现代化页面布局 */
|
||||
.page-container {
|
||||
min-height: calc(100vh - 84px);
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
/* 标签卡片样式 */
|
||||
.tab-card {
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.content-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.content-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 搜索区域样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.search-btn-container .el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 工具栏样式 */
|
||||
.toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.toolbar-left .team-count {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 现代化表格样式 */
|
||||
.modern-table {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:deep(.modern-table .el-table__header) {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
:deep(.modern-table .el-table__header th) {
|
||||
background: #f8f9fa !important;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
:deep(.modern-table .el-table__body tr:hover) {
|
||||
background: #f0f9ff;
|
||||
}
|
||||
|
||||
:deep(.modern-table .el-table__fixed-right) {
|
||||
box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 成员数量样式 */
|
||||
.member-count {
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.member-limit {
|
||||
color: #909399;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* 指导老师显示样式 */
|
||||
.advisor-cell {
|
||||
padding: 4px 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.no-advisor {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.advisor-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px 6px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.advisor-tag {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
padding: 2px 6px;
|
||||
border-radius: 2px;
|
||||
white-space: nowrap;
|
||||
overflow: visible;
|
||||
text-overflow: unset;
|
||||
flex-shrink: 0;
|
||||
max-width: none;
|
||||
background-color: #f0f2f5;
|
||||
color: #606266;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
/* 操作按钮样式 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* 分页容器 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* 链接样式 */
|
||||
.el-link.font-semibold {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 输入框圆角 */
|
||||
:deep(.el-input__wrapper) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
:deep(.el-select .el-input__wrapper) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* 标签圆角效果 */
|
||||
:deep(.el-tag) {
|
||||
border-radius: 12px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
/* 自动填充字段样式 */
|
||||
:deep(.el-input.is-disabled .el-input__wrapper),
|
||||
:deep(.el-input[readonly] .el-input__wrapper) {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #e4e7ed;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
:deep(.el-select.is-disabled .el-input__wrapper) {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #e4e7ed;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
/* 响应式适配 */
|
||||
@media (max-width: 768px) {
|
||||
.toolbar-container {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -59,12 +59,7 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="班主任" prop="classTeacherId">
|
||||
<el-select v-model="queryParams.classTeacherId" placeholder="请选择班主任" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="teacher in classTeacherOptions"
|
||||
:key="teacher.value"
|
||||
:label="teacher.label"
|
||||
:value="teacher.value"
|
||||
/>
|
||||
<el-option v-for="teacher in classTeacherOptions" :key="teacher.value" :label="teacher.label" :value="teacher.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -668,7 +663,6 @@ const getList = async () => {
|
||||
total: total.value,
|
||||
listLength: classInfoList.value.length
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error);
|
||||
classInfoList.value = [];
|
||||
@@ -697,11 +691,11 @@ const getOptions = async () => {
|
||||
console.log('部门树根节点数量:', rootDepts.length);
|
||||
|
||||
// 处理每个一级部门
|
||||
rootDepts.forEach(rootDept => {
|
||||
rootDepts.forEach((rootDept) => {
|
||||
console.log(`处理一级部门: ${rootDept.label}, ID: ${rootDept.id}`);
|
||||
// 处理一级部门下的二级学院
|
||||
if (rootDept.children && rootDept.children.length > 0) {
|
||||
rootDept.children.forEach(child => {
|
||||
rootDept.children.forEach((child) => {
|
||||
// 确保ID是有效的数字
|
||||
const childId = child.id;
|
||||
if (childId && !isNaN(Number(childId))) {
|
||||
@@ -805,7 +799,7 @@ const handleCollegeChange = async (deptId: string | number) => {
|
||||
// 处理响应数据
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
// 转换为选项格式
|
||||
const deptMajors = res.data.map(dept => {
|
||||
const deptMajors = res.data.map((dept) => {
|
||||
// 确保使用数字类型的ID
|
||||
const majorId = Number(dept.deptId);
|
||||
console.log(`专业选项: ${dept.deptName}, ID: ${majorId}`);
|
||||
@@ -856,7 +850,7 @@ const handleFormCollegeChange = async (deptId: string | number) => {
|
||||
// 处理响应数据
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
// 转换为选项格式
|
||||
const deptMajors = res.data.map(dept => {
|
||||
const deptMajors = res.data.map((dept) => {
|
||||
// 确保使用数字类型的ID
|
||||
const majorId = Number(dept.deptId);
|
||||
console.log(`表单专业选项: ${dept.deptName}, ID: ${majorId}`);
|
||||
@@ -889,7 +883,7 @@ const handleFormCollegeChange = async (deptId: string | number) => {
|
||||
|
||||
/** 专业变更处理 */
|
||||
const handleMajorChange = (majorCode: string | number) => {
|
||||
const selectedMajor = formMajorOptions.value.find(option => option.value === Number(majorCode));
|
||||
const selectedMajor = formMajorOptions.value.find((option) => option.value === Number(majorCode));
|
||||
form.value.majorName = selectedMajor ? selectedMajor.label : '';
|
||||
console.log('专业变更,选择专业:', majorCode, '专业名称:', form.value.majorName);
|
||||
};
|
||||
@@ -898,7 +892,7 @@ const handleMajorChange = (majorCode: string | number) => {
|
||||
/** 班主任变更处理 */
|
||||
const handleClassTeacherChange = (teacherId: string | number) => {
|
||||
form.value.classTeacherId = teacherId;
|
||||
const selectedTeacher = classTeacherOptions.value.find(option => option.value === teacherId);
|
||||
const selectedTeacher = classTeacherOptions.value.find((option) => option.value === teacherId);
|
||||
form.value.classTeacherName = selectedTeacher ? selectedTeacher.label : '';
|
||||
};
|
||||
|
||||
|
||||
Loaded 100 of 288 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user