Files

55 lines
5.2 KiB
Go
Raw Permalink Normal View History

package gas
import "git.apinb.com/heqiapp/platforms/backend/api/internal/logic/common"
// Menu 是气站后台静态菜单定义。
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: "delivery", GroupCode: "delivery", Name: "配送点管理", Icon: "icon-storage", Path: "/delivery", SortNo: 20, Status: common.StatusEnable},
{Identity: "delivery_basic", ParentIdentity: "delivery", GroupCode: "delivery", Name: "配送点列表", Path: "/delivery/points", 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_installer", ParentIdentity: "staff", GroupCode: "staff", Name: "安装人员", Path: "/staff/installers", SortNo: 2, Status: common.StatusEnable},
{Identity: "staff_delivery", ParentIdentity: "staff", GroupCode: "staff", Name: "配送人员", Path: "/staff/delivery", SortNo: 3, Status: common.StatusEnable},
{Identity: "staff_operations", ParentIdentity: "staff", GroupCode: "staff", Name: "运维人员", Path: "/staff/operations", SortNo: 4, 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_apply_cash", ParentIdentity: "finance", GroupCode: "finance", Name: "提现申请", Path: "/finance/withdrawals", SortNo: 6, Status: common.StatusEnable},
{Identity: "fin_settlement", ParentIdentity: "finance", GroupCode: "finance", Name: "财务结算", Path: "/finance/settlements", SortNo: 7, Status: common.StatusEnable},
{Identity: "fin_reconciliation", ParentIdentity: "finance", GroupCode: "finance", Name: "财务对账", Path: "/finance/reconciliations", SortNo: 8, Status: common.StatusEnable},
{Identity: "ticket", GroupCode: "ticket", Name: "工单管理", Icon: "icon-customer-service", Path: "/ticket", SortNo: 80, Status: common.StatusEnable},
{Identity: "cs_ticket", ParentIdentity: "ticket", GroupCode: "ticket", Name: "客服工单", Path: "/ticket/tickets", SortNo: 1, Status: common.StatusEnable},
{Identity: "invitation", GroupCode: "invitation", Name: "邀请注册", Icon: "icon-qrcode", Path: "/invitation", SortNo: 90, Status: common.StatusEnable},
{Identity: "invitation_qrcode", ParentIdentity: "invitation", GroupCode: "invitation", Name: "邀请二维码", Path: "/invitation/qrcode", SortNo: 1, Status: common.StatusEnable},
}
// MenusForRole 返回角色允许的菜单。
func MenusForRole(roleCode string) []Menu {
if roleCode != "admin" {
return nil
}
return append([]Menu(nil), adminMenus...)
}