diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/controller/CommunityCommentController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/controller/CommunityCommentController.java new file mode 100644 index 0000000..0299d5f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/controller/CommunityCommentController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.communityComment.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.communityComment.entity.CommunityComment; +import org.jeecg.modules.communityComment.service.ICommunityCommentService; + +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-06 + * @Version: V1.0 + */ +@Api(tags="帖子评论表") +@RestController +@RequestMapping("/communityComment/communityComment") +@Slf4j +public class CommunityCommentController extends JeecgController { + @Autowired + private ICommunityCommentService communityCommentService; + + /** + * 分页列表查询 + * + * @param communityComment + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "帖子评论表-分页列表查询") + @ApiOperation(value="帖子评论表-分页列表查询", notes="帖子评论表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommunityComment communityComment, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(communityComment, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = communityCommentService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param communityComment + * @return + */ + @AutoLog(value = "帖子评论表-添加") + @ApiOperation(value="帖子评论表-添加", notes="帖子评论表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommunityComment communityComment) { + communityCommentService.save(communityComment); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param communityComment + * @return + */ + @AutoLog(value = "帖子评论表-编辑") + @ApiOperation(value="帖子评论表-编辑", notes="帖子评论表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommunityComment communityComment) { + communityCommentService.updateById(communityComment); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "帖子评论表-通过id删除") + @ApiOperation(value="帖子评论表-通过id删除", notes="帖子评论表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + communityCommentService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "帖子评论表-批量删除") + @ApiOperation(value="帖子评论表-批量删除", notes="帖子评论表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.communityCommentService.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 queryById(@RequestParam(name="id",required=true) String id) { + CommunityComment communityComment = communityCommentService.getById(id); + if(communityComment==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(communityComment); + } + + /** + * 导出excel + * + * @param request + * @param communityComment + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommunityComment communityComment) { + return super.exportXls(request, communityComment, CommunityComment.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, CommunityComment.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityComment.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/entity/CommunityComment.java similarity index 78% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityComment.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/entity/CommunityComment.java index 15cdd8a..d1e81ce 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityComment.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/entity/CommunityComment.java @@ -1,6 +1,9 @@ -package org.jeecg.modules.communityPost.entity; +package org.jeecg.modules.communityComment.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; @@ -8,20 +11,23 @@ import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; -import java.util.Date; +import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.io.UnsupportedEncodingException; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; /** * @Description: 帖子评论表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ -@ApiModel(value="community_comment对象", description="帖子评论表") @Data @TableName("community_comment") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="community_comment对象", description="帖子评论表") public class CommunityComment implements Serializable { private static final long serialVersionUID = 1L; @@ -34,14 +40,12 @@ public class CommunityComment implements Serializable { private java.lang.String createBy; /**创建日期*/ @ApiModelProperty(value = "创建日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private java.util.Date createTime; /**更新人*/ @ApiModelProperty(value = "更新人") private java.lang.String updateBy; /**更新日期*/ @ApiModelProperty(value = "更新日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private java.util.Date updateTime; /**文字描述*/ @Excel(name = "文字描述", width = 15) @@ -52,6 +56,8 @@ public class CommunityComment implements Serializable { @ApiModelProperty(value = "图片") private java.lang.String image; /**关联帖子*/ + @Excel(name = "关联帖子", width = 15, dictTable = "community_post", dicText = "content", dicCode = "id") + @Dict(dictTable = "community_post", dicText = "content", dicCode = "id") @ApiModelProperty(value = "关联帖子") private java.lang.String postId; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityCommentMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/CommunityCommentMapper.java similarity index 50% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityCommentMapper.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/CommunityCommentMapper.java index ee7cc4a..e231485 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityCommentMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/CommunityCommentMapper.java @@ -1,19 +1,17 @@ -package org.jeecg.modules.communityPost.mapper; +package org.jeecg.modules.communityComment.mapper; import java.util.List; -import org.jeecg.modules.communityPost.entity.CommunityComment; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.communityComment.entity.CommunityComment; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 帖子评论表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ public interface CommunityCommentMapper extends BaseMapper { - public boolean deleteByMainId(@Param("mainId") String mainId); - - public List selectByMainId(@Param("mainId") String mainId); } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/xml/CommunityCommentMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/xml/CommunityCommentMapper.xml new file mode 100644 index 0000000..ee75005 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/mapper/xml/CommunityCommentMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityCommentService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/ICommunityCommentService.java similarity index 50% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityCommentService.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/ICommunityCommentService.java index b0c68d3..56e65d8 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityCommentService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/ICommunityCommentService.java @@ -1,16 +1,14 @@ -package org.jeecg.modules.communityPost.service; +package org.jeecg.modules.communityComment.service; -import org.jeecg.modules.communityPost.entity.CommunityComment; +import org.jeecg.modules.communityComment.entity.CommunityComment; import com.baomidou.mybatisplus.extension.service.IService; -import java.util.List; /** * @Description: 帖子评论表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ public interface ICommunityCommentService extends IService { - public List selectByMainId(String mainId); } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/impl/CommunityCommentServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/impl/CommunityCommentServiceImpl.java new file mode 100644 index 0000000..015c7d9 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/service/impl/CommunityCommentServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.communityComment.service.impl; + +import org.jeecg.modules.communityComment.entity.CommunityComment; +import org.jeecg.modules.communityComment.mapper.CommunityCommentMapper; +import org.jeecg.modules.communityComment.service.ICommunityCommentService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 帖子评论表 + * @Author: jeecg-boot + * @Date: 2025-08-06 + * @Version: V1.0 + */ +@Service +public class CommunityCommentServiceImpl extends ServiceImpl implements ICommunityCommentService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/CommunityCommentList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/CommunityCommentList.vue new file mode 100644 index 0000000..94755d4 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/CommunityCommentList.vue @@ -0,0 +1,185 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentForm.vue new file mode 100644 index 0000000..da4d169 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentForm.vue @@ -0,0 +1,114 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.Style#Drawer.vue new file mode 100644 index 0000000..bd31d95 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.vue new file mode 100644 index 0000000..a0a2dcc --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue/modules/CommunityCommentModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.api.ts new file mode 100644 index 0000000..3b63f9f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/communityComment/communityComment/list', + save='/communityComment/communityComment/add', + edit='/communityComment/communityComment/edit', + deleteOne = '/communityComment/communityComment/delete', + deleteBatch = '/communityComment/communityComment/deleteBatch', + importExcel = '/communityComment/communityComment/importExcel', + exportXls = '/communityComment/communityComment/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}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.data.ts new file mode 100644 index 0000000..dfed2a3 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityComment.data.ts @@ -0,0 +1,49 @@ +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: 'content' + }, + { + title: '图片', + align:"center", + dataIndex: 'image', + customRender:render.renderAvatar, + }, + { + title: '关联帖子', + align:"center", + dataIndex: 'postId_dictText' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '文字描述', + field: 'content', + component: 'InputTextArea',//TODO 注意string转换问题 + }, + { + label: '图片', + field: 'image', + component: 'JImageUpload', + componentProps:{ + }, + }, + { + label: '关联帖子', + field: 'postId', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"community_post,content,id" + }, + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityCommentList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityCommentList.vue new file mode 100644 index 0000000..7600341 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/CommunityCommentList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/components/CommunityCommentModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/components/CommunityCommentModal.vue new file mode 100644 index 0000000..d1276fb --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityComment/vue3/components/CommunityCommentModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java index c5a44f6..e48ff12 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java @@ -1,42 +1,36 @@ package org.jeecg.modules.communityPost.controller; -import java.io.UnsupportedEncodingException; -import java.io.IOException; -import java.net.URLDecoder; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; - +import 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.communityPost.entity.CommunityPost; +import org.jeecg.modules.communityPost.service.ICommunityPostService; + +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.vo.LoginUser; -import org.apache.shiro.SecurityUtils; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.communityPost.entity.CommunityComment; -import org.jeecg.modules.communityPost.entity.CommunityPost; -import org.jeecg.modules.communityPost.vo.CommunityPostPage; -import org.jeecg.modules.communityPost.service.ICommunityPostService; -import org.jeecg.modules.communityPost.service.ICommunityCommentService; -import org.springframework.beans.BeanUtils; +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.servlet.ModelAndView; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; +import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -45,18 +39,16 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 帖子动态信息表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ @Api(tags="帖子动态信息表") @RestController @RequestMapping("/communityPost/communityPost") @Slf4j -public class CommunityPostController { +public class CommunityPostController extends JeecgController { @Autowired private ICommunityPostService communityPostService; - @Autowired - private ICommunityCommentService communityCommentService; /** * 分页列表查询 @@ -83,36 +75,28 @@ public class CommunityPostController { /** * 添加 * - * @param communityPostPage + * @param communityPost * @return */ @AutoLog(value = "帖子动态信息表-添加") @ApiOperation(value="帖子动态信息表-添加", notes="帖子动态信息表-添加") @PostMapping(value = "/add") - public Result add(@RequestBody CommunityPostPage communityPostPage) { - CommunityPost communityPost = new CommunityPost(); - BeanUtils.copyProperties(communityPostPage, communityPost); - communityPostService.saveMain(communityPost, communityPostPage.getCommunityCommentList()); + public Result add(@RequestBody CommunityPost communityPost) { + communityPostService.save(communityPost); return Result.OK("添加成功!"); } /** * 编辑 * - * @param communityPostPage + * @param communityPost * @return */ @AutoLog(value = "帖子动态信息表-编辑") @ApiOperation(value="帖子动态信息表-编辑", notes="帖子动态信息表-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody CommunityPostPage communityPostPage) { - CommunityPost communityPost = new CommunityPost(); - BeanUtils.copyProperties(communityPostPage, communityPost); - CommunityPost communityPostEntity = communityPostService.getById(communityPost.getId()); - if(communityPostEntity==null) { - return Result.error("未找到对应数据"); - } - communityPostService.updateMain(communityPost, communityPostPage.getCommunityCommentList()); + public Result edit(@RequestBody CommunityPost communityPost) { + communityPostService.updateById(communityPost); return Result.OK("编辑成功!"); } @@ -126,7 +110,7 @@ public class CommunityPostController { @ApiOperation(value="帖子动态信息表-通过id删除", notes="帖子动态信息表-通过id删除") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { - communityPostService.delMain(id); + communityPostService.removeById(id); return Result.OK("删除成功!"); } @@ -140,8 +124,8 @@ public class CommunityPostController { @ApiOperation(value="帖子动态信息表-批量删除", notes="帖子动态信息表-批量删除") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.communityPostService.delBatchMain(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); + this.communityPostService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); } /** @@ -159,21 +143,6 @@ public class CommunityPostController { return Result.error("未找到对应数据"); } return Result.OK(communityPost); - - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "帖子评论表通过主表ID查询") - @ApiOperation(value="帖子评论表主表ID查询", notes="帖子评论表-通主表ID查询") - @GetMapping(value = "/queryCommunityCommentByMainId") - public Result> queryCommunityCommentListByMainId(@RequestParam(name="id",required=true) String id) { - List communityCommentList = communityCommentService.selectByMainId(id); - return Result.OK(communityCommentList); } /** @@ -184,43 +153,11 @@ public class CommunityPostController { */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, CommunityPost communityPost) { - // Step.1 组装查询条件查询数据 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(communityPost, request.getParameterMap()); - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - //Step.2 获取导出数据 - List queryList = communityPostService.list(queryWrapper); - // 过滤选中数据 - String selections = request.getParameter("selections"); - List communityPostList = new ArrayList(); - if(oConvertUtils.isEmpty(selections)) { - communityPostList = queryList; - }else { - List selectionList = Arrays.asList(selections.split(",")); - communityPostList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); - } - - // Step.3 组装pageList - List pageList = new ArrayList(); - for (CommunityPost main : communityPostList) { - CommunityPostPage vo = new CommunityPostPage(); - BeanUtils.copyProperties(main, vo); - List communityCommentList = communityCommentService.selectByMainId(main.getId()); - vo.setCommunityCommentList(communityCommentList); - pageList.add(vo); - } - - // Step.4 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - mv.addObject(NormalExcelConstants.FILE_NAME, "帖子动态信息表列表"); - mv.addObject(NormalExcelConstants.CLASS, CommunityPostPage.class); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("帖子动态信息表数据", "导出人:"+sysUser.getRealname(), "帖子动态信息表")); - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; + return super.exportXls(request, communityPost, CommunityPost.class, "帖子动态信息表"); } /** - * 通过excel导入数据 + * 通过excel导入数据 * * @param request * @param response @@ -228,34 +165,7 @@ public class CommunityPostController { */ @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - MultipartFile file = entity.getValue();// 获取上传文件对象 - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), CommunityPostPage.class, params); - for (CommunityPostPage page : list) { - CommunityPost po = new CommunityPost(); - BeanUtils.copyProperties(page, po); - communityPostService.saveMain(po, page.getCommunityCommentList()); - } - return Result.OK("文件导入成功!数据行数:" + list.size()); - } catch (Exception e) { - log.error(e.getMessage(),e); - return Result.error("文件导入失败:"+e.getMessage()); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return Result.OK("文件导入失败!"); + return super.importExcel(request, response, CommunityPost.class); } } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java index 5856838..850414c 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java @@ -3,6 +3,7 @@ package org.jeecg.modules.communityPost.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Date; +import java.math.BigDecimal; import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; @@ -11,22 +12,27 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.modules.communityComment.entity.CommunityComment; import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; 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-04 + * @Date: 2025-08-06 * @Version: V1.0 */ -@ApiModel(value="community_post对象", description="帖子动态信息表") @Data @TableName("community_post") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="community_post对象", description="帖子动态信息表") public class CommunityPost implements Serializable { private static final long serialVersionUID = 1L; @@ -56,17 +62,17 @@ public class CommunityPost implements Serializable { private java.lang.String image; /**动态类型*/ @Excel(name = "动态类型", width = 15, dicCode = "community_type_post") - @Dict(dicCode = "community_type_post") + @Dict(dicCode = "community_type_post") @ApiModelProperty(value = "动态类型") private java.lang.String type; /**审核状态*/ @Excel(name = "审核状态", width = 15, dicCode = "community_status_post") - @Dict(dicCode = "community_status_post") + @Dict(dicCode = "community_status_post") @ApiModelProperty(value = "审核状态") private java.lang.String status; /**关联用户*/ @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") @ApiModelProperty(value = "关联用户") private java.lang.String userId; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityPostMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityPostMapper.java index 8e65297..d26eb7b 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityPostMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityPostMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 帖子动态信息表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ public interface CommunityPostMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/xml/CommunityCommentMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/xml/CommunityCommentMapper.xml deleted file mode 100644 index 1e490b7..0000000 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/xml/CommunityCommentMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - DELETE - FROM community_comment - WHERE - post_id = #{mainId} - - - diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java index a4b9fcf..47d2817 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java @@ -1,40 +1,14 @@ package org.jeecg.modules.communityPost.service; -import org.jeecg.modules.communityPost.entity.CommunityComment; import org.jeecg.modules.communityPost.entity.CommunityPost; import com.baomidou.mybatisplus.extension.service.IService; -import java.io.Serializable; -import java.util.Collection; -import java.util.List; /** * @Description: 帖子动态信息表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ public interface ICommunityPostService extends IService { - /** - * 添加一对多 - * - */ - public void saveMain(CommunityPost communityPost,List communityCommentList) ; - - /** - * 修改一对多 - * - */ - public void updateMain(CommunityPost communityPost,List communityCommentList); - - /** - * 删除一对多 - */ - public void delMain (String id); - - /** - * 批量删除一对多 - */ - public void delBatchMain (Collection idList); - } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityCommentServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityCommentServiceImpl.java deleted file mode 100644 index a491889..0000000 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityCommentServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.jeecg.modules.communityPost.service.impl; - -import org.jeecg.modules.communityPost.entity.CommunityComment; -import org.jeecg.modules.communityPost.mapper.CommunityCommentMapper; -import org.jeecg.modules.communityPost.service.ICommunityCommentService; -import org.springframework.stereotype.Service; -import java.util.List; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * @Description: 帖子评论表 - * @Author: jeecg-boot - * @Date: 2025-08-04 - * @Version: V1.0 - */ -@Service -public class CommunityCommentServiceImpl extends ServiceImpl implements ICommunityCommentService { - - @Autowired - private CommunityCommentMapper communityCommentMapper; - - @Override - public List selectByMainId(String mainId) { - return communityCommentMapper.selectByMainId(mainId); - } -} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java index a310bc9..a2ad960 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java @@ -1,77 +1,19 @@ package org.jeecg.modules.communityPost.service.impl; import org.jeecg.modules.communityPost.entity.CommunityPost; -import org.jeecg.modules.communityPost.entity.CommunityComment; -import org.jeecg.modules.communityPost.mapper.CommunityCommentMapper; import org.jeecg.modules.communityPost.mapper.CommunityPostMapper; import org.jeecg.modules.communityPost.service.ICommunityPostService; import org.springframework.stereotype.Service; + import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import java.io.Serializable; -import java.util.List; -import java.util.Collection; /** * @Description: 帖子动态信息表 * @Author: jeecg-boot - * @Date: 2025-08-04 + * @Date: 2025-08-06 * @Version: V1.0 */ @Service public class CommunityPostServiceImpl extends ServiceImpl implements ICommunityPostService { - @Autowired - private CommunityPostMapper communityPostMapper; - @Autowired - private CommunityCommentMapper communityCommentMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public void saveMain(CommunityPost communityPost, List communityCommentList) { - communityPostMapper.insert(communityPost); - if(communityCommentList!=null && communityCommentList.size()>0) { - for(CommunityComment entity:communityCommentList) { - //外键设置 - entity.setPostId(communityPost.getId()); - communityCommentMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateMain(CommunityPost communityPost,List communityCommentList) { - communityPostMapper.updateById(communityPost); - - //1.先删除子表数据 - communityCommentMapper.deleteByMainId(communityPost.getId()); - - //2.子表数据重新插入 - if(communityCommentList!=null && communityCommentList.size()>0) { - for(CommunityComment entity:communityCommentList) { - //外键设置 - entity.setPostId(communityPost.getId()); - communityCommentMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delMain(String id) { - communityCommentMapper.deleteByMainId(id); - communityPostMapper.deleteById(id); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delBatchMain(Collection idList) { - for(Serializable id:idList) { - communityCommentMapper.deleteByMainId(id.toString()); - communityPostMapper.deleteById(id); - } - } - } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vo/CommunityPostPage.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vo/CommunityPostPage.java deleted file mode 100644 index 50ca1bb..0000000 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vo/CommunityPostPage.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.jeecg.modules.communityPost.vo; - -import java.util.List; -import org.jeecg.modules.communityPost.entity.CommunityPost; -import org.jeecg.modules.communityPost.entity.CommunityComment; -import lombok.Data; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecgframework.poi.excel.annotation.ExcelEntity; -import org.jeecgframework.poi.excel.annotation.ExcelCollection; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import java.util.Date; -import org.jeecg.common.aspect.annotation.Dict; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * @Description: 帖子动态信息表 - * @Author: jeecg-boot - * @Date: 2025-08-04 - * @Version: V1.0 - */ -@Data -@ApiModel(value="community_postPage对象", description="帖子动态信息表") -public class CommunityPostPage { - - /**主键*/ - @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 content; - /**动态图片*/ - @Excel(name = "动态图片", width = 15) - @ApiModelProperty(value = "动态图片") - private java.lang.String image; - /**动态类型*/ - @Excel(name = "动态类型", width = 15, dicCode = "community_type_post") - @Dict(dicCode = "community_type_post") - @ApiModelProperty(value = "动态类型") - private java.lang.String type; - /**审核状态*/ - @Excel(name = "审核状态", width = 15, dicCode = "community_status_post") - @Dict(dicCode = "community_status_post") - @ApiModelProperty(value = "审核状态") - private java.lang.String status; - /**关联用户*/ - @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @ApiModelProperty(value = "关联用户") - private java.lang.String userId; - - @ExcelCollection(name="帖子评论表") - @ApiModelProperty(value = "帖子评论表") - private List communityCommentList; - -} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue index 797a57f..ba20600 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue @@ -8,7 +8,7 @@ - +
新增 @@ -36,15 +36,15 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue index ceeb21e..895cb58 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue @@ -1,27 +1,26 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.api.ts index e3e3377..1f5b16a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.api.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.api.ts @@ -9,23 +9,16 @@ enum Api { deleteBatch = '/communityPost/communityPost/deleteBatch', importExcel = '/communityPost/communityPost/importExcel', exportXls = '/communityPost/communityPost/exportXls', - communityCommentList = '/communityPost/communityPost/queryCommunityCommentByMainId', } /** * 导出api * @param params */ export const getExportUrl = Api.exportXls; - /** * 导入api */ export const getImportUrl = Api.importExcel; -/** - * 查询子表数据 - * @param params - */ -export const communityCommentList = Api.communityCommentList; /** * 列表接口 * @param params diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.data.ts index 49bfd50..1fb1e1a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPost.data.ts @@ -2,7 +2,6 @@ import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; import { rules} from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; -import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types' //列表数据 export const columns: BasicColumn[] = [ { @@ -74,25 +73,3 @@ export const formSchema: FormSchema[] = [ }, }, ]; -//子表单数据 -//子表表格配置 -export const communityCommentColumns: JVxeColumn[] = [ - { - title: '文字描述', - key: 'content', - type: JVxeTypes.textarea, - width:"200px", - placeholder: '请输入${title}', - defaultValue:'', - }, - { - title: '图片', - key: 'image', - type: JVxeTypes.image, - token:true, - responseName:"message", - width:"200px", - placeholder: '请输入${title}', - defaultValue:'', - }, - ] diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPostList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPostList.vue index 94257e5..8021251 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPostList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue3/CommunityPostList.vue @@ -42,15 +42,15 @@