新增报名信息管理

This commit is contained in:
xiao-fajia 2024-07-27 18:02:04 +08:00
parent b18d595d0f
commit 8b4a0d0009
20 changed files with 520 additions and 27 deletions

View File

@ -0,0 +1,41 @@
package com.ruoyi.cms.api;
import com.ruoyi.cms.domain.HitCompetition;
import com.ruoyi.cms.service.IHitCompetitionService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 大赛信息Controller
*
* @author 点亮信息
* @date 2024-07-26
*/
@Anonymous
@RestController
@RequestMapping("/api/competition")
public class HitCompetitionAPI extends BaseController
{
@Autowired
private IHitCompetitionService competitionService;
/**
* 查询所有比赛
*/
@GetMapping("/list")
public AjaxResult getCompetition(HitCompetition competition){
startPage();
return success(competitionService.selectHitCompetitionList(competition));
}
}

View File

@ -0,0 +1,69 @@
package com.ruoyi.cms.api;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
import com.ruoyi.cms.export.HitRegistrationStudentInfoExport;
import com.ruoyi.cms.service.IHitRegistrationStudentInfoService;
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 报名信息Controller
*
* @author 点亮信息
* @date 2024-07-26
*/
@Anonymous
@RestController
@RequestMapping("/api/registerStudent")
public class HitRegistrationStudentInfoAPI extends BaseController
{
@Autowired
private IHitRegistrationStudentInfoService hitRegistrationStudentInfoService;
@Autowired
private IHitRegistrationTeachInfoService hitRegistrationTeachInfoService;
/**
* 报名接口
* @param studentInfo
* @return
*/
@PostMapping()
public AjaxResult register(@RequestBody HitRegistrationStudentInfo studentInfo){
return toAjax(hitRegistrationStudentInfoService.insertHitRegistrationStudentInfo(studentInfo));
}
/**
* 老师信息验证或插入
* @param teachInfo
* @return
*/
@PostMapping("/addTeach")
public AjaxResult addTeach(@RequestBody HitRegistrationTeachInfo teachInfo){
Long id = hitRegistrationTeachInfoService.checkExist(teachInfo);
if (id != null){
return success(id);
}else {
int flag = hitRegistrationTeachInfoService.insertHitRegistrationTeachInfo(teachInfo);
if (flag > 0) return success(teachInfo.getId());
else return error();
}
}
}

View File

