wuzhen update

This commit is contained in:
wuzhen committed 2025-09-07 18:17:50 +08:00
1 parent edaf8dbacf
commit 48da578546
86 files changed
+2101 -1849

No files matched your search

@@ -3,26 +3,26 @@
<!-- 搜索区域 -->
<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="always" style="padding: 8px 16px;">
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
<el-card shadow="always" style="padding: 8px 16px">
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
<el-row :gutter="16" align="middle">
<el-col :span="5">
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0;">
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0">
<el-input v-model="queryParams.phone" placeholder="请输入联系方式" clearable size="small" @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 0;">
<el-form-item style="margin-bottom: 0">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
@@ -94,13 +94,7 @@
</el-table-column>
<el-table-column label="签到时间" align="center" width="120">
<template #default="scope">
<el-button
v-if="scope.row.latestSignInTime"
link
type="primary"
@click="showSignRecords(scope.row)"
class="time-button"
>
<el-button v-if="scope.row.latestSignInTime" link type="primary" @click="showSignRecords(scope.row)" class="time-button">
{{ formatSignTime(scope.row.latestSignInTime) }}
</el-button>
<span v-else class="text-gray-400">未签到</span>
@@ -108,13 +102,7 @@
</el-table-column>
<el-table-column label="签退时间" align="center" width="120">
<template #default="scope">
<el-button
v-if="scope.row.latestSignOutTime"
link
type="primary"
@click="showSignRecords(scope.row)"
class="time-button"
>
<el-button v-if="scope.row.latestSignOutTime" link type="primary" @click="showSignRecords(scope.row)" class="time-button">
{{ formatSignTime(scope.row.latestSignOutTime) }}
</el-button>
<span v-else class="text-gray-400">未签退</span>
@@ -309,7 +297,7 @@
是否更新已经存在的报名数据
</div>
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
</div>
</template>
</el-upload>
@@ -493,15 +481,15 @@ const getList = async () => {
try {
// 构建查询参数,查询已审核通过的报名记录
const queryData = { ...queryParams.value };
// 如果状态字段为空或未选择,则查询已通过(approvalStatus=1)的报名记录
if (!queryData.approvalStatus) {
queryData.approvalStatus = 1;
}
console.log('ActivityRegistrationView: getList 开始查询,参数:', queryData);
console.log('ActivityRegistrationView: props.activityId:', props.activityId);
const res = await listActivityRegister(queryData);
console.log('ActivityRegistrationView: 查询结果完整对象:', res);
console.log('ActivityRegistrationView: res 的类型:', typeof res);
@@ -510,7 +498,7 @@ const getList = async () => {
console.log('ActivityRegistrationView: res.rows 的类型:', typeof res.rows);
console.log('ActivityRegistrationView: res.total:', res.total);
console.log('ActivityRegistrationView: res 的所有属性:', Object.keys(res || {}));
// 检查 res.rows 是否存在且为数组
if (!res || !res.rows) {
console.error('ActivityRegistrationView: API返回数据异常 - res.rows 不存在');
@@ -520,7 +508,7 @@ const getList = async () => {
total.value = 0;
return;
}
if (!Array.isArray(res.rows)) {
console.error('ActivityRegistrationView: API返回数据异常 - res.rows 不是数组');
console.error('ActivityRegistrationView: res.rows 实际值:', res.rows);
@@ -530,9 +518,9 @@ const getList = async () => {
total.value = 0;
return;
}
console.log('ActivityRegistrationView: res.rows 数组长度:', res.rows.length);
// 为每个成员添加签到信息
const membersWithSignInfo = await Promise.all(
res.rows.map(async (member) => {
@@ -546,17 +534,17 @@ const getList = async () => {
studentNo: member.studentNo
}
});
if (signRes.code === 200 && signRes.data && signRes.data.length > 0) {
// 获取最新的签到和签退时间
const latestSignIn = signRes.data
.filter((record: any) => record.signInTime)
.sort((a: any, b: any) => new Date(b.signInTime).getTime() - new Date(a.signInTime).getTime())[0];
const latestSignOut = signRes.data
.filter((record: any) => record.signOutTime)
.sort((a: any, b: any) => new Date(b.signOutTime).getTime() - new Date(a.signOutTime).getTime())[0];
return {
...member,
latestSignInTime: latestSignIn?.signInTime,
@@ -566,7 +554,7 @@ const getList = async () => {
} catch (error) {
console.warn('获取签到信息失败:', error);
}
return {
...member,
latestSignInTime: undefined,
@@ -574,7 +562,7 @@ const getList = async () => {
};
})
);
memberList.value = membersWithSignInfo;
total.value = res.total;
} catch (error: any) {
@@ -586,7 +574,7 @@ const getList = async () => {
request: error?.request,
config: error?.config
});
// 检查是否是网络错误
if (error?.code === 'NETWORK_ERROR' || error?.code === 'ECONNABORTED') {
proxy?.$modal.msgError('网络连接失败,请检查网络状态');
@@ -603,7 +591,7 @@ const getList = async () => {
// 其他错误(如代码逻辑错误)
proxy?.$modal.msgError(`查询成员列表失败: ${error?.message || '未知错误'}`);
}
// 确保在错误情况下清空数据
memberList.value = [];
total.value = 0;
@@ -617,7 +605,7 @@ const showSignRecords = async (member: ExtendedActivityRegisterVO) => {
signRecordsDialog.visible = true;
signRecordsDialog.title = `${member.studentName}(${member.studentNo})的签到记录`;
signRecordsLoading.value = true;
try {
const res = await request({
url: '/stgl/activityAttendance/getAllByActivityAndUser',
@@ -627,7 +615,7 @@ const showSignRecords = async (member: ExtendedActivityRegisterVO) => {
studentNo: member.studentNo
}
});
if (res.code === 200) {
signRecords.value = res.data || [];
} else {
@@ -708,7 +696,7 @@ const handleUpdate = async (row?: ExtendedActivityRegisterVO) => {
const _id = row?.id || ids.value[0];
const res = await getActivityRegister(_id);
Object.assign(form.value, res.data);
// 设置学生选择器数据
if (res.data.studentName) {
form.value.selectedStudent = {
@@ -722,7 +710,7 @@ const handleUpdate = async (row?: ExtendedActivityRegisterVO) => {
className: res.data.className || ''
} as StudentVO;
}
dialog.visible = true;
dialog.title = '修改活动报名';
};
@@ -732,14 +720,14 @@ const submitForm = () => {
memberFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
// 创建提交数据,排除selectedStudent字段
const { selectedStudent, ...submitData } = form.value;
// 确保包含必要字段
submitData.activityId = props.activityId;
submitData.approvalStatus = 1; // 新增的报名默认为已通过状态
try {
if (form.value.id) {
await updateActivityRegister(submitData as ActivityRegisterForm);
@@ -762,14 +750,14 @@ const submitForm = () => {
const handleDelete = async (row?: ExtendedActivityRegisterVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除选中的活动报名记录?');
try {
if (Array.isArray(_ids)) {
await delActivityRegister(_ids.join(','));
} else {
await delActivityRegister(_ids);
}
proxy?.$modal.msgSuccess('删除成功');
await getList();
} catch (error) {
@@ -911,4 +899,4 @@ onMounted(() => {
.text-gray-400 {
color: #909399;
}
</style>
</style>