JayChou 2 weeks ago
commit b777104f72
  1. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/controller/CmsColumnController.java
  2. 62
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/controller/CmsHomePageController.java
  3. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/entity/CmsColumn.java
  4. 5
      jeecgboot-vue3/src/layouts/default/header/components/user-dropdown/index.vue
  5. 4
      jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue
  6. 4
      jeecgboot-vue3/src/views/system/depart/index.vue

@ -239,6 +239,7 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe
// @RequiresPermissions("cms:cms_column:add") // @RequiresPermissions("cms:cms_column:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody CmsColumn cmsColumn) { public Result<String> add(@RequestBody CmsColumn cmsColumn) {
cmsColumn.setPid("0");
cmsColumnService.save(cmsColumn); cmsColumnService.save(cmsColumn);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -270,12 +271,16 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe
public Result<CmsColumn> delete(@RequestParam(name = "id", required = true) String id) { public Result<CmsColumn> delete(@RequestParam(name = "id", required = true) String id) {
Result<CmsColumn> result = new Result(); Result<CmsColumn> result = new Result();
CmsColumn sysCategory = cmsColumnService.getById(id); CmsColumn sysCategory = cmsColumnService.getById(id);
if (sysCategory.getIsdel().equals("Y")) {
if (sysCategory == null) { if (sysCategory == null) {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
} else { } else {
this.cmsColumnService.delete(id); this.cmsColumnService.delete(id);
result.success("删除成功!"); result.success("删除成功!");
} }
}else {
result.success("基础设置不可删除!");
}
return result; return result;
} }

@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.*;
@Api(tags = "cms首页") @Api(tags = "cms首页")
@RestController @RestController
@ -69,52 +69,34 @@ public class CmsHomePageController /*extends JeecgController<CmsColumn, ICmsColu
} }
@ApiOperation(value = "用于首页的新闻资讯", notes = "新闻资讯") @ApiOperation(value = "用于首页的要问速报", notes = "用于首页的要问速报")
@GetMapping(value = "/getindexnew") @GetMapping(value = "/indexywsb")
public Result<?> getindexnew(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "6") 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 = "8") 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, public Result<?> getindexaward(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "3") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "3") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap()); QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap());
queryWrapper.eq("status", "1"); queryWrapper.eq("status", "1");
queryWrapper.eq("column_id", "1717099355382456322"); List<CmsArticle> allArticles = cmsArticleService.list(queryWrapper);
queryWrapper.last("order by publish_time desc");
Page<CmsArticle> page = new Page<CmsArticle>(pageNo, pageSize); if (allArticles.size() <= 3) {
IPage<CmsArticle> pageList = cmsArticleService.page(page, queryWrapper); return Result.OK(allArticles);
return Result.OK(pageList); } else {
// 随机选择3条记录
Random random = new Random();
List<CmsArticle> randomArticles = new ArrayList<>(3);
Set<Integer> selectedIndices = new HashSet<>(3); // 使用Set来确保索引的唯一性
while (selectedIndices.size() < 3) {
int index = random.nextInt(allArticles.size());
selectedIndices.add(index);
}
for (Integer index : selectedIndices) {
randomArticles.add(allArticles.get(index));
}
return Result.OK(randomArticles);
}
} }
@ApiOperation(value = "查询全部新闻", notes = "查询全部新闻") @ApiOperation(value = "查询全部新闻", notes = "查询全部新闻")
@GetMapping(value = "/cmsfindallnews") @GetMapping(value = "/cmsfindallnews")

@ -86,4 +86,9 @@ public class CmsColumn implements Serializable {
@ApiModelProperty(value = "是否有子节点") @ApiModelProperty(value = "是否有子节点")
@Dict(dicCode = "captain_code") @Dict(dicCode = "captain_code")
private String hasChild; private String hasChild;
/**删除标记*/
@Excel(name = "删除标记", width = 15)
@ApiModelProperty(value = "删除标记")
private java.lang.String isdel;
} }