@ -1,7 +1,15 @@
package com.ruoyi.cms.controller;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
import com.ruoyi.cms.export.HitRegistrationStudentInfoExport;
import com.ruoyi.cms.service.IHitRegistrationTeachInfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -34,17 +42,20 @@ public class HitRegistrationStudentInfoController extends BaseController
@Autowired
private IHitRegistrationStudentInfoService hitRegistrationStudentInfoService;
@Autowired
private IHitRegistrationTeachInfoService hitRegistrationTeachInfoService;
/**
* 查询报名信息列表
*/
@PreAuthorize("@ss.hasPermi('hit:hitRegistrationStudentInfo:list')")
@GetMapping("/list")
public TableDataInfo list(HitRegistrationStudentInfo hitRegistrationStudentInfo)
{
startPage();
List<HitRegistrationStudentInfo> list = hitRegistrationStudentInfoService.selectHitRegistrationStudentInfoList(hitRegistrationStudentInfo);
return getDataTable(list);
}
// @PreAuthorize("@ss.hasPermi('hit:hitRegistrationStudentInfo:list')")
// @GetMapping("/list")
// public TableDataInfo list(HitRegistrationStudentInfo hitRegistrationStudentInfo)
// {
// startPage();
// List<HitRegistrationStudentInfo> list = hitRegistrationStudentInfoService.selectHitRegistrationStudentInfoList(hitRegistrationStudentInfo);
// return getDataTable(list);
// }
/**
* 导出报名信息列表
@ -52,11 +63,20 @@ public class HitRegistrationStudentInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('hit:hitRegistrationStudentInfo:export')")
@Log(title = "报名信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HitRegistrationStudentInfo hitRegistrationStudentInfo)
public void export(HttpServletResponse response, HitRegistrationStudentInfoVo studentInfoVo)
{
List<HitRegistrationStudentInfo> list = hitRegistrationStudentInfoService.selectHitRegistrationStudentInfoList(hitRegistrationStudentInfo);
ExcelUtil<HitRegistrationStudentInfo> util = new ExcelUtil<HitRegistrationStudentInfo>(HitRegistrationStudentInfo.class);
util.exportExcel(response, list, "报名信息数据");
List<HitRegistrationStudentInfoVo> list = hitRegistrationStudentInfoService.selectStudentInfoNew(studentInfoVo);
/** 转换为excel要的字段 */
List<HitRegistrationStudentInfoExport> result = list.stream().map(item -> {
HitRegistrationStudentInfoExport export = new HitRegistrationStudentInfoExport();
BeanUtil.copyProperties(item, export);
export.setLeaderNames(String.join(",", item.getLeaderNames()));
export.setGuideNames(String.join(",", item.getGuideNames()));
return export;
}).collect(Collectors.toList());
ExcelUtil<HitRegistrationStudentInfoExport> util = new ExcelUtil<HitRegistrationStudentInfoExport>(HitRegistrationStudentInfoExport.class);
util.exportExcel(response, result, "报名信息数据");
}
/**
@ -101,4 +121,26 @@ public class HitRegistrationStudentInfoController extends BaseController
{
return toAjax(hitRegistrationStudentInfoService.deleteHitRegistrationStudentInfoByIds(ids));
}
/**
* 自定义查询
* @param studentInfoVo
* @return
*/
@PreAuthorize("@ss.hasPermi('hit:hitRegistrationStudentInfo:list')")
@GetMapping("/list")
public TableDataInfo list(HitRegistrationStudentInfoVo studentInfoVo)
{
startPage();
List<HitRegistrationStudentInfoVo> list = hitRegistrationStudentInfoService.selectStudentInfoNew(studentInfoVo);
return getDataTable(list);
}
/**
* 查询老师信息
*/
@GetMapping("/getTeach/{ids}")
public AjaxResult getTeachInfo(@PathVariable Long[] ids){
return success(hitRegistrationTeachInfoService.listByIds(Arrays.asList(ids)));
}
}

View File

@ -46,7 +46,7 @@ public class HitCompetition extends BaseEntity
private Date regEndTime;
/** 大赛类型("0":团队赛,"1":个人赛,默认"0" */
@Excel(name = "大赛类型", readConverterExp = "0团队赛1个人赛默认0")
@Excel(name = "大赛类型", readConverterExp = "0=团队赛,1=个人赛")
private String competitionType;
/** 逻辑删除0未删除1真删除 */

View File

@ -0,0 +1,72 @@
package com.ruoyi.cms.domain.vo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
@Data
public class HitRegistrationStudentInfoVo extends BaseEntity {
/** 报名信息ID */
private Long id;
/** 大赛ID */
private Long competitionId;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String stuName;
/** 学生性别01 */
@Excel(name = "学生性别", readConverterExp = "0=男,1=女")
private String stuGender;
/** 学生专业 */
@Excel(name = "学生专业")
private String stuMajor;
/** 学生手机号 */
@Excel(name = "学生手机号")
private String stuNumber;
/** 学校及院系名称 */
@Excel(name = "学校及院系名称")
private String schoolName;
/** 所属赛区 */
@Excel(name = "所属赛区")
private String division;
/** 团队名称(个人赛不需求,可以为空) */
@Excel(name = "团队名称")
private String teamName;
/** 领队教师ID集合 */
private List<String> leaderIds;
/** 指导老师ID集合 */
private List<String> guideIds;
/** 老师名字 查询用 */
private String teachName;
/** 逻辑删除0未删除1真删除 */
private Integer delFlag;
/** 大赛名称 */
@Excel(name = "大赛名称")
private String competitionName;
/** 大赛类型("0":团队赛,"1":个人赛,默认"0" */
@Excel(name = "大赛类型", readConverterExp = "0=团队赛,1=个人赛")
private String competitionType;
/** 带队老师姓名集合 */
@Excel(name = "领队老师")
private List<String> leaderNames;
/** 指导老师姓名集合 */
@Excel(name = "指导老师")
private List<String> guideNames;
}

