AWC通过条件控制 菜单可见
1.定义条件:
"conditions": {
"objectIsSelectedFolder": {
"expression": {
"$source": {
"$adapt": "ctx.selected"
},
"$query": {
"$source": "modelType.typeHierarchyArray",
"$query": {
"$in": [
"Folder"
]
}
}
}
},
"objectIsSelected1": {
"expression": "ctx.selected"
},"bomExport": {
"expression": "ctx.userSession.props.group_name.dbValue==='dba' || ctx.userSession.props.user_id.dbValue==='200' || ctx.userSession.props.user_id.dbValue==='test1'"
},"test1Condition": {
"expression": " ctx.userSession.props.user_id.dbValue==='test1' || ctx.userSession.props.group_name.dbValue==='dba' "
},"test1andDBACondition": {
"expression": " ctx.userSession.props.user_id.dbValue==='test1' || ctx.userSession.props.group_name.dbValue==='dba' "
},"DCConditon": {
"expression": "ctx.userSession.props.user_id.dbValue==='115635' || ctx.userSession.props.user_id.dbValue==='200' || ctx.userSession.props.user_id.dbValue==='ctx.userSession.props.user_id.dbValue==='115635'"
},"whereUsedConditon": {
"expression": "ctx.userSession.props.role.displayValues[0]==='性能设计工程师' || ctx.userSession.props.role.displayValues[0]==='物料数据管理专员' || ctx.userSession.props.user_id.dbValue==='ctx.userSession.props.user_id.dbValue==='xxb02'"
}
},
2.在handler中设置关联的条件:
"BOMReplaceCommandHanlder": {
"id": "BOMReplaceCommand",
"action": "activateBOMReplaceCommand",
"activeWhen": true,
"visibleWhen": {
"condition": "conditions.test1Condition"
}
},