cms部分修改

main
王家东 5 months ago
parent 1c1ebfb48d
commit 7fde46bd0b
  1. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/controller/CmsArticleController.java
  2. 51
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/controller/CmsHomePageController.java
  3. BIN
      jeecgboot-vue3-master/src/assets/images/mainHome/2641675928551_3.png
  4. 6
      jeecgboot-vue3-master/src/views/cms/admin/articel/CmsArticle.data.ts

@ -93,7 +93,7 @@ public class CmsArticleController extends JeecgController<CmsArticle, ICmsArticl
cmsArticle.setStatus("1"); cmsArticle.setStatus("1");
// } // }
QueryWrapper<Subweside> subwesideQueryWrapper = new QueryWrapper<>(); QueryWrapper<Subweside> subwesideQueryWrapper = new QueryWrapper<>();
subwesideQueryWrapper.in("id", principal.getId()); subwesideQueryWrapper.in("compadminid", principal.getId());
List<Subweside> subwesideList = subwesideService.list(subwesideQueryWrapper); List<Subweside> subwesideList = subwesideService.list(subwesideQueryWrapper);
if (!subwesideList.isEmpty()) { if (!subwesideList.isEmpty()) {
List<String> subnames = subwesideList.stream() List<String> subnames = subwesideList.stream()
@ -102,7 +102,7 @@ public class CmsArticleController extends JeecgController<CmsArticle, ICmsArticl
String joinedString = String.join(", ", subnames); String joinedString = String.join(", ", subnames);
cmsArticle.setSource("来自子站:"+joinedString); cmsArticle.setSource("来自子站:"+joinedString);
}else { }else {
cmsArticle.setSource("来自子站管理员"); cmsArticle.setSource("");
} }
cmsArticleService.save(cmsArticle); cmsArticleService.save(cmsArticle);
return Result.OK("添加成功!"); return Result.OK("添加成功!");

@ -63,8 +63,57 @@ public class CmsHomePageController /*extends JeecgController<CmsColumn, ICmsColu
public Result<?> getByArticleTitle(CmsArticle cmsArticle, HttpServletRequest req) { public Result<?> getByArticleTitle(CmsArticle cmsArticle, HttpServletRequest req) {
List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>() List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>()
.eq(CmsArticle::getStatus, "1") .eq(CmsArticle::getStatus, "1")
.eq(CmsArticle::getTitle, cmsArticle.getTitle()) .eq(CmsArticle::getId, cmsArticle.getId())
.orderByDesc(CmsArticle::getPublishTime)); .orderByDesc(CmsArticle::getPublishTime));
return Result.OK(list); return Result.OK(list);
} }
@ApiOperation(value = "用于首页的新闻资讯", notes = "新闻资讯")
@GetMapping(value = "/getindexnew")
public Result<?> getindexnew(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap());
queryWrapper.eq("status", "1");
queryWrapper.eq("column_id", "1717099205205401602");
queryWrapper.last("order by publish_time desc");
Page<CmsArticle> page = new Page<CmsArticle>(pageNo, pageSize);
IPage<CmsArticle> pageList = cmsArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value = "用于首页的竞赛导航", notes = "竞赛导航")
@GetMapping(value = "/getindexcomp")
public Result<?> getindexcomp(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap());
queryWrapper.eq("status", "1");
queryWrapper.eq("column_id", "1712301393339650049");
queryWrapper.last("order by publish_time desc");
Page<CmsArticle> page = new Page<CmsArticle>(pageNo, pageSize);
IPage<CmsArticle> pageList = cmsArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
@ApiOperation(value = "用于首页的研究成果", notes = "研究成果")
@GetMapping(value = "/getindexaward")
public Result<?> getindexaward(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap());
queryWrapper.eq("status", "1");
queryWrapper.eq("column_id", "1717099355382456322");
queryWrapper.last("order by publish_time desc");
Page<CmsArticle> page = new Page<CmsArticle>(pageNo, pageSize);
IPage<CmsArticle> pageList = cmsArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 24 KiB

@ -138,6 +138,12 @@ export const formSchema: FormSchema[] = [
componentProps:{ componentProps:{
}, },
}, },
{
label: '简介',
field: 'info',
component: 'InputTextArea',
},
/* { /* {
label: '文章来源', label: '文章来源',
field: 'artfrom', field: 'artfrom',

Loading…
Cancel
Save