View File

@ -0,0 +1,51 @@
package com.ruoyi.cms.export;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
@Data
public class HitRegistrationStudentInfoExport{
/** 学生姓名 */
@Excel(name = "学生姓名")
private String stuName;
/** 学生性别01 */
@Excel(name = "学生性别", readConverterExp = "0=男,1=女")
private String stuGender;
/** 学生专业 */
@Excel(name = "学生专业")
private String stuMajor;
/** 学生手机号 */
@Excel(name = "学生手机号")
private String stuNumber;
/** 学校及院系名称 */
@Excel(name = "学校及院系名称")
private String schoolName;
/** 所属赛区 */
@Excel(name = "所属赛区")
private String division;
/** 团队名称(个人赛不需求,可以为空) */
@Excel(name = "团队名称")
private String teamName;
/** 大赛名称 */
@Excel(name = "大赛名称")
private String competitionName;
/** 大赛类型("0":团队赛,"1":个人赛,默认"0" */
@Excel(name = "大赛类型", readConverterExp = "0=团队赛,1=个人赛")
private String competitionType;
/** 带队老师姓名集合 */
@Excel(name = "领队老师")
private String leaderNames;
/** 指导老师姓名集合 */
@Excel(name = "指导老师")
private String guideNames;
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.cms.domain.HitRegistrationTeachInfo;
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
/**
* 报名信息Mapper接口
@ -61,4 +62,11 @@ public interface HitRegistrationStudentInfoMapper extends BaseMapper<HitRegistra
* @return 结果
*/
public int deleteHitRegistrationStudentInfoByIds(Long[] ids);
/**
* 自定义查询
* @param studentInfoVo
* @return
*/
public List<HitRegistrationStudentInfoVo> selectStudentInfoNew(HitRegistrationStudentInfoVo studentInfoVo);
}

View File

@ -61,4 +61,11 @@ public interface HitRegistrationTeachInfoMapper extends BaseMapper<HitRegistrati
* @return 结果
*/
public int deleteHitRegistrationTeachInfoByIds(Long[] ids);
/**
* 检查老师信息是否已存在
* @param teachInfo
* @return 数据的ID
*/
Long checkExist(HitRegistrationTeachInfo teachInfo);
}

View File

@ -3,7 +3,9 @@ package com.ruoyi.cms.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
/**
* 报名信息Service接口
@ -60,4 +62,11 @@ public interface IHitRegistrationStudentInfoService extends IService<HitRegistra
* @return 结果
*/
public int deleteHitRegistrationStudentInfoById(Long id);
/**
* 自定义查询
* @param studentInfoVo
* @return
*/
public List<HitRegistrationStudentInfoVo> selectStudentInfoNew(HitRegistrationStudentInfoVo studentInfoVo);
}

View File

@ -60,4 +60,11 @@ public interface IHitRegistrationTeachInfoService extends IService<HitRegistrati
* @return 结果
*/
public int deleteHitRegistrationTeachInfoById(Long id);
/**
* 检查老师信息是否已存在
* @param teachInfo
* @return
*/
Long checkExist(HitRegistrationTeachInfo teachInfo);
}

View File

@ -146,6 +146,7 @@ public class CmsContentServiceImpl extends ServiceImpl<CmsContentMapper, CmsCont
content.setId(id);
content.setUpdateBy(username);
content.setUpdateTime(new Date());
content.setOfflineDate(new Date());
content.setStatus("2");
result += baseMapper.updateById(content);
}
@ -158,6 +159,7 @@ public class CmsContentServiceImpl extends ServiceImpl<CmsContentMapper, CmsCont
content.setId(id);
content.setUpdateBy(username);
content.setUpdateTime(new Date());
content.setPublishDate(new Date());
content.setStatus("1");
result += baseMapper.updateById(content);
}

View File

