Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f3a378d4
由
sunke
编写于
2022-12-27 14:26:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1053菜单
1 个父辈
19cc4b5e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
98 行增加
和
2 行删除
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
src/main/java/com/neotel/smfcore/custom/micron1053/Micron1053Menu.java
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
查看文件 @
f3a378d
...
...
@@ -54,6 +54,14 @@ public class MenuInit {
}
/**
* 展示菜单
* @param menuPathOrClientLabel 菜单路径或菜单标识
*/
public
void
hideMenu
(
String
...
menuPathOrClientLabel
){
updateMenu
(
new
String
[]{},
menuPathOrClientLabel
);
}
/**
* 给菜单打标识
* @param label
* @param menus
...
...
@@ -227,7 +235,7 @@ public class MenuInit {
menuList
.
add
(
menuToShow
);
}
Set
<
String
>
showIdSet
=
showMenu
(
menuList
);
Set
<
String
>
hideIdSet
=
hideMenu
(
menuListToHide
);
Set
<
String
>
hideIdSet
=
hideMenu
List
(
menuListToHide
);
if
(!
showIdSet
.
isEmpty
()
||
!
hideIdSet
.
isEmpty
()){
List
<
Role
>
roles
=
roleManager
.
findByQuery
(
new
Query
(
Criteria
.
where
(
"name"
).
is
(
"admin"
)));
Role
roleAdmin
=
roles
.
get
(
0
);
...
...
@@ -276,7 +284,7 @@ public class MenuInit {
/**
* 隐藏菜单
*/
private
Set
<
String
>
hideMenu
(
String
[]
menuListToHide
){
private
Set
<
String
>
hideMenu
List
(
String
[]
menuListToHide
){
Set
<
String
>
hideIdSet
=
new
HashSet
<>();
for
(
String
hidePath
:
menuListToHide
)
{
Menu
hideMenu
=
menuManager
.
findByPath
(
hidePath
);
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/Micron1053Menu.java
0 → 100644
查看文件 @
f3a378d
package
com
.
neotel
.
smfcore
.
custom
.
micron1053
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.security.service.po.Menu
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
/**
* @author sunke
* @date 2022/12/14 4:01 PM
*/
@Component
public
class
Micron1053Menu
{
@Autowired
MenuInit
menuInit
;
@Autowired
SmfApi
smfApi
;
@PostConstruct
public
void
init
(){
String
menuLabel
=
"1053"
;
//Report菜单
Menu
report
=
Menu
.
CreatePMenu
(
"Report"
,
12
,
"report1053"
,
"report1053"
,
null
);
MenuInit
.
addMenu
(
menuLabel
,
report
,
121
,
"Material Movement"
,
"movementReport"
,
"system/movementReport/index"
,
"movementReport"
);
MenuInit
.
addMenu
(
menuLabel
,
report
,
122
,
"Inventory"
,
"inventoryReport"
,
"system/inventoryReport/index"
,
"inventoryReport"
);
MenuInit
.
addMenu
(
menuLabel
,
report
,
123
,
"Abnormality"
,
"performanceReport"
,
"system/abnormReport/index"
,
"performanceReport"
);
MenuInit
.
addMenu
(
menuLabel
,
report
,
124
,
"Performance"
,
"performanceReport"
,
"system/performanceReport/index"
,
"performanceReport"
);
MenuInit
.
addMenu
(
menuLabel
,
report
,
125
,
"Order"
,
"orderReport"
,
"system/order/index"
,
"orderReport"
);
//ML5
Menu
mL5
=
Menu
.
CreatePMenu
(
"ML5"
,
13
,
"mlFive"
,
"miFive"
,
null
);
MenuInit
.
addMenu
(
menuLabel
,
mL5
,
131
,
"ML5 DISPATCH SELECTION"
,
"ML5DispatchSelect"
,
"mlFive/dispatchSelect/index"
,
"dispatchSelection"
);
MenuInit
.
addMenu
(
menuLabel
,
mL5
,
132
,
"ML5 LOADING SELECTION"
,
"ML5Loading"
,
"mlFive/LoadingSelect/index"
,
"loadingSelection"
);
MenuInit
.
addMenu
(
menuLabel
,
mL5
,
133
,
"DISPATCH STATUS"
,
"dispatchStatus"
,
"mlFive/dispatchStatus/index"
,
"dispatchStatus"
);
MenuInit
.
addMenu
(
menuLabel
,
mL5
,
134
,
"LOADING STATUS"
,
"loadingStatus"
,
"mlFive/loadingStatus/index"
,
"loadingStatus"
);
MenuInit
.
addMenu
(
menuLabel
,
mL5
,
135
,
"ML5"
,
"miFive"
,
"mlFive/miFive/index"
,
"miFive"
);
//status菜单
Menu
status
=
Menu
.
CreatePMenu
(
"Status"
,
14
,
"status1053"
,
"state"
,
null
);
MenuInit
.
addMenu
(
menuLabel
,
status
,
141
,
"Temperature Log"
,
"temput"
,
"mlFive/miFive/index"
,
"temput"
);
MenuInit
.
addMenu
(
menuLabel
,
status
,
142
,
"ML5"
,
"miFive"
,
"mlFive/miFive/index"
,
"miFive"
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"SBSH1"
,
"SBSH1"
,
"SBSH/sbshOne/index"
,
"sbsh"
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"SBSH2"
,
"SBSH2"
,
"SBSH/sbshOne/index"
,
"sbsh"
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"SBDH1"
,
"SBDH1"
,
"SBSH/sbshOne/index"
,
"sbdh"
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"SBDH2"
,
"SBDH2"
,
"SBSH/sbshOne/index"
,
"sbdh"
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"SBDH3"
,
"SBDH3"
,
"SBSH/sbshOne/index"
,
"sbdh"
);
//CI
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"CI"
,
"cl"
,
"cl/cl/index"
,
"cl"
);
//MT
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"MT"
,
"mt"
,
"mt/mt/index"
,
"mt"
);
//MI1
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"MI1"
,
"ml"
,
"miOne/miOne/index"
,
"miOne"
);
//MI2
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"MI2"
,
"ml2"
,
"miTwo/miTwo/index"
,
"miOne"
);
//Status
// MenuInit.addMenu(menuLabel,null,128, "Status","status", "state/state/index","state");
// //Report
// MenuInit.addMenu(menuLabel,null,128, "Report","reports", "report/reports/index","report");
//设置管理
Menu
poutSet
=
Menu
.
CreatePMenu
(
"设置"
,
10
,
"system"
,
"system"
,
null
);
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"Diagnosis"
,
"diagnosis"
,
"system/diagnosis/index"
,
"diagnosis"
);
//Help
MenuInit
.
addMenu
(
menuLabel
,
null
,
128
,
"Help"
,
"helps"
,
"help/helps/index"
,
"help"
);
String
apiName
=
smfApi
.
getApiName
();
if
(
Strings
.
isNotBlank
(
apiName
)
&&
apiName
.
equals
(
menuLabel
)){
menuInit
.
showMenu
(
apiName
);
}
}
}
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
查看文件 @
f3a378d
...
...
@@ -81,6 +81,15 @@ public class MenuController {
return
new
ResponseEntity
<>(
"OK"
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/hide"
)
@AnonymousAccess
public
ResponseEntity
<
Object
>
hide
(
@RequestParam
String
menuPath
)
{
if
(
Strings
.
isNotBlank
(
menuPath
)){
menuInit
.
hideMenu
(
menuPath
);
}
return
new
ResponseEntity
<>(
"OK"
,
HttpStatus
.
OK
);
}
@GetMapping
(
value
=
"/build"
)
@ApiOperation
(
"获取前端所需菜单"
)
@AnonymousAccess
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论