Просмотр исходного кода

更新客户端菜单配置,恢复菜单权限校验

zhou.xiaoning 3 лет назад
Родитель
Сommit
0ceb998426
2 измененных файлов с 70 добавлено и 76 удалено
  1. 42 48
      config/pcweb_menu/pcweb_menu_qyfg.json
  2. 28 28
      controllers/common/menu.go

+ 42 - 48
config/pcweb_menu/pcweb_menu_qyfg.json

@@ -931,13 +931,6 @@
                                 "code": "ending",
                                 "isshow": true,
                                 "remark": ""
-                            },
-                            {
-                                "label": "详情",
-                                "rulekey": "",
-                                "code": "detail",
-                                "isshow": true,
-                                "remark": ""
                             }
                         ],
                         "children": [
@@ -1051,7 +1044,7 @@
                         "path": "hedgeditem_trade_pricing",
                         "component": "views/hedgeditem/trade/pricing/index.vue",
                         "sort": 3,
-                        "isshow": true,
+                        "isshow": false,
                         "url": "",
                         "remark": "",
                         "auth": [
@@ -1070,14 +1063,14 @@
                                 "remark": ""
                             },
                             {
-                                "label": "关联采购计划项目",
+                                "label": "关联采购计划",
                                 "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_purchase",
                                 "code": "purchase",
                                 "isshow": true,
                                 "remark": ""
                             },
                             {
-                                "label": "关联现货套保项目",
+                                "label": "关联现货套保",
                                 "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_pricing_hedge",
                                 "code": "hedge",
                                 "isshow": true,
@@ -1110,21 +1103,21 @@
                         "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced",
                         "code": "hedgeditem_trade_performance",
                         "path": "hedgeditem_trade_performance",
-                        "component": "views/business/exposure/list/realTime/index.vue",
+                        "component": "views/hedgeditem/trade/priced/index.vue",
                         "sort": 4,
-                        "isshow": true,
+                        "isshow": false,
                         "url": "",
                         "remark": "",
                         "auth": [
                             {
-                                "label": "关联采购计划项目",
+                                "label": "关联采购计划",
                                 "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced_purchase",
                                 "code": "purchase",
                                 "isshow": true,
                                 "remark": ""
                             },
                             {
-                                "label": "关联现货套保项目",
+                                "label": "关联现货套保",
                                 "rulekey": "client_pc_web_qiyefengguan_hedgeditem_trade_priced_hedge",
                                 "code": "hedge",
                                 "isshow": true,
@@ -1178,8 +1171,8 @@
                         "auth": [
                             {
                                 "label": "关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out_link",
-                                "code": "link",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_out_bind",
+                                "code": "bind",
                                 "isshow": true,
                                 "remark": ""
                             }
@@ -1198,8 +1191,8 @@
                         "auth": [
                             {
                                 "label": "关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in_link",
-                                "code": "link",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_in_bind",
+                                "code": "bind",
                                 "isshow": true,
                                 "remark": ""
                             }
@@ -1218,8 +1211,8 @@
                         "auth": [
                             {
                                 "label": "解除关联",
-                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_finish_unlink",
-                                "code": "unlink",
+                                "rulekey": "client_pc_web_qiyefengguan_hedgeditem_futures_finish_unbind",
+                                "code": "unbind",
                                 "isshow": true,
                                 "remark": ""
                             }
@@ -1309,19 +1302,12 @@
                             },
                             {
                                 "label": "套保交易",
-                                "rulekey": "client_pc_web_qiyefengguan_purchase_pending_relate",
-                                "code": "purchase_pending_relate",
+                                "rulekey": "client_pc_web_qiyefengguan_purchase_pending_trade",
+                                "code": "purchase_pending_trade",
                                 "isshow": false,
                                 "remark": ""
                             },
                             {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_purchase_pending_relate",
-                                "code": "purchase_pending_relate",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1492,13 +1478,6 @@
                                 "remark": ""
                             },
                             {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_sell_pending_relate",
-                                "code": "sell_pending_relate",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1655,13 +1634,6 @@
                                 "remark": ""
                             },
                             {
-                                "label": "关联项目",
-                                "rulekey": "client_pc_web_qiyefengguan_plan_running_relate",
-                                "code": "relate",
-                                "isshow": true,
-                                "remark": ""
-                            },
-                            {
                                 "label": "关闭",
                                 "rulekey": "client_pc_web_qiyefengguan_plan_running_close",
                                 "code": "close",
@@ -1742,7 +1714,7 @@
                 ]
             },
             {
-                "title": "现货查询",
+                "title": "套期项目关联",
                 "rulekey": "client_pc_web_qiyefengguan_search_spot",
                 "code": "search_spot",
                 "path": "search_spot",
@@ -1753,7 +1725,7 @@
                 "remark": "",
                 "children": [
                     {
-                        "title": "采购合同",
+                        "title": "未关联采购合同",
                         "rulekey": "client_pc_web_qiyefengguan_search_purchase",
                         "code": "search_purchase",
                         "path": "search_purchase",
@@ -1764,6 +1736,13 @@
                         "remark": "",
                         "auth": [
                             {
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_search_purchase_bind",
+                                "code": "search_purchase_bind",
+                                "isshow": true,
+                                "remark": ""
+                            },
+                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1773,7 +1752,7 @@
                         ]
                     },
                     {
-                        "title": "销售合同",
+                        "title": "未关联销售合同",
                         "rulekey": "client_pc_web_qiyefengguan_search_sell",
                         "code": "search_sell",
                         "path": "search_sell",
@@ -1784,6 +1763,13 @@
                         "remark": "",
                         "auth": [
                             {
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_search_sell_bind",
+                                "code": "search_sell_bind",
+                                "isshow": true,
+                                "remark": ""
+                            },
+                            {
                                 "label": "详情",
                                 "rulekey": "",
                                 "code": "detail",
@@ -1793,7 +1779,7 @@
                         ]
                     },
                     {
-                        "title": "购销计划",
+                        "title": "未关联购销计划",
                         "rulekey": "client_pc_web_qiyefengguan_search_plan",
                         "code": "search_plan",
                         "path": "search_plan",
@@ -1802,7 +1788,15 @@
                         "isshow": true,
                         "url": "",
                         "remark": "",
-                        "auth": []
+                        "auth": [
+                            {
+                                "label": "关联项目",
+                                "rulekey": "client_pc_web_qiyefengguan_search_plan_bind",
+                                "code": "search_plan_bind",
+                                "isshow": true,
+                                "remark": ""
+                            }
+                        ]
                     }
                 ]
             },

+ 28 - 28
controllers/common/menu.go

@@ -287,20 +287,20 @@ func createPCWebMenu(datas []interface{}, loginID int) []PCWebMenu {
 		if data["isshow"].(bool) {
 			// 判断权限
 			rulekey := ""
-			// if data["rulekey"] != nil {
-			// 	rulekey = data["rulekey"].(string)
-			// 	requireAuth := rulekey != ""
-			// 	if requireAuth {
-			// 		// 判断是否有权限
-			// 		funcMenuList, err := models.GetErmcpRoleFuncMenuLists(loginID, rulekey)
-			// 		if err != nil {
-			// 			continue
-			// 		}
-			// 		if len(funcMenuList) == 0 {
-			// 			continue
-			// 		}
-			// 	}
-			// }
+			if data["rulekey"] != nil {
+				rulekey = data["rulekey"].(string)
+				requireAuth := rulekey != ""
+				if requireAuth {
+					// 判断是否有权限
+					funcMenuList, err := models.GetErmcpRoleFuncMenuLists(loginID, rulekey)
+					if err != nil {
+						continue
+					}
+					if len(funcMenuList) == 0 {
+						continue
+					}
+				}
+			}
 
 			// 构建页面(按钮)权限
 			auths := make([]PCWebMenuAuth, 0)
@@ -311,20 +311,20 @@ func createPCWebMenu(datas []interface{}, loginID int) []PCWebMenu {
 					if am["isshow"].(bool) {
 						// 判断权限
 						rulekeySub := ""
-						// if am["rulekey"] != nil {
-						// 	rulekeySub = am["rulekey"].(string)
-						// 	requireAuth := rulekeySub != ""
-						// 	if requireAuth {
-						// 		// 判断是否有权限
-						// 		funcMenuList, err := models.GetErmcpRoleFuncMenuLists(loginID, rulekeySub)
-						// 		if err != nil {
-						// 			continue
-						// 		}
-						// 		if len(funcMenuList) == 0 {
-						// 			continue
-						// 		}
-						// 	}
-						// }
+						if am["rulekey"] != nil {
+							rulekeySub = am["rulekey"].(string)
+							requireAuth := rulekeySub != ""
+							if requireAuth {
+								// 判断是否有权限
+								funcMenuList, err := models.GetErmcpRoleFuncMenuLists(loginID, rulekeySub)
+								if err != nil {
+									continue
+								}
+								if len(funcMenuList) == 0 {
+									continue
+								}
+							}
+						}
 
 						auth := PCWebMenuAuth{
 							Label:   am["label"].(string),