Files
platforms/backend/api/internal/logic/delivery/menu.go

49 lines
4.4 KiB
Go
Raw Normal View History

package delivery
import "git.apinb.com/heqiapp/platforms/backend/api/internal/logic/common"
type Menu struct {
Identity string `json:"identity"`
ParentIdentity string `json:"parent_identity,omitempty"`
GroupCode string `json:"group_code"`
Name string `json:"name"`
Icon string `json:"icon"`
Path string `json:"path"`
SortNo int `json:"sort_no"`
Status int `json:"status"`
}
var adminMenus = []Menu{
{Identity: "dashboard_overview", GroupCode: "dashboard", Name: "数据概览", Icon: "icon-dashboard", Path: "/dashboard/overview", SortNo: 10, Status: common.StatusEnable},
{Identity: "profile", GroupCode: "profile", Name: "配送点资料", Icon: "icon-storage", Path: "/profile", SortNo: 20, Status: common.StatusEnable},
{Identity: "delivery_profile", ParentIdentity: "profile", GroupCode: "profile", Name: "本点资料", Path: "/profile/basic", SortNo: 1, Status: common.StatusEnable},
{Identity: "staff", GroupCode: "staff", Name: "配送人员管理", Icon: "icon-user-group", Path: "/staff", SortNo: 30, Status: common.StatusEnable},
{Identity: "staff_add", ParentIdentity: "staff", GroupCode: "staff", Name: "新增配送人员", Path: "/staff/add", SortNo: 1, Status: common.StatusEnable},
{Identity: "staff_delivery", ParentIdentity: "staff", GroupCode: "staff", Name: "配送人员列表", Path: "/staff/delivery", SortNo: 2, Status: common.StatusEnable},
{Identity: "user", GroupCode: "user", Name: "用户管理", Icon: "icon-user", Path: "/user", SortNo: 40, Status: common.StatusEnable},
{Identity: "user_account", ParentIdentity: "user", GroupCode: "user", Name: "用户账户", Path: "/user/accounts", SortNo: 1, Status: common.StatusEnable},
{Identity: "contract", GroupCode: "contract", Name: "合同管理", Icon: "icon-file", Path: "/contract", SortNo: 50, Status: common.StatusEnable},
{Identity: "gasorder_contract", ParentIdentity: "contract", GroupCode: "contract", Name: "配送合同", Path: "/contract/contracts", SortNo: 1, Status: common.StatusEnable},
{Identity: "gasorder", GroupCode: "gasorder", Name: "配送订单", Icon: "icon-list", Path: "/gasorder", SortNo: 60, Status: common.StatusEnable},
{Identity: "gasorder_create", ParentIdentity: "gasorder", GroupCode: "gasorder", Name: "创建订单", Path: "/gasorder/create", SortNo: 1, Status: common.StatusEnable},
{Identity: "gasorder_basic", ParentIdentity: "gasorder", GroupCode: "gasorder", Name: "订单列表", Path: "/gasorder/orders", SortNo: 2, Status: common.StatusEnable},
{Identity: "finance", GroupCode: "finance", Name: "财务管理", Icon: "icon-bar-chart", Path: "/finance", SortNo: 70, Status: common.StatusEnable},
{Identity: "wallet_basic", ParentIdentity: "finance", GroupCode: "finance", Name: "钱包", Path: "/finance/wallet", SortNo: 1, Status: common.StatusEnable},
{Identity: "wallet_bank", ParentIdentity: "finance", GroupCode: "finance", Name: "银行卡", Path: "/finance/banks", SortNo: 2, Status: common.StatusEnable},
{Identity: "payment_order", ParentIdentity: "finance", GroupCode: "finance", Name: "支付记录", Path: "/finance/payments", SortNo: 3, Status: common.StatusEnable},
{Identity: "wallet_record", ParentIdentity: "finance", GroupCode: "finance", Name: "钱包流水", Path: "/finance/records", SortNo: 4, Status: common.StatusEnable},
{Identity: "payment_refund", ParentIdentity: "finance", GroupCode: "finance", Name: "退款记录", Path: "/finance/refunds", SortNo: 5, Status: common.StatusEnable},
{Identity: "wallet_recharge", ParentIdentity: "finance", GroupCode: "finance", Name: "钱包充值", Path: "/finance/recharge", SortNo: 6, Status: common.StatusEnable},
{Identity: "wallet_apply_cash", ParentIdentity: "finance", GroupCode: "finance", Name: "提现申请", Path: "/finance/withdrawals", SortNo: 7, Status: common.StatusEnable},
{Identity: "fin_settlement", ParentIdentity: "finance", GroupCode: "finance", Name: "结算结果", Path: "/finance/settlements", SortNo: 8, Status: common.StatusEnable},
{Identity: "invitation", GroupCode: "invitation", Name: "邀请注册", Icon: "icon-qrcode", Path: "/invitation", SortNo: 80, Status: common.StatusEnable},
{Identity: "invitation_qrcode", ParentIdentity: "invitation", GroupCode: "invitation", Name: "邀请二维码", Path: "/invitation/qrcode", SortNo: 1, Status: common.StatusEnable},
}
func MenusForRole(roleCode string) []Menu {
if roleCode != "admin" {
return nil
}
return append([]Menu(nil), adminMenus...)
}