Browse Source

1、增加服务模块

master
Aug 2 months ago
parent
commit
6288e46e94
48 changed files with 2873 additions and 15 deletions
  1. +229
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/controller/EducationCategoryServiceModuleController.java
  2. +67
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/entity/EducationCategoryServiceModule.java
  3. +22
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/mapper/EducationCategoryServiceModuleMapper.java
  4. +9
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/mapper/xml/EducationCategoryServiceModuleMapper.xml
  5. +38
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/service/IEducationCategoryServiceModuleService.java
  6. +191
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/service/impl/EducationCategoryServiceModuleServiceImpl.java
  7. +360
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue/EducationCategoryServiceModuleList.vue
  8. +159
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue/modules/EducationCategoryServiceModuleModal.vue
  9. +82
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModule.api.ts
  10. +51
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModule.data.ts
  11. +272
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModuleList.vue
  12. +87
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/components/EducationCategoryServiceModuleModal.vue
  13. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/controller/EducationCategoryThesisController.java
  14. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/entity/EducationCategoryThesis.java
  15. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/mapper/EducationCategoryThesisMapper.java
  16. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/service/IEducationCategoryThesisService.java
  17. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/service/impl/EducationCategoryThesisServiceImpl.java
  18. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue/EducationCategoryThesisList.vue
  19. +3
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue/modules/EducationCategoryThesisModal.vue
  20. +10
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue3/EducationCategoryThesis.data.ts
  21. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/controller/EducationCategoryThesisTwoController.java
  22. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/entity/EducationCategoryThesisTwo.java
  23. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/mapper/EducationCategoryThesisTwoMapper.java
  24. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/service/IEducationCategoryThesisTwoService.java
  25. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/service/impl/EducationCategoryThesisTwoServiceImpl.java
  26. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue/EducationCategoryThesisTwoList.vue
  27. +3
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue/modules/EducationCategoryThesisTwoModal.vue
  28. +10
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue3/EducationCategoryThesisTwo.data.ts
  29. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/controller/EducationServiceArticleController.java
  30. +67
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/entity/EducationServiceArticle.java
  31. +17
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/mapper/EducationServiceArticleMapper.java
  32. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/mapper/xml/EducationServiceArticleMapper.xml
  33. +14
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/service/IEducationServiceArticleService.java
  34. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/service/impl/EducationServiceArticleServiceImpl.java
  35. +191
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/EducationServiceArticleList.vue
  36. +126
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleForm.vue
  37. +84
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleModal.Style#Drawer.vue
  38. +60
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleModal.vue
  39. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticle.api.ts
  40. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticle.data.ts
  41. +162
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticleList.vue
  42. +58
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/components/EducationServiceArticleModal.vue
  43. +7
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/ConfigController.java
  44. +15
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/IndexController.java
  45. +2
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java
  46. +7
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IndexService.java
  47. +49
    -5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java
  48. +74
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java

+ 229
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/controller/EducationCategoryServiceModuleController.java View File