@ -13,7 +13,7 @@
<Menu @click="handleMenuClick"> <Menu @click="handleMenuClick">
<MenuItem itemKey="doc" :text="t('layout.header.dropdownItemDoc')" icon="ion:document-text-outline" v-if="getShowDoc" /> <MenuItem itemKey="doc" :text="t('layout.header.dropdownItemDoc')" icon="ion:document-text-outline" v-if="getShowDoc" />
<MenuDivider v-if="getShowDoc" /> <MenuDivider v-if="getShowDoc" />
<!-- <MenuItem itemKey="account" :text="t('layout.header.dropdownItemSwitchAccount')" icon="ant-design:setting-outlined" />--> <MenuItem itemKey="account" :text="t('layout.header.dropdownItemSwitchAccount')" icon="ant-design:setting-outlined" />
<MenuItem itemKey="password" :text="t('layout.header.dropdownItemSwitchPassword')" icon="ant-design:edit-outlined" /> <MenuItem itemKey="password" :text="t('layout.header.dropdownItemSwitchPassword')" icon="ant-design:edit-outlined" />
<!-- <MenuItem itemKey="depart" :text="t('layout.header.dropdownItemSwitchDepart')" icon="ant-design:cluster-outlined" />--> <!-- <MenuItem itemKey="depart" :text="t('layout.header.dropdownItemSwitchDepart')" icon="ant-design:cluster-outlined" />-->
<MenuItem itemKey="cache" :text="t('layout.header.dropdownItemRefreshCache')" icon="ion:sync-outline" /> <MenuItem itemKey="cache" :text="t('layout.header.dropdownItemRefreshCache')" icon="ion:sync-outline" />
@ -170,7 +170,8 @@
break; break;
case 'account': case 'account':
//update-begin---author:wangshuai ---date:20221125 for------------ //update-begin---author:wangshuai ---date:20221125 for------------
go(`/system/usersetting`); // go(`/system/usersetting`);
go(`/kejiju/system/usersetting`);
//update-end---author:wangshuai ---date:20221125 for-------------- //update-end---author:wangshuai ---date:20221125 for--------------
break; break;
} }

@ -7,8 +7,8 @@
<a-button type="primary" preIcon="ant-design:import-outlined">导入</a-button> <a-button type="primary" preIcon="ant-design:import-outlined">导入</a-button>
</a-upload> </a-upload>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>
<a-button type="primary" preIcon="ant-design:sync-outlined">同步企微?</a-button> <!-- <a-button type="primary" preIcon="ant-design:sync-outlined">同步企微?</a-button>
<a-button type="primary" preIcon="ant-design:sync-outlined">同步钉钉?</a-button> <a-button type="primary" preIcon="ant-design:sync-outlined">同步钉钉?</a-button>-->
<template v-if="checkedKeys.length > 0"> <template v-if="checkedKeys.length > 0">
<a-dropdown> <a-dropdown>
<template #overlay> <template #overlay>

@ -11,11 +11,11 @@
<DepartFormTab :data="departData" :rootTreeData="rootTreeData" @success="onSuccess" /> <DepartFormTab :data="departData" :rootTreeData="rootTreeData" @success="onSuccess" />
</div> </div>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="部门权限" key="role-info"> <!-- <a-tab-pane tab="部门权限" key="role-info">
<div style="padding: 0 20px 20px"> <div style="padding: 0 20px 20px">
<DepartRuleTab :data="departData" /> <DepartRuleTab :data="departData" />
</div> </div>
</a-tab-pane> </a-tab-pane>-->
</a-tabs> </a-tabs>
<div v-show="departData == null" style="padding-top: 40px"> <div v-show="departData == null" style="padding-top: 40px">
<a-empty description="尚未选择部门" /> <a-empty description="尚未选择部门" />

Loading…
Cancel
Save