优化菜单、省市区树结构排序,修复部门搜索空指针问题

This commit is contained in:
孟帅 2023-07-03 11:23:40 +08:00
parent 4a06a895b3
commit cc3ab9acec
18 changed files with 438 additions and 426 deletions

View File

@ -8,6 +8,7 @@ package menu
import ( import (
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/adminin" "hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
) )
// EditReq 修改/新增菜单 // EditReq 修改/新增菜单
@ -33,5 +34,7 @@ type ListReq struct {
} }
type ListRes struct { type ListRes struct {
List []map[string]interface{} `json:"list" dc:"数据列表"` //List adminin.MenuList `json:"list" dc:"数据列表"`
*adminin.MenuListModel
form.PageRes
} }

View File

@ -76,7 +76,7 @@ type TreeReq struct {
} }
type TreeRes struct { type TreeRes struct {
List []map[string]interface{} `json:"list" dc:"数据列表"` List []*sysin.ProvincesTree `json:"list" dc:"数据列表"`
} }
// ChildrenListReq 获取省市区下级列表 // ChildrenListReq 获取省市区下级列表

View File

@ -79,7 +79,7 @@ func (c *cDept) List(ctx context.Context, req *dept.ListReq) (res *dept.ListRes,
} }
data, err := service.AdminDept().List(ctx, in) data, err := service.AdminDept().List(ctx, in)
if err != nil { if err != nil || data == nil {
return return
} }

View File

@ -62,6 +62,6 @@ func (c *cMenu) List(ctx context.Context, req *menu.ListReq) (res menu.ListRes,
return return
} }
res.List, err = service.AdminMenu().List(ctx, in) res.MenuListModel, err = service.AdminMenu().List(ctx, in)
return return
} }

View File

@ -81,7 +81,7 @@ func LoggingServeLogHandler(ctx context.Context, in *glog.HandlerInput) {
} }
if in.Stack == "" { if in.Stack == "" {
in.Stack = in.Logger.GetStack(4) // 4是跳过当前方法如果调整本行位置需要重新调整skip in.Stack = in.Logger.GetStack()
} }
var data entity.SysServeLog var data entity.SysServeLog

View File

