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

@ -63,8 +63,57 @@ public class CmsHomePageController /*extends JeecgController<CmsColumn, ICmsColu
public Result<?> getByArticleTitle(CmsArticle cmsArticle, HttpServletRequest req) {
List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>()
.eq(CmsArticle::getStatus, "1")
.eq(CmsArticle::getTitle, cmsArticle.getTitle())
.eq(CmsArticle::getId, cmsArticle.getId())
.orderByDesc(CmsArticle::getPublishTime));
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:{
},
},
{
label: '简介',
field: 'info',
component: 'InputTextArea',
},
/* {
label: '文章来源',
field: 'artfrom',

Loading…
Cancel
Save