@ -2,7 +2,10 @@ package com.ruoyi.cms.service.impl;
import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
import com.ruoyi.cms.domain.vo.HitRegistrationStudentInfoVo;
import com.ruoyi.cms.mapper.HitRegistrationStudentInfoMapper;
import com.ruoyi.cms.service.IHitRegistrationStudentInfoService;
import com.ruoyi.common.utils.DateUtils;
@ -97,4 +100,14 @@ public class HitRegistrationStudentInfoServiceImpl extends ServiceImpl<HitRegist
{
return baseMapper.deleteHitRegistrationStudentInfoById(id);
}
/**
* 自定义查询
* @param studentInfoVo
* @return
*/
@Override
public List<HitRegistrationStudentInfoVo> selectStudentInfoNew(HitRegistrationStudentInfoVo studentInfoVo){
return baseMapper.selectStudentInfoNew(studentInfoVo);
}
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.cms.service.impl;
import java.util.List;
import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
@ -98,4 +99,14 @@ public class HitRegistrationTeachInfoServiceImpl extends ServiceImpl<HitRegistra
{
return baseMapper.deleteHitRegistrationTeachInfoById(id);
}
/**
* 检查老师信息是否已存在
* @param teachInfo
* @return 数据的ID
*/
@Override
public Long checkExist(HitRegistrationTeachInfo teachInfo){
return baseMapper.checkExist(teachInfo);
}
}

View File

@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="isFrame != null "> and is_frame = #{isFrame}</if>
<if test="isDisable != null "> and is_disable = #{isDisable}</if>
and del_flag = 0
</where>
order by parent_id, category_sort
</select>

View File

