统计信息
@@ -362,6 +367,7 @@
import { computed, ref, onMounted, watch } from 'vue';
import { StglActivityVO, CoOrganizerInfo, InstructorInfo } from '@/api/stgl/activity/types';
import ActivityRatingView from './ActivityRatingView.vue';
+import ActivityRegistrationView from './ActivityRegistrationView.vue';
import { listByIds } from '@/api/system/oss';
interface Props {
@@ -404,11 +410,10 @@ const instructorList = computed
(() => {
// 加载附件信息
const loadAttachments = async () => {
-
// 重置附件列表
summaryAttachmentList.value = [];
achievementsAttachmentList.value = [];
-
+
// 加载总结报告附件
if (props.activity.summaryAttachments) {
// 检查数据格式:如果以 [ 开头,说明是JSON格式;否则是ossId格式
@@ -423,7 +428,7 @@ const loadAttachments = async () => {
}
} else {
// ossId格式:通过API获取真实附件信息
- const ossIds = attachmentStr.split(',').filter(id => id.trim());
+ const ossIds = attachmentStr.split(',').filter((id) => id.trim());
if (ossIds.length > 0) {
try {
const res = await listByIds(ossIds.join(','));
@@ -454,7 +459,7 @@ const loadAttachments = async () => {
}
} else {
// ossId格式:通过API获取真实附件信息
- const ossIds = attachmentStr.split(',').filter(id => id.trim());
+ const ossIds = attachmentStr.split(',').filter((id) => id.trim());
if (ossIds.length > 0) {
try {
const res = await listByIds(ossIds.join(','));
@@ -480,11 +485,15 @@ const downloadAttachment = (file: any) => {
};
// 监听props变化,重新加载附件信息
-watch(() => props.activity, (newActivity) => {
- if (newActivity && newActivity.id) {
- loadAttachments();
- }
-}, { immediate: true });
+watch(
+ () => props.activity,
+ (newActivity) => {
+ if (newActivity && newActivity.id) {
+ loadAttachments();
+ }
+ },
+ { immediate: true }
+);
// 组件挂载时加载附件信息
onMounted(() => {
@@ -657,4 +666,4 @@ onMounted(() => {
.attachment-icon {
font-size: 14px;
}
-
\ No newline at end of file
+
diff --git a/web/src/views/stgl/activity/components/ActivityRatingView.vue b/web/src/views/stgl/activity/components/ActivityRatingView.vue
index 42752ae8..7ab86f44 100644
--- a/web/src/views/stgl/activity/components/ActivityRatingView.vue
+++ b/web/src/views/stgl/activity/components/ActivityRatingView.vue
@@ -3,7 +3,7 @@
-
+
@@ -18,9 +18,9 @@
-
+
-
+
@@ -59,13 +59,13 @@ const averageRating = computed(() => {
// 计算最高评分
const maxRating = computed(() => {
if (ratings.value.length === 0) return 0;
- return Math.max(...ratings.value.map(rating => rating.ratingScore));
+ 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);
@@ -101,4 +101,4 @@ onMounted(() => {
text-align: center;
padding: 60px 20px;
}
-
\ No newline at end of file
+
diff --git a/web/src/views/stgl/activity/hall/index.vue b/web/src/views/stgl/activity/hall/index.vue
index d08670a7..3432306e 100644
--- a/web/src/views/stgl/activity/hall/index.vue
+++ b/web/src/views/stgl/activity/hall/index.vue
@@ -124,24 +124,10 @@
>
-
+
-
+
@@ -169,7 +155,7 @@
-
+
个人报名
@@ -240,7 +226,7 @@
-
+
团队负责人
@@ -301,18 +287,18 @@
- 团队成员
- 团队成员
+
-
+
@@ -398,10 +384,12 @@ const data = reactive>
const { queryParams } = toRefs(data);
// 报名表单
-const registerForm = reactive({
+const registerForm = reactive<
+ StglActivityRegistrationForm & {
+ presidentStudent?: StudentVO | null;
+ teamMembersNew?: VicePresidentVO[];
+ }
+>({
activityId: undefined,
registrationType: undefined,
studentName: undefined,
@@ -426,10 +414,10 @@ const registerRules = reactive({
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
phone: [
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
- {
- pattern: /^1[3-9]\d{9}$/,
- message: '请输入正确的手机号码',
- trigger: 'blur'
+ {
+ pattern: /^1[3-9]\d{9}$/,
+ message: '请输入正确的手机号码',
+ trigger: 'blur'
} as any
],
teamName: [{ required: true, message: '团队名称不能为空', trigger: 'blur' }]
@@ -442,7 +430,7 @@ const getList = async () => {
const res = await listRegistrableActivities(queryParams.value);
activityList.value = res.rows;
total.value = res.total;
-
+
// 批量检查用户报名状态
await checkUserRegistrationStatus();
} catch (error) {
@@ -464,7 +452,7 @@ const checkUserRegistrationStatus = async () => {
userRegistrationStatus.value[activity.id as number] = false;
}
});
-
+
await Promise.all(promises);
};
@@ -492,7 +480,7 @@ const handleView = async (row: StglActivityVO) => {
const handleRegister = async (row: StglActivityVO) => {
selectedActivity.value = row;
resetRegisterForm();
-
+
registerDialog.visible = true;
};
@@ -516,7 +504,7 @@ const resetRegisterForm = () => {
remark: undefined,
presidentStudent: null
});
-
+
nextTick(() => {
registerFormRef.value?.resetFields();
});
@@ -527,7 +515,7 @@ const loadUserInfoToForm = async () => {
try {
const response = await getPersonalInfo();
const studentInfo: StudentMsgForm = response.data;
-
+
if (studentInfo) {
registerForm.studentName = studentInfo.name || '';
registerForm.studentNo = studentInfo.studentNo || '';
@@ -555,7 +543,7 @@ const handleRegistrationTypeChange = async (value: number) => {
registerForm.teamMembers = [];
registerForm.teamMembersNew = [];
registerForm.presidentStudent = null;
-
+
// 自动填充当前用户信息
await loadUserInfoToForm();
} else if (value === 2) {
@@ -583,7 +571,7 @@ const handlePresidentChange = async (student: StudentVO | null) => {
registerForm.department = student.collegeName || '';
registerForm.major = student.majorName || '';
registerForm.className = student.className || '';
-
+
// 清空email,让用户手动填写或通过其他方式获取
registerForm.email = undefined;
} else {
@@ -602,9 +590,9 @@ const handlePresidentChange = async (student: StudentVO | null) => {
/** 新版团队成员变化处理 */
const handleTeamMembersNewChange = (members: VicePresidentVO[]) => {
registerForm.teamMembersNew = members;
-
+
// 同步到原有字段,用于兼容后端
- registerForm.teamMembers = members.map(member => ({
+ registerForm.teamMembers = members.map((member) => ({
userId: member.student?.id || 0,
studentNo: member.student?.studentNo || '',
studentName: member.name || member.student?.name || '',
@@ -616,7 +604,7 @@ const handleTeamMembersNewChange = (members: VicePresidentVO[]) => {
className: member.class || member.student?.className || '',
isLeader: 0 // 团队成员,非负责人
}));
-
+
// 验证团队人数限制
const totalMembers = members.length + 1; // 包含负责人
if (selectedActivity.value.teamSizeMin && totalMembers < selectedActivity.value.teamSizeMin) {
@@ -630,7 +618,7 @@ const handleTeamMembersNewChange = (members: VicePresidentVO[]) => {
/** 团队成员变化处理(兼容原有方法) */
const handleTeamMembersChange = (members: TeamMemberInfo[]) => {
registerForm.teamMembers = members;
-
+
// 验证团队人数限制
const totalMembers = members.length + 1; // 包含负责人
if (selectedActivity.value.teamSizeMin && totalMembers < selectedActivity.value.teamSizeMin) {
@@ -679,7 +667,7 @@ const submitRegister = () => {
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);
@@ -688,11 +676,11 @@ const submitRegister = () => {
}
}
// 个人报名时不发送任何团队相关字段
-
+
await registerActivity(submitData);
proxy?.$modal.msgSuccess('报名成功,请等待审核');
registerDialog.visible = false;
-
+
// 更新报名状态
userRegistrationStatus.value[selectedActivity.value.id as number] = true;
} catch (error) {
@@ -792,4 +780,4 @@ onMounted(() => {
margin-bottom: 0 !important;
}
}
-
\ No newline at end of file
+
diff --git a/web/src/views/stgl/activity/index.vue b/web/src/views/stgl/activity/index.vue
index 97dac47d..d967e7f0 100644
--- a/web/src/views/stgl/activity/index.vue
+++ b/web/src/views/stgl/activity/index.vue
@@ -45,6 +45,11 @@
+
+
+
+
+
新增
- 修改
+ 修改
复制
- 删除
+ >删除
导出
@@ -180,7 +182,7 @@
-
+
+
+
+
指导老师信息
-