| @ -0,0 +1,229 @@ | |||
| package org.jeecg.modules.educationCategoryThesisTwo.controller; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import java.io.IOException; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.net.URLDecoder; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.entity.EducationCategoryThesisTwo; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.service.IEducationCategoryThesisTwoService; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.base.controller.JeecgController; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 论文分类表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="论文分类表二") | |||
| @RestController | |||
| @RequestMapping("/educationCategoryThesisTwo/educationCategoryThesisTwo") | |||
| @Slf4j | |||
| public class EducationCategoryThesisTwoController extends JeecgController<EducationCategoryThesisTwo, IEducationCategoryThesisTwoService>{ | |||
| @Autowired | |||
| private IEducationCategoryThesisTwoService educationCategoryThesisTwoService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param educationCategoryThesisTwo | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文分类表二-分页列表查询") | |||
| @ApiOperation(value="论文分类表二-分页列表查询", notes="论文分类表二-分页列表查询") | |||
| @GetMapping(value = "/rootList") | |||
| public Result<IPage<EducationCategoryThesisTwo>> queryPageList(EducationCategoryThesisTwo educationCategoryThesisTwo, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| String hasQuery = req.getParameter("hasQuery"); | |||
| if(hasQuery != null && "true".equals(hasQuery)){ | |||
| QueryWrapper<EducationCategoryThesisTwo> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryThesisTwo, req.getParameterMap()); | |||
| List<EducationCategoryThesisTwo> list = educationCategoryThesisTwoService.queryTreeListNoPage(queryWrapper); | |||
| IPage<EducationCategoryThesisTwo> pageList = new Page<>(1, 10, list.size()); | |||
| pageList.setRecords(list); | |||
| return Result.OK(pageList); | |||
| }else{ | |||
| String parentId = educationCategoryThesisTwo.getPid(); | |||
| if (oConvertUtils.isEmpty(parentId)) { | |||
| parentId = "0"; | |||
| } | |||
| educationCategoryThesisTwo.setPid(null); | |||
| QueryWrapper<EducationCategoryThesisTwo> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryThesisTwo, req.getParameterMap()); | |||
| // 使用 eq 防止模糊查询 | |||
| queryWrapper.eq("pid", parentId); | |||
| Page<EducationCategoryThesisTwo> page = new Page<EducationCategoryThesisTwo>(pageNo, pageSize); | |||
| IPage<EducationCategoryThesisTwo> pageList = educationCategoryThesisTwoService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| } | |||
| /** | |||
| * 获取子数据 | |||
| * @param educationCategoryThesisTwo | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文分类表二-获取子数据") | |||
| @ApiOperation(value="论文分类表二-获取子数据", notes="论文分类表二-获取子数据") | |||
| @GetMapping(value = "/childList") | |||
| public Result<IPage<EducationCategoryThesisTwo>> queryPageList(EducationCategoryThesisTwo educationCategoryThesisTwo,HttpServletRequest req) { | |||
| QueryWrapper<EducationCategoryThesisTwo> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryThesisTwo, req.getParameterMap()); | |||
| List<EducationCategoryThesisTwo> list = educationCategoryThesisTwoService.list(queryWrapper); | |||
| IPage<EducationCategoryThesisTwo> pageList = new Page<>(1, 10, list.size()); | |||
| pageList.setRecords(list); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 批量查询子节点 | |||
| * @param parentIds 父ID(多个采用半角逗号分割) | |||
| * @return 返回 IPage | |||
| * @param parentIds | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文分类表二-批量获取子数据") | |||
| @ApiOperation(value="论文分类表二-批量获取子数据", notes="论文分类表二-批量获取子数据") | |||
| @GetMapping("/getChildListBatch") | |||
| public Result getChildListBatch(@RequestParam("parentIds") String parentIds) { | |||
| try { | |||
| QueryWrapper<EducationCategoryThesisTwo> queryWrapper = new QueryWrapper<>(); | |||
| List<String> parentIdList = Arrays.asList(parentIds.split(",")); | |||
| queryWrapper.in("pid", parentIdList); | |||
| List<EducationCategoryThesisTwo> list = educationCategoryThesisTwoService.list(queryWrapper); | |||
| IPage<EducationCategoryThesisTwo> pageList = new Page<>(1, 10, list.size()); | |||
| pageList.setRecords(list); | |||
| return Result.OK(pageList); | |||
| } catch (Exception e) { | |||
| log.error(e.getMessage(), e); | |||
| return Result.error("批量查询子节点失败:" + e.getMessage()); | |||
| } | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param educationCategoryThesisTwo | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文分类表二-添加") | |||
| @ApiOperation(value="论文分类表二-添加", notes="论文分类表二-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody EducationCategoryThesisTwo educationCategoryThesisTwo) { | |||
| educationCategoryThesisTwoService.addEducationCategoryThesisTwo(educationCategoryThesisTwo); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param educationCategoryThesisTwo | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文分类表二-编辑") | |||
| @ApiOperation(value="论文分类表二-编辑", notes="论文分类表二-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody EducationCategoryThesisTwo educationCategoryThesisTwo) { | |||
| educationCategoryThesisTwoService.updateEducationCategoryThesisTwo(educationCategoryThesisTwo); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文分类表二-通过id删除") | |||
| @ApiOperation(value="论文分类表二-通过id删除", notes="论文分类表二-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| educationCategoryThesisTwoService.deleteEducationCategoryThesisTwo(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文分类表二-批量删除") | |||
| @ApiOperation(value="论文分类表二-批量删除", notes="论文分类表二-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.educationCategoryThesisTwoService.removeByIds(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文分类表二-通过id查询") | |||
| @ApiOperation(value="论文分类表二-通过id查询", notes="论文分类表二-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<EducationCategoryThesisTwo> queryById(@RequestParam(name="id",required=true) String id) { | |||
| EducationCategoryThesisTwo educationCategoryThesisTwo = educationCategoryThesisTwoService.getById(id); | |||
| if(educationCategoryThesisTwo==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(educationCategoryThesisTwo); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param educationCategoryThesisTwo | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, EducationCategoryThesisTwo educationCategoryThesisTwo) { | |||
| return super.exportXls(request, educationCategoryThesisTwo, EducationCategoryThesisTwo.class, "论文分类表二"); | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| return super.importExcel(request, response, EducationCategoryThesisTwo.class); | |||
| } | |||
| } | |||
| @ -0,0 +1,63 @@ | |||
| package org.jeecg.modules.educationCategoryThesisTwo.entity; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import java.math.BigDecimal; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import java.io.UnsupportedEncodingException; | |||
| /** | |||
| * @Description: 论文分类表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @TableName("education_category_thesis_two") | |||
| @ApiModel(value="education_category_thesis_two对象", description="论文分类表二") | |||
| public class EducationCategoryThesisTwo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**分类名称*/ | |||
| @Excel(name = "分类名称", width = 15) | |||
| @ApiModelProperty(value = "分类名称") | |||
| private java.lang.String title; | |||
| /**图标*/ | |||
| @Excel(name = "图标", width = 15) | |||
| @ApiModelProperty(value = "图标") | |||
| private java.lang.String image; | |||
| /**父级节点*/ | |||
| @Excel(name = "父级节点", width = 15) | |||
| @ApiModelProperty(value = "父级节点") | |||
| private java.lang.String pid; | |||
| /**是否有子节点*/ | |||
| @Excel(name = "是否有子节点", width = 15, dicCode = "yn") | |||
| @Dict(dicCode = "yn") | |||
| @ApiModelProperty(value = "是否有子节点") | |||
| private java.lang.String hasChild; | |||
| } | |||
| @ -0,0 +1,22 @@ | |||
| package org.jeecg.modules.educationCategoryThesisTwo.mapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.entity.EducationCategoryThesisTwo; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 论文分类表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationCategoryThesisTwoMapper extends BaseMapper<EducationCategoryThesisTwo> { | |||
| /** | |||
| * 编辑节点状态 | |||
| * @param id | |||
| * @param status | |||
| */ | |||
| void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status); | |||
| } | |||
| @ -0,0 +1,9 @@ | |||
| <?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.jeecg.modules.educationCategoryThesisTwo.mapper.EducationCategoryThesisTwoMapper"> | |||
| <update id="updateTreeNodeStatus" parameterType="java.lang.String"> | |||
| update education_category_thesis_two set has_child = #{status} where id = #{id} | |||
| </update> | |||
| </mapper> | |||
| @ -0,0 +1,38 @@ | |||
| package org.jeecg.modules.educationCategoryThesisTwo.service; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.entity.EducationCategoryThesisTwo; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import org.jeecg.common.exception.JeecgBootException; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 论文分类表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationCategoryThesisTwoService extends IService<EducationCategoryThesisTwo> { | |||
| /**根节点父ID的值*/ | |||
| public static final String ROOT_PID_VALUE = "0"; | |||
| /**树节点有子节点状态值*/ | |||
| public static final String HASCHILD = "1"; | |||
| /**树节点无子节点状态值*/ | |||
| public static final String NOCHILD = "0"; | |||
| /**新增节点*/ | |||
| void addEducationCategoryThesisTwo(EducationCategoryThesisTwo educationCategoryThesisTwo); | |||
| /**修改节点*/ | |||
| void updateEducationCategoryThesisTwo(EducationCategoryThesisTwo educationCategoryThesisTwo) throws JeecgBootException; | |||
| /**删除节点*/ | |||
| void deleteEducationCategoryThesisTwo(String id) throws JeecgBootException; | |||
| /**查询所有数据,无分页*/ | |||
| List<EducationCategoryThesisTwo> queryTreeListNoPage(QueryWrapper<EducationCategoryThesisTwo> queryWrapper); | |||
| } | |||
| @ -0,0 +1,191 @@ | |||
| package org.jeecg.modules.educationCategoryThesisTwo.service.impl; | |||
| import org.jeecg.common.exception.JeecgBootException; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.entity.EducationCategoryThesisTwo; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.mapper.EducationCategoryThesisTwoMapper; | |||
| import org.jeecg.modules.educationCategoryThesisTwo.service.IEducationCategoryThesisTwoService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.ArrayList; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * @Description: 论文分类表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationCategoryThesisTwoServiceImpl extends ServiceImpl<EducationCategoryThesisTwoMapper, EducationCategoryThesisTwo> implements IEducationCategoryThesisTwoService { | |||
| @Override | |||
| public void addEducationCategoryThesisTwo(EducationCategoryThesisTwo educationCategoryThesisTwo) { | |||
| //新增时设置hasChild为0 | |||
| educationCategoryThesisTwo.setHasChild(IEducationCategoryThesisTwoService.NOCHILD); | |||
| if(oConvertUtils.isEmpty(educationCategoryThesisTwo.getPid())){ | |||
| educationCategoryThesisTwo.setPid(IEducationCategoryThesisTwoService.ROOT_PID_VALUE); | |||
| }else{ | |||
| //如果当前节点父ID不为空 则设置父节点的hasChildren 为1 | |||
| EducationCategoryThesisTwo parent = baseMapper.selectById(educationCategoryThesisTwo.getPid()); | |||
| if(parent!=null && !"1".equals(parent.getHasChild())){ | |||
| parent.setHasChild("1"); | |||
| baseMapper.updateById(parent); | |||
| } | |||
| } | |||
| baseMapper.insert(educationCategoryThesisTwo); | |||
| } | |||
| @Override | |||
| public void updateEducationCategoryThesisTwo(EducationCategoryThesisTwo educationCategoryThesisTwo) { | |||
| EducationCategoryThesisTwo entity = this.getById(educationCategoryThesisTwo.getId()); | |||
| if(entity==null) { | |||
| throw new JeecgBootException("未找到对应实体"); | |||
| } | |||
| String old_pid = entity.getPid(); | |||
| String new_pid = educationCategoryThesisTwo.getPid(); | |||
| if(!old_pid.equals(new_pid)) { | |||
| updateOldParentNode(old_pid); | |||
| if(oConvertUtils.isEmpty(new_pid)){ | |||
| educationCategoryThesisTwo.setPid(IEducationCategoryThesisTwoService.ROOT_PID_VALUE); | |||
| } | |||
| if(!IEducationCategoryThesisTwoService.ROOT_PID_VALUE.equals(educationCategoryThesisTwo.getPid())) { | |||
| baseMapper.updateTreeNodeStatus(educationCategoryThesisTwo.getPid(), IEducationCategoryThesisTwoService.HASCHILD); | |||
| } | |||
| } | |||
| baseMapper.updateById(educationCategoryThesisTwo); | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void deleteEducationCategoryThesisTwo(String id) throws JeecgBootException { | |||
| //查询选中节点下所有子节点一并删除 | |||
| id = this.queryTreeChildIds(id); | |||
| if(id.indexOf(",")>0) { | |||
| StringBuffer sb = new StringBuffer(); | |||
| String[] idArr = id.split(","); | |||
| for (String idVal : idArr) { | |||
| if(idVal != null){ | |||
| EducationCategoryThesisTwo educationCategoryThesisTwo = this.getById(idVal); | |||
| String pidVal = educationCategoryThesisTwo.getPid(); | |||
| //查询此节点上一级是否还有其他子节点 | |||
| List<EducationCategoryThesisTwo> dataList = baseMapper.selectList(new QueryWrapper<EducationCategoryThesisTwo>().eq("pid", pidVal).notIn("id",Arrays.asList(idArr))); | |||
| if((dataList == null || dataList.size()==0) && !Arrays.asList(idArr).contains(pidVal) | |||
| && !sb.toString().contains(pidVal)){ | |||
| //如果当前节点原本有子节点 现在木有了,更新状态 | |||
| sb.append(pidVal).append(","); | |||
| } | |||
| } | |||
| } | |||
| //批量删除节点 | |||
| baseMapper.deleteBatchIds(Arrays.asList(idArr)); | |||
| //修改已无子节点的标识 | |||
| String[] pidArr = sb.toString().split(","); | |||
| for(String pid : pidArr){ | |||
| this.updateOldParentNode(pid); | |||
| } | |||
| }else{ | |||
| EducationCategoryThesisTwo educationCategoryThesisTwo = this.getById(id); | |||
| if(educationCategoryThesisTwo==null) { | |||
| throw new JeecgBootException("未找到对应实体"); | |||
| } | |||
| updateOldParentNode(educationCategoryThesisTwo.getPid()); | |||
| baseMapper.deleteById(id); | |||
| } | |||
| } | |||
| @Override | |||
| public List<EducationCategoryThesisTwo> queryTreeListNoPage(QueryWrapper<EducationCategoryThesisTwo> queryWrapper) { | |||
| List<EducationCategoryThesisTwo> dataList = baseMapper.selectList(queryWrapper); | |||
| List<EducationCategoryThesisTwo> mapList = new ArrayList<>(); | |||
| for(EducationCategoryThesisTwo data : dataList){ | |||
| String pidVal = data.getPid(); | |||
| //递归查询子节点的根节点 | |||
| if(pidVal != null && !"0".equals(pidVal)){ | |||
| EducationCategoryThesisTwo rootVal = this.getTreeRoot(pidVal); | |||
| if(rootVal != null && !mapList.contains(rootVal)){ | |||
| mapList.add(rootVal); | |||
| } | |||
| }else{ | |||
| if(!mapList.contains(data)){ | |||
| mapList.add(data); | |||
| } | |||
| } | |||
| } | |||
| return mapList; | |||
| } | |||
| /** | |||
| * 根据所传pid查询旧的父级节点的子节点并修改相应状态值 | |||
| * @param pid | |||
| */ | |||
| private void updateOldParentNode(String pid) { | |||
| if(!IEducationCategoryThesisTwoService.ROOT_PID_VALUE.equals(pid)) { | |||
| Integer count = Math.toIntExact(baseMapper.selectCount(new QueryWrapper<EducationCategoryThesisTwo>().eq("pid", pid))); | |||
| if(count==null || count<=1) { | |||
| baseMapper.updateTreeNodeStatus(pid, IEducationCategoryThesisTwoService.NOCHILD); | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * 递归查询节点的根节点 | |||
| * @param pidVal | |||
| * @return | |||
| */ | |||
| private EducationCategoryThesisTwo getTreeRoot(String pidVal){ | |||
| EducationCategoryThesisTwo data = baseMapper.selectById(pidVal); | |||
| if(data != null && !"0".equals(data.getPid())){ | |||
| return this.getTreeRoot(data.getPid()); | |||
| }else{ | |||
| return data; | |||
| } | |||
| } | |||
| /** | |||
| * 根据id查询所有子节点id | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| private String queryTreeChildIds(String ids) { | |||
| //获取id数组 | |||
| String[] idArr = ids.split(","); | |||
| StringBuffer sb = new StringBuffer(); | |||
| for (String pidVal : idArr) { | |||
| if(pidVal != null){ | |||
| if(!sb.toString().contains(pidVal)){ | |||
| if(sb.toString().length() > 0){ | |||
| sb.append(","); | |||
| } | |||
| sb.append(pidVal); | |||
| this.getTreeChildIds(pidVal,sb); | |||
| } | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| /** | |||
| * 递归查询所有子节点 | |||
| * @param pidVal | |||
| * @param sb | |||
| * @return | |||
| */ | |||
| private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){ | |||
| List<EducationCategoryThesisTwo> dataList = baseMapper.selectList(new QueryWrapper<EducationCategoryThesisTwo>().eq("pid", pidVal)); | |||
| if(dataList != null && dataList.size()>0){ | |||
| for(EducationCategoryThesisTwo tree : dataList) { | |||
| if(!sb.toString().contains(tree.getId())){ | |||
| sb.append(",").append(tree.getId()); | |||
| } | |||
| this.getTreeChildIds(tree.getId(),sb); | |||
| } | |||
| } | |||
| return sb; | |||
| } | |||
| } | |||
| @ -0,0 +1,354 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('论文分类表二')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| rowKey="id" | |||
| class="j-table-force-nowrap" | |||
| :scroll="{x:true}" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :expandedRowKeys="expandedRowKeys" | |||
| @change="handleTableChange" | |||
| @expand="handleExpand" | |||
| v-bind="tableProps"> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleAddChild(record)">添加下级</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <educationCategoryThesisTwo-modal ref="modalForm" @ok="modalFormOk"></educationCategoryThesisTwo-modal> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import { getAction, deleteAction } from '@/api/manage' | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import EducationCategoryThesisTwoModal from './modules/EducationCategoryThesisTwoModal' | |||
| import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||
| import { filterObj } from '@/utils/util'; | |||
| export default { | |||
| name: "EducationCategoryThesisTwoList", | |||
| mixins:[JeecgListMixin], | |||
| components: { | |||
| EducationCategoryThesisTwoModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '论文分类表二管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title:'分类名称', | |||
| align:"left", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'图标', | |||
| align:"left", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' }, | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/educationCategoryThesisTwo/educationCategoryThesisTwo/rootList", | |||
| childList: "/educationCategoryThesisTwo/educationCategoryThesisTwo/childList", | |||
| getChildListBatch: "/educationCategoryThesisTwo/educationCategoryThesisTwo/getChildListBatch", | |||
| delete: "/educationCategoryThesisTwo/educationCategoryThesisTwo/delete", | |||
| deleteBatch: "/educationCategoryThesisTwo/educationCategoryThesisTwo/deleteBatch", | |||
| exportXlsUrl: "/educationCategoryThesisTwo/educationCategoryThesisTwo/exportXls", | |||
| importExcelUrl: "educationCategoryThesisTwo/educationCategoryThesisTwo/importExcel", | |||
| }, | |||
| expandedRowKeys:[], | |||
| hasChildrenField:"hasChild", | |||
| pidField:"pid", | |||
| dictOptions: {}, | |||
| loadParent: false, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| }, | |||
| tableProps() { | |||
| let _this = this | |||
| return { | |||
| // 列表项是否可选择 | |||
| rowSelection: { | |||
| selectedRowKeys: _this.selectedRowKeys, | |||
| onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| methods: { | |||
| loadData(arg){ | |||
| if(arg==1){ | |||
| this.ipagination.current=1 | |||
| } | |||
| this.loading = true | |||
| let params = this.getQueryParams() | |||
| params.hasQuery = 'true' | |||
| getAction(this.url.list,params).then(res=>{ | |||
| if(res.success){ | |||
| let result = res.result | |||
| if(Number(result.total)>0){ | |||
| this.ipagination.total = Number(result.total) | |||
| this.dataSource = this.getDataByResult(res.result.records) | |||
| return this.loadDataByExpandedRows(this.dataSource) | |||
| }else{ | |||
| this.ipagination.total=0 | |||
| this.dataSource=[] | |||
| } | |||
| }else{ | |||
| this.$message.warning(res.message) | |||
| } | |||
| }).finally(()=>{ | |||
| this.loading = false | |||
| }) | |||
| }, | |||
| // 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据) | |||
| loadDataByExpandedRows(dataList) { | |||
| if (this.expandedRowKeys.length > 0) { | |||
| return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{ | |||
| if (res.success && res.result.records.length>0) { | |||
| //已展开的数据批量子节点 | |||
| let records = res.result.records | |||
| const listMap = new Map(); | |||
| for (let item of records) { | |||
| let pid = item[this.pidField]; | |||
| if (this.expandedRowKeys.join(',').includes(pid)) { | |||
| let mapList = listMap.get(pid); | |||
| if (mapList == null) { | |||
| mapList = []; | |||
| } | |||
| mapList.push(item); | |||
| listMap.set(pid, mapList); | |||
| } | |||
| } | |||
| let childrenMap = listMap; | |||
| let fn = (list) => { | |||
| if(list) { | |||
| list.forEach(data => { | |||
| if (this.expandedRowKeys.includes(data.id)) { | |||
| data.children = this.getDataByResult(childrenMap.get(data.id)) | |||
| fn(data.children) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| fn(dataList) | |||
| } | |||
| }) | |||
| } else { | |||
| return Promise.resolve() | |||
| } | |||
| }, | |||
| getQueryParams(arg) { | |||
| //获取查询条件 | |||
| let sqp = {} | |||
| let param = {} | |||
| if(this.superQueryParams){ | |||
| sqp['superQueryParams']=encodeURI(this.superQueryParams) | |||
| sqp['superQueryMatchType'] = this.superQueryMatchType | |||
| } | |||
| if(arg){ | |||
| param = Object.assign(sqp, this.isorter ,this.filters); | |||
| }else{ | |||
| param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); | |||
| } | |||
| if(JSON.stringify(this.queryParam) === "{}" || arg){ | |||
| param.hasQuery = 'false' | |||
| }else{ | |||
| param.hasQuery = 'true' | |||
| } | |||
| param.field = this.getQueryField(); | |||
| param.pageNo = this.ipagination.current; | |||
| param.pageSize = this.ipagination.pageSize; | |||
| return filterObj(param); | |||
| }, | |||
| searchReset() { | |||
| //重置 | |||
| this.expandedRowKeys = [] | |||
| this.queryParam = {} | |||
| this.loadData(1); | |||
| }, | |||
| getDataByResult(result){ | |||
| if(result){ | |||
| return result.map(item=>{ | |||
| //判断是否标记了带有子节点 | |||
| if(item[this.hasChildrenField]=='1'){ | |||
| let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true } | |||
| item.children = [loadChild] | |||
| } | |||
| return item | |||
| }) | |||
| } | |||
| }, | |||
| handleExpand(expanded, record){ | |||
| // 判断是否是展开状态 | |||
| if (expanded) { | |||
| this.expandedRowKeys.push(record.id) | |||
| if (record.children.length>0 && record.children[0].isLoading === true) { | |||
| let params = this.getQueryParams(1);//查询条件 | |||
| params[this.pidField] = record.id | |||
| params.hasQuery = 'false' | |||
| params.superQueryParams="" | |||
| getAction(this.url.childList,params).then((res)=>{ | |||
| if(res.success){ | |||
| if(res.result.records){ | |||
| record.children = this.getDataByResult(res.result.records) | |||
| this.dataSource = [...this.dataSource] | |||
| }else{ | |||
| record.children='' | |||
| record.hasChildrenField='0' | |||
| } | |||
| }else{ | |||
| this.$message.warning(res.message) | |||
| } | |||
| }) | |||
| } | |||
| }else{ | |||
| let keyIndex = this.expandedRowKeys.indexOf(record.id) | |||
| if(keyIndex>=0){ | |||
| this.expandedRowKeys.splice(keyIndex, 1); | |||
| } | |||
| } | |||
| }, | |||
| handleAddChild(record){ | |||
| this.loadParent = true | |||
| let obj = {} | |||
| obj[this.pidField] = record['id'] | |||
| this.$refs.modalForm.add(obj); | |||
| }, | |||
| handleDeleteNode(id) { | |||
| if(!this.url.delete){ | |||
| this.$message.error("请设置url.delete属性!") | |||
| return | |||
| } | |||
| var that = this; | |||
| deleteAction(that.url.delete, {id: id}).then((res) => { | |||
| if (res.success) { | |||
| that.loadData(1) | |||
| } else { | |||
| that.$message.warning(res.message); | |||
| } | |||
| }); | |||
| }, | |||
| batchDel(){ | |||
| if(this.selectedRowKeys.length<=0){ | |||
| this.$message.warning('请选择一条记录!'); | |||
| return false; | |||
| }else{ | |||
| let ids = ""; | |||
| let that = this; | |||
| that.selectedRowKeys.forEach(function(val) { | |||
| ids+=val+","; | |||
| }); | |||
| that.$confirm({ | |||
| title:"确认删除", | |||
| content:"是否删除选中数据?", | |||
| onOk: function(){ | |||
| that.handleDeleteNode(ids) | |||
| that.onClearSelected(); | |||
| } | |||
| }); | |||
| } | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'Text',value:'title',text:'分类名称',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'image',text:'图标',dictCode:''}) | |||
| fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,156 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="width" | |||
| :visible="visible" | |||
| :confirmLoading="confirmLoading" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| @cancel="handleCancel" | |||
| cancelText="关闭"> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules"> | |||
| <a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入分类名称" ></a-input> | |||
| </a-form-model-item> | |||
| <a-form-model-item label="图标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||
| </a-form-model-item> | |||
| <a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid"> | |||
| <j-tree-select | |||
| ref="treeSelect" | |||
| placeholder="请选择父级节点" | |||
| v-model="model.pid" | |||
| dict="education_category_thesis_two,title,id" | |||
| pidField="pid" | |||
| pidValue="0" | |||
| hasChildField="has_child" | |||
| > | |||
| </j-tree-select> | |||
| </a-form-model-item> | |||
| </a-form-model> | |||
| </a-spin> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import { httpAction } from '@/api/manage' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: "EducationCategoryThesisTwoModal", | |||
| components: { | |||
| }, | |||
| data () { | |||
| return { | |||
| title:"操作", | |||
| width:800, | |||
| visible: false, | |||
| model:{ | |||
| }, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| confirmLoading: false, | |||
| validatorRules: { | |||
| }, | |||
| url: { | |||
| add: "/educationCategoryThesisTwo/educationCategoryThesisTwo/add", | |||
| edit: "/educationCategoryThesisTwo/educationCategoryThesisTwo/edit", | |||
| }, | |||
| expandedRowKeys:[], | |||
| pidField:"pid" | |||
| } | |||
| }, | |||
| created () { | |||
| //备份model原始值 | |||
| this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||
| }, | |||
| methods: { | |||
| add (obj) { | |||
| this.modelDefault.pid='' | |||
| this.edit(Object.assign(this.modelDefault , obj)); | |||
| }, | |||
| edit (record) { | |||
| this.model = Object.assign({}, record); | |||
| this.visible = true; | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| this.$refs.form.clearValidate() | |||
| }, | |||
| handleOk () { | |||
| const that = this; | |||
| // 触发表单验证 | |||
| this.$refs.form.validate(valid => { | |||
| if (valid) { | |||
| that.confirmLoading = true; | |||
| let httpurl = ''; | |||
| let method = ''; | |||
| if(!this.model.id){ | |||
| httpurl+=this.url.add; | |||
| method = 'post'; | |||
| }else{ | |||
| httpurl+=this.url.edit; | |||
| method = 'put'; | |||
| } | |||
| if(this.model.id && this.model.id === this.model[this.pidField]){ | |||
| that.$message.warning("父级节点不能选择自己"); | |||
| that.confirmLoading = false; | |||
| return; | |||
| } | |||
| httpAction(httpurl,this.model,method).then((res)=>{ | |||
| if(res.success){ | |||
| that.$message.success(res.message); | |||
| this.$emit('ok'); | |||
| }else{ | |||
| that.$message.warning(res.message); | |||
| } | |||
| }).finally(() => { | |||
| that.confirmLoading = false; | |||
| that.close(); | |||
| }) | |||
| }else{ | |||
| return false | |||
| } | |||
| }) | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| }, | |||
| submitSuccess(formData,flag){ | |||
| if(!formData.id){ | |||
| let treeData = this.$refs.treeSelect.getCurrTreeData() | |||
| this.expandedRowKeys=[] | |||
| this.getExpandKeysByPid(formData[this.pidField],treeData,treeData) | |||
| this.$emit('ok',formData,this.expandedRowKeys.reverse()); | |||
| }else{ | |||
| this.$emit('ok',formData,flag); | |||
| } | |||
| }, | |||
| getExpandKeysByPid(pid,arr,all){ | |||
| if(pid && arr && arr.length>0){ | |||
| for(let i=0;i<arr.length;i++){ | |||
| if(arr[i].key==pid){ | |||
| this.expandedRowKeys.push(arr[i].key) | |||
| this.getExpandKeysByPid(arr[i]['parentId'],all,all) | |||
| }else{ | |||
| this.getExpandKeysByPid(pid,arr[i].children,all) | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,82 @@ | |||
| import {defHttp} from "/@/utils/http/axios"; | |||
| import {Modal} from 'ant-design-vue'; | |||
| enum Api { | |||
| list = '/educationCategoryThesisTwo/educationCategoryThesisTwo/rootList', | |||
| save='/educationCategoryThesisTwo/educationCategoryThesisTwo/add', | |||
| edit='/educationCategoryThesisTwo/educationCategoryThesisTwo/edit', | |||
| deleteEducationCategoryThesisTwo = '/sys/educationCategoryThesisTwo/delete', | |||
| deleteBatch = '/educationCategoryThesisTwo/educationCategoryThesisTwo/deleteBatch', | |||
| importExcel = '/educationCategoryThesisTwo/educationCategoryThesisTwo/importExcel', | |||
| exportXls = '/educationCategoryThesisTwo/educationCategoryThesisTwo/exportXls', | |||
| loadTreeData = '/educationCategoryThesisTwo/educationCategoryThesisTwo/loadTreeRoot', | |||
| getChildList = '/educationCategoryThesisTwo/educationCategoryThesisTwo/childList', | |||
| getChildListBatch = '/educationCategoryThesisTwo/educationCategoryThesisTwo/getChildListBatch', | |||
| } | |||
| /** | |||
| * 导出api | |||
| * @param params | |||
| */ | |||
| export const getExportUrl = Api.exportXls; | |||
| /** | |||
| * 导入api | |||
| * @param params | |||
| */ | |||
| export const getImportUrl = Api.importExcel; | |||
| /** | |||
| * 列表接口 | |||
| * @param params | |||
| */ | |||
| export const list = (params) => | |||
| defHttp.get({url: Api.list, params}); | |||
| /** | |||
| * 删除 | |||
| */ | |||
| export const deleteEducationCategoryThesisTwo = (params,handleSuccess) => { | |||
| return defHttp.delete({url: Api.deleteEducationCategoryThesisTwo, params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * @param params | |||
| */ | |||
| export const batchDeleteEducationCategoryThesisTwo = (params, handleSuccess) => { | |||
| Modal.confirm({ | |||
| title: '确认删除', | |||
| content: '是否删除选中数据', | |||
| okText: '确认', | |||
| cancelText: '取消', | |||
| onOk: () => { | |||
| return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||
| handleSuccess(); | |||
| }); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * 保存或者更新 | |||
| * @param params | |||
| */ | |||
| export const saveOrUpdateDict = (params, isUpdate) => { | |||
| let url = isUpdate ? Api.edit : Api.save; | |||
| return defHttp.post({url: url, params}); | |||
| } | |||
| /** | |||
| * 查询全部树形节点数据 | |||
| * @param params | |||
| */ | |||
| export const loadTreeData = (params) => | |||
| defHttp.get({url: Api.loadTreeData,params}); | |||
| /** | |||
| * 查询子节点数据 | |||
| * @param params | |||
| */ | |||
| export const getChildList = (params) => | |||
| defHttp.get({url: Api.getChildList, params}); | |||
| /** | |||
| * 批量查询子节点数据 | |||
| * @param params | |||
| */ | |||
| export const getChildListBatch = (params) => | |||
| defHttp.get({url: Api.getChildListBatch, params},{isTransformResponse:false}); | |||
| @ -0,0 +1,41 @@ | |||
| import {BasicColumn} from '/@/components/Table'; | |||
| import {FormSchema} from '/@/components/Table'; | |||
| import { rules} from '/@/utils/helper/validator'; | |||
| import { render } from '/@/utils/common/renderUtils'; | |||
| //列表数据 | |||
| export const columns: BasicColumn[] = [ | |||
| { | |||
| title: '分类名称', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title: '图标', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| customRender:render.renderAvatar, | |||
| }, | |||
| ]; | |||
| //查询数据 | |||
| export const searchFormSchema: FormSchema[] = [ | |||
| ]; | |||
| //表单数据 | |||
| export const formSchema: FormSchema[] = [ | |||
| { | |||
| label: '分类名称', | |||
| field: 'title', | |||
| component: 'Input', | |||
| }, | |||
| { | |||
| label: '图标', | |||
| field: 'image', | |||
| component: 'JImageUpload', | |||
| componentProps:{ | |||
| }, | |||
| }, | |||
| { | |||
| label: '父级节点', | |||
| field: 'pid', | |||
| component: 'Input', | |||
| }, | |||
| ]; | |||
| @ -0,0 +1,272 @@ | |||
| <template> | |||
| <div class="p-4"> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" @click="handleCreate" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button>批量操作 | |||
| <Icon icon="ant-design:down-outlined"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)"/> | |||
| </template> | |||
| </BasicTable> | |||
| <!--字典弹窗--> | |||
| <EducationCategoryThesisTwoModal @register="registerModal" @success="handleSuccess"/> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="educationCategoryThesisTwo-educationCategoryThesisTwo" setup> | |||
| //ts语法 | |||
| import {ref, computed, unref, toRaw, nextTick} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/src/components/Table'; | |||
| import {useModal} from '/src/components/Modal'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import EducationCategoryThesisTwoModal from './components/EducationCategoryThesisTwoModal.vue'; | |||
| import {columns} from './EducationCategoryThesisTwo.data'; | |||
| import {list, deleteEducationCategoryThesisTwo, batchDeleteEducationCategoryThesisTwo, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './EducationCategoryThesisTwo.api'; | |||
| const expandedRowKeys = ref([]); | |||
| //字典model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '论文分类表二', | |||
| columns, | |||
| canResize:false, | |||
| actionColumn: { | |||
| width: 120, | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"论文分类表二", | |||
| url: getExportUrl, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl, | |||
| success: importSuccess | |||
| }, | |||
| }) | |||
| const [registerTable, {reload, collapseAll, updateTableDataRecord, findTableDataRecord,getDataSource},{ rowSelection, selectedRowKeys }] = tableContext | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleCreate() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| async function handleEdit(record) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| async function handleDetail(record) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| hideFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteEducationCategoryThesisTwo({id: record.id}, importSuccess); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| const ids = selectedRowKeys.value.filter(item => !item.includes('loading')) | |||
| await batchDeleteEducationCategoryThesisTwo({ids: ids}, importSuccess); | |||
| } | |||
| /** | |||
| * 导入 | |||
| */ | |||
| function importSuccess() { | |||
| reload() && (expandedRowKeys.value = []); | |||
| } | |||
| /** | |||
| * 添加下级 | |||
| */ | |||
| function handleAddSub(record) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| async function handleSuccess({isUpdate, values, expandedArr}) { | |||
| if (isUpdate) { | |||
| //编辑回调 | |||
| updateTableDataRecord(values.id, values); | |||
| } else { | |||
| if(!values['pid']){ | |||
| //新增根节点 | |||
| reload(); | |||
| }else{ | |||
| //新增子集 | |||
| expandedRowKeys.value = []; | |||
| for (let key of unref(expandedArr)) { | |||
| await expandTreeNode(key) | |||
| } | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * 接口请求成功后回调 | |||
| */ | |||
| function onFetchSuccess(result) { | |||
| getDataByResult(result.items)&&loadDataByExpandedRows(); | |||
| } | |||
| /** | |||
| * 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据) | |||
| */ | |||
| async function loadDataByExpandedRows() { | |||
| if (unref(expandedRowKeys).length > 0) { | |||
| const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',')}); | |||
| if (res.success && res.result.records.length>0) { | |||
| //已展开的数据批量子节点 | |||
| let records = res.result.records | |||
| const listMap = new Map(); | |||
| for (let item of records) { | |||
| let pid = item['pid']; | |||
| if (unref(expandedRowKeys).includes(pid)) { | |||
| let mapList = listMap.get(pid); | |||
| if (mapList == null) { | |||
| mapList = []; | |||
| } | |||
| mapList.push(item); | |||
| listMap.set(pid, mapList); | |||
| } | |||
| } | |||
| let childrenMap = listMap; | |||
| let fn = (list) => { | |||
| if(list) { | |||
| list.forEach(data => { | |||
| if (unref(expandedRowKeys).includes(data.id)) { | |||
| data.children = getDataByResult(childrenMap.get(data.id)) | |||
| fn(data.children) | |||
| } | |||
| }) | |||
| } | |||
| }; | |||
| fn(getDataSource()) | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * 处理数据集 | |||
| */ | |||
| function getDataByResult(result){ | |||
| if(result && result.length>0){ | |||
| return result.map(item=>{ | |||
| //判断是否标记了带有子节点 | |||
| if(item["hasChild"]=='1'){ | |||
| let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true } | |||
| item.children = [loadChild] | |||
| } | |||
| return item | |||
| }) | |||
| } | |||
| } | |||
| /** | |||
| *树节点展开合并 | |||
| * */ | |||
| async function handleExpand(expanded, record) { | |||
| // 判断是否是展开状态,展开状态(expanded)并且存在子集(children)并且未加载过(isLoading)的就去查询子节点数据 | |||
| if (expanded) { | |||
| expandedRowKeys.value.push(record.id) | |||
| if (record.children.length > 0 && !!record.children[0].isLoading) { | |||
| let result = await getChildList({pid: record.id}); | |||
| result=result.records?result.records:result; | |||
| if (result && result.length > 0) { | |||
| record.children = getDataByResult(result); | |||
| } else { | |||
| record.children = null | |||
| record.hasChild = '0' | |||
| } | |||
| } | |||
| } else { | |||
| let keyIndex = expandedRowKeys.value.indexOf(record.id) | |||
| if (keyIndex >= 0) { | |||
| expandedRowKeys.value.splice(keyIndex, 1); | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| *操作表格后处理树节点展开合并 | |||
| * */ | |||
| async function expandTreeNode(key) { | |||
| let record = findTableDataRecord(key) | |||
| expandedRowKeys.value.push(key); | |||
| let result = await getChildList({pid: key}); | |||
| if (result && result.length > 0) { | |||
| record.children = getDataByResult(result); | |||
| } else { | |||
| record.children = null | |||
| record.hasChild = '0' | |||
| } | |||
| updateTableDataRecord(key, record); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record) { | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| }, | |||
| { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '确定删除吗?', | |||
| confirm: handleDelete.bind(null, record), | |||
| }, | |||
| }, | |||
| { | |||
| label: '添加下级', | |||
| onClick: handleAddSub.bind(null, {pid: record.id}), | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,87 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm"/> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/src/components/Modal'; | |||
| import {BasicForm, useForm} from '/src/components/Form'; | |||
| import {formSchema} from '../educationCategoryThesisTwo.data'; | |||
| import {loadTreeData, saveOrUpdateDict} from '../educationCategoryThesisTwo.api'; | |||
| // 获取emit | |||
| const emit = defineEmits(['register', 'success']); | |||
| const isUpdate = ref(true); | |||
| const expandedRowKeys = ref([]); | |||
| const treeData = ref([]); | |||
| //表单配置 | |||
| const [registerForm, {resetFields, setFieldsValue, validate, updateSchema}] = useForm({ | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 4 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 18 }, | |||
| }, | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await resetFields(); | |||
| expandedRowKeys.value = []; | |||
| setModalProps({confirmLoading: false, minHeight: 80}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| if (data?.record) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| } | |||
| //父级节点树信息 | |||
| treeData.value = await loadTreeData({'async': false,'pcode':''}); | |||
| updateSchema({ | |||
| field: 'pid', | |||
| componentProps: {treeData}, | |||
| }); | |||
| }); | |||
| //设置标题 | |||
| const getTitle = computed(() => (!unref(isUpdate) ? '新增字典' : '编辑字典')); | |||
| /** | |||
| * 根据pid获取展开的节点 | |||
| * @param pid | |||
| * @param arr | |||
| */ | |||
| function getExpandKeysByPid(pid,arr){ | |||
| if(pid && arr && arr.length>0){ | |||
| for(let i=0;i<arr.length;i++){ | |||
| if(arr[i].key==pid && unref(expandedRowKeys).indexOf(pid)<0){ | |||
| expandedRowKeys.value.push(arr[i].key); | |||
| getExpandKeysByPid(arr[i]['parentId'],unref(treeData)) | |||
| }else{ | |||
| getExpandKeysByPid(pid,arr[i].children) | |||
| } | |||
| } | |||
| } | |||
| } | |||
| //表单提交事件 | |||
| async function handleSubmit() { | |||
| try { | |||
| let values = await validate(); | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdateDict(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //展开的节点信息 | |||
| await getExpandKeysByPid(values['pid'],unref(treeData)) | |||
| //刷新列表(isUpdate:是否编辑;values:表单信息;expandedArr:展开的节点信息) | |||
| emit('success', {isUpdate: unref(isUpdate), values:{...values},expandedArr: unref(expandedRowKeys).reverse()}); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| @ -0,0 +1,55 @@ | |||
| package org.jeecg.modules.educationThesis.entity; | |||
| import java.io.Serializable; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import java.util.Date; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import java.io.UnsupportedEncodingException; | |||
| /** | |||
| * @Description: 发表全流程辅导 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @ApiModel(value="education_process对象", description="发表全流程辅导") | |||
| @Data | |||
| @TableName("education_process") | |||
| public class EducationProcess implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**标题*/ | |||
| @Excel(name = "标题", width = 15) | |||
| @ApiModelProperty(value = "标题") | |||
| private java.lang.String title; | |||
| /**文本内容*/ | |||
| @Excel(name = "文本内容", width = 15) | |||
| @ApiModelProperty(value = "文本内容") | |||
| private java.lang.String content; | |||
| /**关联论文id*/ | |||
| @ApiModelProperty(value = "关联论文id") | |||
| private java.lang.String thesisId; | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.educationThesis.mapper; | |||
| import java.util.List; | |||
| import org.jeecg.modules.educationThesis.entity.EducationProcess; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| /** | |||
| * @Description: 发表全流程辅导 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationProcessMapper extends BaseMapper<EducationProcess> { | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| public List<EducationProcess> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| <?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.jeecg.modules.educationThesis.mapper.EducationProcessMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM education_process | |||
| WHERE | |||
| thesis_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.educationThesis.entity.EducationProcess"> | |||
| SELECT * | |||
| FROM education_process | |||
| WHERE | |||
| thesis_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| package org.jeecg.modules.educationThesis.service; | |||
| import org.jeecg.modules.educationThesis.entity.EducationProcess; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 发表全流程辅导 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationProcessService extends IService<EducationProcess> { | |||
| public List<EducationProcess> selectByMainId(String mainId); | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package org.jeecg.modules.educationThesis.service.impl; | |||
| import org.jeecg.modules.educationThesis.entity.EducationProcess; | |||
| import org.jeecg.modules.educationThesis.mapper.EducationProcessMapper; | |||
| import org.jeecg.modules.educationThesis.service.IEducationProcessService; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| /** | |||
| * @Description: 发表全流程辅导 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationProcessServiceImpl extends ServiceImpl<EducationProcessMapper, EducationProcess> implements IEducationProcessService { | |||
| @Autowired | |||
| private EducationProcessMapper educationProcessMapper; | |||
| @Override | |||
| public List<EducationProcess> selectByMainId(String mainId) { | |||
| return educationProcessMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -0,0 +1,299 @@ | |||
| package org.jeecg.modules.educationThesisTwo.controller; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.io.IOException; | |||
| import java.net.URLDecoder; | |||
| import java.util.ArrayList; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.jeecgframework.poi.excel.ExcelImportUtil; | |||
| import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||
| import org.jeecgframework.poi.excel.entity.ExportParams; | |||
| import org.jeecgframework.poi.excel.entity.ImportParams; | |||
| import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||
| import org.jeecg.common.system.vo.LoginUser; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.jeecg.common.api.vo.Result; | |||
| import org.jeecg.common.system.query.QueryGenerator; | |||
| import org.jeecg.common.util.oConvertUtils; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo; | |||
| import org.jeecg.modules.educationThesisTwo.vo.EducationThesisTwoPage; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationThesisTwoService; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationExcelOneService; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationExcelTwoService; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationDocumentTwoService; | |||
| import org.springframework.beans.BeanUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.servlet.ModelAndView; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import org.springframework.web.multipart.MultipartHttpServletRequest; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import com.alibaba.fastjson.JSON; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.jeecg.common.aspect.annotation.AutoLog; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Api(tags="论文信息表二") | |||
| @RestController | |||
| @RequestMapping("/educationThesisTwo/educationThesisTwo") | |||
| @Slf4j | |||
| public class EducationThesisTwoController { | |||
| @Autowired | |||
| private IEducationThesisTwoService educationThesisTwoService; | |||
| @Autowired | |||
| private IEducationExcelOneService educationExcelOneService; | |||
| @Autowired | |||
| private IEducationExcelTwoService educationExcelTwoService; | |||
| @Autowired | |||
| private IEducationDocumentTwoService educationDocumentTwoService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param educationThesisTwo | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文信息表二-分页列表查询") | |||
| @ApiOperation(value="论文信息表二-分页列表查询", notes="论文信息表二-分页列表查询") | |||
| @GetMapping(value = "/list") | |||
| public Result<IPage<EducationThesisTwo>> queryPageList(EducationThesisTwo educationThesisTwo, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| QueryWrapper<EducationThesisTwo> queryWrapper = QueryGenerator.initQueryWrapper(educationThesisTwo, req.getParameterMap()); | |||
| Page<EducationThesisTwo> page = new Page<EducationThesisTwo>(pageNo, pageSize); | |||
| IPage<EducationThesisTwo> pageList = educationThesisTwoService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param educationThesisTwoPage | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文信息表二-添加") | |||
| @ApiOperation(value="论文信息表二-添加", notes="论文信息表二-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> add(@RequestBody EducationThesisTwoPage educationThesisTwoPage) { | |||
| EducationThesisTwo educationThesisTwo = new EducationThesisTwo(); | |||
| BeanUtils.copyProperties(educationThesisTwoPage, educationThesisTwo); | |||
| educationThesisTwoService.saveMain(educationThesisTwo, educationThesisTwoPage.getEducationExcelOneList(),educationThesisTwoPage.getEducationExcelTwoList(),educationThesisTwoPage.getEducationDocumentTwoList()); | |||
| return Result.OK("添加成功!"); | |||
| } | |||
| /** | |||
| * 编辑 | |||
| * | |||
| * @param educationThesisTwoPage | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文信息表二-编辑") | |||
| @ApiOperation(value="论文信息表二-编辑", notes="论文信息表二-编辑") | |||
| @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||
| public Result<String> edit(@RequestBody EducationThesisTwoPage educationThesisTwoPage) { | |||
| EducationThesisTwo educationThesisTwo = new EducationThesisTwo(); | |||
| BeanUtils.copyProperties(educationThesisTwoPage, educationThesisTwo); | |||
| EducationThesisTwo educationThesisTwoEntity = educationThesisTwoService.getById(educationThesisTwo.getId()); | |||
| if(educationThesisTwoEntity==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| educationThesisTwoService.updateMain(educationThesisTwo, educationThesisTwoPage.getEducationExcelOneList(),educationThesisTwoPage.getEducationExcelTwoList(),educationThesisTwoPage.getEducationDocumentTwoList()); | |||
| return Result.OK("编辑成功!"); | |||
| } | |||
| /** | |||
| * 通过id删除 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文信息表二-通过id删除") | |||
| @ApiOperation(value="论文信息表二-通过id删除", notes="论文信息表二-通过id删除") | |||
| @DeleteMapping(value = "/delete") | |||
| public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||
| educationThesisTwoService.delMain(id); | |||
| return Result.OK("删除成功!"); | |||
| } | |||
| /** | |||
| * 批量删除 | |||
| * | |||
| * @param ids | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "论文信息表二-批量删除") | |||
| @ApiOperation(value="论文信息表二-批量删除", notes="论文信息表二-批量删除") | |||
| @DeleteMapping(value = "/deleteBatch") | |||
| public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||
| this.educationThesisTwoService.delBatchMain(Arrays.asList(ids.split(","))); | |||
| return Result.OK("批量删除成功!"); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "论文信息表二-通过id查询") | |||
| @ApiOperation(value="论文信息表二-通过id查询", notes="论文信息表二-通过id查询") | |||
| @GetMapping(value = "/queryById") | |||
| public Result<EducationThesisTwo> queryById(@RequestParam(name="id",required=true) String id) { | |||
| EducationThesisTwo educationThesisTwo = educationThesisTwoService.getById(id); | |||
| if(educationThesisTwo==null) { | |||
| return Result.error("未找到对应数据"); | |||
| } | |||
| return Result.OK(educationThesisTwo); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "表格一通过主表ID查询") | |||
| @ApiOperation(value="表格一主表ID查询", notes="表格一-通主表ID查询") | |||
| @GetMapping(value = "/queryEducationExcelOneByMainId") | |||
| public Result<List<EducationExcelOne>> queryEducationExcelOneListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<EducationExcelOne> educationExcelOneList = educationExcelOneService.selectByMainId(id); | |||
| return Result.OK(educationExcelOneList); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "表格二通过主表ID查询") | |||
| @ApiOperation(value="表格二主表ID查询", notes="表格二-通主表ID查询") | |||
| @GetMapping(value = "/queryEducationExcelTwoByMainId") | |||
| public Result<List<EducationExcelTwo>> queryEducationExcelTwoListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<EducationExcelTwo> educationExcelTwoList = educationExcelTwoService.selectByMainId(id); | |||
| return Result.OK(educationExcelTwoList); | |||
| } | |||
| /** | |||
| * 通过id查询 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "附加材料表二通过主表ID查询") | |||
| @ApiOperation(value="附加材料表二主表ID查询", notes="附加材料表二-通主表ID查询") | |||
| @GetMapping(value = "/queryEducationDocumentTwoByMainId") | |||
| public Result<List<EducationDocumentTwo>> queryEducationDocumentTwoListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<EducationDocumentTwo> educationDocumentTwoList = educationDocumentTwoService.selectByMainId(id); | |||
| return Result.OK(educationDocumentTwoList); | |||
| } | |||
| /** | |||
| * 导出excel | |||
| * | |||
| * @param request | |||
| * @param educationThesisTwo | |||
| */ | |||
| @RequestMapping(value = "/exportXls") | |||
| public ModelAndView exportXls(HttpServletRequest request, EducationThesisTwo educationThesisTwo) { | |||
| // Step.1 组装查询条件查询数据 | |||
| QueryWrapper<EducationThesisTwo> queryWrapper = QueryGenerator.initQueryWrapper(educationThesisTwo, request.getParameterMap()); | |||
| LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | |||
| //Step.2 获取导出数据 | |||
| List<EducationThesisTwo> queryList = educationThesisTwoService.list(queryWrapper); | |||
| // 过滤选中数据 | |||
| String selections = request.getParameter("selections"); | |||
| List<EducationThesisTwo> educationThesisTwoList = new ArrayList<EducationThesisTwo>(); | |||
| if(oConvertUtils.isEmpty(selections)) { | |||
| educationThesisTwoList = queryList; | |||
| }else { | |||
| List<String> selectionList = Arrays.asList(selections.split(",")); | |||
| educationThesisTwoList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | |||
| } | |||
| // Step.3 组装pageList | |||
| List<EducationThesisTwoPage> pageList = new ArrayList<EducationThesisTwoPage>(); | |||
| for (EducationThesisTwo main : educationThesisTwoList) { | |||
| EducationThesisTwoPage vo = new EducationThesisTwoPage(); | |||
| BeanUtils.copyProperties(main, vo); | |||
| List<EducationExcelOne> educationExcelOneList = educationExcelOneService.selectByMainId(main.getId()); | |||
| vo.setEducationExcelOneList(educationExcelOneList); | |||
| List<EducationExcelTwo> educationExcelTwoList = educationExcelTwoService.selectByMainId(main.getId()); | |||
| vo.setEducationExcelTwoList(educationExcelTwoList); | |||
| List<EducationDocumentTwo> educationDocumentTwoList = educationDocumentTwoService.selectByMainId(main.getId()); | |||
| vo.setEducationDocumentTwoList(educationDocumentTwoList); | |||
| pageList.add(vo); | |||
| } | |||
| // Step.4 AutoPoi 导出Excel | |||
| ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | |||
| mv.addObject(NormalExcelConstants.FILE_NAME, "论文信息表二列表"); | |||
| mv.addObject(NormalExcelConstants.CLASS, EducationThesisTwoPage.class); | |||
| mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("论文信息表二数据", "导出人:"+sysUser.getRealname(), "论文信息表二")); | |||
| mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | |||
| return mv; | |||
| } | |||
| /** | |||
| * 通过excel导入数据 | |||
| * | |||
| * @param request | |||
| * @param response | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||
| public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||
| MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | |||
| Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | |||
| for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | |||
| MultipartFile file = entity.getValue();// 获取上传文件对象 | |||
| ImportParams params = new ImportParams(); | |||
| params.setTitleRows(2); | |||
| params.setHeadRows(1); | |||
| params.setNeedSave(true); | |||
| try { | |||
| List<EducationThesisTwoPage> list = ExcelImportUtil.importExcel(file.getInputStream(), EducationThesisTwoPage.class, params); | |||
| for (EducationThesisTwoPage page : list) { | |||
| EducationThesisTwo po = new EducationThesisTwo(); | |||
| BeanUtils.copyProperties(page, po); | |||
| educationThesisTwoService.saveMain(po, page.getEducationExcelOneList(),page.getEducationExcelTwoList(),page.getEducationDocumentTwoList()); | |||
| } | |||
| return Result.OK("文件导入成功!数据行数:" + list.size()); | |||
| } catch (Exception e) { | |||
| log.error(e.getMessage(),e); | |||
| return Result.error("文件导入失败:"+e.getMessage()); | |||
| } finally { | |||
| try { | |||
| file.getInputStream().close(); | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| } | |||
| return Result.OK("文件导入失败!"); | |||
| } | |||
| } | |||
| @ -0,0 +1,55 @@ | |||
| package org.jeecg.modules.educationThesisTwo.entity; | |||
| import java.io.Serializable; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import java.util.Date; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import java.io.UnsupportedEncodingException; | |||
| /** | |||
| * @Description: 附加材料表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @ApiModel(value="education_document_two对象", description="附加材料表二") | |||
| @Data | |||
| @TableName("education_document_two") | |||
| public class EducationDocumentTwo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**标题*/ | |||
| @Excel(name = "标题", width = 15) | |||
| @ApiModelProperty(value = "标题") | |||
| private java.lang.String title; | |||
| /**文件*/ | |||
| @Excel(name = "文件", width = 15) | |||
| @ApiModelProperty(value = "文件") | |||
| private java.lang.String document; | |||
| /**关联论文id*/ | |||
| @ApiModelProperty(value = "关联论文id") | |||
| private java.lang.String thesisId; | |||
| } | |||
| @ -0,0 +1,55 @@ | |||
| package org.jeecg.modules.educationThesisTwo.entity; | |||
| import java.io.Serializable; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import java.util.Date; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import java.io.UnsupportedEncodingException; | |||
| /** | |||
| * @Description: 表格一 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @ApiModel(value="education_excel_one对象", description="表格一") | |||
| @Data | |||
| @TableName("education_excel_one") | |||
| public class EducationExcelOne implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**第一列*/ | |||
| @Excel(name = "第一列", width = 15) | |||
| @ApiModelProperty(value = "第一列") | |||
| private java.lang.String columnOne; | |||
| /**第二列*/ | |||
| @Excel(name = "第二列", width = 15) | |||
| @ApiModelProperty(value = "第二列") | |||
| private java.lang.String columnTwo; | |||
| /**关联论文id*/ | |||
| @ApiModelProperty(value = "关联论文id") | |||
| private java.lang.String thesisId; | |||
| } | |||
| @ -0,0 +1,55 @@ | |||
| package org.jeecg.modules.educationThesisTwo.entity; | |||
| import java.io.Serializable; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import java.util.Date; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import java.io.UnsupportedEncodingException; | |||
| /** | |||
| * @Description: 表格二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @ApiModel(value="education_excel_two对象", description="表格二") | |||
| @Data | |||
| @TableName("education_excel_two") | |||
| public class EducationExcelTwo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**第一列*/ | |||
| @Excel(name = "第一列", width = 15) | |||
| @ApiModelProperty(value = "第一列") | |||
| private java.lang.String columnOne; | |||
| /**第二列*/ | |||
| @Excel(name = "第二列", width = 15) | |||
| @ApiModelProperty(value = "第二列") | |||
| private java.lang.String columnTwo; | |||
| /**关联论文id*/ | |||
| @ApiModelProperty(value = "关联论文id") | |||
| private java.lang.String thesisId; | |||
| } | |||
| @ -0,0 +1,144 @@ | |||
| package org.jeecg.modules.educationThesisTwo.entity; | |||
| import java.io.Serializable; | |||
| import java.io.UnsupportedEncodingException; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.annotation.IdType; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @ApiModel(value="education_thesis_two对象", description="论文信息表二") | |||
| @Data | |||
| @TableName("education_thesis_two") | |||
| public class EducationThesisTwo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /**主键*/ | |||
| @TableId(type = IdType.ASSIGN_ID) | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**一级分类*/ | |||
| @Excel(name = "一级分类", width = 15) | |||
| @ApiModelProperty(value = "一级分类") | |||
| private java.lang.String categoryOne; | |||
| /**二级分类*/ | |||
| @Excel(name = "二级分类", width = 15) | |||
| @ApiModelProperty(value = "二级分类") | |||
| private java.lang.String categoryTwo; | |||
| /**标题*/ | |||
| @Excel(name = "标题", width = 15) | |||
| @ApiModelProperty(value = "标题") | |||
| private java.lang.String title; | |||
| /**封面/海报图片*/ | |||
| @Excel(name = "封面/海报图片", width = 15) | |||
| @ApiModelProperty(value = "封面/海报图片") | |||
| private java.lang.String paperImage; | |||
| /**详情页图片*/ | |||
| @Excel(name = "详情页图片", width = 15) | |||
| @ApiModelProperty(value = "详情页图片") | |||
| private java.lang.String image; | |||
| /**模块标题一*/ | |||
| @Excel(name = "模块标题一", width = 15) | |||
| @ApiModelProperty(value = "模块标题一") | |||
| private java.lang.String titleModuleOne; | |||
| /**模块内容一*/ | |||
| @Excel(name = "模块内容一", width = 15) | |||
| @ApiModelProperty(value = "模块内容一") | |||
| private java.lang.String cotentModuleOne; | |||
| /**模块标题二*/ | |||
| @Excel(name = "模块标题二", width = 15) | |||
| @ApiModelProperty(value = "模块标题二") | |||
| private java.lang.String titleModuleTwo; | |||
| /**模块内容二*/ | |||
| @Excel(name = "模块内容二", width = 15) | |||
| @ApiModelProperty(value = "模块内容二") | |||
| private java.lang.String cotentModuleTwo; | |||
| /**模块标题三*/ | |||
| @Excel(name = "模块标题三", width = 15) | |||
| @ApiModelProperty(value = "模块标题三") | |||
| private java.lang.String titleModuleThree; | |||
| /**模块内容三*/ | |||
| @Excel(name = "模块内容三", width = 15) | |||
| @ApiModelProperty(value = "模块内容三") | |||
| private java.lang.String cotentModuleThree; | |||
| /**模块标题四*/ | |||
| @Excel(name = "模块标题四", width = 15) | |||
| @ApiModelProperty(value = "模块标题四") | |||
| private java.lang.String titleModuleFour; | |||
| /**模块内容四*/ | |||
| @Excel(name = "模块内容四", width = 15) | |||
| @ApiModelProperty(value = "模块内容四") | |||
| private java.lang.String cotentModuleFour; | |||
| /**模块标题五*/ | |||
| @Excel(name = "模块标题五", width = 15) | |||
| @ApiModelProperty(value = "模块标题五") | |||
| private java.lang.String titleModuleFive; | |||
| /**模块内容五*/ | |||
| @Excel(name = "模块内容五", width = 15) | |||
| @ApiModelProperty(value = "模块内容五") | |||
| private java.lang.String cotentModuleFive; | |||
| /**模块标题六*/ | |||
| @Excel(name = "模块标题六", width = 15) | |||
| @ApiModelProperty(value = "模块标题六") | |||
| private java.lang.String titleModuleSix; | |||
| /**模块内容六*/ | |||
| @Excel(name = "模块内容六", width = 15) | |||
| @ApiModelProperty(value = "模块内容六") | |||
| private java.lang.String cotentModuleSix; | |||
| /**模块标题七*/ | |||
| @Excel(name = "模块标题七", width = 15) | |||
| @ApiModelProperty(value = "模块标题七") | |||
| private java.lang.String titleModuleSeven; | |||
| /**模块内容七*/ | |||
| @Excel(name = "模块内容七", width = 15) | |||
| @ApiModelProperty(value = "模块内容七") | |||
| private java.lang.String cotentModuleSeven; | |||
| /**表格标题一*/ | |||
| @Excel(name = "表格标题一", width = 15) | |||
| @ApiModelProperty(value = "表格标题一") | |||
| private java.lang.String titleExcelOne; | |||
| /**表格标题二*/ | |||
| @Excel(name = "表格标题二", width = 15) | |||
| @ApiModelProperty(value = "表格标题二") | |||
| private java.lang.String titleExcelTwo; | |||
| //表格一 | |||
| @TableField(exist = false) | |||
| List<EducationExcelOne> educationExcelOneList; | |||
| //表格二 | |||
| @TableField(exist = false) | |||
| List<EducationExcelTwo> educationExcelTwoList; | |||
| //附加材料列表二 | |||
| @TableField(exist = false) | |||
| List<EducationDocumentTwo> educationDocumentTwoList; | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.educationThesisTwo.mapper; | |||
| import java.util.List; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| /** | |||
| * @Description: 附加材料表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationDocumentTwoMapper extends BaseMapper<EducationDocumentTwo> { | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| public List<EducationDocumentTwo> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.educationThesisTwo.mapper; | |||
| import java.util.List; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| /** | |||
| * @Description: 表格一 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationExcelOneMapper extends BaseMapper<EducationExcelOne> { | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| public List<EducationExcelOne> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| package org.jeecg.modules.educationThesisTwo.mapper; | |||
| import java.util.List; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| /** | |||
| * @Description: 表格二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationExcelTwoMapper extends BaseMapper<EducationExcelTwo> { | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| public List<EducationExcelTwo> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| package org.jeecg.modules.educationThesisTwo.mapper; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface EducationThesisTwoMapper extends BaseMapper<EducationThesisTwo> { | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| <?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.jeecg.modules.educationThesisTwo.mapper.EducationDocumentTwoMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM education_document_two | |||
| WHERE | |||
| thesis_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo"> | |||
| SELECT * | |||
| FROM education_document_two | |||
| WHERE | |||
| thesis_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| <?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.jeecg.modules.educationThesisTwo.mapper.EducationExcelOneMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM education_excel_one | |||
| WHERE | |||
| thesis_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne"> | |||
| SELECT * | |||
| FROM education_excel_one | |||
| WHERE | |||
| thesis_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| <?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.jeecg.modules.educationThesisTwo.mapper.EducationExcelTwoMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM education_excel_two | |||
| WHERE | |||
| thesis_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo"> | |||
| SELECT * | |||
| FROM education_excel_two | |||
| WHERE | |||
| thesis_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,5 @@ | |||
| <?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.jeecg.modules.educationThesisTwo.mapper.EducationThesisTwoMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 附加材料表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationDocumentTwoService extends IService<EducationDocumentTwo> { | |||
| public List<EducationDocumentTwo> selectByMainId(String mainId); | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 表格一 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationExcelOneService extends IService<EducationExcelOne> { | |||
| public List<EducationExcelOne> selectByMainId(String mainId); | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 表格二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationExcelTwoService extends IService<EducationExcelTwo> { | |||
| public List<EducationExcelTwo> selectByMainId(String mainId); | |||
| } | |||
| @ -0,0 +1,42 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import java.io.Serializable; | |||
| import java.util.Collection; | |||
| import java.util.List; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| public interface IEducationThesisTwoService extends IService<EducationThesisTwo> { | |||
| /** | |||
| * 添加一对多 | |||
| * | |||
| */ | |||
| public void saveMain(EducationThesisTwo educationThesisTwo,List<EducationExcelOne> educationExcelOneList,List<EducationExcelTwo> educationExcelTwoList,List<EducationDocumentTwo> educationDocumentTwoList) ; | |||
| /** | |||
| * 修改一对多 | |||
| * | |||
| */ | |||
| public void updateMain(EducationThesisTwo educationThesisTwo,List<EducationExcelOne> educationExcelOneList,List<EducationExcelTwo> educationExcelTwoList,List<EducationDocumentTwo> educationDocumentTwoList); | |||
| /** | |||
| * 删除一对多 | |||
| */ | |||
| public void delMain (String id); | |||
| /** | |||
| * 批量删除一对多 | |||
| */ | |||
| public void delBatchMain (Collection<? extends Serializable> idList); | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service.impl; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationDocumentTwoMapper; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationDocumentTwoService; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| /** | |||
| * @Description: 附加材料表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationDocumentTwoServiceImpl extends ServiceImpl<EducationDocumentTwoMapper, EducationDocumentTwo> implements IEducationDocumentTwoService { | |||
| @Autowired | |||
| private EducationDocumentTwoMapper educationDocumentTwoMapper; | |||
| @Override | |||
| public List<EducationDocumentTwo> selectByMainId(String mainId) { | |||
| return educationDocumentTwoMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service.impl; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationExcelOneMapper; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationExcelOneService; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| /** | |||
| * @Description: 表格一 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationExcelOneServiceImpl extends ServiceImpl<EducationExcelOneMapper, EducationExcelOne> implements IEducationExcelOneService { | |||
| @Autowired | |||
| private EducationExcelOneMapper educationExcelOneMapper; | |||
| @Override | |||
| public List<EducationExcelOne> selectByMainId(String mainId) { | |||
| return educationExcelOneMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service.impl; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationExcelTwoMapper; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationExcelTwoService; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| /** | |||
| * @Description: 表格二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationExcelTwoServiceImpl extends ServiceImpl<EducationExcelTwoMapper, EducationExcelTwo> implements IEducationExcelTwoService { | |||
| @Autowired | |||
| private EducationExcelTwoMapper educationExcelTwoMapper; | |||
| @Override | |||
| public List<EducationExcelTwo> selectByMainId(String mainId) { | |||
| return educationExcelTwoMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -0,0 +1,119 @@ | |||
| package org.jeecg.modules.educationThesisTwo.service.impl; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationExcelOneMapper; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationExcelTwoMapper; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationDocumentTwoMapper; | |||
| import org.jeecg.modules.educationThesisTwo.mapper.EducationThesisTwoMapper; | |||
| import org.jeecg.modules.educationThesisTwo.service.IEducationThesisTwoService; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import java.util.Collection; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Service | |||
| public class EducationThesisTwoServiceImpl extends ServiceImpl<EducationThesisTwoMapper, EducationThesisTwo> implements IEducationThesisTwoService { | |||
| @Autowired | |||
| private EducationThesisTwoMapper educationThesisTwoMapper; | |||
| @Autowired | |||
| private EducationExcelOneMapper educationExcelOneMapper; | |||
| @Autowired | |||
| private EducationExcelTwoMapper educationExcelTwoMapper; | |||
| @Autowired | |||
| private EducationDocumentTwoMapper educationDocumentTwoMapper; | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void saveMain(EducationThesisTwo educationThesisTwo, List<EducationExcelOne> educationExcelOneList,List<EducationExcelTwo> educationExcelTwoList,List<EducationDocumentTwo> educationDocumentTwoList) { | |||
| educationThesisTwoMapper.insert(educationThesisTwo); | |||
| if(educationExcelOneList!=null && educationExcelOneList.size()>0) { | |||
| for(EducationExcelOne entity:educationExcelOneList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationExcelOneMapper.insert(entity); | |||
| } | |||
| } | |||
| if(educationExcelTwoList!=null && educationExcelTwoList.size()>0) { | |||
| for(EducationExcelTwo entity:educationExcelTwoList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationExcelTwoMapper.insert(entity); | |||
| } | |||
| } | |||
| if(educationDocumentTwoList!=null && educationDocumentTwoList.size()>0) { | |||
| for(EducationDocumentTwo entity:educationDocumentTwoList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationDocumentTwoMapper.insert(entity); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void updateMain(EducationThesisTwo educationThesisTwo,List<EducationExcelOne> educationExcelOneList,List<EducationExcelTwo> educationExcelTwoList,List<EducationDocumentTwo> educationDocumentTwoList) { | |||
| educationThesisTwoMapper.updateById(educationThesisTwo); | |||
| //1.先删除子表数据 | |||
| educationExcelOneMapper.deleteByMainId(educationThesisTwo.getId()); | |||
| educationExcelTwoMapper.deleteByMainId(educationThesisTwo.getId()); | |||
| educationDocumentTwoMapper.deleteByMainId(educationThesisTwo.getId()); | |||
| //2.子表数据重新插入 | |||
| if(educationExcelOneList!=null && educationExcelOneList.size()>0) { | |||
| for(EducationExcelOne entity:educationExcelOneList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationExcelOneMapper.insert(entity); | |||
| } | |||
| } | |||
| if(educationExcelTwoList!=null && educationExcelTwoList.size()>0) { | |||
| for(EducationExcelTwo entity:educationExcelTwoList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationExcelTwoMapper.insert(entity); | |||
| } | |||
| } | |||
| if(educationDocumentTwoList!=null && educationDocumentTwoList.size()>0) { | |||
| for(EducationDocumentTwo entity:educationDocumentTwoList) { | |||
| //外键设置 | |||
| entity.setThesisId(educationThesisTwo.getId()); | |||
| educationDocumentTwoMapper.insert(entity); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void delMain(String id) { | |||
| educationExcelOneMapper.deleteByMainId(id); | |||
| educationExcelTwoMapper.deleteByMainId(id); | |||
| educationDocumentTwoMapper.deleteByMainId(id); | |||
| educationThesisTwoMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = Exception.class) | |||
| public void delBatchMain(Collection<? extends Serializable> idList) { | |||
| for(Serializable id:idList) { | |||
| educationExcelOneMapper.deleteByMainId(id.toString()); | |||
| educationExcelTwoMapper.deleteByMainId(id.toString()); | |||
| educationDocumentTwoMapper.deleteByMainId(id.toString()); | |||
| educationThesisTwoMapper.deleteById(id); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,139 @@ | |||
| package org.jeecg.modules.educationThesisTwo.vo; | |||
| import java.util.List; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelOne; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationExcelTwo; | |||
| import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo; | |||
| import lombok.Data; | |||
| import org.jeecgframework.poi.excel.annotation.Excel; | |||
| import org.jeecgframework.poi.excel.annotation.ExcelEntity; | |||
| import org.jeecgframework.poi.excel.annotation.ExcelCollection; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import org.springframework.format.annotation.DateTimeFormat; | |||
| import java.util.Date; | |||
| import org.jeecg.common.aspect.annotation.Dict; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| /** | |||
| * @Description: 论文信息表二 | |||
| * @Author: jeecg-boot | |||
| * @Date: 2025-08-12 | |||
| * @Version: V1.0 | |||
| */ | |||
| @Data | |||
| @ApiModel(value="education_thesis_twoPage对象", description="论文信息表二") | |||
| public class EducationThesisTwoPage { | |||
| /**主键*/ | |||
| @ApiModelProperty(value = "主键") | |||
| private java.lang.String id; | |||
| /**创建人*/ | |||
| @ApiModelProperty(value = "创建人") | |||
| private java.lang.String createBy; | |||
| /**创建日期*/ | |||
| @ApiModelProperty(value = "创建日期") | |||
| private java.util.Date createTime; | |||
| /**更新人*/ | |||
| @ApiModelProperty(value = "更新人") | |||
| private java.lang.String updateBy; | |||
| /**更新日期*/ | |||
| @ApiModelProperty(value = "更新日期") | |||
| private java.util.Date updateTime; | |||
| /**一级分类*/ | |||
| @Excel(name = "一级分类", width = 15) | |||
| @ApiModelProperty(value = "一级分类") | |||
| private java.lang.String categoryOne; | |||
| /**二级分类*/ | |||
| @Excel(name = "二级分类", width = 15) | |||
| @ApiModelProperty(value = "二级分类") | |||
| private java.lang.String categoryTwo; | |||
| /**标题*/ | |||
| @Excel(name = "标题", width = 15) | |||
| @ApiModelProperty(value = "标题") | |||
| private java.lang.String title; | |||
| /**封面/海报图片*/ | |||
| @Excel(name = "封面/海报图片", width = 15) | |||
| @ApiModelProperty(value = "封面/海报图片") | |||
| private java.lang.String paperImage; | |||
| /**详情页图片*/ | |||
| @Excel(name = "详情页图片", width = 15) | |||
| @ApiModelProperty(value = "详情页图片") | |||
| private java.lang.String image; | |||
| /**模块标题一*/ | |||
| @Excel(name = "模块标题一", width = 15) | |||
| @ApiModelProperty(value = "模块标题一") | |||
| private java.lang.String titleModuleOne; | |||
| /**模块内容一*/ | |||
| @Excel(name = "模块内容一", width = 15) | |||
| @ApiModelProperty(value = "模块内容一") | |||
| private java.lang.String cotentModuleOne; | |||
| /**模块标题二*/ | |||
| @Excel(name = "模块标题二", width = 15) | |||
| @ApiModelProperty(value = "模块标题二") | |||
| private java.lang.String titleModuleTwo; | |||
| /**模块内容二*/ | |||
| @Excel(name = "模块内容二", width = 15) | |||
| @ApiModelProperty(value = "模块内容二") | |||
| private java.lang.String cotentModuleTwo; | |||
| /**模块标题三*/ | |||
| @Excel(name = "模块标题三", width = 15) | |||
| @ApiModelProperty(value = "模块标题三") | |||
| private java.lang.String titleModuleThree; | |||
| /**模块内容三*/ | |||
| @Excel(name = "模块内容三", width = 15) | |||
| @ApiModelProperty(value = "模块内容三") | |||
| private java.lang.String cotentModuleThree; | |||
| /**模块标题四*/ | |||
| @Excel(name = "模块标题四", width = 15) | |||
| @ApiModelProperty(value = "模块标题四") | |||
| private java.lang.String titleModuleFour; | |||
| /**模块内容四*/ | |||
| @Excel(name = "模块内容四", width = 15) | |||
| @ApiModelProperty(value = "模块内容四") | |||
| private java.lang.String cotentModuleFour; | |||
| /**模块标题五*/ | |||
| @Excel(name = "模块标题五", width = 15) | |||
| @ApiModelProperty(value = "模块标题五") | |||
| private java.lang.String titleModuleFive; | |||
| /**模块内容五*/ | |||
| @Excel(name = "模块内容五", width = 15) | |||
| @ApiModelProperty(value = "模块内容五") | |||
| private java.lang.String cotentModuleFive; | |||
| /**模块标题六*/ | |||
| @Excel(name = "模块标题六", width = 15) | |||
| @ApiModelProperty(value = "模块标题六") | |||
| private java.lang.String titleModuleSix; | |||
| /**模块内容六*/ | |||
| @Excel(name = "模块内容六", width = 15) | |||
| @ApiModelProperty(value = "模块内容六") | |||
| private java.lang.String cotentModuleSix; | |||
| /**模块标题七*/ | |||
| @Excel(name = "模块标题七", width = 15) | |||
| @ApiModelProperty(value = "模块标题七") | |||
| private java.lang.String titleModuleSeven; | |||
| /**模块内容七*/ | |||
| @Excel(name = "模块内容七", width = 15) | |||
| @ApiModelProperty(value = "模块内容七") | |||
| private java.lang.String cotentModuleSeven; | |||
| /**表格标题一*/ | |||
| @Excel(name = "表格标题一", width = 15) | |||
| @ApiModelProperty(value = "表格标题一") | |||
| private java.lang.String titleExcelOne; | |||
| /**表格标题二*/ | |||
| @Excel(name = "表格标题二", width = 15) | |||
| @ApiModelProperty(value = "表格标题二") | |||
| private java.lang.String titleExcelTwo; | |||
| @ExcelCollection(name="表格一") | |||
| @ApiModelProperty(value = "表格一") | |||
| private List<EducationExcelOne> educationExcelOneList; | |||
| @ExcelCollection(name="表格二") | |||
| @ApiModelProperty(value = "表格二") | |||
| private List<EducationExcelTwo> educationExcelTwoList; | |||
| @ExcelCollection(name="附加材料表二") | |||
| @ApiModelProperty(value = "附加材料表二") | |||
| private List<EducationDocumentTwo> educationDocumentTwoList; | |||
| } | |||
| @ -0,0 +1,299 @@ | |||
| <template> | |||
| <a-card :bordered="false"> | |||
| <!-- 查询区域 --> | |||
| <div class="table-page-search-wrapper"> | |||
| <a-form layout="inline" @keyup.enter.native="searchQuery"> | |||
| <a-row :gutter="24"> | |||
| </a-row> | |||
| </a-form> | |||
| </div> | |||
| <!-- 查询区域-END --> | |||
| <!-- 操作按钮区域 --> | |||
| <div class="table-operator"> | |||
| <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||
| <a-button type="primary" icon="download" @click="handleExportXls('论文信息表二')">导出</a-button> | |||
| <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||
| <a-button type="primary" icon="import">导入</a-button> | |||
| </a-upload> | |||
| <!-- 高级查询区域 --> | |||
| <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||
| </a-menu> | |||
| <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||
| </a-dropdown> | |||
| </div> | |||
| <!-- table区域-begin --> | |||
| <div> | |||
| <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||
| <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||
| <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||
| </div> | |||
| <a-table | |||
| ref="table" | |||
| size="middle" | |||
| bordered | |||
| rowKey="id" | |||
| class="j-table-force-nowrap" | |||
| :scroll="{x:true}" | |||
| :columns="columns" | |||
| :dataSource="dataSource" | |||
| :pagination="ipagination" | |||
| :loading="loading" | |||
| :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||
| @change="handleTableChange"> | |||
| <template slot="htmlSlot" slot-scope="text"> | |||
| <div v-html="text"></div> | |||
| </template> | |||
| <template slot="imgSlot" slot-scope="text,record"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||
| <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||
| </template> | |||
| <template slot="fileSlot" slot-scope="text"> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button | |||
| v-else | |||
| :ghost="true" | |||
| type="primary" | |||
| icon="download" | |||
| size="small" | |||
| @click="downloadFile(text)"> | |||
| 下载 | |||
| </a-button> | |||
| </template> | |||
| <span slot="action" slot-scope="text, record"> | |||
| <a @click="handleEdit(record)">编辑</a> | |||
| <a-divider type="vertical" /> | |||
| <a-dropdown> | |||
| <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||
| <a-menu slot="overlay"> | |||
| <a-menu-item> | |||
| <a @click="handleDetail(record)">详情</a> | |||
| </a-menu-item> | |||
| <a-menu-item> | |||
| <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||
| <a>删除</a> | |||
| </a-popconfirm> | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </a-dropdown> | |||
| </span> | |||
| </a-table> | |||
| </div> | |||
| <education-thesis-two-modal ref="modalForm" @ok="modalFormOk"/> | |||
| </a-card> | |||
| </template> | |||
| <script> | |||
| import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||
| import EducationThesisTwoModal from './modules/EducationThesisTwoModal' | |||
| import '@/assets/less/TableExpand.less' | |||
| export default { | |||
| name: "EducationThesisTwoList", | |||
| mixins:[JeecgListMixin], | |||
| components: { | |||
| EducationThesisTwoModal | |||
| }, | |||
| data () { | |||
| return { | |||
| description: '论文信息表二管理页面', | |||
| // 表头 | |||
| columns: [ | |||
| { | |||
| title: '#', | |||
| dataIndex: '', | |||
| key:'rowIndex', | |||
| width:60, | |||
| align:"center", | |||
| customRender:function (t,r,index) { | |||
| return parseInt(index)+1; | |||
| } | |||
| }, | |||
| { | |||
| title:'一级分类', | |||
| align:"center", | |||
| dataIndex: 'categoryOne' | |||
| }, | |||
| { | |||
| title:'二级分类', | |||
| align:"center", | |||
| dataIndex: 'categoryTwo_dictText' | |||
| }, | |||
| { | |||
| title:'标题', | |||
| align:"center", | |||
| dataIndex: 'title' | |||
| }, | |||
| { | |||
| title:'封面/海报图片', | |||
| align:"center", | |||
| dataIndex: 'paperImage', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'详情页图片', | |||
| align:"center", | |||
| dataIndex: 'image', | |||
| scopedSlots: {customRender: 'imgSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题一', | |||
| align:"center", | |||
| dataIndex: 'titleModuleOne' | |||
| }, | |||
| { | |||
| title:'模块内容一', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleOne', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题二', | |||
| align:"center", | |||
| dataIndex: 'titleModuleTwo' | |||
| }, | |||
| { | |||
| title:'模块内容二', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleTwo', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题三', | |||
| align:"center", | |||
| dataIndex: 'titleModuleThree' | |||
| }, | |||
| { | |||
| title:'模块内容三', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleThree', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题四', | |||
| align:"center", | |||
| dataIndex: 'titleModuleFour' | |||
| }, | |||
| { | |||
| title:'模块内容四', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleFour', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题五', | |||
| align:"center", | |||
| dataIndex: 'titleModuleFive' | |||
| }, | |||
| { | |||
| title:'模块内容五', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleFive', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题六', | |||
| align:"center", | |||
| dataIndex: 'titleModuleSix' | |||
| }, | |||
| { | |||
| title:'模块内容六', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleSix', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'模块标题七', | |||
| align:"center", | |||
| dataIndex: 'titleModuleSeven' | |||
| }, | |||
| { | |||
| title:'模块内容七', | |||
| align:"center", | |||
| dataIndex: 'cotentModuleSeven', | |||
| scopedSlots: {customRender: 'htmlSlot'} | |||
| }, | |||
| { | |||
| title:'表格标题一', | |||
| align:"center", | |||
| dataIndex: 'titleExcelOne' | |||
| }, | |||
| { | |||
| title:'表格标题二', | |||
| align:"center", | |||
| dataIndex: 'titleExcelTwo' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| dataIndex: 'action', | |||
| align:"center", | |||
| fixed:"right", | |||
| width:147, | |||
| scopedSlots: { customRender: 'action' }, | |||
| } | |||
| ], | |||
| url: { | |||
| list: "/educationThesisTwo/educationThesisTwo/list", | |||
| delete: "/educationThesisTwo/educationThesisTwo/delete", | |||
| deleteBatch: "/educationThesisTwo/educationThesisTwo/deleteBatch", | |||
| exportXlsUrl: "/educationThesisTwo/educationThesisTwo/exportXls", | |||
| importExcelUrl: "educationThesisTwo/educationThesisTwo/importExcel", | |||
| }, | |||
| dictOptions:{}, | |||
| superFieldList:[], | |||
| } | |||
| }, | |||
| created() { | |||
| this.getSuperFieldList(); | |||
| }, | |||
| computed: { | |||
| importExcelUrl: function(){ | |||
| return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||
| } | |||
| }, | |||
| methods: { | |||
| initDictConfig(){ | |||
| }, | |||
| getSuperFieldList(){ | |||
| let fieldList=[]; | |||
| fieldList.push({type:'string',value:'categoryOne',text:'一级分类'}) | |||
| fieldList.push({type:'string',value:'categoryTwo',text:'二级分类',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'title',text:'标题',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'paperImage',text:'封面/海报图片',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'image',text:'详情页图片',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleOne',text:'模块标题一',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleOne',text:'模块内容一',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleTwo',text:'模块标题二',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleTwo',text:'模块内容二',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleThree',text:'模块标题三',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleThree',text:'模块内容三',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleFour',text:'模块标题四',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleFour',text:'模块内容四',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleFive',text:'模块标题五',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleFive',text:'模块内容五',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleSix',text:'模块标题六',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleSix',text:'模块内容六',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleModuleSeven',text:'模块标题七',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'cotentModuleSeven',text:'模块内容七',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleExcelOne',text:'表格标题一',dictCode:''}) | |||
| fieldList.push({type:'Text',value:'titleExcelTwo',text:'表格标题二',dictCode:''}) | |||
| this.superFieldList = fieldList | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| @import '~@assets/less/common.less'; | |||
| </style> | |||
| @ -0,0 +1,347 @@ | |||
| <template> | |||
| <a-spin :spinning="confirmLoading"> | |||
| <j-form-container :disabled="formDisabled"> | |||
| <!-- 主表单区域 --> | |||
| <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||
| <a-row> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="一级分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryOne"> | |||
| <a-input v-model="model.categoryOne" placeholder="请输入一级分类" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="二级分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryTwo"> | |||
| <j-dict-select-tag type="list" v-model="model.categoryTwo" dictCode="" placeholder="请选择二级分类" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||
| <a-input v-model="model.title" placeholder="请输入标题" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="封面/海报图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paperImage"> | |||
| <j-image-upload isMultiple v-model="model.paperImage" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="详情页图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||
| <j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题一" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleOne"> | |||
| <a-input v-model="model.titleModuleOne" placeholder="请输入模块标题一" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容一" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleOne"> | |||
| <j-editor v-model="model.cotentModuleOne" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题二" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleTwo"> | |||
| <a-input v-model="model.titleModuleTwo" placeholder="请输入模块标题二" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容二" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleTwo"> | |||
| <j-editor v-model="model.cotentModuleTwo" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题三" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleThree"> | |||
| <a-input v-model="model.titleModuleThree" placeholder="请输入模块标题三" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容三" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleThree"> | |||
| <j-editor v-model="model.cotentModuleThree" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题四" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleFour"> | |||
| <a-input v-model="model.titleModuleFour" placeholder="请输入模块标题四" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容四" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleFour"> | |||
| <j-editor v-model="model.cotentModuleFour" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题五" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleFive"> | |||
| <a-input v-model="model.titleModuleFive" placeholder="请输入模块标题五" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容五" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleFive"> | |||
| <j-editor v-model="model.cotentModuleFive" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题六" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleSix"> | |||
| <a-input v-model="model.titleModuleSix" placeholder="请输入模块标题六" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容六" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleSix"> | |||
| <j-editor v-model="model.cotentModuleSix" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块标题七" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleModuleSeven"> | |||
| <a-input v-model="model.titleModuleSeven" placeholder="请输入模块标题七" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="模块内容七" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cotentModuleSeven"> | |||
| <j-editor v-model="model.cotentModuleSeven" /> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="表格标题一" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleExcelOne"> | |||
| <a-input v-model="model.titleExcelOne" placeholder="请输入表格标题一" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| <a-col :span="24" > | |||
| <a-form-model-item label="表格标题二" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="titleExcelTwo"> | |||
| <a-input v-model="model.titleExcelTwo" placeholder="请输入表格标题二" ></a-input> | |||
| </a-form-model-item> | |||
| </a-col> | |||
| </a-row> | |||
| </a-form-model> | |||
| </j-form-container> | |||
| <!-- 子表单区域 --> | |||
| <a-tabs v-model="activeKey" @change="handleChangeTabs"> | |||
| <a-tab-pane tab="表格一" :key="refKeys[0]" :forceRender="true"> | |||
| <j-editable-table | |||
| :ref="refKeys[0]" | |||
| :loading="educationExcelOneTable.loading" | |||
| :columns="educationExcelOneTable.columns" | |||
| :dataSource="educationExcelOneTable.dataSource" | |||
| :maxHeight="300" | |||
| :disabled="formDisabled" | |||
| :rowNumber="true" | |||
| :rowSelection="true" | |||
| :actionButton="true"/> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="表格二" :key="refKeys[1]" :forceRender="true"> | |||
| <j-editable-table | |||
| :ref="refKeys[1]" | |||
| :loading="educationExcelTwoTable.loading" | |||
| :columns="educationExcelTwoTable.columns" | |||
| :dataSource="educationExcelTwoTable.dataSource" | |||
| :maxHeight="300" | |||
| :disabled="formDisabled" | |||
| :rowNumber="true" | |||
| :rowSelection="true" | |||
| :actionButton="true"/> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="附加材料表二" :key="refKeys[2]" :forceRender="true"> | |||
| <j-editable-table | |||
| :ref="refKeys[2]" | |||
| :loading="educationDocumentTwoTable.loading" | |||
| :columns="educationDocumentTwoTable.columns" | |||
| :dataSource="educationDocumentTwoTable.dataSource" | |||
| :maxHeight="300" | |||
| :disabled="formDisabled" | |||
| :rowNumber="true" | |||
| :rowSelection="true" | |||
| :actionButton="true"/> | |||
| </a-tab-pane> | |||
| </a-tabs> | |||
| </a-spin> | |||
| </template> | |||
| <script> | |||
| import { getAction } from '@/api/manage' | |||
| import { FormTypes,getRefPromise,VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil' | |||
| import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin' | |||
| import { validateDuplicateValue } from '@/utils/util' | |||
| export default { | |||
| name: 'EducationThesisTwoForm', | |||
| mixins: [JEditableTableModelMixin], | |||
| components: { | |||
| }, | |||
| data() { | |||
| return { | |||
| labelCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 5 }, | |||
| }, | |||
| wrapperCol: { | |||
| xs: { span: 24 }, | |||
| sm: { span: 16 }, | |||
| }, | |||
| model:{ | |||
| }, | |||
| // 新增时子表默认添加几行空数据 | |||
| addDefaultRowNum: 1, | |||
| validatorRules: { | |||
| }, | |||
| refKeys: ['educationExcelOne', 'educationExcelTwo', 'educationDocumentTwo', ], | |||
| tableKeys:['educationExcelOne', 'educationExcelTwo', 'educationDocumentTwo', ], | |||
| activeKey: 'educationExcelOne', | |||
| // 表格一 | |||
| educationExcelOneTable: { | |||
| loading: false, | |||
| dataSource: [], | |||
| columns: [ | |||
| { | |||
| title: '第一列', | |||
| key: 'columnOne', | |||
| type: FormTypes.input, | |||
| width:"200px", | |||
| placeholder: '请输入${title}', | |||
| defaultValue:'', | |||
| }, | |||
| { | |||
| title: '第二列', | |||
| key: 'columnTwo', | |||
| type: FormTypes.input, | |||
| width:"200px", | |||
| placeholder: '请输入${title}', | |||
| defaultValue:'', | |||
| }, | |||
| ] | |||
| }, | |||
| // 表格二 | |||
| educationExcelTwoTable: { | |||
| loading: false, | |||
| dataSource: [], | |||
| columns: [ | |||
| { | |||
| title: '第一列', | |||
| key: 'columnOne', | |||
| type: FormTypes.input, | |||
| width:"200px", | |||
| placeholder: '请输入${title}', | |||
| defaultValue:'', | |||
| }, | |||
| { | |||
| title: '第二列', | |||
| key: 'columnTwo', | |||
| type: FormTypes.input, | |||
| width:"200px", | |||
| placeholder: '请输入${title}', | |||
| defaultValue:'', | |||
| }, | |||
| ] | |||
| }, | |||
| // 附加材料表二 | |||
| educationDocumentTwoTable: { | |||
| loading: false, | |||
| dataSource: [], | |||
| columns: [ | |||
| { | |||
| title: '标题', | |||
| key: 'title', | |||
| type: FormTypes.input, | |||
| width:"200px", | |||
| placeholder: '请输入${title}', | |||
| defaultValue:'', | |||
| }, | |||
| { | |||
| title: '文件', | |||
| key: 'document', | |||
| type: FormTypes.file, | |||
| token:true, | |||
| responseName:"message", | |||
| width:"200px", | |||
| placeholder: '请选择文件', | |||
| defaultValue:'', | |||
| }, | |||
| ] | |||
| }, | |||
| url: { | |||
| add: "/educationThesisTwo/educationThesisTwo/add", | |||
| edit: "/educationThesisTwo/educationThesisTwo/edit", | |||
| queryById: "/educationThesisTwo/educationThesisTwo/queryById", | |||
| educationExcelOne: { | |||
| list: '/educationThesisTwo/educationThesisTwo/queryEducationExcelOneByMainId' | |||
| }, | |||
| educationExcelTwo: { | |||
| list: '/educationThesisTwo/educationThesisTwo/queryEducationExcelTwoByMainId' | |||
| }, | |||
| educationDocumentTwo: { | |||
| list: '/educationThesisTwo/educationThesisTwo/queryEducationDocumentTwoByMainId' | |||
| }, | |||
| } | |||
| } | |||
| }, | |||
| props: { | |||
| //表单禁用 | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false, | |||
| required: false | |||
| } | |||
| }, | |||
| computed: { | |||
| formDisabled(){ | |||
| return this.disabled | |||
| }, | |||
| }, | |||
| created () { | |||
| }, | |||
| methods: { | |||
| addBefore(){ | |||
| this.educationExcelOneTable.dataSource=[] | |||
| this.educationExcelTwoTable.dataSource=[] | |||
| this.educationDocumentTwoTable.dataSource=[] | |||
| }, | |||
| getAllTable() { | |||
| let values = this.tableKeys.map(key => getRefPromise(this, key)) | |||
| return Promise.all(values) | |||
| }, | |||
| /** 调用完edit()方法之后会自动调用此方法 */ | |||
| editAfter() { | |||
| this.$nextTick(() => { | |||
| }) | |||
| // 加载子表数据 | |||
| if (this.model.id) { | |||
| let params = { id: this.model.id } | |||
| this.requestSubTableData(this.url.educationExcelOne.list, params, this.educationExcelOneTable) | |||
| this.requestSubTableData(this.url.educationExcelTwo.list, params, this.educationExcelTwoTable) | |||
| this.requestSubTableData(this.url.educationDocumentTwo.list, params, this.educationDocumentTwoTable) | |||
| } | |||
| }, | |||
| //校验所有一对一子表表单 | |||
| validateSubForm(allValues){ | |||
| return new Promise((resolve,reject)=>{ | |||
| Promise.all([ | |||
| ]).then(() => { | |||
| resolve(allValues) | |||
| }).catch(e => { | |||
| if (e.error === VALIDATE_NO_PASSED) { | |||
| // 如果有未通过表单验证的子表,就自动跳转到它所在的tab | |||
| this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] | |||
| } else { | |||
| console.error(e) | |||
| } | |||
| }) | |||
| }) | |||
| }, | |||
| /** 整理成formData */ | |||
| classifyIntoFormData(allValues) { | |||
| let main = Object.assign(this.model, allValues.formValue) | |||
| return { | |||
| ...main, // 展开 | |||
| educationExcelOneList: allValues.tablesValue[0].values, | |||
| educationExcelTwoList: allValues.tablesValue[1].values, | |||
| educationDocumentTwoList: allValues.tablesValue[2].values, | |||
| } | |||
| }, | |||
| validateError(msg){ | |||
| this.$message.error(msg) | |||
| }, | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||
| @ -0,0 +1,64 @@ | |||
| <template> | |||
| <j-modal | |||
| :title="title" | |||
| :width="1200" | |||
| :visible="visible" | |||
| :maskClosable="false" | |||
| switchFullscreen | |||
| @ok="handleOk" | |||
| :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||
| @cancel="handleCancel"> | |||
| <education-thesis-two-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/> | |||
| </j-modal> | |||
| </template> | |||
| <script> | |||
| import EducationThesisTwoForm from './EducationThesisTwoForm' | |||
| export default { | |||
| name: 'EducationThesisTwoModal', | |||
| components: { | |||
| EducationThesisTwoForm | |||
| }, | |||
| data() { | |||
| return { | |||
| title:'', | |||
| width:800, | |||
| visible: false, | |||
| disableSubmit: false | |||
| } | |||
| }, | |||
| methods:{ | |||
| add () { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.add(); | |||
| }) | |||
| }, | |||
| edit (record) { | |||
| this.visible=true | |||
| this.$nextTick(()=>{ | |||
| this.$refs.realForm.edit(record); | |||
| }) | |||
| }, | |||
| close () { | |||
| this.$emit('close'); | |||
| this.visible = false; | |||
| }, | |||
| handleOk () { | |||
| this.$refs.realForm.handleOk(); | |||
| }, | |||
| submitCallback(){ | |||
| this.$emit('ok'); | |||
| this.visible = false; | |||
| }, | |||
| handleCancel () { | |||
| this.close() | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| </style> | |||