Compare commits
2 Commits
dc25681010
...
602e2984a4
Author | SHA1 | Date | |
---|---|---|---|
|
602e2984a4 | ||
|
e45aa1642d |
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.cms.api;
|
||||
|
||||
import com.ruoyi.cms.domain.Imitation;
|
||||
import com.ruoyi.cms.service.IImitationService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/imitation")
|
||||
public class ImitationAPI extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IImitationService imitationService;
|
||||
|
||||
@RequestMapping("/list")
|
||||
public TableDataInfo getImitation(Imitation imitation){
|
||||
startPage();
|
||||
return getDataTable(imitationService.selectImitationList(imitation));
|
||||
}
|
||||
|
||||
@RequestMapping("/{id}")
|
||||
public AjaxResult getImitationById(@PathVariable Long id){
|
||||
return success(imitationService.selectImitationById(id));
|
||||
}
|
||||
}
|
@ -2,16 +2,11 @@ package com.ruoyi.cms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@ -23,14 +18,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 基础信息Controller
|
||||
*
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-07-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cms/baseInfo")
|
||||
public class BaseInfoController extends BaseController
|
||||
{
|
||||
public class BaseInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseInfoService baseInfoService;
|
||||
|
||||
@ -40,8 +34,7 @@ public class BaseInfoController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('cms:baseInfo:edit')")
|
||||
@Log(title = "基础信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseInfo baseInfo)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody BaseInfo baseInfo) {
|
||||
return toAjax(baseInfoService.updateBaseInfo(baseInfo));
|
||||
}
|
||||
|
||||
@ -49,7 +42,16 @@ public class BaseInfoController extends BaseController
|
||||
* 查询
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult selectBaseInfo(){
|
||||
public AjaxResult selectBaseInfo() {
|
||||
return success(baseInfoService.getBaseInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报名状态
|
||||
*/
|
||||
@GetMapping("/updateRegister")
|
||||
public AjaxResult updateStatus(@RequestParam("status") String status) {
|
||||
baseInfoService.updateRegisterStatus(status);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.cms.domain.Imitation;
|
||||
import com.ruoyi.cms.service.IImitationService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 虚仿真课Controller
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/hit/imitation")
|
||||
public class ImitationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IImitationService imitationService;
|
||||
|
||||
/**
|
||||
* 查询虚仿真课列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Imitation imitation)
|
||||
{
|
||||
startPage();
|
||||
List<Imitation> list = imitationService.selectImitationList(imitation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出虚仿真课列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:export')")
|
||||
@Log(title = "虚仿真课", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Imitation imitation)
|
||||
{
|
||||
List<Imitation> list = imitationService.selectImitationList(imitation);
|
||||
ExcelUtil<Imitation> util = new ExcelUtil<Imitation>(Imitation.class);
|
||||
util.exportExcel(response, list, "虚仿真课数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取虚仿真课详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(imitationService.selectImitationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增虚仿真课
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:add')")
|
||||
@Log(title = "虚仿真课", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Imitation imitation)
|
||||
{
|
||||
return toAjax(imitationService.insertImitation(imitation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改虚仿真课
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:edit')")
|
||||
@Log(title = "虚仿真课", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Imitation imitation)
|
||||
{
|
||||
return toAjax(imitationService.updateImitation(imitation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除虚仿真课
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('hit:imitation:remove')")
|
||||
@Log(title = "虚仿真课", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(imitationService.deleteImitationByIds(ids));
|
||||
}
|
||||
}
|
@ -47,4 +47,7 @@ public class BaseInfo extends BaseEntity
|
||||
/** 版权信息 */
|
||||
@Excel(name = "版权信息")
|
||||
private String copyrightInfo;
|
||||
|
||||
/** 是否可以报名 */
|
||||
private String registerStatus;
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 虚仿真课对象 imitation
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-02
|
||||
*/
|
||||
@Data
|
||||
public class Imitation extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long id;
|
||||
|
||||
/** 课程标题 */
|
||||
@Excel(name = "课程标题")
|
||||
private String imitationTitle;
|
||||
|
||||
/** 课程简介 */
|
||||
@Excel(name = "课程简介")
|
||||
private String imitationSummary;
|
||||
|
||||
/** 课程老师 */
|
||||
@Excel(name = "课程老师")
|
||||
private String imitationTeach;
|
||||
|
||||
/** 课程学校 */
|
||||
@Excel(name = "课程学校")
|
||||
private String imitationSchool;
|
||||
|
||||
/** 课程链接 */
|
||||
@Excel(name = "课程链接")
|
||||
private String imitationLink;
|
||||
|
||||
/** 课程阅览量 */
|
||||
@Excel(name = "课程阅览量")
|
||||
private Long imitationCount;
|
||||
|
||||
/** 课程类别(0=没有,1=国一流,2=省一流) */
|
||||
@Excel(name = "课程类别(0=没有,1=国一流,2=省一流)")
|
||||
private Integer imitationType;
|
||||
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 缩略图 */
|
||||
private String imitationImage;
|
||||
}
|
@ -4,6 +4,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -69,4 +70,7 @@ public class HitRegistrationStudentInfoVo extends BaseEntity {
|
||||
/** 指导老师姓名集合 */
|
||||
@Excel(name = "指导老师")
|
||||
private List<String> guideNames;
|
||||
|
||||
/** 时间 */
|
||||
private Date createTime;
|
||||
}
|
||||
|
@ -28,4 +28,9 @@ public interface BaseInfoMapper extends BaseMapper<BaseInfo>
|
||||
* @return
|
||||
*/
|
||||
public BaseInfo selectBaseInfo();
|
||||
|
||||
/**
|
||||
* 修改报名状态
|
||||
*/
|
||||
public int updateRegisterStatusInt(String status);
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cms.domain.Imitation;
|
||||
|
||||
/**
|
||||
* 虚仿真课Mapper接口
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-02
|
||||
*/
|
||||
public interface ImitationMapper extends BaseMapper<Imitation>
|
||||
{
|
||||
/**
|
||||
* 查询虚仿真课
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 虚仿真课
|
||||
*/
|
||||
public Imitation selectImitationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询虚仿真课列表
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 虚仿真课集合
|
||||
*/
|
||||
public List<Imitation> selectImitationList(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 新增虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertImitation(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 修改虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateImitation(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 删除虚仿真课
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteImitationById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除虚仿真课
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteImitationByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 计数加1
|
||||
*/
|
||||
public void addCount(Long id);
|
||||
}
|
@ -26,4 +26,9 @@ public interface IBaseInfoService extends IService<BaseInfo>
|
||||
*/
|
||||
public BaseInfo getBaseInfo();
|
||||
|
||||
/**
|
||||
* 修改报名状态
|
||||
*/
|
||||
public void updateRegisterStatus(String status);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.Imitation;
|
||||
|
||||
/**
|
||||
* 虚仿真课Service接口
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-02
|
||||
*/
|
||||
public interface IImitationService extends IService<Imitation>
|
||||
{
|
||||
/**
|
||||
* 查询虚仿真课
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 虚仿真课
|
||||
*/
|
||||
public Imitation selectImitationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询虚仿真课列表
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 虚仿真课集合
|
||||
*/
|
||||
public List<Imitation> selectImitationList(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 新增虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertImitation(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 修改虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateImitation(Imitation imitation);
|
||||
|
||||
/**
|
||||
* 批量删除虚仿真课
|
||||
*
|
||||
* @param ids 需要删除的虚仿真课主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteImitationByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除虚仿真课信息
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteImitationById(Long id);
|
||||
}
|
@ -42,4 +42,11 @@ public class BaseInfoServiceImpl extends ServiceImpl<BaseInfoMapper, BaseInfo> i
|
||||
return baseMapper.selectBaseInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报名状态
|
||||
*/
|
||||
@Override
|
||||
public void updateRegisterStatus(String status){
|
||||
baseMapper.updateRegisterStatusInt(status);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,101 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.cms.mapper.ImitationMapper;
|
||||
import com.ruoyi.cms.domain.Imitation;
|
||||
import com.ruoyi.cms.service.IImitationService;
|
||||
|
||||
/**
|
||||
* 虚仿真课Service业务层处理
|
||||
*
|
||||
* @author 点亮信息
|
||||
* @date 2024-08-02
|
||||
*/
|
||||
@Service
|
||||
public class ImitationServiceImpl extends ServiceImpl<ImitationMapper, Imitation> implements IImitationService
|
||||
{
|
||||
@Autowired
|
||||
private Snowflake snowflake;
|
||||
|
||||
/**
|
||||
* 查询虚仿真课
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 虚仿真课
|
||||
*/
|
||||
@Override
|
||||
public Imitation selectImitationById(Long id)
|
||||
{
|
||||
baseMapper.addCount(id);
|
||||
return baseMapper.selectImitationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询虚仿真课列表
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 虚仿真课
|
||||
*/
|
||||
@Override
|
||||
public List<Imitation> selectImitationList(Imitation imitation)
|
||||
{
|
||||
return baseMapper.selectImitationList(imitation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertImitation(Imitation imitation)
|
||||
{
|
||||
imitation.setId(snowflake.nextId());
|
||||
imitation.setCreateTime(DateUtils.getNowDate());
|
||||
return baseMapper.insertImitation(imitation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改虚仿真课
|
||||
*
|
||||
* @param imitation 虚仿真课
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateImitation(Imitation imitation)
|
||||
{
|
||||
imitation.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseMapper.updateImitation(imitation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除虚仿真课
|
||||
*
|
||||
* @param ids 需要删除的虚仿真课主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteImitationByIds(Long[] ids)
|
||||
{
|
||||
return baseMapper.deleteImitationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除虚仿真课信息
|
||||
*
|
||||
* @param id 虚仿真课主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteImitationById(Long id)
|
||||
{
|
||||
return baseMapper.deleteImitationById(id);
|
||||
}
|
||||
}
|
@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="webImg" column="web_img" />
|
||||
<result property="recordInfo" column="record_info" />
|
||||
<result property="copyrightInfo" column="copyright_info" />
|
||||
<result property="registerStatus" column="register_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseInfoVo">
|
||||
select id, web_name, contact_number, contact_email, address, web_img, record_info, copyright_info from base_info
|
||||
select id, web_name, contact_number, contact_email, address, web_img, record_info, copyright_info, register_status from base_info
|
||||
</sql>
|
||||
|
||||
|
||||
@ -35,6 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateRegisterStatusInt" parameterType="String">
|
||||
update base_info set register_status = #{status};
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectBaseInfo" resultType="com.ruoyi.cms.domain.BaseInfo">
|
||||
<include refid="selectBaseInfoVo" />
|
||||
|
@ -193,5 +193,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
<if test="createTime != null">and YEAR(create_time) = YEAR(#{createTime})</if>
|
||||
</select>
|
||||
</mapper>
|
119
ruoyi-admin/src/main/resources/mapper/cms/ImitationMapper.xml
Normal file
119
ruoyi-admin/src/main/resources/mapper/cms/ImitationMapper.xml
Normal file
@ -0,0 +1,119 @@
|
||||
<?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="com.ruoyi.cms.mapper.ImitationMapper">
|
||||
|
||||
<resultMap type="Imitation" id="ImitationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="imitationTitle" column="imitation_title" />
|
||||
<result property="imitationSummary" column="imitation_summary" />
|
||||
<result property="imitationTeach" column="imitation_teach" />
|
||||
<result property="imitationSchool" column="imitation_school" />
|
||||
<result property="imitationLink" column="imitation_link" />
|
||||
<result property="imitationCount" column="imitation_count" />
|
||||
<result property="imitationType" column="imitation_type" />
|
||||
<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="imitationImage" column="imitation_image" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectImitationVo">
|
||||
select id, imitation_image, imitation_title, imitation_summary, imitation_teach, imitation_school, imitation_link, imitation_count, imitation_type, remark, del_flag, create_time, create_by, update_time, update_by from imitation
|
||||
</sql>
|
||||
|
||||
<select id="selectImitationList" parameterType="Imitation" resultMap="ImitationResult">
|
||||
<include refid="selectImitationVo"/>
|
||||
<where>
|
||||
<if test="imitationTitle != null and imitationTitle != ''"> and imitation_title like concat('%', #{imitationTitle}, '%')</if>
|
||||
<if test="imitationSummary != null and imitationSummary != ''"> and imitation_summary like concat('%', #{imitationSummary}, '%')</if>
|
||||
<if test="imitationTeach != null and imitationTeach != ''"> and imitation_teach like concat('%', #{imitationTeach}, '%')</if>
|
||||
<if test="imitationSchool != null and imitationSchool != ''"> and imitation_school like concat('%', #{imitationSchool}, '%')</if>
|
||||
<if test="imitationLink != null and imitationLink != ''"> and imitation_link = #{imitationLink}</if>
|
||||
<if test="imitationCount != null "> and imitation_count = #{imitationCount}</if>
|
||||
<if test="imitationType != null "> and imitation_type = #{imitationType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectImitationById" parameterType="Long" resultMap="ImitationResult">
|
||||
<include refid="selectImitationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertImitation" parameterType="Imitation">
|
||||
insert into imitation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="imitationTitle != null and imitationTitle != ''">imitation_title,</if>
|
||||
<if test="imitationSummary != null and imitationSummary != ''">imitation_summary,</if>
|
||||
<if test="imitationTeach != null and imitationTeach != ''">imitation_teach,</if>
|
||||
<if test="imitationSchool != null and imitationSchool != ''">imitation_school,</if>
|
||||
<if test="imitationLink != null and imitationLink != ''">imitation_link,</if>
|
||||
<if test="imitationCount != null">imitation_count,</if>
|
||||
<if test="imitationType != null">imitation_type,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="imitationImage != null">imitation_image,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="imitationTitle != null and imitationTitle != ''">#{imitationTitle},</if>
|
||||
<if test="imitationSummary != null and imitationSummary != ''">#{imitationSummary},</if>
|
||||
<if test="imitationTeach != null and imitationTeach != ''">#{imitationTeach},</if>
|
||||
<if test="imitationSchool != null and imitationSchool != ''">#{imitationSchool},</if>
|
||||
<if test="imitationLink != null and imitationLink != ''">#{imitationLink},</if>
|
||||
<if test="imitationCount != null">#{imitationCount},</if>
|
||||
<if test="imitationType != null">#{imitationType},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="imitationImage != null">#{imitationImage},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="addCount" parameterType="Long">
|
||||
update imitation set imitation_count = imitation_count + 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateImitation" parameterType="Imitation">
|
||||
update imitation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="imitationTitle != null and imitationTitle != ''">imitation_title = #{imitationTitle},</if>
|
||||
<if test="imitationSummary != null and imitationSummary != ''">imitation_summary = #{imitationSummary},</if>
|
||||
<if test="imitationTeach != null and imitationTeach != ''">imitation_teach = #{imitationTeach},</if>
|
||||
<if test="imitationSchool != null and imitationSchool != ''">imitation_school = #{imitationSchool},</if>
|
||||
<if test="imitationLink != null and imitationLink != ''">imitation_link = #{imitationLink},</if>
|
||||
<if test="imitationCount != null">imitation_count = #{imitationCount},</if>
|
||||
<if test="imitationType != null">imitation_type = #{imitationType},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="imitationImage != null">update_by = #{imitationImage},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteImitationById" parameterType="Long">
|
||||
delete from imitation where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteImitationByIds" parameterType="String">
|
||||
delete from imitation where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -41,3 +41,9 @@ export function delBaseInfo(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function editStatus(status){
|
||||
return request({
|
||||
url: "/cms/baseInfo/updateRegister?status=" + status,
|
||||
})
|
||||
}
|
||||
|
44
ruoyi-ui/src/api/hit/imitation.js
Normal file
44
ruoyi-ui/src/api/hit/imitation.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询虚仿真课列表
|
||||
export function listImitation(query) {
|
||||
return request({
|
||||
url: '/hit/imitation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询虚仿真课详细
|
||||
export function getImitation(id) {
|
||||
return request({
|
||||
url: '/hit/imitation/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增虚仿真课
|
||||
export function addImitation(data) {
|
||||
return request({
|
||||
url: '/hit/imitation',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改虚仿真课
|
||||
export function updateImitation(data) {
|
||||
return request({
|
||||
url: '/hit/imitation',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除虚仿真课
|
||||
export function delImitation(id) {
|
||||
return request({
|
||||
url: '/hit/imitation/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -176,11 +176,6 @@ export default {
|
||||
defaultValue: undefined,
|
||||
required: false
|
||||
},
|
||||
temp: {
|
||||
type: String,
|
||||
defaultValue: undefined,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -198,7 +193,6 @@ export default {
|
||||
delFlag: "0",
|
||||
},
|
||||
total: 0,
|
||||
tempType: "0",
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -211,9 +205,6 @@ export default {
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
temp(newVal){
|
||||
this.tempType = newVal
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.cid === "") {
|
||||
@ -226,7 +217,7 @@ export default {
|
||||
methods: {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push({path: '/content/editor', query: {"categoryId": this.queryParams.categoryId, "temp": this.tempType}})
|
||||
this.$router.push({path: '/content/editor', query: {"categoryId": this.queryParams.categoryId}})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
@ -30,7 +30,7 @@
|
||||
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
||||
<!-- 内容列表-->
|
||||
<el-tab-pane label="内容列表" name="contentList">
|
||||
<cms-content-list v-if="activeName==='contentList'" :cid="selectCategoryId" :temp="temp"></cms-content-list>
|
||||
<cms-content-list v-if="activeName==='contentList'" :cid="selectCategoryId"></cms-content-list>
|
||||
</el-tab-pane>
|
||||
<!-- 回收站-->
|
||||
<el-tab-pane label="回收站" name="recycle">
|
||||
@ -93,7 +93,6 @@ export default {
|
||||
{key: 3, label: `内容状态`, visible: true},
|
||||
{key: 4, label: `创建时间`, visible: true},
|
||||
],
|
||||
temp: "0"
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -162,7 +161,6 @@ export default {
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.selectCategoryId = data.id;
|
||||
this.temp = data.temp;
|
||||
},
|
||||
/** 查询栏目下拉树结构 */
|
||||
getCategoryTree() {
|
||||
|
@ -258,6 +258,7 @@ export default {
|
||||
getCategoryList() {
|
||||
getLeavesCategoryList().then(response => {
|
||||
this.categoryList = response.data
|
||||
console.log(this.temp)
|
||||
if (!!this.$route.query.categoryId){
|
||||
let flag = false;
|
||||
this.categoryList.forEach(item => {
|
||||
@ -313,6 +314,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.reset();
|
||||
this.$router.replace('/content/content')
|
||||
this.$modal.closeLoading();
|
||||
}
|
||||
|
352
ruoyi-ui/src/views/hit/imitation/index.vue
Normal file
352
ruoyi-ui/src/views/hit/imitation/index.vue
Normal file
@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="课程标题" prop="imitationTitle">
|
||||
<el-input
|
||||
v-model="queryParams.imitationTitle"
|
||||
placeholder="请输入课程标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程简介" prop="imitationSummary">
|
||||
<el-input
|
||||
v-model="queryParams.imitationSummary"
|
||||
placeholder="请输入课程简介"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程老师" prop="imitationTeach">
|
||||
<el-input
|
||||
v-model="queryParams.imitationTeach"
|
||||
placeholder="请输入课程老师"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程学校" prop="imitationSchool">
|
||||
<el-input
|
||||
v-model="queryParams.imitationSchool"
|
||||
placeholder="请输入课程学校"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程类别" prop="imitationType">
|
||||
<el-select v-model="queryParams.imitationType" placeholder="请选择课程类别" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.imitation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['hit:imitation:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['hit:imitation:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['hit:imitation:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['hit:imitation:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="imitationList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="课程标题" align="center" prop="imitationTitle" />
|
||||
<el-table-column :show-overflow-tooltip="true" label="课程简介" align="center" prop="imitationSummary" />
|
||||
<el-table-column label="课程老师" align="center" prop="imitationTeach" />
|
||||
<el-table-column label="课程学校" align="center" prop="imitationSchool" />
|
||||
<el-table-column label="课程链接" align="center" prop="imitationLink" />
|
||||
<el-table-column label="课程阅览量" align="center" prop="imitationCount" />
|
||||
<el-table-column label="课程类别" align="center" prop="imitationType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.imitation_type" :value="scope.row.imitationType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="缩略图" align="center" prop="imitationImage" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.imitationImage" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['hit:imitation:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['hit:imitation:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改虚仿真课对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="课程标题" prop="imitationTitle">
|
||||
<el-input v-model="form.imitationTitle" placeholder="请输入课程标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程简介" prop="imitationSummary">
|
||||
<el-input v-model="form.imitationSummary" placeholder="请输入课程简介" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程老师" prop="imitationTeach">
|
||||
<el-input v-model="form.imitationTeach" placeholder="请输入课程老师" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程学校" prop="imitationSchool">
|
||||
<el-input v-model="form.imitationSchool" placeholder="请输入课程学校" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程链接" prop="imitationLink">
|
||||
<el-input v-model="form.imitationLink" placeholder="请输入课程链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程类别" prop="imitationType">
|
||||
<el-select v-model="form.imitationType" placeholder="请选择课程类别">
|
||||
<el-option
|
||||
v-for="dict in dict.type.imitation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缩略图" prop="imitationImage">
|
||||
<image-upload :limit="1" v-model="form.imitationImage"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listImitation, getImitation, delImitation, addImitation, updateImitation } from "@/api/hit/imitation";
|
||||
|
||||
export default {
|
||||
name: "Imitation",
|
||||
dicts: ['imitation_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 虚仿真课表格数据
|
||||
imitationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
imitationTitle: null,
|
||||
imitationSummary: null,
|
||||
imitationTeach: null,
|
||||
imitationSchool: null,
|
||||
imitationLink: null,
|
||||
imitationType: null,
|
||||
imitationImage: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
imitationTitle: [
|
||||
{ required: true, message: "课程标题不能为空", trigger: "blur" }
|
||||
],
|
||||
imitationSummary: [
|
||||
{ required: true, message: "课程简介不能为空", trigger: "blur" }
|
||||
],
|
||||
imitationTeach: [
|
||||
{ required: true, message: "课程老师不能为空", trigger: "blur" }
|
||||
],
|
||||
imitationSchool: [
|
||||
{ required: true, message: "课程学校不能为空", trigger: "blur" }
|
||||
],
|
||||
imitationLink: [
|
||||
{ required: true, message: "课程链接不能为空", trigger: "blur" }
|
||||
],
|
||||
imitationImage: [
|
||||
{ required: true, message: "缩略图不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询虚仿真课列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listImitation(this.queryParams).then(response => {
|
||||
this.imitationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
imitationTitle: null,
|
||||
imitationSummary: null,
|
||||
imitationTeach: null,
|
||||
imitationSchool: null,
|
||||
imitationLink: null,
|
||||
imitationType: 0,
|
||||
imitationImage: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加虚仿真课";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getImitation(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改虚仿真课";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateImitation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addImitation(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除虚仿真课编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delImitation(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('hit/imitation/export', {
|
||||
...this.queryParams
|
||||
}, `imitation_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -93,6 +93,16 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大赛年份" prop="competitionYear">
|
||||
<el-select v-model="queryParams.createTime" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in yearList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置刷新</el-button>
|
||||
@ -121,6 +131,16 @@
|
||||
v-hasPermi="['hit:hitRegistrationStudentInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-switch
|
||||
v-model="registerStatus"
|
||||
@change="updateRegisterStatus"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-text="开启报名"
|
||||
inactive-text="关闭报名">
|
||||
</el-switch>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -203,12 +223,15 @@ import {
|
||||
updateHitRegistrationStudentInfo,
|
||||
getTeachInfoByIds
|
||||
} from "@/api/hit/registrationStudentInfo";
|
||||
import {selectBaseInfo, editStatus} from '@/api/cms/baseInfo'
|
||||
|
||||
export default {
|
||||
name: "HitRegistrationStudentInfo",
|
||||
dicts: ['sys_user_sex', 'competition_type'],
|
||||
data() {
|
||||
return {
|
||||
yearList: [],
|
||||
registerStatus:"",
|
||||
leaderTeachList:[],
|
||||
guideTeachList:[],
|
||||
// 遮罩层
|
||||
@ -244,6 +267,7 @@ export default {
|
||||
leaderIds: null,
|
||||
guideIds: null,
|
||||
teachName:null,
|
||||
createTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -278,6 +302,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
selectBaseInfo().then(res => {
|
||||
this.registerStatus = res.data.registerStatus
|
||||
})
|
||||
this.yearList = this.years();
|
||||
},
|
||||
methods: {
|
||||
/** 查询报名信息列表 */
|
||||
@ -314,10 +342,10 @@ export default {
|
||||
guideIds: null,
|
||||
remark: null,
|
||||
delFlag: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
updateBy: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -329,6 +357,7 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.createTime = null
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
@ -401,6 +430,26 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
updateRegisterStatus(){
|
||||
editStatus(this.registerStatus).then(res => {
|
||||
if (res.code === 200 ){
|
||||
this.$modal.msgSuccess(this.registerStatus === "1" ? "报名已开启" : "报名已关闭")
|
||||
}
|
||||
})
|
||||
},
|
||||
years() {
|
||||
const currentYear = new Date().getFullYear();
|
||||
const startYear = currentYear - 40; // 假设从当前年份往前 20 年
|
||||
const endYear = currentYear;
|
||||
const years = [];
|
||||
for (let year = startYear; year <= endYear; year++) {
|
||||
years.push({
|
||||
label: year,
|
||||
value: year + "-01-01",
|
||||
});
|
||||
}
|
||||
return years.sort((a, b) => b.label - a.label);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user