@ -0,0 +1,229 @@
package org.jeecg.modules.educationCategoryServiceModule.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.educationCategoryServiceModule.entity.EducationCategoryServiceModule;
import org.jeecg.modules.educationCategoryServiceModule.service.IEducationCategoryServiceModuleService;
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-26
* @Version: V1.0
*/
@Api(tags="服务模块分类")
@RestController
@RequestMapping("/educationCategoryServiceModule/educationCategoryServiceModule")
@Slf4j
public class EducationCategoryServiceModuleController extends JeecgController<EducationCategoryServiceModule, IEducationCategoryServiceModuleService>{
@Autowired
private IEducationCategoryServiceModuleService educationCategoryServiceModuleService;
/**
* 分页列表查询
*
* @param educationCategoryServiceModule
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "服务模块分类-分页列表查询")
@ApiOperation(value="服务模块分类-分页列表查询", notes="服务模块分类-分页列表查询")
@GetMapping(value = "/rootList")
public Result<IPage<EducationCategoryServiceModule>> queryPageList(EducationCategoryServiceModule educationCategoryServiceModule,
@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<EducationCategoryServiceModule> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryServiceModule, req.getParameterMap());
List<EducationCategoryServiceModule> list = educationCategoryServiceModuleService.queryTreeListNoPage(queryWrapper);
IPage<EducationCategoryServiceModule> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}else{
String parentId = educationCategoryServiceModule.getPid();
if (oConvertUtils.isEmpty(parentId)) {
parentId = "0";
}
educationCategoryServiceModule.setPid(null);
QueryWrapper<EducationCategoryServiceModule> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryServiceModule, req.getParameterMap());
// 使用 eq 防止模糊查询
queryWrapper.eq("pid", parentId);
Page<EducationCategoryServiceModule> page = new Page<EducationCategoryServiceModule>(pageNo, pageSize);
IPage<EducationCategoryServiceModule> pageList = educationCategoryServiceModuleService.page(page, queryWrapper);
return Result.OK(pageList);
}
}
/**
* 获取子数据
* @param educationCategoryServiceModule
* @param req
* @return
*/
//@AutoLog(value = "服务模块分类-获取子数据")
@ApiOperation(value="服务模块分类-获取子数据", notes="服务模块分类-获取子数据")
@GetMapping(value = "/childList")
public Result<IPage<EducationCategoryServiceModule>> queryPageList(EducationCategoryServiceModule educationCategoryServiceModule,HttpServletRequest req) {
QueryWrapper<EducationCategoryServiceModule> queryWrapper = QueryGenerator.initQueryWrapper(educationCategoryServiceModule, req.getParameterMap());
List<EducationCategoryServiceModule> list = educationCategoryServiceModuleService.list(queryWrapper);
IPage<EducationCategoryServiceModule> 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<EducationCategoryServiceModule> queryWrapper = new QueryWrapper<>();
List<String> parentIdList = Arrays.asList(parentIds.split(","));
queryWrapper.in("pid", parentIdList);
List<EducationCategoryServiceModule> list = educationCategoryServiceModuleService.list(queryWrapper);
IPage<EducationCategoryServiceModule> 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 educationCategoryServiceModule
* @return
*/
@AutoLog(value = "服务模块分类-添加")
@ApiOperation(value="服务模块分类-添加", notes="服务模块分类-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody EducationCategoryServiceModule educationCategoryServiceModule) {
educationCategoryServiceModuleService.addEducationCategoryServiceModule(educationCategoryServiceModule);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param educationCategoryServiceModule
* @return
*/
@AutoLog(value = "服务模块分类-编辑")
@ApiOperation(value="服务模块分类-编辑", notes="服务模块分类-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody EducationCategoryServiceModule educationCategoryServiceModule) {
educationCategoryServiceModuleService.updateEducationCategoryServiceModule(educationCategoryServiceModule);
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) {
educationCategoryServiceModuleService.deleteEducationCategoryServiceModule(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.educationCategoryServiceModuleService.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<EducationCategoryServiceModule> queryById(@RequestParam(name="id",required=true) String id) {
EducationCategoryServiceModule educationCategoryServiceModule = educationCategoryServiceModuleService.getById(id);
if(educationCategoryServiceModule==null) {
return Result.error("未找到对应数据");
}
return Result.OK(educationCategoryServiceModule);
}
/**
* 导出excel
*
* @param request
* @param educationCategoryServiceModule
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, EducationCategoryServiceModule educationCategoryServiceModule) {
return super.exportXls(request, educationCategoryServiceModule, EducationCategoryServiceModule.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, EducationCategoryServiceModule.class);
}
}

+ 67
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/entity/EducationCategoryServiceModule.java View File

@ -0,0 +1,67 @@
package org.jeecg.modules.educationCategoryServiceModule.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-26
* @Version: V1.0
*/
@Data
@TableName("education_category_service_module")
@ApiModel(value="education_category_service_module对象", description="服务模块分类")
public class EducationCategoryServiceModule 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.Integer orderNo;
/**父级节点*/
@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;
}

+ 22
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/mapper/EducationCategoryServiceModuleMapper.java View File

@ -0,0 +1,22 @@
package org.jeecg.modules.educationCategoryServiceModule.mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.educationCategoryServiceModule.entity.EducationCategoryServiceModule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 服务模块分类
* @Author: jeecg-boot
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface EducationCategoryServiceModuleMapper extends BaseMapper<EducationCategoryServiceModule> {
/**
* 编辑节点状态
* @param id
* @param status
*/
void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status);
}

+ 9
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/mapper/xml/EducationCategoryServiceModuleMapper.xml View File

@ -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.educationCategoryServiceModule.mapper.EducationCategoryServiceModuleMapper">
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update education_category_service_module set has_child = #{status} where id = #{id}
</update>
</mapper>

+ 38
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/service/IEducationCategoryServiceModuleService.java View File

@ -0,0 +1,38 @@
package org.jeecg.modules.educationCategoryServiceModule.service;
import org.jeecg.modules.educationCategoryServiceModule.entity.EducationCategoryServiceModule;
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-26
* @Version: V1.0
*/
public interface IEducationCategoryServiceModuleService extends IService<EducationCategoryServiceModule> {
/**根节点父ID的值*/
public static final String ROOT_PID_VALUE = "0";
/**树节点有子节点状态值*/
public static final String HASCHILD = "1";
/**树节点无子节点状态值*/
public static final String NOCHILD = "0";
/**新增节点*/
void addEducationCategoryServiceModule(EducationCategoryServiceModule educationCategoryServiceModule);
/**修改节点*/
void updateEducationCategoryServiceModule(EducationCategoryServiceModule educationCategoryServiceModule) throws JeecgBootException;
/**删除节点*/
void deleteEducationCategoryServiceModule(String id) throws JeecgBootException;
/**查询所有数据,无分页*/
List<EducationCategoryServiceModule> queryTreeListNoPage(QueryWrapper<EducationCategoryServiceModule> queryWrapper);
}

+ 191
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/service/impl/EducationCategoryServiceModuleServiceImpl.java View File

@ -0,0 +1,191 @@
package org.jeecg.modules.educationCategoryServiceModule.service.impl;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.educationCategoryServiceModule.entity.EducationCategoryServiceModule;
import org.jeecg.modules.educationCategoryServiceModule.mapper.EducationCategoryServiceModuleMapper;
import org.jeecg.modules.educationCategoryServiceModule.service.IEducationCategoryServiceModuleService;
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-26
* @Version: V1.0
*/
@Service
public class EducationCategoryServiceModuleServiceImpl extends ServiceImpl<EducationCategoryServiceModuleMapper, EducationCategoryServiceModule> implements IEducationCategoryServiceModuleService {
@Override
public void addEducationCategoryServiceModule(EducationCategoryServiceModule educationCategoryServiceModule) {
//新增时设置hasChild为0
educationCategoryServiceModule.setHasChild(IEducationCategoryServiceModuleService.NOCHILD);
if(oConvertUtils.isEmpty(educationCategoryServiceModule.getPid())){
educationCategoryServiceModule.setPid(IEducationCategoryServiceModuleService.ROOT_PID_VALUE);
}else{
//如果当前节点父ID不为空 则设置父节点的hasChildren 为1
EducationCategoryServiceModule parent = baseMapper.selectById(educationCategoryServiceModule.getPid());
if(parent!=null && !"1".equals(parent.getHasChild())){
parent.setHasChild("1");
baseMapper.updateById(parent);
}
}
baseMapper.insert(educationCategoryServiceModule);
}
@Override
public void updateEducationCategoryServiceModule(EducationCategoryServiceModule educationCategoryServiceModule) {
EducationCategoryServiceModule entity = this.getById(educationCategoryServiceModule.getId());
if(entity==null) {
throw new JeecgBootException("未找到对应实体");
}
String old_pid = entity.getPid();
String new_pid = educationCategoryServiceModule.getPid();
if(!old_pid.equals(new_pid)) {
updateOldParentNode(old_pid);
if(oConvertUtils.isEmpty(new_pid)){
educationCategoryServiceModule.setPid(IEducationCategoryServiceModuleService.ROOT_PID_VALUE);
}
if(!IEducationCategoryServiceModuleService.ROOT_PID_VALUE.equals(educationCategoryServiceModule.getPid())) {
baseMapper.updateTreeNodeStatus(educationCategoryServiceModule.getPid(), IEducationCategoryServiceModuleService.HASCHILD);
}
}
baseMapper.updateById(educationCategoryServiceModule);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteEducationCategoryServiceModule(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){
EducationCategoryServiceModule educationCategoryServiceModule = this.getById(idVal);
String pidVal = educationCategoryServiceModule.getPid();
//查询此节点上一级是否还有其他子节点
List<EducationCategoryServiceModule> dataList = baseMapper.selectList(new QueryWrapper<EducationCategoryServiceModule>().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{
EducationCategoryServiceModule educationCategoryServiceModule = this.getById(id);
if(educationCategoryServiceModule==null) {
throw new JeecgBootException("未找到对应实体");
}
updateOldParentNode(educationCategoryServiceModule.getPid());
baseMapper.deleteById(id);
}
}
@Override
public List<EducationCategoryServiceModule> queryTreeListNoPage(QueryWrapper<EducationCategoryServiceModule> queryWrapper) {
List<EducationCategoryServiceModule> dataList = baseMapper.selectList(queryWrapper);
List<EducationCategoryServiceModule> mapList = new ArrayList<>();
for(EducationCategoryServiceModule data : dataList){
String pidVal = data.getPid();
//递归查询子节点的根节点
if(pidVal != null && !"0".equals(pidVal)){
EducationCategoryServiceModule 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(!IEducationCategoryServiceModuleService.ROOT_PID_VALUE.equals(pid)) {
Integer count = Math.toIntExact(baseMapper.selectCount(new QueryWrapper<EducationCategoryServiceModule>().eq("pid", pid)));
if(count==null || count<=1) {
baseMapper.updateTreeNodeStatus(pid, IEducationCategoryServiceModuleService.NOCHILD);
}
}
}
/**
* 递归查询节点的根节点
* @param pidVal
* @return
*/
private EducationCategoryServiceModule getTreeRoot(String pidVal){
EducationCategoryServiceModule 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<EducationCategoryServiceModule> dataList = baseMapper.selectList(new QueryWrapper<EducationCategoryServiceModule>().eq("pid", pidVal));
if(dataList != null && dataList.size()>0){
for(EducationCategoryServiceModule tree : dataList) {
if(!sb.toString().contains(tree.getId())){
sb.append(",").append(tree.getId());
}
this.getTreeChildIds(tree.getId(),sb);
}
}
return sb;
}
}

+ 360
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue/EducationCategoryServiceModuleList.vue View File

@ -0,0 +1,360 @@
<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>
<educationCategoryServiceModule-modal ref="modalForm" @ok="modalFormOk"></educationCategoryServiceModule-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EducationCategoryServiceModuleModal from './modules/EducationCategoryServiceModuleModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "EducationCategoryServiceModuleList",
mixins:[JeecgListMixin],
components: {
EducationCategoryServiceModuleModal
},
data () {
return {
description: '服务模块分类管理页面',
//
columns: [
{
title:'分类名称',
align:"left",
dataIndex: 'title'
},
{
title:'图标',
align:"left",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'排序编号',
align:"left",
dataIndex: 'orderNo'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/educationCategoryServiceModule/educationCategoryServiceModule/rootList",
childList: "/educationCategoryServiceModule/educationCategoryServiceModule/childList",
getChildListBatch: "/educationCategoryServiceModule/educationCategoryServiceModule/getChildListBatch",
delete: "/educationCategoryServiceModule/educationCategoryServiceModule/delete",
deleteBatch: "/educationCategoryServiceModule/educationCategoryServiceModule/deleteBatch",
exportXlsUrl: "/educationCategoryServiceModule/educationCategoryServiceModule/exportXls",
importExcelUrl: "educationCategoryServiceModule/educationCategoryServiceModule/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:'int',value:'orderNo',text:'排序编号',dictCode:''})
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 159
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue/modules/EducationCategoryServiceModuleModal.vue View File

@ -0,0 +1,159 @@
<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="orderNo">
<a-input-number v-model="model.orderNo" placeholder="请输入排序编号" style="width: 100%" />
</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_service_module,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: "EducationCategoryServiceModuleModal",
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: "/educationCategoryServiceModule/educationCategoryServiceModule/add",
edit: "/educationCategoryServiceModule/educationCategoryServiceModule/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>

+ 82
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModule.api.ts View File

@ -0,0 +1,82 @@
import {defHttp} from "/@/utils/http/axios";
import {Modal} from 'ant-design-vue';
enum Api {
list = '/educationCategoryServiceModule/educationCategoryServiceModule/rootList',
save='/educationCategoryServiceModule/educationCategoryServiceModule/add',
edit='/educationCategoryServiceModule/educationCategoryServiceModule/edit',
deleteEducationCategoryServiceModule = '/sys/educationCategoryServiceModule/delete',
deleteBatch = '/educationCategoryServiceModule/educationCategoryServiceModule/deleteBatch',
importExcel = '/educationCategoryServiceModule/educationCategoryServiceModule/importExcel',
exportXls = '/educationCategoryServiceModule/educationCategoryServiceModule/exportXls',
loadTreeData = '/educationCategoryServiceModule/educationCategoryServiceModule/loadTreeRoot',
getChildList = '/educationCategoryServiceModule/educationCategoryServiceModule/childList',
getChildListBatch = '/educationCategoryServiceModule/educationCategoryServiceModule/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 deleteEducationCategoryServiceModule = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteEducationCategoryServiceModule, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDeleteEducationCategoryServiceModule = (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});

+ 51
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModule.data.ts View File

@ -0,0 +1,51 @@
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,
},
{
title: '排序编号',
align:"center",
dataIndex: 'orderNo'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '分类名称',
field: 'title',
component: 'Input',
},
{
label: '图标',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '排序编号',
field: 'orderNo',
component: 'InputNumber',
},
{
label: '父级节点',
field: 'pid',
component: 'Input',
},
];

+ 272
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/EducationCategoryServiceModuleList.vue View File

@ -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>
<!--字典弹窗-->
<EducationCategoryServiceModuleModal @register="registerModal" @success="handleSuccess"/>
</div>
</template>
<script lang="ts" name="educationCategoryServiceModule-educationCategoryServiceModule" 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 EducationCategoryServiceModuleModal from './components/EducationCategoryServiceModuleModal.vue';
import {columns} from './EducationCategoryServiceModule.data';
import {list, deleteEducationCategoryServiceModule, batchDeleteEducationCategoryServiceModule, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './EducationCategoryServiceModule.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 deleteEducationCategoryServiceModule({id: record.id}, importSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
const ids = selectedRowKeys.value.filter(item => !item.includes('loading'))
await batchDeleteEducationCategoryServiceModule({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>

+ 87
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryServiceModule/vue3/components/EducationCategoryServiceModuleModal.vue View File

@ -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 '../educationCategoryServiceModule.data';
import {loadTreeData, saveOrUpdateDict} from '../educationCategoryServiceModule.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>

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/controller/EducationCategoryThesisController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 论文分类表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Date: 2025-08-26
* @Version: V1.0
*/
@Api(tags="论文分类表")


+ 5
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/entity/EducationCategoryThesis.java View File

@ -18,7 +18,7 @@ import java.io.UnsupportedEncodingException;
/**
* @Description: 论文分类表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Date: 2025-08-26
* @Version: V1.0
*/
@Data
@ -51,6 +51,10 @@ public class EducationCategoryThesis implements Serializable {
@Excel(name = "图标", width = 15)
@ApiModelProperty(value = "图标")
private java.lang.String image;
/**排序编号*/
@Excel(name = "排序编号", width = 15)
@ApiModelProperty(value = "排序编号")
private java.lang.Integer orderNo;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
@ApiModelProperty(value = "父级节点")


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/mapper/EducationCategoryThesisMapper.java View File

@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 论文分类表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface EducationCategoryThesisMapper extends BaseMapper<EducationCategoryThesis> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/service/IEducationCategoryThesisService.java View File

@ -9,7 +9,7 @@ import java.util.List;
/**
* @Description: 论文分类表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface IEducationCategoryThesisService extends IService<EducationCategoryThesis> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/service/impl/EducationCategoryThesisServiceImpl.java View File

@ -17,7 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 论文分类表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Date: 2025-08-26
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue/EducationCategoryThesisList.vue View File

@ -121,6 +121,11 @@
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'排序编号',
align:"left",
dataIndex: 'orderNo'
},
{
title: '操作',
dataIndex: 'action',
@ -343,6 +348,7 @@
let fieldList=[];
fieldList.push({type:'string',value:'title',text:'分类名称',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'图标',dictCode:''})
fieldList.push({type:'int',value:'orderNo',text:'排序编号',dictCode:''})
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
this.superFieldList = fieldList
}


+ 3
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue/modules/EducationCategoryThesisModal.vue View File

@ -16,6 +16,9 @@
<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="orderNo">
<a-input-number v-model="model.orderNo" placeholder="请输入排序编号" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-tree-select
ref="treeSelect"


+ 10
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesis/vue3/EducationCategoryThesis.data.ts View File

@ -15,6 +15,11 @@ export const columns: BasicColumn[] = [
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '排序编号',
align:"center",
dataIndex: 'orderNo'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -33,6 +38,11 @@ export const formSchema: FormSchema[] = [
componentProps:{
},
},
{
label: '排序编号',
field: 'orderNo',
component: 'InputNumber',
},
{
label: '父级节点',
field: 'pid',


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/controller/EducationCategoryThesisTwoController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 论文分类表二
* @Author: jeecg-boot
* @Date: 2025-08-12
* @Date: 2025-08-26
* @Version: V1.0
*/
@Api(tags="论文分类表二")


+ 5
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/entity/EducationCategoryThesisTwo.java View File

@ -18,7 +18,7 @@ import java.io.UnsupportedEncodingException;
/**
* @Description: 论文分类表二
* @Author: jeecg-boot
* @Date: 2025-08-12
* @Date: 2025-08-26
* @Version: V1.0
*/
@Data
@ -51,6 +51,10 @@ public class EducationCategoryThesisTwo implements Serializable {
@Excel(name = "图标", width = 15)
@ApiModelProperty(value = "图标")
private java.lang.String image;
/**排序编号*/
@Excel(name = "排序编号", width = 15)
@ApiModelProperty(value = "排序编号")
private java.lang.Integer orderNo;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
@ApiModelProperty(value = "父级节点")


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/mapper/EducationCategoryThesisTwoMapper.java View File

@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 论文分类表二
* @Author: jeecg-boot
* @Date: 2025-08-12
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface EducationCategoryThesisTwoMapper extends BaseMapper<EducationCategoryThesisTwo> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/service/IEducationCategoryThesisTwoService.java View File

@ -9,7 +9,7 @@ import java.util.List;
/**
* @Description: 论文分类表二
* @Author: jeecg-boot
* @Date: 2025-08-12
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface IEducationCategoryThesisTwoService extends IService<EducationCategoryThesisTwo> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/service/impl/EducationCategoryThesisTwoServiceImpl.java View File

@ -17,7 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 论文分类表二
* @Author: jeecg-boot
* @Date: 2025-08-12
* @Date: 2025-08-26
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue/EducationCategoryThesisTwoList.vue View File

@ -121,6 +121,11 @@
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'排序编号',
align:"left",
dataIndex: 'orderNo'
},
{
title: '操作',
dataIndex: 'action',
@ -343,6 +348,7 @@
let fieldList=[];
fieldList.push({type:'Text',value:'title',text:'分类名称',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'图标',dictCode:''})
fieldList.push({type:'int',value:'orderNo',text:'排序编号',dictCode:''})
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
this.superFieldList = fieldList
}


+ 3
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue/modules/EducationCategoryThesisTwoModal.vue View File

@ -16,6 +16,9 @@
<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="orderNo">
<a-input-number v-model="model.orderNo" placeholder="请输入排序编号" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-tree-select
ref="treeSelect"


+ 10
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationCategoryThesisTwo/vue3/EducationCategoryThesisTwo.data.ts View File

@ -15,6 +15,11 @@ export const columns: BasicColumn[] = [
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '排序编号',
align:"center",
dataIndex: 'orderNo'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -33,6 +38,11 @@ export const formSchema: FormSchema[] = [
componentProps:{
},
},
{
label: '排序编号',
field: 'orderNo',
component: 'InputNumber',
},
{
label: '父级节点',
field: 'pid',


+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/controller/EducationServiceArticleController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.educationServiceArticle.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.educationServiceArticle.entity.EducationServiceArticle;
import org.jeecg.modules.educationServiceArticle.service.IEducationServiceArticleService;
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-26
* @Version: V1.0
*/
@Api(tags="服务模块文章")
@RestController
@RequestMapping("/educationServiceArticle/educationServiceArticle")
@Slf4j
public class EducationServiceArticleController extends JeecgController<EducationServiceArticle, IEducationServiceArticleService> {
@Autowired
private IEducationServiceArticleService educationServiceArticleService;
/**
* 分页列表查询
*
* @param educationServiceArticle
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "服务模块文章-分页列表查询")
@ApiOperation(value="服务模块文章-分页列表查询", notes="服务模块文章-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<EducationServiceArticle>> queryPageList(EducationServiceArticle educationServiceArticle,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<EducationServiceArticle> queryWrapper = QueryGenerator.initQueryWrapper(educationServiceArticle, req.getParameterMap());
Page<EducationServiceArticle> page = new Page<EducationServiceArticle>(pageNo, pageSize);
IPage<EducationServiceArticle> pageList = educationServiceArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param educationServiceArticle
* @return
*/
@AutoLog(value = "服务模块文章-添加")
@ApiOperation(value="服务模块文章-添加", notes="服务模块文章-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody EducationServiceArticle educationServiceArticle) {
educationServiceArticleService.save(educationServiceArticle);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param educationServiceArticle
* @return
*/
@AutoLog(value = "服务模块文章-编辑")
@ApiOperation(value="服务模块文章-编辑", notes="服务模块文章-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody EducationServiceArticle educationServiceArticle) {
educationServiceArticleService.updateById(educationServiceArticle);
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) {
educationServiceArticleService.removeById(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.educationServiceArticleService.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<EducationServiceArticle> queryById(@RequestParam(name="id",required=true) String id) {
EducationServiceArticle educationServiceArticle = educationServiceArticleService.getById(id);
if(educationServiceArticle==null) {
return Result.error("未找到对应数据");
}
return Result.OK(educationServiceArticle);
}
/**
* 导出excel
*
* @param request
* @param educationServiceArticle
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, EducationServiceArticle educationServiceArticle) {
return super.exportXls(request, educationServiceArticle, EducationServiceArticle.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, EducationServiceArticle.class);
}
}

+ 67
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/entity/EducationServiceArticle.java View File

@ -0,0 +1,67 @@
package org.jeecg.modules.educationServiceArticle.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
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 lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 服务模块文章
* @Author: jeecg-boot
* @Date: 2025-08-26
* @Version: V1.0
*/
@Data
@TableName("education_service_article")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="education_service_article对象", description="服务模块文章")
public class EducationServiceArticle 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 details;
/**关联分类id*/
@Excel(name = "关联分类id", width = 15, dictTable = "education_category_service_module", dicText = "title", dicCode = "id")
@Dict(dictTable = "education_category_service_module", dicText = "title", dicCode = "id")
@ApiModelProperty(value = "关联分类id")
private java.lang.String categoryId;
}

+ 17
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/mapper/EducationServiceArticleMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.educationServiceArticle.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 服务模块文章
* @Author: jeecg-boot
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface EducationServiceArticleMapper extends BaseMapper<EducationServiceArticle> {
}

+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/mapper/xml/EducationServiceArticleMapper.xml View File

@ -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.educationServiceArticle.mapper.EducationServiceArticleMapper">
</mapper>

+ 14
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/service/IEducationServiceArticleService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.educationServiceArticle.service;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 服务模块文章
* @Author: jeecg-boot
* @Date: 2025-08-26
* @Version: V1.0
*/
public interface IEducationServiceArticleService extends IService<EducationServiceArticle> {
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/service/impl/EducationServiceArticleServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.educationServiceArticle.service.impl;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import org.jeecg.modules.educationServiceArticle.mapper.EducationServiceArticleMapper;
import org.jeecg.modules.educationServiceArticle.service.IEducationServiceArticleService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 服务模块文章
* @Author: jeecg-boot
* @Date: 2025-08-26
* @Version: V1.0
*/
@Service
public class EducationServiceArticleServiceImpl extends ServiceImpl<EducationServiceArticleMapper, EducationServiceArticle> implements IEducationServiceArticleService {
}

+ 191
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/EducationServiceArticleList.vue View File

@ -0,0 +1,191 @@
<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"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@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-service-article-modal ref="modalForm" @ok="modalFormOk"></education-service-article-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EducationServiceArticleModal from './modules/EducationServiceArticleModal'
export default {
name: 'EducationServiceArticleList',
mixins:[JeecgListMixin, mixinDevice],
components: {
EducationServiceArticleModal
},
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: 'title'
},
{
title:'封面',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'详情',
align:"center",
dataIndex: 'details',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title:'关联分类id',
align:"center",
dataIndex: 'categoryId_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/educationServiceArticle/educationServiceArticle/list",
delete: "/educationServiceArticle/educationServiceArticle/delete",
deleteBatch: "/educationServiceArticle/educationServiceArticle/deleteBatch",
exportXlsUrl: "/educationServiceArticle/educationServiceArticle/exportXls",
importExcelUrl: "educationServiceArticle/educationServiceArticle/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'Text',value:'title',text:'标题',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'封面',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'详情',dictCode:''})
fieldList.push({type:'string',value:'categoryId',text:'关联分类id'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 126
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleForm.vue View File

@ -0,0 +1,126 @@
<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="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="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="details">
<j-editor v-model="model.details" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="关联分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryId">
<j-tree-select
ref="treeSelect"
placeholder="请选择关联分类id"
v-model="model.categoryId"
dict="education_category_service_module,title,id"
pidValue="0"
>
</j-tree-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'EducationServiceArticleForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/educationServiceArticle/educationServiceArticle/add",
edit: "/educationServiceArticle/educationServiceArticle/edit",
queryById: "/educationServiceArticle/educationServiceArticle/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
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';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<education-service-article-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></education-service-article-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import EducationServiceArticleForm from './EducationServiceArticleForm'
export default {
name: 'EducationServiceArticleModal',
components: {
EducationServiceArticleForm
},
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;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue/modules/EducationServiceArticleModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<education-service-article-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></education-service-article-form>
</j-modal>
</template>
<script>
import EducationServiceArticleForm from './EducationServiceArticleForm'
export default {
name: 'EducationServiceArticleModal',
components: {
EducationServiceArticleForm
},
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.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticle.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/educationServiceArticle/educationServiceArticle/list',
save='/educationServiceArticle/educationServiceArticle/add',
edit='/educationServiceArticle/educationServiceArticle/edit',
deleteOne = '/educationServiceArticle/educationServiceArticle/delete',
deleteBatch = '/educationServiceArticle/educationServiceArticle/deleteBatch',
importExcel = '/educationServiceArticle/educationServiceArticle/importExcel',
exportXls = '/educationServiceArticle/educationServiceArticle/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (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 saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 61
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticle.data.ts View File

@ -0,0 +1,61 @@
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,
},
{
title: '详情',
align:"center",
dataIndex: 'details',
slots: { customRender: 'htmlSlot' },
},
{
title: '关联分类id',
align:"center",
dataIndex: 'categoryId_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
},
{
label: '封面',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '详情',
field: 'details',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
{
label: '关联分类id',
field: 'categoryId',
component: 'JTreeSelect',
componentProps:{
dict:"education_category_service_module,title,id",
pidValue:"0",
},
},
];

+ 162
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/EducationServiceArticleList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" 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="checkedKeys.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="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<EducationServiceArticleModal @register="registerModal" @success="handleSuccess"></EducationServiceArticleModal>
</div>
</template>
<script lang="ts" name="educationServiceArticle-educationServiceArticle" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import EducationServiceArticleModal from './components/EducationServiceArticleModal.vue'
import {columns, searchFormSchema} from './educationServiceArticle.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './educationServiceArticle.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '服务模块文章',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"服务模块文章",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationServiceArticle/vue3/components/EducationServiceArticleModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../educationServiceArticle.data';
import {saveOrUpdate} from '../educationServiceArticle.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 7
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/ConfigController.java View File

@ -66,6 +66,13 @@ public class ConfigController {
return configService.queryCategoryThesisTwoList(pid, pageBean);
}
//获取服务模块分类列表
@ApiOperation(value="系统配置-获取服务模块分类列表", notes="系统配置-获取服务模块分类列表")
@RequestMapping(value = "/queryCategoryServiceModuleList", method = {RequestMethod.GET})
public Result<?> queryCategoryServiceModuleList(String pid, PageBean pageBean){
return configService.queryCategoryServiceModuleList(pid, pageBean);
}
//获取服务分类列表
@ApiOperation(value="系统配置-获取服务分类列表", notes="系统配置-获取服务分类列表")
@RequestMapping(value = "/queryCategoryServiceList", method = {RequestMethod.GET})


+ 15
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/IndexController.java View File

@ -8,6 +8,7 @@ import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.api.service.IndexService;
import org.jeecg.modules.educationArticle.entity.EducationArticle;
import org.jeecg.modules.educationBanner.entity.EducationBanner;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import org.jeecg.modules.educationThesis.entity.EducationThesis;
import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo;
import org.springframework.web.bind.annotation.RequestMapping;
@ -76,4 +77,18 @@ public class IndexController {
return indexService.queryAriticleById(articleId);
}
//获取服务模块文章列表
@ApiOperation(value="首页-获取服务模块文章列表", notes="首页-获取服务模块文章列表")
@RequestMapping(value = "/queryServiceArticleList", method = {RequestMethod.GET})
public Result<?> queryServiceArticleList(EducationServiceArticle educationServiceArticle, PageBean pageBean){
return indexService.queryServiceArticleList(educationServiceArticle, pageBean);
}
//获取服务模块文章详情
@ApiOperation(value="首页-获取服务模块文章详情", notes="首页-获取服务模块文章详情")
@RequestMapping(value = "/queryServiceArticleById", method = {RequestMethod.GET})
public Result<?> queryServiceArticleById(String articleId){
return indexService.queryServiceArticleById(articleId);
}
}

+ 2
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java View File

@ -20,6 +20,8 @@ public interface ConfigService {
public Result<?> queryCategoryThesisList(String pid, PageBean pageBean);
//获取论文分类列表二
public Result<?> queryCategoryThesisTwoList(String pid, PageBean pageBean);
//获取服务模块分类列表
public Result<?> queryCategoryServiceModuleList(String pid, PageBean pageBean);
//获取服务分类列表
public Result<?> queryCategoryServiceList(PageBean pageBean);
//获取专业分类列表


+ 7
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IndexService.java View File

@ -5,6 +5,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.educationArticle.entity.EducationArticle;
import org.jeecg.modules.educationBanner.entity.EducationBanner;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import org.jeecg.modules.educationThesis.entity.EducationThesis;
import org.jeecg.modules.educationThesisTwo.entity.EducationThesisTwo;
import org.springframework.web.bind.annotation.RequestMapping;
@ -33,4 +34,10 @@ public interface IndexService {
//获取案例文章详情
public Result<?> queryAriticleById(String articleId);
//获取案例文章列表
public Result<?> queryServiceArticleList(EducationServiceArticle educationServiceArticle, PageBean pageBean);
//获取案例文章详情
public Result<?> queryServiceArticleById(String articleId);
}

+ 49
- 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java View File

@ -21,6 +21,8 @@ import org.jeecg.modules.educationCategoryPeriod.entity.EducationCategoryPeriod;
import org.jeecg.modules.educationCategoryPeriod.service.IEducationCategoryPeriodService;
import org.jeecg.modules.educationCategoryService.entity.EducationCategoryService;
import org.jeecg.modules.educationCategoryService.service.IEducationCategoryServiceService;
import org.jeecg.modules.educationCategoryServiceModule.entity.EducationCategoryServiceModule;
import org.jeecg.modules.educationCategoryServiceModule.service.IEducationCategoryServiceModuleService;
import org.jeecg.modules.educationCategoryThesis.entity.EducationCategoryThesis;
import org.jeecg.modules.educationCategoryThesis.service.IEducationCategoryThesisService;
import org.jeecg.modules.educationCategoryThesisTwo.entity.EducationCategoryThesisTwo;
@ -72,9 +74,12 @@ public class ConfigServiceImpl implements ConfigService {
//论文分类信息一
@Resource
private IEducationCategoryThesisService educationCategoryThesisService;
//论文分类信息
//论文分类信息
@Resource
private IEducationCategoryThesisTwoService educationCategoryThesisTwoService;
//服务模块分类信息
@Resource
private IEducationCategoryServiceModuleService educationCategoryServiceModuleService;
//服务分类信息
@Resource
private IEducationCategoryServiceService educationCategoryServiceService;
@ -223,8 +228,8 @@ public class ConfigServiceImpl implements ConfigService {
query.eq(EducationCategoryThesis::getPid, pid);
}
//按照创建时间降序排列
query.orderByDesc(EducationCategoryThesis::getCreateTime);
//按照排序编号升序排列
query.orderByAsc(EducationCategoryThesis::getOrderNo);
//获取论文分类列表信息
pageList = query.page(page);
@ -262,8 +267,8 @@ public class ConfigServiceImpl implements ConfigService {
query.eq(EducationCategoryThesisTwo::getPid, pid);
}
//按照创建时间降序排列
query.orderByDesc(EducationCategoryThesisTwo::getCreateTime);
//按照排序编号升序排列
query.orderByAsc(EducationCategoryThesisTwo::getOrderNo);
//获取论文分类列表信息
pageList = query.page(page);
@ -277,6 +282,45 @@ public class ConfigServiceImpl implements ConfigService {
}
}
//获取服务模块分类列表
@Override
public Result<?> queryCategoryServiceModuleList(String pid, PageBean pageBean) {
log.info("开始查询服务模块分类列表");
//返回信息
String massege = "";
//分页信息
Page<EducationCategoryServiceModule> page = null;
//查询信息
LambdaQueryChainWrapper<EducationCategoryServiceModule> query = null;
//返回信息
Page<EducationCategoryServiceModule> pageList = null;
try{
//分页
page = new Page<EducationCategoryServiceModule>(pageBean.getPageNo(), pageBean.getPageSize());
query = educationCategoryServiceModuleService
.lambdaQuery();
//组装查询条件
if(StringUtils.isNotEmpty(pid)){
query.eq(EducationCategoryServiceModule::getPid, pid);
}
//按照排序编号升序排列
query.orderByAsc(EducationCategoryServiceModule::getOrderNo);
//获取服务模块分类列表信息
pageList = query.page(page);
log.info("服务模块分类列表查询结束");
return Result.OK("服务模块分类列表", pageList);
}catch (Exception e){
log.error("服务模块分类列表查询失败");
e.printStackTrace();
return Result.error("服务模块分类列表查询失败");
}
}
//获取服务分类列表
@Override
public Result<?> queryCategoryServiceList(PageBean pageBean) {


+ 74
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java View File

@ -12,6 +12,8 @@ import org.jeecg.modules.educationArticle.entity.EducationArticle;
import org.jeecg.modules.educationArticle.service.IEducationArticleService;
import org.jeecg.modules.educationBanner.entity.EducationBanner;
import org.jeecg.modules.educationBanner.service.IEducationBannerService;
import org.jeecg.modules.educationServiceArticle.entity.EducationServiceArticle;
import org.jeecg.modules.educationServiceArticle.service.IEducationServiceArticleService;
import org.jeecg.modules.educationThesis.entity.*;
import org.jeecg.modules.educationThesis.service.*;
import org.jeecg.modules.educationThesisTwo.entity.EducationDocumentTwo;
@ -46,6 +48,9 @@ public class IndexServiceImpl implements IndexService {
//案例文章信息
@Resource
private IEducationArticleService educationArticleService;
//服务模块文章信息
@Resource
private IEducationServiceArticleService educationServiceArticleService;
//发表全流程辅导
@Resource
private IEducationProcessService educationProcessService;
@ -404,4 +409,73 @@ public class IndexServiceImpl implements IndexService {
return Result.error("案例文章信息查询失败");
}
}
//获取服务模块文章列表
@Override
public Result<?> queryServiceArticleList(EducationServiceArticle educationServiceArticle, PageBean pageBean) {
log.info("开始服务模块文章信息");
//返回信息
String massege = "";
//分页信息
Page<EducationServiceArticle> page = null;
//查询信息
LambdaQueryChainWrapper<EducationServiceArticle> query = null;
//返回信息
Page<EducationServiceArticle> pageList = null;
try{
//分页
page = new Page<EducationServiceArticle>(pageBean.getPageNo(), pageBean.getPageSize());
query = educationServiceArticleService
.lambdaQuery();
//组装查询条件
if(StringUtils.isNotBlank(educationServiceArticle.getTitle())){
//标题
query.like(EducationServiceArticle::getTitle, educationServiceArticle.getTitle());
}
if(StringUtils.isNotBlank(educationServiceArticle.getCategoryId())){
//分类
query.eq(EducationServiceArticle::getCategoryId, educationServiceArticle.getCategoryId());
}
//按照创建时间降序排列
query.orderByDesc(EducationServiceArticle::getCreateTime);
//获取服务模块文章信息
pageList = query.page(page);
log.info("服务模块文章信息查询结束");
return Result.OK("服务模块文章列表", pageList);
}catch (Exception e){
log.info("服务模块文章信息列表查询失败");
e.printStackTrace();
return Result.error("服务模块文章列表查询失败");
}
}
//获取服务模块文章详情
@Override
public Result<?> queryServiceArticleById(String articleId) {
log.info("开始查询服务模块文章信息");
//返回信息
String massege = "";
try{
//1查询案例文章详情
EducationServiceArticle one = educationServiceArticleService.getById(articleId);
if(null == one){
log.info("服务模块文章不存在,请检查服务模块文章编号:{}", articleId);
return Result.OK("服务模块文章不存在,请检查服务模块文章编号:{}", articleId);
}
//2返回案例文章信息
log.info("服务模块文章信息查询结束");
return Result.OK("服务模块文章信息", one);
}catch (Exception e){
log.info("服务模块文章信息查询失败");
e.printStackTrace();
return Result.error("服务模块文章信息查询失败");
}
}
}

Loading…
Cancel
Save