|
|
@@ -813,8 +813,8 @@ func GetRoleFuncMenuLists(loginID int, resourceCode string) ([]Funcmenulist, err
|
|
|
}
|
|
|
|
|
|
// GetErmcpRoleFuncMenuLists 获取终端权限(企业风管专用,区分企业和企业成员)
|
|
|
-func GetErmcpRoleFuncMenuLists(loginID int, resourceCode string) ([]Funcmenulist, error) {
|
|
|
- funcMenuLists := make([]Funcmenulist, 0)
|
|
|
+func GetErmcpRoleFuncMenuLists(loginID int, resourceCode string) ([]NewFuncmenulist, error) {
|
|
|
+ funcMenuLists := make([]NewFuncmenulist, 0)
|
|
|
|
|
|
// 获取对应的Loginaccount信息
|
|
|
var loginAccount Loginaccount
|
|
|
@@ -894,7 +894,7 @@ func GetErmcpRoleFuncMenuLists(loginID int, resourceCode string) ([]Funcmenulist
|
|
|
}
|
|
|
if len(areaRoles) == 0 {
|
|
|
// 无角色,返回空数组s
|
|
|
- return make([]Funcmenulist, 0), nil
|
|
|
+ return make([]NewFuncmenulist, 0), nil
|
|
|
}
|
|
|
// 构建RoleID列表
|
|
|
roleIDs := ""
|
|
|
@@ -985,12 +985,14 @@ type NewFuncmenulist struct {
|
|
|
COMPONENT *string `json:"component" xorm:"COMPONENT"` // 组件名或组件地址
|
|
|
BUTTONTYPE *string `json:"buttontype" xorm:"BUTTONTYPE"` // 按钮类型 - 存按钮样式
|
|
|
HIDDEN *int32 `json:"hidden" xorm:"HIDDEN"` // 是否隐藏 - 0:显示 1:隐藏
|
|
|
+ BUTTONNAME *string `json:"buttonname" xorm:"BUTTONNAME"` // 按钮名称
|
|
|
}
|
|
|
|
|
|
type NewFuncmenulistReq struct {
|
|
|
RESOURCECODE string `form:"resourcecode"` // 资源代码
|
|
|
PARENTCODE string `form:"parentcode"` // 上级资源代码
|
|
|
RESOURCENAME string `form:"resourcename"` // 资源名(Title), 模糊查询
|
|
|
+ MENUTYPE string `form:"menutype"` // 菜单类型(格式:1,2,3) - 1:管理端 2:PC(C#) 3:移动(云平台) 4:终端(交易所) 5:PC(云平台)
|
|
|
}
|
|
|
|
|
|
// TableName is FUNCMENULIST
|
|
|
@@ -1000,7 +1002,7 @@ func (r *NewFuncmenulist) TableName() string {
|
|
|
|
|
|
func (r *NewFuncmenulist) Find(req NewFuncmenulistReq) ([]NewFuncmenulist, error) {
|
|
|
funcMenuLists := make([]NewFuncmenulist, 0)
|
|
|
- session := db.GetEngine().Table("FUNCMENULIST T").Where("T.MENUTYPE = 5")
|
|
|
+ session := db.GetEngine().Table("FUNCMENULIST T")
|
|
|
if len(req.RESOURCECODE) != 0 {
|
|
|
session = session.And("T.RESOURCECODE = ?", req.RESOURCECODE)
|
|
|
}
|
|
|
@@ -1010,6 +1012,9 @@ func (r *NewFuncmenulist) Find(req NewFuncmenulistReq) ([]NewFuncmenulist, error
|
|
|
if len(req.RESOURCENAME) != 0 {
|
|
|
session = session.And("T.RESOURCENAME LIKE ?", "%"+req.RESOURCENAME+"%")
|
|
|
}
|
|
|
+ if len(req.MENUTYPE) != 0 {
|
|
|
+ session = session.And(fmt.Sprintf("T.MENUTYPE in (%s)", req.MENUTYPE))
|
|
|
+ }
|
|
|
if err := session.Find(&funcMenuLists); err != nil {
|
|
|
return nil, err
|
|
|
}
|