@ -124,4 +124,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<!-- 自定义-->
<sql id="selectHitRegistrationStudentInfoVoNew">
select
id, competition_id, stu_name, stu_gender, stu_major, stu_number, school_name, division, team_name, leader_ids, guide_ids, remark,del_flag, create_time, create_by, update_time, update_by,competition_name, competition_type, leader_names, guide_names
from
(SELECT
s.id, s.competition_id, s.stu_name, s.stu_gender, s.stu_major, s.stu_number, s.school_name, s.division, s.team_name, s.leader_ids, s.guide_ids, s.remark, s.del_flag, s.create_time, s.create_by, s.update_time, s.update_by,c.competition_name, c.competition_type,
CONCAT('[',
GROUP_CONCAT(JSON_QUOTE(t.teacher_name) ORDER BY t.teacher_name SEPARATOR ','),
']') AS leader_names
FROM
hit_registration_student_info s
LEFT JOIN
hit_registration_teach_info t ON JSON_CONTAINS(s.leader_ids, CAST(t.id AS JSON), '$')
LEFT JOIN
hit_competition c on c.id = s.competition_id
GROUP BY
s.id) as t1,
(SELECT
s.id AS student_id,
CONCAT('[',
GROUP_CONCAT(JSON_QUOTE(t.teacher_name) ORDER BY t.teacher_name SEPARATOR ','),
']') AS guide_names
FROM
hit_registration_student_info s
LEFT JOIN
hit_registration_teach_info t ON JSON_CONTAINS(s.guide_ids, CAST(t.id AS JSON), '$')
GROUP BY
s.id) as t2
where t1.id = t2.student_id
</sql>
<resultMap type="hitRegistrationStudentInfoVo" id="StudentInfoVoNew">
<result property="id" column="id" />
<result property="competitionId" column="competition_id" />
<result property="stuName" column="stu_name" />
<result property="stuGender" column="stu_gender" />
<result property="stuMajor" column="stu_major" />
<result property="stuNumber" column="stu_number" />
<result property="schoolName" column="school_name" />
<result property="division" column="division" />
<result property="teamName" column="team_name" />
<result property="leaderIds" column="leader_ids" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler" />
<result property="guideIds" column="guide_ids" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="competitionName" column="competition_name" />
<result property="competitionType" column="competition_type" />
<result property="leaderNames" column="leader_names" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler" />
<result property="guideNames" column="guide_names" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler" />
</resultMap>
<select id="selectStudentInfoNew" parameterType="hitRegistrationStudentInfoVo" resultMap="StudentInfoVoNew">
<include refid="selectHitRegistrationStudentInfoVoNew"/>
<if test="competitionName != null and competitionName != ''"> and competition_name like concat('%', #{competitionName}, '%')</if>
<if test="stuName != null and stuName != ''"> and stu_name like concat('%', #{stuName}, '%')</if>
<if test="stuGender != null "> and stu_gender = #{stuGender}</if>
<if test="stuMajor != null and stuMajor != ''"> and stu_major = #{stuMajor}</if>
<if test="stuNumber != null and stuNumber != ''"> and stu_number like concat('%', #{stuNumber}, '%')</if>
<if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
<if test="division != null and division != ''"> and division like concat('%', #{division}, '%')</if>
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
<if test="teachName != null and teachName != ''"> and (leader_names like concat('%', #{teachName}, '%') or guide_names like concat('%', #{teachName}, '%'))</if>
<if test="competitionType != null">and competition_type = #{competitionType}</if>
</select>
</mapper>

View File

@ -89,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteHitRegistrationTeachInfoById" parameterType="Long">
delete from hit_registration_teach_info where id = #{id}
</delete>
@ -99,4 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="checkExist" resultType="java.lang.Long" parameterType="hitRegistrationTeachInfo">
select id from hit_registration_teach_info where teacher_name = #{teacherName} and teacher_job = #{teacherJob} and teacher_number = #{teacherNumber} and teacher_email = #{teacherEmail} and teacher_school = #{teacherSchool} limit 1
</select>
</mapper>

View File

@ -42,3 +42,11 @@ export function delHitRegistrationStudentInfo(id) {
method: 'delete'
})
}
//获取老师信息
export function getTeachInfoByIds(ids){
return request({
url: '/hit/hitRegistrationStudentInfo/getTeach/' + ids,
method: "get",
})
}

View File

@ -110,7 +110,17 @@
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="发布时间" align="center" prop="publishDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.publishDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="下线时间" align="center" prop="offlineDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.offlineDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column

View File

@ -154,12 +154,9 @@ export default {
},
data() {
return {
uploadLimit: 1,
openResourceDialog: false,
imgUploadUrl: process.env.VUE_APP_BASE_API + "/ueditor/config?action=uploadimage",
isType: "0",
activeName: "basic",
summaryInputSize: {minRows: 3, maxRows: 6},
//
form: {
contentType: "0",

View File

@ -50,7 +50,7 @@
<el-form-item label="大赛类型" prop="">
<el-select
v-model="queryParams.competitionType"
placeholder="内容类型"
placeholder="大赛类型"
clearable
style="width: 125px">
<el-option
@ -77,7 +77,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="师名称" prop="teachName">
<el-form-item label="师名称" prop="teachName">
<el-input
v-model="queryParams.teachName"
placeholder="请输入团队名称"
@ -124,22 +124,52 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="HitRegistrationStudentInfoList" @selection-change="handleSelectionChange">
<el-table @expand-change="getTeachInfo" style="width: 100%; table-layout: auto" v-loading="loading" :data="HitRegistrationStudentInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="expand">
<template slot-scope="props">
<el-descriptions title="学生信息" style="margin-left: 100px">
<el-descriptions-item label="比赛名称">{{props.row.competitionName}}</el-descriptions-item>
<el-descriptions-item label="学生姓名">{{props.row.stuName}}</el-descriptions-item>
<el-descriptions-item label="学生性别">
<dict-tag :options="dict.type.sys_user_sex" :value="props.row.stuGender"/>
</el-descriptions-item>
<el-descriptions-item label="学生专业">{{props.row.stuMajor}}</el-descriptions-item>
<el-descriptions-item label="学生手机号">{{props.row.stuNumber}}</el-descriptions-item>
<el-descriptions-item label="学校及院系名称">{{props.row.schoolName}}</el-descriptions-item>
<el-descriptions-item label="所属赛区">{{props.row.division}}</el-descriptions-item>
<el-descriptions-item label="团队名称">{{props.row.teamName}}</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'领队教师' + (index + 1)" v-for="(item, index) in leaderTeachList" style="margin-left: 100px" v-show="leaderTeachList !== null && leaderTeachList.length !== 0">
<el-descriptions-item label="教师姓名">{{item.teacherName}}</el-descriptions-item>
<el-descriptions-item label="教师职务">{{item.teacherJob}}</el-descriptions-item>
<el-descriptions-item label="教师手机号">{{item.teacherNumber}}</el-descriptions-item>
<el-descriptions-item label="教师邮箱">{{item.teacherEmail}}</el-descriptions-item>
<el-descriptions-item label="教师所在系及专业">{{item.teacherSchool}}</el-descriptions-item>
</el-descriptions>
<el-descriptions :title="'指导教师' + (index + 1)" v-for="(item, index) in guideTeachList" style="margin-left: 100px" v-show="guideTeachList !== null && guideTeachList.length !== 0">
<el-descriptions-item label="教师姓名">{{item.teacherName}}</el-descriptions-item>
<el-descriptions-item label="教师职务">{{item.teacherJob}}</el-descriptions-item>
<el-descriptions-item label="教师手机号">{{item.teacherNumber}}</el-descriptions-item>
<el-descriptions-item label="教师邮箱">{{item.teacherEmail}}</el-descriptions-item>
<el-descriptions-item label="教师所在系及专业">{{item.teacherSchool}}</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column label="比赛名称" align="center" prop="competitionName" />
<el-table-column label="学生姓名" align="center" prop="stuName" />
<el-table-column label="学生性别" align="center" prop="stuGender">
<el-table-column label="学生性别" align="center" prop="stuGender" width="100px">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.stuGender"/>
</template>
</el-table-column>
<el-table-column label="学生专业" align="center" prop="stuMajor" />
<el-table-column label="学生手机号" align="center" prop="stuNumber" />
<el-table-column label="学校及院系名称" align="center" prop="schoolName" />
<el-table-column label="学校及院系名称" align="center" prop="schoolName" width="120px"/>
<el-table-column label="所属赛区" align="center" prop="division" />
<el-table-column label="团队名称" align="center" prop="teamName" />
<el-table-column label="领队教师" align="center" prop="leaderIds" />
<el-table-column label="指导老师" align="center" prop="guideIds" />
<el-table-column label="领队教师" align="center" prop="leaderNames" />
<el-table-column label="指导教师" align="center" prop="guideNames" width="120px" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -165,13 +195,22 @@
</template>
<script>
import { listHitRegistrationStudentInfo, getHitRegistrationStudentInfo, delHitRegistrationStudentInfo, addHitRegistrationStudentInfo, updateHitRegistrationStudentInfo } from "@/api/hit/registrationStudentInfo";
import {
listHitRegistrationStudentInfo,
getHitRegistrationStudentInfo,
delHitRegistrationStudentInfo,
addHitRegistrationStudentInfo,
updateHitRegistrationStudentInfo,
getTeachInfoByIds
} from "@/api/hit/registrationStudentInfo";
export default {
name: "HitRegistrationStudentInfo",
dicts: ['sys_user_sex', 'competition_type'],
data() {
return {
leaderTeachList:[],
guideTeachList:[],
//
loading: true,
//
@ -246,6 +285,10 @@ export default {
this.loading = true;
listHitRegistrationStudentInfo(this.queryParams).then(response => {
this.HitRegistrationStudentInfoList = response.rows;
this.HitRegistrationStudentInfoList.forEach(item => {
item.leaderNames = item.leaderNames.join(",")
item.guideNames = item.guideNames.join(",")
})
this.total = response.total;
this.loading = false;
});
@ -342,10 +385,37 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('registrationStudentInfo/registrationStudentInfo/export', {
this.download('hit/hitRegistrationStudentInfo/export', {
...this.queryParams
}, `HitRegistrationStudentInfo_${new Date().getTime()}.xlsx`)
}
},
getTeachInfo(row){
if (row.leaderIds !== null && row.leaderIds.length !== 0){
getTeachInfoByIds(row.leaderIds).then(res => {
this.leaderTeachList = res.data
})
}
if (row.guideIds !== null && row.guideIds.length !== 0){
getTeachInfoByIds(row.guideIds).then(res => {
this.guideTeachList = res.data
})
}
},
}
};
</script>
<style scoped lang="scss">
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
</style>