refactor: tooltip延迟显示等

This commit is contained in:
meilin.huang
2023-10-31 12:36:04 +08:00
parent f2b0f294d8
commit 3155380f16
17 changed files with 134 additions and 110 deletions

View File

@@ -49,7 +49,7 @@ func (d *Db) Dbs(rc *req.Ctx) {
}
queryCond.TagIds = tagIds
res, err := d.DbApp.GetPageList(queryCond, page, new([]vo.SelectDataDbVO))
res, err := d.DbApp.GetPageList(queryCond, page, new([]vo.DbListVO))
biz.ErrIsNil(err)
rc.ResData = res
}

View File

@@ -24,7 +24,7 @@ type Instance struct {
// @router /api/instances [get]
func (d *Instance) Instances(rc *req.Ctx) {
queryCond, page := ginx.BindQueryAndPage[*entity.InstanceQuery](rc.GinCtx, new(entity.InstanceQuery))
res, err := d.InstanceApp.GetPageList(queryCond, page, new([]vo.SelectDataInstanceVO))
res, err := d.InstanceApp.GetPageList(queryCond, page, new([]vo.InstanceListVO))
biz.ErrIsNil(err)
rc.ResData = res
}

View File

@@ -2,8 +2,7 @@ package vo
import "time"
type SelectDataDbVO struct {
//models.BaseModel
type DbListVO struct {
Id *int64 `json:"id"`
Name *string `json:"name"`
Database *string `json:"database"`
@@ -14,6 +13,9 @@ type SelectDataDbVO struct {
InstanceId *int64 `json:"instanceId"`
InstanceName *string `json:"instanceName"`
InstanceType *string `json:"type"`
Host string `json:"host"`
Port int `json:"port"`
Username string `json:"username"`
CreateTime *time.Time `json:"createTime"`
Creator *string `json:"creator"`

View File

@@ -2,8 +2,7 @@ package vo
import "time"
type SelectDataInstanceVO struct {
//models.BaseModel
type InstanceListVO struct {
Id *int64 `json:"id"`
Name *string `json:"name"`
Host *string `json:"host"`

View File

@@ -19,7 +19,7 @@ func newDbRepo() repository.Db {
// 分页获取数据库信息列表
func (d *dbRepoImpl) GetDbList(condition *entity.DbQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
qd := gormx.NewQueryWithTableName("t_db db").
Select("db.*, inst.name instance_name, inst.type instance_type").
Select("db.*, inst.name instance_name, inst.type instance_type, inst.host, inst.port, inst.username ").
Joins("JOIN t_db_instance inst ON db.instance_id = inst.id").
Eq("db.instance_id", condition.InstanceId).
Like("db.database", condition.Database).