@ -19,10 +19,10 @@ import (
"hotgo/internal/library/contexts" "hotgo/internal/library/contexts"
"hotgo/internal/library/hgorm" "hotgo/internal/library/hgorm"
"hotgo/internal/model/do" "hotgo/internal/model/do"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin" "hotgo/internal/model/input/adminin"
"hotgo/internal/service" "hotgo/internal/service"
"hotgo/utility/convert" "hotgo/utility/convert"
"hotgo/utility/tree"
) )
type sAdminMenu struct{} type sAdminMenu struct{}
@ -118,7 +118,6 @@ func (s *sAdminMenu) Edit(ctx context.Context, in adminin.MenuEditInp) (err erro
err = gerror.Wrap(err, "修改菜单失败!") err = gerror.Wrap(err, "修改菜单失败!")
return err return err
} }
return casbin.Refresh(ctx) return casbin.Refresh(ctx)
} }
@ -133,13 +132,15 @@ func (s *sAdminMenu) Edit(ctx context.Context, in adminin.MenuEditInp) (err erro
} }
// List 获取菜单列表 // List 获取菜单列表
func (s *sAdminMenu) List(ctx context.Context, in adminin.MenuListInp) (lists []map[string]interface{}, err error) { func (s *sAdminMenu) List(ctx context.Context, in adminin.MenuListInp) (res *adminin.MenuListModel, err error) {
var models []*adminin.MenuTree var models []*entity.AdminMenu
err = dao.AdminMenu.Ctx(ctx).Order("sort asc,id desc").Scan(&models) if err = dao.AdminMenu.Ctx(ctx).Order("sort asc,id desc").Scan(&models); err != nil {
if err != nil {
return return
} }
return tree.GenTree(gconv.SliceMap(models)), nil
res = new(adminin.MenuListModel)
res.List = s.treeList(0, models)
return
} }
// genNaiveMenus 生成NaiveUI菜单格式 // genNaiveMenus 生成NaiveUI菜单格式
@ -169,7 +170,6 @@ func (s *sAdminMenu) genNaiveMenus(menus []adminin.MenuRouteSummary) (sources []
} }
sources = append(sources, source) sources = append(sources, source)
} }
return return
} }
@ -177,9 +177,11 @@ func (s *sAdminMenu) genNaiveMenus(menus []adminin.MenuRouteSummary) (sources []
func (s *sAdminMenu) getChildrenList(menu *adminin.MenuRouteSummary, treeMap map[string][]adminin.MenuRouteSummary) (err error) { func (s *sAdminMenu) getChildrenList(menu *adminin.MenuRouteSummary, treeMap map[string][]adminin.MenuRouteSummary) (err error) {
menu.Children = treeMap[gconv.String(menu.Id)] menu.Children = treeMap[gconv.String(menu.Id)]
for i := 0; i < len(menu.Children); i++ { for i := 0; i < len(menu.Children); i++ {
err = s.getChildrenList(&menu.Children[i], treeMap) if err = s.getChildrenList(&menu.Children[i], treeMap); err != nil {
return
} }
return err }
return
} }
// GetMenuList 获取菜单列表 // GetMenuList 获取菜单列表
@ -193,30 +195,23 @@ func (s *sAdminMenu) GetMenuList(ctx context.Context, memberId int64) (res *role
// 非超管验证允许的菜单列表 // 非超管验证允许的菜单列表
if !service.AdminMember().VerifySuperId(ctx, memberId) { if !service.AdminMember().VerifySuperId(ctx, memberId) {
array, err := dao.AdminRoleMenu.Ctx(ctx). menuIds, err := dao.AdminRoleMenu.Ctx(ctx).Fields("menu_id").Where("role_id", contexts.GetRoleId(ctx)).Array()
Fields("menu_id").
Where("role_id", contexts.GetRoleId(ctx)).
Array()
if err != nil { if err != nil {
return nil, err return nil, err
} }
if len(array) > 0 { if len(menuIds) > 0 {
pidList, err := dao.AdminMenu.Ctx(ctx).Fields("pid").WhereIn("id", array).Group("pid").Array() pidList, err := dao.AdminMenu.Ctx(ctx).Fields("pid").WhereIn("id", menuIds).Group("pid").Array()
if err != nil { if err != nil {
return nil, err return nil, err
} }
if len(pidList) > 0 { if len(pidList) > 0 {
array = append(pidList, array...) menuIds = append(pidList, menuIds...)
} }
} }
mod = mod.Where("id", array) mod = mod.Where("id", menuIds)
} }
if err = mod.Order("sort asc,id desc").Scan(&allMenus); err != nil { if err = mod.Order("sort asc,id desc").Scan(&allMenus); err != nil || len(allMenus) == 0 {
return
}
if len(allMenus) == 0 {
return return
} }
@ -247,14 +242,11 @@ func (s *sAdminMenu) LoginPermissions(ctx context.Context, memberId int64) (list
// 非超管验证允许的菜单列表 // 非超管验证允许的菜单列表
if !service.AdminMember().VerifySuperId(ctx, memberId) { if !service.AdminMember().VerifySuperId(ctx, memberId) {
array, err := dao.AdminRoleMenu.Ctx(ctx). menuIds, err := dao.AdminRoleMenu.Ctx(ctx).Fields("menu_id").Where("role_id", contexts.GetRoleId(ctx)).Array()
Fields("menu_id").
Where("role_id", contexts.GetRoleId(ctx)).
Array()
if err != nil { if err != nil {
return nil, err return nil, err
} }
mod = mod.Where("id", array) mod = mod.Where("id", menuIds)
} }
if err = mod.Scan(&allPermissions); err != nil { if err = mod.Scan(&allPermissions); err != nil {
@ -276,3 +268,23 @@ func (s *sAdminMenu) LoginPermissions(ctx context.Context, memberId int64) (list
lists = convert.UniqueSlice(lists) lists = convert.UniqueSlice(lists)
return return
} }
// treeList 树状列表
func (s *sAdminMenu) treeList(pid int64, nodes []*entity.AdminMenu) (list []*adminin.MenuTree) {
list = make([]*adminin.MenuTree, 0)
for _, v := range nodes {
if v.Pid == pid {
item := new(adminin.MenuTree)
item.AdminMenu = *v
item.Label = v.Title
item.Key = v.Id
child := s.treeList(v.Id, nodes)
if len(child) > 0 {
item.Children = child
}
list = append(list, item)
}
}
return
}

View File

@ -9,14 +9,12 @@ import (
"context" "context"
"github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gconv"
"hotgo/internal/dao" "hotgo/internal/dao"
"hotgo/internal/library/hgorm" "hotgo/internal/library/hgorm"
"hotgo/internal/model/entity" "hotgo/internal/model/entity"
"hotgo/internal/model/input/form" "hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin" "hotgo/internal/model/input/sysin"
"hotgo/internal/service" "hotgo/internal/service"
"hotgo/utility/tree"
) )
type sSysProvinces struct{} type sSysProvinces struct{}
@ -30,19 +28,15 @@ func init() {
} }
// Tree 关系树选项列表 // Tree 关系树选项列表
func (s *sSysProvinces) Tree(ctx context.Context) (list []g.Map, err error) { func (s *sSysProvinces) Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error) {
var models []*entity.SysProvinces var models []*entity.SysProvinces
if err = dao.SysProvinces.Ctx(ctx).Order("pid asc,id asc,sort asc").Scan(&models); err != nil { if err = dao.SysProvinces.Ctx(ctx).Order("pid asc,id asc,sort asc").Scan(&models); err != nil {
err = gerror.Wrap(err, "获取省市区关系树选项列表失败!") err = gerror.Wrap(err, "获取省市区关系树选项列表失败!")
return return
} }
list = gconv.SliceMap(models) list = s.treeList(0, models)
for k, v := range list { return
list[k]["key"] = v["id"]
list[k]["label"] = v["title"]
}
return tree.GenTree(list), nil
} }
// Delete 删除省市区数据 // Delete 删除省市区数据
@ -212,9 +206,7 @@ func (s *sSysProvinces) UniqueId(ctx context.Context, in sysin.ProvincesUniqueId
// Select 省市区选项 // Select 省市区选项
func (s *sSysProvinces) Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error) { func (s *sSysProvinces) Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error) {
res = new(sysin.ProvincesSelectModel) res = new(sysin.ProvincesSelectModel)
mod := dao.SysProvinces.Ctx(ctx). mod := dao.SysProvinces.Ctx(ctx).Fields("id as value, title as label, level").Where("pid", in.Value)
Fields("id as value, title as label, level").
Where("pid", in.Value)
if err = mod.Order("sort asc,id asc").Scan(&res.List); err != nil { if err = mod.Order("sort asc,id asc").Scan(&res.List); err != nil {
err = gerror.Wrap(err, "获取省市区选项失败!") err = gerror.Wrap(err, "获取省市区选项失败!")
@ -226,6 +218,7 @@ func (s *sSysProvinces) Select(ctx context.Context, in sysin.ProvincesSelectInp)
v.IsLeaf = true v.IsLeaf = true
continue continue
} }
if in.DataType == "pc" && v.Level >= 2 { if in.DataType == "pc" && v.Level >= 2 {
v.IsLeaf = true v.IsLeaf = true
continue continue
@ -238,3 +231,24 @@ func (s *sSysProvinces) Select(ctx context.Context, in sysin.ProvincesSelectInp)
} }
return return
} }
// treeList 树状列表
func (s *sSysProvinces) treeList(pid int64, nodes []*entity.SysProvinces) (list []*sysin.ProvincesTree) {
list = make([]*sysin.ProvincesTree, 0)
for _, v := range nodes {
if v.Pid == pid {
item := new(sysin.ProvincesTree)
item.SysProvinces = *v
item.Label = v.Title
item.Value = v.Id
item.Key = v.Id
child := s.treeList(v.Id, nodes)
if len(child) > 0 {
item.Children = child
}
list = append(list, item)
}
}
return
}

