Browse Source

提交代码

zlwu 1 năm trước cách đây
mục cha
commit
bee68f318d

+ 105 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgDormViolationController.java

@@ -0,0 +1,105 @@
+package org.dromara.xg.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.xg.domain.vo.XgDormViolationVo;
+import org.dromara.xg.domain.bo.XgDormViolationBo;
+import org.dromara.xg.service.IXgDormViolationService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 宿舍违纪记录
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/dormViolation/dormViolation")
+public class XgDormViolationController extends BaseController {
+
+    private final IXgDormViolationService xgDormViolationService;
+
+    /**
+     * 查询宿舍违纪记录列表
+     */
+    @SaCheckPermission("dormViolation:dormViolation:list")
+    @GetMapping("/list")
+    public TableDataInfo<XgDormViolationVo> list(XgDormViolationBo bo, PageQuery pageQuery) {
+        return xgDormViolationService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出宿舍违纪记录列表
+     */
+    @SaCheckPermission("dormViolation:dormViolation:export")
+    @Log(title = "宿舍违纪记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(XgDormViolationBo bo, HttpServletResponse response) {
+        List<XgDormViolationVo> list = xgDormViolationService.queryList(bo);
+        ExcelUtil.exportExcel(list, "宿舍违纪记录", XgDormViolationVo.class, response);
+    }
+
+    /**
+     * 获取宿舍违纪记录详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("dormViolation:dormViolation:query")
+    @GetMapping("/{id}")
+    public R<XgDormViolationVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(xgDormViolationService.queryById(id));
+    }
+
+    /**
+     * 新增宿舍违纪记录
+     */
+    @SaCheckPermission("dormViolation:dormViolation:add")
+    @Log(title = "宿舍违纪记录", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody XgDormViolationBo bo) {
+        return toAjax(xgDormViolationService.insertByBo(bo));
+    }
+
+    /**
+     * 修改宿舍违纪记录
+     */
+    @SaCheckPermission("dormViolation:dormViolation:edit")
+    @Log(title = "宿舍违纪记录", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgDormViolationBo bo) {
+        return toAjax(xgDormViolationService.updateByBo(bo));
+    }
+
+    /**
+     * 删除宿舍违纪记录
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("dormViolation:dormViolation:remove")
+    @Log(title = "宿舍违纪记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(xgDormViolationService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 168 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/XgDormViolation.java

@@ -0,0 +1,168 @@
+package org.dromara.xg.domain;
+
+import org.dromara.common.tenant.core.TenantEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serial;
+
+/**
+ * 宿舍违纪记录对象 xg_dorm_violation
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("xg_dorm_violation")
+public class XgDormViolation extends TenantEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 违纪记录ID(主键)
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 学生ID
+     */
+    private Long studentId;
+
+    /**
+     * 学生姓名
+     */
+    private String studentName;
+
+    /**
+     * 学号
+     */
+    private String studentNo;
+
+    /**
+     * 学院ID
+     */
+    private Long collegeId;
+
+    /**
+     * 学院名称
+     */
+    private String collegeName;
+
+    /**
+     * 专业ID
+     */
+    private Long majorId;
+
+    /**
+     * 专业名称
+     */
+    private String majorName;
+
+    /**
+     * 班级ID
+     */
+    private Long classId;
+
+    /**
+     * 班级名称
+     */
+    private String className;
+
+    /**
+     * 校区ID
+     */
+    private Long campusId;
+
+    /**
+     * 校区名称
+     */
+    private String campusName;
+
+    /**
+     * 宿舍区域ID
+     */
+    private Long areaId;
+
+    /**
+     * 宿舍区域名称
+     */
+    private String areaName;
+
+    /**
+     * 宿舍楼ID
+     */
+    private Long buildingId;
+
+    /**
+     * 宿舍楼名称
+     */
+    private String buildingName;
+
+    /**
+     * 宿舍房间ID
+     */
+    private Long roomId;
+
+    /**
+     * 房间名称
+     */
+    private String roomName;
+
+    /**
+     * 床位ID
+     */
+    private Long bedId;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 违纪类型
+     */
+    private String violationType;
+
+    /**
+     * 违纪等级:1轻微 2一般 3严重 4特别严重
+     */
+    private String violationLevel;
+
+    /**
+     * 违纪发生时间
+     */
+    private Date violationTime;
+
+    /**
+     * 违纪行为描述
+     */
+    private String violationDescription;
+
+    /**
+     * 涉及其他学生id(逗号分隔)
+     */
+    private String involvedStudents;
+
+    /**
+     * 附件OSS ID列表(逗号分隔)
+     */
+    private String attachmentOssIds;
+
+    /**
+     * 删除标志(0代表存在 1代表删除)
+     */
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 178 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/bo/XgDormViolationBo.java

@@ -0,0 +1,178 @@
+package org.dromara.xg.domain.bo;
+
+import org.dromara.xg.domain.XgDormViolation;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * 宿舍违纪记录业务对象 xg_dorm_violation
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = XgDormViolation.class, reverseConvertGenerate = false)
+public class XgDormViolationBo extends BaseEntity {
+
+    /**
+     * 违纪记录ID(主键)
+     */
+    @NotNull(message = "违纪记录ID(主键)不能为空", groups = { EditGroup.class })
+    private Long id;
+
+    /**
+     * 学生ID
+     */
+    @NotNull(message = "学生ID不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long studentId;
+
+    /**
+     * 学生姓名
+     */
+    @NotBlank(message = "学生姓名不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String studentName;
+
+    /**
+     * 学号
+     */
+    @NotBlank(message = "学号不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String studentNo;
+
+    /**
+     * 学院ID
+     */
+    private Long collegeId;
+
+    /**
+     * 学院名称
+     */
+    private String collegeName;
+
+    /**
+     * 专业ID
+     */
+    private Long majorId;
+
+    /**
+     * 专业名称
+     */
+    private String majorName;
+
+    /**
+     * 班级ID
+     */
+    private Long classId;
+
+    /**
+     * 班级名称
+     */
+    private String className;
+
+    /**
+     * 校区ID
+     */
+    private Long campusId;
+
+    /**
+     * 校区名称
+     */
+    private String campusName;
+
+    /**
+     * 宿舍区域ID
+     */
+    private Long areaId;
+
+    /**
+     * 宿舍区域名称
+     */
+    private String areaName;
+
+    /**
+     * 宿舍楼ID
+     */
+    @NotNull(message = "宿舍楼ID不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long buildingId;
+
+    /**
+     * 宿舍楼名称
+     */
+    @NotBlank(message = "宿舍楼名称不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String buildingName;
+
+    /**
+     * 宿舍房间ID
+     */
+    @NotNull(message = "宿舍房间ID不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long roomId;
+
+    /**
+     * 房间名称
+     */
+    @NotBlank(message = "房间名称不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String roomName;
+
+    /**
+     * 床位ID
+     */
+    private Long bedId;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 违纪类型
+     */
+    @NotBlank(message = "违纪类型不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String violationType;
+
+    /**
+     * 违纪等级:1轻微 2一般 3严重 4特别严重
+     */
+    @NotBlank(message = "违纪等级:1轻微 2一般 3严重 4特别严重不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String violationLevel;
+
+    /**
+     * 违纪发生时间
+     */
+    @NotNull(message = "违纪发生时间不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Date violationTime;
+
+    /**
+     * 违纪行为描述
+     */
+    @NotBlank(message = "违纪行为描述不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String violationDescription;
+
+    /**
+     * 涉及其他学生id(逗号分隔)
+     */
+    private String involvedStudents;
+
+    /**
+     * 附件OSS ID列表(逗号分隔)
+     */
+    private String attachmentOssIds;
+
+    /**
+     * 删除标志(0代表存在 1代表删除)
+     */
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 208 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/vo/XgDormViolationVo.java

@@ -0,0 +1,208 @@
+package org.dromara.xg.domain.vo;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.dromara.xg.domain.XgDormViolation;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 宿舍违纪记录视图对象 xg_dorm_violation
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = XgDormViolation.class)
+public class XgDormViolationVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 违纪记录ID(主键)
+     */
+    @ExcelProperty(value = "违纪记录ID", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "主=键")
+    private Long id;
+
+    /**
+     * 学生ID
+     */
+    @ExcelProperty(value = "学生ID")
+    private Long studentId;
+
+    /**
+     * 学生姓名
+     */
+    @ExcelProperty(value = "学生姓名")
+    private String studentName;
+
+    /**
+     * 学号
+     */
+    @ExcelProperty(value = "学号")
+    private String studentNo;
+
+    /**
+     * 学院ID
+     */
+    @ExcelProperty(value = "学院ID")
+    private Long collegeId;
+
+    /**
+     * 学院名称
+     */
+    @ExcelProperty(value = "学院名称")
+    private String collegeName;
+
+    /**
+     * 专业ID
+     */
+    @ExcelProperty(value = "专业ID")
+    private Long majorId;
+
+    /**
+     * 专业名称
+     */
+    @ExcelProperty(value = "专业名称")
+    private String majorName;
+
+    /**
+     * 班级ID
+     */
+    @ExcelProperty(value = "班级ID")
+    private Long classId;
+
+    /**
+     * 班级名称
+     */
+    @ExcelProperty(value = "班级名称")
+    private String className;
+
+    /**
+     * 校区ID
+     */
+    @ExcelProperty(value = "校区ID")
+    private Long campusId;
+
+    /**
+     * 校区名称
+     */
+    @ExcelProperty(value = "校区名称")
+    private String campusName;
+
+    /**
+     * 宿舍区域ID
+     */
+    @ExcelProperty(value = "宿舍区域ID")
+    private Long areaId;
+
+    /**
+     * 宿舍区域名称
+     */
+    @ExcelProperty(value = "宿舍区域名称")
+    private String areaName;
+
+    /**
+     * 宿舍楼ID
+     */
+    @ExcelProperty(value = "宿舍楼ID")
+    private Long buildingId;
+
+    /**
+     * 宿舍楼名称
+     */
+    @ExcelProperty(value = "宿舍楼名称")
+    private String buildingName;
+
+    /**
+     * 宿舍房间ID
+     */
+    @ExcelProperty(value = "宿舍房间ID")
+    private Long roomId;
+
+    /**
+     * 房间名称
+     */
+    @ExcelProperty(value = "房间名称")
+    private String roomName;
+
+    /**
+     * 床位ID
+     */
+    @ExcelProperty(value = "床位ID")
+    private Long bedId;
+
+    /**
+     * 床位名称
+     */
+    @ExcelProperty(value = "床位名称")
+    private String bedName;
+
+    /**
+     * 违纪类型
+     */
+    @ExcelProperty(value = "违纪类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "dorm_violation_type")
+    private String violationType;
+
+    /**
+     * 违纪等级:1轻微 2一般 3严重 4特别严重
+     */
+    @ExcelProperty(value = "违纪等级:1轻微 2一般 3严重 4特别严重", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "dorm_violation_level")
+    private String violationLevel;
+
+    /**
+     * 违纪发生时间
+     */
+    @ExcelProperty(value = "违纪发生时间")
+    private Date violationTime;
+
+    /**
+     * 违纪行为描述
+     */
+    @ExcelProperty(value = "违纪行为描述")
+    private String violationDescription;
+
+    /**
+     * 涉及其他学生id(逗号分隔)
+     */
+    @ExcelProperty(value = "涉及其他学生id", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "逗=号分隔")
+    private String involvedStudents;
+
+    /**
+     * 附件OSS ID列表(逗号分隔)
+     */
+    @ExcelProperty(value = "附件OSS ID列表", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "逗=号分隔")
+    private String attachmentOssIds;
+
+    /**
+     * 删除标志(0代表存在 1代表删除)
+     */
+    @ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=代表存在,1=代表删除")
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+
+}

+ 15 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/mapper/XgDormViolationMapper.java

@@ -0,0 +1,15 @@
+package org.dromara.xg.mapper;
+
+import org.dromara.xg.domain.XgDormViolation;
+import org.dromara.xg.domain.vo.XgDormViolationVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+/**
+ * 宿舍违纪记录Mapper接口
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+public interface XgDormViolationMapper extends BaseMapperPlus<XgDormViolation, XgDormViolationVo> {
+
+}

+ 68 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/IXgDormViolationService.java

@@ -0,0 +1,68 @@
+package org.dromara.xg.service;
+
+import org.dromara.xg.domain.vo.XgDormViolationVo;
+import org.dromara.xg.domain.bo.XgDormViolationBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 宿舍违纪记录Service接口
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+public interface IXgDormViolationService {
+
+    /**
+     * 查询宿舍违纪记录
+     *
+     * @param id 主键
+     * @return 宿舍违纪记录
+     */
+    XgDormViolationVo queryById(Long id);
+
+    /**
+     * 分页查询宿舍违纪记录列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 宿舍违纪记录分页列表
+     */
+    TableDataInfo<XgDormViolationVo> queryPageList(XgDormViolationBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的宿舍违纪记录列表
+     *
+     * @param bo 查询条件
+     * @return 宿舍违纪记录列表
+     */
+    List<XgDormViolationVo> queryList(XgDormViolationBo bo);
+
+    /**
+     * 新增宿舍违纪记录
+     *
+     * @param bo 宿舍违纪记录
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(XgDormViolationBo bo);
+
+    /**
+     * 修改宿舍违纪记录
+     *
+     * @param bo 宿舍违纪记录
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(XgDormViolationBo bo);
+
+    /**
+     * 校验并批量删除宿舍违纪记录信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 157 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgDormViolationServiceImpl.java

@@ -0,0 +1,157 @@
+package org.dromara.xg.service.impl;
+
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.dromara.xg.domain.bo.XgDormViolationBo;
+import org.dromara.xg.domain.vo.XgDormViolationVo;
+import org.dromara.xg.domain.XgDormViolation;
+import org.dromara.xg.mapper.XgDormViolationMapper;
+import org.dromara.xg.service.IXgDormViolationService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 宿舍违纪记录Service业务层处理
+ *
+ * @author zlwu
+ * @date 2025-08-16
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class XgDormViolationServiceImpl implements IXgDormViolationService {
+
+    private final XgDormViolationMapper baseMapper;
+
+    /**
+     * 查询宿舍违纪记录
+     *
+     * @param id 主键
+     * @return 宿舍违纪记录
+     */
+    @Override
+    public XgDormViolationVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询宿舍违纪记录列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 宿舍违纪记录分页列表
+     */
+    @Override
+    public TableDataInfo<XgDormViolationVo> queryPageList(XgDormViolationBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<XgDormViolation> lqw = buildQueryWrapper(bo);
+        Page<XgDormViolationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的宿舍违纪记录列表
+     *
+     * @param bo 查询条件
+     * @return 宿舍违纪记录列表
+     */
+    @Override
+    public List<XgDormViolationVo> queryList(XgDormViolationBo bo) {
+        LambdaQueryWrapper<XgDormViolation> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<XgDormViolation> buildQueryWrapper(XgDormViolationBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<XgDormViolation> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(XgDormViolation::getId);
+        lqw.eq(bo.getStudentId() != null, XgDormViolation::getStudentId, bo.getStudentId());
+        lqw.like(StringUtils.isNotBlank(bo.getStudentName()), XgDormViolation::getStudentName, bo.getStudentName());
+        lqw.like(StringUtils.isNotBlank(bo.getStudentNo()), XgDormViolation::getStudentNo, bo.getStudentNo());
+        lqw.eq(bo.getCollegeId() != null, XgDormViolation::getCollegeId, bo.getCollegeId());
+        lqw.like(StringUtils.isNotBlank(bo.getCollegeName()), XgDormViolation::getCollegeName, bo.getCollegeName());
+        lqw.eq(bo.getMajorId() != null, XgDormViolation::getMajorId, bo.getMajorId());
+        lqw.like(StringUtils.isNotBlank(bo.getMajorName()), XgDormViolation::getMajorName, bo.getMajorName());
+        lqw.eq(bo.getClassId() != null, XgDormViolation::getClassId, bo.getClassId());
+        lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgDormViolation::getClassName, bo.getClassName());
+        lqw.eq(bo.getCampusId() != null, XgDormViolation::getCampusId, bo.getCampusId());
+        lqw.like(StringUtils.isNotBlank(bo.getCampusName()), XgDormViolation::getCampusName, bo.getCampusName());
+        lqw.eq(bo.getAreaId() != null, XgDormViolation::getAreaId, bo.getAreaId());
+        lqw.like(StringUtils.isNotBlank(bo.getAreaName()), XgDormViolation::getAreaName, bo.getAreaName());
+        lqw.eq(bo.getBuildingId() != null, XgDormViolation::getBuildingId, bo.getBuildingId());
+        lqw.like(StringUtils.isNotBlank(bo.getBuildingName()), XgDormViolation::getBuildingName, bo.getBuildingName());
+        lqw.eq(bo.getRoomId() != null, XgDormViolation::getRoomId, bo.getRoomId());
+        lqw.like(StringUtils.isNotBlank(bo.getRoomName()), XgDormViolation::getRoomName, bo.getRoomName());
+        lqw.eq(bo.getBedId() != null, XgDormViolation::getBedId, bo.getBedId());
+        lqw.like(StringUtils.isNotBlank(bo.getBedName()), XgDormViolation::getBedName, bo.getBedName());
+        lqw.eq(StringUtils.isNotBlank(bo.getViolationType()), XgDormViolation::getViolationType, bo.getViolationType());
+        lqw.eq(StringUtils.isNotBlank(bo.getViolationLevel()), XgDormViolation::getViolationLevel, bo.getViolationLevel());
+        lqw.eq(bo.getViolationTime() != null, XgDormViolation::getViolationTime, bo.getViolationTime());
+        lqw.like(StringUtils.isNotBlank(bo.getViolationDescription()), XgDormViolation::getViolationDescription, bo.getViolationDescription());
+        lqw.like(StringUtils.isNotBlank(bo.getInvolvedStudents()), XgDormViolation::getInvolvedStudents, bo.getInvolvedStudents());
+        lqw.like(StringUtils.isNotBlank(bo.getAttachmentOssIds()), XgDormViolation::getAttachmentOssIds, bo.getAttachmentOssIds());
+        lqw.eq(StringUtils.isNotBlank(bo.getDeleted()), XgDormViolation::getDeleted, bo.getDeleted());
+        return lqw;
+    }
+
+    /**
+     * 新增宿舍违纪记录
+     *
+     * @param bo 宿舍违纪记录
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(XgDormViolationBo bo) {
+        XgDormViolation add = MapstructUtils.convert(bo, XgDormViolation.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改宿舍违纪记录
+     *
+     * @param bo 宿舍违纪记录
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(XgDormViolationBo bo) {
+        XgDormViolation update = MapstructUtils.convert(bo, XgDormViolation.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(XgDormViolation entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除宿舍违纪记录信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

+ 7 - 0
backend/ruoyi-modules/ruoyi-xg/src/main/resources/mapper/dormViolation/XgDormViolationMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.dromara.xg.mapper.XgDormViolationMapper">
+
+</mapper>

+ 65 - 0
docs/设计文档/database/学工管理-宿舍管理/宿舍违纪管理数据字典配置.sql

@@ -0,0 +1,65 @@
+-- 宿舍违纪记录管理数据字典配置脚本(超简化版)
+-- 来源:宿舍违纪记录数据模型设计
+-- 用途:配置宿舍违纪记录模块所需的数据字典项(仅主表相关字典)
+-- 维护人:数据库设计团队
+-- 日期:2025-01-28
+
+-- =============================================================================
+-- 1. 违纪类型字典
+-- =============================================================================
+INSERT INTO sys_dict_type (dict_id, tenant_id, dict_name, dict_type, create_dept, create_by, create_time, update_by, update_time, remark)
+VALUES (NEXT VALUE FOR sys_dict_type_seq, '000000', '宿舍违纪类型', 'dorm_violation_type', 103, 1, NOW(), 1, NOW(), '宿舍违纪类型分类');
+
+INSERT INTO sys_dict_data (dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, create_dept, create_by, create_time, update_by, update_time, remark)
+VALUES
+-- 卫生违纪类
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 1, '垃圾乱扔', 'WS001001', 'dorm_violation_type', '', 'warning', 'N', 103, 1, NOW(), 1, NOW(), '在宿舍内外乱扔垃圾'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 2, '床铺不整', 'WS001002', 'dorm_violation_type', '', 'warning', 'N', 103, 1, NOW(), 1, NOW(), '床铺整理不规范'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 3, '物品摆放混乱', 'WS001003', 'dorm_violation_type', '', 'warning', 'N', 103, 1, NOW(), 1, NOW(), '个人物品摆放不规范'),
+
+-- 纪律违纪类
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 11, '晚归违纪', 'JL001001', 'dorm_violation_type', '', 'info', 'N', 103, 1, NOW(), 1, NOW(), '超过规定时间归宿'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 12, '噪音扰民', 'JL001002', 'dorm_violation_type', '', 'info', 'N', 103, 1, NOW(), 1, NOW(), '在休息时间制造噪音'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 13, '夜不归宿', 'JL001003', 'dorm_violation_type', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '整夜未在宿舍住宿'),
+
+-- 安全违纪类
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 21, '违规用电', 'AQ001001', 'dorm_violation_type', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '使用违规电器或私拉电线'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 22, '吸烟违纪', 'AQ001002', 'dorm_violation_type', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '在宿舍内吸烟'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 23, '明火使用', 'AQ001003', 'dorm_violation_type', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '在宿舍内使用明火'),
+
+-- 物品违纪类
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 31, '损坏公物', 'WP001001', 'dorm_violation_type', '', 'primary', 'N', 103, 1, NOW(), 1, NOW(), '故意或过失损坏公共物品'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 32, '私改设施', 'WP001002', 'dorm_violation_type', '', 'primary', 'N', 103, 1, NOW(), 1, NOW(), '私自改动宿舍设施'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 33, '盗用他人物品', 'WP001003', 'dorm_violation_type', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '盗用或损坏他人物品');
+
+-- =============================================================================
+-- 2. 违纪等级字典
+-- =============================================================================
+INSERT INTO sys_dict_type (dict_id, tenant_id, dict_name, dict_type, create_dept, create_by, create_time, update_by, update_time, remark)
+VALUES (NEXT VALUE FOR sys_dict_type_seq, '000000', '违纪等级', 'dorm_violation_level', 103, 1, NOW(), 1, NOW(), '宿舍违纪等级分类');
+
+INSERT INTO sys_dict_data (dict_code, tenant_id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, create_dept, create_by, create_time, update_by, update_time, remark)
+VALUES
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 1, '轻微', '1', 'dorm_violation_level', '', 'success', 'Y', 103, 1, NOW(), 1, NOW(), '轻微违纪'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 2, '一般', '2', 'dorm_violation_level', '', 'warning', 'N', 103, 1, NOW(), 1, NOW(), '一般违纪'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 3, '严重', '3', 'dorm_violation_level', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '严重违纪'),
+(NEXT VALUE FOR sys_dict_data_seq, '000000', 4, '特别严重', '4', 'dorm_violation_level', '', 'danger', 'N', 103, 1, NOW(), 1, NOW(), '特别严重违纪');
+
+-- =============================================================================
+-- 数据字典配置完成提示
+-- =============================================================================
+-- 宿舍违纪记录管理数据字典配置脚本执行完成(超简化版)
+-- 包含字典类型:
+-- 1. dorm_violation_type - 宿舍违纪类型(12个违纪类型)
+-- 2. dorm_violation_level - 违纪等级(4个等级)
+--
+-- 功能特点:
+-- 1. 超级简化设计,仅保留核心字典
+-- 2. 违纪类型使用字典管理,无需单独表
+-- 3. 附件使用OSS ID存储,无需附件类型字典
+-- 4. 移除了处罚、审核、累计等复杂字典
+--
+-- 注意事项:
+-- 1. 违纪类型编码采用分类前缀(WS卫生、JL纪律、AQ安全、WP物品)
+-- 2. 所有字典数据采用项目统一规范
+-- 3. 专注于记录功能,大幅简化了数据字典结构

+ 96 - 0
docs/设计文档/database/学工管理-宿舍管理/宿舍违纪管理数据库建表脚本.sql

@@ -0,0 +1,96 @@
+-- 宿舍违纪记录管理数据库建表脚本(超简化版)
+-- 来源:宿舍违纪记录数据模型设计
+-- 用途:创建宿舍违纪记录管理所需的数据库表(仅主表)
+-- 维护人:数据库设计团队
+-- 日期:2025-01-28
+
+-- =============================================================================
+-- 1. 宿舍违纪记录表 (xg_dorm_violation) - 唯一核心表
+-- =============================================================================
+DROP TABLE IF EXISTS `xg_dorm_violation`;
+CREATE TABLE `xg_dorm_violation` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '违纪记录ID(主键)',
+
+  -- 学生信息(冗余存储,提高查询性能)
+  `student_id` bigint(20) NOT NULL COMMENT '学生ID',
+  `student_name` varchar(100) NOT NULL COMMENT '学生姓名',
+  `student_no` varchar(50) NOT NULL COMMENT '学号',
+  `college_id` bigint(20) DEFAULT NULL COMMENT '学院ID',
+  `college_name` varchar(100) DEFAULT NULL COMMENT '学院名称',
+  `major_id` bigint(20) DEFAULT NULL COMMENT '专业ID',
+  `major_name` varchar(100) DEFAULT NULL COMMENT '专业名称',
+  `class_id` bigint(20) DEFAULT NULL COMMENT '班级ID',
+  `class_name` varchar(100) DEFAULT NULL COMMENT '班级名称',
+
+  -- 宿舍位置信息(复用现有宿舍管理结构)
+  `campus_id` bigint(20) DEFAULT NULL COMMENT '校区ID',
+  `campus_name` varchar(100) DEFAULT NULL COMMENT '校区名称',
+  `area_id` bigint(20) DEFAULT NULL COMMENT '宿舍区域ID',
+  `area_name` varchar(100) DEFAULT NULL COMMENT '宿舍区域名称',
+  `building_id` bigint(20) NOT NULL COMMENT '宿舍楼ID',
+  `building_name` varchar(100) NOT NULL COMMENT '宿舍楼名称',
+  `room_id` bigint(20) NOT NULL COMMENT '宿舍房间ID',
+  `room_name` varchar(50) NOT NULL COMMENT '房间名称',
+  `bed_id` bigint(20) DEFAULT NULL COMMENT '床位ID',
+  `bed_name` varchar(20) DEFAULT NULL COMMENT '床位名称',
+
+  -- 违纪基本信息
+  `violation_type` varchar(50) NOT NULL COMMENT '违纪类型',
+  `violation_level` char(1) NOT NULL COMMENT '违纪等级:1轻微 2一般 3严重 4特别严重',
+  `violation_time` datetime NOT NULL COMMENT '违纪发生时间',
+  `violation_description` text NOT NULL COMMENT '违纪行为描述',
+
+  -- 附加信息
+  `involved_students` text DEFAULT NULL COMMENT '涉及其他学生信息(JSON格式)',
+  -- 附件信息(OSS存储)
+  `attachment_oss_ids` text DEFAULT NULL COMMENT '附件OSS ID列表(逗号分隔)',
+
+  -- 系统字段
+  `deleted` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
+  `tenant_id` varchar(20) DEFAULT '000000' COMMENT '租户编号',
+  `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
+  `create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+  `update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
+
+  PRIMARY KEY (`id`),
+  KEY `idx_student_id` (`student_id`),
+  KEY `idx_student_no` (`student_no`),
+  KEY `idx_college_id` (`college_id`),
+  KEY `idx_building_id` (`building_id`),
+  KEY `idx_room_id` (`room_id`),
+  KEY `idx_violation_type` (`violation_type`),
+  KEY `idx_violation_time` (`violation_time`),
+  KEY `idx_violation_level` (`violation_level`),
+  KEY `idx_tenant_id` (`tenant_id`),
+  KEY `idx_deleted` (`deleted`),
+
+  -- 复合索引(统计查询优化)
+  KEY `idx_college_time` (`college_id`, `violation_time`),
+  KEY `idx_building_level` (`building_id`, `violation_level`),
+  KEY `idx_student_time` (`student_id`, `violation_time`),
+  KEY `idx_type_level` (`violation_type`, `violation_level`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='宿舍违纪记录表';
+
+-- =============================================================================
+-- 数据库建表脚本执行完成提示
+-- =============================================================================
+-- 宿舍违纪记录管理数据库建表脚本执行完成(超简化版)
+-- 
+-- 创建表:
+-- 1. xg_dorm_violation - 宿舍违纪记录主表(包含所有核心功能)
+-- 
+-- 设计特点:
+-- 1. 单表设计,降低复杂度
+-- 2. 违纪类型使用字典管理
+-- 3. 附件使用OSS ID存储
+-- 4. 冗余存储关键信息,提高查询性能
+-- 5. 完整的索引设计,支持高效查询和统计
+-- 
+-- 注意事项:
+-- 1. 违纪类型使用sys_dict_data表管理
+-- 2. 附件OSS ID使用逗号分隔存储
+-- 3. 所有字段遵循项目统一规范
+-- 4. 支持多租户和逻辑删除 

+ 363 - 0
docs/设计文档/database/学工管理-宿舍管理/宿舍违纪管理数据模型设计.md

@@ -0,0 +1,363 @@
+# 宿舍违纪记录管理数据模型设计文档(超简化版)
+
+## 📋 文档信息
+
+| 项目 | 信息 |
+|------|------|
+| **项目名称** | 校园管理系统 - 宿舍违纪记录管理模块 |
+| **数据库版本** | MySQL 8.0+ |
+| **文档版本** | V2.0.0(超简化版) |
+| **创建时间** | 2025-01-28 |
+| **创建人员** | 数据库设计团队 |
+| **审核状态** | 待审核 |
+
+## 🎯 设计目标
+
+### 核心目标
+- 建立最简化的宿舍违纪记录管理系统
+- 使用单表存储所有核心数据,降低系统复杂度
+- 违纪类型通过字典管理,便于维护和扩展
+- 附件通过OSS ID字符串存储,简化文件管理
+
+### 设计原则
+- **极简设计**:单表设计,减少表关联复杂度
+- **字典驱动**:违纪类型使用系统字典管理
+- **OSS存储**:附件使用阿里云OSS,表中仅存储ID
+- **查询优化**:通过索引设计支持高效查询和统计
+- **性能第一**:冗余存储关键信息,避免复杂JOIN
+
+## 🗄️ 数据库表设计
+
+### 唯一核心表
+
+#### 宿舍违纪记录表 (xg_dorm_violation)
+**表说明**:违纪记录管理的唯一核心表,包含所有功能
+
+**核心字段组**:
+
+##### 📊 学生信息(冗余存储)
+- **student_id**, **student_name**, **student_no**:学生基本信息
+- **college_id**, **college_name**:学院信息
+- **class_id**, **class_name**:班级信息
+
+##### 🏠 宿舍位置信息(充分复用现有结构)
+- **campus_id**, **campus_name**:校区信息
+- **area_id**, **area_name**:宿舍区域信息
+- **building_id**, **building_name**:宿舍楼信息(必填)
+- **room_id**, **room_no**:房间信息(必填)
+- **bed_id**, **bed_no**:床位信息
+
+##### 🚨 违纪基本信息
+- **violation_type_dict**:违纪类型(字典值,如WS001001)
+- **violation_level**:违纪等级(1轻微 2一般 3严重 4特别严重)
+- **violation_time**:违纪发生时间
+- **violation_description**:违纪行为描述
+- **violation_location**:违纪具体位置
+
+##### 🔍 发现信息
+- **discoverer_type**:发现人类型(1宿管员 2学生 3巡查员 4其他)
+- **discoverer_id**, **discoverer_name**:发现人信息
+- **discovery_method**:发现方式(1日常检查 2举报 3巡查 4其他)
+- **discovery_time**:发现时间
+
+##### 📋 记录状态和评分
+- **record_status**:记录状态(1已记录 2已确认 3已归档)
+- **severity_score**:严重程度评分(0-100)
+- **is_repeat**, **repeat_count**:重复违纪信息
+
+##### 📎 附件信息(OSS存储)
+- **attachment_oss_ids**:附件OSS ID列表(逗号分隔字符串)
+- **attachment_count**:附件数量
+
+**设计特点**:
+- **单表设计**:所有功能集中在一张表,减少复杂度
+- **冗余存储**:关键信息冗余存储,避免复杂JOIN查询
+- **字典管理**:违纪类型使用系统字典,便于维护
+- **OSS集成**:附件使用阿里云OSS存储,表中仅存ID
+- **索引优化**:完整的索引设计,支持高效查询
+
+### 🔗 与现有系统的关系
+
+#### 宿舍管理系统集成
+违纪记录管理充分复用现有宿舍管理数据结构:
+
+```sql
+-- 关联关系(查询时关联,表结构独立)
+xg_dorm_violation.campus_id -> xg_dorm_campus.id
+xg_dorm_violation.area_id -> xg_dorm_area.id  
+xg_dorm_violation.building_id -> xg_dorm_building.id
+xg_dorm_violation.room_id -> xg_dorm_room.id
+xg_dorm_violation.bed_id -> xg_dorm_bed.id
+xg_dorm_violation.student_id -> xg_dorm_bed_student.student_id
+```
+
+#### 系统字典集成
+违纪类型通过系统字典管理:
+
+```sql
+-- 字典关联
+xg_dorm_violation.violation_type_dict -> sys_dict_data.dict_value
+-- 其中 dict_type = 'dorm_violation_type'
+```
+
+#### 用户系统集成
+发现人和处理人信息关联:
+
+```sql
+-- 关联关系
+xg_dorm_violation.discoverer_id -> sys_user.user_id
+xg_dorm_violation.handler_id -> sys_user.user_id
+```
+
+## 📊 索引设计
+
+### 1. 基础查询索引
+```sql
+-- 核心查询索引
+KEY `idx_student_id` (`student_id`)           -- 按学生查询
+KEY `idx_student_no` (`student_no`)           -- 按学号查询  
+KEY `idx_college_id` (`college_id`)           -- 按学院查询
+KEY `idx_building_id` (`building_id`)         -- 按宿舍楼查询
+KEY `idx_room_id` (`room_id`)                 -- 按房间查询
+KEY `idx_violation_type` (`violation_type_dict`) -- 按违纪类型查询
+KEY `idx_violation_time` (`violation_time`)   -- 按违纪时间查询
+KEY `idx_record_status` (`record_status`)     -- 按记录状态查询
+KEY `idx_violation_level` (`violation_level`) -- 按违纪等级查询
+KEY `idx_is_repeat` (`is_repeat`)             -- 按重复违纪查询
+```
+
+### 2. 复合索引(统计优化)
+```sql
+-- 统计分析优化索引
+KEY `idx_college_time` (`college_id`, `violation_time`)
+KEY `idx_building_level` (`building_id`, `violation_level`)
+KEY `idx_student_time` (`student_id`, `violation_time`)
+KEY `idx_type_level` (`violation_type_dict`, `violation_level`)
+KEY `idx_status_time` (`record_status`, `create_time`)
+```
+
+## 📈 业务逻辑设计
+
+### 1. 违纪类型字典管理
+```sql
+-- 违纪类型编码规则
+WS001001 - 垃圾乱扔(卫生类)
+JL001001 - 晚归违纪(纪律类)  
+AQ001001 - 违规用电(安全类)
+WP001001 - 损坏公物(物品类)
+
+-- 编码格式:分类前缀 + 6位数字
+-- WS: 卫生违纪, JL: 纪律违纪, AQ: 安全违纪, WP: 物品违纪
+```
+
+### 2. 附件OSS存储
+```sql
+-- 附件ID存储格式
+attachment_oss_ids = "oss_id_1,oss_id_2,oss_id_3"
+
+-- 解析方式
+String[] ossIds = attachmentOssIds.split(",");
+```
+
+### 3. 违纪等级评分机制
+```sql
+-- 违纪等级与评分对应
+'1' (轻微): 0-20分
+'2' (一般): 21-40分  
+'3' (严重): 41-70分
+'4' (特别严重): 71-100分
+```
+
+### 4. 记录状态流转
+```sql
+-- 简化状态流转
+'1' (已记录) -> '2' (已确认) -> '3' (已归档)
+```
+
+### 5. 重复违纪检测
+```sql
+-- 检测逻辑
+同一学生 + 相同违纪类型 + 时间窗口内 = 重复违纪
+时间窗口: 当前学期或最近6个月
+```
+
+## 📋 数据字典
+
+### 核心字典类型(5个)
+
+| 字典类型 | 字典名称 | 说明 |
+|---------|---------|------|
+| dorm_violation_type | 宿舍违纪类型 | 12种违纪类型,按分类前缀编码 |
+| dorm_violation_level | 违纪等级 | 轻微、一般、严重、特别严重 |
+| dorm_discoverer_type | 发现人类型 | 宿管员、学生、巡查员、其他 |
+| dorm_discovery_method | 发现方式 | 日常检查、举报、巡查、其他 |
+| dorm_record_status | 违纪记录状态 | 已记录、已确认、已归档 |
+
+### 违纪类型详细清单
+
+#### 🧹 卫生违纪类(WS)
+- **WS001001** - 垃圾乱扔:在宿舍内外乱扔垃圾
+- **WS001002** - 床铺不整:床铺整理不规范
+- **WS001003** - 物品摆放混乱:个人物品摆放不规范
+
+#### ⏰ 纪律违纪类(JL)
+- **JL001001** - 晚归违纪:超过规定时间归宿
+- **JL001002** - 噪音扰民:在休息时间制造噪音
+- **JL001003** - 夜不归宿:整夜未在宿舍住宿
+
+#### ⚠️ 安全违纪类(AQ)
+- **AQ001001** - 违规用电:使用违规电器或私拉电线
+- **AQ001002** - 吸烟违纪:在宿舍内吸烟
+- **AQ001003** - 明火使用:在宿舍内使用明火
+
+#### 🛠️ 物品违纪类(WP)
+- **WP001001** - 损坏公物:故意或过失损坏公共物品
+- **WP001002** - 私改设施:私自改动宿舍设施
+- **WP001003** - 盗用他人物品:盗用或损坏他人物品
+
+## 🚀 性能优化
+
+### 1. 查询优化策略
+- **索引覆盖**:主要查询字段都有对应索引
+- **复合索引**:统计查询使用复合索引优化
+- **冗余字段**:避免复杂JOIN,直接查询单表
+- **分页优化**:使用limit offset优化大数据量查询
+
+### 2. 存储优化策略
+- **OSS集成**:附件文件外部存储,减轻数据库压力
+- **字符串存储**:附件ID使用逗号分隔,简化存储结构
+- **数据压缩**:JSON格式存储复杂字段(如涉及其他学生信息)
+
+### 3. 缓存策略
+- **字典缓存**:违纪类型等字典数据Redis缓存
+- **热点数据**:常用查询结果缓存
+- **统计缓存**:定时更新统计数据缓存
+
+## 📊 统计分析功能
+
+### 1. 基础统计
+- 按时间段的违纪记录统计
+- 按学院、宿舍楼的违纪分布
+- 按违纪类型的频次统计
+- 违纪等级分布分析
+
+### 2. 趋势分析
+- 违纪记录的时间趋势
+- 重复违纪学生识别
+- 违纪热点区域分析
+- 违纪类型变化趋势
+
+### 3. 对比分析
+- 不同学院违纪情况对比
+- 不同宿舍楼违纪率对比
+- 不同时间段违纪情况对比
+
+## 🔒 数据安全设计
+
+### 1. 敏感信息保护
+- 学生身份信息的访问权限控制
+- 违纪记录的查看权限分级
+- OSS附件的安全访问控制
+
+### 2. 审计追踪
+- 完整的操作日志记录
+- 数据变更的版本追踪
+
+### 3. 数据备份
+- 违纪记录的定期备份
+- OSS附件的安全存储
+- 历史数据的归档管理
+
+## 📝 变更记录
+
+| 版本 | 日期 | 变更内容 | 变更人 |
+|------|------|----------|--------|
+| V2.0.0 | 2025-01-28 | 超简化版设计:单表设计,违纪类型使用字典,附件使用OSS ID | 数据库设计团队 |
+| V1.0.0 | 2025-01-28 | 简化版初始创建,专注违纪记录功能,移除处罚和审核模块 | 数据库设计团队 |
+
+## 📄 相关文档
+
+| 文档名称 | 文档路径 | 说明 |
+|---------|---------|------|
+| 建表脚本 | `宿舍违纪管理数据库建表脚本.sql` | 超简化版数据库建表SQL(仅1张表) |
+| 数据字典 | `宿舍违纪管理数据字典配置.sql` | 超简化版字典配置(5个字典类型) |
+| 宿舍管理设计 | `宿舍管理数据库设计.md` | 现有宿舍管理数据模型 |
+| 数据库规范 | `../mysql-database-standard.md` | 项目数据库设计规范 |
+
+## 🎯 功能特点
+
+### 1. 超简化设计理念
+- **单表设计**:所有功能集中在一张表,极大降低复杂度
+- **字典驱动**:违纪类型通过系统字典管理,便于维护和扩展
+- **OSS集成**:附件使用云存储,表中仅存储ID,简化文件管理
+- **性能优先**:通过冗余存储避免复杂关联查询
+
+### 2. 核心功能
+- 违纪记录的增删改查
+- 违纪类型的字典化管理
+- 重复违纪的自动检测
+- 附件文件的OSS存储管理
+- 多维度的统计分析
+
+### 3. 系统集成
+- 充分复用现有宿舍管理数据结构
+- 与用户管理系统无缝集成
+- 与系统字典管理完美融合
+- 遵循项目统一的数据库设计规范
+
+## 🎯 技术优势
+
+### 1. 开发效率
+- **单表操作**:减少复杂的多表关联查询
+- **字典管理**:违纪类型维护简单,无需修改表结构
+- **OSS集成**:文件管理交给专业云服务,简化开发
+
+### 2. 运维效率
+- **部署简单**:只需创建一张表和几个字典
+- **维护容易**:数据结构简单,问题排查快速
+- **扩展灵活**:新增违纪类型只需添加字典项
+
+### 3. 性能优势
+- **查询高效**:单表查询,避免复杂JOIN
+- **索引优化**:针对性的索引设计,支持高效统计
+- **存储优化**:大文件外部存储,减轻数据库压力
+
+## 🎯 后续扩展
+
+### 1. 功能扩展方向
+- 违纪预警和风险评估
+- 违纪数据的智能分析
+- 与学生综合评价系统的集成
+- 移动端违纪上报功能
+
+### 2. 性能扩展方向
+- 大数据量的分表策略
+- 实时统计和报表功能
+- 违纪图片的AI识别功能
+- 多校区数据的同步机制
+
+### 3. 管理扩展方向
+- 违纪数据的导出功能
+- 与家长通知系统的对接(如需要)
+- 违纪数据的开放API接口
+- 历史数据的分析报告生成
+
+## 💡 使用建议
+
+### 1. 开发建议
+- 使用单表DAO模式,简化数据访问层
+- 违纪类型从字典缓存中获取,提高性能
+- 附件上传直接到OSS,异步更新记录表
+- 统计查询优先使用复合索引
+
+### 2. 维护建议
+- 定期清理OSS中的孤立文件
+- 监控单表数据量,适时进行数据归档
+- 定期更新字典缓存,保持数据一致性
+- 建立完善的数据备份和恢复机制
+
+### 3. 扩展建议
+- 如需处罚功能,可单独增加处罚表关联违纪记录
+- 如需工作流,可集成Warm-Flow框架
+- 如需复杂统计,可考虑数据仓库方案
+- 如需移动端,优先考虑API接口设计 

+ 153 - 0
web/src/api/xg/xgss/dormViolation/dormViolation/index.ts

@@ -0,0 +1,153 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import {
+  DormViolationVO,
+  DormViolationForm,
+  DormViolationQuery,
+  StudentOptionVO,
+  StudentOptionQuery,
+  CampusOptionVO,
+  AreaOptionVO,
+  BuildingOptionVO,
+  RoomOptionVO,
+  BedOptionVO
+} from '@/api/xg/xgss/dormViolation/dormViolation/types';
+
+/**
+ * 查询宿舍违纪记录列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listDormViolation = (query?: DormViolationQuery): AxiosPromise<DormViolationVO[]> => {
+  return request({
+    url: '/dormViolation/dormViolation/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询宿舍违纪记录详细
+ * @param id
+ */
+export const getDormViolation = (id: string | number): AxiosPromise<DormViolationVO> => {
+  return request({
+    url: '/dormViolation/dormViolation/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增宿舍违纪记录
+ * @param data
+ */
+export const addDormViolation = (data: DormViolationForm) => {
+  return request({
+    url: '/dormViolation/dormViolation',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改宿舍违纪记录
+ * @param data
+ */
+export const updateDormViolation = (data: DormViolationForm) => {
+  return request({
+    url: '/dormViolation/dormViolation',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除宿舍违纪记录
+ * @param id
+ */
+export const delDormViolation = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/dormViolation/dormViolation/' + id,
+    method: 'delete'
+  });
+};
+
+/**
+ * 获取学生选择器选项列表(支持按学号、姓名检索)
+ * @param query 查询参数
+ * @returns 学生选项列表
+ */
+export const getStudentOptions = (query?: StudentOptionQuery): AxiosPromise<{
+  total: number;
+  rows: StudentOptionVO[];
+}> => {
+  return request({
+    url: '/holidayStay/holidayStay/studentOptions',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 获取校区选项列表
+ * @returns 校区选项列表
+ */
+export const getCampusOptions = (): AxiosPromise<any[]> => {
+  return request({
+    url: '/xqxx/dormCampus/list',
+    method: 'get'
+  });
+};
+
+/**
+ * 获取指定校区的宿舍区选项列表
+ * @param campusId 校区ID
+ * @returns 宿舍区选项列表
+ */
+export const getAreaOptions = (campusId?: string | number): AxiosPromise<any[]> => {
+  return request({
+    url: '/ssqxx/dormArea/list',
+    method: 'get',
+    params: campusId ? { campusId } : undefined
+  });
+};
+
+/**
+ * 获取指定宿舍区的宿舍楼选项列表
+ * @param areaId 宿舍区ID
+ * @returns 宿舍楼选项列表
+ */
+export const getBuildingOptions = (areaId?: string | number): AxiosPromise<any[]> => {
+  return request({
+    url: '/sslxx/dormBuilding/list',
+    method: 'get',
+    params: areaId ? { areaId } : undefined
+  });
+};
+
+/**
+ * 获取指定宿舍楼的房间选项列表
+ * @param buildingId 宿舍楼ID
+ * @returns 房间选项列表
+ */
+export const getRoomOptions = (buildingId?: string | number): AxiosPromise<any[]> => {
+  return request({
+    url: '/xgss/dormRoom/list',
+    method: 'get',
+    params: buildingId ? { buildingId } : undefined
+  });
+};
+
+/**
+ * 获取指定房间的床位选项列表
+ * @param roomId 房间ID
+ * @returns 床位选项列表
+ */
+export const getBedOptions = (roomId?: string | number): AxiosPromise<any[]> => {
+  return request({
+    url: '/dormbed/dormBed/list',
+    method: 'get',
+    params: roomId ? { roomId } : undefined
+  });
+};

+ 483 - 0
web/src/api/xg/xgss/dormViolation/dormViolation/types.ts

@@ -0,0 +1,483 @@
+export interface DormViolationVO {
+  /**
+   * 违纪记录ID(主键)
+   */
+  id: string | number;
+
+  /**
+   * 学生ID
+   */
+  studentId: string | number;
+
+  /**
+   * 学生姓名
+   */
+  studentName: string;
+
+  /**
+   * 学号
+   */
+  studentNo: string;
+
+  /**
+   * 学院ID
+   */
+  collegeId: string | number;
+
+  /**
+   * 学院名称
+   */
+  collegeName: string;
+
+  /**
+   * 专业ID
+   */
+  majorId: string | number;
+
+  /**
+   * 专业名称
+   */
+  majorName: string;
+
+  /**
+   * 班级ID
+   */
+  classId: string | number;
+
+  /**
+   * 班级名称
+   */
+  className: string;
+
+  /**
+   * 校区ID
+   */
+  campusId: string | number;
+
+  /**
+   * 校区名称
+   */
+  campusName: string;
+
+  /**
+   * 宿舍区域ID
+   */
+  areaId: string | number;
+
+  /**
+   * 宿舍区域名称
+   */
+  areaName: string;
+
+  /**
+   * 宿舍楼ID
+   */
+  buildingId: string | number;
+
+  /**
+   * 宿舍楼名称
+   */
+  buildingName: string;
+
+  /**
+   * 宿舍房间ID
+   */
+  roomId: string | number;
+
+  /**
+   * 房间名称
+   */
+  roomName: string;
+
+  /**
+   * 床位ID
+   */
+  bedId: string | number;
+
+  /**
+   * 床位名称
+   */
+  bedName: string;
+
+  /**
+   * 违纪类型
+   */
+  violationType: string;
+
+  /**
+   * 违纪等级:1轻微 2一般 3严重 4特别严重
+   */
+  violationLevel: string;
+
+  /**
+   * 违纪发生时间
+   */
+  violationTime: string;
+
+  /**
+   * 违纪行为描述
+   */
+  violationDescription: string;
+
+  /**
+   * 涉及其他学生id(逗号分隔)
+   */
+  involvedStudents: string;
+
+  /**
+   * 附件OSS ID列表(逗号分隔)
+   */
+  attachmentOssIds: string | number;
+
+  /**
+   * 删除标志(0代表存在 1代表删除)
+   */
+  deleted: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+}
+
+export interface DormViolationForm extends BaseEntity {
+  /**
+   * 违纪记录ID(主键)
+   */
+  id?: string | number;
+
+  /**
+   * 学生ID
+   */
+  studentId?: string | number;
+
+  /**
+   * 学生姓名
+   */
+  studentName?: string;
+
+  /**
+   * 学号
+   */
+  studentNo?: string;
+
+  /**
+   * 学院ID
+   */
+  collegeId?: string | number;
+
+  /**
+   * 学院名称
+   */
+  collegeName?: string;
+
+  /**
+   * 专业ID
+   */
+  majorId?: string | number;
+
+  /**
+   * 专业名称
+   */
+  majorName?: string;
+
+  /**
+   * 班级ID
+   */
+  classId?: string | number;
+
+  /**
+   * 班级名称
+   */
+  className?: string;
+
+  /**
+   * 校区ID
+   */
+  campusId?: string | number;
+
+  /**
+   * 校区名称
+   */
+  campusName?: string;
+
+  /**
+   * 宿舍区域ID
+   */
+  areaId?: string | number;
+
+  /**
+   * 宿舍区域名称
+   */
+  areaName?: string;
+
+  /**
+   * 宿舍楼ID
+   */
+  buildingId?: string | number;
+
+  /**
+   * 宿舍楼名称
+   */
+  buildingName?: string;
+
+  /**
+   * 宿舍房间ID
+   */
+  roomId?: string | number;
+
+  /**
+   * 房间名称
+   */
+  roomName?: string;
+
+  /**
+   * 床位ID
+   */
+  bedId?: string | number;
+
+  /**
+   * 床位名称
+   */
+  bedName?: string;
+
+  /**
+   * 违纪类型
+   */
+  violationType?: string;
+
+  /**
+   * 违纪等级:1轻微 2一般 3严重 4特别严重
+   */
+  violationLevel?: string;
+
+  /**
+   * 违纪发生时间
+   */
+  violationTime?: string;
+
+  /**
+   * 违纪行为描述
+   */
+  violationDescription?: string;
+
+  /**
+   * 涉及其他学生id(逗号分隔)
+   */
+  involvedStudents?: string;
+
+  /**
+   * 附件OSS ID列表(逗号分隔)
+   */
+  attachmentOssIds?: string | number;
+
+  /**
+   * 删除标志(0代表存在 1代表删除)
+   */
+  deleted?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+}
+
+export interface DormViolationQuery extends PageQuery {
+
+  /**
+   * 学生ID
+   */
+  studentId?: string | number;
+
+  /**
+   * 学生姓名
+   */
+  studentName?: string;
+
+  /**
+   * 学号
+   */
+  studentNo?: string;
+
+  /**
+   * 学院ID
+   */
+  collegeId?: string | number;
+
+  /**
+   * 学院名称
+   */
+  collegeName?: string;
+
+  /**
+   * 专业ID
+   */
+  majorId?: string | number;
+
+  /**
+   * 专业名称
+   */
+  majorName?: string;
+
+  /**
+   * 班级ID
+   */
+  classId?: string | number;
+
+  /**
+   * 班级名称
+   */
+  className?: string;
+
+  /**
+   * 校区ID
+   */
+  campusId?: string | number;
+
+  /**
+   * 校区名称
+   */
+  campusName?: string;
+
+  /**
+   * 宿舍区域ID
+   */
+  areaId?: string | number;
+
+  /**
+   * 宿舍区域名称
+   */
+  areaName?: string;
+
+  /**
+   * 宿舍楼ID
+   */
+  buildingId?: string | number;
+
+  /**
+   * 宿舍楼名称
+   */
+  buildingName?: string;
+
+  /**
+   * 宿舍房间ID
+   */
+  roomId?: string | number;
+
+  /**
+   * 房间名称
+   */
+  roomName?: string;
+
+  /**
+   * 床位ID
+   */
+  bedId?: string | number;
+
+  /**
+   * 床位名称
+   */
+  bedName?: string;
+
+  /**
+   * 违纪类型
+   */
+  violationType?: string;
+
+  /**
+   * 违纪等级:1轻微 2一般 3严重 4特别严重
+   */
+  violationLevel?: string;
+
+  /**
+   * 违纪发生时间
+   */
+  violationTime?: string;
+
+  /**
+   * 违纪行为描述
+   */
+  violationDescription?: string;
+
+  /**
+   * 涉及其他学生id(逗号分隔)
+   */
+  involvedStudents?: string;
+
+  /**
+   * 附件OSS ID列表(逗号分隔)
+   */
+  attachmentOssIds?: string | number;
+
+  /**
+   * 删除标志(0代表存在 1代表删除)
+   */
+  deleted?: string;
+
+    /**
+     * 日期范围参数
+     */
+    params?: any;
+}
+
+// 学生选择相关类型
+export interface StudentOptionVO {
+  id: string | number;
+  name: string;
+  studentNo: string;
+  gender: string;
+  collegeId?: string | number;
+  collegeName?: string;
+  majorId?: string | number;
+  majorName?: string;
+  classId?: string | number;
+  className?: string;
+  phone?: string;
+  dormInfo?: {
+    campusId?: string | number;
+    campusName?: string;
+    areaId?: string | number;
+    areaName?: string;
+    buildingId?: string | number;
+    buildingName?: string;
+    roomId?: string | number;
+    roomName?: string;
+    bedId?: string | number;
+    bedName?: string;
+  };
+}
+
+export interface StudentOptionQuery extends PageQuery {
+  keyword?: string;
+}
+
+// 宿舍级联选择相关类型
+export interface CampusOptionVO {
+  id: string | number;
+  campusName: string;
+}
+
+export interface AreaOptionVO {
+  id: string | number;
+  areaName: string;
+}
+
+export interface BuildingOptionVO {
+  id: string | number;
+  buildingName: string;
+}
+
+export interface RoomOptionVO {
+  id: string | number;
+  roomName: string;
+}
+
+export interface BedOptionVO {
+  id: string | number;
+  bedName: string;
+}
+
+
+

+ 1695 - 0
web/src/views/xg/xgss/dormViolation/dormViolation/index.vue

@@ -0,0 +1,1695 @@
+<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" :inline="true">
+            <!-- <el-form-item label="学生ID" prop="studentId">
+              <el-input v-model="queryParams.studentId" placeholder="请输入学生ID" 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="studentNo">
+              <el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="学院ID" prop="collegeId">
+              <el-input v-model="queryParams.collegeId" placeholder="请输入学院ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="学院名称" prop="collegeName">
+              <el-input v-model="queryParams.collegeName" placeholder="请输入学院名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="专业ID" prop="majorId">
+              <el-input v-model="queryParams.majorId" placeholder="请输入专业ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="专业名称" prop="majorName">
+              <el-input v-model="queryParams.majorName" placeholder="请输入专业名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="班级ID" prop="classId">
+              <el-input v-model="queryParams.classId" placeholder="请输入班级ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="班级名称" prop="className">
+              <el-input v-model="queryParams.className" placeholder="请输入班级名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="校区ID" prop="campusId">
+              <el-input v-model="queryParams.campusId" placeholder="请输入校区ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="校区名称" prop="campusName">
+              <el-input v-model="queryParams.campusName" placeholder="请输入校区名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="宿舍区域ID" prop="areaId">
+              <el-input v-model="queryParams.areaId" placeholder="请输入宿舍区域ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="宿舍区域名称" prop="areaName">
+              <el-input v-model="queryParams.areaName" placeholder="请输入宿舍区域名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="宿舍楼ID" prop="buildingId">
+              <el-input v-model="queryParams.buildingId" placeholder="请输入宿舍楼ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="宿舍楼名称" prop="buildingName">
+              <el-input v-model="queryParams.buildingName" placeholder="请输入宿舍楼名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="宿舍房间ID" prop="roomId">
+              <el-input v-model="queryParams.roomId" placeholder="请输入宿舍房间ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="房间名称" prop="roomName">
+              <el-input v-model="queryParams.roomName" placeholder="请输入房间名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="床位ID" prop="bedId">
+              <el-input v-model="queryParams.bedId" placeholder="请输入床位ID" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="床位名称" prop="bedName">
+              <el-input v-model="queryParams.bedName" placeholder="请输入床位名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="违纪类型" prop="violationType">
+              <el-select v-model="queryParams.violationType" placeholder="请选择违纪类型" clearable>
+                <el-option v-for="dict in dorm_violation_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="违纪等级:1轻微 2一般 3严重 4特别严重" prop="violationLevel">
+              <el-select v-model="queryParams.violationLevel" placeholder="请选择违纪等级:1轻微 2一般 3严重 4特别严重" clearable>
+                <el-option v-for="dict in dorm_violation_level" :key="dict.value" :label="dict.label" :value="dict.value" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="违纪发生时间" prop="violationTime">
+              <el-date-picker clearable v-model="queryParams.violationTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择违纪发生时间" />
+            </el-form-item>
+            <el-form-item label="违纪行为描述" prop="violationDescription">
+              <el-input v-model="queryParams.violationDescription" placeholder="请输入违纪行为描述" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="涉及其他学生id" prop="involvedStudents">
+              <el-input v-model="queryParams.involvedStudents" placeholder="请输入涉及其他学生id" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="附件OSS ID列表" prop="attachmentOssIds">
+              <el-input v-model="queryParams.attachmentOssIds" placeholder="请输入附件OSS ID列表" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="删除标志" prop="deleted">
+              <el-input v-model="queryParams.deleted" placeholder="请输入删除标志" clearable @keyup.enter="handleQuery" />
+            </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>
+        </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="['dormViolation:dormViolation:add']">新增</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dormViolation:dormViolation:edit']"
+              >修改</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="danger"
+              plain
+              icon="Delete"
+              :disabled="multiple"
+              @click="handleDelete()"
+              v-hasPermi="['dormViolation:dormViolation:remove']"
+              >删除</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dormViolation:dormViolation: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="dormViolationList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="违纪记录ID" align="center" prop="id" v-if="true" />
+        <el-table-column label="学生ID" align="center" prop="studentId" />
+        <el-table-column label="学生姓名" align="center" prop="studentName" />
+        <el-table-column label="学号" align="center" prop="studentNo" />
+        <el-table-column label="学院ID" align="center" prop="collegeId" />
+        <el-table-column label="学院名称" align="center" prop="collegeName" />
+        <el-table-column label="专业ID" align="center" prop="majorId" />
+        <el-table-column label="专业名称" align="center" prop="majorName" />
+        <el-table-column label="班级ID" align="center" prop="classId" />
+        <el-table-column label="班级名称" align="center" prop="className" />
+        <el-table-column label="校区ID" align="center" prop="campusId" />
+        <el-table-column label="校区名称" align="center" prop="campusName" />
+        <el-table-column label="宿舍区域ID" align="center" prop="areaId" />
+        <el-table-column label="宿舍区域名称" align="center" prop="areaName" />
+        <el-table-column label="宿舍楼ID" align="center" prop="buildingId" />
+        <el-table-column label="宿舍楼名称" align="center" prop="buildingName" />
+        <el-table-column label="宿舍房间ID" align="center" prop="roomId" />
+        <el-table-column label="房间名称" align="center" prop="roomName" />
+        <el-table-column label="床位ID" align="center" prop="bedId" />
+        <el-table-column label="床位名称" align="center" prop="bedName" />
+        <el-table-column label="违纪类型" align="center" prop="violationType">
+          <template #default="scope">
+            <dict-tag :options="dorm_violation_type" :value="scope.row.violationType" />
+          </template>
+        </el-table-column>
+        <el-table-column label="违纪等级:1轻微 2一般 3严重 4特别严重" align="center" prop="violationLevel">
+          <template #default="scope">
+            <dict-tag :options="dorm_violation_level" :value="scope.row.violationLevel" />
+          </template>
+        </el-table-column>
+        <el-table-column label="违纪发生时间" align="center" prop="violationTime" width="180">
+          <template #default="scope">
+            <span>{{ parseTime(scope.row.violationTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="违纪行为描述" align="center" prop="violationDescription" />
+        <el-table-column label="涉及其他学生id" align="center" prop="involvedStudents" />
+        <el-table-column label="附件OSS ID列表" align="center" prop="attachmentOssIds" />
+        <el-table-column label="删除标志" align="center" prop="deleted" />
+        <el-table-column label="备注" align="center" prop="remark" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-tooltip content="修改" placement="top">
+              <el-button
+                link
+                type="primary"
+                icon="Edit"
+                @click="handleUpdate(scope.row)"
+                v-hasPermi="['dormViolation:dormViolation:edit']"
+              ></el-button>
+            </el-tooltip>
+            <el-tooltip content="删除" placement="top">
+              <el-button
+                link
+                type="primary"
+                icon="Delete"
+                @click="handleDelete(scope.row)"
+                v-hasPermi="['dormViolation:dormViolation: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="1000px" append-to-body>
+      <el-form ref="dormViolationFormRef" :model="form" :rules="rules" label-width="120px">
+        <el-row :gutter="20">
+          <!-- 左列:学生基本信息 -->
+          <el-col :span="12">
+            <el-form-item label="学生ID" prop="studentId" v-if="false">
+              <el-input v-model="form.studentId" placeholder="请输入学生ID" />
+            </el-form-item>
+            <el-form-item label="学生选择" prop="studentId">
+              <el-select
+                v-model="form.studentId"
+                placeholder="请输入学号或姓名搜索学生"
+                filterable
+                remote
+                :remote-method="remoteSearchStudents"
+                :loading="studentLoading"
+                clearable
+                @change="handleStudentChange"
+                style="width: 100%"
+                @visible-change="handleStudentSelectVisibleChange"
+                popper-class="student-select-dropdown"
+              >
+                <el-option v-for="student in studentOptions" :key="student.id" :label="`${student.name} (${student.studentNo})`" :value="student.id">
+                  <div class="student-option">
+                    <div class="student-main">
+                      <span class="student-name">{{ student.name }}</span>
+                      <span class="student-no">{{ student.studentNo }}</span>
+                      <span class="student-gender">{{ student.gender === '0' ? '男' : '女' }}</span>
+                    </div>
+                    <div class="student-info" v-if="student.collegeName || student.majorName || student.className">
+                      <span v-if="student.collegeName && student.collegeName.trim()" class="info-item">{{ student.collegeName }}</span>
+                      <span v-if="student.majorName && student.majorName.trim()" class="info-item">{{ student.majorName }}</span>
+                      <span v-if="student.className && student.className.trim()" class="info-item">{{ student.className }}</span>
+                    </div>
+                  </div>
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="学生姓名" prop="studentName">
+              <el-input v-model="form.studentName" placeholder="选择学生后自动填充" :disabled="true" />
+            </el-form-item>
+            <el-form-item label="学号" prop="studentNo" v-if="false">
+              <el-input v-model="form.studentNo" placeholder="请输入学号" />
+            </el-form-item>
+            <el-form-item label="学院ID" prop="collegeId" v-if="false">
+              <el-input v-model="form.collegeId" placeholder="请输入学院ID" />
+            </el-form-item>
+            <el-form-item label="学院名称" prop="collegeName">
+              <el-input v-model="form.collegeName" placeholder="选择学生后自动填充" :disabled="true" />
+            </el-form-item>
+            <el-form-item label="专业ID" prop="majorId" v-if="false">
+              <el-input v-model="form.majorId" placeholder="请输入专业ID" />
+            </el-form-item>
+            <el-form-item label="专业名称" prop="majorName">
+              <el-input v-model="form.majorName" placeholder="选择学生后自动填充" :disabled="true" />
+            </el-form-item>
+            <el-form-item label="班级ID" prop="classId" v-if="false">
+              <el-input v-model="form.classId" placeholder="请输入班级ID" />
+            </el-form-item>
+            <el-form-item label="班级名称" prop="className">
+              <el-input v-model="form.className" placeholder="选择学生后自动填充" :disabled="true" />
+            </el-form-item>
+          </el-col>
+
+          <!-- 右列:宿舍信息 -->
+          <el-col :span="12">
+            <el-form-item label="校区ID" prop="campusId" v-if="false">
+              <el-input v-model="form.campusId" placeholder="请输入校区ID" />
+            </el-form-item>
+            <el-form-item label="校区名称" prop="campusId">
+              <el-select
+                v-model="form.campusId"
+                placeholder="请选择校区"
+                clearable
+                filterable
+                :loading="dormLoading"
+                @change="handleCampusChange"
+                style="width: 100%"
+              >
+                <el-option v-for="campus in campusOptions" :key="campus.id" :label="campus.campusName" :value="campus.id" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="宿舍区ID" prop="areaId" v-if="false">
+              <el-input v-model="form.areaId" placeholder="请输入宿舍区ID" />
+            </el-form-item>
+            <el-form-item label="宿舍区名称" prop="areaId">
+              <el-select
+                v-model="form.areaId"
+                placeholder="请选择宿舍区"
+                clearable
+                filterable
+                :loading="dormLoading"
+                @change="handleAreaChange"
+                style="width: 100%"
+                :disabled="!form.campusId"
+              >
+                <el-option v-for="area in areaOptions" :key="area.id" :label="area.areaName" :value="area.id" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="宿舍楼ID" prop="buildingId" v-if="false">
+              <el-input v-model="form.buildingId" placeholder="请输入宿舍楼ID" />
+            </el-form-item>
+            <el-form-item label="宿舍楼名称" prop="buildingId">
+              <el-select
+                v-model="form.buildingId"
+                placeholder="请选择宿舍楼"
+                clearable
+                filterable
+                :loading="dormLoading"
+                @change="handleBuildingChange"
+                style="width: 100%"
+                :disabled="!form.areaId"
+              >
+                <el-option v-for="building in buildingOptions" :key="building.id" :label="building.buildingName" :value="building.id" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="房间ID" prop="roomId" v-if="false">
+              <el-input v-model="form.roomId" placeholder="请输入房间ID" />
+            </el-form-item>
+            <el-form-item label="房间名称" prop="roomId">
+              <el-select
+                v-model="form.roomId"
+                placeholder="请选择房间"
+                clearable
+                filterable
+                :loading="dormLoading"
+                @change="handleRoomChange"
+                style="width: 100%"
+                :disabled="!form.buildingId"
+              >
+                <el-option v-for="room in roomOptions" :key="room.id" :label="room.roomName" :value="room.id" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="床位ID" prop="bedId" v-if="false">
+              <el-input v-model="form.bedId" placeholder="请输入床位ID" />
+            </el-form-item>
+            <el-form-item label="床位名称" prop="bedId">
+              <el-select
+                v-model="form.bedId"
+                placeholder="请选择床位"
+                clearable
+                filterable
+                :loading="dormLoading"
+                @change="handleBedChange"
+                style="width: 100%"
+                :disabled="!form.roomId"
+              >
+                <el-option v-for="bed in bedOptions" :key="bed.id" :label="bed.bedName" :value="bed.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <!-- 违纪信息 -->
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="违纪类型" prop="violationType">
+              <el-select v-model="form.violationType" placeholder="请选择违纪类型" style="width: 100%">
+                <el-option v-for="dict in dorm_violation_type" :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="violationLevel">
+              <el-select v-model="form.violationLevel" placeholder="请选择违纪等级" style="width: 100%">
+                <el-option v-for="dict in dorm_violation_level" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="违纪发生时间" prop="violationTime">
+              <el-date-picker
+                clearable
+                v-model="form.violationTime"
+                type="datetime"
+                value-format="YYYY-MM-DD HH:mm:ss"
+                placeholder="请选择违纪发生时间"
+                style="width: 100%"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="涉及其他学生" prop="involvedStudents">
+              <el-input v-model="form.involvedStudents" placeholder="请输入涉及其他学生ID" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <!-- 完整宽度的字段 -->
+        <el-form-item label="违纪行为描述" prop="violationDescription">
+          <el-input v-model="form.violationDescription" type="textarea" placeholder="请输入违纪行为描述" :rows="3" />
+        </el-form-item>
+
+        <el-form-item label="上传附件">
+          <div class="attachment-upload-container">
+            <el-upload
+              :file-list="attachmentList"
+              class="upload-demo"
+              drag
+              list-type="picture-card"
+              :on-preview="handleFilePreview"
+              :action="uploadAction"
+              :headers="uploadHeaders"
+              :data="uploadData"
+              :auto-upload="true"
+              :before-upload="handleBeforeUpload"
+              :on-success="handleUploadSuccess"
+              :on-error="handleUploadError"
+              :on-remove="handleRemoveAttachmentConfirm"
+              :on-change="handleFileChange"
+              multiple
+              :limit="15"
+              :show-file-list="true"
+              accept="image/*,video/*,.pdf,.doc,.docx,.txt"
+            >
+              <template #tip>
+                <div class="el-upload__tip">
+                  支持图片、视频、PDF、Word文档等格式,单个文件大小不超过10MB,最多上传15个文件。
+                  <span class="el-upload__tip" v-if="!form.id" style="color: #ff0000">(新增时文件会立即上传,保存违纪记录后自动关联)</span>
+                  <span class="el-upload__tip" v-else style="color: #ff0000">(编辑时文件会立即上传并关联到当前违纪记录)</span>
+                </div>
+              </template>
+
+              <!-- 调整拖拽上传图标与文字在同一行、居中对齐 -->
+              <div class="el-upload-dragger1">
+                <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+                <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+              </div>
+
+              <!-- 自定义文件卡片缩略图(含文件名) -->
+              <template #file="{ file }">
+                <div class="upload-file-card">
+                  <!-- 缩略图区域 -->
+                  <div class="upload-file-thumb">
+                    <image-preview v-if="isImageFile(file) && file.url" :src="getFileOssId(file)" class="upload-thumb-image" :isOssId="true" />
+                    <div v-else class="upload-file-placeholder">
+                      <el-icon><Document /></el-icon>
+                      <span class="file-ext">{{ getFileExt(file.name) }}</span>
+                    </div>
+                    <!-- loading 遮罩只在上传中显示 -->
+                    <div v-if="file.status === 'uploading'" class="upload-file-loading">
+                      <el-icon class="is-loading"><Loading /></el-icon>
+                      <span class="loading-text">上传中...</span>
+                    </div>
+                  </div>
+
+                  <!-- 文件名称 -->
+                  <div class="upload-file-name" :title="file.name">
+                    {{ getShortFileName(file.name) }}
+                  </div>
+
+                  <!-- 操作按钮区域 - 固定在文件名下方 -->
+                  <div class="upload-file-card-actions" v-if="file.status && file.status !== 'ready'">
+                    <el-button-group size="small">
+                      <el-button type="success" @click.stop="handleDownloadAttachment(file)" title="下载" :disabled="file.status !== 'success'">
+                        <el-icon><Download /></el-icon>
+                      </el-button>
+                      <el-button type="danger" @click.stop="handleRemoveAttachmentConfirm(file)" title="删除">
+                        <el-icon><Delete /></el-icon>
+                      </el-button>
+                    </el-button-group>
+                  </div>
+                </div>
+              </template>
+            </el-upload>
+          </div>
+        </el-form-item>
+
+        <el-form-item label="备注信息" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入备注信息" :rows="3" />
+        </el-form-item>
+      </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>
+  </div>
+</template>
+
+<script setup name="DormViolation" lang="ts">
+import { ref, reactive, toRefs, onMounted, getCurrentInstance, ComponentInternalInstance, computed } from 'vue';
+import ElMessage from 'element-plus/es/components/message/index';
+import ElMessageBox from 'element-plus/es/components/message-box/index';
+import ElLoading from 'element-plus/es/components/loading/index';
+import { UploadFilled, Document, Loading, Download, Delete } from '@element-plus/icons-vue';
+import { getToken } from '@/utils/auth';
+import ImagePreview from '@/components/ImagePreview/index.vue';
+import request from '@/utils/request';
+import {
+  listDormViolation,
+  getDormViolation,
+  delDormViolation,
+  addDormViolation,
+  updateDormViolation,
+  getStudentOptions,
+  getCampusOptions,
+  getAreaOptions,
+  getBuildingOptions,
+  getRoomOptions,
+  getBedOptions
+} from '@/api/xg/xgss/dormViolation/dormViolation';
+import {
+  DormViolationVO,
+  DormViolationQuery,
+  DormViolationForm,
+  StudentOptionVO,
+  StudentOptionQuery,
+  CampusOptionVO,
+  AreaOptionVO,
+  BuildingOptionVO,
+  RoomOptionVO,
+  BedOptionVO
+} from '@/api/xg/xgss/dormViolation/dormViolation/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { dorm_violation_level, dorm_violation_type } = toRefs<any>(proxy?.useDict('dorm_violation_level', 'dorm_violation_type'));
+
+const dormViolationList = ref<DormViolationVO[]>([]);
+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 studentOptions = ref<StudentOptionVO[]>([]);
+const studentLoading = ref(false);
+const studentSelectVisible = ref(false);
+
+// 宿舍级联选择器相关状态
+const campusOptions = ref<CampusOptionVO[]>([]);
+const areaOptions = ref<AreaOptionVO[]>([]);
+const buildingOptions = ref<BuildingOptionVO[]>([]);
+const roomOptions = ref<RoomOptionVO[]>([]);
+const bedOptions = ref<BedOptionVO[]>([]);
+const dormLoading = ref(false);
+
+// 附件上传相关状态
+const attachmentList = ref<any[]>([]);
+
+const queryFormRef = ref<ElFormInstance>();
+const dormViolationFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: DormViolationForm = {
+  id: undefined,
+  studentId: undefined,
+  studentName: undefined,
+  studentNo: undefined,
+  collegeId: undefined,
+  collegeName: undefined,
+  majorId: undefined,
+  majorName: undefined,
+  classId: undefined,
+  className: undefined,
+  campusId: undefined,
+  campusName: undefined,
+  areaId: undefined,
+  areaName: undefined,
+  buildingId: undefined,
+  buildingName: undefined,
+  roomId: undefined,
+  roomName: undefined,
+  bedId: undefined,
+  bedName: undefined,
+  violationType: undefined,
+  violationLevel: undefined,
+  violationTime: undefined,
+  violationDescription: undefined,
+  involvedStudents: undefined,
+  attachmentOssIds: undefined,
+  deleted: undefined,
+  remark: undefined
+};
+const data = reactive<PageData<DormViolationForm, DormViolationQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    studentId: undefined,
+    studentName: undefined,
+    studentNo: undefined,
+    collegeId: undefined,
+    collegeName: undefined,
+    majorId: undefined,
+    majorName: undefined,
+    classId: undefined,
+    className: undefined,
+    campusId: undefined,
+    campusName: undefined,
+    areaId: undefined,
+    areaName: undefined,
+    buildingId: undefined,
+    buildingName: undefined,
+    roomId: undefined,
+    roomName: undefined,
+    bedId: undefined,
+    bedName: undefined,
+    violationType: undefined,
+    violationLevel: undefined,
+    violationTime: undefined,
+    violationDescription: undefined,
+    involvedStudents: undefined,
+    attachmentOssIds: undefined,
+    deleted: undefined,
+    params: {}
+  },
+  rules: {
+    id: [{ required: true, message: '违纪记录ID不能为空', trigger: 'blur' }],
+    studentId: [{ required: true, message: '学生ID不能为空', trigger: 'blur' }],
+    studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }],
+    studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
+    buildingId: [{ required: true, message: '宿舍楼ID不能为空', trigger: 'blur' }],
+    buildingName: [{ required: true, message: '宿舍楼名称不能为空', trigger: 'blur' }],
+    roomId: [{ required: true, message: '宿舍房间ID不能为空', trigger: 'blur' }],
+    roomName: [{ required: true, message: '房间名称不能为空', trigger: 'blur' }],
+    violationType: [{ required: true, message: '违纪类型不能为空', trigger: 'change' }],
+    violationLevel: [{ required: true, message: '违纪等级:1轻微 2一般 3严重 4特别严重不能为空', trigger: 'change' }],
+    violationTime: [{ required: true, message: '违纪发生时间不能为空', trigger: 'blur' }],
+    violationDescription: [{ required: true, message: '违纪行为描述不能为空', trigger: 'blur' }]
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+// 上传相关配置
+const uploadAction = computed(() => {
+  return import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload';
+});
+
+const uploadHeaders = computed(() => {
+  return {
+    'Authorization': `Bearer ${getToken() || ''}`,
+    'clientid': import.meta.env.VITE_APP_CLIENT_ID || 'e5cd7e4891bf95d1d19206ce24a7b32e'
+  };
+});
+
+const uploadData = computed(() => {
+  return {
+    bizType: 'dorm_violation_attachment'
+  };
+});
+
+/** 查询宿舍违纪记录列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listDormViolation(queryParams.value);
+  dormViolationList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  dormViolationFormRef.value?.resetFields();
+
+  // 清空宿舍级联选项
+  areaOptions.value = [];
+  buildingOptions.value = [];
+  roomOptions.value = [];
+  bedOptions.value = [];
+
+  // 清空附件列表
+  attachmentList.value = [];
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: DormViolationVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加宿舍违纪记录';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: DormViolationVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getDormViolation(_id);
+  Object.assign(form.value, res.data);
+
+  // 根据已有数据级联加载宿舍选项
+  await loadCascadeOptionsForUpdate(form.value);
+
+  // 处理附件数据
+  await handleAttachmentData();
+
+  dialog.visible = true;
+  dialog.title = '修改宿舍违纪记录';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  dormViolationFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+
+      // 处理附件数据
+      const attachmentOssIds = attachmentList.value.filter((file: any) => file.status === 'success' && file.ossId).map((file: any) => file.ossId);
+
+      // 将附件ID添加到表单数据中,处理成逗号分隔的字符串
+      form.value.attachmentOssIds = attachmentOssIds.join(',');
+
+      if (form.value.id) {
+        await updateDormViolation(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addDormViolation(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: DormViolationVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除宿舍违纪记录编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delDormViolation(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'dormViolation/dormViolation/export',
+    {
+      ...queryParams.value
+    },
+    `dormViolation_${new Date().getTime()}.xlsx`
+  );
+};
+
+/** 远程搜索学生 */
+const remoteSearchStudents = async (query: string) => {
+  studentLoading.value = true;
+  try {
+    const params: StudentOptionQuery = {
+      keyword: query.trim(),
+      pageNum: 1,
+      pageSize: 20
+    };
+    const res = await getStudentOptions(params);
+    console.log('学生搜索响应:', res);
+    studentOptions.value = res.rows || [];
+
+    // 调试:检查第一个学生的数据
+    if (studentOptions.value.length > 0) {
+      const firstStudent = studentOptions.value[0];
+      console.log('第一个学生数据:', {
+        name: firstStudent.name,
+        studentNo: firstStudent.studentNo,
+        collegeName: firstStudent.collegeName,
+        majorName: firstStudent.majorName,
+        className: firstStudent.className
+      });
+    }
+  } catch (error) {
+    console.error('搜索学生失败:', error);
+    studentOptions.value = [];
+  } finally {
+    studentLoading.value = false;
+  }
+};
+
+/** 学生选择器可见性变化处理 */
+const handleStudentSelectVisibleChange = async (visible: boolean) => {
+  studentSelectVisible.value = visible;
+
+  // 当下拉框打开且没有数据时,加载初始数据
+  if (visible && studentOptions.value.length === 0) {
+    await loadInitialStudents();
+  }
+};
+
+/** 加载初始学生数据 */
+const loadInitialStudents = async () => {
+  studentLoading.value = true;
+  try {
+    const params: StudentOptionQuery = {
+      keyword: '', // 空关键词获取初始数据
+      pageNum: 1,
+      pageSize: 20
+    };
+    const res = await getStudentOptions(params);
+    console.log('初始学生数据响应:', res);
+    studentOptions.value = res.rows || [];
+
+    // 调试:检查第一个学生的数据
+    if (studentOptions.value.length > 0) {
+      const firstStudent = studentOptions.value[0];
+      console.log('初始数据第一个学生:', {
+        name: firstStudent.name,
+        studentNo: firstStudent.studentNo,
+        collegeName: firstStudent.collegeName,
+        majorName: firstStudent.majorName,
+        className: firstStudent.className
+      });
+    }
+  } catch (error) {
+    console.error('加载初始学生数据失败:', error);
+    studentOptions.value = [];
+  } finally {
+    studentLoading.value = false;
+  }
+};
+
+/** 学生选择处理 */
+const handleStudentChange = async (studentId: string | number) => {
+  if (!studentId) {
+    // 清空学生相关信息
+    form.value.studentName = undefined;
+    form.value.studentNo = undefined;
+    form.value.collegeName = undefined;
+    form.value.majorName = undefined;
+    form.value.className = undefined;
+
+    // 清空宿舍信息及选项
+    form.value.campusId = undefined;
+    form.value.campusName = undefined;
+    form.value.areaId = undefined;
+    form.value.areaName = undefined;
+    form.value.buildingId = undefined;
+    form.value.buildingName = undefined;
+    form.value.roomId = undefined;
+    form.value.roomName = undefined;
+    form.value.bedId = undefined;
+    form.value.bedName = undefined;
+
+    areaOptions.value = [];
+    buildingOptions.value = [];
+    roomOptions.value = [];
+    bedOptions.value = [];
+    return;
+  }
+
+  const selectedStudent = studentOptions.value.find((student) => student.id === studentId);
+  if (selectedStudent) {
+    // 填充学生基本信息
+    form.value.studentId = selectedStudent.id;
+    form.value.studentName = selectedStudent.name;
+    form.value.studentNo = selectedStudent.studentNo;
+
+    // 填充学院、专业、班级信息
+    form.value.collegeId = selectedStudent.collegeId;
+    form.value.collegeName = selectedStudent.collegeName;
+    form.value.majorId = selectedStudent.majorId;
+    form.value.majorName = selectedStudent.majorName;
+    form.value.classId = selectedStudent.classId;
+    form.value.className = selectedStudent.className;
+
+    // 填充宿舍信息并级联加载选项
+    if (selectedStudent.dormInfo) {
+      // 填充宿舍信息
+      form.value.campusId = selectedStudent.dormInfo.campusId;
+      form.value.campusName = selectedStudent.dormInfo.campusName;
+      form.value.areaId = selectedStudent.dormInfo.areaId;
+      form.value.areaName = selectedStudent.dormInfo.areaName;
+      form.value.buildingId = selectedStudent.dormInfo.buildingId;
+      form.value.buildingName = selectedStudent.dormInfo.buildingName;
+      form.value.roomId = selectedStudent.dormInfo.roomId;
+      form.value.roomName = selectedStudent.dormInfo.roomName;
+      form.value.bedId = selectedStudent.dormInfo.bedId;
+      form.value.bedName = selectedStudent.dormInfo.bedName;
+
+      // 级联加载对应的选项
+      try {
+        if (selectedStudent.dormInfo.campusId) {
+          await loadAreaOptions(selectedStudent.dormInfo.campusId);
+
+          if (selectedStudent.dormInfo.areaId) {
+            await loadBuildingOptions(selectedStudent.dormInfo.areaId);
+
+            if (selectedStudent.dormInfo.buildingId) {
+              await loadRoomOptions(selectedStudent.dormInfo.buildingId);
+
+              if (selectedStudent.dormInfo.roomId) {
+                await loadBedOptions(selectedStudent.dormInfo.roomId);
+              }
+            }
+          }
+        }
+      } catch (error) {
+        console.error('级联加载宿舍选项失败:', error);
+      }
+    } else {
+      // 如果宿舍信息为空,清空宿舍相关字段
+      form.value.campusId = undefined;
+      form.value.campusName = undefined;
+      form.value.areaId = undefined;
+      form.value.areaName = undefined;
+      form.value.buildingId = undefined;
+      form.value.buildingName = undefined;
+      form.value.roomId = undefined;
+      form.value.roomName = undefined;
+      form.value.bedId = undefined;
+      form.value.bedName = undefined;
+
+      areaOptions.value = [];
+      buildingOptions.value = [];
+      roomOptions.value = [];
+      bedOptions.value = [];
+    }
+  }
+};
+
+/** 加载校区选项 */
+const loadCampusOptions = async () => {
+  try {
+    dormLoading.value = true;
+    const res = await getCampusOptions();
+    campusOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('加载校区选项失败:', error);
+    campusOptions.value = [];
+  } finally {
+    dormLoading.value = false;
+  }
+};
+
+/** 校区选择变化处理 */
+const handleCampusChange = async (campusId: string | number) => {
+  console.log('校区选择变化处理', campusId);
+  // 清空下级选项
+  form.value.areaId = undefined;
+  form.value.areaName = undefined;
+  form.value.buildingId = undefined;
+  form.value.buildingName = undefined;
+  form.value.roomId = undefined;
+  form.value.roomName = undefined;
+  form.value.bedId = undefined;
+  form.value.bedName = undefined;
+
+  areaOptions.value = [];
+  buildingOptions.value = [];
+  roomOptions.value = [];
+  bedOptions.value = [];
+
+  if (campusId) {
+    // 设置校区名称
+    const selectedCampus = campusOptions.value.find((campus) => campus.id === campusId);
+    if (selectedCampus) {
+      form.value.campusId = campusId;
+      form.value.campusName = selectedCampus.campusName;
+    }
+
+    // 加载宿舍区选项
+    await loadAreaOptions(campusId);
+  } else {
+    form.value.campusId = undefined;
+    form.value.campusName = undefined;
+  }
+};
+
+/** 加载宿舍区选项 */
+const loadAreaOptions = async (campusId: string | number) => {
+  try {
+    dormLoading.value = true;
+    const res = await getAreaOptions(campusId);
+    areaOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('加载宿舍区选项失败:', error);
+    areaOptions.value = [];
+  } finally {
+    dormLoading.value = false;
+  }
+};
+
+/** 宿舍区选择变化处理 */
+const handleAreaChange = async (areaId: string | number) => {
+  // 清空下级选项
+  form.value.buildingId = undefined;
+  form.value.buildingName = undefined;
+  form.value.roomId = undefined;
+  form.value.roomName = undefined;
+  form.value.bedId = undefined;
+  form.value.bedName = undefined;
+
+  buildingOptions.value = [];
+  roomOptions.value = [];
+  bedOptions.value = [];
+
+  if (areaId) {
+    // 设置宿舍区名称
+    const selectedArea = areaOptions.value.find((area) => area.id === areaId);
+    if (selectedArea) {
+      form.value.areaId = areaId;
+      form.value.areaName = selectedArea.areaName;
+    }
+
+    // 加载宿舍楼选项
+    await loadBuildingOptions(areaId);
+  } else {
+    form.value.areaId = undefined;
+    form.value.areaName = undefined;
+  }
+};
+
+/** 加载宿舍楼选项 */
+const loadBuildingOptions = async (areaId: string | number) => {
+  try {
+    dormLoading.value = true;
+    const res = await getBuildingOptions(areaId);
+    buildingOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('加载宿舍楼选项失败:', error);
+    buildingOptions.value = [];
+  } finally {
+    dormLoading.value = false;
+  }
+};
+
+/** 宿舍楼选择变化处理 */
+const handleBuildingChange = async (buildingId: string | number) => {
+  // 清空下级选项
+  form.value.roomId = undefined;
+  form.value.roomName = undefined;
+  form.value.bedId = undefined;
+  form.value.bedName = undefined;
+
+  roomOptions.value = [];
+  bedOptions.value = [];
+
+  if (buildingId) {
+    // 设置宿舍楼名称
+    const selectedBuilding = buildingOptions.value.find((building) => building.id === buildingId);
+    if (selectedBuilding) {
+      form.value.buildingId = buildingId;
+      form.value.buildingName = selectedBuilding.buildingName;
+    }
+
+    // 加载房间选项
+    await loadRoomOptions(buildingId);
+  } else {
+    form.value.buildingId = undefined;
+    form.value.buildingName = undefined;
+  }
+};
+
+/** 加载房间选项 */
+const loadRoomOptions = async (buildingId: string | number) => {
+  try {
+    dormLoading.value = true;
+    const res = await getRoomOptions(buildingId);
+    roomOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('加载房间选项失败:', error);
+    roomOptions.value = [];
+  } finally {
+    dormLoading.value = false;
+  }
+};
+
+/** 房间选择变化处理 */
+const handleRoomChange = async (roomId: string | number) => {
+  // 清空下级选项
+  form.value.bedId = undefined;
+  form.value.bedName = undefined;
+
+  bedOptions.value = [];
+
+  if (roomId) {
+    // 设置房间名称
+    const selectedRoom = roomOptions.value.find((room) => room.id === roomId);
+    if (selectedRoom) {
+      form.value.roomId = roomId;
+      form.value.roomName = selectedRoom.roomName;
+    }
+
+    // 加载床位选项
+    await loadBedOptions(roomId);
+  } else {
+    form.value.roomId = undefined;
+    form.value.roomName = undefined;
+  }
+};
+
+/** 加载床位选项 */
+const loadBedOptions = async (roomId: string | number) => {
+  try {
+    dormLoading.value = true;
+    const res = await getBedOptions(roomId);
+    bedOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('加载床位选项失败:', error);
+    bedOptions.value = [];
+  } finally {
+    dormLoading.value = false;
+  }
+};
+
+/** 床位选择变化处理 */
+const handleBedChange = (bedId: string | number) => {
+  if (bedId) {
+    // 设置床位名称
+    const selectedBed = bedOptions.value.find((bed) => bed.id === bedId);
+    if (selectedBed) {
+      form.value.bedId = bedId;
+      form.value.bedName = selectedBed.bedName;
+    }
+  } else {
+    form.value.bedId = undefined;
+    form.value.bedName = undefined;
+  }
+};
+
+/** 修改时级联加载宿舍选项数据 */
+const loadCascadeOptionsForUpdate = async (formData: DormViolationForm) => {
+  try {
+    // 如果有校区ID,加载宿舍区选项
+    if (formData.campusId) {
+      await loadAreaOptions(formData.campusId);
+
+      // 如果有宿舍区ID,加载宿舍楼选项
+      if (formData.areaId) {
+        await loadBuildingOptions(formData.areaId);
+
+        // 如果有宿舍楼ID,加载房间选项
+        if (formData.buildingId) {
+          await loadRoomOptions(formData.buildingId);
+
+          // 如果有房间ID,加载床位选项
+          if (formData.roomId) {
+            await loadBedOptions(formData.roomId);
+          }
+        }
+      }
+    }
+  } catch (error) {
+    console.error('修改时级联加载宿舍选项失败:', error);
+  }
+};
+
+// 文件类型判断
+const isImageFile = (file: any) => {
+  const imageTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/webp'];
+  return imageTypes.includes(file.raw?.type) || (file.url && /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(file.name));
+};
+
+// 获取文件OSS ID的辅助函数
+const getFileOssId = (file: any) => {
+  return file.ossId || '';
+};
+
+// 获取文件扩展名
+const getFileExt = (fileName: string) => {
+  const ext = fileName.split('.').pop()?.toUpperCase();
+  return ext || 'FILE';
+};
+
+// 获取缩写的文件名(保留后缀)
+const getShortFileName = (fileName: string) => {
+  if (!fileName) return '';
+
+  const lastDotIndex = fileName.lastIndexOf('.');
+  if (lastDotIndex === -1) {
+    // 没有后缀的文件名
+    return fileName.length > 12 ? fileName.substring(0, 12) + '...' : fileName;
+  }
+
+  const name = fileName.substring(0, lastDotIndex);
+  const ext = fileName.substring(lastDotIndex); // 包含点号的后缀
+
+  if (name.length <= 8) {
+    return fileName; // 文件名较短,直接返回
+  }
+
+  // 文件名较长,缩写中间部分,保留后缀
+  return name.substring(0, 8) + '...' + ext;
+};
+
+// 文件预览
+const handleFilePreview = (file: any) => {
+  if (isImageFile(file)) {
+    // 图片预览
+    window.open(file.url);
+  } else {
+    // 其他文件下载
+    handleDownloadAttachment(file);
+  }
+};
+
+// 文件上传前检查
+const handleBeforeUpload = (file: any) => {
+  const isValidType = /\.(jpg|jpeg|png|gif|bmp|webp|pdf|doc|docx|txt|mp4|avi|mov)$/i.test(file.name);
+  const isLt10M = file.size / 1024 / 1024 < 10;
+
+  if (!isValidType) {
+    ElMessage.error('上传文件格式不正确!');
+    return false;
+  }
+  if (!isLt10M) {
+    ElMessage.error('上传文件大小不能超过 10MB!');
+    return false;
+  }
+  return true;
+};
+
+// 文件上传成功
+const handleUploadSuccess = (response: any, file: any) => {
+  if (response.code === 200) {
+    file.url = response.data.url;
+    file.ossId = response.data.ossId;
+    ElMessage.success('文件上传成功');
+  } else {
+    ElMessage.error(response.msg || '文件上传失败');
+  }
+};
+
+// 文件上传失败
+const handleUploadError = (error: any, file: any) => {
+  console.error('文件上传失败:', error);
+  ElMessage.error('文件上传失败');
+};
+
+// 文件变更
+const handleFileChange = (file: any, fileList: any) => {
+  console.log('文件变更:', file, fileList);
+  attachmentList.value = fileList;
+};
+
+// 删除附件确认
+const handleRemoveAttachmentConfirm = (file: any) => {
+  ElMessageBox.confirm('确定要删除这个文件吗?', '提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(() => {
+      handleRemoveAttachment(file);
+    })
+    .catch(() => {
+      // 取消删除
+    });
+};
+
+// 删除附件
+const handleRemoveAttachment = (file: any) => {
+  const index = attachmentList.value.findIndex((item: any) => item.uid === file.uid);
+  if (index > -1) {
+    attachmentList.value.splice(index, 1);
+    ElMessage.success('文件删除成功');
+  }
+};
+
+// 下载附件
+const handleDownloadAttachment = async (file: any) => {
+  let downloadUrl = '';
+  let fileName = file.name || 'attachment';
+
+  // 如果文件已经上传成功,使用服务器返回的路径
+  if (file.response && file.response.data && file.response.data.filePath) {
+    downloadUrl = file.response.data.filePath;
+    fileName = file.response.data.fileName || fileName;
+  }
+  // 如果是已有的附件,使用文件的ossId
+  else if (file.ossId) {
+    downloadUrl = file.ossId;
+  }
+  // 如果是本地文件,直接使用raw文件
+  else if (file.raw) {
+    const link = document.createElement('a');
+    link.href = URL.createObjectURL(file.raw);
+    link.download = fileName;
+    link.style.display = 'none';
+    document.body.appendChild(link);
+    link.click();
+    document.body.removeChild(link);
+    URL.revokeObjectURL(link.href);
+    console.log('下载本地文件:', fileName);
+    return;
+  }
+
+  if (!downloadUrl) {
+    ElMessage.error('无法获取文件下载地址');
+    return;
+  }
+
+  // 对于服务器文件,使用fetch获取内容强制下载
+  try {
+    const loading = ElLoading.service({
+      text: '正在下载文件...',
+      target: document.body
+    });
+
+    const response = await request({
+      url: '/resource/oss/download/' + downloadUrl,
+      method: 'get',
+      responseType: 'blob',
+      timeout: 300000 // 300秒超时
+    });
+
+    // 验证响应数据
+    if (!response) {
+      throw new Error('响应数据为空');
+    }
+    console.log('response', response);
+
+    // 检查response的结构,判断是直接的Blob还是包含data属性的响应对象
+    let blobData: Blob;
+    if (response instanceof Blob) {
+      // 如果response本身就是Blob对象
+      blobData = response;
+    } else if (response.data instanceof Blob) {
+      // 如果response.data是Blob对象
+      blobData = response.data;
+    } else {
+      throw new Error('无效的响应数据格式');
+    }
+
+    const url = window.URL.createObjectURL(blobData);
+
+    const link = document.createElement('a');
+    link.href = url;
+    link.download = fileName;
+    link.style.display = 'none';
+    document.body.appendChild(link);
+    link.click();
+    document.body.removeChild(link);
+
+    window.URL.revokeObjectURL(url);
+    loading?.close();
+    console.log('下载服务器文件成功:', fileName);
+  } catch (error) {
+    console.error('下载文件失败:', error);
+    ElMessage.error('下载文件失败,请稍后重试');
+  }
+};
+
+// 处理附件数据
+const handleAttachmentData = async () => {
+  try {
+    // 如果有附件ID,则获取附件信息
+    if (form.value.attachmentOssIds && form.value.attachmentOssIds.toString().trim()) {
+      console.log('开始处理附件数据:', form.value.attachmentOssIds);
+
+      // 将逗号分隔的字符串转换为数组
+      const ossIdsArray = form.value.attachmentOssIds
+        .toString()
+        .split(',')
+        .map((id) => id.trim())
+        .filter((id) => id);
+
+      // 调用接口获取附件信息
+      const response = await request({
+        url: `/resource/oss/listByIds/${ossIdsArray.join(',')}`,
+        method: 'get'
+      });
+
+      if (response.code === 200 && response.data) {
+        console.log('获取到的附件信息:', response.data);
+
+        // 将附件信息转换为上传组件需要的格式
+        const attachmentFiles = response.data.map((item: any, index: number) => ({
+          uid: `existing_${index}_${Date.now()}`,
+          name: item.originalName || `附件${index + 1}`,
+          url: item.url,
+          ossId: item.ossId,
+          status: 'success', // 标记为已上传成功
+          response: {
+            code: 200,
+            data: {
+              url: item.url,
+              ossId: item.ossId
+            }
+          }
+        }));
+
+        // 设置附件列表
+        attachmentList.value = attachmentFiles;
+        console.log('设置附件列表成功:', attachmentList.value);
+      } else {
+        console.warn('获取附件信息失败:', response.msg);
+        attachmentList.value = [];
+      }
+    } else {
+      console.log('没有附件数据,清空附件列表');
+      attachmentList.value = [];
+    }
+  } catch (error) {
+    console.error('处理附件数据失败:', error);
+    ElMessage.error('获取附件信息失败,请稍后重试');
+    attachmentList.value = [];
+  }
+};
+
+onMounted(() => {
+  getList();
+  // 加载校区选项
+  loadCampusOptions();
+});
+</script>
+
+<style scoped>
+.student-option {
+  padding: 2px 0;
+  min-height: 32px;
+}
+
+.student-main {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  margin-bottom: 1px;
+}
+
+.student-name {
+  font-weight: 500;
+  color: #303133;
+  font-size: 13px;
+}
+
+.student-no {
+  font-size: 11px;
+  color: #606266;
+  /* background: #f5f7fa; */
+  padding: 0px 3px;
+  border-radius: 2px;
+}
+
+.student-gender {
+  font-size: 11px;
+  color: #909399;
+}
+
+.student-info {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  font-size: 11px;
+  color: #909399;
+  margin-top: 1px;
+}
+
+.info-item {
+  display: inline-block;
+}
+
+.info-item:not(:last-child)::after {
+  content: '·';
+  margin-left: 6px;
+  color: #c0c4cc;
+}
+
+/* 全局样式,确保下拉选项正确显示 */
+:global(.student-select-dropdown .el-select-dropdown__item) {
+  height: auto !important;
+  min-height: 32px !important;
+  padding: 4px 12px !important;
+}
+
+/* 附件上传容器样式 */
+.attachment-upload-container {
+  width: 100%;
+  max-height: calc(100vh - 650px);
+  min-height: 200px;
+  overflow-y: auto;
+  padding-right: 8px;
+  border: 1px solid #e4e7ed;
+  border-radius: 6px;
+  background: #fafafa;
+}
+
+/* 附件上传区域内容样式 */
+.attachment-upload-container .upload-demo {
+  padding: 12px;
+  min-height: 180px;
+}
+
+.attachment-upload-container .upload-demo .el-upload {
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+  transition: all 0.3s;
+}
+
+.attachment-upload-container .upload-demo .el-upload:hover {
+  border-color: #409eff;
+}
+
+.attachment-upload-container .upload-demo .el-upload__tip {
+  font-size: 12px;
+  color: #000000;
+  margin-top: 7px;
+}
+
+/* 调整拖拽上传图标与文字在同一行、居中对齐 */
+.attachment-upload-container .upload-demo .el-upload-dragger1 {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  gap: 15px;
+  padding: 0px !important;
+}
+
+.attachment-upload-container .upload-demo .el-upload-dragger1 .el-icon--upload {
+  margin: 0;
+  padding: 0px !important;
+}
+
+/* 文件卡片占位封面样式 */
+.attachment-upload-container .upload-demo .upload-file-placeholder {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  color: #909399;
+  font-size: 14px;
+}
+
+.attachment-upload-container .upload-demo .upload-file-placeholder .el-icon {
+  font-size: 28px;
+  margin-bottom: 4px;
+}
+
+.attachment-upload-container .upload-demo .upload-file-placeholder .file-ext {
+  font-size: 12px;
+  text-transform: uppercase;
+  text-align: center;
+}
+
+/* 让附件卡片一行展示 5 个 */
+.attachment-upload-container :deep(.el-upload-list--picture-card) {
+  display: grid;
+  grid-template-columns: repeat(5, 1fr);
+  gap: 9px;
+  margin-top: 12px;
+  padding-bottom: 16px;
+}
+
+/* 确保卡片宽度自适应 */
+.attachment-upload-container :deep(.el-upload-list--picture-card) .el-upload-list__item {
+  margin: 0;
+  height: 180px !important;
+  width: 100% !important;
+}
+
+:deep(.el-upload-dragger) {
+  border: 0px !important;
+  padding: 0px !important;
+}
+
+:deep(.el-upload-dragger) .el-upload-dragger1 {
+  border: 0px !important;
+  padding: 0px !important;
+}
+
+/* 文件卡片样式 */
+.upload-file-card {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  border-radius: 6px;
+  overflow: hidden;
+  background: #fff;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+  transition: all 0.3s;
+}
+
+.upload-file-card:hover {
+  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
+}
+
+.upload-file-thumb {
+  position: relative;
+  width: 100%;
+  height: 110px;
+  background: #f5f5f5;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  overflow: hidden;
+}
+
+.upload-thumb-image {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+
+.upload-file-loading {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  /* background: rgba(255, 255, 255, 0.9); */
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  z-index: 10;
+}
+
+.loading-text {
+  margin-top: 8px;
+  font-size: 12px;
+  color: #606266;
+}
+
+.upload-file-name {
+  padding: 6px 8px;
+  font-size: 11px;
+  color: #303133;
+  text-align: center;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background: #fafafa;
+  border-top: 1px solid #f0f0f0;
+  line-height: 1.2;
+  height: 32px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  word-break: break-all;
+  max-width: 100%;
+}
+
+.upload-file-card-actions {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 6px 8px;
+  background: #fafafa;
+  border-top: 1px solid #f0f0f0;
+  transition: all 0.3s;
+  height: 38px;
+}
+
+.upload-file-card-actions .el-button-group {
+  background: transparent;
+  border-radius: 4px;
+  padding: 0;
+}
+
+.upload-file-card-actions .el-button {
+  padding: 4px 8px;
+  border: 1px solid #e0e0e0;
+  background: #fff;
+  font-size: 12px;
+  margin: 0 2px;
+  border-radius: 3px;
+  transition: all 0.3s;
+}
+
+.upload-file-card-actions .el-button:hover {
+  background: #f5f5f5;
+  border-color: #409eff;
+}
+
+.upload-file-card-actions .el-button.is-disabled {
+  opacity: 0.5;
+  cursor: not-allowed;
+  background: #f5f5f5;
+}
+</style>