This commit is contained in:
caozehui
2025-03-24 20:38:24 +08:00
parent ce217b8b86
commit c67a2c8323
13 changed files with 41 additions and 225 deletions

View File

@@ -1,23 +0,0 @@
package com.njcn.gather.system.menu.controller;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.gather.system.menu.pojo.ButtonVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("admin")
public class ButtonController {
@RequestMapping("/auth/buttons")
public HttpResult<ButtonVO> buttons() {
ButtonVO buttonVO = new ButtonVO();
HttpResult<ButtonVO> result = new HttpResult<>();
result.setMessage("成功");
result.setCode("A0000");
result.setData(buttonVO);
return result;
}
}

View File

@@ -1,132 +0,0 @@
package com.njcn.gather.system.menu.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.gather.system.menu.pojo.MenuVO;
import com.njcn.gather.system.menu.pojo.MetaVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("admin")
public class MenuController {
// @RequestMapping("/menu/list")
// public HttpResult<List<MenuVO>> menuList() {
//
// List<MenuVO> menuVOList = new ArrayList<>();
//
// MenuVO menuVO = new MenuVO();
// menuVO.setPath("/home/index");
// menuVO.setName("home");
// menuVO.setComponent("/home/index");
//
// MetaVO metaVO = new MetaVO();
// metaVO.setIcon("HomeFilled");
// metaVO.setTitle("检测计划");
// metaVO.setIsLink("");
// metaVO.setHide(false);
// metaVO.setFull(false);
// metaVO.setAffix(true);
// metaVO.setKeepAlive(true);
//
// menuVO.setMeta(metaVO);
// menuVOList.add(menuVO);
//
// MenuVO menuVO1 = getMenuVORedirect("/machine","machine","/machine/testScript","Operation","台账管理");
// MenuVO menuVO11 = getMenuVO("/machine/testScript","testScript","/machine/testScript/index","Document","检测脚本");
// MenuVO menuVO12 = getMenuVO("/machine/device","device","/machine/device/index","Cpu","被检设备");
// MenuVO menuVO13 = getMenuVO("/machine/errorSystem","errorSystem","/machine/errorSystem/index","Tickets","误差体系");
// MenuVO menuVO14 = getMenuVO("/machine/testSource","testSource","/machine/testSource/index","Help","检测源");
// MenuVO menuVO15 = getMenuVO("/machine/devType","devType","/machine/devType/index","Cpu","设备类型");
// menuVO1.setChildren(CollectionUtil.toList(menuVO11,menuVO12,menuVO13,menuVO14,menuVO15));
// menuVOList.add(menuVO1);
//
//
//
// MenuVO menuVO2 = getMenuVORedirect("/authority","authority","/authority/user","Menu","权限管理");
// MenuVO menuVO21 = getMenuVO("/authority/user","user","/authority/user/index","UserFilled","用户管理");
// MenuVO menuVO22 = getMenuVO("/authority/role","role","/authority/role/index","Avatar","角色管理");
// MenuVO menuVO23 = getMenuVO("/authority/resource","resource","/authority/resource/index","Connection","菜单管理");
// menuVO2.setChildren(CollectionUtil.toList(menuVO21,menuVO22,menuVO23));
// menuVOList.add(menuVO2);
//
//
// MenuVO menuVO3 = getMenuVORedirect("/system","system","/system/base","Tools","系统配置");
// MenuVO menuVO31 = getMenuVO("/system/base","base","/system/base/index","UserFilled","通用配置");
// MenuVO menuVO32 = getMenuVO("/system/dict","dict","/system/dictionary/dictType/index","DataAnalysis","数据字典");
// MenuVO menuVO33 = getMenuVO("/system/dictTree","dictTree","/system/dictionary/dictTree/index","DataAnalysis","树形字典");
// MenuVO menuVO34 = getMenuVO("/system/dictPq","dictPq","/system/dictionary/dictPq/index","DataAnalysis","电能质量字典");
// MenuVO menuVO35 = getMenuVO("/system/template","template","/system/template/index","Memo","报告模板");
// MenuVO menuVO36 = getMenuVO("/system/versionRegister","versionRegister","/system/versionRegister/index","SetUp","版本注册");
// menuVO3.setChildren(CollectionUtil.toList(menuVO31,menuVO32,menuVO33,menuVO34,menuVO35,menuVO36));
// menuVOList.add(menuVO3);
//
// MenuVO menuVO4 = getMenuVO("/log","log","/log/index","TrendCharts","日志管理");
// menuVOList.add(menuVO4);
//
//
// MenuVO menuVO5 = getMenuVO("/analyse","analyse","/analyse/index","Monitor","统计分析");
// menuVOList.add(menuVO5);
//
//
// MenuVO menuVO6 = getMenuVORedirect("/demo","demo","/system/demo","Tools","示例");
// MenuVO menuVO61 = getMenuVO("/system/proTable","table","/demo/proTable/index","UserFilled","普通表格");
// MenuVO menuVO62 = getMenuVO("/system/proTableTree","tableTree","/demo/proTableTree/index","DataAnalysis","表格树");
// menuVO6.setChildren(CollectionUtil.toList(menuVO61,menuVO62));
// menuVOList.add(menuVO6);
//
//
//
// HttpResult<List<MenuVO>> result = new HttpResult<>();
// result.setData(menuVOList);
// result.setCode("A0000");
// result.setMessage("成功");
// return result;
// }
//
// private static MenuVO getMenuVO(String path, String name, String component,String icon,String title) {
// MenuVO menu = new MenuVO();
// menu.setPath(path);
// menu.setName(name);
// menu.setComponent(component);
//
// MetaVO meta = new MetaVO();
// meta.setIcon(icon);
// meta.setTitle(title);
// meta.setIsLink("");
// meta.setHide(false);
// meta.setFull(false);
// meta.setAffix(false);
// meta.setKeepAlive(true);
//
// menu.setMeta(meta);
//
// return menu;
// }
//
// private static MenuVO getMenuVORedirect(String path, String name, String component,String icon,String title) {
// MenuVO menu = new MenuVO();
// menu.setPath(path);
// menu.setName(name);
// menu.setRedirect(component);
//
// MetaVO meta = new MetaVO();
// meta.setIcon(icon);
// meta.setTitle(title);
// meta.setIsLink("");
// meta.setHide(false);
// meta.setFull(false);
// meta.setAffix(false);
// meta.setKeepAlive(true);
//
// menu.setMeta(meta);
//
// return menu;
// }
}

