diff --git a/admin/apps/game/domain/comm_resource.go b/admin/apps/game/domain/comm_resource.go index 28fef26..1dd6564 100644 --- a/admin/apps/game/domain/comm_resource.go +++ b/admin/apps/game/domain/comm_resource.go @@ -22,9 +22,10 @@ import ( ) type CommonResourceService struct { - projectRepo repo.IProjectRepo - serverRepo repo.IServerRepo - noticeRepo repo.INoticeRepo + projectRepo repo.IProjectRepo + serverRepo repo.IServerRepo + noticeRepo repo.INoticeRepo + genAccountRepo repo.IGenAccountRepo } func (svc *CommonResourceService) initCommonResourcesRepo(db *gorm.DB) { @@ -70,15 +71,25 @@ func (svc *CommonResourceService) initCommonResourcesRepo(db *gorm.DB) { r(consts.ResourcesName_CDKey, "礼包码", repo.NewCommonResourceRepo(db, &model.CDKey{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete) r(consts.ResourcesName_ItemBag, "道具礼包", repo.NewCommonResourceRepo(db, &model.ItemBag{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Put|ShowMethod_Delete) + { + genAccountRepo := r(consts.ResourcesName_GenAccount, "登录白名单", repo.NewCommonResourceRepo(db, &model.GenAccount{}), ShowMethod_Get|ShowMethod_Post|ShowMethod_Delete) + genAccountRepo.GlobalBtns = []*ResourceBtnInfo{ + {&api.ResourceBtnInfo{Key: consts.BtnKeyGlobal_GenAccount_ExportAll, Name: "导出", BtnColorType: "warning"}, svc.handleGenAccountExport}, + } + genAccountRepo.RowBtns = []*ResourceBtnInfo{ + {&api.ResourceBtnInfo{Key: consts.BtnKeyGlobal_GenAccount_Export, Name: "导出", BtnColorType: "warning"}, svc.handleGenAccountExport}, + } + } //r(consts.ResourcesName_DevicePush, "设备推送(暂无)", repo.NewCommonResourceRepo(db, &model.DevicePush{}), ShowMethod_Get) } func NewCommonResourceService(db *gorm.DB) *CommonResourceService { svc := &CommonResourceService{ - projectRepo: repo.NewProjectRepo(db), - serverRepo: repo.NewServerRepo(db), - noticeRepo: repo.NewNoticeRepo(db), + projectRepo: repo.NewProjectRepo(db), + serverRepo: repo.NewServerRepo(db), + noticeRepo: repo.NewNoticeRepo(db), + genAccountRepo: repo.NewGenAccountRepo(db), } svc.initCommonResourcesRepo(db) svc.startEventSubscriber() @@ -238,6 +249,13 @@ func (svc *CommonResourceService) Create(projectId int, resource string, dtoObj } else { return projectEt, nil, errcode.New(errcode.ParamsInvalid, "account empty:%+v", dtoObj) } + } else if resource == consts.ResourcesName_GenAccount { + accountList, findAccount := dtoObj["AccountList"] + if findAccount { + list := strings.Split(accountList.(string), ",") + dtoObj["AccountNum"] = len(list) + } + newDtoObj, err = createOne(dtoObj) } else { newDtoObj, err = createOne(dtoObj) } diff --git a/admin/apps/game/domain/comm_resource_selection.go b/admin/apps/game/domain/comm_resource_selection.go index 4d81aac..eb8124f 100644 --- a/admin/apps/game/domain/comm_resource_selection.go +++ b/admin/apps/game/domain/comm_resource_selection.go @@ -3,7 +3,12 @@ package domain import ( "admin/apps/game/domain/entity" "admin/apps/game/domain/projects" + "admin/apps/game/model" dto2 "admin/internal/model/dto" + "bytes" + "fmt" + "strings" + "time" ) func (svc *CommonResourceService) handleServerUpOrDown(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { @@ -76,3 +81,45 @@ func (svc *CommonResourceService) handleNoticeEnable(projectEt *entity.Project, NeedRefresh: true, }, nil } + +func (svc *CommonResourceService) handleGenAccountExport(projectEt *entity.Project, resourceName string, params *dto2.CommonRowsSelectionReq) (*dto2.CommonRowsSelectionRsp, error) { + + fileContent := bytes.NewBuffer(nil) + + getContentFun := func(po *model.GenAccount) { + buf := bytes.NewBuffer(nil) + + accounts := strings.Split(po.AccountList, ",") + buf.WriteString(fmt.Sprintf("id:%v\n", po.ID)) + buf.WriteString(fmt.Sprintf("区服:%v\n", po.ServerConfID)) + buf.WriteString(fmt.Sprintf("创建时间:%v\n", po.CreatedAt.Format(time.DateTime))) + buf.WriteString(fmt.Sprintf("账号数量:%v\n", len(accounts))) + buf.WriteString(fmt.Sprintf("账号列表:\n")) + for _, account := range accounts { + buf.WriteString(fmt.Sprintf("%v\n", account)) + } + buf.WriteString(fmt.Sprintf("\n")) + fileContent.WriteString(buf.String()) + } + if len(params.Rows) == 0 { + poList, err := svc.genAccountRepo.ListAll(projectEt.GetProjectID()) + if err != nil { + return nil, err + } + for _, po := range poList { + getContentFun(po) + } + } else { + for _, dtoObj := range params.Rows { + et := new(entity.CommonResource).FromPo(&model.GenAccount{}).FromDto(dtoObj) + po := et.Po.(*model.GenAccount) + getContentFun(po) + } + } + + return &dto2.CommonRowsSelectionRsp{ + Msg: fileContent.String(), + NeedRefresh: false, + FileName: projectEt.GetProjectPo().Name + "-登录白名单账号列表.txt", + }, nil +} diff --git a/admin/apps/game/domain/projects/projects.go b/admin/apps/game/domain/projects/projects.go index 2966f7c..4dd264b 100644 --- a/admin/apps/game/domain/projects/projects.go +++ b/admin/apps/game/domain/projects/projects.go @@ -20,6 +20,7 @@ var projectsResourceHookMgr = map[string]map[string]any{ consts.ResourcesName_MailGlobal: &smdl.MailGlobalHook{}, // 所有角色走神魔大陆api直接获取 consts.ResourcesName_MailRole: &smdl.MailRoleHook{}, // 所有角色走神魔大陆api直接获取 consts.ResourcesName_WhiteList: &smdl.WhitelistHook{}, // 所有角色走神魔大陆api直接获取 + consts.ResourcesName_GenAccount: &smdl.GenAccountHook{}, // 所有角色走神魔大陆api直接获取 }, } diff --git a/admin/apps/game/domain/projects/smdl/gen_account.go b/admin/apps/game/domain/projects/smdl/gen_account.go new file mode 100644 index 0000000..8fc0afa --- /dev/null +++ b/admin/apps/game/domain/projects/smdl/gen_account.go @@ -0,0 +1,100 @@ +package smdl + +import ( + "admin/apps/game/domain/entity" + "admin/apps/game/model" + "admin/internal/errcode" + "admin/internal/model/dto" + "admin/lib/httpclient" + "admin/lib/xlog" + "net/url" + "strings" + "time" +) + +type GenAccountHook struct { +} + +func (hook *GenAccountHook) Create(projectInfo *entity.Project, resource string, dtoObj dto.CommonDtoValues) error { + alisrvAddr := projectInfo.GetApiAddr() + if alisrvAddr == "" { + return errcode.New(errcode.ServerError, "项目%v没有配置api服务器地址", projectInfo.Po.Name) + } + + et := (&entity.CommonResource{}).FromPo(&model.GenAccount{}).FromDto(dtoObj) + info := et.ToPo().(*model.GenAccount) + + // 扶持账号借用白名单表存储,懒得建表了 + params := &url.Values{} + params.Add("cmd_data", "OpWhitelist") + params.Add("type", "generate") + params.Add("op", "add") + params.Add("server", info.ServerConfID) + + accountList := strings.Split(info.AccountList, ",") + notifyFun := func() { + for _, account := range accountList { + params.Set("value", account) + rsp := make(map[string]any) + err := httpclient.Request(alisrvAddr+"/gm", "get", params, &rsp) + if err != nil { + err = errcode.New(errcode.ServerError, "发送登录白名单(生成账号)添加请求:%+v错误:%v", account, err) + xlog.Warnf("%v", err) + } else { + xlog.Infof("发送登录白名单(生成账号)添加请求:%+v成功", account) + } + } + } + + if len(accountList) >= 30 { + // 账号多就异步,不然卡死前端 + go notifyFun() + } else { + notifyFun() + } + + return nil +} + +func (hook *GenAccountHook) Delete(projectInfo *entity.Project, resource string, dtoObj dto.CommonDtoValues) error { + alisrvAddr := projectInfo.GetApiAddr() + if alisrvAddr == "" { + return errcode.New(errcode.ServerError, "项目%v没有配置api服务器地址", projectInfo.Po.Name) + } + + et := (&entity.CommonResource{}).FromPo(&model.GenAccount{}).FromDto(dtoObj) + info := et.ToPo().(*model.GenAccount) + + params := &url.Values{} + params.Add("cmd_data", "OpWhitelist") + params.Add("type", "generate") + params.Add("op", "remove") + params.Add("server", info.ServerConfID) + + accountList := strings.Split(info.AccountList, ",") + notifyFun := func() { + for _, account := range accountList { + params.Set("value", account) + rsp := make(map[string]any) + err := httpclient.Request(alisrvAddr+"/gm", "get", params, &rsp) + if err != nil { + err = errcode.New(errcode.ServerError, "发送登录白名单(生成账号)删除请求:%+v错误:%v", account, err) + xlog.Warnf("%v", err) + } else { + xlog.Infof("发送登录白名单(生成账号)删除请求:%+v成功", account) + } + } + } + + if len(accountList) >= 30 { + // 账号多就异步,不然卡死前端 + go func() { + notifyFun() + }() + time.Sleep(time.Second * 5) + } else { + notifyFun() + } + + return nil +} diff --git a/admin/apps/game/domain/repo/comm_resource.go b/admin/apps/game/domain/repo/comm_resource.go index 0c09200..d5417c8 100644 --- a/admin/apps/game/domain/repo/comm_resource.go +++ b/admin/apps/game/domain/repo/comm_resource.go @@ -238,7 +238,13 @@ func (repo *commonResourceRepoImpl) parseWhereConditions2Sql(conditions []*dto2. } } - switch field.Tag.Get("where") { + + tagWhere := field.Tag.Get("where") + condWhere := cond.Op + if condWhere == "" { + condWhere = tagWhere + } + switch condWhere { case "eq": if field.Tag.Get("type") == "[]string" && field.Tag.Get("multi_choice") == "true" { // eq也要查出来为空的 @@ -281,7 +287,6 @@ func (repo *commonResourceRepoImpl) parseWhereConditions2Sql(conditions []*dto2. whereClause = append(whereClause, fmt.Sprintf("`%v` >= ? and `%v` <= ?", dbFieldName, dbFieldName)) whereArgs = append(whereArgs, cond.Value1, cond.Value2) } - case "": default: panic(fmt.Errorf("unsupport where tag %v", field.Tag)) } diff --git a/admin/apps/game/domain/repo/gen_account.go b/admin/apps/game/domain/repo/gen_account.go new file mode 100644 index 0000000..6381715 --- /dev/null +++ b/admin/apps/game/domain/repo/gen_account.go @@ -0,0 +1,28 @@ +package repo + +import ( + "admin/apps/game/model" + "admin/internal/errcode" + "gorm.io/gorm" +) + +type IGenAccountRepo interface { + ListAll(projectId int) ([]*model.GenAccount, error) +} + +func NewGenAccountRepo(db *gorm.DB) IGenAccountRepo { + return &genAccountRepoImpl{db: db} +} + +type genAccountRepoImpl struct { + db *gorm.DB +} + +func (impl *genAccountRepoImpl) ListAll(projectId int) ([]*model.GenAccount, error) { + po := make([]*model.GenAccount, 0) + err := impl.db.Where("project_id = ?", projectId).Find(&po).Error + if err != nil { + return nil, errcode.New(errcode.ParamsInvalid, "list gen account error:%v", err) + } + return po, nil +} diff --git a/admin/apps/game/model/gen_account.go b/admin/apps/game/model/gen_account.go new file mode 100644 index 0000000..f55928f --- /dev/null +++ b/admin/apps/game/model/gen_account.go @@ -0,0 +1,34 @@ +package model + +import ( + "admin/internal/db" + "admin/internal/model/dto" + "time" +) + +func init() { + db.RegisterTableModels(GenAccount{}) +} + +type GenAccount struct { + ID int `gorm:"primarykey" readonly:"true"` + ProjectId int `gorm:"uniqueIndex:idx_account"` + ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_account;index:idx_server" name:"区服id" required:"true" choices:"GetChoiceServers" where:"eq"` + AccountNum int `name:"账号数量" readonly:"true"` + AccountList string `gorm:"type:longtext" name:"账号列表" type:"randAccount" desc:"用逗号标记多个" required:"true" big_column:"true"` + + CreatedAt time.Time `readonly:"true" where:"range"` + UpdatedAt time.Time `readonly:"true"` +} + +func (lm *GenAccount) TableName() string { + return "gen_account" +} + +func (m *GenAccount) GetId() int { + return m.ID +} + +func (m *GenAccount) GetChoiceServers(project *Project) []*dto.CommonDtoFieldChoice { + return getChoiceServers(project) +} diff --git a/admin/apps/game/model/server.go b/admin/apps/game/model/server.go index a720695..00f3ced 100644 --- a/admin/apps/game/model/server.go +++ b/admin/apps/game/model/server.go @@ -16,7 +16,7 @@ type Server struct { ID int `gorm:"primarykey" readonly:"true"` ProjectId int `gorm:"uniqueIndex:idx_server"` ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_server" name:"区服id" required:"true" uneditable:"true"` - Desc string `name:"描述"` + Desc string `name:"描述" required:"true"` ClientConnAddr string `name:"客户端连接地址" desc:"填 公网ip:公网端口" required:"true"` RunningStatus string `name:"进程运行状态" desc:"进程运行状态:未知、运行中、停止" readonly:"true" uneditable:"true" type:"tagStatus" choices:"GetRunningStatusChoices"` Ccu int `name:"实时在线" desc:"ccu" readonly:"true" uneditable:"true"` diff --git a/admin/apps/user/model/token.go b/admin/apps/user/model/token.go index 6c19fb3..6312f98 100644 --- a/admin/apps/user/model/token.go +++ b/admin/apps/user/model/token.go @@ -17,7 +17,7 @@ func init() { type Token struct { ID int `gorm:"primarykey" readonly:"true"` Token string `gorm:"type:varchar(256);index" required:"true"` - UserId int `gorm:"type:int(20);uniqueIndex:user" name:"用户id" readonly:"true"` + UserId int `gorm:"type:int(20);unique" name:"用户id" readonly:"true"` ExpireAt time.Time `name:"到期时间" readonly:"true"` CreatedAt time.Time `readonly:"true"` } diff --git a/admin/cmd/all_in_one/admin b/admin/cmd/all_in_one/admin index 7f2de05..e9bdd07 100755 Binary files a/admin/cmd/all_in_one/admin and b/admin/cmd/all_in_one/admin differ diff --git a/admin/cmd/all_in_one/build.sh b/admin/cmd/all_in_one/build.sh index 43c9bec..10c4adf 100755 --- a/admin/cmd/all_in_one/build.sh +++ b/admin/cmd/all_in_one/build.sh @@ -2,9 +2,9 @@ app="admin" img_prefix="harbor.devops.u.niu/mid-platform" -img_tag="2.0.0" +img_tag="2.0.1" go build -tags netgo -ldflags "-s -w" -trimpath -buildvcs=false -o $app echo "准备构建:$app" docker build -t $img_prefix/$app:$img_tag --file Dockerfile . -docker push $img_prefix/$app:$img_tag \ No newline at end of file +docker push $img_prefix/$app:$img_tag diff --git a/admin/internal/consts/consts.go b/admin/internal/consts/consts.go index fd5e42e..a2b4a6e 100644 --- a/admin/internal/consts/consts.go +++ b/admin/internal/consts/consts.go @@ -36,6 +36,7 @@ const ( ResourcesName_CDKey = "cdkey" ResourcesName_DevicePush = "device_push" ResourcesName_ItemBag = "item_bag" + ResourcesName_GenAccount = "gen_account" ) const ( @@ -58,14 +59,15 @@ const ( ) const ( - BtnKeyGlobal_Server_DownAll = "server:down:all" // 一键维护 - BtnKeyGlobal_Server_UpAll = "server:up:all" // 一键维护结束 - BtnKeyGlobal_Server_ExportCdn = "server:export:cdn" // 一键导出cdn - BtnKeyGlobal_Notice_DisableAll = "notice:disable:all" // 一键禁用 - BtnKeyGlobal_Notice_EnableAll = "notice:enable:all" // 一键启用 - BtnKeyGlobal_Notice_Disable = "notice:disable" // 禁用 - BtnKeyGlobal_Notice_Enable = "notice:enable" // 启用 - + BtnKeyGlobal_Server_DownAll = "server:down:all" // 一键维护 + BtnKeyGlobal_Server_UpAll = "server:up:all" // 一键维护结束 + BtnKeyGlobal_Server_ExportCdn = "server:export:cdn" // 一键导出cdn + BtnKeyGlobal_Notice_DisableAll = "notice:disable:all" // 一键禁用 + BtnKeyGlobal_Notice_EnableAll = "notice:enable:all" // 一键启用 + BtnKeyGlobal_Notice_Disable = "notice:disable" // 禁用 + BtnKeyGlobal_Notice_Enable = "notice:enable" // 启用 + BtnKeyGlobal_GenAccount_ExportAll = "gen_account:export:all" // 导出 + BtnKeyGlobal_GenAccount_Export = "gen_account:export" // 导出 ) const ( diff --git a/admin/ui/static/index.html b/admin/ui/static/index.html index 844bcf7..bc8ad16 100644 --- a/admin/ui/static/index.html +++ b/admin/ui/static/index.html @@ -5,7 +5,7 @@ Vite App - + diff --git a/admin/ui/static/static/css/analyseMetricEditorLayout-C535QVBW.css b/admin/ui/static/static/css/analyseMetricEditorLayout-C535QVBW.css new file mode 100644 index 0000000..de509e8 --- /dev/null +++ b/admin/ui/static/static/css/analyseMetricEditorLayout-C535QVBW.css @@ -0,0 +1 @@ +.clearfix[data-v-94c97751]:after{content:"";display:block;clear:both}.editorContainer[data-v-94c97751]{width:100%;height:100%;position:relative}.editorFinishArea[data-v-94c97751]{width:100%;height:60px;position:absolute;bottom:0;left:0;border-top:1px solid #dddddd;display:flex;align-items:center;justify-content:end}.editorFinishBtns[data-v-94c97751]{margin-right:10px}.editorOperationArea[data-v-94c97751]{width:100%;height:calc(100% - 60px);position:absolute;top:0;left:0} diff --git a/admin/ui/static/static/css/groupBySelect-CFOi4zHL.css b/admin/ui/static/static/css/groupBySelect-CFOi4zHL.css new file mode 100644 index 0000000..31dde7d --- /dev/null +++ b/admin/ui/static/static/css/groupBySelect-CFOi4zHL.css @@ -0,0 +1 @@ +.groupByOneArea[data-v-5cb43c01]{width:100%} diff --git a/admin/ui/static/static/css/index-B3tO-Skr.css b/admin/ui/static/static/css/index-B3tO-Skr.css new file mode 100644 index 0000000..198d55c --- /dev/null +++ b/admin/ui/static/static/css/index-B3tO-Skr.css @@ -0,0 +1 @@ +.editorTopRightToolBarBtn[data-v-4d718c2b]{margin:0;padding:0 8px;border:0}.editorAreaOuter[data-v-4d718c2b]{width:100%;height:100%;position:relative}.editorAreaInner[data-v-4d718c2b]{width:calc(100% - 30px);height:calc(100% - 10px);position:absolute;top:10px;left:15px} diff --git a/admin/ui/static/static/css/metricSelect-NSGkGZUF.css b/admin/ui/static/static/css/metricSelect-NSGkGZUF.css new file mode 100644 index 0000000..85a7fc7 --- /dev/null +++ b/admin/ui/static/static/css/metricSelect-NSGkGZUF.css @@ -0,0 +1 @@ +.editorTopRightToolBarBtn[data-v-f344ede9]{margin:0;padding:0 8px;border:0}.editorOperationArea[data-v-f344ede9]{height:100%;display:inline-flex;flex-direction:row;align-items:center;margin-bottom:5px;border-left:3px solid #202241;padding-left:5px} diff --git a/admin/ui/static/static/css/propertyConditionFilter-CwW-c0Ha.css b/admin/ui/static/static/css/propertyConditionFilter-CwW-c0Ha.css new file mode 100644 index 0000000..0eebeff --- /dev/null +++ b/admin/ui/static/static/css/propertyConditionFilter-CwW-c0Ha.css @@ -0,0 +1 @@ +.filterToolBtn[data-v-57807f7e]{margin:0;padding:0;border:0;width:20px;height:20px} diff --git a/admin/ui/static/static/css/propertyConditionType-NSBzD7rw.css b/admin/ui/static/static/css/propertyConditionType-NSBzD7rw.css new file mode 100644 index 0000000..1a6c7ce --- /dev/null +++ b/admin/ui/static/static/css/propertyConditionType-NSBzD7rw.css @@ -0,0 +1 @@ +.andOrArea[data-v-ac96b3b4]{width:40px;height:100%;display:inline-flex;flex-direction:column;justify-content:center;align-items:center}.andOrWrapLine[data-v-ac96b3b4]{width:1px;height:calc(50% - 13px);border-right:1px solid #d2d2d4;background-color:#d2d2d4}.andOrBtn[data-v-ac96b3b4]{width:25px;height:25px;margin:0;padding:0;border-radius:5px;border:1px solid #d2d2d4}.selectNodeArea[data-v-ac96b3b4]{width:100%} diff --git a/admin/ui/static/static/css/table-Cq-mWM91.css b/admin/ui/static/static/css/table-Cq-mWM91.css new file mode 100644 index 0000000..f2ee916 --- /dev/null +++ b/admin/ui/static/static/css/table-Cq-mWM91.css @@ -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-45466dde]{height:calc(100vh - 100px);display:flex}.app-content .table-content[data-v-45466dde]{display:flex;flex-direction:column;justify-content:space-between;height:100%;overflow:auto}.app-content .table-content .table[data-v-45466dde]{flex:1;position:relative}.app-content .table-content .table[data-v-45466dde] .el-table{flex:1;position:absolute}.app-content .table-content .table[data-v-45466dde] .el-popper{max-width:640px;word-break:break-all}.pagination-container .el-pagination[data-v-45466dde]{right:0;position:absolute;height:25px;margin-bottom:50px;margin-top:0;padding:10px 30px!important;z-index:2}.pagination-container.hidden[data-v-45466dde]{display:none}@media (max-width: 768px){.pagination-container .el-pagination>.el-pagination__jump[data-v-45466dde]{display:none!important}.pagination-container .el-pagination>.el-pagination__sizes[data-v-45466dde]{display:none!important}} diff --git a/admin/ui/static/static/js/Login-TrQ9GHLr.js b/admin/ui/static/static/js/Login-TrQ9GHLr.js new file mode 100644 index 0000000..e8d819f --- /dev/null +++ b/admin/ui/static/static/js/Login-TrQ9GHLr.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/analyseIndex-Csxsvrp1.js b/admin/ui/static/static/js/analyseIndex-Csxsvrp1.js new file mode 100644 index 0000000..c4cd135 --- /dev/null +++ b/admin/ui/static/static/js/analyseIndex-Csxsvrp1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/index-zt3BRHpG.js","static/js/index-UuEmTaM1.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/css/index-BqAGgcXq.css","static/css/index-DCz6qoKM.css","static/js/index-DzfN_Q6p.js","static/css/index-BPoLGm0d.css"])))=>i.map(i=>d[i]); +import{b as s}from"./index-UuEmTaM1.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-zt3BRHpG.js")),__vite__mapDeps([0,1,2,3,4,5])))),c=o((()=>s((()=>import("./index-DzfN_Q6p.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}; diff --git a/admin/ui/static/static/js/analyseMainContent-CB5MT4oL.js b/admin/ui/static/static/js/analyseMainContent-CB5MT4oL.js new file mode 100644 index 0000000..fd27373 --- /dev/null +++ b/admin/ui/static/static/js/analyseMainContent-CB5MT4oL.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainContentLeft-C7wXzq5w.js","static/js/index-UuEmTaM1.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/css/index-BqAGgcXq.css","static/css/analyseMainContentLeft-CKg7AoA4.css","static/js/analyseMainContentRight-CdqYcJY1.js","static/css/analyseMainContentRight-DqjIe2oH.css"])))=>i.map(i=>d[i]); +import{_ as n,b as a}from"./index-UuEmTaM1.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-C7wXzq5w.js")),__vite__mapDeps([0,1,2,3,4,5])))),p=i((()=>a((()=>import("./analyseMainContentRight-CdqYcJY1.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}; diff --git a/admin/ui/static/static/js/analyseMainContentLeft-C7wXzq5w.js b/admin/ui/static/static/js/analyseMainContentLeft-C7wXzq5w.js new file mode 100644 index 0000000..eca1a39 --- /dev/null +++ b/admin/ui/static/static/js/analyseMainContentLeft-C7wXzq5w.js @@ -0,0 +1 @@ +import{_ as n}from"./index-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/analyseMainContentRight-CdqYcJY1.js b/admin/ui/static/static/js/analyseMainContentRight-CdqYcJY1.js new file mode 100644 index 0000000..dc970a4 --- /dev/null +++ b/admin/ui/static/static/js/analyseMainContentRight-CdqYcJY1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainContentRightToolbar-DWZ1UF5V.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css","static/css/analyseMainContentRightToolbar-CCLHpzDP.css","static/js/analyseMainContentRightResult-hXb8BPCX.js","static/css/analyseMainContentRightResult-DBbfxKRW.css"])))=>i.map(i=>d[i]); +import{_ as a,b as s}from"./index-UuEmTaM1.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-DWZ1UF5V.js")),__vite__mapDeps([0,1,2,3,4,5])))),u=l((()=>s((()=>import("./analyseMainContentRightResult-hXb8BPCX.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}; diff --git a/admin/ui/static/static/js/analyseMainContentRightResult-hXb8BPCX.js b/admin/ui/static/static/js/analyseMainContentRightResult-hXb8BPCX.js new file mode 100644 index 0000000..e3a19bc --- /dev/null +++ b/admin/ui/static/static/js/analyseMainContentRightResult-hXb8BPCX.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/analyseMainContentRightToolbar-DWZ1UF5V.js b/admin/ui/static/static/js/analyseMainContentRightToolbar-DWZ1UF5V.js new file mode 100644 index 0000000..f33309d --- /dev/null +++ b/admin/ui/static/static/js/analyseMainContentRightToolbar-DWZ1UF5V.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/analyseMainHeader-DVMuVXEy.js b/admin/ui/static/static/js/analyseMainHeader-DVMuVXEy.js new file mode 100644 index 0000000..047ee40 --- /dev/null +++ b/admin/ui/static/static/js/analyseMainHeader-DVMuVXEy.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/analyseMainIndex-D3uxViE1.js b/admin/ui/static/static/js/analyseMainIndex-D3uxViE1.js new file mode 100644 index 0000000..6df7668 --- /dev/null +++ b/admin/ui/static/static/js/analyseMainIndex-D3uxViE1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMainHeader-DVMuVXEy.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css","static/css/analyseMainHeader-R7amk0nh.css","static/js/analyseMainContent-CB5MT4oL.js","static/css/analyseMainContent-BvJwrdRn.css"])))=>i.map(i=>d[i]); +import{_ as a,b as n}from"./index-UuEmTaM1.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-DVMuVXEy.js")),__vite__mapDeps([0,1,2,3,4,5])))),u=_((()=>n((()=>import("./analyseMainContent-CB5MT4oL.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}; diff --git a/admin/ui/static/static/js/analyseMetricEditorLayout-BV3v_DJK.js b/admin/ui/static/static/js/analyseMetricEditorLayout-BV3v_DJK.js new file mode 100644 index 0000000..173f417 --- /dev/null +++ b/admin/ui/static/static/js/analyseMetricEditorLayout-BV3v_DJK.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/character-nfMAdFRb.js b/admin/ui/static/static/js/character-nfMAdFRb.js new file mode 100644 index 0000000..e59b0dd --- /dev/null +++ b/admin/ui/static/static/js/character-nfMAdFRb.js @@ -0,0 +1 @@ +import{t as e}from"./tableUser-CnqaLxm-.js";import{u as r,L as t}from"./index-UuEmTaM1.js";import{a as s,o as a,c as o,B as c}from"./vendor-CF1QNs3T.js";import"./resource-BKdHLLMe.js";import"./empty-BUY6hahc.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}; diff --git a/admin/ui/static/static/js/dashboardIndex-CoIpcZcT.js b/admin/ui/static/static/js/dashboardIndex-CoIpcZcT.js new file mode 100644 index 0000000..a3b4fe7 --- /dev/null +++ b/admin/ui/static/static/js/dashboardIndex-CoIpcZcT.js @@ -0,0 +1 @@ +import{_ as r}from"./index-UuEmTaM1.js";import"./vendor-CF1QNs3T.js";const e=r({},[["render",function(r,e){return" 看板界面 "}]]);export{e as default}; diff --git a/admin/ui/static/static/js/empty-BUY6hahc.js b/admin/ui/static/static/js/empty-BUY6hahc.js new file mode 100644 index 0000000..3b3d335 --- /dev/null +++ b/admin/ui/static/static/js/empty-BUY6hahc.js @@ -0,0 +1 @@ +import{c as o,o as r,ah as s}from"./vendor-CF1QNs3T.js";import{_ as n}from"./index-UuEmTaM1.js";const e=n({},[["render",function(n,e){const t=s;return r(),o(t,{description:"没有权限!请联系管理员添加权限!"})}]]);export{e}; diff --git a/admin/ui/static/static/js/event-ByFJ2aDl.js b/admin/ui/static/static/js/event-ByFJ2aDl.js new file mode 100644 index 0000000..a1e41f6 --- /dev/null +++ b/admin/ui/static/static/js/event-ByFJ2aDl.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/analyseMetricEditorLayout-BV3v_DJK.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css","static/css/analyseMetricEditorLayout-C535QVBW.css","static/js/index-sUbZK50i.js","static/css/index-B3tO-Skr.css","static/js/analyseMainIndex-D3uxViE1.js","static/css/analyseMainIndex-tuhwk4Nv.css"])))=>i.map(i=>d[i]); +import{b as e}from"./index-UuEmTaM1.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-BV3v_DJK.js")),__vite__mapDeps([0,1,2,3,4,5])))),m={editorPane:o((()=>e((()=>import("./index-sUbZK50i.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-D3uxViE1.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}; diff --git a/admin/ui/static/static/js/groupBySelect-BdvtIjfJ.js b/admin/ui/static/static/js/groupBySelect-BdvtIjfJ.js new file mode 100644 index 0000000..cde190a --- /dev/null +++ b/admin/ui/static/static/js/groupBySelect-BdvtIjfJ.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/history-2-P7j7wj.js b/admin/ui/static/static/js/history-2-P7j7wj.js new file mode 100644 index 0000000..7530efc --- /dev/null +++ b/admin/ui/static/static/js/history-2-P7j7wj.js @@ -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-UuEmTaM1.js";import{e as U}from"./empty-BUY6hahc.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}; diff --git a/admin/ui/static/static/js/history-DzTwqgVw.js b/admin/ui/static/static/js/history-DzTwqgVw.js new file mode 100644 index 0000000..d43fcad --- /dev/null +++ b/admin/ui/static/static/js/history-DzTwqgVw.js @@ -0,0 +1 @@ +import{t as s}from"./history-2-P7j7wj.js";import{c as o,o as t,B as i}from"./vendor-CF1QNs3T.js";import"./index-UuEmTaM1.js";import"./empty-BUY6hahc.js";const r={__name:"history",setup:r=>(r,a)=>(t(),o(i(s),{disableConditionInput:false}))};export{r as default}; diff --git a/admin/ui/static/static/js/horizonMenu-C0xfyLrV.js b/admin/ui/static/static/js/horizonMenu-C0xfyLrV.js new file mode 100644 index 0000000..d4875d3 --- /dev/null +++ b/admin/ui/static/static/js/horizonMenu-C0xfyLrV.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/index-DzfN_Q6p.js b/admin/ui/static/static/js/index-DzfN_Q6p.js new file mode 100644 index 0000000..e607ff4 --- /dev/null +++ b/admin/ui/static/static/js/index-DzfN_Q6p.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/index-UuEmTaM1.js b/admin/ui/static/static/js/index-UuEmTaM1.js new file mode 100644 index 0000000..7f0e960 --- /dev/null +++ b/admin/ui/static/static/js/index-UuEmTaM1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/dashboardIndex-CoIpcZcT.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/analyseIndex-Csxsvrp1.js","static/js/event-ByFJ2aDl.js","static/js/retention-ja11eFY1.js","static/js/project_op-BxWYeSra.js","static/js/table-C92lqdDR.js","static/js/resource-BKdHLLMe.js","static/js/empty-BUY6hahc.js","static/css/table-Cq-mWM91.css","static/js/project-BeETwwih.js","static/js/user-BKNZ5fs6.js","static/js/tableUser-CnqaLxm-.js","static/css/tableUser-D2eeKgYw.css","static/js/history-2-P7j7wj.js","static/css/history-G7P9yLzC.css","static/js/character-nfMAdFRb.js","static/js/history-DzTwqgVw.js","static/js/welcome-NcV1Cu66.js","static/js/Login-TrQ9GHLr.js","static/css/Login-BwJ0jPRV.css"])))=>i.map(i=>d[i]); +import{c as e,o as t,u as n,R as o,a,b as s,w as r,d as i,t as c,E as l,e as p,f as d,h as m,g as u,i as h,j as _,k as f,r as g,l as y,m as I,n as j,p as E,q as b,s as v,v as R,x as D,y as k,F as w,z as C,A as P,B as L,C as T,D as A,G as O,H as x,I as V,J as U,K as S,L as M,M as N,N as B,O as G,P as $,Q as z}from"./vendor-CF1QNs3T.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const q={__name:"App",setup:a=>(a,s)=>(t(),e(n(o)))},F={},J=function(e,t,n){let o=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));o=Promise.allSettled(t.map((e=>{if((e=function(e){return"/"+e}(e))in F)return;F[e]=!0;const t=e.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${o}`))return;const a=document.createElement("link");return a.rel=t?"stylesheet":"modulepreload",t||(a.as="script"),a.crossOrigin="",a.href=e,n&&a.setAttribute("nonce",n),document.head.appendChild(a),t?new Promise(((t,n)=>{a.addEventListener("load",t),a.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}function a(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then((t=>{for(const e of t||[])"rejected"===e.status&&a(e.reason);return e().catch(a)}))};const K=new class{setCache(e,t){window.localStorage.setItem(e,JSON.stringify(t))}getCache(e){const t=window.localStorage.getItem(e);if(t)return JSON.parse(t)}deleteCache(e){window.localStorage.removeItem(e)}clearCache(){}},H={style:{"font-size":"20px"}},Q={__name:"errcodeDetail",props:{data:{}},setup(e){const o=e;console.log("打开errcodeDetail,data:",o.data);let p="错误详情:";return p+=o.data.detail_msg,p+="
",p+="出错代码:",p+=o.data.stack,p+="
",(o,d)=>{const m=l;return t(),a("div",null,[s(m,{content:n(p),"raw-content":"",placement:"bottom",effect:"light",style:{"font-size":"20px"}},{default:r((()=>[i("span",H,"原因:"+c(e.data.msg),1)])),_:1},8,["content"])])}}},W=p.create({baseURL:"/api",timeout:15e3,headers:{"Content-type":"application/json;charset=utf-8","Cache-Control":"no-cache",UserId:0,Token:""}});function X(e,t,n,o,a,s,r){const i={pageNo:e,pageLen:t,userId:n,opResourceType:o,opResourceGroup:a,opResourceKey:s,method:r};return console.log("params:",i),W({url:"/user/history",method:"get",params:i})}W.interceptors.request.use((e=>{let t=Y().userInfo,n=Z(),o=t?parseInt(t.user_id,10):0;const a=n?n.token:"";return e.headers=e.headers||{},e.headers.UserId=o,e.headers.Token=a,e.headers.Authorization="Bearer "+a,e})),W.interceptors.response.use((e=>{console.log("res:",e.data);const t=e.headers["content-disposition"],n=/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i;if(t){if(t.match(n))return e}const o=e.data.code;return 200!=o?5===o?(console.log("token无效,重新登录!"),Y().logout(),location.href="/login",Promise.reject()):(7==o?d.alert("用户名或密码错误!",{type:"warning",confirmButtonText:"知道了"}):(console.log("interceptor err code",e),d({title:"服务器错误码["+o+"]",message:()=>m(Q,{data:e.data}),type:"warning",confirmButtonText:"知道了"}).then((e=>{}))),Promise.reject(e.data)):e.data}),(e=>{console.log(e);const t=e.response&&e.response.status||-1,n=e.response&&e.response.data.message||e;return d.alert(n,"请求服务器返回http错误码-"+t,{type:"error",confirmButtonText:"知道了"}),Promise.reject(e)}));const Y=u("user",{state:()=>({tokenInfo:Z(),userInfo:ne(),projects:se(),dynamicMenuItems:[],dynamicRouteChildren:[],isGetUserInfo:!1}),actions:{hasGetUserInfo(){return this.generateDynamicRoutes(),this.isGetUserInfo},getDynamicRouteChildren(){return this.dynamicRouteChildren},pushDynamicRouteChildren(e){this.dynamicRouteChildren.push(e)},pushDynamicMenuItems(e){this.dynamicMenuItems.push(e)},clearDynamicRouteChildren(e){this.dynamicRouteChildren=[]},clearDynamicMenuItems(e){this.dynamicMenuItems=[]},login(e,t){return new Promise(((n,o)=>{var a;(a={user:e,password:t},W({url:"/user/login",method:"post",data:a})).then((e=>{this.userInfo=e.data.user_info,this.tokenInfo=e.data.token_info,this.projects=e.data.projects,ee(this.tokenInfo),ae(this.userInfo),ie(this.projects),this.generateDynamicRoutes(),this.isGetUserInfo=!0,n()})).catch((e=>{o(e)}))}))},getUserInfo(){return new Promise(((e,t)=>{var n;W({url:"/user/info",method:"get",data:n}).then((t=>{this.userInfo=t.data.user_info,this.tokenInfo=t.data.token_info,this.projects=t.data.projects,ee(this.tokenInfo),ae(this.userInfo),ie(this.projects),this.generateDynamicRoutes(),this.isGetUserInfo=!0,e()})).catch((e=>{t(e)}))}))},logout(){console.log("走logout清理缓存。。"),this.userInfo=null,this.tokenInfo=null,this.projects=null,oe(),te(),re()},generateDynamicRoutes(){this.clearDynamicRouteChildren(),this.clearDynamicMenuItems();const e=this.projects;for(let t=0;tJ((()=>import("./dashboardIndex-CoIpcZcT.js")),__vite__mapDeps([0,1,2])),props:!0},r=a.path+"/bi_analyse",i={path:r,name:a.name+"_bi_analyse",meta:{desc:"数据分析",projectId:n.project_id},component:()=>J((()=>import("./analyseIndex-Csxsvrp1.js")),__vite__mapDeps([3,1,2])),props:!0,children:[{path:r+"/analyse",name:r+"/analyse",meta:{desc:"分析"},children:[{path:r+"/analyse/event",name:r+"/analyse/event",meta:{desc:"事件分析"},component:()=>J((()=>import("./event-ByFJ2aDl.js")),__vite__mapDeps([4,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"留存分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"漏斗分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"间隔分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"分布分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"路径分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"属性分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"归因分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))},{path:r+"/analyse/retention",name:r+"/analyse/retention",meta:{desc:"行为序列"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))}]},{path:r+"/bi_user",name:r+"/bi_user",meta:{desc:"用户"},children:[{path:r+"/bi_user/event",name:r+"/bi_user/event",meta:{desc:"事件分析"},component:()=>J((()=>import("./event-ByFJ2aDl.js")),__vite__mapDeps([4,1,2]))},{path:r+"/bi_user/retention",name:r+"/bi_user/retention",meta:{desc:"留存分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))}]},{path:r+"/bi_data",name:r+"/bi_data",meta:{desc:"数据"},children:[{path:r+"/bi_data/event",name:r+"/bi_data/event",meta:{desc:"事件分析"},component:()=>J((()=>import("./event-ByFJ2aDl.js")),__vite__mapDeps([4,1,2]))},{path:r+"/bi_data/retention",name:r+"/bi_data/retention",meta:{desc:"留存分析"},component:()=>J((()=>import("./retention-ja11eFY1.js")),__vite__mapDeps([5,1,2]))}]}]};a.children.push(s),a.children.push(i),this.pushDynamicRouteChildren(s),this.pushDynamicRouteChildren(i);n.resource_list.forEach((e=>{const t=a.path+"/"+e.resource,s={path:t,name:a.name+"_"+e.resource,meta:{desc:e.desc,projectId:n.project_id,resource:e.resource,resource_url:t,methods:{},global_click_btns:e.global_btns,row_click_btns:e.row_btns},component:()=>J((()=>import("./project_op-BxWYeSra.js")),__vite__mapDeps([6,7,1,2,8,9,10])),props:!0};e.show_methods.forEach((e=>{"get"==e&&(o=!0),s.meta.methods[e]=!0})),a.children.push(s),this.pushDynamicRouteChildren(s)})),o&&this.pushDynamicMenuItems(a)}console.log("pinia重新生成路由。。"),ye.children=ge.concat(this.getDynamicRouteChildren()),Ie.addRoute(ye)}}}),Z=()=>K.getCache("tokenInfo"),ee=e=>{K.setCache("tokenInfo",e)},te=()=>{K.deleteCache("tokenInfo")},ne=()=>K.getCache("userInfo"),oe=()=>{K.deleteCache("userInfo")},ae=e=>{K.setCache("userInfo",e)},se=()=>K.getCache("projects"),re=()=>{K.deleteCache("projects")},ie=e=>{K.setCache("projects",e)},ce=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},le={class:"sidebar-content"},pe={class:"avatar-container"},de={class:"avatar"},me={style:{"margin-left":"5px"}},ue={style:{"border-bottom":"1px whitesmoke solid","border-top":"1px whitesmoke solid"}},he={__name:"Home",setup(o){const l=h(),p=_(),m=Y().userInfo.nick_name,u=f((()=>p.path)),O=Y().dynamicMenuItems,x=g(!1),V=()=>{l.push("/welcome")};function U(e){if("logout"===e)d.confirm("确定注销并退出系统吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{Y().logout(),l.push("/login")})).catch((()=>{}))}return(o,p)=>{const d=y("User"),h=E,_=y("ArrowDown"),f=v,g=b,S=j,M=P,N=k,B=D,G=I,$=y("router-view"),z=T,q=A;return t(),a("main",null,[i("div",null,[s(q,{class:"app-container"},{default:r((()=>[s(G,{class:"app-sidebar"},{default:r((()=>[i("div",le,[i("div",{class:"sidebar-logo",onClick:V},p[1]||(p[1]=[i("span",{class:"system-name"},"游戏数据管理系统",-1)])),i("div",pe,[s(S,{class:"avatar-dropdown",trigger:"click",onCommand:U},{dropdown:r((()=>[s(g,null,{default:r((()=>[s(f,{command:"logout"},{default:r((()=>p[2]||(p[2]=[R("退出登录")]))),_:1})])),_:1})])),default:r((()=>[i("span",de,[s(h,null,{default:r((()=>[s(d)])),_:1}),i("p",me,c(n(m)),1),s(h,null,{default:r((()=>[s(_)])),_:1})])])),_:1})]),s(B,{"default-active":u.value,class:"el-menu-vertical-demo",collapse:!1},{default:r((()=>[i("div",ue,[s(N,{index:"/user"},{title:r((()=>p[3]||(p[3]=[i("span",null,"用户管理",-1)]))),default:r((()=>[(t(!0),a(w,null,C(n(fe),(n=>(t(),e(M,{index:n.path,onClick:e=>o.$router.push(n.path)},{default:r((()=>[s(h,null,{default:r((()=>[(t(),e(L(n.meta.icon),{class:"el-icon"}))])),_:2},1024),i("span",null,c(n.meta.name),1)])),_:2},1032,["index","onClick"])))),256))])),_:1}),s(M,{index:"/project",onClick:p[0]||(p[0]=e=>o.$router.push("/project"))},{default:r((()=>p[4]||(p[4]=[i("span",null,"项目管理",-1)]))),_:1})]),(t(!0),a(w,null,C(n(O),(n=>(t(),e(N,{index:n.path},{title:r((()=>[i("span",null,c(n.meta.projectName),1)])),default:r((()=>[(t(!0),a(w,null,C(n.children,(n=>(t(),e(M,{key:n.path,index:n.path,onClick:e=>{return t=n,K.setCache("resource",t),l.push({path:t.path}),void(x.value=!0);var t}},{default:r((()=>[R(c(n.meta.desc),1)])),_:2},1032,["index","onClick"])))),128))])),_:2},1032,["index"])))),256))])),_:1},8,["default-active"])])])),_:1}),s(z,{class:"app-main"},{default:r((()=>[(t(),e($,{key:o.$route.fullPath}))])),_:1})])),_:1})])])}}},_e={path:"/project",name:"project",meta:{name:"project",icon:"App",resource_url:"/project",methods:{get:!0,post:!0,put:!0,delete:!0}},component:()=>J((()=>import("./project-BeETwwih.js")),__vite__mapDeps([11,7,1,2,8,9,10]))},fe=[{path:"/usermanager",name:"usermanager",meta:{name:"用户管理",icon:"User"},component:()=>J((()=>import("./user-BKNZ5fs6.js")),__vite__mapDeps([12,13,1,2,8,9,14,15,16]))},{path:"/character",name:"character",meta:{name:"角色管理",icon:"Avatar"},component:()=>J((()=>import("./character-nfMAdFRb.js")),__vite__mapDeps([17,13,1,2,8,9,14]))},{path:"/userhistory",name:"userhistory",meta:{name:"用户操作记录",icon:"Finished"},component:()=>J((()=>import("./history-DzTwqgVw.js")),__vite__mapDeps([18,15,1,2,9,16]))}],ge=[{path:"/welcome",name:"welcome",component:()=>J((()=>import("./welcome-NcV1Cu66.js")),__vite__mapDeps([19,1,2]))},{path:"/user",name:"user",meta:{name:"user",icon:"User"},children:fe},_e],ye={path:"/",name:"home",component:ce(he,[["__scopeId","data-v-b168a903"]]),children:ge},Ie=O({history:x("/"),routes:[{path:"/login",name:"login",component:()=>J((()=>import("./Login-TrQ9GHLr.js")),__vite__mapDeps([20,1,2,21])),hidden:!0},ye]});Ie.beforeEach(((e,t,n)=>{const o=Z();if(o&&void 0!==o.token&&""!==o.token)"/login"===e.path?(console.log("有token走登录,跳过登录",o),n({path:"/welcome"})):(console.log("跳到页面:"+e.path+",当前所有路由:",Ie.getRoutes()),Y().hasGetUserInfo()?(console.log("获取过用户数据,跳过获取。。。"),"/"===e.path?n({path:"/welcome"}):n()):Y().getUserInfo().then((()=>{console.log("获取用户信息成功,继续:",e.path),"/"===e.path?n({path:"/welcome"}):n({...e,replace:!0})})).catch((e=>{Y().logout().then((()=>{V.error(e),n({path:"/login"})}))})));else{if("/login"===e.path)return void n();console.log("token无效,走登录。",o),n(`/login?redirect=${e.fullPath}`)}}));const je=U();je.use(S);const Ee=M(q);Ee.config.productionTip=!1,Ee.use(N);for(const[be,ve]of Object.entries(B))Ee.component(be,ve);Ee.use(G,{locale:$}),Ee.use(je),Ee.config.globalProperties.$echarts=z,Ee.use(Ie),Ee.mount("#app");export{K as L,ce as _,X as a,J as b,_e as c,se as g,Ie as r,W as s,Y as u}; diff --git a/admin/ui/static/static/js/index-sUbZK50i.js b/admin/ui/static/static/js/index-sUbZK50i.js new file mode 100644 index 0000000..c3ad3b3 --- /dev/null +++ b/admin/ui/static/static/js/index-sUbZK50i.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/metricSelect-cQkHNvUm.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css","static/css/metricSelect-NSGkGZUF.css","static/js/groupBySelect-BdvtIjfJ.js","static/css/groupBySelect-CFOi4zHL.css","static/js/propertiesConditionFilter-BGVrRtlX.js"])))=>i.map(i=>d[i]); +import{_ as e,b as a}from"./index-UuEmTaM1.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-cQkHNvUm.js")),__vite__mapDeps([0,1,2,3,4,5])))),j=T((()=>a((()=>import("./groupBySelect-BdvtIjfJ.js")),__vite__mapDeps([6,1,2,3,4,7])))),B=T((()=>a((()=>import("./propertiesConditionFilter-BGVrRtlX.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}; diff --git a/admin/ui/static/static/js/index-zt3BRHpG.js b/admin/ui/static/static/js/index-zt3BRHpG.js new file mode 100644 index 0000000..2118fe9 --- /dev/null +++ b/admin/ui/static/static/js/index-zt3BRHpG.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/horizonMenu-C0xfyLrV.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css"])))=>i.map(i=>d[i]); +import{_ as s,b as a}from"./index-UuEmTaM1.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-C0xfyLrV.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}; diff --git a/admin/ui/static/static/js/metricSelect-cQkHNvUm.js b/admin/ui/static/static/js/metricSelect-cQkHNvUm.js new file mode 100644 index 0000000..6c45a74 --- /dev/null +++ b/admin/ui/static/static/js/metricSelect-cQkHNvUm.js @@ -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-UuEmTaM1.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{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}; diff --git a/admin/ui/static/static/js/project-BeETwwih.js b/admin/ui/static/static/js/project-BeETwwih.js new file mode 100644 index 0000000..249cd79 --- /dev/null +++ b/admin/ui/static/static/js/project-BeETwwih.js @@ -0,0 +1 @@ +import{t as e}from"./table-C92lqdDR.js";import{L as s,u as r,c as t}from"./index-UuEmTaM1.js";import{i as a,a as o,o as m,c,B as p}from"./vendor-CF1QNs3T.js";import"./resource-BKdHLLMe.js";import"./empty-BUY6hahc.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}; diff --git a/admin/ui/static/static/js/project_op-BxWYeSra.js b/admin/ui/static/static/js/project_op-BxWYeSra.js new file mode 100644 index 0000000..382c247 --- /dev/null +++ b/admin/ui/static/static/js/project_op-BxWYeSra.js @@ -0,0 +1 @@ +import{t as e}from"./table-C92lqdDR.js";import{_ as l,s as a,L as t,u as o,r}from"./index-UuEmTaM1.js";import{a as d,o as n,b as c,w as p,X as s,u,Y as i,a7 as f,aa as m,v as _,F as b,z as y,c as h,r as k,U as w,ae as I,B as V,a8 as g,af as v,a0 as K,E as D,a1 as C,a2 as U,a4 as x,a3 as j,$ as L}from"./vendor-CF1QNs3T.js";import"./resource-BKdHLLMe.js";import"./empty-BUY6hahc.js";const Y=l({__name:"userDetailAccount",props:{accountInfo:{}},setup(e){const l=e,a=l.accountInfo;console.log("账户信息:",a);let t=[{filedKey1:"账户id",filedValue1:a.account_id,filedKey2:"平台",filedValue2:a.platform},{filedKey1:"角色数",filedValue1:a.role_list.length,filedKey2:"渠道",filedValue2:a.channel},{filedKey1:"注册时间",filedValue1:a.created_at,filedKey2:"注册ip",filedValue2:a.created_ip},{filedKey1:"总付费金额",filedValue1:a.total_pay_amount,filedKey2:"总付费次数",filedValue2:a.total_pay_times},{filedKey1:"首次付费时间",filedValue1:a.first_pay_at,filedKey2:"最后付费时间",filedValue2:a.last_pay_at},{filedKey1:"登录设备数(暂无)",filedValue1:0,filedKey2:"最后登录时间",filedValue2:a.last_login_time}],o=[],r=[],k=!0;a.role_list.forEach((e=>{let l=0;e.currency_items.forEach((a=>{l++;let t="currencyNum"+l;e["currencyName"+l]=a.desc,e[t]=a.item_num,k&&r.push({colProp:t,colLabel:a.desc})})),k=!1,o.push(e)})),Object.keys(l.accountInfo).forEach((e=>{l.accountInfo[e]}));const w=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=i,k=s,I=f,V=m;return n(),d("div",null,[c(I,null,{default:p((()=>[c(k,{data:u(t),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":w,"show-header":!1},{default:p((()=>[c(a,{prop:"filedKey1",label:"",width:"180"}),c(a,{prop:"filedValue1",label:"",width:"200"}),c(a,{prop:"filedKey2",label:"",width:"180"}),c(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),c(I,null,{default:p((()=>[c(V,{"content-position":"left"},{default:p((()=>l[0]||(l[0]=[_("角色详情")]))),_:1}),c(k,{class:"roleDetailList",data:u(o),border:"","show-header":!0,style:{width:"100%"}},{default:p((()=>[c(a,{prop:"platform",label:"平台"}),c(a,{prop:"server_id",label:"区服"}),c(a,{prop:"name",label:"角色名称",width:"100%"}),c(a,{prop:"role_id",label:"角色id"}),c(a,{prop:"total_pay_amount",label:"充值金额"}),c(a,{prop:"level",label:"等级"}),c(a,{prop:"created_at",label:"创建时间",width:"100"}),c(a,{prop:"last_login_time",label:"最后登录时间",width:"100"}),(n(!0),d(b,null,y(u(r),(e=>(n(),h(a,{prop:e.colProp,label:e.colLabel},null,8,["prop","label"])))),256))])),_:1},8,["data"])])),_:1})])}}},[["__scopeId","data-v-5a8d8958"]]),R={__name:"userDetailOrder",props:{accountInfo:{}},setup(e){const l=e.accountInfo;let a=[];return l.role_list.forEach((e=>{a.push(...e.order_list)})),(e,l)=>{const t=i,o=s;return n(),d("div",null,[c(o,{data:u(a),style:{width:"100%"},"table-layout":"auto",border:"","show-header":!0},{default:p((()=>[c(t,{prop:"server_id",label:"区服"}),c(t,{prop:"account_id",label:"账户id"}),c(t,{prop:"role_id",label:"角色id"}),c(t,{prop:"role_name",label:"角色名"}),c(t,{prop:"sn",label:"订单号"}),c(t,{prop:"product_id",label:"商品id"}),c(t,{prop:"price",label:"金额"}),c(t,{prop:"purchase_type",label:"支付方式"}),c(t,{prop:"purchase_at",label:"订单时间"})])),_:1},8,["data"])])}}};const E={__name:"userDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=t.getCache("resource").meta.resource_url,r=k("detail");console.log("进入用户详情:",l.rowInfo),l.rowInfo.Account,l.rowInfo.ServerConfId;let s=k(!1),i={};var f,m;(f=o,m=l.rowInfo,a({url:f+"/special/detail",method:"get",params:m})).then((e=>{console.log("获取账户详情返回:",e.data),i=e.data.account_info,s.value=!0}),(e=>{}));const _=(e,l)=>{switch(e.props.name){case"detail":console.log("点击了账号详情");break;case"order":console.log("点击了充值订单记录");break;case"currency":console.log("点击了货币记录")}};return(e,l)=>{const a=I,t=v;return n(),d("div",null,[u(s)?(n(),h(t,{key:0,modelValue:u(r),"onUpdate:modelValue":l[0]||(l[0]=e=>g(r)?r.value=e:null),class:"demo-tabs",onTabClick:_},{default:p((()=>[c(a,{label:"账号详情",name:"detail"},{default:p((()=>[u(s)?(n(),h(V(Y),{key:0,accountInfo:u(i)},null,8,["accountInfo"])):w("",!0)])),_:1}),u(s)?(n(),h(a,{key:0,label:"充值订单记录",name:"order",accountInfo:u(i)},{default:p((()=>[u(s)?(n(),h(V(R),{key:0,accountInfo:u(i)},null,8,["accountInfo"])):w("",!0)])),_:1},8,["accountInfo"])):w("",!0)])),_:1},8,["modelValue"])):w("",!0)])}}},A={__name:"cdkeyDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,a=l.rowInfo,o=l.fieldsDescInfo;return t.getCache("resource").meta.resource_url,(e,l)=>{const t=i,r=s,f=K,m=U,_=C,k=D,w=x,I=j,V=L;return n(),h(V,{ref:"dialogLookFormRef",model:u(a),class:"operation_form","label-width":"130px"},{default:p((()=>[(n(!0),d(b,null,y(u(o),(e=>(n(),d(b,null,["items"===e.type?(n(),h(f,{key:0,label:"奖励列表",prop:"Attach"},{default:p((()=>[c(r,{data:u(a).Attach,border:""},{default:p((()=>[c(t,{label:"道具id",prop:"id"}),c(t,{label:"数量",prop:"num"}),c(t,{label:"道具名",prop:"desc"})])),_:1},8,["data"])])),_:1})):(n(),d(b,{key:1},[void 0!==e.choices&&e.choices.length>0?(n(),h(f,{key:0,label:e.name,prop:e.key},{default:p((()=>[c(k,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(_,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",disabled:"",modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:p((()=>[(n(!0),d(b,null,y(e.choices,(e=>(n(),h(m,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(n(),h(f,{key:1,label:e.name,prop:e.key},{default:p((()=>[c(w,{modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,type:"datetime",disabled:"",placeholder:"空时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):(n(),h(f,{key:2,label:e.name,prop:e.key},{default:p((()=>[c(I,{modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,disabled:""},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"]))],64))],64)))),256))])),_:1},8,["model"])}}};const H={__name:"cdkeyUsedHistory",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=l.rowInfo;l.fieldsDescInfo;const r=t.getCache("resource").meta.resource_url,y=k([]),h=k([]);var w,I;(w=r,I={id:o.ID},a({url:w+"/special/used",method:"get",params:I})).then((e=>{y.value=e.data.list,h.value=[{filedKey1:"礼包名称",filedValue1:o.Name,filedKey2:"礼包总数量",filedValue2:o.CodeNum},{filedKey1:"礼包使用数量",filedValue1:y.value.length}]}),(e=>{}));const V=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=i,t=s,o=f,r=m;return n(),d(b,null,[c(o,null,{default:p((()=>[c(t,{data:u(h),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":V,"show-header":!1},{default:p((()=>[c(a,{prop:"filedKey1",label:"",width:"180"}),c(a,{prop:"filedValue1",label:"",width:"200"}),c(a,{prop:"filedKey2",label:"",width:"180"}),c(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),c(r,{"content-position":"left"},{default:p((()=>l[0]||(l[0]=[_("使用详情")]))),_:1}),c(o,null,{default:p((()=>[c(t,{data:u(y),style:{width:"100%"},height:"300","max-height":"300","table-layout":"auto",stripe:""},{default:p((()=>[c(a,{prop:"server_id",label:"区服"}),c(a,{prop:"account",label:"账号名"}),c(a,{prop:"role_id",label:"角色id"}),c(a,{prop:"role_name",label:"角色名"}),c(a,{prop:"key",label:"码"}),c(a,{prop:"ip",label:"ip"}),c(a,{prop:"device_id",label:"设备号"}),c(a,{prop:"created_at",label:"使用时间"})])),_:1},8,["data"])])),_:1})],64)}}},T={__name:"project_op",setup(l){const d=t.getCache("resource"),c=o().dynamicRouteChildren,p=d.meta.projectId,s=[];switch(d.meta.resource){case"account":if(s.length>0)break;s.push({key:"account:detail",name:"用户详情",btn_color_type:"primary",btn_type:1,btn_callback_component:E},{key:"account:detail",name:"白名单",btn_color_type:"default",btn_type:2,click_handler:e=>{for(let l=0;l0)break;s.push({key:"account:detail",name:"封禁",btn_color_type:"info",btn_type:2,click_handler:e=>{for(let l=0;l0)break;s.push({key:"cdkey:detail",name:"查看",btn_color_type:"primary",btn_type:1,btn_callback_component:A},{key:"cdkey:export",name:"导出",btn_color_type:"warning",btn_type:2,click_handler:e=>{const l=t.getCache("resource").meta.resource_url;var o,r;(o=l,r={id:e.ID},a({url:o+"/special/export",method:"get",params:r,responseType:"blob"})).then((e=>{console.log("导出cdkey返回:",e);let l="default_filename.ext";const a=e.headers["content-disposition"].match(/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i);a&&a[1]&&(l=decodeURIComponent(a[1]));const t=new Blob([e.data]),o=document.createElement("a");o.href=window.URL.createObjectURL(t),o.download=l,o.click(),window.URL.revokeObjectURL(o.href)}))}},{key:"cdkey:used:history",name:"礼包使用",btn_color_type:"default",btn_type:1,btn_callback_component:H})}return(l,a)=>(n(),h(V(e),{rowClickDialogBtns:s}))}};export{T as default}; diff --git a/admin/ui/static/static/js/propertiesConditionFilter-BGVrRtlX.js b/admin/ui/static/static/js/propertiesConditionFilter-BGVrRtlX.js new file mode 100644 index 0000000..cff97bc --- /dev/null +++ b/admin/ui/static/static/js/propertiesConditionFilter-BGVrRtlX.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/propertyConditionType-cH_UXbua.js","static/js/vendor-CF1QNs3T.js","static/css/vendor-DnLjZ1mj.css","static/js/index-UuEmTaM1.js","static/css/index-BqAGgcXq.css","static/css/propertyConditionType-NSBzD7rw.css","static/js/propertyConditionFilter-Bo6S0Hpt.js","static/css/propertyConditionFilter-CwW-c0Ha.css"])))=>i.map(i=>d[i]); +import{b as e}from"./index-UuEmTaM1.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-cH_UXbua.js")),__vite__mapDeps([0,1,2,3,4,5])))),h=l((()=>e((()=>import("./propertyConditionFilter-Bo6S0Hpt.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({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}; diff --git a/admin/ui/static/static/js/propertyConditionFilter-Bo6S0Hpt.js b/admin/ui/static/static/js/propertyConditionFilter-Bo6S0Hpt.js new file mode 100644 index 0000000..1f116e0 --- /dev/null +++ b/admin/ui/static/static/js/propertyConditionFilter-Bo6S0Hpt.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/propertyConditionType-cH_UXbua.js b/admin/ui/static/static/js/propertyConditionType-cH_UXbua.js new file mode 100644 index 0000000..2754fa9 --- /dev/null +++ b/admin/ui/static/static/js/propertyConditionType-cH_UXbua.js @@ -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-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/resource-BKdHLLMe.js b/admin/ui/static/static/js/resource-BKdHLLMe.js new file mode 100644 index 0000000..889e7a1 --- /dev/null +++ b/admin/ui/static/static/js/resource-BKdHLLMe.js @@ -0,0 +1 @@ +import{s as t}from"./index-UuEmTaM1.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}; diff --git a/admin/ui/static/static/js/retention-ja11eFY1.js b/admin/ui/static/static/js/retention-ja11eFY1.js new file mode 100644 index 0000000..7148466 --- /dev/null +++ b/admin/ui/static/static/js/retention-ja11eFY1.js @@ -0,0 +1 @@ +import{_ as r}from"./index-UuEmTaM1.js";import"./vendor-CF1QNs3T.js";const e=r({},[["render",function(r,e){return" 留存分析 "}]]);export{e as default}; diff --git a/admin/ui/static/static/js/table-C92lqdDR.js b/admin/ui/static/static/js/table-C92lqdDR.js new file mode 100644 index 0000000..2b6a9c7 --- /dev/null +++ b/admin/ui/static/static/js/table-C92lqdDR.js @@ -0,0 +1 @@ +import{r as e,S as l,T as a,j as t,a as o,o as u,c as n,u as d,B as r,F as s,U as p,w as c,b as i,V as m,a7 as v,z as y,a4 as h,a1 as f,a2 as _,a3 as k,W as g,v as b,t as V,C as w,d as x,X as U,Y as C,ag as D,E as Y,Z as z,_ as A,$ as M,a0 as H,D as I,f as j,a6 as R,I as q,h as F}from"./vendor-CF1QNs3T.js";import{r as E,a as S,d as L,b as B,c as O,e as $}from"./resource-BKdHLLMe.js";import{_ as T,L as N,r as W}from"./index-UuEmTaM1.js";import{e as J}from"./empty-BUY6hahc.js";function P(e){switch(e){case"eq":return"等于";case"gt":return"大于";case"lt":return"小于";case"ge":return"大于等于";case"le":return"小于等于";case"like":return"包含";case"range":return""}}const X={class:"app-content"},Z={class:"table-content"},G={class:"table"},K={key:1},Q={key:1},ee={class:"pagination-container"},le=T({__name:"table",props:{rowClickDialogBtns:Array},setup(T){const le=T;let ae=[];le.rowClickDialogBtns&&(ae=le.rowClickDialogBtns);const te=N.getCache("resource"),oe=e({fields_desc:[],rows:[]}),ue=e(!1),ne=te.meta.projectId,de=te,re=void 0!==de.meta.methods.get&&!0===de.meta.methods.get,se=de.meta.global_click_btns?de.meta.global_click_btns:[];let pe=de.meta.row_click_btns?de.meta.row_click_btns:[];pe.push(...ae);const ce=l(pe.map((()=>!1))),ie=e(null),me=te.meta.resource_url,ve=e([]),ye=e([]),he=e([]),fe=e([]),_e=e({}),ke=e(1),ge=e(10),be=[10,20,50,100],Ve=e(0),we=e(null),xe=e(0),Ue=e(null),Ce=(e,l)=>{for(let t=0;t{console.log("触发校验道具列表规则:",Ie.value),void 0===Ie.value.Attach||0===Ie.value.Attach.length?a(new Error("请至少填写一个奖励道具!")):a()},trigger:["blur","change"]}]));const o=["plain","primary","success","info","waring","danger"];if("tagStatus"===a.type)for(let e=0;e{try{let e={page_no:ke.value,page_len:ge.value,where_conditions:""},l={conditions:[]};ye.value.forEach((e=>{(e.value1||e.value2)&&l.conditions.push({key:e.key,op:e.where,value1:e.value1,value2:e.value2})})),e.where_conditions=JSON.stringify(l);const a=await E(me,e);if(oe.value=a,200!==oe.value.code)throw new Error("请求失败,错误码:",oe.code);ve.value=oe.value.data.fields_desc,Ve.value=oe.value.data.total_count,he.value=((e,l)=>{let a=[];return l.forEach((l=>{const t=Ce(e,l);a.push(t)})),a})(ve.value,oe.value.data.rows),fe.value=oe.value.data.item_bags,ue.value=!0}catch(e){console.log(e)}},Ye=e("default");Ye.value=(()=>{let e=0;return!0===de.meta.methods.put&&(e+=1),!0===de.meta.methods.delete&&(e+=1),e+=pe.length,e>=4?"small":e>=3?"default":"large"})(),a((()=>{De()}));const ze=e(!1),Ae=e(!1),Me=e(null),He=e(null),Ie=e({ServerIDs:[],Attach:[]}),je=t();let Re=!1;null!=je.query.from&&""!=je.query.from&&(Object.keys(je.query).forEach((e=>{const l=je.query[e];"from"!==e&&(Ie.value[e]=l)})),ze.value=!0,Re=!0);const qe=e([]),Fe=(e,l)=>{console.log(`选择表格行,类型:${e},:`,l),j.confirm("确定要操作吗?").then((()=>{$(me,{btn_key:e.key,rows:l}).then((e=>{const l=e.data.msg;let a=e.data.file_name;const t=e.data.need_refresh;if(""!==a){const e=/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i,t=a.match(e);t&&t[1]&&(a=decodeURIComponent(t[1]));const o=new Blob([l]),u=document.createElement("a");return u.href=window.URL.createObjectURL(o),u.download=a,u.click(),void window.URL.revokeObjectURL(u.href)}R({title:"操作行数据返回",message:F("i",{style:"color: teal"},l),duration:900,onClose(e){t&&location.reload()}})}),(e=>{}))})).catch((()=>{}))},Ee=e=>{qe.value=e};function Se(e){let l=!1;if(null!=Ue.value&&void 0!==Ue.value.name&&""!==Ue.value.name&&(Ue.value.items.forEach((e=>{"string"==typeof Ie.value.Attach&&(Ie.value.Attach=[]);let l={id:e.item_id,num:e.item_num,desc:e.desc,item_type:e.item_type};Ie.value.Attach.push(l)})),console.log("添加礼包:",Ue.value),l=!0),null!==we.value&&void 0!==we.value.value&&""!==we.value.value){if(xe.value<=0)return void q("请输入有效道具数量!");let e={id:we.value.value,num:Number(xe.value),desc:we.value.desc,item_type:we.value.type};console.log("add item:",e),"string"==typeof Ie.value.Attach&&(Ie.value.Attach=[]),Ie.value.Attach.push(e),l=!0}l||(console.log("道具:",we.value),console.log("礼包:",Ue.value),q("请选择道具或者礼包!")),ze.value?Me.value.validateField("Attach"):Ae.value&&He.value.validateField("Attach")}function Le(e){let l=Ie.value.Attach.findIndex((l=>l===e));Ie.value.Attach.splice(l,1),ze.value?Me.value.validateField("Attach"):Ae.value&&He.value.validateField("Attach")}const Be=()=>{ze.value=!1,Ae.value=!1,Ie.value={Attach:[]},we.value=null,xe.value=0,Ue.value=null,Re&&W.replace({path:je.path,query:{}}),Pe.value=0,Xe.value="",Ze.value=5,Ge.value=""},Oe=e(!1),$e=e({}),Te=e=>{e?(Oe.value=!0,e=e.replace(/[\s\u3000]/g,""),L(ne).then((l=>{console.log("获取所有道具返回:",l.data),console.log("查询字符串:["+e+"]"),$e.value=l.data.items.filter((l=>l.desc.includes(e))),Oe.value=!1}),(e=>{$e.value=[]}))):$e.value=[]},Ne=()=>{for(let e=0;e{Ve.value<=0||ge.value*ke.value>Ve.value&&he.value.length>=Ve.value||De()},Je=e=>{De()},Pe=e(0),Xe=e(""),Ze=e(5),Ge=e(""),Ke=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"],Qe=()=>{if(Pe.value<=0||Pe.value>1e3)return void alert("数量不合法!!范围[1-1000]");if(""===Xe.value&&""===Ge.value)return void alert("生成账号的前缀、后缀至少填一个!!");if(Ze.value<3||Ze.value>20)return void alert("生成账号的随机字串长度不合法!!范围[3-20]");let e=[];for(let l=0;l{const a=h,t=_,q=f,F=k,E=g,L=v,$=m,T=C,N=D,W=Y,P=U,le=z,ae=A,oe=H,ne=M,je=w,Re=I;return u(),o("div",X,[d(re)?(u(),o(s,{key:1},[ue.value?(u(),n(Re,{key:0},{default:c((()=>[i($,{style:{"margin-bottom":"10px"}},{default:c((()=>[0!==ye.value.length?(u(),n(L,{key:0},{default:c((()=>[(u(!0),o(s,null,y(ye.value,(e=>(u(),o(s,null,["range"===e.where?(u(),o(s,{key:0},[i(a,{modelValue:e.value1,"onUpdate:modelValue":l=>e.value1=l,type:"datetime",placeholder:e.name+"起始",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss",style:{"margin-right":"10px"}},null,8,["modelValue","onUpdate:modelValue","placeholder"]),i(a,{modelValue:e.value2,"onUpdate:modelValue":l=>e.value2=l,type:"datetime",placeholder:e.name+"结束",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss",style:{"margin-right":"10px"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64)):(u(),o(s,{key:1},[e.choices.length>0?(u(),n(q,{key:0,modelValue:e.value1,"onUpdate:modelValue":l=>e.value1=l,placeholder:(e.multi_choice,"--"+e.name+"--"),style:{width:"150px","margin-right":"10px"},filterable:""},{default:c((()=>[(u(!0),o(s,null,y(e.choices,(e=>(u(),n(t,{key:e.value,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):(u(),n(F,{key:1,modelValue:e.value1,"onUpdate:modelValue":l=>e.value1=l,placeholder:e.name+e.whereDesc,style:{width:"150px","margin-right":"10px"}},null,8,["modelValue","onUpdate:modelValue","placeholder"]))],64))],64)))),256)),i(E,{onClick:De,type:"primary"},{default:c((()=>l[17]||(l[17]=[b("条件搜索")]))),_:1}),i(E,{onClick:Ne,type:"default"},{default:c((()=>l[18]||(l[18]=[b("清空条件")]))),_:1})])),_:1})):p("",!0),i(L,{style:{"margin-top":"10px"}},{default:c((()=>[!0===d(de).meta.methods.post?(u(),n(E,{key:0,onClick:l[0]||(l[0]=e=>ze.value=!0),size:"default",type:"primary"},{default:c((()=>l[19]||(l[19]=[b(" 添加 ")]))),_:1})):p("",!0),(u(!0),o(s,null,y(d(se),(e=>(u(),n(E,{size:"default",type:e.btn_color_type,onClick:l=>{Fe(e,qe.value)}},{default:c((()=>[b(V(e.name),1)])),_:2},1032,["type","onClick"])))),256))])),_:1})])),_:1}),i(je,null,{default:c((()=>[x("div",Z,[x("div",G,[i(P,{data:he.value,style:{width:"100%"},"table-layout":"auto",stripe:"",onSelectionChange:Ee},{default:c((()=>[d(se).length>0?(u(),n(T,{key:0,type:"selection"})):p("",!0),(u(!0),o(s,null,y(ve.value,(e=>(u(),o(s,null,["items"===e.type?(u(),n(T,{key:0,prop:"jsonValue",label:e.name,"show-overflow-tooltip":{effect:"light",placement:"top"}},null,8,["label"])):"tagStatus"===e.type?(u(),n(T,{key:1,prop:"tagValue"+e.key,label:e.name},{default:c((l=>[i(N,{type:l.row["tagColor"+e.key]},{default:c((()=>[b(V(l.row["tagValue"+e.key]),1)])),_:2},1032,["type"])])),_:2},1032,["prop","label"])):e.big_column?(u(),n(T,{key:2,prop:e.key,label:e.name,"show-overflow-tooltip":{effect:"light",placement:"top"}},{header:c((()=>[""!==e.help_text?(u(),n(W,{key:0,effect:"light",content:e.help_text,placement:"top"},{default:c((()=>[x("span",null,V(e.name),1)])),_:2},1032,["content"])):(u(),o("span",K,V(e.name),1))])),_:2},1032,["prop","label"])):(u(),n(T,{key:3,prop:e.key,label:e.name},{header:c((()=>[""!==e.help_text?(u(),n(W,{key:0,effect:"light",content:e.help_text,placement:"top"},{default:c((()=>[x("span",null,V(e.name),1)])),_:2},1032,["content"])):(u(),o("span",Q,V(e.name),1))])),_:2},1032,["prop","label"]))],64)))),256)),i(T,{prop:"func",label:"功 能"},{default:c((e=>[!0===d(de).meta.methods.put?(u(),n(E,{key:0,size:Ye.value,type:"success",onClick:l=>{return a=e.$index,t=e.row,Ie.value=t,Ie.value.oldData=t,Ie.value.oldIndex=a,void(Ae.value=!0);var a,t}},{default:c((()=>l[20]||(l[20]=[x("span",null,"编辑",-1)]))),_:2},1032,["size","onClick"])):p("",!0),!0===d(de).meta.methods.delete?(u(),n(E,{key:1,size:Ye.value,type:"danger",onClick:l=>{return a=e.$index,t=e.row,void j.confirm("确定要删除吗?").then((()=>{S(me,{id:t.ID}).then((e=>{R({title:"删除结果通知",message:"删除数据["+t.ID+"]成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0}),he.value.splice(a,1)}),(e=>{console.log("delet error:",e)}))})).catch((()=>{}));var a,t}},{default:c((()=>l[21]||(l[21]=[x("span",null,"删除",-1)]))),_:2},1032,["size","onClick"])):p("",!0),(u(!0),o(s,null,y(d(pe),((l,a)=>(u(),o(s,null,[0===l.btn_type?(u(),n(E,{key:0,size:Ye.value,type:l.btn_color_type,onClick:a=>{return t=l,e.$index,o=e.row,void(t.btn_type>0?t.btn_type:Fe(t,[o]));var t,o}},{default:c((()=>[b(V(l.name),1)])),_:2},1032,["size","type","onClick"])):1===l.btn_type?(u(),n(E,{key:1,size:Ye.value,type:l.btn_color_type,onClick:l=>{return t=a,o=e.row,ie.value=o,ce[t]=!0,void console.log("点击按钮:",ie);var t,o}},{default:c((()=>[b(V(l.name),1)])),_:2},1032,["size","type","onClick"])):2===l.btn_type?(u(),n(E,{key:2,size:Ye.value,type:l.btn_color_type,onClick:a=>{return t=l,o=e.row,void t.click_handler(o);var t,o}},{default:c((()=>[b(V(l.name),1)])),_:2},1032,["size","type","onClick"])):p("",!0)],64)))),256))])),_:1})])),_:1},8,["data"])]),x("div",ee,[i(le,{"current-page":ke.value,"onUpdate:currentPage":l[1]||(l[1]=e=>ke.value=e),"page-size":ge.value,"onUpdate:pageSize":l[2]||(l[2]=e=>ge.value=e),"page-sizes":be,layout:"total, sizes, prev, pager, next, jumper",total:Ve.value,onSizeChange:We,onCurrentChange:Je},null,8,["current-page","page-size","total"])])]),(u(!0),o(s,null,y(d(pe),((e,l)=>(u(),n(ae,{modelValue:d(ce)[l],"onUpdate:modelValue":e=>d(ce)[l]=e,title:e.name,onClose:e=>d(ce)[l]=!1,"destroy-on-close":""},{default:c((()=>[(u(),n(r(e.btn_callback_component),{rowInfo:ie.value,fieldsDescInfo:ve.value},null,8,["rowInfo","fieldsDescInfo"]))])),_:2},1032,["modelValue","onUpdate:modelValue","title","onClose"])))),256)),i(ae,{modelValue:ze.value,"onUpdate:modelValue":l[11]||(l[11]=e=>ze.value=e),mask:!0,title:"添加",modal:!0,"before-close":Be,"destroy-on-close":""},{default:c((()=>[i(ne,{ref_key:"dialogAddFormRef",ref:Me,model:Ie.value,rules:_e.value,"label-position":"right","label-width":"130px"},{default:c((()=>[(u(!0),o(s,null,y(ve.value,(e=>(u(),o(s,null,["items"===e.type?(u(),o(s,{key:0},[i(ne,{inline:!0,model:we.value,"label-position":"right"},{default:c((()=>[i(oe,{label:e.name,prop:e.key,"label-width":"130px"},{default:c((()=>[i(W,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:c((()=>[i(q,{modelValue:we.value,"onUpdate:modelValue":l[3]||(l[3]=e=>we.value=e),placeholder:"--搜索道具--",style:{width:"150px"},filterable:"",remote:"",clearable:"","remote-method":Te,loading:Oe.value,"value-key":"value"},{default:c((()=>[(u(!0),o(s,null,y($e.value,(e=>(u(),n(t,{key:e.value,label:e.desc,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue","loading"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"]),i(oe,{label:"数量",prop:"num"},{default:c((()=>[i(F,{type:"number",modelValue:xe.value,"onUpdate:modelValue":l[4]||(l[4]=e=>xe.value=e),placeholder:"请输入数量",style:{width:"150px"}},null,8,["modelValue"])])),_:1}),"item_bag"!==d(te).meta.resource?(u(),n(oe,{key:0},{default:c((()=>[i(W,{effect:"light",content:"选择礼包,点击添加到奖励列表"},{default:c((()=>[i(q,{placeholder:"--礼包--",modelValue:Ue.value,"onUpdate:modelValue":l[5]||(l[5]=e=>Ue.value=e),clearable:"",style:{width:"150px"},"value-key":"name"},{default:c((()=>[(u(!0),o(s,null,y(fe.value,(e=>(u(),n(t,{key:e.name,label:e.name,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})):p("",!0),i(oe,null,{default:c((()=>[i(E,{type:"primary",onClick:e=>Se()},{default:c((()=>l[22]||(l[22]=[b("添加")]))),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["model"]),i(oe,{label:"奖励列表",prop:"Attach"},{default:c((()=>[i(P,{data:Ie.value.Attach,border:""},{default:c((()=>[i(T,{label:"道具id",prop:"id"}),i(T,{label:"数量",prop:"num"}),i(T,{label:"道具名",prop:"desc"}),i(T,{label:"操作"},{default:c((e=>[i(E,{type:"danger",size:"small",onClick:l=>Le(e.row)},{default:c((()=>l[23]||(l[23]=[b("删除")]))),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})],64)):!0!==e.readonly?(u(),o(s,{key:1},[void 0!==e.choices&&e.choices.length>0?(u(),n(oe,{key:0,label:e.name,prop:e.key},{default:c((()=>[i(W,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:c((()=>[i(q,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:c((()=>[(u(!0),o(s,null,y(e.choices,(e=>(u(),n(t,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(u(),n(oe,{key:1,label:e.name,prop:e.key},{default:c((()=>[i(a,{modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,type:"datetime",placeholder:"选个时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):"randAccount"===e.type?(u(),n(oe,{key:2,label:e.name,prop:e.key},{default:c((()=>[i(L,{style:{"margin-bottom":"10px"}},{default:c((()=>[l[25]||(l[25]=x("span",null,"随机数量:",-1)),i(W,{effect:"light",placement:"top-start",content:"输入生成账号的数量,数量范围[1-1000],数量太大了后台短时间生成不完,注意多等几分钟会再发放账号"},{default:c((()=>[i(F,{type:"number",modelValue:Pe.value,"onUpdate:modelValue":l[6]||(l[6]=e=>Pe.value=e),placeholder:"账号数量",style:{width:"90px"}},null,8,["modelValue"])])),_:1}),l[26]||(l[26]=x("span",{style:{"margin-left":"10px"}},"随机模板:",-1)),i(W,{effect:"light",placement:"top",content:"前缀、后缀必填至少一个"},{default:c((()=>[i(F,{modelValue:Xe.value,"onUpdate:modelValue":l[7]||(l[7]=e=>Xe.value=e),placeholder:"前缀",style:{width:"100px","margin-right":"5px"}},null,8,["modelValue"])])),_:1}),i(W,{effect:"light",placement:"top",content:"账号随机混淆字串的位数,范围[3-20],与前缀、后缀一起组成账号"},{default:c((()=>[i(F,{type:"number",modelValue:Ze.value,"onUpdate:modelValue":l[8]||(l[8]=e=>Ze.value=e),placeholder:"随机串数量",style:{width:"80px","margin-right":"5px"}},null,8,["modelValue"])])),_:1}),i(W,{effect:"light",placement:"top",content:"前缀、后缀必填至少一个"},{default:c((()=>[i(F,{modelValue:Ge.value,"onUpdate:modelValue":l[9]||(l[9]=e=>Ge.value=e),placeholder:"后缀",style:{width:"100px","margin-right":"5px"}},null,8,["modelValue"])])),_:1}),i(E,{type:"success",onClick:Qe},{default:c((()=>l[24]||(l[24]=[b("生成")]))),_:1})])),_:1}),i(F,{modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text,type:"textarea",autosize:{minRows:5,maxRows:20}},null,8,["modelValue","onUpdate:modelValue","placeholder"])])),_:2},1032,["label","prop"])):(u(),n(oe,{key:3,label:e.name,prop:e.key},{default:c((()=>["text"===e.type?(u(),n(F,{key:0,modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text,type:"textarea",autosize:{minRows:2,maxRows:10}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(u(),n(F,{key:1,modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text},null,8,["modelValue","onUpdate:modelValue","placeholder"]))])),_:2},1032,["label","prop"]))],64)):p("",!0)],64)))),256)),i(oe,null,{default:c((()=>[i(E,{onClick:l[10]||(l[10]=e=>(async()=>{try{await Me.value.validate((e=>{e&&(console.log("commit add form:",Ie.value),B(me,Ie.value).then((e=>{R({title:"添加结果通知",message:"添加成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0});const l=Ce(ve.value,e.data.dto);he.value.unshift(l),ze.value=!1,Be()}),(e=>{console.log("添加报错:",e)})),console.log("提交数据:",Ie.value))}))}catch(e){console.log("校验失败:",e)}})(Me.value)),size:"large",type:"primary"},{default:c((()=>l[27]||(l[27]=[b("提交")]))),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["modelValue"]),i(ae,{modelValue:Ae.value,"onUpdate:modelValue":l[16]||(l[16]=e=>Ae.value=e),mask:!0,title:"编辑",modal:!0,"before-close":Be,"destroy-on-close":""},{default:c((()=>[i(ne,{ref_key:"dialogEditFormRef",ref:He,model:Ie.value,rules:_e.value,class:"operation_form","label-width":"130px"},{default:c((()=>[(u(!0),o(s,null,y(ve.value,(e=>(u(),o(s,null,["items"===e.type?(u(),o(s,{key:0},[i(ne,{inline:!0,model:we.value,"label-position":"right","label-width":"130px"},{default:c((()=>[i(oe,{label:e.name,prop:e.key},{default:c((()=>[i(W,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:c((()=>[i(q,{placeholder:"--搜索道具--",modelValue:we.value,"onUpdate:modelValue":l[12]||(l[12]=e=>we.value=e),style:{width:"150px"},filterable:"",remote:"","remote-method":Te,loading:Oe.value,"value-key":"value"},{default:c((()=>[(u(!0),o(s,null,y($e.value,(e=>(u(),n(t,{key:e.value,label:e.desc,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue","loading"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"]),i(oe,{label:"数量",prop:"number"},{default:c((()=>[i(F,{type:"number",modelValue:xe.value,"onUpdate:modelValue":l[13]||(l[13]=e=>xe.value=e),placeholder:"请输入数量",style:{width:"150px"}},null,8,["modelValue"])])),_:1}),"item_bag"!==d(te).meta.resource?(u(),n(oe,{key:0},{default:c((()=>[i(W,{effect:"light",content:"选择礼包,点击添加到奖励列表"},{default:c((()=>[i(q,{placeholder:"--礼包--",modelValue:Ue.value,"onUpdate:modelValue":l[14]||(l[14]=e=>Ue.value=e),clearable:"",style:{width:"150px"},"value-key":"name"},{default:c((()=>[(u(!0),o(s,null,y(fe.value,(e=>(u(),n(t,{key:e.name,label:e.name,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1})):p("",!0),i(oe,null,{default:c((()=>[i(E,{type:"primary",onClick:e=>Se()},{default:c((()=>l[28]||(l[28]=[b("添加")]))),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["model"]),i(oe,{label:"奖励列表",prop:"Attach"},{default:c((()=>[i(P,{data:Ie.value.Attach,border:""},{default:c((()=>[i(T,{label:"道具id",prop:"id"}),i(T,{label:"数量",prop:"num"}),i(T,{label:"道具名",prop:"desc"}),i(T,{label:"操作"},{default:c((e=>[i(E,{type:"danger",size:"small",onClick:l=>Le(e.row)},{default:c((()=>l[29]||(l[29]=[b("删除")]))),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})],64)):!0!==e.readonly?(u(),o(s,{key:1},[!0!==e.uneditable?(u(),o(s,{key:0},[void 0!==e.choices&&e.choices.length>0?(u(),n(oe,{key:0,label:e.name,prop:e.key},{default:c((()=>[i(W,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:c((()=>[i(q,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:c((()=>[(u(!0),o(s,null,y(e.choices,(e=>(u(),n(t,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(u(),n(oe,{key:1,label:e.name,prop:e.key},{default:c((()=>[i(a,{modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,type:"datetime",placeholder:"选个时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):(u(),n(oe,{key:2,label:e.name,prop:e.key},{default:c((()=>["text"===e.type?(u(),n(F,{key:0,modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text,type:"textarea",autosize:{minRows:2,maxRows:10}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(u(),n(F,{key:1,modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text},null,8,["modelValue","onUpdate:modelValue","placeholder"]))])),_:2},1032,["label","prop"]))],64)):(u(),n(oe,{key:1,label:e.name,prop:e.key},{default:c((()=>[i(F,{modelValue:Ie.value[e.key],"onUpdate:modelValue":l=>Ie.value[e.key]=l,placeholder:e.help_text,disabled:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])])),_:2},1032,["label","prop"]))],64)):p("",!0)],64)))),256)),i(oe,null,{default:c((()=>[i(E,{onClick:l[15]||(l[15]=e=>(async()=>{try{await He.value.validate((e=>{if(e){const e=Ie.value.oldIndex;Ie.value.oldData,delete Ie.value.oldIndex,delete Ie.value.oldData,O(me,Ie.value).then((l=>{R({title:"编辑结果通知",message:"编辑成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0}),Ae.value=!1,he.value[e]=Ce(ve.value,l.data.dto),Be()}),(e=>{console.log("添加报错:",e)})),console.log("提交数据:",Ie.value)}}))}catch(e){console.log("校验失败:",e)}})(He.value)),size:"large",type:"primary"},{default:c((()=>l[30]||(l[30]=[b("提交")]))),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["modelValue"])])),_:1})])),_:1})):p("",!0)],64)):(u(),n(r(J),{key:0}))])}}},[["__scopeId","data-v-45466dde"]]);export{le as t}; diff --git a/admin/ui/static/static/js/tableUser-CnqaLxm-.js b/admin/ui/static/static/js/tableUser-CnqaLxm-.js new file mode 100644 index 0000000..48d6109 --- /dev/null +++ b/admin/ui/static/static/js/tableUser-CnqaLxm-.js @@ -0,0 +1 @@ +import{S as e,r as l,T as a,l as t,a as o,o as u,c as d,u as n,B as s,F as r,U as i,w as p,b as c,V as m,W as v,v as y,C as h,d as f,X as k,z as _,Y as b,p as g,t as V,Z as w,_ as C,$ as U,a0 as x,E as z,a1 as D,a2 as Y,a3 as E,a4 as S,a5 as j,D as P,f as A,a6 as I,I as H}from"./vendor-CF1QNs3T.js";import{r as M,a as R,b as B,c as $}from"./resource-BKdHLLMe.js";import{_ as F,L as N,g as T}from"./index-UuEmTaM1.js";import{e as q}from"./empty-BUY6hahc.js";function J(e){let l=[],a=0;return e.forEach((e=>{a++;let t={id:a,label:e.project_name,key:"project",children:[]};e.resource_total_list.forEach((l=>{a++;let o={id:a,label:l.desc,key:"resource",children:[]};for(let t=0;t!1))),ee=l(null),le=l({fields_desc:[],rows:[]}),ae=l(!1),te=Z,oe=void 0!==te.meta.methods.get&&!0===te.meta.methods.get,ue=Z.meta.resource_url,de=l([]),ne=l([]),se=l([]),re=l({}),ie=l(1),pe=l(10),ce=[10,20,50,100],me=l(0),ve=l({id:0,number:1}),ye=T(),he={children:"children",label:"label"},fe=l([]),ke=l([]),_e=async()=>{try{let l={page_no:ie.value,page_len:pe.value,where_conditions:""},a={conditions:[]};ne.value.forEach((e=>{(e.value1||e.value2)&&a.conditions.push({key:e.key,op:e.where,value1:e.value1,value2:e.value2})})),l.where_conditions=JSON.stringify(a);const t=await M(ue,l);if(le.value=t,200!==le.value.code)throw new Error("请求失败,错误码:",le.code);de.value=le.value.data.fields_desc,me.value=le.value.data.total_count,se.value=le.value.data.rows;for(let o=0;o{oe&&_e()}));const be=l(!1),ge=l(!1),Ve=l(null),we=l(null),Ce=l({ServerIDs:[],Attach:[],Permissions:[]}),Ue=l({});function xe(e){if(null==ve.value.id||""==ve.value.id||ve.value.id<0)return void H("请选择道具!");if(null==ve.value.num||""==ve.value.num||ve.value.num<=0)return void H("请输入有效道具数量!");let l={id:ve.value.id,num:Number(ve.value.num)};for(let a=0;al===e));Ce.value.Attach.splice(l,1)}const De=(e,l,a)=>{l?"project"==e.key?e.children.forEach((e=>{e.children.forEach((e=>{ke.value.push(e.permissionStr)}))})):"resource"==e.key?e.children.forEach((e=>{ke.value.push(e.permissionStr)})):ke.value.push(e.permissionStr):"project"==e.key?e.children.forEach((e=>{e.children.forEach((e=>{ke.value=ke.value.filter((l=>l!==e.permissionStr))}))})):"resource"==e.key?e.children.forEach((e=>{ke.value=ke.value.filter((l=>l!==e.permissionStr))})):ke.value=ke.value.filter((l=>l!==e.permissionStr)),console.log("权限被点击了:",e,l,a),console.log("权限点击后:",ke.value)},Ye=()=>{console.log("关闭添加/编辑弹窗"),be.value=!1,ge.value=!1,Ce.value={Attach:[],Permissions:[]},Ue.value={},ke.value=[]},Ee=e=>{me.value<=0||pe.value*ie.value>me.value&&se.value.length>=me.value||_e()},Se=e=>{_e()};return(e,l)=>{const a=v,H=m,M=b,F=t("Edit"),N=g,T=t("Delete"),J=k,Z=w,G=Y,le=D,ne=z,ye=x,_e=E,je=U,Pe=S,Ae=j,Ie=C,He=h,Me=P;return u(),o("div",L,[n(oe)?(u(),o(r,{key:1},[ae.value?(u(),d(Me,{key:0},{default:p((()=>[c(H,null,{default:p((()=>[!0===n(te).meta.methods.post?(u(),d(a,{key:0,onClick:l[0]||(l[0]=e=>be.value=!0),size:"large",type:"primary"},{default:p((()=>l[11]||(l[11]=[y(" 添加 ")]))),_:1})):i("",!0)])),_:1}),c(He,null,{default:p((()=>[f("div",O,[f("div",W,[c(J,{data:se.value,style:{width:"100%"},"table-layout":"auto",stripe:""},{default:p((()=>[(u(!0),o(r,null,_(de.value,(e=>(u(),o(r,null,["items"===e.type?(u(),d(M,{key:0,prop:"jsonValue",label:e.name},null,8,["label"])):"UserPass"===e.key?(u(),d(M,{key:1,prop:"jsonValue",label:e.name},null,8,["label"])):"Permissions"===e.key?(u(),d(M,{key:2,prop:e.key,label:e.name,"show-overflow-tooltip":""},null,8,["prop","label"])):(u(),d(M,{key:3,prop:e.key,label:e.name},null,8,["prop","label"]))],64)))),256)),c(M,{prop:"func",label:"功 能"},{default:p((t=>[!0===n(te).meta.methods.put?(u(),d(a,{key:0,size:"default",type:"success",onClick:e=>{return l=t.$index,a=t.row,Ue.value.oldData=a,Ue.value.oldIndex=l,Ue.value=a,console.log("edit data:",a),ge.value=!0,void(0!=fe.value.length&&(ke.value=function(e,l){let a=[];return e.forEach((e=>{e.children.forEach((e=>{e.children.forEach((e=>{for(let t=0;t[c(N,{style:{"vertical-align":"middle"}},{default:p((()=>[c(F)])),_:1}),l[12]||(l[12]=f("span",null,"编辑",-1))])),_:2},1032,["onClick"])):i("",!0),(u(!0),o(r,null,_(n(K),((l,n)=>(u(),o(r,null,[0===l.btn_type?(u(),d(a,{key:0,size:"default",type:l.btn_color_type,onClick:a=>e.tableSelectRows2(l,t.$index,t.row)},{default:p((()=>[y(V(l.name),1)])),_:2},1032,["type","onClick"])):1===l.btn_type?(u(),d(a,{key:1,size:"default",type:l.btn_color_type,onClick:e=>{return l=n,a=t.row,ee.value=a,Q[l]=!0,void console.log("点击按钮:",ee);var l,a}},{default:p((()=>[y(V(l.name),1)])),_:2},1032,["type","onClick"])):2===l.btn_type?(u(),d(a,{key:2,size:"default",type:l.btn_color_type,onClick:a=>e.tableSelectRow4(l,t.row)},{default:p((()=>[y(V(l.name),1)])),_:2},1032,["type","onClick"])):i("",!0)],64)))),256)),!0===n(te).meta.methods.delete?(u(),d(a,{key:1,size:"default",type:"danger",onClick:e=>{return l=t.$index,a=t.row,void A.confirm("确定要删除吗?").then((()=>{R(ue,{id:a.ID}).then((e=>{I({title:"删除结果通知",message:"删除数据["+a.ID+"]成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0}),se.value.splice(l,1)}),(e=>{console.log("delet error:",e)}))})).catch((()=>{}));var l,a}},{default:p((()=>[c(N,{style:{"vertical-align":"middle"}},{default:p((()=>[c(T)])),_:1}),l[13]||(l[13]=f("span",null,"删除",-1))])),_:2},1032,["onClick"])):i("",!0)])),_:1})])),_:1},8,["data"])]),f("div",X,[c(Z,{"current-page":ie.value,"onUpdate:currentPage":l[1]||(l[1]=e=>ie.value=e),"page-size":pe.value,"onUpdate:pageSize":l[2]||(l[2]=e=>pe.value=e),"page-sizes":ce,layout:"total, sizes, prev, pager, next, jumper",total:me.value,onSizeChange:Ee,onCurrentChange:Se},null,8,["current-page","page-size","total"])])]),c(Ie,{modelValue:be.value,"onUpdate:modelValue":l[6]||(l[6]=e=>be.value=e),mask:!0,title:"添加",modal:!0,"before-close":Ye,"destroy-on-close":""},{default:p((()=>[c(je,{ref_key:"dialogAddFormRef",ref:Ve,model:Ce.value,rules:re.value,"label-position":"right","label-width":"130px"},{default:p((()=>[(u(!0),o(r,null,_(de.value,(e=>(u(),o(r,null,["items"===e.type?(u(),o(r,{key:0},[c(je,{inline:!0,model:ve.value,"label-position":"right"},{default:p((()=>[c(ye,{label:e.name,prop:e.key,"label-width":"130px"},{default:p((()=>[c(ne,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(le,{placeholder:"--选择道具后填数量点击添加--",modelValue:ve.value.id,"onUpdate:modelValue":l[3]||(l[3]=e=>ve.value.id=e),style:{width:"150px"},filterable:""},{default:p((()=>[(u(!0),o(r,null,_(e.choices,(e=>(u(),d(G,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["modelValue"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"]),c(ye,{label:"数量",prop:"num"},{default:p((()=>[c(_e,{type:"number",modelValue:ve.value.num,"onUpdate:modelValue":l[4]||(l[4]=e=>ve.value.num=e),placeholder:"请输入数量",style:{width:"150px"}},null,8,["modelValue"])])),_:1}),c(ye,null,{default:p((()=>[c(a,{type:"primary",onClick:l=>xe(e)},{default:p((()=>l[14]||(l[14]=[y("添加")]))),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["model"]),c(ye,{label:"奖励列表",prop:"Attach"},{default:p((()=>[c(J,{data:Ce.value.Attach,border:""},{default:p((()=>[c(M,{label:"道具id",prop:"id"}),c(M,{label:"数量",prop:"num"}),c(M,{label:"操作"},{default:p((e=>[c(a,{type:"danger",size:"small",onClick:l=>ze(e.row)},{default:p((()=>l[15]||(l[15]=[y("删除")]))),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})],64)):!0!==e.readonly?(u(),o(r,{key:1},[void 0!==e.choices&&e.choices.length>0?(u(),d(ye,{key:0,label:e.name,prop:e.key},{default:p((()=>[c(ne,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(le,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",modelValue:Ce.value[e.key],"onUpdate:modelValue":l=>Ce.value[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:p((()=>[(u(!0),o(r,null,_(e.choices,(e=>(u(),d(G,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(u(),d(ye,{key:1,label:e.name,prop:e.key},{default:p((()=>[c(Pe,{modelValue:Ce.value[e.key],"onUpdate:modelValue":l=>Ce.value[e.key]=l,type:"datetime",placeholder:"选个时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):"Permissions"===e.key?(u(),d(ye,{key:2,label:e.name,prop:e.key},{default:p((()=>[c(Ae,{ref_for:!0,ref:"treeRef",data:fe.value,"show-checkbox":"","node-key":"id",props:he,onCheckChange:De},null,8,["data"])])),_:2},1032,["label","prop"])):(u(),d(ye,{key:3,label:e.name,prop:e.key},{default:p((()=>["UserPass"===e.key?(u(),d(_e,{key:0,modelValue:Ce.value[e.key],"onUpdate:modelValue":l=>Ce.value[e.key]=l,placeholder:e.help_text,"show-password":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(u(),d(_e,{key:1,modelValue:Ce.value[e.key],"onUpdate:modelValue":l=>Ce.value[e.key]=l,placeholder:e.help_text},null,8,["modelValue","onUpdate:modelValue","placeholder"]))])),_:2},1032,["label","prop"]))],64)):i("",!0)],64)))),256)),c(ye,null,{default:p((()=>[c(a,{onClick:l[5]||(l[5]=e=>(async()=>{try{await Ve.value.validate((e=>{e&&(Ce.value.Permissions=ke.value,console.log("commit add form:",Ce.value),B(ue,Ce.value).then((e=>{I({title:"添加结果通知",message:"添加成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0}),se.value.push(e.data.dto),be.value=!1,Ye()}),(e=>{console.log("添加报错:",e)})),console.log("提交数据:",Ce.value))}))}catch(e){console.log("校验失败:",e)}})(Ve.value)),size:"large",type:"primary"},{default:p((()=>l[16]||(l[16]=[y("提交")]))),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["modelValue"]),c(Ie,{modelValue:ge.value,"onUpdate:modelValue":l[10]||(l[10]=e=>ge.value=e),mask:!0,title:"编辑",modal:!0,"before-close":Ye,"destroy-on-close":""},{default:p((()=>[c(je,{ref_key:"dialogEditFormRef",ref:we,model:Ue.value,rules:re.value,class:"operation_form","label-width":"130px"},{default:p((()=>[(u(!0),o(r,null,_(de.value,(e=>(u(),o(r,null,["items"===e.type?(u(),o(r,{key:0},[c(je,{inline:!0,model:ve.value,"label-position":"right","label-width":"130px"},{default:p((()=>[c(ye,{label:e.name,prop:e.key},{default:p((()=>[c(ne,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(le,{placeholder:"--选择道具后填数量点击添加--",modelValue:ve.value.id,"onUpdate:modelValue":l[7]||(l[7]=e=>ve.value.id=e),style:{width:"150px"},filterable:""},{default:p((()=>[(u(!0),o(r,null,_(e.choices,(e=>(u(),d(G,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["modelValue"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"]),c(ye,{label:"数量",prop:"number"},{default:p((()=>[c(_e,{type:"number",modelValue:ve.value.num,"onUpdate:modelValue":l[8]||(l[8]=e=>ve.value.num=e),placeholder:"请输入数量",style:{width:"150px"}},null,8,["modelValue"])])),_:1}),c(ye,null,{default:p((()=>[c(a,{type:"primary",onClick:l=>xe(e)},{default:p((()=>l[17]||(l[17]=[y("添加")]))),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["model"]),c(ye,{label:"奖励列表",prop:"attachmentsList"},{default:p((()=>[c(J,{data:Ue.value.Attach,border:""},{default:p((()=>[c(M,{label:"道具id",prop:"id"}),c(M,{label:"数量",prop:"num"}),c(M,{label:"操作"},{default:p((e=>[c(a,{type:"danger",size:"small",onClick:l=>ze(e.row)},{default:p((()=>l[18]||(l[18]=[y("删除")]))),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})],64)):!0!==e.readonly?(u(),o(r,{key:1},[!0!==e.uneditable?(u(),o(r,{key:0},[void 0!==e.choices&&e.choices.length>0?(u(),d(ye,{key:0,label:e.name,prop:e.key},{default:p((()=>[c(ne,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(le,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",modelValue:Ue.value[e.key],"onUpdate:modelValue":l=>Ue.value[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:p((()=>[(u(!0),o(r,null,_(e.choices,(e=>(u(),d(G,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(u(),d(ye,{key:1,label:e.name,prop:e.key},{default:p((()=>[c(Pe,{modelValue:Ue.value[e.key],"onUpdate:modelValue":l=>Ue.value[e.key]=l,type:"datetime",placeholder:"选个时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):"Permissions"===e.key?(u(),d(ye,{key:2,label:e.name,prop:e.key},{default:p((()=>[c(Ae,{ref_for:!0,ref:"treeRef",data:fe.value,"show-checkbox":"","node-key":"id","default-checked-keys":ke.value,props:he,onCheckChange:De},null,8,["data","default-checked-keys"])])),_:2},1032,["label","prop"])):(u(),d(ye,{key:3,label:e.name,prop:e.key},{default:p((()=>["UserPass"===e.key?(u(),d(_e,{key:0,modelValue:Ue.value[e.key],"onUpdate:modelValue":l=>Ue.value[e.key]=l,placeholder:e.help_text,"show-password":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(u(),d(_e,{key:1,modelValue:Ue.value[e.key],"onUpdate:modelValue":l=>Ue.value[e.key]=l,placeholder:e.help_text},null,8,["modelValue","onUpdate:modelValue","placeholder"]))])),_:2},1032,["label","prop"]))],64)):(u(),d(ye,{key:1,label:e.name,prop:e.key},{default:p((()=>[c(_e,{modelValue:Ue.value[e.key],"onUpdate:modelValue":l=>Ue.value[e.key]=l,placeholder:e.help_text,disabled:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])])),_:2},1032,["label","prop"]))],64)):i("",!0)],64)))),256)),c(ye,null,{default:p((()=>[c(a,{onClick:l[9]||(l[9]=e=>(async()=>{try{await we.value.validate((e=>{e&&(Ue.value.Permissions=ke.value,$(ue,Ue.value).then((e=>{I({title:"编辑结果通知",message:"编辑成功!如果页面没有变化,刷新一下!",type:"success",duration:4e3,"show-close":!0}),ge.value=!1,se.value[Ue.value.oldIndex]=e.data.dto,Ye()}),(e=>{console.log("添加报错:",e)})),console.log("提交数据:",Ue.value))}))}catch(e){console.log("校验失败:",e)}})(we.value)),size:"large",type:"primary"},{default:p((()=>l[19]||(l[19]=[y("提交")]))),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["modelValue"]),(u(!0),o(r,null,_(n(K),((e,l)=>(u(),d(Ie,{modelValue:n(Q)[l],"onUpdate:modelValue":e=>n(Q)[l]=e,title:e.name,onClose:e=>n(Q)[l]=!1,"destroy-on-close":""},{default:p((()=>[f("div",null,[(u(),d(s(e.btn_callback_component),{rowInfo:ee.value},null,8,["rowInfo"]))])])),_:2},1032,["modelValue","onUpdate:modelValue","title","onClose"])))),256))])),_:1})])),_:1})):i("",!0)],64)):(u(),d(s(q),{key:0}))])}}},[["__scopeId","data-v-01390b3f"]]);export{Z as t}; diff --git a/admin/ui/static/static/js/user-BKNZ5fs6.js b/admin/ui/static/static/js/user-BKNZ5fs6.js new file mode 100644 index 0000000..caac5dd --- /dev/null +++ b/admin/ui/static/static/js/user-BKNZ5fs6.js @@ -0,0 +1 @@ +import{t as e}from"./tableUser-CnqaLxm-.js";import{u as s,L as r}from"./index-UuEmTaM1.js";import{t}from"./history-2-P7j7wj.js";import{a as o,o as a,c as m,B as u}from"./vendor-CF1QNs3T.js";import"./resource-BKdHLLMe.js";import"./empty-BUY6hahc.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}; diff --git a/admin/ui/static/static/js/welcome-NcV1Cu66.js b/admin/ui/static/static/js/welcome-NcV1Cu66.js new file mode 100644 index 0000000..72818ab --- /dev/null +++ b/admin/ui/static/static/js/welcome-NcV1Cu66.js @@ -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-UuEmTaM1.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}; diff --git a/admin/uniugm.db b/admin/uniugm.db new file mode 100644 index 0000000..f968966 Binary files /dev/null and b/admin/uniugm.db differ diff --git a/ui/src/components/restful/table.vue b/ui/src/components/restful/table.vue index a56b6e5..fa83708 100644 --- a/ui/src/components/restful/table.vue +++ b/ui/src/components/restful/table.vue @@ -110,7 +110,7 @@ const handleServerRowData = (fieldsDescInfoData, rowData) => { if (whereField.key === field.key) { whereFieldsDescInfo.value[i].type = field.type whereFieldsDescInfo.value[i].where = field.where - whereFieldsDescInfo.value[i].whereDesc = getWhereConditionDesc(field.where) + whereFieldsDescInfo.value[i].whereDes find = true break } @@ -473,6 +473,10 @@ const handleCloseDialog = () => { query: {} }) } + genRandAccountNum.value = 0 + genRandAccountPrefix.value = "" + genRandAccountCharBitNum.value = 5 + genRandAccountSuffix.value = "" } const loadingRemoteItems = ref(false) @@ -525,6 +529,42 @@ const handlePaginationCurChange = (val) => { listData() } +const genRandAccountNum = ref(0) +const genRandAccountPrefix = ref('') +const genRandAccountCharBitNum = ref(5) +const genRandAccountSuffix = ref('') + +const randCharArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] + +const handleGenRandAccount = () => { + if (genRandAccountNum.value <= 0 || genRandAccountNum.value > 1000) { + alert("数量不合法!!范围[1-1000]") + return + } + if (genRandAccountPrefix.value === "" && genRandAccountSuffix.value === "") { + alert("生成账号的前缀、后缀至少填一个!!") + return + } + + if (genRandAccountCharBitNum.value < 3 || genRandAccountCharBitNum.value > 20) { + alert("生成账号的随机字串长度不合法!!范围[3-20]") + return + } + + let accountList = [] + for (let i = 0; i < genRandAccountNum.value; i++) { + let randStr = "" + for (let j = 0; j < genRandAccountCharBitNum.value; j++) { + randStr += randCharArray[Math.floor(Math.random() * 1000000) %randCharArray.length] + } + const accountName = genRandAccountPrefix.value + randStr + genRandAccountSuffix.value + // console.log("rand account name:", Math.random()) + accountList.push(accountName) + } + dialogObjectForm.value.AccountList = accountList.join(",") +} + + +