From c6e786e0d877490e97d2c355c9b45ff50f373476 Mon Sep 17 00:00:00 2001 From: pjhmizn49 Date: Fri, 13 Dec 2024 14:41:56 +0800 Subject: [PATCH] ADD file via upload --- .../com/example/flower/unit/MenuList.java | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 flower_back/src/main/java/com/example/flower/unit/MenuList.java diff --git a/flower_back/src/main/java/com/example/flower/unit/MenuList.java b/flower_back/src/main/java/com/example/flower/unit/MenuList.java new file mode 100644 index 0000000..2d7bf9e --- /dev/null +++ b/flower_back/src/main/java/com/example/flower/unit/MenuList.java @@ -0,0 +1,188 @@ +package com.example.flower.unit; + +import com.alibaba.fastjson.JSONObject; + +public class MenuList { //菜单权限功能 + public static JSONObject[] setMenu(JSONObject[] j ,int role){ + if(role==1){ //店长可以获得所有菜单的权限 + //统计信息 + j[0] = new JSONObject(); + j[0].put("path","/statistic"); + j[0].put("name","statistic"); + j[0].put("label","统计信息"); + j[0].put("icon","el-icon-data-line"); + j[0].put("url","statisticView.vue"); + + //人员管理 + JSONObject[] children1 = new JSONObject[2]; + children1[0] = new JSONObject(); + children1[0].put("path","/user"); + children1[0].put("name","user"); + children1[0].put("label","用户管理"); + children1[0].put("icon","el-icon-user-solid"); + children1[0].put("url","userView.vue"); + + children1[1] = new JSONObject(); + children1[1].put("path","/staff"); + children1[1].put("name","staff"); + children1[1].put("label","员工管理"); + children1[1].put("icon","el-icon-s-custom"); + children1[1].put("url","staffView.vue"); + + j[1] = new JSONObject(); + j[1].put("label","人员管理"); + j[1].put("icon","el-icon-user"); + j[1].put("children",children1); + + //商品管理 + JSONObject[] children2 = new JSONObject[3]; + children2[0] = new JSONObject(); + children2[0].put("path","/class"); + children2[0].put("name","class"); + children2[0].put("label","类别管理"); + children2[0].put("icon","el-icon-menu"); + children2[0].put("url","classView.vue"); + + children2[1] = new JSONObject(); + children2[1].put("path","/flower"); + children2[1].put("name","flower"); + children2[1].put("label","花卉管理"); + children2[1].put("icon","el-icon-star-on"); + children2[1].put("url","flowerView.vue"); + + children2[2] = new JSONObject(); + children2[2].put("path","/pack"); + children2[2].put("name","pack"); + children2[2].put("label","花材管理"); + children2[2].put("icon","el-icon-s-shop"); + children2[2].put("url","packView.vue"); + + j[2] = new JSONObject(); + j[2].put("label","商品管理"); + j[2].put("icon","el-icon-box"); + j[2].put("children",children2); + + //订单管理 + j[3] = new JSONObject(); + j[3].put("path","/order"); + j[3].put("name","order"); + j[3].put("label","订单管理"); + j[3].put("icon","el-icon-document"); + j[3].put("url","orderView.vue"); + + //套餐管理 + j[4] = new JSONObject(); + j[4].put("path","/discount"); + j[4].put("name","discount"); + j[4].put("label","套餐管理"); + j[4].put("icon","el-icon-shopping-bag-1"); + j[4].put("url","discountView.vue"); + + //发布公告 + j[5] = new JSONObject(); + j[5].put("path","/notice"); + j[5].put("name","notice"); + j[5].put("label","发布公告"); + j[5].put("icon","el-icon-news"); + j[5].put("url","noticeView.vue"); + + //换赠设置 + j[6] = new JSONObject(); + j[6].put("path","/gift"); + j[6].put("name","gift"); + j[6].put("label","换赠设置"); + j[6].put("icon","el-icon-present"); + j[6].put("url","giftView.vue"); + + //聊天室 + j[7] = new JSONObject(); + j[7].put("path","/chat"); + j[7].put("name","chat"); + j[7].put("label","聊 天 室"); + j[7].put("icon","el-icon-chat-dot-round"); + j[7].put("url","chatView.vue"); + + } + + else if(role==0){ //员工菜单 + //统计信息 + j[0] = new JSONObject(); + j[0].put("path","/statistic"); + j[0].put("name","statistic"); + j[0].put("label","统计信息"); + j[0].put("icon","el-icon-data-line"); + j[0].put("url","statisticView.vue"); + + + //商品管理 + JSONObject[] children3 = new JSONObject[3]; + children3[0] = new JSONObject(); + children3[0].put("path","/class"); + children3[0].put("name","class"); + children3[0].put("label","类别管理"); + children3[0].put("icon","el-icon-menu"); + children3[0].put("url","classView.vue"); + + children3[1] = new JSONObject(); + children3[1].put("path","/flower"); + children3[1].put("name","flower"); + children3[1].put("label","花卉管理"); + children3[1].put("icon","el-icon-star-on"); + children3[1].put("url","flowerView.vue"); + + children3[2] = new JSONObject(); + children3[2].put("path","/pack"); + children3[2].put("name","pack"); + children3[2].put("label","花材管理"); + children3[2].put("icon","el-icon-s-shop"); + children3[2].put("url","packView.vue"); + + j[1] = new JSONObject(); + j[1].put("label","商品管理"); + j[1].put("icon","el-icon-box"); + j[1].put("children",children3); + + //订单管理 + j[2] = new JSONObject(); + j[2].put("path","/order"); + j[2].put("name","order"); + j[2].put("label","订单管理"); + j[2].put("icon","el-icon-document"); + j[2].put("url","orderView.vue"); + + //套餐管理 + j[3] = new JSONObject(); + j[3].put("path","/discount"); + j[3].put("name","discount"); + j[3].put("label","套餐管理"); + j[3].put("icon","el-icon-shopping-bag-1"); + j[3].put("url","discountView.vue"); + + //发布公告 + j[4] = new JSONObject(); + j[4].put("path","/notice"); + j[4].put("name","notice"); + j[4].put("label","发布公告"); + j[4].put("icon","el-icon-news"); + j[4].put("url","noticeView.vue"); + + //换赠设置 + j[5] = new JSONObject(); + j[5].put("path","/gift"); + j[5].put("name","gift"); + j[5].put("label","换赠设置"); + j[5].put("icon","el-icon-present"); + j[5].put("url","giftView.vue"); + + //聊天室 + j[6] = new JSONObject(); + j[6].put("path","/chat"); + j[6].put("name","chat"); + j[6].put("label","聊 天 室"); + j[6].put("icon","el-icon-chat-dot-round"); + j[6].put("url","chatView.vue"); + } + + return j; + } +}