View File

@ -57,11 +57,6 @@ func (in *MenuListInp) Filter(ctx context.Context) (err error) {
return return
} }
type MenuListModel struct {
List []*entity.AdminMenu `json:"list" dc:"数据列表"`
form.PageRes
}
// MenuSearchListInp 查询菜单列表 // MenuSearchListInp 查询菜单列表
type MenuSearchListInp struct { type MenuSearchListInp struct {
Name string `json:"name" dc:"菜单名称"` Name string `json:"name" dc:"菜单名称"`
@ -74,12 +69,16 @@ func (in *MenuSearchListInp) Filter(ctx context.Context) (err error) {
type MenuSearchListModel []*model.TreeMenu type MenuSearchListModel []*model.TreeMenu
// MenuTree 菜单结构 // MenuTree
type MenuTree struct { type MenuTree struct {
// 适配n-tree
Id int64 `json:"key" `
Title string `json:"label"`
entity.AdminMenu entity.AdminMenu
Key int64 `json:"key" `
Label string `json:"label" dc:"标签"`
Children []*MenuTree `json:"children"`
}
type MenuListModel struct {
List []*MenuTree `json:"list"`
} }
// MenuRouteMeta 菜单路由 // MenuRouteMeta 菜单路由

View File

@ -169,3 +169,12 @@ type ProvincesCityLabelInp struct {
} }
type ProvincesCityLabelModel string type ProvincesCityLabelModel string
// ProvincesTree 树
type ProvincesTree struct {
entity.SysProvinces
Key int64 `json:"key" dc:"key"`
Label string `json:"label" dc:"标签"`
Value int64 `json:"value" dc:"键值"`
Children []*ProvincesTree `json:"children"`
}

View File

@ -18,6 +18,29 @@ import (
) )
type ( type (
IAdminPost interface {
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
}
IAdminRole interface {
Verify(ctx context.Context, path, method string) bool
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
GetName(ctx context.Context, id int64) (name string, err error)
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
GetPermissions(ctx context.Context, in adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
UpdatePermissions(ctx context.Context, in adminin.UpdatePermissionsInp) (err error)
Edit(ctx context.Context, in adminin.RoleEditInp) (err error)
Delete(ctx context.Context, in adminin.RoleDeleteInp) (err error)
DataScopeSelect() (res form.Selects)
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
}
IAdminCreditsLog interface { IAdminCreditsLog interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model Model(ctx context.Context, option ...*handler.Option) *gdb.Model
SaveBalance(ctx context.Context, in adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error) SaveBalance(ctx context.Context, in adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error)
@ -25,31 +48,6 @@ type (
List(ctx context.Context, in adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error) List(ctx context.Context, in adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error)
Export(ctx context.Context, in adminin.CreditsLogListInp) (err error) Export(ctx context.Context, in adminin.CreditsLogListInp) (err error)
} }
IAdminNotice interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in adminin.NoticeDeleteInp) (err error)
Edit(ctx context.Context, in adminin.NoticeEditInp) (err error)
Status(ctx context.Context, in adminin.NoticeStatusInp) (err error)
MaxSort(ctx context.Context, in adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
View(ctx context.Context, in adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
List(ctx context.Context, in adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
PullMessages(ctx context.Context, in adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
UnreadCount(ctx context.Context, in adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
UpRead(ctx context.Context, in adminin.NoticeUpReadInp) (err error)
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (err error)
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
}
IAdminSite interface {
Register(ctx context.Context, in adminin.RegisterInp) (err error)
AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
}
IAdminCash interface {
View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
}
IAdminDept interface { IAdminDept interface {
Delete(ctx context.Context, in adminin.DeptDeleteInp) (err error) Delete(ctx context.Context, in adminin.DeptDeleteInp) (err error)
Edit(ctx context.Context, in adminin.DeptEditInp) (err error) Edit(ctx context.Context, in adminin.DeptEditInp) (err error)
@ -90,7 +88,7 @@ type (
Delete(ctx context.Context, in adminin.MenuDeleteInp) (err error) Delete(ctx context.Context, in adminin.MenuDeleteInp) (err error)
VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error) VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error)
Edit(ctx context.Context, in adminin.MenuEditInp) (err error) Edit(ctx context.Context, in adminin.MenuEditInp) (err error)
List(ctx context.Context, in adminin.MenuListInp) (lists []map[string]interface{}, err error) List(ctx context.Context, in adminin.MenuListInp) (res *adminin.MenuListModel, err error)
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error) GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error) LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
} }
@ -98,6 +96,20 @@ type (
StartMonitor(ctx context.Context) StartMonitor(ctx context.Context)
GetMeta(ctx context.Context) *model.MonitorData GetMeta(ctx context.Context) *model.MonitorData
} }
IAdminNotice interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in adminin.NoticeDeleteInp) (err error)
Edit(ctx context.Context, in adminin.NoticeEditInp) (err error)
Status(ctx context.Context, in adminin.NoticeStatusInp) (err error)
MaxSort(ctx context.Context, in adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
View(ctx context.Context, in adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
List(ctx context.Context, in adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
PullMessages(ctx context.Context, in adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
UnreadCount(ctx context.Context, in adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
UpRead(ctx context.Context, in adminin.NoticeUpReadInp) (err error)
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (err error)
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
}
IAdminOrder interface { IAdminOrder interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model Model(ctx context.Context, option ...*handler.Option) *gdb.Model
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error) AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
@ -111,66 +123,43 @@ type (
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error) View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
Status(ctx context.Context, in adminin.OrderStatusInp) (err error) Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
} }
IAdminPost interface { IAdminCash interface {
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error) View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
Edit(ctx context.Context, in adminin.PostEditInp) (err error) List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error) Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error) Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
} }
IAdminRole interface { IAdminSite interface {
Verify(ctx context.Context, path, method string) bool Register(ctx context.Context, in adminin.RegisterInp) (err error)
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error) AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
GetName(ctx context.Context, id int64) (name string, err error) MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
GetPermissions(ctx context.Context, in adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
UpdatePermissions(ctx context.Context, in adminin.UpdatePermissionsInp) (err error)
Edit(ctx context.Context, in adminin.RoleEditInp) (err error)
Delete(ctx context.Context, in adminin.RoleDeleteInp) (err error)
DataScopeSelect() (res form.Selects)
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
} }
) )
var ( var (
localAdminMonitor IAdminMonitor
localAdminOrder IAdminOrder
localAdminPost IAdminPost
localAdminCash IAdminCash
localAdminDept IAdminDept localAdminDept IAdminDept
localAdminMember IAdminMember localAdminMember IAdminMember
localAdminMemberPost IAdminMemberPost localAdminMemberPost IAdminMemberPost
localAdminMenu IAdminMenu localAdminMenu IAdminMenu
localAdminMonitor IAdminMonitor
localAdminNotice IAdminNotice
localAdminOrder IAdminOrder
localAdminCash IAdminCash
localAdminSite IAdminSite
localAdminPost IAdminPost
localAdminRole IAdminRole localAdminRole IAdminRole
localAdminCreditsLog IAdminCreditsLog localAdminCreditsLog IAdminCreditsLog
localAdminNotice IAdminNotice
localAdminSite IAdminSite
) )
func AdminSite() IAdminSite { func AdminMonitor() IAdminMonitor {
if localAdminSite == nil { if localAdminMonitor == nil {
panic("implement not found for interface IAdminSite, forgot register?") panic("implement not found for interface IAdminMonitor, forgot register?")
} }
return localAdminSite return localAdminMonitor
} }
func RegisterAdminSite(i IAdminSite) { func RegisterAdminMonitor(i IAdminMonitor) {
localAdminSite = i localAdminMonitor = i
}
func AdminCreditsLog() IAdminCreditsLog {
if localAdminCreditsLog == nil {
panic("implement not found for interface IAdminCreditsLog, forgot register?")
}
return localAdminCreditsLog
}
func RegisterAdminCreditsLog(i IAdminCreditsLog) {
localAdminCreditsLog = i
} }
func AdminNotice() IAdminNotice { func AdminNotice() IAdminNotice {
@ -184,6 +173,39 @@ func RegisterAdminNotice(i IAdminNotice) {
localAdminNotice = i localAdminNotice = i
} }
func AdminOrder() IAdminOrder {
if localAdminOrder == nil {
panic("implement not found for interface IAdminOrder, forgot register?")
}
return localAdminOrder
}
func RegisterAdminOrder(i IAdminOrder) {
localAdminOrder = i
}
func AdminCash() IAdminCash {
if localAdminCash == nil {
panic("implement not found for interface IAdminCash, forgot register?")
}
return localAdminCash
}
func RegisterAdminCash(i IAdminCash) {
localAdminCash = i
}
func AdminDept() IAdminDept {
if localAdminDept == nil {
panic("implement not found for interface IAdminDept, forgot register?")
}
return localAdminDept
}
func RegisterAdminDept(i IAdminDept) {
localAdminDept = i
}
func AdminMember() IAdminMember { func AdminMember() IAdminMember {
if localAdminMember == nil { if localAdminMember == nil {
panic("implement not found for interface IAdminMember, forgot register?") panic("implement not found for interface IAdminMember, forgot register?")
@ -217,26 +239,26 @@ func RegisterAdminMenu(i IAdminMenu) {
localAdminMenu = i localAdminMenu = i
} }
func AdminMonitor() IAdminMonitor { func AdminSite() IAdminSite {
if localAdminMonitor == nil { if localAdminSite == nil {
panic("implement not found for interface IAdminMonitor, forgot register?") panic("implement not found for interface IAdminSite, forgot register?")
} }
return localAdminMonitor return localAdminSite
} }
func RegisterAdminMonitor(i IAdminMonitor) { func RegisterAdminSite(i IAdminSite) {
localAdminMonitor = i localAdminSite = i
} }
func AdminOrder() IAdminOrder { func AdminCreditsLog() IAdminCreditsLog {
if localAdminOrder == nil { if localAdminCreditsLog == nil {
panic("implement not found for interface IAdminOrder, forgot register?") panic("implement not found for interface IAdminCreditsLog, forgot register?")
} }
return localAdminOrder return localAdminCreditsLog
} }
func RegisterAdminOrder(i IAdminOrder) { func RegisterAdminCreditsLog(i IAdminCreditsLog) {
localAdminOrder = i localAdminCreditsLog = i
} }
func AdminPost() IAdminPost { func AdminPost() IAdminPost {
@ -250,28 +272,6 @@ func RegisterAdminPost(i IAdminPost) {
localAdminPost = i localAdminPost = i
} }
func AdminCash() IAdminCash {
if localAdminCash == nil {
panic("implement not found for interface IAdminCash, forgot register?")
}
return localAdminCash
}
func RegisterAdminCash(i IAdminCash) {
localAdminCash = i
}
func AdminDept() IAdminDept {
if localAdminDept == nil {
panic("implement not found for interface IAdminDept, forgot register?")
}
return localAdminDept
}
func RegisterAdminDept(i IAdminDept) {
localAdminDept = i
}
func AdminRole() IAdminRole { func AdminRole() IAdminRole {
if localAdminRole == nil { if localAdminRole == nil {
panic("implement not found for interface IAdminRole, forgot register?") panic("implement not found for interface IAdminRole, forgot register?")

View File

@ -13,26 +13,28 @@ import (
"hotgo/internal/model/input/sysin" "hotgo/internal/model/input/sysin"
"github.com/gogf/gf/v2/database/gdb" "github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
) )
type ( type (
ISysGenCodes interface { ISysDictType interface {
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error) Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error) Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error) Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error) TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error) }
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error) ISysEmsLog interface {
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error) Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error) Edit(ctx context.Context, in sysin.EmsLogEditInp) (err error)
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error) Status(ctx context.Context, in sysin.EmsLogStatusInp) (err error)
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error) View(ctx context.Context, in sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error)
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error) List(ctx context.Context, in sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error)
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error) Send(ctx context.Context, in sysin.SendEmsInp) (err error)
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error)
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
VerifyCode(ctx context.Context, in sysin.VerifyEmsCodeInp) (err error)
} }
ISysProvinces interface { ISysProvinces interface {
Tree(ctx context.Context) (list []g.Map, err error) Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error)
Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error) Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error) Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error)
Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error) Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error)
@ -43,14 +45,6 @@ type (
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error) UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error) Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
} }
ISysServeLog interface {
Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
}
ISysSmsLog interface { ISysSmsLog interface {
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error) Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
Edit(ctx context.Context, in sysin.SmsLogEditInp) (err error) Edit(ctx context.Context, in sysin.SmsLogEditInp) (err error)
@ -63,17 +57,29 @@ type (
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error) AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error) VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error)
} }
ISysDictData interface { ISysAddons interface {
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error) Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error) Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error) Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
} }
ISysDictType interface { ISysAttachment interface {
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error) Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error) Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error) View(ctx context.Context, in sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error) List(ctx context.Context, in sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
}
ISysBlacklist interface {
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error)
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error)
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
VariableLoad(ctx context.Context, err error)
Load(ctx context.Context)
} }
ISysCurdDemo interface { ISysCurdDemo interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model Model(ctx context.Context, option ...*handler.Option) *gdb.Model
@ -86,64 +92,6 @@ type (
Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error) Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error)
Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error) Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error)
} }
ISysEmsLog interface {
Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
Edit(ctx context.Context, in sysin.EmsLogEditInp) (err error)
Status(ctx context.Context, in sysin.EmsLogStatusInp) (err error)
View(ctx context.Context, in sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error)
List(ctx context.Context, in sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error)
Send(ctx context.Context, in sysin.SendEmsInp) (err error)
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error)
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
VerifyCode(ctx context.Context, in sysin.VerifyEmsCodeInp) (err error)
}
ISysAttachment interface {
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
View(ctx context.Context, in sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
List(ctx context.Context, in sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
}
ISysCron interface {
StartCron(ctx context.Context)
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
}
ISysLog interface {
Export(ctx context.Context, in sysin.LogListInp) (err error)
RealWrite(ctx context.Context, log entity.SysLog) (err error)
AutoLog(ctx context.Context) error
AnalysisLog(ctx context.Context) entity.SysLog
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
}
ISysAddons interface {
List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
}
ISysAddonsConfig interface {
GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (err error)
}
ISysCronGroup interface {
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysLoginLog interface { ISysLoginLog interface {
Model(ctx context.Context) *gdb.Model Model(ctx context.Context) *gdb.Model
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error) List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
@ -153,15 +101,27 @@ type (
Push(ctx context.Context, in sysin.LoginLogPushInp) Push(ctx context.Context, in sysin.LoginLogPushInp)
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error) RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
} }
ISysBlacklist interface { ISysAddonsConfig interface {
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error) GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error) ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error) UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (err error)
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error) }
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error) ISysServeLog interface {
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error) Model(ctx context.Context) *gdb.Model
VariableLoad(ctx context.Context, err error) List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
Load(ctx context.Context) Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
}
ISysLog interface {
Export(ctx context.Context, in sysin.LogListInp) (err error)
RealWrite(ctx context.Context, log entity.SysLog) (err error)
AutoLog(ctx context.Context) error
AnalysisLog(ctx context.Context) entity.SysLog
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
} }
ISysConfig interface { ISysConfig interface {
InitConfig(ctx context.Context) InitConfig(ctx context.Context)
@ -183,105 +143,67 @@ type (
ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error) ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error)
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (err error) UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (err error)
} }
ISysCron interface {
StartCron(ctx context.Context)
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
}
ISysCronGroup interface {
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysDictData interface {
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysGenCodes interface {
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error)
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error)
}
) )
var ( var (
localSysDictType ISysDictType
localSysGenCodes ISysGenCodes
localSysProvinces ISysProvinces
localSysServeLog ISysServeLog
localSysSmsLog ISysSmsLog
localSysDictData ISysDictData
localSysEmsLog ISysEmsLog
localSysCurdDemo ISysCurdDemo
localSysAddonsConfig ISysAddonsConfig localSysAddonsConfig ISysAddonsConfig
localSysAttachment ISysAttachment localSysServeLog ISysServeLog
localSysCron ISysCron
localSysLog ISysLog localSysLog ISysLog
localSysAddons ISysAddons
localSysConfig ISysConfig localSysConfig ISysConfig
localSysCron ISysCron
localSysCronGroup ISysCronGroup localSysCronGroup ISysCronGroup
localSysLoginLog ISysLoginLog localSysDictData ISysDictData
localSysGenCodes ISysGenCodes
localSysDictType ISysDictType
localSysEmsLog ISysEmsLog
localSysProvinces ISysProvinces
localSysSmsLog ISysSmsLog
localSysAddons ISysAddons
localSysAttachment ISysAttachment
localSysBlacklist ISysBlacklist localSysBlacklist ISysBlacklist
localSysCurdDemo ISysCurdDemo
localSysLoginLog ISysLoginLog
) )
func SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysCurdDemo
}
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
}
func SysAddons() ISysAddons {
if localSysAddons == nil {
panic("implement not found for interface ISysAddons, forgot register?")
}
return localSysAddons
}
func RegisterSysAddons(i ISysAddons) {
localSysAddons = i
}
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
}
return localSysAddonsConfig
}
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysAttachment() ISysAttachment {
if localSysAttachment == nil {
panic("implement not found for interface ISysAttachment, forgot register?")
}
return localSysAttachment
}
func RegisterSysAttachment(i ISysAttachment) {
localSysAttachment = i
}
func SysCron() ISysCron {
if localSysCron == nil {
panic("implement not found for interface ISysCron, forgot register?")
}
return localSysCron
}
func RegisterSysCron(i ISysCron) {
localSysCron = i
}
func SysLog() ISysLog {
if localSysLog == nil {
panic("implement not found for interface ISysLog, forgot register?")
}
return localSysLog
}
func RegisterSysLog(i ISysLog) {
localSysLog = i
}
func SysBlacklist() ISysBlacklist { func SysBlacklist() ISysBlacklist {
if localSysBlacklist == nil { if localSysBlacklist == nil {
panic("implement not found for interface ISysBlacklist, forgot register?") panic("implement not found for interface ISysBlacklist, forgot register?")
@ -293,26 +215,15 @@ func RegisterSysBlacklist(i ISysBlacklist) {
localSysBlacklist = i localSysBlacklist = i
} }
func SysConfig() ISysConfig { func SysCurdDemo() ISysCurdDemo {
if localSysConfig == nil { if localSysCurdDemo == nil {
panic("implement not found for interface ISysConfig, forgot register?") panic("implement not found for interface ISysCurdDemo, forgot register?")
} }
return localSysConfig return localSysCurdDemo
} }
func RegisterSysConfig(i ISysConfig) { func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysConfig = i localSysCurdDemo = i
}
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
} }
func SysLoginLog() ISysLoginLog { func SysLoginLog() ISysLoginLog {
@ -326,6 +237,17 @@ func RegisterSysLoginLog(i ISysLoginLog) {
localSysLoginLog = i localSysLoginLog = i
} }
func SysProvinces() ISysProvinces {
if localSysProvinces == nil {
panic("implement not found for interface ISysProvinces, forgot register?")
}
return localSysProvinces
}
func RegisterSysProvinces(i ISysProvinces) {
localSysProvinces = i
}
func SysSmsLog() ISysSmsLog { func SysSmsLog() ISysSmsLog {
if localSysSmsLog == nil { if localSysSmsLog == nil {
panic("implement not found for interface ISysSmsLog, forgot register?") panic("implement not found for interface ISysSmsLog, forgot register?")
@ -337,6 +259,61 @@ func RegisterSysSmsLog(i ISysSmsLog) {
localSysSmsLog = i localSysSmsLog = i
} }
func SysAddons() ISysAddons {
if localSysAddons == nil {
panic("implement not found for interface ISysAddons, forgot register?")
}
return localSysAddons
}
func RegisterSysAddons(i ISysAddons) {
localSysAddons = i
}
func SysAttachment() ISysAttachment {
if localSysAttachment == nil {
panic("implement not found for interface ISysAttachment, forgot register?")
}
return localSysAttachment
}
func RegisterSysAttachment(i ISysAttachment) {
localSysAttachment = i
}
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
}
return localSysAddonsConfig
}
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysServeLog() ISysServeLog {
if localSysServeLog == nil {
panic("implement not found for interface ISysServeLog, forgot register?")
}
return localSysServeLog
}
func RegisterSysServeLog(i ISysServeLog) {
localSysServeLog = i
}
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
}
func SysDictData() ISysDictData { func SysDictData() ISysDictData {
if localSysDictData == nil { if localSysDictData == nil {
panic("implement not found for interface ISysDictData, forgot register?") panic("implement not found for interface ISysDictData, forgot register?")
@ -348,17 +325,6 @@ func RegisterSysDictData(i ISysDictData) {
localSysDictData = i localSysDictData = i
} }
func SysDictType() ISysDictType {
if localSysDictType == nil {
panic("implement not found for interface ISysDictType, forgot register?")
}
return localSysDictType
}
func RegisterSysDictType(i ISysDictType) {
localSysDictType = i
}
func SysGenCodes() ISysGenCodes { func SysGenCodes() ISysGenCodes {
if localSysGenCodes == nil { if localSysGenCodes == nil {
panic("implement not found for interface ISysGenCodes, forgot register?") panic("implement not found for interface ISysGenCodes, forgot register?")
@ -370,24 +336,57 @@ func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i localSysGenCodes = i
} }
func SysProvinces() ISysProvinces { func SysLog() ISysLog {
if localSysProvinces == nil { if localSysLog == nil {
panic("implement not found for interface ISysProvinces, forgot register?") panic("implement not found for interface ISysLog, forgot register?")
} }
return localSysProvinces return localSysLog
} }
func RegisterSysProvinces(i ISysProvinces) { func RegisterSysLog(i ISysLog) {
localSysProvinces = i localSysLog = i
} }
func SysServeLog() ISysServeLog { func SysConfig() ISysConfig {
if localSysServeLog == nil { if localSysConfig == nil {
panic("implement not found for interface ISysServeLog, forgot register?") panic("implement not found for interface ISysConfig, forgot register?")
} }
return localSysServeLog return localSysConfig
} }
func RegisterSysServeLog(i ISysServeLog) { func RegisterSysConfig(i ISysConfig) {
localSysServeLog = i localSysConfig = i
}
func SysCron() ISysCron {
if localSysCron == nil {
panic("implement not found for interface ISysCron, forgot register?")
}
return localSysCron
}
func RegisterSysCron(i ISysCron) {
localSysCron = i
}
func SysDictType() ISysDictType {
if localSysDictType == nil {
panic("implement not found for interface ISysDictType, forgot register?")
}
return localSysDictType
}
func RegisterSysDictType(i ISysDictType) {
localSysDictType = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
} }

View File

@ -10,6 +10,12 @@ import (
) )
type ( type (
IAuthClient interface {
Start(ctx context.Context)
Stop(ctx context.Context)
IsLogin() bool
OnResponseAuthSummary(ctx context.Context, args ...interface{})
}
ICronClient interface { ICronClient interface {
Start(ctx context.Context) Start(ctx context.Context)
Stop(ctx context.Context) Stop(ctx context.Context)
@ -19,17 +25,11 @@ type (
OnCronStatus(ctx context.Context, args ...interface{}) OnCronStatus(ctx context.Context, args ...interface{})
OnCronOnlineExec(ctx context.Context, args ...interface{}) OnCronOnlineExec(ctx context.Context, args ...interface{})
} }
IAuthClient interface {
Start(ctx context.Context)
Stop(ctx context.Context)
IsLogin() bool
OnResponseAuthSummary(ctx context.Context, args ...interface{})
}
) )
var ( var (
localAuthClient IAuthClient
localCronClient ICronClient localCronClient ICronClient
localAuthClient IAuthClient
) )
func AuthClient() IAuthClient { func AuthClient() IAuthClient {

View File

@ -115,7 +115,6 @@
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
size: 'small', size: 'small',
text: true, text: true,
@ -182,7 +181,6 @@
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
size: 'small', size: 'small',
text: true, text: true,

View File

@ -106,7 +106,6 @@
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
size: 'small', size: 'small',
text: true, text: true,

View File

@ -105,9 +105,7 @@ export const columns = [
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
tertiary: true,
size: 'small', size: 'small',
text: true, text: true,
iconPlacement: 'right', iconPlacement: 'right',

View File

@ -192,7 +192,7 @@
id: number; id: number;
children?: RowData[]; children?: RowData[];
}; };
const data = ref([]); const data = ref<any>([]);
const columns: DataTableColumns<RowData> = [ const columns: DataTableColumns<RowData> = [
{ {
title(_column) { title(_column) {
@ -200,9 +200,7 @@
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
tertiary: true,
size: 'small', size: 'small',
text: true, text: true,
iconPlacement: 'right', iconPlacement: 'right',
@ -283,7 +281,7 @@
title: '操作', title: '操作',
key: 'actions', key: 'actions',
width: 220, width: 220,
// fixed: 'right', fixed: 'right',
render(record: any) { render(record: any) {
return h(TableAction as any, { return h(TableAction as any, {
style: 'button', style: 'button',
@ -384,7 +382,7 @@
const loadDataTable = async (res) => { const loadDataTable = async (res) => {
loading.value = true; loading.value = true;
const tmp = await getDeptList({ ...res, ...formRef.value?.formModel }); const tmp = await getDeptList({ ...res, ...formRef.value?.formModel });
data.value = tmp.list; data.value = tmp?.list;
if (data.value === undefined || data.value === null) { if (data.value === undefined || data.value === null) {
data.value = []; data.value = [];
} }

View File

@ -375,7 +375,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, reactive, ref, unref } from 'vue'; import { onMounted, reactive, ref, unref } from 'vue';
import { FormItemRule, TreeSelectOption, useDialog, useMessage } from 'naive-ui'; import { FormItemRule, useDialog, useMessage } from 'naive-ui';
import { import {
AlignLeftOutlined, AlignLeftOutlined,
FormOutlined, FormOutlined,
@ -406,19 +406,6 @@
return s; return s;
}); });
const switchStatusMap = [
{
value: 2,
label: '关闭',
},
{
value: 1,
label: '开启',
},
].map((s) => {
return s;
});
const statusMap = [ const statusMap = [
{ {
value: 0, value: 0,
@ -472,8 +459,6 @@
const createDrawerRef = ref(); const createDrawerRef = ref();
const message = useMessage(); const message = useMessage();
const dialog = useDialog(); const dialog = useDialog();
let treeItemKey = ref([]);
let expandedKeys = ref([]);
const treeData = ref([]); const treeData = ref([]);
const loading = ref(true); const loading = ref(true);
const subLoading = ref(false); const subLoading = ref(false);
@ -482,9 +467,11 @@
const pattern = ref(''); const pattern = ref('');
const drawerTitle = ref(''); const drawerTitle = ref('');
const optionTreeData = ref<any>([]); const optionTreeData = ref<any>([]);
const formParams = reactive<State>(newState(null)); const formParams = reactive<State>(newState(null));
let treeItemKey = ref([]);
let expandedKeys = ref([]);
function openCreateDrawer() { function openCreateDrawer() {
drawerTitle.value = '添加菜单'; drawerTitle.value = '添加菜单';
const { openDrawer } = createDrawerRef.value; const { openDrawer } = createDrawerRef.value;
@ -562,10 +549,7 @@
} }
// //
function handleUpdateValue( function handleUpdateValue(value) {
value: string | number | Array<string | number> | null,
_option: TreeSelectOption | null | Array<TreeSelectOption | null>
) {
formParams.pid = value as number; formParams.pid = value as number;
} }

View File

@ -13,7 +13,6 @@ export const columns = [
h( h(
NButton, NButton,
{ {
ghost: true,
strong: true, strong: true,
size: 'small', size: 'small',
text: true, text: true,