View File

@@ -1,21 +0,0 @@
package com.njcn.gather.system.menu.pojo;
import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;
import java.util.List;
@Data
public class ButtonVO {
private List<String> useProTable = CollectionUtil.toList("add",
"batchAdd",
"export",
"batchDelete",
"status");
private List<String> authButton = CollectionUtil.toList( "add",
"edit",
"delete",
"import",
"export");
}

View File

@@ -1,39 +0,0 @@
package com.njcn.gather.system.menu.pojo;
import lombok.Data;
import java.util.List;
@Data
public class MenuVO {
/**
* 路由菜单访问路径
*/
private String path;
/**
* 路由 name (对应页面组件 name, 可用作 KeepAlive 缓存标识 && 按钮权限筛选)
*/
private String name;
/**
* 视图文件路径
*/
private String component;
/**
* 路由重定向地址
*/
private String redirect;
/**
* 路由菜单元信息
*/
private MetaVO meta;
/**
* 子集路由菜单信息
*/
private List<MenuVO> children;
}

View File

@@ -1,49 +0,0 @@
package com.njcn.gather.system.menu.pojo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class MetaVO {
/**
* 菜单和面包屑对应的图标
*/
private String icon;
/**
* 路由标题 (用作 document.title || 菜单的名称)
*/
private String title;
/**
* 路由外链时填写的访问地址
*/
@JsonProperty("isLink")
private String isLink;
/**
* 是否在菜单中隐藏 (通常列表详情页需要隐藏)
*/
@JsonProperty("isHide")
private boolean isHide;
/**
* 菜单是否全屏 (示例:数据大屏页面)
*/
@JsonProperty("isFull")
private boolean isFull;
/**
* 菜单是否固定在标签页中 (首页通常是固定项)
*/
@JsonProperty("isAffix")
private boolean isAffix;
/**
* 当前路由是否缓存
*/
@JsonProperty("isKeepAlive")
private boolean isKeepAlive;
}