This commit is contained in:
likun 2025-07-14 15:25:17 +08:00
commit f5bf3b9c77
65 changed files with 518 additions and 70 deletions

View File

@ -6,11 +6,13 @@ import (
"admin/apps/game/domain/projects" "admin/apps/game/domain/projects"
"admin/apps/game/domain/repo" "admin/apps/game/domain/repo"
"admin/apps/game/model" "admin/apps/game/model"
api2 "admin/apps/user/api"
"admin/internal/consts" "admin/internal/consts"
"admin/internal/errcode" "admin/internal/errcode"
"admin/internal/event" "admin/internal/event"
dto2 "admin/internal/model/dto" dto2 "admin/internal/model/dto"
"admin/lib/xlog" "admin/lib/xlog"
"context"
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"fmt" "fmt"
@ -62,7 +64,12 @@ func (svc *CommonResourceService) initCommonResourcesRepo(db *gorm.DB) {
r(consts.ResourcesName_Role, "角色列表", repo.NewCommonResourceRepo(db, &model.Role{}), ShowMethod_Get) // 角色管理不需要在后台读写数据都是通过项目api拉 r(consts.ResourcesName_Role, "角色列表", repo.NewCommonResourceRepo(db, &model.Role{}), ShowMethod_Get) // 角色管理不需要在后台读写数据都是通过项目api拉
r(consts.ResourcesName_WhiteList, "白名单", repo.NewCommonResourceRepo(db, &model.WhiteList{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete) r(consts.ResourcesName_WhiteList, "白名单", repo.NewCommonResourceRepo(db, &model.WhiteList{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete)
r(consts.ResourcesName_Ban, "封禁管理", repo.NewCommonResourceRepo(db, &model.Ban{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete) r(consts.ResourcesName_Ban, "封禁管理", repo.NewCommonResourceRepo(db, &model.Ban{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete)
r(consts.ResourcesName_MailRole, "个人邮件", repo.NewCommonResourceRepo(db, &model.RoleMail{}), ShowMethod_Get|ShowMethod_Post) // 个人邮件发放就没法撤回? {
roleMailRepo := r(consts.ResourcesName_MailRole, "个人邮件", repo.NewCommonResourceRepo(db, &model.RoleMail{}), ShowMethod_Get|ShowMethod_Post)
roleMailRepo.RowBtns = []*ResourceBtnInfo{
{&api.ResourceBtnInfo{Key: consts.BtnKeyRow_RoleMailReview, Name: "确认审核", BtnColorType: "primary"}, svc.handleReviewRows},
}
} // 个人邮件发放就没法撤回?
{ {
globalMailRepo := r(consts.ResourcesName_MailGlobal, "全服邮件", repo.NewCommonResourceRepo(db, &model.GlobalMail{}), ShowMethod_Get|ShowMethod_Post) globalMailRepo := r(consts.ResourcesName_MailGlobal, "全服邮件", repo.NewCommonResourceRepo(db, &model.GlobalMail{}), ShowMethod_Get|ShowMethod_Post)
@ -134,7 +141,7 @@ func (svc *CommonResourceService) startLoadAllDelayInvokeDbData() {
} }
} }
func (svc *CommonResourceService) List(projectId int, resource string, listParams *dto2.CommonListReq) (int, []*dto2.CommonDtoFieldDesc, []dto2.CommonDtoValues, error) { func (svc *CommonResourceService) List(ctx context.Context, projectId int, resource string, listParams *dto2.CommonListReq) (int, []*dto2.CommonDtoFieldDesc, []dto2.CommonDtoValues, error) {
_, projectEt, find, err := svc.projectRepo.GetById(projectId) _, projectEt, find, err := svc.projectRepo.GetById(projectId)
if err != nil { if err != nil {
return 0, nil, nil, err return 0, nil, nil, err
@ -144,6 +151,24 @@ func (svc *CommonResourceService) List(projectId int, resource string, listParam
} }
rRepo := findCommResourceRepo(resource) rRepo := findCommResourceRepo(resource)
if rRepo.Repo.Need(projectEt, resource) {
// 查看当前操作账号是否有审核员
userId := ctx.Value("user_id").(int)
getRsp, err := api2.GetUserApiInstance().OpPermissionNeedReview(context.Background(), &api2.OpPermissionNeedReviewReq{UserId: userId})
if err != nil {
return 0, nil, nil, err
}
if getRsp.IsNeedReview {
// 只能查看自己新增的数据
listParams.ParsedWhereConditions.Conditions = append([]*dto2.GetWhereCondition{&dto2.GetWhereCondition{
Key: "PostUserId",
Op: "eq",
Value1: strconv.Itoa(userId),
}}, listParams.ParsedWhereConditions.Conditions...)
}
}
totalCount, fieldsDescInfo, etList, err := rRepo.Repo.List(projectEt, listParams) totalCount, fieldsDescInfo, etList, err := rRepo.Repo.List(projectEt, listParams)
if err != nil { if err != nil {
return 0, nil, nil, err return 0, nil, nil, err
@ -183,7 +208,7 @@ func (svc *CommonResourceService) GetById(projectId int, resource string, id int
return fieldsDescInfo, et.ToCommonDto(), et, find, nil return fieldsDescInfo, et.ToCommonDto(), et, find, nil
} }
func (svc *CommonResourceService) Create(projectId int, resource string, dtoObj dto2.CommonDtoValues) (*entity.Project, dto2.CommonDtoValues, error) { func (svc *CommonResourceService) Create(ctx context.Context, projectId int, resource string, dtoObj dto2.CommonDtoValues) (*entity.Project, dto2.CommonDtoValues, error) {
_, projectEt, find, err := svc.projectRepo.GetById(projectId) _, projectEt, find, err := svc.projectRepo.GetById(projectId)
if err != nil { if err != nil {
return projectEt, nil, err return projectEt, nil, err
@ -194,6 +219,30 @@ func (svc *CommonResourceService) Create(projectId int, resource string, dtoObj
createOne := func(obj dto2.CommonDtoValues) (dto2.CommonDtoValues, error) { createOne := func(obj dto2.CommonDtoValues) (dto2.CommonDtoValues, error) {
resourceRepo := findCommResourceRepo(resource) resourceRepo := findCommResourceRepo(resource)
var createNeedReview bool
if resourceRepo.Repo.Need(projectEt, resource) {
// 新增需要审核
// 查看当前操作账号是否有审核员
userId := ctx.Value("user_id").(int)
getRsp, err := api2.GetUserApiInstance().OpPermissionNeedReview(context.Background(), &api2.OpPermissionNeedReviewReq{UserId: userId})
if err != nil {
return obj, err
}
if getRsp.IsNeedReview {
createNeedReview = true
obj["ReviewCheckStatus"] = consts.OpReviewStatus_Pending
obj["PostUserId"] = userId
obj["PostUserName"] = getRsp.UserName
obj["ReviewNeedCharacters"] = getRsp.ReviewCharacters
} else {
obj["ReviewCheckStatus"] = consts.OpReviewStatus_DirectOk
obj["PostUserId"] = userId
obj["PostUserName"] = getRsp.UserName
obj["ReviewNeedCharacters"] = make([]string, 0)
}
}
et, err := resourceRepo.Repo.Create(projectEt, resource, obj) et, err := resourceRepo.Repo.Create(projectEt, resource, obj)
if err != nil { if err != nil {
return nil, err return nil, err
@ -203,6 +252,10 @@ func (svc *CommonResourceService) Create(projectId int, resource string, dtoObj
// 这里转换一次新的数据传输对象因为上一步走了创建会给dto分配id // 这里转换一次新的数据传输对象因为上一步走了创建会给dto分配id
newObj := et.ToCommonDto() newObj := et.ToCommonDto()
if createNeedReview {
return newObj, nil
}
// 执行各个项目特定的钩子方法 // 执行各个项目特定的钩子方法
if resourceRepo.HasDelayInvokeCreateHook { if resourceRepo.HasDelayInvokeCreateHook {
field := reflect.ValueOf(et.Po).Elem().FieldByName("DelayInvokeCreateHook") field := reflect.ValueOf(et.Po).Elem().FieldByName("DelayInvokeCreateHook")
@ -263,7 +316,7 @@ func (svc *CommonResourceService) Create(projectId int, resource string, dtoObj
return projectEt, newDtoObj, err return projectEt, newDtoObj, err
} }
func (svc *CommonResourceService) Edit(projectId int, resource string, dtoObj dto2.CommonDtoValues) (*entity.Project, error) { func (svc *CommonResourceService) Edit(ctx context.Context, projectId int, resource string, dtoObj dto2.CommonDtoValues) (*entity.Project, error) {
_, projectEt, find, err := svc.projectRepo.GetById(projectId) _, projectEt, find, err := svc.projectRepo.GetById(projectId)
if err != nil { if err != nil {
return projectEt, err return projectEt, err
@ -272,11 +325,24 @@ func (svc *CommonResourceService) Edit(projectId int, resource string, dtoObj dt
return projectEt, errcode.New(errcode.ServerError, "not found project %v db data", projectId) return projectEt, errcode.New(errcode.ServerError, "not found project %v db data", projectId)
} }
err = findCommResourceRepo(resource).Repo.Edit(projectEt, dtoObj) resourceRepo := findCommResourceRepo(resource)
oldEt, err := resourceRepo.Repo.Edit(projectEt, dtoObj)
if err != nil { if err != nil {
return projectEt, err return projectEt, err
} }
oldDto := oldEt.ToCommonDto()
if reviewStatus, find := oldDto["ReviewCheckStatus"]; find {
// 资源写操作需要审核
if reviewStatus == consts.OpReviewStatus_Pending {
// 资源还在挂起等待审核,可以直接返回成功,等待下次审核调用钩子
return projectEt, nil
}
// 资源审核过了,表示钩子已经执行过,修改数据好像没意义,先不调用钩子
return projectEt, nil
}
// 执行各个项目特定的钩子方法 // 执行各个项目特定的钩子方法
if hook, ok := projects.GetProjectResourceHook(projectEt, resource).(projects.IPostResourceOpEditHook); ok { if hook, ok := projects.GetProjectResourceHook(projectEt, resource).(projects.IPostResourceOpEditHook); ok {
err = hook.Edit(projectEt, resource, dtoObj) err = hook.Edit(projectEt, resource, dtoObj)
@ -317,7 +383,7 @@ func (svc *CommonResourceService) Delete(projectId int, resource string, id int)
return projectEt, oldEt, nil return projectEt, oldEt, nil
} }
func (svc *CommonResourceService) RowsSelection(projectId int, resourceName string, params *dto2.CommonRowsSelectionReq) (*entity.Project, *dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) RowsSelection(ctx context.Context, projectId int, resourceName string, params *dto2.CommonRowsSelectionReq) (*entity.Project, *dto2.CommonRowsSelectionRsp, error) {
_, projectEt, find, err := svc.projectRepo.GetById(projectId) _, projectEt, find, err := svc.projectRepo.GetById(projectId)
if err != nil { if err != nil {
return projectEt, nil, err return projectEt, nil, err
@ -332,7 +398,7 @@ func (svc *CommonResourceService) RowsSelection(projectId int, resourceName stri
return projectEt, nil, errcode.New(errcode.ServerError, "not found project %v resource %v rows section btn:%v", return projectEt, nil, errcode.New(errcode.ServerError, "not found project %v resource %v rows section btn:%v",
projectId, resourceName, params.BtnKey) projectId, resourceName, params.BtnKey)
} }
rsp, err := btnInfo.RowsSelectionHandler(projectEt, resourceName, params) rsp, err := btnInfo.RowsSelectionHandler(ctx, projectEt, resourceName, params)
return projectEt, rsp, err return projectEt, rsp, err
} }
@ -403,7 +469,7 @@ const (
type ResourceBtnInfo struct { type ResourceBtnInfo struct {
*api.ResourceBtnInfo *api.ResourceBtnInfo
RowsSelectionHandler func(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) RowsSelectionHandler func(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error)
} }
type resourceRepoInfo struct { type resourceRepoInfo struct {

View File

@ -4,18 +4,21 @@ import (
"admin/apps/game/domain/entity" "admin/apps/game/domain/entity"
"admin/apps/game/domain/projects" "admin/apps/game/domain/projects"
"admin/apps/game/model" "admin/apps/game/model"
api2 "admin/apps/user/api"
"admin/internal/consts"
"admin/internal/errcode" "admin/internal/errcode"
dto2 "admin/internal/model/dto" dto2 "admin/internal/model/dto"
"admin/lib/cdn" "admin/lib/cdn"
"admin/lib/dfs" "admin/lib/dfs"
"admin/lib/xlog" "admin/lib/xlog"
"bytes" "bytes"
"context"
"fmt" "fmt"
"strings" "strings"
"time" "time"
) )
func (svc *CommonResourceService) handleServerUpOrDown(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleServerUpOrDown(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
if hook, ok := projects.GetProjectResourceHook(projectEt, resourceName).(projects.IPostResourceOpRowsHook); ok { if hook, ok := projects.GetProjectResourceHook(projectEt, resourceName).(projects.IPostResourceOpRowsHook); ok {
rsp, err := hook.RowsSelection(projectEt, resourceName, params.BtnKey, params.Rows) rsp, err := hook.RowsSelection(projectEt, resourceName, params.BtnKey, params.Rows)
return rsp, err return rsp, err
@ -23,7 +26,7 @@ func (svc *CommonResourceService) handleServerUpOrDown(projectEt *entity.Project
return nil, nil return nil, nil
} }
func (svc *CommonResourceService) handleServerExportCdn(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleServerExportCdn(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
// 导出cdn聚合公告信息一起导 // 导出cdn聚合公告信息一起导
serverList, err := svc.serverRepo.List(projectEt.GetProjectPo().ID) serverList, err := svc.serverRepo.List(projectEt.GetProjectPo().ID)
if err != nil { if err != nil {
@ -71,7 +74,7 @@ func (svc *CommonResourceService) handleServerExportCdn(projectEt *entity.Projec
err = cdn.PurgeTxCdnPath(secretId, secretKey, region, projectEt.Po.CdnPath) err = cdn.PurgeTxCdnPath(secretId, secretKey, region, projectEt.Po.CdnPath)
if err != nil { if err != nil {
return nil, errcode.New(errcode.DBError, "purge cdn path:%v error:%v", projectEt.Po.CdnPath) return nil, errcode.New(errcode.DBError, "purge cdn path:%v error:%v", projectEt.Po.CdnPath, err)
} }
return &dto2.CommonRowsSelectionRsp{ return &dto2.CommonRowsSelectionRsp{
@ -81,7 +84,7 @@ func (svc *CommonResourceService) handleServerExportCdn(projectEt *entity.Projec
}, nil }, nil
} }
func (svc *CommonResourceService) handleServerPrepareShowExportCdn(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleServerPrepareShowExportCdn(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
// 导出cdn聚合公告信息一起导 // 导出cdn聚合公告信息一起导
serverList, err := svc.serverRepo.List(projectEt.GetProjectPo().ID) serverList, err := svc.serverRepo.List(projectEt.GetProjectPo().ID)
if err != nil { if err != nil {
@ -103,7 +106,7 @@ func (svc *CommonResourceService) handleServerPrepareShowExportCdn(projectEt *en
}, nil }, nil
} }
func (svc *CommonResourceService) handleNoticeDisable(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleNoticeDisable(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
var err error var err error
if len(params.Rows) == 0 { if len(params.Rows) == 0 {
// 禁用所有 // 禁用所有
@ -124,7 +127,7 @@ func (svc *CommonResourceService) handleNoticeDisable(projectEt *entity.Project,
}, nil }, nil
} }
func (svc *CommonResourceService) handleNoticeEnable(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleNoticeEnable(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
var err error var err error
if len(params.Rows) == 0 { if len(params.Rows) == 0 {
// 禁用所有 // 禁用所有
@ -145,7 +148,7 @@ func (svc *CommonResourceService) handleNoticeEnable(projectEt *entity.Project,
}, nil }, nil
} }
func (svc *CommonResourceService) handleGenAccountExport(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *CommonResourceService) handleGenAccountExport(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
fileContent := bytes.NewBuffer(nil) fileContent := bytes.NewBuffer(nil)
@ -186,3 +189,58 @@ func (svc *CommonResourceService) handleGenAccountExport(projectEt *entity.Proje
FileName: projectEt.GetProjectPo().Name + "-登录白名单账号列表.txt", FileName: projectEt.GetProjectPo().Name + "-登录白名单账号列表.txt",
}, nil }, nil
} }
func (svc *CommonResourceService) handleReviewRows(ctx context.Context, projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
resourceRepo := findCommResourceRepo(resourceName)
userId := ctx.Value("user_id").(int)
getRsp, err := api2.GetUserApiInstance().GetUserInfoByID(context.Background(), &api2.GetUserInfoReq{UserId: userId})
if err != nil {
return nil, err
}
if resourceRepo.Repo.Need(projectEt, resourceName) {
for _, dtoObj := range params.Rows {
opRowId := dtoObj["ID"].(float64)
_, dbEt, find, err := resourceRepo.Repo.GetById(projectEt, int(opRowId))
if err != nil {
return nil, err
}
if !find {
return nil, errcode.New(errcode.ParamsInvalid, "not found resource %v db data by id:%v", resourceName, opRowId)
}
dbObj := dbEt.ToCommonDto()
if curStatus, find := dbObj["ReviewCheckStatus"]; find && curStatus.(string) == consts.OpReviewStatus_Ok {
// 审核通过了还审核啥
return nil, errcode.New(errcode.ParamsInvalid, "resource %v db data already review:%v", resourceName, opRowId)
}
dbObj["ProjectId"] = projectEt.GetProjectID()
dbObj["ReviewCheckStatus"] = consts.OpReviewStatus_Ok
dbObj["ReviewUserId"] = userId
dbObj["ReviewUserName"] = getRsp.User.UserName
_, err = resourceRepo.Repo.Edit(projectEt, dbObj)
if err != nil {
return nil, err
}
if hook, ok := projects.GetProjectResourceHook(projectEt, resourceName).(projects.IPostResourceOpCreateHook); ok {
err = hook.Create(projectEt, resourceName, dbObj)
if err != nil {
return nil, err
}
}
}
return &dto2.CommonRowsSelectionRsp{
Msg: "审核成功!",
NeedRefresh: true,
FileName: "",
ShortDesc: "",
}, nil
}
return nil, errcode.New(errcode.ParamsInvalid, "resource %v not need review", resourceName)
}

View File

@ -25,11 +25,12 @@ type ICommonResourceRepo interface {
List(project *entity.Project, params *dto2.CommonListReq) (int, []*dto2.CommonDtoFieldDesc, []*entity.CommonResource, error) List(project *entity.Project, params *dto2.CommonListReq) (int, []*dto2.CommonDtoFieldDesc, []*entity.CommonResource, error)
GetById(projectEt *entity.Project, id int) ([]*dto2.CommonDtoFieldDesc, *entity.CommonResource, bool, error) GetById(projectEt *entity.Project, id int) ([]*dto2.CommonDtoFieldDesc, *entity.CommonResource, bool, error)
Create(projectEt *entity.Project, resource string, et dto2.CommonDtoValues) (*entity.CommonResource, error) Create(projectEt *entity.Project, resource string, et dto2.CommonDtoValues) (*entity.CommonResource, error)
Edit(projectEt *entity.Project, et dto2.CommonDtoValues) error Edit(projectEt *entity.Project, et dto2.CommonDtoValues) (oldEt *entity.CommonResource, err error)
Delete(projectEt *entity.Project, id int) (*entity.CommonResource, bool, error) Delete(projectEt *entity.Project, id int) (*entity.CommonResource, bool, error)
ListPagination(whereSql string, whereArgs []any, f func(po model.IModel)) error ListPagination(whereSql string, whereArgs []any, f func(po model.IModel)) error
UpdateClearDelayInvokeCreateHookFieldN(id int) error UpdateClearDelayInvokeCreateHookFieldN(id int) error
MakeEntitiesByDtoList(dtoList []dto2.CommonDtoValues) []*entity.CommonResource MakeEntitiesByDtoList(dtoList []dto2.CommonDtoValues) []*entity.CommonResource
Need(project *entity.Project, resource string) bool
} }
func NewCommonResourceRepo(db *gorm.DB, poTemplate model.IModel) ICommonResourceRepo { func NewCommonResourceRepo(db *gorm.DB, poTemplate model.IModel) ICommonResourceRepo {
@ -130,13 +131,23 @@ func (repo *commonResourceRepoImpl) Create(projectEt *entity.Project, resource s
return et, nil return et, nil
} }
func (repo *commonResourceRepoImpl) Edit(projectEt *entity.Project, dtoObj dto2.CommonDtoValues) error { func (repo *commonResourceRepoImpl) Edit(projectEt *entity.Project, dtoObj dto2.CommonDtoValues) (*entity.CommonResource, error) {
et := (&entity.CommonResource{}).FromPo(repo.makeEmptyPo()).FromDto(dtoObj) et := (&entity.CommonResource{}).FromPo(repo.makeEmptyPo()).FromDto(dtoObj)
err := repo.db.Where("id=?", et.Po.GetId()).Save(et.Po).Error
_, oldEt, find, err := repo.GetById(projectEt, et.Po.GetId())
if err != nil { if err != nil {
return errcode.New(errcode.DBError, "edit resource:%v obj:%+v error:%v", repo.poTemplate.TableName(), et, err) return nil, err
} }
return nil if !find {
return et, errcode.New(errcode.ParamsInvalid, "edit resource not found by id:%v", et.Po.GetId())
}
err = repo.db.Where("id=?", et.Po.GetId()).Save(et.Po).Error
if err != nil {
return nil, errcode.New(errcode.DBError, "edit resource:%v obj:%+v error:%v", repo.poTemplate.TableName(), et, err)
}
return oldEt, nil
} }
func (repo *commonResourceRepoImpl) Delete(projectEt *entity.Project, id int) (*entity.CommonResource, bool, error) { func (repo *commonResourceRepoImpl) Delete(projectEt *entity.Project, id int) (*entity.CommonResource, bool, error) {
@ -209,6 +220,11 @@ func (repo *commonResourceRepoImpl) MakeEntitiesByDtoList(dtoList []dto2.CommonD
return list return list
} }
func (repo *commonResourceRepoImpl) Need(project *entity.Project, resource string) bool {
_, find := reflect.TypeOf(repo.poTemplate).Elem().FieldByName("ReviewCheckStatus")
return find
}
func (repo *commonResourceRepoImpl) makeEmptyPo() model.IModel { func (repo *commonResourceRepoImpl) makeEmptyPo() model.IModel {
return reflect.New(reflect.TypeOf(repo.poTemplate).Elem()).Interface().(model.IModel) return reflect.New(reflect.TypeOf(repo.poTemplate).Elem()).Interface().(model.IModel)
} }

View File

@ -1,6 +1,7 @@
package model package model
import ( import (
"admin/internal/consts"
"admin/internal/db" "admin/internal/db"
"admin/internal/model/dto" "admin/internal/model/dto"
"time" "time"
@ -21,13 +22,20 @@ type RoleMail struct {
ID int `gorm:"primarykey" readonly:"true"` ID int `gorm:"primarykey" readonly:"true"`
ProjectId int `gorm:"index:idx_project_id"` ProjectId int `gorm:"index:idx_project_id"`
ServerID string `name:"所属区服" choices:"GetChoiceServers" required:"true" where:"eq"` ServerID string `name:"所属区服" choices:"GetChoiceServers" required:"true" where:"eq"`
RoleIDs []string `gorm:"type:json;serializer:json" name:"生效的角色id" desc:"生效的角色id逗号分隔多个" required:"true"` RoleIDs []string `gorm:"type:json;serializer:json" name:"生效的角色id" desc:"生效的角色id逗号分隔多个" required:"true" big_column:"true"`
Title string `name:"邮件标题" required:"true" big_column:"true"` Title string `name:"邮件标题" required:"true" big_column:"true"`
Content string `name:"邮件内容" required:"true" big_column:"true"` Content string `name:"邮件内容" required:"true" big_column:"true"`
Attach []*MailAttachItem `gorm:"type:json;serializer:json" name:"邮件附件" type:"items" desc:"搜索道具并点击添加"` Attach []*MailAttachItem `gorm:"type:json;serializer:json" name:"邮件附件" type:"items" desc:"搜索道具并点击添加"`
CreatedAt time.Time `readonly:"true" where:"range"` CreatedAt time.Time `readonly:"true" where:"range"`
UpdatedAt time.Time `readonly:"true"` UpdatedAt time.Time `readonly:"true"`
ReviewCheckStatus string `gorm:"type:varchar(20);default:pending" name:"审核状态" type:"tagStatus" choices:"GetStatusChoices" readonly:"true"`
PostUserId int `name:"发送用户id" readonly:"true"`
PostUserName string `name:"发送用户名字" readonly:"true"`
ReviewNeedCharacters []string `gorm:"type:json;serializer:json" name:"审核角色组" readonly:"true"`
ReviewUserId int `name:"审核员id" readonly:"true"`
ReviewUserName string `name:"审核员名字" readonly:"true"`
} }
func (lm *RoleMail) TableName() string { func (lm *RoleMail) TableName() string {
@ -45,3 +53,11 @@ func (m *RoleMail) GetShowKey() string {
func (m *RoleMail) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice { func (m *RoleMail) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice {
return getChoiceServers(project) return getChoiceServers(project)
} }
func (m *RoleMail) GetStatusChoices(project *Project) []*dto.CommonDtoFieldChoice {
return []*dto.CommonDtoFieldChoice{
{Desc: "审核通过已发放", Value: consts.OpReviewStatus_Ok, Type: 2}, // type: 0:plain 1:primary 2:success 3:info 4:warning 5:danger
{Desc: "待审核", Value: consts.OpReviewStatus_Pending, Type: 3},
{Desc: "已发放", Value: consts.OpReviewStatus_DirectOk, Type: 2},
}
}

View File

@ -56,7 +56,7 @@ func (svc *Service) CommonList(ctx context.Context, projectId int, resourceName
Value1: projectId, Value1: projectId,
}}, params.ParsedWhereConditions.Conditions...) }}, params.ParsedWhereConditions.Conditions...)
} }
totalCount, fieldsDescInfo, rows, err := svc.resourceSvc.List(projectId, resourceName, params) totalCount, fieldsDescInfo, rows, err := svc.resourceSvc.List(ctx, projectId, resourceName, params)
itemBags, err := svc.projectSvc.GetAllItemBag(projectId) itemBags, err := svc.projectSvc.GetAllItemBag(projectId)
if err != nil { if err != nil {
return nil, err return nil, err
@ -69,7 +69,7 @@ func (svc *Service) CommonPost(ctx context.Context, projectId int, resourceName
params["ProjectId"] = projectId params["ProjectId"] = projectId
} }
project, values, err := svc.resourceSvc.Create(projectId, resourceName, params) project, values, err := svc.resourceSvc.Create(ctx, projectId, resourceName, params)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -102,7 +102,7 @@ func (svc *Service) CommonPut(ctx context.Context, projectId int, resourceName s
if resourceName != consts.ResourcesName_Project { if resourceName != consts.ResourcesName_Project {
params["ProjectId"] = projectId params["ProjectId"] = projectId
} }
project, err := svc.resourceSvc.Edit(projectId, resourceName, params) project, err := svc.resourceSvc.Edit(ctx, projectId, resourceName, params)
if err != nil { if err != nil {
return err return err
} }
@ -162,7 +162,7 @@ func (svc *Service) CommonDelete(ctx context.Context, projectId int, resourceNam
} }
func (svc *Service) CommonRowsSelection(ctx context.Context, projectId int, resourceName string, param *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { func (svc *Service) CommonRowsSelection(ctx context.Context, projectId int, resourceName string, param *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) {
project, rsp, err := svc.resourceSvc.RowsSelection(projectId, resourceName, param) project, rsp, err := svc.resourceSvc.RowsSelection(ctx, projectId, resourceName, param)
if err != nil { if err != nil {
return rsp, err return rsp, err
} }

View File

@ -10,6 +10,8 @@ func GetUserApiInstance() IUserApi {
type IUserApi interface { type IUserApi interface {
Auth(ctx context.Context, req *AuthReq) (*AuthRsp, error) Auth(ctx context.Context, req *AuthReq) (*AuthRsp, error)
OpPermissionNeedReview(ctx context.Context, req *OpPermissionNeedReviewReq) (*OpPermissionNeedReviewRsp, error)
GetUserInfoByID(ctx context.Context, req *GetUserInfoReq) (*GetUserInfoRsp, error)
} }
func RegisterUserApiHandler(handler IUserApi) { func RegisterUserApiHandler(handler IUserApi) {
@ -39,3 +41,23 @@ type AuthRsp struct {
User *UserInfo User *UserInfo
Token *TokenInfo Token *TokenInfo
} }
type OpPermissionNeedReviewReq struct {
Token string
UserId int
}
type OpPermissionNeedReviewRsp struct {
IsNeedReview bool
UserName string
ReviewCharacters []string
}
type GetUserInfoReq struct {
UserId int
}
type GetUserInfoRsp struct {
Find bool
User *UserInfo
}

View File

@ -67,3 +67,14 @@ func (svc *CommonResourceService) GetToken(userId int) (*model.Token, error) {
return tokenInfo, nil return tokenInfo, nil
} }
func (svc *CommonResourceService) UserHasPermitReviewCharacters(userId int) (*entity.User, []string, bool, error) {
user, find, err := svc.userRepo.GetById(userId)
if err != nil {
return nil, nil, false, err
}
if !find {
return nil, nil, false, errcode.New(errcode.ParamsInvalid, "not found user %v db data", userId)
}
return user, user.Character.WriteOpCheckCharacters, len(user.Character.WriteOpCheckCharacters) > 0, nil
}

View File

@ -3,6 +3,7 @@ package model
import ( import (
"admin/internal/db" "admin/internal/db"
"admin/internal/global" "admin/internal/global"
"admin/internal/model/dto"
"admin/lib/xlog" "admin/lib/xlog"
"time" "time"
) )
@ -16,8 +17,9 @@ type Permission struct {
// Character 角色权限组 // Character 角色权限组
type Character struct { type Character struct {
ID int `gorm:"primarykey" readonly:"true"` ID int `gorm:"primarykey" readonly:"true"`
Name string `name:"角色名" desc:"区别一组用户的名字例如qa、策划、运营" gorm:"type:varchar(255);unique" required:"true" uneditable:"true"` Name string `name:"角色名" desc:"区别一组用户的名字例如qa、策划、运营" gorm:"type:varchar(255);unique" required:"true" uneditable:"true"`
WriteOpCheckCharacters []string `gorm:"type:json;serializer:json" name:"操作审核员" desc:"不选表示敏感操作无需审核" type:"[]string" choices:"GetCharChoices" multi_choice:"true"`
// 权限列表,格式就是 ["project:<projectId>:<resource>:<get>", "sys:user:get", ...] // 权限列表,格式就是 ["project:<projectId>:<resource>:<get>", "sys:user:get", ...]
// 例如项目3封禁功能的列表获取权限"project:3:ban:list" // 例如项目3封禁功能的列表获取权限"project:3:ban:list"
Permissions []string `gorm:"type:json;serializer:json" name:"权限列表" type:"Permissions"` Permissions []string `gorm:"type:json;serializer:json" name:"权限列表" type:"Permissions"`
@ -41,3 +43,14 @@ func (m *Character) List() []*Character {
} }
return list return list
} }
func (m *Character) GetCharChoices() []*dto.CommonDtoFieldChoice {
choices := make([]*dto.CommonDtoFieldChoice, 0)
for _, v := range new(Character).List() {
choices = append(choices, &dto.CommonDtoFieldChoice{
Desc: v.Name,
Value: v.Name,
})
}
return choices
}

View File

@ -38,10 +38,6 @@ func (u *User) GetStatusChoices() []*dto.CommonDtoFieldChoice {
func (u *User) GetCharChoices() []*dto.CommonDtoFieldChoice { func (u *User) GetCharChoices() []*dto.CommonDtoFieldChoice {
choices := make([]*dto.CommonDtoFieldChoice, 0) choices := make([]*dto.CommonDtoFieldChoice, 0)
choices = append(choices, &dto.CommonDtoFieldChoice{
Desc: "空",
Value: "",
})
for _, v := range new(Character).List() { for _, v := range new(Character).List() {
choices = append(choices, &dto.CommonDtoFieldChoice{ choices = append(choices, &dto.CommonDtoFieldChoice{
Desc: v.Name, Desc: v.Name,

View File

@ -147,3 +147,36 @@ func (svc *Service) ListUserExecHistory(params *dto2.ListUserOpHistoryReq) (*dto
rsp.TotalCount = totalCount rsp.TotalCount = totalCount
return rsp, nil return rsp, nil
} }
func (svc *Service) OpPermissionNeedReview(ctx context.Context, req *apiUser.OpPermissionNeedReviewReq) (*apiUser.OpPermissionNeedReviewRsp, error) {
user, reviewCharacters, need, err := svc.resourceSvc.UserHasPermitReviewCharacters(req.UserId)
if err != nil {
return nil, err
}
return &apiUser.OpPermissionNeedReviewRsp{
IsNeedReview: need,
UserName: user.Po.UserName,
ReviewCharacters: reviewCharacters,
}, nil
}
func (svc *Service) GetUserInfoByID(ctx context.Context, req *apiUser.GetUserInfoReq) (*apiUser.GetUserInfoRsp, error) {
user, find, err := svc.resourceSvc.GetUserById(req.UserId)
if err != nil {
return nil, err
}
if !find {
return &apiUser.GetUserInfoRsp{Find: find}, nil
}
return &apiUser.GetUserInfoRsp{
Find: true,
User: &apiUser.UserInfo{
UserId: user.Po.ID,
UserName: user.Po.UserName,
NickName: user.Po.NickName,
Icon: "",
Character: user.Character.Name,
Permissions: user.Character.Permissions,
},
}, nil
}

View File

@ -72,8 +72,9 @@ const (
) )
const ( const (
BtnKeyRow_Server_Down = "server:down" BtnKeyRow_Server_Down = "server:down"
BtnKeyRow_Server_Up = "server:up" BtnKeyRow_Server_Up = "server:up"
BtnKeyRow_RoleMailReview = "rolemail:review"
) )
const ( const (
@ -92,3 +93,9 @@ const (
CdnServerStatus_Full = 0 CdnServerStatus_Full = 0
CdnServerStatus_Maintain = 3 CdnServerStatus_Maintain = 3
) )
const (
OpReviewStatus_Ok = "reviewed" // 审核通过
OpReviewStatus_Pending = "pending" // 待审核
OpReviewStatus_DirectOk = "dir_reviewed" // 无须审核直接通过
)

View File

@ -9,6 +9,10 @@ func GetProjectResourcePermission(projectId int, resource string, method string)
return fmt.Sprintf("project:%v:%v:%v", projectId, resource, strings.ToLower(method)) return fmt.Sprintf("project:%v:%v:%v", projectId, resource, strings.ToLower(method))
} }
func GetProjectResourceBtnPermission(projectId int, resource string, btn string) string {
return fmt.Sprintf("project:btn:%v:%v:%v", projectId, resource, strings.ToLower(btn))
}
func ParseProjectResourcePermission(permission string) (int, string, string, error) { func ParseProjectResourcePermission(permission string) (int, string, string, error) {
projectId := 0 projectId := 0
resource := "" resource := ""

View File

@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title> <title>Vite App</title>
<script type="module" crossorigin src="/static/js/index-LJvZJS40.js"></script> <script type="module" crossorigin src="/static/js/index-hOIgOejC.js"></script>
<link rel="modulepreload" crossorigin href="/static/js/vendor-CF1QNs3T.js"> <link rel="modulepreload" crossorigin href="/static/js/vendor-B2m3dX6z.js">
<link rel="stylesheet" crossorigin href="/static/css/vendor-DnLjZ1mj.css"> <link rel="stylesheet" crossorigin href="/static/css/vendor-DnLjZ1mj.css">
<link rel="stylesheet" crossorigin href="/static/css/index-BqAGgcXq.css"> <link rel="stylesheet" crossorigin href="/static/css/index-BqAGgcXq.css">
</head> </head>

View File

@ -0,0 +1 @@
.roleDetailList[data-v-5a8d8958] .el-table__header-wrapper th{word-break:break-word;background-color:#f8f8f9!important;color:#515a6e;height:40px!important;font-size:13px}.roleDetailList[data-v-5a8d8958] .el-table__header .el-table-column--selection .cell{width:60px!important}.roleDetailList[data-v-5a8d8958] .el-table .fixed-width .el-button--small{padding-left:0;padding-right:0;width:20px!important}.roleDetailList[data-v-5a8d8958] .el-table__header{background:#f5f7fa!important}.roleDetailList[data-v-5a8d8958] .el-table__row td{border-color:#ebeef5}.app-content[data-v-0dd2745c]{height:calc(100vh - 100px);display:flex}.app-content .table-content[data-v-0dd2745c]{display:flex;flex-direction:column;justify-content:space-between;height:100%;overflow:auto}.app-content .table-content .table[data-v-0dd2745c]{flex:1;position:relative}.app-content .table-content .table[data-v-0dd2745c] .el-table{flex:1;position:absolute}.app-content .table-content .table[data-v-0dd2745c] .el-popper{max-width:640px;word-break:break-all}.pagination-container .el-pagination[data-v-0dd2745c]{right:0;position:absolute;height:25px;margin-bottom:50px;margin-top:0;padding:10px 30px!important;z-index:2}.pagination-container.hidden[data-v-0dd2745c]{display:none}@media (max-width: 768px){.pagination-container .el-pagination>.el-pagination__jump[data-v-0dd2745c]{display:none!important}.pagination-container .el-pagination>.el-pagination__sizes[data-v-0dd2745c]{display:none!important}}

View File

@ -0,0 +1 @@
import{r as e,ab as a,a as s,o,d as r,b as l,w as n,a0 as t,a3 as u,ac as d,W as i,v as p,$ as c,a9 as m,I as v}from"./vendor-B2m3dX6z.js";import{_ as f,u as _,r as g}from"./index-hOIgOejC.js";const y={class:"login-box"},h={class:m({container:!0,animate__animated:!0,animate__flipInX:!0})},w={class:"form-container sign-in-container"},b=f({__name:"Login",setup(m){e(void 0);const{proxy:f}=a(),b=e({user:"",password:""}),V={user:[{required:!0,trigger:"blur",message:"请输入您的账号"}],password:[{required:!0,trigger:"blur",message:"请输入您的密码"}]},x=e=>{e&&f.$refs.ruleFormRef.validate((e=>{if(!e)return console.log("error submit!"),!1;_().login(b.value.user,b.value.password).then((()=>{console.log("登录成功,推送首页。。"),g.push({path:"/welcome"})}),(e=>{})).catch((()=>{v.error("login response error")}))}))};return(e,a)=>{const m=u,v=t,f=i,_=c;return o(),s("div",y,[r("div",h,[r("div",w,[l(_,{ref:"ruleFormRef",model:b.value,"status-icon":"",rules:V,class:"form"},{default:n((()=>[l(v,{class:"form-item",prop:"username"},{default:n((()=>[l(m,{modelValue:b.value.user,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value.user=e),placeholder:"用户名",autocomplete:"off",onKeyup:a[1]||(a[1]=d((e=>x(b.value)),["enter"]))},null,8,["modelValue"])])),_:1}),l(v,{class:"form-item",prop:"password"},{default:n((()=>[l(m,{modelValue:b.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>b.value.password=e),placeholder:"密码",type:"password",autocomplete:"off",onKeyup:a[3]||(a[3]=d((e=>x(b.value)),["enter"]))},null,8,["modelValue"])])),_:1}),l(f,{class:"theme-button",type:"primary",onClick:a[4]||(a[4]=e=>x(b.value)),onKeydown:a[5]||(a[5]=d((e=>{var a;13!==a.keyCode&&100!==a.keyCode||x(b.value)}),["enter"]))},{default:n((()=>a[6]||(a[6]=[p("登 陆 ")]))),_:1})])),_:1},8,["model"])]),a[7]||(a[7]=r("div",{class:"overlay_container"},[r("div",{class:"overlay"},[r("div",{class:"overlay_panel overlay_right_container"},[r("h2",{class:"container-title"},"hello friend!"),r("p",null,"输入您的个人信息,以便使用后台管理系统")])])],-1))])])}}},[["__scopeId","data-v-68d4afe9"]]);export{b as default};

View File

@ -0,0 +1 @@
import{r as e,ab as a,a as s,o,d as r,b as l,w as n,a0 as t,a3 as u,ac as d,W as i,v as p,$ as c,a9 as m,I as v}from"./vendor-CF1QNs3T.js";import{_ as f,u as _,r as g}from"./index-Cirxlp2u.js";const y={class:"login-box"},h={class:m({container:!0,animate__animated:!0,animate__flipInX:!0})},w={class:"form-container sign-in-container"},b=f({__name:"Login",setup(m){e(void 0);const{proxy:f}=a(),b=e({user:"",password:""}),V={user:[{required:!0,trigger:"blur",message:"请输入您的账号"}],password:[{required:!0,trigger:"blur",message:"请输入您的密码"}]},x=e=>{e&&f.$refs.ruleFormRef.validate((e=>{if(!e)return console.log("error submit!"),!1;_().login(b.value.user,b.value.password).then((()=>{console.log("登录成功,推送首页。。"),g.push({path:"/welcome"})}),(e=>{})).catch((()=>{v.error("login response error")}))}))};return(e,a)=>{const m=u,v=t,f=i,_=c;return o(),s("div",y,[r("div",h,[r("div",w,[l(_,{ref:"ruleFormRef",model:b.value,"status-icon":"",rules:V,class:"form"},{default:n((()=>[l(v,{class:"form-item",prop:"username"},{default:n((()=>[l(m,{modelValue:b.value.user,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value.user=e),placeholder:"用户名",autocomplete:"off",onKeyup:a[1]||(a[1]=d((e=>x(b.value)),["enter"]))},null,8,["modelValue"])])),_:1}),l(v,{class:"form-item",prop:"password"},{default:n((()=>[l(m,{modelValue:b.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>b.value.password=e),placeholder:"密码",type:"password",autocomplete:"off",onKeyup:a[3]||(a[3]=d((e=>x(b.value)),["enter"]))},null,8,["modelValue"])])),_:1}),l(f,{class:"theme-button",type:"primary",onClick:a[4]||(a[4]=e=>x(b.value)),onKeydown:a[5]||(a[5]=d((e=>{var a;13!==a.keyCode&&100!==a.keyCode||x(b.value)}),["enter"]))},{default:n((()=>a[6]||(a[6]=[p("登 陆 ")]))),_:1})])),_:1},8,["model"])]),a[7]||(a[7]=r("div",{class:"overlay_container"},[r("div",{class:"overlay"},[r("div",{class:"overlay_panel overlay_right_container"},[r("h2",{class:"container-title"},"hello friend!"),r("p",null,"输入您的个人信息,以便使用后台管理系统")])])],-1))])])}}},[["__scopeId","data-v-68d4afe9"]]);export{b as default};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/index-rnTC2Gz1.js","static/js/index-Cirxlp2u.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/css/index-BqAGgcXq.css","static/css/index-DCz6qoKM.css","static/js/index-BVuV6cUH.js","static/css/index-BPoLGm0d.css"])))=>i.map(i=>d[i]);
import{b as s}from"./index-Cirxlp2u.js";import{c as a,o as e,w as t,b as n,u as r,ad as o,D as _}from"./vendor-CF1QNs3T.js";const i={__name:"analyseIndex",setup(i){const d=o((()=>s((()=>import("./index-rnTC2Gz1.js")),__vite__mapDeps([0,1,2,3,4,5])))),c=o((()=>s((()=>import("./index-BVuV6cUH.js")),__vite__mapDeps([6,2,3,1,4,7]))));return(s,o)=>{const i=_;return e(),a(i,{class:"bi_container",direction:"vertical"},{default:t((()=>[n(r(d)),n(r(c))])),_:1})}}};export{i as default};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainContentLeft-fL9kUex7.js","static/js/index-Cirxlp2u.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/css/index-BqAGgcXq.css","static/css/analyseMainContentLeft-CKg7AoA4.css","static/js/analyseMainContentRight-CUFlwZM6.js","static/css/analyseMainContentRight-DqjIe2oH.css"])))=>i.map(i=>d[i]);
import{_ as n,b as a}from"./index-Cirxlp2u.js";import{c as e,o,w as s,b as t,u as l,am as f,ad as i,an as m}from"./vendor-CF1QNs3T.js";const u=n({__name:"analyseMainContent",props:{analyseCustomInfo:{analyseName:"",leftPaneInfo:{paneComponent:null},rightPaneInfo:{paneComponent:null}}},setup(n){const u=n;console.log("custom info:",u.analyseCustomInfo);const _=i((()=>a((()=>import("./analyseMainContentLeft-fL9kUex7.js")),__vite__mapDeps([0,1,2,3,4,5])))),p=i((()=>a((()=>import("./analyseMainContentRight-CUFlwZM6.js")),__vite__mapDeps([6,1,2,3,4,7]))));return(a,i)=>(o(),e(l(m),null,{default:s((()=>[t(l(f),{size:"25","min-size":"20","max-size":"40"},{default:s((()=>[t(l(_),{paneInfo:n.analyseCustomInfo.leftPaneInfo},null,8,["paneInfo"])])),_:1}),t(l(f),{size:"75","min-size":"60","max-size":"80"},{default:s((()=>[t(l(p),{paneInfo:n.analyseCustomInfo.rightPaneInfo},null,8,["paneInfo"])])),_:1})])),_:1}))}},[["__scopeId","data-v-5ab4c275"]]);export{u as default};

View File

@ -0,0 +1 @@
import{_ as n}from"./index-Cirxlp2u.js";import{a,o as e,c as o,B as s}from"./vendor-CF1QNs3T.js";const t={class:"contentPane"},p=n({__name:"analyseMainContentLeft",props:{paneInfo:{paneComponent:null}},setup:n=>(p,d)=>(e(),a("div",t,[(e(),o(s(n.paneInfo.paneComponent)))]))},[["__scopeId","data-v-5e99bb1d"]]);export{p as default};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainContentRightToolbar-Bwi-r2rX.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css","static/css/analyseMainContentRightToolbar-CCLHpzDP.css","static/js/analyseMainContentRightResult-DBw8mE0s.js","static/css/analyseMainContentRightResult-DBbfxKRW.css"])))=>i.map(i=>d[i]);
import{_ as a,b as s}from"./index-Cirxlp2u.js";import{a as t,o as n,d as o,b as e,u as r,ad as l}from"./vendor-CF1QNs3T.js";const _={class:"result"},i={class:"resultToolbar"},d={class:"resultContent"},p=a({__name:"analyseMainContentRight",props:{paneInfo:{paneComponent:null}},setup(a){const p=l((()=>s((()=>import("./analyseMainContentRightToolbar-Bwi-r2rX.js")),__vite__mapDeps([0,1,2,3,4,5])))),u=l((()=>s((()=>import("./analyseMainContentRightResult-DBw8mE0s.js")),__vite__mapDeps([6,1,2,3,4,7]))));return(a,s)=>(n(),t("div",_,[o("div",i,[e(r(p))]),o("div",d,[e(r(u))])]))}},[["__scopeId","data-v-c93e8dd8"]]);export{p as default};

View File

@ -0,0 +1 @@
import{r as a,T as e,aw as t,a as l,o as s,d as n,b as d,aa as i,w as r,aj as u,ax as f,W as o,v as c,a7 as y,X as p,Y as _,t as x,F as m,ay as g}from"./vendor-CF1QNs3T.js";import{_ as h}from"./index-Cirxlp2u.js";const w={class:"clearfix",style:{width:"100%","text-align":"center",display:"flex","align-items":"center","justify-content":"center"}},v={style:{width:"100%",height:"1px",display:"flex","align-items":"center","justify-content":"center"}},b={href:"#"},A={href:"#"},j={href:"#"},P={href:"#"},z={href:"#"},R=h({__name:"analyseMainContentRightResult",setup(h){const R=a(null);let E=null;const L=a([{metric:"APP关闭.总次数",stageAcc:"426",day20250530:"49",day20250531:"70",day20250601:"61",day20250602:"78"},{metric:"APP打开.总次数",stageAcc:"401",day20250530:"45",day20250531:"63",day20250601:"45",day20250602:"32"}]),k=()=>{null==E||E.resize()};return e((()=>{(()=>{if(R.value){E=g(R.value);const a={title:{text:"事件分析图"},tooltip:{},legend:{data:["销量"]},xAxis:{data:["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]},yAxis:{},series:[{name:"销量",type:"bar",data:[5,20,36,10,10,20]}]};E.setOption(a)}})(),window.addEventListener("resize",k)})),t((()=>{window.removeEventListener("resize",k),null==E||E.dispose()})),(a,e)=>{const t=i,g=o,h=f,E=u,k=y,C=_,F=p;return s(),l(m,null,[n("div",w,[n("div",{ref_key:"chartRef",ref:R,style:{width:"100%",height:"400px",margin:"10px 0 0 10px"}},null,512)]),n("div",v,[d(t,{style:{width:"90%"},"content-position":"center"})]),d(k,{style:{"margin-top":"10px","margin-bottom":"10px","margin-left":"10px"}},{default:r((()=>[d(E,{span:6},{default:r((()=>[d(h,null,{default:r((()=>[d(g,null,{default:r((()=>e[0]||(e[0]=[c("合并")]))),_:1}),d(g,null,{default:r((()=>e[1]||(e[1]=[c("平铺")]))),_:1})])),_:1})])),_:1}),d(E,{span:10,offset:8},{default:r((()=>[d(h,{style:{float:"right","margin-right":"20px"}},{default:r((()=>[d(g,null,{default:r((()=>e[2]||(e[2]=[c("按日期")]))),_:1}),d(g,null,{default:r((()=>e[3]||(e[3]=[c("阶段汇总配置")]))),_:1}),d(g,null,{default:r((()=>e[4]||(e[4]=[c("导出")]))),_:1})])),_:1})])),_:1})])),_:1}),d(k,null,{default:r((()=>[d(F,{data:L.value},{default:r((()=>[d(C,{prop:"metric",label:"指标"}),d(C,{label:"阶段汇总"},{default:r((a=>[n("a",b,x(a.row.stageAcc),1)])),_:1}),d(C,{label:"2025-05-30(五)"},{default:r((a=>[n("a",A,x(a.row.day20250530),1)])),_:1}),d(C,{label:"2025-05-31(六)"},{default:r((a=>[n("a",j,x(a.row.day20250531),1)])),_:1}),d(C,{label:"2025-06-01(日)"},{default:r((a=>[n("a",P,x(a.row.day20250601),1)])),_:1}),d(C,{label:"2025-06-02(一)"},{default:r((a=>[n("a",z,x(a.row.day20250602),1)])),_:1})])),_:1},8,["data"])])),_:1})],64)}}},[["__scopeId","data-v-b8b97447"]]);export{R as default};

View File

@ -0,0 +1 @@
import{r as e,aq as a,T as l,a as t,o as s,b as n,a4 as d,l as o,w as r,d as u,t as c,ar as p,a7 as i,v,W as m,p as f,as as g,at as _,au as b,av as x,c as h,aj as y,F as T,z as k,u as C,E as P,B as V}from"./vendor-CF1QNs3T.js";import{_ as w}from"./index-Cirxlp2u.js";function D(){const e=new Date;return e.setHours(0,0,0,0),e}const j={class:"timeRangePicker"},E={__name:"dateDayRanger",setup(o){const r=e("过去7天"),u=D();u.setTime(u.getTime()-6048e5);const c=D(),p=e([u,c]);a((()=>{console.log(`选择日期范围:${r.value[0]}${r.value[1]}`)})),l((()=>{}));const i=[{text:"昨日",value:()=>{const e=D(),a=D();return e.setTime(e.getTime()-864e5),[e,a]}},{text:"今日",value:()=>[D(),D()]},{text:"过去7天",value:()=>[u,c]},{text:"本月",value:()=>{const e=D(),a=D();return e.setDate(1),[e,a]}}];return(e,a)=>{const l=d;return s(),t("div",j,[n(l,{teleported:!1,modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=e=>r.value=e),type:"daterange","range-separator":"到","start-placeholder":"Start date","end-placeholder":"End date",shortcuts:i,"default-time":p.value},null,8,["modelValue","default-time"])])}}},I={class:"dateDaySelect clearfix"},R=["title"],S={style:{"margin-right":"10px"}},B={class:"timePickerPane"},U=w({__name:"dateDaySelect",setup(a){const l=e("按天"),d=[{label:"按天",value:"按天"},{label:"按分钟",value:"按分钟",children:[{label:"1分钟",value:"1分钟"},{label:"5分钟",value:"5分钟"},{label:"10分钟",value:"10分钟"}]},{label:"按小时",value:"按小时"},{label:"按周",value:"按周"},{label:"按月",value:"按月"},{label:"按季度",value:"按季度"},{label:"按年",value:"按年"},{label:"合计",value:"合计"}],_=e("今日"),b=()=>{};return(e,a)=>{const x=p,h=o("Calendar"),y=f,T=m,k=i,C=g;return s(),t("div",I,[n(x,{popperClass:"cascaderPopper",modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=e=>l.value=e),options:d,"show-all-levels":!1,props:{expandTrigger:"hover",emitPath:!1}},{default:r((({data:e})=>[u("span",{title:e.label},c(e.value),9,R)])),_:1},8,["modelValue"]),n(C,{placement:"bottom-start",trigger:"click",width:800,onClick:b,"popper-style":"box-shadow: rgb(14 18 22 / 35%) 0px 10px 38px -10px, rgb(14 18 22 / 20%) 0px 10px 20px -15px; padding: 0px;"},{reference:r((()=>[n(T,{style:{"margin-left":"10px"}},{default:r((()=>[u("p",S,c(_.value),1),n(y,{class:"el-icon--right"},{default:r((()=>[n(h)])),_:1})])),_:1})])),default:r((()=>[u("div",B,[n(k,null,{default:r((()=>a[1]||(a[1]=[v("日期范围")]))),_:1}),n(k,null,{default:r((()=>[n(E)])),_:1})])])),_:1})])}}},[["__scopeId","data-v-65ce36af"]]),$=w({__name:"analyseMainContentRightToolbar",setup(a){const l=e([{comp:_,desc:"趋势图",selected:!0},{comp:b,desc:"上升图",selected:!1},{comp:x,desc:"饼图",selected:!1}]);return(e,a)=>{const d=y,o=m,u=P,c=i;return s(),h(c,{gutter:20,align:"middle",class:"toolbarPane"},{default:r((()=>[n(d,{span:6},{default:r((()=>[n(U,{style:{"margin-left":"10px"}})])),_:1}),n(d,{span:6,offset:12},{default:r((()=>[n(c,{style:{height:"100%"},align:"middle",justify:"end"},{default:r((()=>[(s(!0),t(T,null,k(C(l),((e,a)=>(s(),h(u,{placement:"top",effect:"light",content:e.desc},{default:r((()=>[n(o,{disabled:e.selected,class:"chartBtn",onClick:a=>(e=>{l.value.forEach((a=>{a.selected=a.desc===e.desc}))})(e)},{default:r((()=>[(s(),h(V(e.comp),{class:"chartIcon"}))])),_:2},1032,["disabled","onClick"])])),_:2},1032,["content"])))),256))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-584d9183"]]);export{$ as default};

View File

@ -0,0 +1 @@
import{l as a,a as s,o as l,b as n,w as e,d as t,p as o,aj as d,al as r,n as p,W as f,v as u,F as i}from"./vendor-CF1QNs3T.js";import{_ as c}from"./index-Cirxlp2u.js";const _={class:"headerAnalyseDesc"},b={class:"headerAnalyseToolbar",style:{display:"flex",float:"right"}},h={class:"toolbarSpan"},S={class:"toolbarSpan"},g={class:"toolbarSpan"},m={class:"toolbarSpan"},v={class:"toolbarSpan"};const y=c({},[["render",function(c,y){const x=a("Warning"),j=o,w=d,z=r,A=f,D=p,T=a("Refresh"),W=a("Download");return l(),s(i,null,[n(w,{span:6},{default:e((()=>[t("div",_,[y[0]||(y[0]=t("p",{style:{"margin-right":"6px","font-weight":"bold"}},"事件分析",-1)),n(j,{size:"20"},{default:e((()=>[n(x)])),_:1})])])),_:1}),n(w,{span:10,offset:8},{default:e((()=>[t("div",b,[y[3]||(y[3]=t("span",{class:"toolbarSpan"},[t("p",null,"近似计算")],-1)),t("span",h,[n(z)]),t("span",S,[n(D,null,{default:e((()=>[n(A,null,{default:e((()=>y[1]||(y[1]=[u(" UTC +8 ")]))),_:1})])),_:1})]),t("span",g,[n(A,null,{default:e((()=>[n(j,{size:"20"},{default:e((()=>[n(T)])),_:1})])),_:1})]),t("span",m,[n(A,null,{default:e((()=>[n(j,{size:"20"},{default:e((()=>[n(W)])),_:1})])),_:1})]),t("span",v,[n(A,null,{default:e((()=>y[2]||(y[2]=[u("已存报表")]))),_:1})])])])),_:1})],64)}],["__scopeId","data-v-1b836963"]]);export{y as default};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainHeader-DPDggfBD.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css","static/css/analyseMainHeader-R7amk0nh.css","static/js/analyseMainContent-DeDS2ih5.js","static/css/analyseMainContent-BvJwrdRn.css"])))=>i.map(i=>d[i]);
import{_ as a,b as n}from"./index-Cirxlp2u.js";import{a as s,o as e,b as o,w as t,u as l,ad as _,a7 as r}from"./vendor-CF1QNs3T.js";const m={class:"analyseMain"},p=a({__name:"analyseMainIndex",props:{analyseCustomInfo:{analyseName:"",leftPaneInfo:{paneComponent:null},rightPaneInfo:{paneComponent:null}}},setup(a){const p=_((()=>n((()=>import("./analyseMainHeader-DPDggfBD.js")),__vite__mapDeps([0,1,2,3,4,5])))),u=_((()=>n((()=>import("./analyseMainContent-DeDS2ih5.js")),__vite__mapDeps([6,3,1,2,4,7]))));return(n,_)=>{const i=r;return e(),s("div",m,[o(i,{class:"analyseMainHeader"},{default:t((()=>[o(l(p))])),_:1}),o(i,{class:"analyseMainContent"},{default:t((()=>[o(l(u),{analyseCustomInfo:a.analyseCustomInfo},null,8,["analyseCustomInfo"])])),_:1})])}}},[["__scopeId","data-v-33346a41"]]);export{p as default};

View File

@ -0,0 +1 @@
import{a,o as e,d as s,b as r,w as i,c as t,B as o,ai as d,v as n,W as l}from"./vendor-CF1QNs3T.js";import{_ as c}from"./index-Cirxlp2u.js";const p={class:"editorContainer .clearfix"},f={class:"editorOperationArea"},u={class:"editorFinishArea"},_={class:"editorFinishBtns"},v=c({__name:"analyseMetricEditorLayout",props:{editorAreaInfo:{editorPane:null}},setup:c=>(v,m)=>{const y=d,A=l;return e(),a("div",p,[s("div",f,[r(y,null,{default:i((()=>[(e(),t(o(c.editorAreaInfo.editorPane)))])),_:1})]),s("div",u,[s("div",_,[r(A,{size:"large"},{default:i((()=>m[0]||(m[0]=[n(" 保存 ")]))),_:1}),r(A,{type:"primary",size:"large"},{default:i((()=>m[1]||(m[1]=[n(" 计算 ")]))),_:1})])])])}},[["__scopeId","data-v-94c97751"]]);export{v as default};

View File

@ -0,0 +1 @@
import{t as e}from"./tableUser-Dcsyh5oY.js";import{u as r,L as t}from"./index-Cirxlp2u.js";import{a as s,o as a,c as o,B as c}from"./vendor-CF1QNs3T.js";import"./resource-DYLEDGDb.js";import"./empty-BXuh8c50.js";const m={__name:"character",setup(m){let u={meta:{desc:"character",resource:"character",resource_url:"/resource/character",methods:{get:!0,post:!0,put:!0,delete:!0}}};return"admin"!==r().userInfo.character&&(u.meta.methods={}),t.setCache("resource",u),(r,t)=>(a(),s("div",null,[(a(),o(c(e)))]))}};export{m as default};

View File

@ -0,0 +1 @@
import{t as e}from"./tableUser-CoV5BUx7.js";import{u as r,L as t}from"./index-hOIgOejC.js";import{a as s,o as a,c as o,B as c}from"./vendor-B2m3dX6z.js";import"./resource-D0hLzgq7.js";import"./empty-CvrMoGrV.js";const m={__name:"character",setup(m){let u={meta:{desc:"character",resource:"character",resource_url:"/resource/character",methods:{get:!0,post:!0,put:!0,delete:!0}}};return"admin"!==r().userInfo.character&&(u.meta.methods={}),t.setCache("resource",u),(r,t)=>(a(),s("div",null,[(a(),o(c(e)))]))}};export{m as default};

View File

@ -0,0 +1 @@
import{_ as r}from"./index-Cirxlp2u.js";import"./vendor-CF1QNs3T.js";const e=r({},[["render",function(r,e){return" 看板界面 "}]]);export{e as default};

View File

@ -0,0 +1 @@
import{c as o,o as r,ah as s}from"./vendor-CF1QNs3T.js";import{_ as n}from"./index-Cirxlp2u.js";const e=n({},[["render",function(n,e){const t=s;return r(),o(t,{description:"没有权限!请联系管理员添加权限!"})}]]);export{e};

View File

@ -0,0 +1 @@
import{c as o,o as r,ag as s}from"./vendor-B2m3dX6z.js";import{_ as n}from"./index-hOIgOejC.js";const e=n({},[["render",function(n,e){const t=s;return r(),o(t,{description:"没有权限!请联系管理员添加权限!"})}]]);export{e};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMetricEditorLayout-DdWjNz-I.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css","static/css/analyseMetricEditorLayout-C535QVBW.css","static/js/index--B9BZCSZ.js","static/css/index-B3tO-Skr.css","static/js/analyseMainIndex-Ie1NZ0Qy.js","static/css/analyseMainIndex-tuhwk4Nv.css"])))=>i.map(i=>d[i]);
import{b as e}from"./index-Cirxlp2u.js";import{r as n,c as a,o as t,ad as o,B as s,u as r}from"./vendor-CF1QNs3T.js";const _={__name:"analyseMetricEditorEvent",setup(_){const i=o((()=>e((()=>import("./analyseMetricEditorLayout-DdWjNz-I.js")),__vite__mapDeps([0,1,2,3,4,5])))),m={editorPane:o((()=>e((()=>import("./index--B9BZCSZ.js")),__vite__mapDeps([6,3,1,2,4,7]))))};return n(""),(e,n)=>(t(),a(s(r(i)),{editorAreaInfo:m}))}},i={__name:"event",setup(n){const s=o((()=>e((()=>import("./analyseMainIndex-Ie1NZ0Qy.js")),__vite__mapDeps([8,3,1,2,4,9])))),i={analyseName:"事件分析",leftPaneInfo:{paneComponent:_},rightPaneInfo:{paneComponent:_}};return(e,n)=>(t(),a(r(s),{analyseCustomInfo:i}))}};export{i as default};

View File

@ -0,0 +1 @@
import{r as e,l as a,c as l,o as t,w as o,b as r,u as p,a8 as s,a7 as u}from"./vendor-CF1QNs3T.js";import{_ as n}from"./index-Cirxlp2u.js";const m=n({__name:"groupBySelect",setup(n){const m=e([{label:"用户属性",options:[{value:"account_id",label:"游戏账号",meta:{propertyType:2}},{value:"role_id",label:"角色id",meta:{propertyType:2}},{value:"role_name",label:"角色名",meta:{propertyType:2}}]},{label:"事件属性",options:[{value:"item_id",label:"道具id",meta:{propertyType:2}},{value:"item_name",label:"道具名",meta:{propertyType:2}},{value:"cur_num",label:"cur_num",meta:{propertyType:2}}]}]),i=e("");return(e,n)=>{const y=a("a-select"),c=u;return t(),l(c,{class:"groupByOneArea"},{default:o((()=>[r(y,{showArrow:"",value:p(i),"onUpdate:value":n[0]||(n[0]=e=>s(i)?i.value=e:null),options:p(m),onChange:n[1]||(n[1]=()=>{}),style:{width:"100px",margin:"0"}},null,8,["value","options"])])),_:1})}}},[["__scopeId","data-v-5cb43c01"]]);export{m as default};

View File

@ -0,0 +1 @@
import{r as e,T as a,a as l,o as t,c as o,u,B as n,F as s,U as p,w as r,b as d,V as i,a7 as v,a3 as m,a8 as c,W as g,v as h,C as y,d as f,X as V,Y as b,Z as x,D as w,a9 as I}from"./vendor-CF1QNs3T.js";import{_ as k,u as _,a as C}from"./index-Cirxlp2u.js";import{e as U}from"./empty-BXuh8c50.js";const z={class:"table-content"},j={class:"table"},D={class:"pagination-container"},R=k({__name:"history",props:{rowInfo:{},disableConditionInput:!0},setup(k){const R=k;let S=!0;!1===R.disableConditionInput&&(S=!1);const T="admin"===_().userInfo.character,A=e(T),B=e(1),F=e(20),G=e(R.userId);R.rowInfo&&void 0!==R.rowInfo.ID&&(G.value=R.rowInfo.ID);const K=e(""),N=e(""),P=e(""),W=e(""),X=e(!1),Y=[20,50,100],Z=e(0),q=e([]),E=()=>{C(B.value,F.value,G.value,K.value,N.value,P.value,W.value).then((e=>{q.value=e.data.list,Z.value=e.data.totalCount,X.value=!0}),(e=>{}))};a((()=>{E()}));const H=()=>{G.value="",K.value="",N.value="",P.value="",W.value=""},J=e=>{Z.value<=0||F.value*B.value>Z.value&&q.value.length>=Z.value||E()},L=e=>{E()};return(e,a)=>{const k=m,_=g,C=v,R=i,T=b,M=V,O=x,Q=y,$=w;return t(),l("div",{class:I(u(S)?"app-content1":"app-content")},[u(A)?(t(),l(s,{key:1},[u(X)?(t(),o($,{key:0},{default:r((()=>[d(R,{style:{"margin-bottom":"10px"}},{default:r((()=>[d(C,null,{default:r((()=>[!1===u(S)?(t(),o(k,{key:0,modelValue:u(G),"onUpdate:modelValue":a[0]||(a[0]=e=>c(G)?G.value=e:null),placeholder:"用户id",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:1,modelValue:u(K),"onUpdate:modelValue":a[1]||(a[1]=e=>c(K)?K.value=e:null),placeholder:"操作资源类型",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:2,modelValue:u(N),"onUpdate:modelValue":a[2]||(a[2]=e=>c(N)?N.value=e:null),placeholder:"操作资源组",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:3,modelValue:u(P),"onUpdate:modelValue":a[3]||(a[3]=e=>c(P)?P.value=e:null),placeholder:"操作对象",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:4,modelValue:u(W),"onUpdate:modelValue":a[4]||(a[4]=e=>c(W)?W.value=e:null),placeholder:"操作方法",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(_,{key:5,onClick:E,type:"primary",style:{"margin-right":"10px"}},{default:r((()=>a[7]||(a[7]=[h("条件搜索 ")]))),_:1})):p("",!0),!1===u(S)?(t(),o(_,{key:6,onClick:H},{default:r((()=>a[8]||(a[8]=[h("清空条件")]))),_:1})):p("",!0)])),_:1})])),_:1}),d(Q,null,{default:r((()=>[f("div",z,[f("div",j,[d(M,{data:u(q),style:{width:"100%"},"table-layout":"auto",stripe:"","tooltip-effect":"light"},{default:r((()=>[d(T,{prop:"userId",label:"用户id"}),d(T,{prop:"userName",label:"用户名"}),d(T,{prop:"opResourceType",label:"操作资源类型"}),d(T,{prop:"opResourceGroup",label:"操作资源组"}),d(T,{prop:"opResourceKey",label:"操作对象"}),d(T,{prop:"method",label:"操作方法"}),d(T,{prop:"createdAt",label:"创建时间"}),d(T,{prop:"detailInfo",label:"详情数据","show-overflow-tooltip":""})])),_:1},8,["data"])]),f("div",D,[d(O,{"current-page":u(B),"onUpdate:currentPage":a[5]||(a[5]=e=>c(B)?B.value=e:null),"page-size":u(F),"onUpdate:pageSize":a[6]||(a[6]=e=>c(F)?F.value=e:null),"page-sizes":Y,layout:"total, sizes, prev, pager, next, jumper",total:u(Z),onSizeChange:J,onCurrentChange:L},null,8,["current-page","page-size","total"])])])])),_:1})])),_:1})):p("",!0)],64)):(t(),o(n(U),{key:0}))],2)}}},[["__scopeId","data-v-926d7759"]]);export{R as t};

View File

@ -0,0 +1 @@
import{t as s}from"./history-CNMnPJn_.js";import{c as o,o as t,B as e}from"./vendor-B2m3dX6z.js";import"./index-hOIgOejC.js";import"./empty-CvrMoGrV.js";const i={__name:"history",setup:i=>(i,r)=>(t(),o(e(s),{disableConditionInput:false}))};export{i as default};

View File

@ -0,0 +1 @@
import{r as e,T as a,a as l,o as t,c as o,u,B as n,F as s,U as p,w as r,b as d,V as i,a7 as v,a3 as m,a8 as c,W as g,v as h,C as y,d as f,X as V,Y as b,Z as x,D as w,a9 as I}from"./vendor-B2m3dX6z.js";import{_ as k,u as _,a as C}from"./index-hOIgOejC.js";import{e as U}from"./empty-CvrMoGrV.js";const z={class:"table-content"},j={class:"table"},D={class:"pagination-container"},R=k({__name:"history",props:{rowInfo:{},disableConditionInput:!0},setup(k){const R=k;let S=!0;!1===R.disableConditionInput&&(S=!1);const T="admin"===_().userInfo.character,A=e(T),B=e(1),F=e(20),G=e(R.userId);R.rowInfo&&void 0!==R.rowInfo.ID&&(G.value=R.rowInfo.ID);const K=e(""),N=e(""),P=e(""),W=e(""),X=e(!1),Y=[20,50,100],Z=e(0),q=e([]),E=()=>{C(B.value,F.value,G.value,K.value,N.value,P.value,W.value).then((e=>{q.value=e.data.list,Z.value=e.data.totalCount,X.value=!0}),(e=>{}))};a((()=>{E()}));const H=()=>{G.value="",K.value="",N.value="",P.value="",W.value=""},J=e=>{Z.value<=0||F.value*B.value>Z.value&&q.value.length>=Z.value||E()},L=e=>{E()};return(e,a)=>{const k=m,_=g,C=v,R=i,T=b,M=V,O=x,Q=y,$=w;return t(),l("div",{class:I(u(S)?"app-content1":"app-content")},[u(A)?(t(),l(s,{key:1},[u(X)?(t(),o($,{key:0},{default:r((()=>[d(R,{style:{"margin-bottom":"10px"}},{default:r((()=>[d(C,null,{default:r((()=>[!1===u(S)?(t(),o(k,{key:0,modelValue:u(G),"onUpdate:modelValue":a[0]||(a[0]=e=>c(G)?G.value=e:null),placeholder:"用户id",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:1,modelValue:u(K),"onUpdate:modelValue":a[1]||(a[1]=e=>c(K)?K.value=e:null),placeholder:"操作资源类型",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:2,modelValue:u(N),"onUpdate:modelValue":a[2]||(a[2]=e=>c(N)?N.value=e:null),placeholder:"操作资源组",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:3,modelValue:u(P),"onUpdate:modelValue":a[3]||(a[3]=e=>c(P)?P.value=e:null),placeholder:"操作对象",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(k,{key:4,modelValue:u(W),"onUpdate:modelValue":a[4]||(a[4]=e=>c(W)?W.value=e:null),placeholder:"操作方法",style:{width:"150px","margin-right":"10px"}},null,8,["modelValue"])):p("",!0),!1===u(S)?(t(),o(_,{key:5,onClick:E,type:"primary",style:{"margin-right":"10px"}},{default:r((()=>a[7]||(a[7]=[h("条件搜索 ")]))),_:1})):p("",!0),!1===u(S)?(t(),o(_,{key:6,onClick:H},{default:r((()=>a[8]||(a[8]=[h("清空条件")]))),_:1})):p("",!0)])),_:1})])),_:1}),d(Q,null,{default:r((()=>[f("div",z,[f("div",j,[d(M,{data:u(q),style:{width:"100%"},"table-layout":"auto",stripe:"","tooltip-effect":"light"},{default:r((()=>[d(T,{prop:"userId",label:"用户id"}),d(T,{prop:"userName",label:"用户名"}),d(T,{prop:"opResourceType",label:"操作资源类型"}),d(T,{prop:"opResourceGroup",label:"操作资源组"}),d(T,{prop:"opResourceKey",label:"操作对象"}),d(T,{prop:"method",label:"操作方法"}),d(T,{prop:"createdAt",label:"创建时间"}),d(T,{prop:"detailInfo",label:"详情数据","show-overflow-tooltip":""})])),_:1},8,["data"])]),f("div",D,[d(O,{"current-page":u(B),"onUpdate:currentPage":a[5]||(a[5]=e=>c(B)?B.value=e:null),"page-size":u(F),"onUpdate:pageSize":a[6]||(a[6]=e=>c(F)?F.value=e:null),"page-sizes":Y,layout:"total, sizes, prev, pager, next, jumper",total:u(Z),onSizeChange:J,onCurrentChange:L},null,8,["current-page","page-size","total"])])])])),_:1})])),_:1})):p("",!0)],64)):(t(),o(n(U),{key:0}))],2)}}},[["__scopeId","data-v-926d7759"]]);export{R as t};

View File

@ -0,0 +1 @@
import{t as s}from"./history-BxcsGH8g.js";import{c as o,o as t,B as i}from"./vendor-CF1QNs3T.js";import"./index-Cirxlp2u.js";import"./empty-BXuh8c50.js";const r={__name:"history",setup:r=>(r,a)=>(t(),o(i(s),{disableConditionInput:false}))};export{r as default};

View File

@ -0,0 +1 @@
import{i as a,c as e,o as s,w as n,a as o,F as t,z as l,u as r,y as d,A as i,v as u,t as c,d as h,x as p}from"./vendor-CF1QNs3T.js";import{L as m}from"./index-Cirxlp2u.js";const f={__name:"horizonMenu",setup(f){const x=a(),_=m.getCache("resource");console.log("analyse route info:",_);return(a,m)=>{const f=i,v=d,g=p;return s(),e(g,{mode:"horizontal"},{default:n((()=>[(s(!0),o(t,null,l(r(_).children,(a=>(s(),e(v,{index:a.path},{title:n((()=>[h("span",null,c(a.meta.desc),1)])),default:n((()=>[(s(!0),o(t,null,l(a.children,(a=>(s(),e(f,{key:a.path,index:a.path,onClick:e=>{return s=a,console.log("点击资源:",s),void x.push({path:s.path});var s}},{default:n((()=>[u(c(a.meta.desc),1)])),_:2},1032,["index","onClick"])))),128))])),_:2},1032,["index"])))),256))])),_:1})}}};export{f as default};

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/metricSelect-xWFI__Zh.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css","static/css/metricSelect-NSGkGZUF.css","static/js/groupBySelect-Daf0BFVy.js","static/css/groupBySelect-CFOi4zHL.css","static/js/propertiesConditionFilter-jk57-h2L.js"])))=>i.map(i=>d[i]);
import{_ as e,b as a}from"./index-Cirxlp2u.js";import{r as t,T as l,l as s,a as i,o as n,d as o,b as r,w as d,aj as p,a7 as u,W as _,p as f,u as y,ak as m,F as c,z as h,c as g,ad as T}from"./vendor-CF1QNs3T.js";const v={class:"editorAreaOuter"},x={class:"editorAreaInner"},b=e({__name:"index",setup(e){const b=T((()=>a((()=>import("./metricSelect-xWFI__Zh.js")),__vite__mapDeps([0,1,2,3,4,5])))),j=T((()=>a((()=>import("./groupBySelect-Daf0BFVy.js")),__vite__mapDeps([6,1,2,3,4,7])))),B=T((()=>a((()=>import("./propertiesConditionFilter-jk57-h2L.js")),__vite__mapDeps([8,3,1,2,4])))),D={userProperties:[{name:"account_id",alias:"账户id",propertyType:2},{name:"account_name",alias:"账户名",propertyType:2},{name:"role_id",alias:"角色id",propertyType:2},{name:"server_id",alias:"服务器id",propertyType:2},{name:"currency_coin",alias:"金币数",propertyType:1}],eventDescList:[{name:"role_login",alias:"角色登录",fields:[{name:"sign_day",alias:"签到天数",propertyType:1}]},{name:"item_change",alias:"item_change",fields:[{name:"item_id",alias:"item_id",propertyType:1},{name:"item_name",alias:"item_name",propertyType:2},{name:"num_before",alias:"num_before",propertyType:1},{name:"num_after",alias:"num_after",propertyType:1},{name:"delta",alias:"delta",propertyType:1}]},{name:"role_logout",alias:"角色登出",fields:[{name:"online_duration",alias:"在线时长",propertyType:1}]}]},R=t(0),w=t([]),A=()=>{const e=R.value+1;R.value+=e,w.value.push(e)},k=e=>{w.value.splice(w.value.indexOf(e),1)},E=t(null),z=()=>{E.value&&E.value.onAddNode()},I=t(0),O=t([]),P=()=>{const e=I.value+1;I.value+=e,O.value.push(e)};return l((()=>{A()})),(e,a)=>{const t=p,l=s("Plus"),T=f,R=_,I=u;return n(),i("div",v,[o("div",x,[r(I,{style:{height:"40px"},align:"middle"},{default:d((()=>[r(t,{span:6},{default:d((()=>a[0]||(a[0]=[o("span",{style:{"font-weight":"bold"}}," 分析指标 ",-1)]))),_:1}),r(t,{span:10,offset:8},{default:d((()=>[r(I,{justify:"end"},{default:d((()=>[r(R,{class:"editorTopRightToolBarBtn",onClick:A},{default:d((()=>[r(T,{size:20},{default:d((()=>[r(l)])),_:1})])),_:1}),r(R,{class:"editorTopRightToolBarBtn"},{default:d((()=>[r(y(m),{style:{"font-size":"20px"}})])),_:1})])),_:1})])),_:1})])),_:1}),r(I,{style:{width:"100%","min-height":"70px"}},{default:d((()=>[(n(!0),i(c,null,h(w.value,((e,a)=>(n(),g(y(b),{key:e,index:e,canDelete:w.value.length>1,onDeleteMetricSelect:k,eventAllData:D},null,8,["index","canDelete"])))),128))])),_:1}),r(I,{style:{height:"30px"}}),r(I,{style:{height:"40px"},align:"middle"},{default:d((()=>[r(t,{span:6},{default:d((()=>a[1]||(a[1]=[o("span",{style:{"font-weight":"bold"}}," 全局筛选 ",-1)]))),_:1}),r(t,{span:10,offset:8},{default:d((()=>[r(I,{justify:"end"},{default:d((()=>[r(R,{class:"editorTopRightToolBarBtn",onClick:z},{default:d((()=>[r(T,{size:20},{default:d((()=>[r(l)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(I,{style:{width:"200%","min-height":"0px"}},{default:d((()=>[r(y(B),{ref_key:"globalFilterSelectRef",ref:E},null,512)])),_:1}),r(I,{style:{height:"1px"}}),r(I,{style:{height:"40px"},align:"middle"},{default:d((()=>[r(t,{span:6},{default:d((()=>a[2]||(a[2]=[o("span",{style:{"font-weight":"bold"}}," 分组项 ",-1)]))),_:1}),r(t,{span:10,offset:8},{default:d((()=>[r(I,{justify:"end"},{default:d((()=>[r(R,{class:"editorTopRightToolBarBtn",onClick:P},{default:d((()=>[r(T,{size:20},{default:d((()=>[r(l)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(I,{style:{width:"100%","min-height":"70px"}},{default:d((()=>[(n(!0),i(c,null,h(O.value,((e,a)=>(n(),g(y(j))))),256))])),_:1})])])}}},[["__scopeId","data-v-4d718c2b"]]);export{b as default};

View File

@ -0,0 +1 @@
import{i as s,j as a,l as e,c as t,o as i,w as o,C as r}from"./vendor-CF1QNs3T.js";import{_ as l}from"./index-Cirxlp2u.js";const n=l({__name:"index",setup:l=>(s(),a(),(s,a)=>{const l=e("router-view"),n=r;return i(),t(n,{class:"bi_main"},{default:o((()=>[(i(),t(l,{key:s.$route.fullPath,style:{display:"inline-block",height:"100%",width:"100%"}}))])),_:1})})},[["__scopeId","data-v-cf4b133f"]]);export{n as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/horizonMenu-sh-PYRTK.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css"])))=>i.map(i=>d[i]);
import{_ as s,b as a}from"./index-Cirxlp2u.js";import{i as o,c as e,o as r,w as t,b as _,u as n,ad as d,V as i}from"./vendor-CF1QNs3T.js";const c=s({__name:"index",setup(s){o();const c=d((()=>a((()=>import("./horizonMenu-sh-PYRTK.js")),__vite__mapDeps([0,1,2,3,4]))));return(s,a)=>{const o=i;return r(),e(o,{class:"bi_header"},{default:t((()=>[_(n(c))])),_:1})}}},[["__scopeId","data-v-cd726624"]]);export{c as default};

View File

@ -0,0 +1 @@
import{r as e,k as l,l as a,a as t,o as i,b as o,w as n,a7 as s,W as u,p as r,d as p}from"./vendor-CF1QNs3T.js";import{_ as d}from"./index-Cirxlp2u.js";const v={class:"editorOperationArea"},c=d({__name:"metricSelect",props:{index:0,canDelete:!0,onDeleteMetricSelect:null,eventAllData:{}},setup(d){const c=d.eventAllData,f=e(""),h=e([]);c.eventDescList.forEach((e=>{let l={value:e.name,label:e.name};void 0!==e.alias&&""!==e.alias&&(l.label=e.alias),h.value.push(l)})),f.value=h.value[0].label;const g=e({}),b={label:"预置指标",options:[{value:"totalCount",label:"总次数",opList:[]},{value:"triggerUserCount",label:"触发用户数",opList:[]},{value:"userAvgCount",label:"人均次数",opList:[]}]},y=["总和","均值","人均值","中位数","最大值","最小值","去重数","方差","标准差","99分位数","95分位数","90分位数","85分位数","80分位数","75分位数","70分位数","60分位数","50分位数","40分位数","30分位数","20分位数","10分位数","5分位数"],m=["totalCount","avg","avgPerUser","median","max","min","distinct","variance","standardDeviation","99qualtile","95qualtile","90qualtile","85qualtile","80qualtile","75qualtile","70qualtile","60qualtile","50qualtile","40qualtile","30qualtile","20qualtile","10qualtile","5qualtile"],w=[],x=[{value:"distinct",label:"去重数"}];for(let e=0;e<y.length;e++)w.push({value:m[e],label:y[e]});const q=e(""),_=e(!0),D=l((()=>{const e=c.eventDescList.find(((e,l)=>e.alias===f.value));if(!e)return[b];g.value=e;let l={label:"用户属性",options:[]},a={label:"事件属性",options:[]};return e.fields.forEach((e=>{let l=[];1===e.propertyType?l=w:2===e.propertyType&&(l=x),a.options.push({value:e.name,label:e.alias,opList:l})})),c.userProperties.forEach((e=>{let a=[];1===e.propertyType?a=w:2===e.propertyType&&(a=x),l.options.push({value:e.name,label:e.alias,opList:a})})),[b,a,l]})),C=e(""),L=l((()=>{let e=[];return D.value.find(((l,a)=>{const t=l.options.find(((e,l)=>e.value===q.value));return!!t&&(e=t.opList,!0)})),C.value="",_.value=0===e.length,e})),A=e=>{},T=(e,l)=>l.value.filter((l=>l.options&&l.options.length>0?l.options.filter((l=>l.includes(e))):l.label.includes(e)));return f.value,(e,l)=>{const c=a("Delete"),g=r,b=u,y=a("a-space"),m=s,w=a("a-select");return i(),t("div",v,[o(m,null,{default:n((()=>[o(m,null,{default:n((()=>[o(m,{justify:"end",style:{width:"100%"}},{default:n((()=>[o(y,{align:"end",style:{float:"right"}},{default:n((()=>[o(b,{class:"editorTopRightToolBarBtn",disabled:!d.canDelete,onClick:l[0]||(l[0]=e=>d.onDeleteMetricSelect(d.index))},{default:n((()=>[o(g,{size:20},{default:n((()=>[o(c)])),_:1})])),_:1},8,["disabled"])])),_:1})])),_:1}),o(y,{size:5},{default:n((()=>[o(w,{showArrow:"","show-search":!0,value:f.value,"onUpdate:value":l[1]||(l[1]=e=>f.value=e),options:h.value,onChange:A,"filter-option":T,style:{width:"100px",margin:"0"}},null,8,["value","options"]),l[6]||(l[6]=p("div",{style:{"background-color":"#202241","border-radius":"5px",width:"25px",height:"25px",display:"flex","justify-content":"center","align-items":"center"}},[p("p",{style:{color:"white",margin:"0"}},"的")],-1)),o(w,{showArrow:"","show-search":"",value:q.value,"onUpdate:value":l[2]||(l[2]=e=>q.value=e),options:D.value,"filter-option":T,onChange:l[3]||(l[3]=()=>{}),style:{width:"100px",margin:"0"}},null,8,["value","options"]),l[7]||(l[7]=p("div",{style:{height:"100%",display:"inline-flex","flex-direction":"column","justify-content":"end"}},[p("p",{style:{color:"black","font-weight":"bold","font-size":"20px",margin:"0"}},"·")],-1)),o(w,{showArrow:"",disabled:_.value,value:C.value,"onUpdate:value":l[4]||(l[4]=e=>C.value=e),"filter-option":T,options:L.value,onChange:l[5]||(l[5]=()=>{}),style:{width:"100px",margin:"0"}},null,8,["disabled","value","options"])])),_:1})])),_:1})])),_:1})])}}},[["__scopeId","data-v-f344ede9"]]);export{c as default};

View File

@ -0,0 +1 @@
import{t as e}from"./table-DW29WmLl.js";import{L as s,u as r,c as t}from"./index-Cirxlp2u.js";import{i as a,a as o,o as m,c,B as p}from"./vendor-CF1QNs3T.js";import"./resource-DYLEDGDb.js";import"./empty-BXuh8c50.js";const i={__name:"project",setup(i){s.setCache("project",{}),a();let n=t;return"admin"!==r().userInfo.character&&(n.meta.methods={}),s.setCache("resource",n),(s,r)=>(m(),o("div",null,[(m(),c(p(e)))]))}};export{i as default};

View File

@ -0,0 +1 @@
import{t as e}from"./table-CdyUIl0m.js";import{L as s,u as a,c as r}from"./index-hOIgOejC.js";import{i as t,a as o,o as m,c,B as p}from"./vendor-B2m3dX6z.js";import"./resource-D0hLzgq7.js";import"./empty-CvrMoGrV.js";const i={__name:"project",setup(i){s.setCache("project",{}),t();let n=r;return"admin"!==a().userInfo.character&&(n.meta.methods={}),s.setCache("resource",n),(s,a)=>(m(),o("div",null,[(m(),c(p(e)))]))}};export{i as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/propertyConditionType-C_wkZjzO.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-Cirxlp2u.js","static/css/index-BqAGgcXq.css","static/css/propertyConditionType-NSBzD7rw.css","static/js/propertyConditionFilter-Dksag3Ur.js","static/css/propertyConditionFilter-CwW-c0Ha.css"])))=>i.map(i=>d[i]);
import{b as e}from"./index-Cirxlp2u.js";import{S as n,r,c as i,o as d,ad as l,u as o,ao as t}from"./vendor-CF1QNs3T.js";const p={__name:"propertiesConditionFilter",setup(p,{expose:s}){const c=l((()=>e((()=>import("./propertyConditionType-C_wkZjzO.js")),__vite__mapDeps([0,1,2,3,4,5])))),h=l((()=>e((()=>import("./propertyConditionFilter-Dksag3Ur.js")),__vite__mapDeps([6,1,2,3,4,7])))),u=n({}),a=(e,n)=>{const r=JSON.parse(JSON.stringify(e));n.nodeType=r.nodeType,n.id=r.id,n.children=r.children,n.propertyInfo=r.propertyInfo},f=e=>{if(null===e)return null;if(""!==e.nodeType){if(0===e.children.length)return null;let n=0;for(;!(n>=e.children.length);){let r=e.children[n],i=f(r);null!==i?(e.children[n]=i,n++):e.children.splice(n,1)}1===e.children.length&&a(e.children[0],e)}return e},y=r(0),T=()=>(y.value+=1,y.value),_=e=>{if(null!==e)return e.id=T(),""!==e.nodeType&&e.children.forEach(((n,r)=>{e.children[r]=_(n)})),e},m=(e,n,r,i,d)=>{if(n.id===i)return d(e,n,r),!0;if(""===n.nodeType)return!1;for(let l=0;l<n.children.length;l++){const e=n.children[l];if(m(l,e,n,i,d))return!0}return!1},N=()=>({nodeType:"",id:T(),propertyInfo:{name:"",alias:"",cond:"",value1:"",value2:""},children:[]}),S=e=>{m(0,u,null,e,((e,n,r)=>{if(null===r){const e=JSON.parse(JSON.stringify(n));u.nodeType="and",u.id=e.id,u.children=[t(e),N()]}else r.children.push(N())})),f(u),_(u)};s({onAddNode:()=>{if(void 0===u.nodeType){const e=N();a(e,u)}else""===u.nodeType?S(u.id):u.children.push(N());f(u),_(u)}});const v={showComp:h,onSplitNode:e=>{m(0,u,null,e,((e,n,r)=>{if(null===r){const e=JSON.parse(JSON.stringify(n));u.nodeType="and",u.id=e.id,u.children=[t(e),N()]}else r.children[e]={nodeType:"and",id:T(),children:[n,N()]}})),f(u),_(u)},onAddBrother:S,onDeleteNode:e=>{m(0,u,null,e,((e,n,r)=>{null===r?(u.nodeType=void 0,u.children=[],u.id=void 0):r.children.splice(e,1)})),f(u),_(u)}};return(e,n)=>(d(),i(o(c),{node:o(u),propertyShowHandlerInfo:v},null,8,["node"]))}};export{p as default};

View File

@ -0,0 +1 @@
import{r as e,l,a as o,o as t,b as a,w as n,F as r,z as p,u as s,c as u,a8 as i,E as d,W as c,ap as f,p as v}from"./vendor-CF1QNs3T.js";import{_ as m}from"./index-Cirxlp2u.js";const y=m({__name:"propertyConditionFilter",props:{propertyHandlerInfo:{propertyInfo:{},onSplitNode:null,onAddBrother:null,onDeleteNode:null}},setup(m){const y=e([{label:"用户属性",options:[{value:"account_id",label:"游戏账号",meta:{propertyType:2}},{value:"role_id",label:"角色id",meta:{propertyType:2}},{value:"role_name",label:"角色名",meta:{propertyType:2}}]},{label:"事件属性",options:[{value:"item_id",label:"道具id",meta:{propertyType:2}},{value:"item_name",label:"道具名",meta:{propertyType:2}},{value:"cur_num",label:"cur_num",meta:{propertyType:2}}]}]),h=[["等于","不等于","小于","小于等于","大于","大于等于","有值","无值","区间"],["eq","ne","st","se","gt","ge","valued","valueless","range"]],_=[["等于","不等于","包括","不包括","有值","无值","正则匹配","正则不匹配"],["eq","ne","contain","exclusive","regmatch","regnotmatch"]],b=e([]),g=e([]);h[0].forEach(((e,l)=>{b.value.push({value:h[1][l],label:h[0][l]})})),_[0].forEach(((e,l)=>{g.value.push({value:_[1][l],label:_[0][l]})}));const w=(e,l)=>l.value.filter((l=>l.options&&l.options.length>0?l.options.filter((l=>l.includes(e))):l.label.includes(e))),I=e(""),T=e(""),x=e([]),C=(e,l)=>{console.log("select value:",e,l)};return(e,h)=>{const _=l("a-select-option"),g=l("a-select-opt-group"),H=l("a-select"),A=c,B=d,z=l("CirclePlus"),N=v,k=l("Delete"),D=l("a-space");return t(),o("div",null,[a(H,{showArrow:"","show-search":"",value:s(I),"onUpdate:value":h[0]||(h[0]=e=>i(I)?I.value=e:null),options:s(y),"filter-option":w,onSelect:C,style:{width:"100px",margin:"0"}},{default:n((()=>[(t(!0),o(r,null,p(s(y),(e=>(t(),u(g,{label:e.label},{default:n((()=>[(t(!0),o(r,null,p(e.options,(e=>(t(),u(_,{value:e,label:e.label},null,8,["value","label"])))),256))])),_:2},1032,["label"])))),256))])),_:1},8,["value","options"]),a(H,{showArrow:"",value:s(T),"onUpdate:value":h[1]||(h[1]=e=>i(T)?T.value=e:null),options:s(b),onChange:h[2]||(h[2]=()=>{}),style:{width:"70px",margin:"0"}},null,8,["value","options"]),a(H,{showArrow:"","show-search":"",mode:"multiple",value:s(x),"onUpdate:value":h[3]||(h[3]=e=>i(x)?x.value=e:null),options:s(b),onChange:h[4]||(h[4]=()=>{}),style:{width:"80px",margin:"0 5px 0 0"}},null,8,["value","options"]),a(D,{size:2},{default:n((()=>[a(B,{effect:"light",content:"裂变",placement:"top"},{default:n((()=>[a(A,{class:"filterToolBtn",onClick:h[5]||(h[5]=e=>m.propertyHandlerInfo.onSplitNode(m.propertyHandlerInfo.propertyInfo.id))},{default:n((()=>[a(s(f),{style:{transform:"rotate(90deg)"}})])),_:1})])),_:1}),a(B,{effect:"light",content:"增加平行节点",placement:"top"},{default:n((()=>[a(A,{class:"filterToolBtn",onClick:h[6]||(h[6]=e=>m.propertyHandlerInfo.onAddBrother(m.propertyHandlerInfo.propertyInfo.id))},{default:n((()=>[a(N,{size:16},{default:n((()=>[a(z)])),_:1})])),_:1})])),_:1}),a(B,{effect:"light",content:"删除",placement:"top"},{default:n((()=>[a(A,{class:"filterToolBtn",onClick:h[7]||(h[7]=e=>m.propertyHandlerInfo.onDeleteNode(m.propertyHandlerInfo.propertyInfo.id))},{default:n((()=>[a(N,{size:16},{default:n((()=>[a(k)])),_:1})])),_:1})])),_:1})])),_:1})])}}},[["__scopeId","data-v-57807f7e"]]);export{y as default};

View File

@ -0,0 +1 @@
import{l as e,c as o,U as n,o as d,w as r,d as a,b as l,W as p,a as t,F as s,z as y,a7 as i,B as f}from"./vendor-CF1QNs3T.js";import{_ as c}from"./index-Cirxlp2u.js";const h={class:"andOrArea"},u={key:0},I={key:1},w={style:{display:"inline-flex","flex-direction":"column"}},v={key:0,style:{width:"100%",height:"5px"}},H=c({__name:"propertyConditionType",props:{node:{},propertyShowHandlerInfo:{}},setup(c){const H=c;return(S,T)=>{const _=p,m=e("PropertyConditionType",!0),k=i;return void 0!==c.node.nodeType&&""!==c.node.nodeType?(d(),o(k,{key:0,class:"treeNodeArea"},{default:r((()=>[a("div",h,[T[1]||(T[1]=a("div",{class:"andOrWrapLine"},null,-1)),l(_,{class:"andOrBtn",onClick:T[0]||(T[0]=e=>{var o;"and"===(o=c.node).nodeType?o.nodeType="or":o.nodeType="and"})},{default:r((()=>["and"===c.node.nodeType?(d(),t("p",u,"与")):"or"===c.node.nodeType?(d(),t("p",I,"或")):n("",!0)])),_:1}),T[2]||(T[2]=a("div",{class:"andOrWrapLine"},null,-1))]),a("div",w,[(d(!0),t(s,null,y(c.node.children,((e,o)=>(d(),t(s,null,[l(m,{node:e,propertyShowHandlerInfo:c.propertyShowHandlerInfo},null,8,["node","propertyShowHandlerInfo"]),o!==c.node.children.length-1?(d(),t("div",v)):n("",!0)],64)))),256))])])),_:1})):void 0!==c.node.nodeType?(d(),o(k,{key:1,class:"selectNodeArea"},{default:r((()=>[(d(),o(f(c.propertyShowHandlerInfo.showComp),{style:{float:"right"},propertyHandlerInfo:{propertyInfo:c.node,onSplitNode:H.propertyShowHandlerInfo.onSplitNode,onAddBrother:H.propertyShowHandlerInfo.onAddBrother,onDeleteNode:H.propertyShowHandlerInfo.onDeleteNode}},null,8,["propertyHandlerInfo"]))])),_:1})):n("",!0)}}},[["__scopeId","data-v-ac96b3b4"]]);export{H as default};

View File

@ -0,0 +1 @@
import{s as t}from"./index-hOIgOejC.js";function r(r,e){return t({url:r,method:"get",params:e})}function e(r,e){return t({url:r,method:"post",data:{dto:e}})}function o(r,e){return t({url:r,method:"put",data:{dto:e}})}function n(r,e){return t({url:r,method:"delete",data:e})}function u(r,e){return t({url:r+"/selection",method:"post",data:e})}function a(r){return t({url:"/project/"+r.toString()+"/items",method:"get"})}export{n as a,e as b,o as c,a as d,u as e,r};

View File

@ -0,0 +1 @@
import{s as t}from"./index-Cirxlp2u.js";function r(r,e){return t({url:r,method:"get",params:e})}function e(r,e){return t({url:r,method:"post",data:{dto:e}})}function o(r,e){return t({url:r,method:"put",data:{dto:e}})}function n(r,e){return t({url:r,method:"delete",data:e})}function u(r,e){return t({url:r+"/selection",method:"post",data:e})}function a(r){return t({url:"/project/"+r.toString()+"/items",method:"get"})}export{n as a,e as b,o as c,a as d,u as e,r};

View File

@ -0,0 +1 @@
import{_ as r}from"./index-Cirxlp2u.js";import"./vendor-CF1QNs3T.js";const e=r({},[["render",function(r,e){return" 留存分析 "}]]);export{e as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{t as e}from"./tableUser-CoV5BUx7.js";import{u as s,L as r}from"./index-hOIgOejC.js";import{t}from"./history-CNMnPJn_.js";import{a as o,o as a,c,B as m}from"./vendor-B2m3dX6z.js";import"./resource-D0hLzgq7.js";import"./empty-CvrMoGrV.js";const u={__name:"user",setup(u){let n={meta:{desc:"user",resource:"user",resource_url:"/resource/user",methods:{get:!0,post:!0,put:!0,delete:!0}}};"admin"!==s().userInfo.character&&(n.meta.methods={}),r.setCache("resource",n);const p=[];return p.push({key:"user:exec:history",name:"执行记录",btn_color_type:"info",btn_type:1,btn_callback_component:t}),(s,r)=>(a(),o("div",null,[(a(),c(m(e),{rowClickDialogBtns:p}))]))}};export{u as default};

View File

@ -0,0 +1 @@
import{t as e}from"./tableUser-Dcsyh5oY.js";import{u as s,L as r}from"./index-Cirxlp2u.js";import{t}from"./history-BxcsGH8g.js";import{a as o,o as a,c as m,B as u}from"./vendor-CF1QNs3T.js";import"./resource-DYLEDGDb.js";import"./empty-BXuh8c50.js";const c={__name:"user",setup(c){let n={meta:{desc:"user",resource:"user",resource_url:"/resource/user",methods:{get:!0,post:!0,put:!0,delete:!0}}};"admin"!==s().userInfo.character&&(n.meta.methods={}),r.setCache("resource",n);const i=[];return i.push({key:"user:exec:history",name:"执行记录",btn_color_type:"info",btn_type:1,btn_callback_component:t}),(s,r)=>(a(),o("div",null,[(a(),m(u(e),{rowClickDialogBtns:i}))]))}};export{c as default};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{a as s,o as a,d as e,b as n,v as t,t as o,u as r,aa as p,F as l}from"./vendor-CF1QNs3T.js";import{u}from"./index-Cirxlp2u.js";const f={style:{"font-size":"40px"}},i={style:{color:"darkslategrey","font-size":"50px"}},m={__name:"welcome",setup(m){const c=u().userInfo;return(u,m)=>{const d=p;return a(),s(l,null,[e("span",f,[m[0]||(m[0]=t("亲爱的")),e("span",i,o(r(c).nick_name),1),m[1]||(m[1]=t("!欢迎使用本公司后台管理系统!"))]),n(d),m[2]||(m[2]=e("span",{style:{"font-size":"40px"}},"硬盘有价,数据无价,操作不规范,亲人两行泪。",-1))],64)}}};export{m as default};

View File

@ -0,0 +1 @@
import{a as s,o as a,d as e,b as n,v as t,t as o,u as r,aa as p,F as l}from"./vendor-B2m3dX6z.js";import{u}from"./index-hOIgOejC.js";const f={style:{"font-size":"40px"}},i={style:{color:"darkslategrey","font-size":"50px"}},m={__name:"welcome",setup(m){const c=u().userInfo;return(u,m)=>{const d=p;return a(),s(l,null,[e("span",f,[m[0]||(m[0]=t("亲爱的")),e("span",i,o(r(c).nick_name),1),m[1]||(m[1]=t("!欢迎使用本公司后台管理系统!"))]),n(d),m[2]||(m[2]=e("span",{style:{"font-size":"40px"}},"硬盘有价,数据无价,操作不规范,亲人两行泪。",-1))],64)}}};export{m as default};

Binary file not shown.

View File

@ -15,6 +15,7 @@ import empty from '@/components/restful/empty.vue';
import {getWhereConditionDesc} from "@/utils/string.js"; import {getWhereConditionDesc} from "@/utils/string.js";
import UserDetail from "@/components/game/userDetail.vue"; import UserDetail from "@/components/game/userDetail.vue";
import router from "@/router/index.js"; import router from "@/router/index.js";
import userStore from "@/stores/user.js";
const props = defineProps({ const props = defineProps({
rowClickDialogBtns: Array, rowClickDialogBtns: Array,
@ -206,6 +207,10 @@ onMounted(() => {
listData(); listData();
}) })
const curCharacter = userStore().userInfo.character
console.log("当前用户角色:", curCharacter)
const dialogAddVisible = ref(false) const dialogAddVisible = ref(false)
const dialogEditVisible = ref(false) const dialogEditVisible = ref(false)
const dialogAddFormRef = ref(null) const dialogAddFormRef = ref(null)
@ -395,19 +400,41 @@ const handleDelete = (index, row) => {
} }
function itemBagSelectChange() {
console.log("选择礼包:", selectedItemBag.value)
let hasValidInput = false
if (selectedItemBag.value != null) {
selectedItemBag.value.forEach(bag => {
if (bag.name !== undefined && bag.name !== '') {
bag.items.forEach((bagItem) => {
if (typeof dialogObjectForm.value.Attach === typeof "") {
dialogObjectForm.value.Attach = [];
}
let d = {id: bagItem.item_id, num: bagItem.item_num, desc: bagItem.desc, item_type: bagItem.item_type};
dialogObjectForm.value.Attach.push(d);
})
console.log("添加礼包:", bag)
hasValidInput = true;
}
})
}
// if (!hasValidInput) {
// console.log("", selectedItemBag.value)
// ElMessage('')
// }
if (dialogAddVisible.value) {
dialogAddFormRef.value.validateField("Attach");
} else if (dialogEditVisible.value) {
// console.log("", rules.value)
// console.log("", dialogEditFormRef.value)
dialogEditFormRef.value.validateField("Attach");
}
}
function addItem(fieldDescInfo) { function addItem(fieldDescInfo) {
let hasValidInput = false; let hasValidInput = false;
if (selectedItemBag.value != null && selectedItemBag.value.name !== undefined && selectedItemBag.value.name !== '') {
selectedItemBag.value.items.forEach((bagItem) => {
if (typeof dialogObjectForm.value.Attach === typeof "") {
dialogObjectForm.value.Attach = [];
}
let d = {id: bagItem.item_id, num: bagItem.item_num, desc: bagItem.desc, item_type: bagItem.item_type};
dialogObjectForm.value.Attach.push(d);
})
console.log("添加礼包:", selectedItemBag.value)
hasValidInput = true;
}
if (selectedItem.value !== null && selectedItem.value.value !== undefined && selectedItem.value.value !== '') { if (selectedItem.value !== null && selectedItem.value.value !== undefined && selectedItem.value.value !== '') {
if (selectedItemNum.value <= 0) { if (selectedItemNum.value <= 0) {
ElMessage('请输入有效道具数量!') ElMessage('请输入有效道具数量!')
@ -430,7 +457,6 @@ function addItem(fieldDescInfo) {
} }
if (!hasValidInput) { if (!hasValidInput) {
console.log("道具:", selectedItem.value) console.log("道具:", selectedItem.value)
console.log("礼包:", selectedItemBag.value)
ElMessage('请选择道具或者礼包!') ElMessage('请选择道具或者礼包!')
} }
@ -693,8 +719,21 @@ const handleGenRandAccount = () => {
</el-button> </el-button>
<template v-for="(btn, index) in rowClickBtns"> <template v-for="(btn, index) in rowClickBtns">
<template v-if="btn.btn_type === 0"> <!--直接发送选择行数据到服务器的按钮类型--> <template v-if="btn.btn_type === 0"> <!--直接发送选择行数据到服务器的按钮类型-->
<template v-if="scope.row['ReviewNeedCharacters'] !== undefined &&
scope.row['ReviewNeedCharacters'] !== null">
<el-button
:size="funcBtnSize"
:type="btn.btn_color_type"
@click="tableSelectRows2(btn, scope.$index, scope.row)"
v-if="scope.row['ReviewNeedCharacters'].includes(curCharacter) &&
scope.row['ReviewCheckStatus'] === 'pending'">
{{ btn.name }}
</el-button>
<div v-else/>
</template>
<el-button :size="funcBtnSize" :type="btn.btn_color_type" <el-button :size="funcBtnSize" :type="btn.btn_color_type"
@click="tableSelectRows2(btn, scope.$index, scope.row)"> @click="tableSelectRows2(btn, scope.$index, scope.row)" v-else>
{{ btn.name }} {{ btn.name }}
</el-button> </el-button>
</template> </template>
@ -753,32 +792,35 @@ const handleGenRandAccount = () => {
<el-form :inline="true" :model="selectedItem" label-position="right"> <el-form :inline="true" :model="selectedItem" label-position="right">
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key" label-width="130px"> <el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key" label-width="130px">
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start"> <el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
<el-select v-model="selectedItem" placeholder="--搜索道具--" style="width: 150px" <el-select v-model="selectedItem" placeholder="--搜索道具--" style="width: 200px"
filterable remote clearable filterable remote clearable
:remote-method="handleQueryItem" :remote-method="handleQueryItem"
:loading="loadingRemoteItems" :loading="loadingRemoteItems"
value-key="value" value-key="value"
> >
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc" <el-option v-for="info in itemChoices" :key="info.value" :label="info.desc+'('+info.value+')'"
:value="info"></el-option> :value="info"></el-option>
</el-select> </el-select>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="num"> <el-form-item label="数量" prop="num">
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 150px"/> <el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 100px"/>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
</el-form-item>
<!-- 选择礼包 --> <!-- 选择礼包 -->
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'"> <el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表"> <el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px" <el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
value-key="name"> value-key="name" multiple @blur="itemBagSelectChange">
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option> <el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
</el-select> </el-select>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
</el-form-item>
</el-form> </el-form>
<el-form-item label="奖励列表" prop="Attach"> <el-form-item label="奖励列表" prop="Attach">
<el-table :data="dialogObjectForm.Attach" border> <el-table :data="dialogObjectForm.Attach" border>
@ -875,36 +917,42 @@ const handleGenRandAccount = () => {
<!--如果是items类型就是物品下拉框+道具组合--> <!--如果是items类型就是物品下拉框+道具组合-->
<template v-if="(fieldDescInfo.type === 'items')"> <template v-if="(fieldDescInfo.type === 'items')">
<el-row>
<el-form :inline="true" :model="selectedItem" label-position="right" <el-form :inline="true" :model="selectedItem" label-position="right"
label-width="130px"> label-width="130px">
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key"> <el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key">
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start"> <el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
<el-select placeholder="--搜索道具--" v-model="selectedItem" style="width: 150px" <el-select placeholder="--搜索道具--" v-model="selectedItem" style="width: 200px"
filterable remote :remote-method="handleQueryItem" filterable remote :remote-method="handleQueryItem"
:loading="loadingRemoteItems" :loading="loadingRemoteItems"
value-key="value" value-key="value"
> >
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc" <el-option v-for="info in itemChoices" :key="info.value" :label="info.desc+'('+info.value+')'"
:value="info"></el-option> :value="info"></el-option>
</el-select> </el-select>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="number">
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 150px"/> <el-form-item label="数量" prop="number" label-width="40px">
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 100px"/>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
</el-form-item>
<!-- 选择礼包 --> <!-- 选择礼包 -->
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'"> <el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表"> <el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px" <el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
value-key="name"> value-key="name" multiple @blur="itemBagSelectChange">
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option> <el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
</el-select> </el-select>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
</el-form-item>
</el-form> </el-form>
</el-row>
<el-form-item label="奖励列表" prop="Attach"> <el-form-item label="奖励列表" prop="Attach">
<el-table :data="dialogObjectForm.Attach" border> <el-table :data="dialogObjectForm.Attach" border>
<el-table-column label="道具id" prop="id"/> <el-table-column label="道具id" prop="id"/>

View File

@ -258,10 +258,10 @@ const userStore = defineStore(
] ]
} }
projectRoute.children.push(biDashboardRoute) // projectRoute.children.push(biDashboardRoute)
projectRoute.children.push(biAnalyseRoute) // projectRoute.children.push(biAnalyseRoute)
this.pushDynamicRouteChildren(biDashboardRoute) // this.pushDynamicRouteChildren(biDashboardRoute)
this.pushDynamicRouteChildren(biAnalyseRoute) // this.pushDynamicRouteChildren(biAnalyseRoute)
// 添加游戏后台gm管理资源菜单 // 添加游戏后台gm管理资源菜单
const resourceList = project.resource_list const resourceList = project.resource_list
@ -285,17 +285,21 @@ const userStore = defineStore(
// if (resource.resource === 'cdkey') { // if (resource.resource === 'cdkey') {
// resourceRoute.component = () => import('@/views/project/project_cdkey.vue') // resourceRoute.component = () => import('@/views/project/project_cdkey.vue')
// } // }
let resourceHasAnyResourcePermission = false
resource.show_methods.forEach((method) => { resource.show_methods.forEach((method) => {
if (method == "get") { if (method === "get") {
projectHasAnyResourcePermission = true projectHasAnyResourcePermission = true
resourceHasAnyResourcePermission = true
} }
resourceRoute.meta.methods[method] = true resourceRoute.meta.methods[method] = true
}) })
// router.addRoute(projectRoute) // router.addRoute(projectRoute)
projectRoute.children.push(resourceRoute) if (resourceHasAnyResourcePermission) {
this.pushDynamicRouteChildren(resourceRoute) projectRoute.children.push(resourceRoute)
this.pushDynamicRouteChildren(resourceRoute)
}
// console.log("add resource route:", resourceRoute) // console.log("add resource route:", resourceRoute)
}) })