From abd5eb162afb43d6d6f50df1e9ec422b596131ce Mon Sep 17 00:00:00 2001 From: richjohnrambo Date: Tue, 22 Sep 2026 23:17:03 +0800 Subject: [PATCH] feat: add tenant entry application pages --- .../im_tenant_application.go | 34 ++++ .../im_tenant_entry_feedback.go | 34 ++++ .../admin/sys/im_tenant_application.go | 47 ++++++ .../admin/sys/im_tenant_entry_feedback.go | 47 ++++++ server/internal/logic/sys/im_public_upload.go | 90 +++++++++++ .../logic/sys/im_tenant_application.go | 117 ++++++++++++++ .../logic/sys/im_tenant_entry_feedback.go | 111 +++++++++++++ .../model/input/sysin/im_public_upload.go | 23 +++ .../input/sysin/im_tenant_application.go | 63 ++++++++ .../input/sysin/im_tenant_entry_feedback.go | 61 ++++++++ .../router/genrouter/im_tenant_application.go | 7 + .../genrouter/im_tenant_entry_feedback.go | 7 + server/internal/service/sys.go | 146 +++++++++++------- .../data/generate/im_menu_hierarchy.sql | 32 ++++ web/src/api/imTenantApplication/index.ts | 19 +++ web/src/api/imTenantEntryFeedback/index.ts | 19 +++ web/src/views/imTenantApplication/index.vue | 77 +++++++++ web/src/views/imTenantApplication/model.ts | 128 +++++++++++++++ web/src/views/imTenantApplication/view.vue | 125 +++++++++++++++ web/src/views/imTenantEntryFeedback/index.vue | 77 +++++++++ web/src/views/imTenantEntryFeedback/model.ts | 107 +++++++++++++ web/src/views/imTenantEntryFeedback/view.vue | 131 ++++++++++++++++ 22 files changed, 1447 insertions(+), 55 deletions(-) create mode 100644 server/api/admin/imtenantapplication/im_tenant_application.go create mode 100644 server/api/admin/imtenantentryfeedback/im_tenant_entry_feedback.go create mode 100644 server/internal/controller/admin/sys/im_tenant_application.go create mode 100644 server/internal/controller/admin/sys/im_tenant_entry_feedback.go create mode 100644 server/internal/logic/sys/im_public_upload.go create mode 100644 server/internal/logic/sys/im_tenant_application.go create mode 100644 server/internal/logic/sys/im_tenant_entry_feedback.go create mode 100644 server/internal/model/input/sysin/im_public_upload.go create mode 100644 server/internal/model/input/sysin/im_tenant_application.go create mode 100644 server/internal/model/input/sysin/im_tenant_entry_feedback.go create mode 100644 server/internal/router/genrouter/im_tenant_application.go create mode 100644 server/internal/router/genrouter/im_tenant_entry_feedback.go create mode 100644 web/src/api/imTenantApplication/index.ts create mode 100644 web/src/api/imTenantEntryFeedback/index.ts create mode 100644 web/src/views/imTenantApplication/index.vue create mode 100644 web/src/views/imTenantApplication/model.ts create mode 100644 web/src/views/imTenantApplication/view.vue create mode 100644 web/src/views/imTenantEntryFeedback/index.vue create mode 100644 web/src/views/imTenantEntryFeedback/model.ts create mode 100644 web/src/views/imTenantEntryFeedback/view.vue diff --git a/server/api/admin/imtenantapplication/im_tenant_application.go b/server/api/admin/imtenantapplication/im_tenant_application.go new file mode 100644 index 0000000..1aa05de --- /dev/null +++ b/server/api/admin/imtenantapplication/im_tenant_application.go @@ -0,0 +1,34 @@ +// Package imtenantapplication +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package imtenantapplication + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询企业注册申请列表 +type ListReq struct { + g.Meta `path:"/imTenantApplication/list" method:"get" tags:"企业注册申请" summary:"获取企业注册申请列表"` + sysin.ImTenantApplicationListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.ImTenantApplicationListModel `json:"list" dc:"数据列表"` +} + +// ViewReq 获取企业注册申请指定信息 +type ViewReq struct { + g.Meta `path:"/imTenantApplication/view" method:"get" tags:"企业注册申请" summary:"获取企业注册申请指定信息"` + sysin.ImTenantApplicationViewInp +} + +type ViewRes struct { + *sysin.ImTenantApplicationViewModel +} diff --git a/server/api/admin/imtenantentryfeedback/im_tenant_entry_feedback.go b/server/api/admin/imtenantentryfeedback/im_tenant_entry_feedback.go new file mode 100644 index 0000000..2d44022 --- /dev/null +++ b/server/api/admin/imtenantentryfeedback/im_tenant_entry_feedback.go @@ -0,0 +1,34 @@ +// Package imtenantentryfeedback +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package imtenantentryfeedback + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询企业入口反馈列表 +type ListReq struct { + g.Meta `path:"/imTenantEntryFeedback/list" method:"get" tags:"企业入口反馈" summary:"获取企业入口反馈列表"` + sysin.ImTenantEntryFeedbackListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.ImTenantEntryFeedbackListModel `json:"list" dc:"数据列表"` +} + +// ViewReq 获取企业入口反馈指定信息 +type ViewReq struct { + g.Meta `path:"/imTenantEntryFeedback/view" method:"get" tags:"企业入口反馈" summary:"获取企业入口反馈指定信息"` + sysin.ImTenantEntryFeedbackViewInp +} + +type ViewRes struct { + *sysin.ImTenantEntryFeedbackViewModel +} diff --git a/server/internal/controller/admin/sys/im_tenant_application.go b/server/internal/controller/admin/sys/im_tenant_application.go new file mode 100644 index 0000000..c17fef1 --- /dev/null +++ b/server/internal/controller/admin/sys/im_tenant_application.go @@ -0,0 +1,47 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/imtenantapplication" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + ImTenantApplication = cImTenantApplication{} +) + +type cImTenantApplication struct{} + +// List 查看企业注册申请列表 +func (c *cImTenantApplication) List(ctx context.Context, req *imtenantapplication.ListReq) (res *imtenantapplication.ListRes, err error) { + list, totalCount, err := service.SysImTenantApplication().List(ctx, &req.ImTenantApplicationListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.ImTenantApplicationListModel{} + } + + res = new(imtenantapplication.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// View 获取指定企业注册申请信息 +func (c *cImTenantApplication) View(ctx context.Context, req *imtenantapplication.ViewReq) (res *imtenantapplication.ViewRes, err error) { + data, err := service.SysImTenantApplication().View(ctx, &req.ImTenantApplicationViewInp) + if err != nil { + return + } + + res = new(imtenantapplication.ViewRes) + res.ImTenantApplicationViewModel = data + return +} diff --git a/server/internal/controller/admin/sys/im_tenant_entry_feedback.go b/server/internal/controller/admin/sys/im_tenant_entry_feedback.go new file mode 100644 index 0000000..66850b7 --- /dev/null +++ b/server/internal/controller/admin/sys/im_tenant_entry_feedback.go @@ -0,0 +1,47 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/imtenantentryfeedback" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + ImTenantEntryFeedback = cImTenantEntryFeedback{} +) + +type cImTenantEntryFeedback struct{} + +// List 查看企业入口反馈列表 +func (c *cImTenantEntryFeedback) List(ctx context.Context, req *imtenantentryfeedback.ListReq) (res *imtenantentryfeedback.ListRes, err error) { + list, totalCount, err := service.SysImTenantEntryFeedback().List(ctx, &req.ImTenantEntryFeedbackListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.ImTenantEntryFeedbackListModel{} + } + + res = new(imtenantentryfeedback.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// View 获取指定企业入口反馈信息 +func (c *cImTenantEntryFeedback) View(ctx context.Context, req *imtenantentryfeedback.ViewReq) (res *imtenantentryfeedback.ViewRes, err error) { + data, err := service.SysImTenantEntryFeedback().View(ctx, &req.ImTenantEntryFeedbackViewInp) + if err != nil { + return + } + + res = new(imtenantentryfeedback.ViewRes) + res.ImTenantEntryFeedbackViewModel = data + return +} diff --git a/server/internal/logic/sys/im_public_upload.go b/server/internal/logic/sys/im_public_upload.go new file mode 100644 index 0000000..e87c75a --- /dev/null +++ b/server/internal/logic/sys/im_public_upload.go @@ -0,0 +1,90 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/internal/library/storager" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" + "strings" + + "github.com/gogf/gf/v2/encoding/gjson" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" +) + +func loadImPublicUploads(ctx context.Context, fileIds []string) (files []*sysin.ImPublicUploadModel, err error) { + fileIds = compactStringSlice(fileIds) + if len(fileIds) == 0 { + return []*sysin.ImPublicUploadModel{}, nil + } + if err = g.DB().Model("im_public_uploads").Safe().Ctx(ctx). + Fields( + "id", + "file_id", + "purpose", + "mime_type", + "size", + "etag", + "location", + "expires_at", + "created_at", + "uploaded_at", + ). + WhereIn("file_id", fileIds). + OrderAsc("id"). + Scan(&files); err != nil { + return nil, gerror.Wrap(err, "获取公共上传文件信息失败,请稍后重试!") + } + + drive := "" + if conf, confErr := service.SysConfig().GetUpload(ctx); confErr == nil && conf != nil { + drive = conf.Drive + } + for _, file := range files { + file.Url = storager.LastUrl(ctx, file.Location, drive) + } + return +} + +func firstImPublicUpload(ctx context.Context, fileId string) (file *sysin.ImPublicUploadModel, err error) { + files, err := loadImPublicUploads(ctx, []string{fileId}) + if err != nil || len(files) == 0 { + return + } + return files[0], nil +} + +func parseJSONStringSlice(raw string) []string { + raw = strings.TrimSpace(raw) + if raw == "" || raw == "null" { + return nil + } + + var ids []string + if err := gjson.DecodeTo([]byte(raw), &ids); err == nil && len(ids) > 0 { + return compactStringSlice(ids) + } + return compactStringSlice([]string{raw}) +} + +func compactStringSlice(values []string) []string { + res := make([]string, 0, len(values)) + seen := make(map[string]struct{}, len(values)) + for _, value := range values { + value = strings.TrimSpace(value) + if value == "" { + continue + } + if _, ok := seen[value]; ok { + continue + } + seen[value] = struct{}{} + res = append(res, value) + } + return res +} diff --git a/server/internal/logic/sys/im_tenant_application.go b/server/internal/logic/sys/im_tenant_application.go new file mode 100644 index 0000000..a9d87f9 --- /dev/null +++ b/server/internal/logic/sys/im_tenant_application.go @@ -0,0 +1,117 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" +) + +type sSysImTenantApplication struct{} + +func NewSysImTenantApplication() *sSysImTenantApplication { + return &sSysImTenantApplication{} +} + +func init() { + service.RegisterSysImTenantApplication(NewSysImTenantApplication()) +} + +// List 获取企业注册申请列表 +func (s *sSysImTenantApplication) List(ctx context.Context, in *sysin.ImTenantApplicationListInp) (list []*sysin.ImTenantApplicationListModel, totalCount int, err error) { + if err = in.Filter(ctx); err != nil { + return + } + + mod := s.listModel(ctx) + mod = s.applyWhere(mod, in) + mod = mod.Page(in.Page, in.PerPage).OrderDesc("created_at").OrderDesc("id") + + if err = mod.ScanAndCount(&list, &totalCount, false); err != nil { + return nil, 0, gerror.Wrap(err, "获取企业注册申请列表失败,请稍后重试!") + } + return +} + +func (s *sSysImTenantApplication) listModel(ctx context.Context) *gdb.Model { + return g.DB().Model("im_tenant_applications").Safe().Ctx(ctx).Fields( + "id", + "application_id", + "credit_code", + "enterprise_email", + "license_file_id", + "tenant_code_hint", + "status", + "estimated_review_hour", + "submitted_at", + "created_at", + "updated_at", + ) +} + +func (s *sSysImTenantApplication) applyWhere(mod *gdb.Model, in *sysin.ImTenantApplicationListInp) *gdb.Model { + if in.ApplicationId != "" { + mod = mod.WhereLike("application_id", "%"+in.ApplicationId+"%") + } + if in.CreditCode != "" { + mod = mod.WhereLike("credit_code", "%"+in.CreditCode+"%") + } + if in.EnterpriseEmail != "" { + mod = mod.WhereLike("enterprise_email", "%"+in.EnterpriseEmail+"%") + } + if in.TenantCodeHint != "" { + mod = mod.WhereLike("tenant_code_hint", "%"+in.TenantCodeHint+"%") + } + if in.Status != "" { + mod = mod.Where("status", in.Status) + } + if in.Keyword != "" { + like := "%" + in.Keyword + "%" + mod = mod.Where("(application_id LIKE ? OR credit_code LIKE ? OR enterprise_email LIKE ? OR tenant_code_hint LIKE ?)", like, like, like, like) + } + if len(in.CreatedAt) == 2 { + mod = mod.WhereBetween("created_at", in.CreatedAt[0], in.CreatedAt[1]) + } + return mod +} + +// View 获取企业注册申请指定信息 +func (s *sSysImTenantApplication) View(ctx context.Context, in *sysin.ImTenantApplicationViewInp) (res *sysin.ImTenantApplicationViewModel, err error) { + if err = in.Filter(ctx); err != nil { + return + } + + if err = g.DB().Model("im_tenant_applications").Safe().Ctx(ctx). + Fields( + "id", + "application_id", + "credit_code", + "enterprise_email", + "license_file_id", + "tenant_code_hint", + "CAST(client_context AS CHAR) client_context", + "idempotency_key", + "status", + "estimated_review_hour", + "submitted_at", + "created_at", + "updated_at", + ). + Where("id", in.Id). + Scan(&res); err != nil { + return nil, gerror.Wrap(err, "获取企业注册申请信息失败,请稍后重试!") + } + if res == nil { + return + } + res.LicenseFile, err = firstImPublicUpload(ctx, res.LicenseFileId) + return +} diff --git a/server/internal/logic/sys/im_tenant_entry_feedback.go b/server/internal/logic/sys/im_tenant_entry_feedback.go new file mode 100644 index 0000000..ec01c39 --- /dev/null +++ b/server/internal/logic/sys/im_tenant_entry_feedback.go @@ -0,0 +1,111 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" +) + +type sSysImTenantEntryFeedback struct{} + +func NewSysImTenantEntryFeedback() *sSysImTenantEntryFeedback { + return &sSysImTenantEntryFeedback{} +} + +func init() { + service.RegisterSysImTenantEntryFeedback(NewSysImTenantEntryFeedback()) +} + +// List 获取企业入口反馈列表 +func (s *sSysImTenantEntryFeedback) List(ctx context.Context, in *sysin.ImTenantEntryFeedbackListInp) (list []*sysin.ImTenantEntryFeedbackListModel, totalCount int, err error) { + if err = in.Filter(ctx); err != nil { + return + } + + mod := s.listModel(ctx) + mod = s.applyWhere(mod, in) + mod = mod.Page(in.Page, in.PerPage).OrderDesc("created_at").OrderDesc("id") + + if err = mod.ScanAndCount(&list, &totalCount, false); err != nil { + return nil, 0, gerror.Wrap(err, "获取企业入口反馈列表失败,请稍后重试!") + } + return +} + +func (s *sSysImTenantEntryFeedback) listModel(ctx context.Context) *gdb.Model { + return g.DB().Model("im_tenant_entry_feedbacks").Safe().Ctx(ctx).Fields( + "id", + "feedback_id", + "description", + "contact", + "tenant_code_hint", + "status", + "submitted_at", + "created_at", + "updated_at", + ) +} + +func (s *sSysImTenantEntryFeedback) applyWhere(mod *gdb.Model, in *sysin.ImTenantEntryFeedbackListInp) *gdb.Model { + if in.FeedbackId != "" { + mod = mod.WhereLike("feedback_id", "%"+in.FeedbackId+"%") + } + if in.Contact != "" { + mod = mod.WhereLike("contact", "%"+in.Contact+"%") + } + if in.TenantCodeHint != "" { + mod = mod.WhereLike("tenant_code_hint", "%"+in.TenantCodeHint+"%") + } + if in.Status != "" { + mod = mod.Where("status", in.Status) + } + if in.Keyword != "" { + like := "%" + in.Keyword + "%" + mod = mod.Where("(feedback_id LIKE ? OR description LIKE ? OR contact LIKE ? OR tenant_code_hint LIKE ?)", like, like, like, like) + } + if len(in.CreatedAt) == 2 { + mod = mod.WhereBetween("created_at", in.CreatedAt[0], in.CreatedAt[1]) + } + return mod +} + +// View 获取企业入口反馈指定信息 +func (s *sSysImTenantEntryFeedback) View(ctx context.Context, in *sysin.ImTenantEntryFeedbackViewInp) (res *sysin.ImTenantEntryFeedbackViewModel, err error) { + if err = in.Filter(ctx); err != nil { + return + } + + if err = g.DB().Model("im_tenant_entry_feedbacks").Safe().Ctx(ctx). + Fields( + "id", + "feedback_id", + "description", + "contact", + "tenant_code_hint", + "CAST(screenshot_file_ids AS CHAR) screenshot_file_ids", + "CAST(client_context AS CHAR) client_context", + "idempotency_key", + "status", + "submitted_at", + "created_at", + "updated_at", + ). + Where("id", in.Id). + Scan(&res); err != nil { + return nil, gerror.Wrap(err, "获取企业入口反馈信息失败,请稍后重试!") + } + if res == nil { + return + } + res.ScreenshotFiles, err = loadImPublicUploads(ctx, parseJSONStringSlice(res.ScreenshotFileIds)) + return +} diff --git a/server/internal/model/input/sysin/im_public_upload.go b/server/internal/model/input/sysin/im_public_upload.go new file mode 100644 index 0000000..4315178 --- /dev/null +++ b/server/internal/model/input/sysin/im_public_upload.go @@ -0,0 +1,23 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import "github.com/gogf/gf/v2/os/gtime" + +// ImPublicUploadModel 企业注册入口公共上传文件 +type ImPublicUploadModel struct { + Id int64 `json:"id" dc:"ID"` + FileId string `json:"fileId" dc:"文件ID"` + Purpose string `json:"purpose" dc:"用途"` + MimeType string `json:"mimeType" dc:"MIME类型"` + Size int64 `json:"size" dc:"文件大小"` + Etag string `json:"etag" dc:"ETag"` + Location string `json:"location" dc:"存储位置"` + Url string `json:"url" dc:"访问地址"` + ExpiresAt *gtime.Time `json:"expiresAt" dc:"过期时间"` + CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` + UploadedAt *gtime.Time `json:"uploadedAt" dc:"上传完成时间"` +} diff --git a/server/internal/model/input/sysin/im_tenant_application.go b/server/internal/model/input/sysin/im_tenant_application.go new file mode 100644 index 0000000..7d5e300 --- /dev/null +++ b/server/internal/model/input/sysin/im_tenant_application.go @@ -0,0 +1,63 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import ( + "context" + "hotgo/internal/model/input/form" + + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/os/gtime" +) + +// ImTenantApplicationListInp 获取企业注册申请列表 +type ImTenantApplicationListInp struct { + form.PageReq + ApplicationId string `json:"applicationId" dc:"申请ID"` + CreditCode string `json:"creditCode" dc:"统一社会信用代码"` + EnterpriseEmail string `json:"enterpriseEmail" dc:"企业邮箱"` + TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"` + Status string `json:"status" dc:"状态"` + Keyword string `json:"keyword" dc:"关键词"` + CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"` +} + +func (in *ImTenantApplicationListInp) Filter(ctx context.Context) (err error) { + return +} + +type ImTenantApplicationListModel struct { + Id int64 `json:"id" dc:"ID"` + ApplicationId string `json:"applicationId" dc:"申请ID"` + CreditCode string `json:"creditCode" dc:"统一社会信用代码"` + EnterpriseEmail string `json:"enterpriseEmail" dc:"企业邮箱"` + LicenseFileId string `json:"licenseFileId" dc:"营业执照文件ID"` + TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"` + Status string `json:"status" dc:"状态"` + EstimatedReviewHour int `json:"estimatedReviewHour" dc:"预计审核小时"` + SubmittedAt *gtime.Time `json:"submittedAt" dc:"提交时间"` + CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` + UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"` +} + +// ImTenantApplicationViewInp 获取企业注册申请详情 +type ImTenantApplicationViewInp struct { + Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"` +} + +func (in *ImTenantApplicationViewInp) Filter(ctx context.Context) (err error) { + if in.Id <= 0 { + return gerror.New("ID不能为空") + } + return +} + +type ImTenantApplicationViewModel struct { + ImTenantApplicationListModel + ClientContext string `json:"clientContext" dc:"客户端上下文"` + IdempotencyKey string `json:"idempotencyKey" dc:"幂等键"` + LicenseFile *ImPublicUploadModel `json:"licenseFile" dc:"营业执照文件"` +} diff --git a/server/internal/model/input/sysin/im_tenant_entry_feedback.go b/server/internal/model/input/sysin/im_tenant_entry_feedback.go new file mode 100644 index 0000000..39ad797 --- /dev/null +++ b/server/internal/model/input/sysin/im_tenant_entry_feedback.go @@ -0,0 +1,61 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2026 HotGo +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import ( + "context" + "hotgo/internal/model/input/form" + + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/os/gtime" +) + +// ImTenantEntryFeedbackListInp 获取企业入口反馈列表 +type ImTenantEntryFeedbackListInp struct { + form.PageReq + FeedbackId string `json:"feedbackId" dc:"反馈ID"` + Contact string `json:"contact" dc:"联系方式"` + TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"` + Status string `json:"status" dc:"状态"` + Keyword string `json:"keyword" dc:"关键词"` + CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"` +} + +func (in *ImTenantEntryFeedbackListInp) Filter(ctx context.Context) (err error) { + return +} + +type ImTenantEntryFeedbackListModel struct { + Id int64 `json:"id" dc:"ID"` + FeedbackId string `json:"feedbackId" dc:"反馈ID"` + Description string `json:"description" dc:"问题描述"` + Contact string `json:"contact" dc:"联系方式"` + TenantCodeHint string `json:"tenantCodeHint" dc:"商户编码线索"` + Status string `json:"status" dc:"状态"` + SubmittedAt *gtime.Time `json:"submittedAt" dc:"提交时间"` + CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` + UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"` +} + +// ImTenantEntryFeedbackViewInp 获取企业入口反馈详情 +type ImTenantEntryFeedbackViewInp struct { + Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"` +} + +func (in *ImTenantEntryFeedbackViewInp) Filter(ctx context.Context) (err error) { + if in.Id <= 0 { + return gerror.New("ID不能为空") + } + return +} + +type ImTenantEntryFeedbackViewModel struct { + ImTenantEntryFeedbackListModel + ScreenshotFileIds string `json:"screenshotFileIds" dc:"截图文件ID JSON"` + ClientContext string `json:"clientContext" dc:"客户端上下文"` + IdempotencyKey string `json:"idempotencyKey" dc:"幂等键"` + ScreenshotFiles []*ImPublicUploadModel `json:"screenshotFiles" dc:"截图文件"` +} diff --git a/server/internal/router/genrouter/im_tenant_application.go b/server/internal/router/genrouter/im_tenant_application.go new file mode 100644 index 0000000..1300cb2 --- /dev/null +++ b/server/internal/router/genrouter/im_tenant_application.go @@ -0,0 +1,7 @@ +package genrouter + +import "hotgo/internal/controller/admin/sys" + +func init() { + LoginRequiredRouter = append(LoginRequiredRouter, sys.ImTenantApplication) // 企业注册申请 +} diff --git a/server/internal/router/genrouter/im_tenant_entry_feedback.go b/server/internal/router/genrouter/im_tenant_entry_feedback.go new file mode 100644 index 0000000..d17de09 --- /dev/null +++ b/server/internal/router/genrouter/im_tenant_entry_feedback.go @@ -0,0 +1,7 @@ +package genrouter + +import "hotgo/internal/controller/admin/sys" + +func init() { + LoginRequiredRouter = append(LoginRequiredRouter, sys.ImTenantEntryFeedback) // 企业入口反馈 +} diff --git a/server/internal/service/sys.go b/server/internal/service/sys.go index 65b6486..7eae51b 100644 --- a/server/internal/service/sys.go +++ b/server/internal/service/sys.go @@ -350,6 +350,18 @@ type ( // Status 更新IM举报反馈工单状态 Status(ctx context.Context, in *sysin.ImWorkOrderStatusInp) (err error) } + ISysImTenantApplication interface { + // List 获取企业注册申请列表 + List(ctx context.Context, in *sysin.ImTenantApplicationListInp) (list []*sysin.ImTenantApplicationListModel, totalCount int, err error) + // View 获取企业注册申请指定信息 + View(ctx context.Context, in *sysin.ImTenantApplicationViewInp) (res *sysin.ImTenantApplicationViewModel, err error) + } + ISysImTenantEntryFeedback interface { + // List 获取企业入口反馈列表 + List(ctx context.Context, in *sysin.ImTenantEntryFeedbackListInp) (list []*sysin.ImTenantEntryFeedbackListModel, totalCount int, err error) + // View 获取企业入口反馈指定信息 + View(ctx context.Context, in *sysin.ImTenantEntryFeedbackViewInp) (res *sysin.ImTenantEntryFeedbackViewModel, err error) + } ISysImOutbox interface { // List 获取IM Outbox列表 List(ctx context.Context, in *sysin.ImOutboxListInp) (list []*sysin.ImOutboxListModel, totalCount int, err error) @@ -788,61 +800,63 @@ type ( ) var ( - localSysAddons ISysAddons - localSysAddonsConfig ISysAddonsConfig - localSysAttachment ISysAttachment - localSysBlacklist ISysBlacklist - localSysConfig ISysConfig - localSysCron ISysCron - localSysCronGroup ISysCronGroup - localSysCurdDemo ISysCurdDemo - localSysCultivateFlower ISysCultivateFlower - localSysCultivateContent ISysCultivateContent - localSysImTenant ISysImTenant - localSysImMessageEncryption ISysImMessageEncryption - localSysImRegistration ISysImRegistration - localSysImInvite ISysImInvite - localSysImUser ISysImUser - localSysImGroup ISysImGroup - localSysImRealname ISysImRealname - localSysImWorkOrder ISysImWorkOrder - localSysImOutbox ISysImOutbox - localSysImOrg ISysImOrg - localSysImFile ISysImFile - localSysImFilePolicy ISysImFilePolicy - localSysImUserPolicyGroup ISysImUserPolicyGroup - localSysImSensitiveWord ISysImSensitiveWord - localSysImSecurityPolicy ISysImSecurityPolicy - localSysImDashboard ISysImDashboard - localSysImPrivateMessage ISysImPrivateMessage - localSysImGroupMessage ISysImGroupMessage - localSysImUserLoginHistory ISysImUserLoginHistory - localSysImLoginFailureLog ISysImLoginFailureLog - localSysImExternalConfig ISysImExternalConfig - localSysImNotification ISysImNotification - localSysImAppRelease ISysImAppRelease - localSysImAbuseReason ISysImAbuseReason - localSysImMailboxConfig ISysImMailboxConfig - localSysImFeedbackConfig ISysImFeedbackConfig - localSysImWorkbench ISysImWorkbench - localSysImTaskDashboard ISysImTaskDashboard - localSysImAuditLog ISysImAuditLog - localSysImKafkaAudit ISysImKafkaAudit - localSysImKafkaCommand ISysImKafkaCommand - localSysImDeadLetter ISysImDeadLetter - localSysDictData ISysDictData - localSysDictType ISysDictType - localSysEmsLog ISysEmsLog - localSysGenCodes ISysGenCodes - localSysLog ISysLog - localSysLoginLog ISysLoginLog - localSysNormalTreeDemo ISysNormalTreeDemo - localSysOptionTreeDemo ISysOptionTreeDemo - localSysProvinces ISysProvinces - localSysServeLicense ISysServeLicense - localSysServeLog ISysServeLog - localSysSmsLog ISysSmsLog - localSysTestCategory ISysTestCategory + localSysAddons ISysAddons + localSysAddonsConfig ISysAddonsConfig + localSysAttachment ISysAttachment + localSysBlacklist ISysBlacklist + localSysConfig ISysConfig + localSysCron ISysCron + localSysCronGroup ISysCronGroup + localSysCurdDemo ISysCurdDemo + localSysCultivateFlower ISysCultivateFlower + localSysCultivateContent ISysCultivateContent + localSysImTenant ISysImTenant + localSysImMessageEncryption ISysImMessageEncryption + localSysImRegistration ISysImRegistration + localSysImInvite ISysImInvite + localSysImUser ISysImUser + localSysImGroup ISysImGroup + localSysImRealname ISysImRealname + localSysImWorkOrder ISysImWorkOrder + localSysImTenantApplication ISysImTenantApplication + localSysImTenantEntryFeedback ISysImTenantEntryFeedback + localSysImOutbox ISysImOutbox + localSysImOrg ISysImOrg + localSysImFile ISysImFile + localSysImFilePolicy ISysImFilePolicy + localSysImUserPolicyGroup ISysImUserPolicyGroup + localSysImSensitiveWord ISysImSensitiveWord + localSysImSecurityPolicy ISysImSecurityPolicy + localSysImDashboard ISysImDashboard + localSysImPrivateMessage ISysImPrivateMessage + localSysImGroupMessage ISysImGroupMessage + localSysImUserLoginHistory ISysImUserLoginHistory + localSysImLoginFailureLog ISysImLoginFailureLog + localSysImExternalConfig ISysImExternalConfig + localSysImNotification ISysImNotification + localSysImAppRelease ISysImAppRelease + localSysImAbuseReason ISysImAbuseReason + localSysImMailboxConfig ISysImMailboxConfig + localSysImFeedbackConfig ISysImFeedbackConfig + localSysImWorkbench ISysImWorkbench + localSysImTaskDashboard ISysImTaskDashboard + localSysImAuditLog ISysImAuditLog + localSysImKafkaAudit ISysImKafkaAudit + localSysImKafkaCommand ISysImKafkaCommand + localSysImDeadLetter ISysImDeadLetter + localSysDictData ISysDictData + localSysDictType ISysDictType + localSysEmsLog ISysEmsLog + localSysGenCodes ISysGenCodes + localSysLog ISysLog + localSysLoginLog ISysLoginLog + localSysNormalTreeDemo ISysNormalTreeDemo + localSysOptionTreeDemo ISysOptionTreeDemo + localSysProvinces ISysProvinces + localSysServeLicense ISysServeLicense + localSysServeLog ISysServeLog + localSysSmsLog ISysSmsLog + localSysTestCategory ISysTestCategory ) func SysAddons() ISysAddons { @@ -1041,6 +1055,28 @@ func RegisterSysImWorkOrder(i ISysImWorkOrder) { localSysImWorkOrder = i } +func SysImTenantApplication() ISysImTenantApplication { + if localSysImTenantApplication == nil { + panic("implement not found for interface ISysImTenantApplication, forgot register?") + } + return localSysImTenantApplication +} + +func RegisterSysImTenantApplication(i ISysImTenantApplication) { + localSysImTenantApplication = i +} + +func SysImTenantEntryFeedback() ISysImTenantEntryFeedback { + if localSysImTenantEntryFeedback == nil { + panic("implement not found for interface ISysImTenantEntryFeedback, forgot register?") + } + return localSysImTenantEntryFeedback +} + +func RegisterSysImTenantEntryFeedback(i ISysImTenantEntryFeedback) { + localSysImTenantEntryFeedback = i +} + func SysImOutbox() ISysImOutbox { if localSysImOutbox == nil { panic("implement not found for interface ISysImOutbox, forgot register?") diff --git a/server/storage/data/generate/im_menu_hierarchy.sql b/server/storage/data/generate/im_menu_hierarchy.sql index 6da84ba..09b4802 100644 --- a/server/storage/data/generate/im_menu_hierarchy.sql +++ b/server/storage/data/generate/im_menu_hierarchy.sql @@ -90,6 +90,38 @@ LEFT JOIN `hg_admin_role_menu` existing ON existing.`role_id` = rm.`role_id` AND WHERE btn.`name` IN ('imSecurityPolicyView','imSecurityPolicySave','imSecurityPolicyPublish','imSecurityPolicyRestoreDefault','imSecurityPolicyLoginLockoutConfig') AND existing.`menu_id` IS NULL; +INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`) +SELECT @settingsId, '企业注册', 'imTenantApplicationIndex', 'tenant-application/index', '', 2, '', '/imTenantApplication/list', '', '/imTenantApplication/index', 1, 'imSystemSettings', 0, 0, '', 0, 0, 0, 3, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), 80, '', 1, @now, @now +WHERE @settingsId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantApplicationIndex'); + +INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`) +SELECT @settingsId, '企业反馈', 'imTenantEntryFeedbackIndex', 'tenant-entry-feedback/index', '', 2, '', '/imTenantEntryFeedback/list', '', '/imTenantEntryFeedback/index', 1, 'imSystemSettings', 0, 0, '', 0, 0, 0, 3, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), 90, '', 1, @now, @now +WHERE @settingsId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackIndex'); + +SET @tenantApplicationId := (SELECT `id` FROM `hg_admin_menu` WHERE `name`='imTenantApplicationIndex' LIMIT 1); +SET @tenantEntryFeedbackId := (SELECT `id` FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackIndex' LIMIT 1); + +UPDATE `hg_admin_menu` SET `pid`=@settingsId, `title`='企业注册', `path`='tenant-application/index', `permissions`='/imTenantApplication/list', `component`='/imTenantApplication/index', `active_menu`='imSystemSettings', `type`=2, `level`=3, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), `sort`=80, `hidden`=0, `status`=1, `updated_at`=@now WHERE `id`=@tenantApplicationId; +UPDATE `hg_admin_menu` SET `pid`=@settingsId, `title`='企业反馈', `path`='tenant-entry-feedback/index', `permissions`='/imTenantEntryFeedback/list', `component`='/imTenantEntryFeedback/index', `active_menu`='imSystemSettings', `type`=2, `level`=3, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' '), `sort`=90, `hidden`=0, `status`=1, `updated_at`=@now WHERE `id`=@tenantEntryFeedbackId; + +INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`) +SELECT @tenantApplicationId, '企业注册详情', 'imTenantApplicationView', '', '', 3, '', '/imTenantApplication/view', '', '', 1, '', 0, 0, '', 0, 1, 0, 4, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantApplicationId, ' '), 10, '', 1, @now, @now +WHERE @tenantApplicationId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantApplicationView'); + +INSERT INTO `hg_admin_menu` (`pid`, `title`, `name`, `path`, `icon`, `type`, `redirect`, `permissions`, `permission_name`, `component`, `always_show`, `active_menu`, `is_root`, `is_frame`, `frame_src`, `keep_alive`, `hidden`, `affix`, `level`, `tree`, `sort`, `remark`, `status`, `created_at`, `updated_at`) +SELECT @tenantEntryFeedbackId, '企业反馈详情', 'imTenantEntryFeedbackView', '', '', 3, '', '/imTenantEntryFeedback/view', '', '', 1, '', 0, 0, '', 0, 1, 0, 4, CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantEntryFeedbackId, ' '), 10, '', 1, @now, @now +WHERE @tenantEntryFeedbackId IS NOT NULL AND NOT EXISTS (SELECT 1 FROM `hg_admin_menu` WHERE `name`='imTenantEntryFeedbackView'); + +UPDATE `hg_admin_menu` SET `pid`=@tenantApplicationId, `title`='企业注册详情', `permissions`='/imTenantApplication/view', `type`=3, `level`=4, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantApplicationId, ' '), `hidden`=1, `status`=1, `updated_at`=@now WHERE `name`='imTenantApplicationView'; +UPDATE `hg_admin_menu` SET `pid`=@tenantEntryFeedbackId, `title`='企业反馈详情', `permissions`='/imTenantEntryFeedback/view', `type`=3, `level`=4, `tree`=CONCAT('tr_', @imRootId, ' tr_', @settingsId, ' tr_', @tenantEntryFeedbackId, ' '), `hidden`=1, `status`=1, `updated_at`=@now WHERE `name`='imTenantEntryFeedbackView'; + +INSERT INTO `hg_admin_role_menu` (`role_id`, `menu_id`) +SELECT DISTINCT rm.`role_id`, menu.`id` +FROM `hg_admin_role_menu` rm +JOIN `hg_admin_menu` menu ON menu.`name` IN ('imTenantApplicationIndex', 'imTenantApplicationView', 'imTenantEntryFeedbackIndex', 'imTenantEntryFeedbackView') +LEFT JOIN `hg_admin_role_menu` existing ON existing.`role_id`=rm.`role_id` AND existing.`menu_id`=menu.`id` +WHERE rm.`menu_id`=@settingsId AND existing.`menu_id` IS NULL; + -- Remove one-page wrapper directories after their page has been moved. UPDATE `hg_admin_menu` SET `status`=2, `hidden`=1, `updated_at`=@now WHERE `name` IN ('imUser', 'imGroup', 'imTenant', 'imRealname', 'imWorkOrder', 'imAuditLog', 'imOutbox'); diff --git a/web/src/api/imTenantApplication/index.ts b/web/src/api/imTenantApplication/index.ts new file mode 100644 index 0000000..79406ce --- /dev/null +++ b/web/src/api/imTenantApplication/index.ts @@ -0,0 +1,19 @@ +import { http } from '@/utils/http/axios'; + +// 获取企业注册申请列表 +export function List(params) { + return http.request({ + url: '/imTenantApplication/list', + method: 'get', + params, + }); +} + +// 获取企业注册申请详情 +export function View(params) { + return http.request({ + url: '/imTenantApplication/view', + method: 'GET', + params, + }); +} diff --git a/web/src/api/imTenantEntryFeedback/index.ts b/web/src/api/imTenantEntryFeedback/index.ts new file mode 100644 index 0000000..0645089 --- /dev/null +++ b/web/src/api/imTenantEntryFeedback/index.ts @@ -0,0 +1,19 @@ +import { http } from '@/utils/http/axios'; + +// 获取企业反馈列表 +export function List(params) { + return http.request({ + url: '/imTenantEntryFeedback/list', + method: 'get', + params, + }); +} + +// 获取企业反馈详情 +export function View(params) { + return http.request({ + url: '/imTenantEntryFeedback/view', + method: 'GET', + params, + }); +} diff --git a/web/src/views/imTenantApplication/index.vue b/web/src/views/imTenantApplication/index.vue new file mode 100644 index 0000000..b4c6757 --- /dev/null +++ b/web/src/views/imTenantApplication/index.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/web/src/views/imTenantApplication/model.ts b/web/src/views/imTenantApplication/model.ts new file mode 100644 index 0000000..992c29b --- /dev/null +++ b/web/src/views/imTenantApplication/model.ts @@ -0,0 +1,128 @@ +import { ref } from 'vue'; +import { cloneDeep } from 'lodash-es'; +import { FormSchema } from '@/components/Form'; +import { defRangeShortcuts } from '@/utils/dateUtil'; + +export interface PublicUpload { + id: number; + fileId: string; + purpose: string; + mimeType: string; + size: number; + etag: string; + location: string; + url: string; + expiresAt: string; + createdAt: string; + uploadedAt: string; +} + +export class State { + public id = 0; + public applicationId = ''; + public creditCode = ''; + public enterpriseEmail = ''; + public licenseFileId = ''; + public tenantCodeHint = ''; + public status = ''; + public estimatedReviewHour = 0; + public submittedAt = ''; + public createdAt = ''; + public updatedAt = ''; + public clientContext = ''; + public idempotencyKey = ''; + public licenseFile: PublicUpload | null = null; + + constructor(state?: Partial) { + if (state) Object.assign(this, state); + } +} + +export function newState(state: State | Record | null): State { + if (state !== null) { + if (state instanceof State) return cloneDeep(state); + return new State(state); + } + return new State(); +} + +export function statusLabel(status: string) { + const map: Record = { + received: '已接收', + pending_review: '待审核', + approved: '已通过', + rejected: '已拒绝', + closed: '已关闭', + }; + return map[status] || status || '-'; +} + +export const schemas = ref([ + { + field: 'applicationId', + component: 'NInput', + label: '申请ID', + componentProps: { placeholder: '请输入申请ID' }, + }, + { + field: 'creditCode', + component: 'NInput', + label: '信用代码', + componentProps: { placeholder: '请输入统一社会信用代码' }, + }, + { + field: 'enterpriseEmail', + component: 'NInput', + label: '企业邮箱', + componentProps: { placeholder: '请输入企业邮箱' }, + }, + { + field: 'tenantCodeHint', + component: 'NInput', + label: '商户线索', + componentProps: { placeholder: '请输入商户编码线索' }, + }, + { + field: 'status', + component: 'NInput', + label: '状态', + componentProps: { placeholder: '请输入状态' }, + }, + { + field: 'keyword', + component: 'NInput', + label: '关键词', + componentProps: { placeholder: '请输入申请ID/信用代码/邮箱' }, + }, + { + field: 'createdAt', + component: 'NDatePicker', + label: '创建时间', + componentProps: { + type: 'datetimerange', + clearable: true, + shortcuts: defRangeShortcuts(), + }, + }, +]); + +export const columns = [ + { title: 'ID', key: 'id', align: 'left', width: 80 }, + { title: '申请ID', key: 'applicationId', align: 'left', width: 210 }, + { title: '统一社会信用代码', key: 'creditCode', align: 'left', width: 190 }, + { title: '企业邮箱', key: 'enterpriseEmail', align: 'left', width: 210 }, + { title: '营业执照文件', key: 'licenseFileId', align: 'left', width: 180 }, + { title: '商户线索', key: 'tenantCodeHint', align: 'left', width: 140 }, + { + title: '状态', + key: 'status', + align: 'left', + width: 120, + render(row: State) { + return statusLabel(row.status); + }, + }, + { title: '预计审核小时', key: 'estimatedReviewHour', align: 'left', width: 130 }, + { title: '提交时间', key: 'submittedAt', align: 'left', width: 180 }, + { title: '创建时间', key: 'createdAt', align: 'left', width: 180 }, +]; diff --git a/web/src/views/imTenantApplication/view.vue b/web/src/views/imTenantApplication/view.vue new file mode 100644 index 0000000..134a2c6 --- /dev/null +++ b/web/src/views/imTenantApplication/view.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/web/src/views/imTenantEntryFeedback/index.vue b/web/src/views/imTenantEntryFeedback/index.vue new file mode 100644 index 0000000..dcda673 --- /dev/null +++ b/web/src/views/imTenantEntryFeedback/index.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/web/src/views/imTenantEntryFeedback/model.ts b/web/src/views/imTenantEntryFeedback/model.ts new file mode 100644 index 0000000..a2e75f1 --- /dev/null +++ b/web/src/views/imTenantEntryFeedback/model.ts @@ -0,0 +1,107 @@ +import { ref } from 'vue'; +import { cloneDeep } from 'lodash-es'; +import { FormSchema } from '@/components/Form'; +import { defRangeShortcuts } from '@/utils/dateUtil'; +import { PublicUpload } from '@/views/imTenantApplication/model'; + +export class State { + public id = 0; + public feedbackId = ''; + public description = ''; + public contact = ''; + public tenantCodeHint = ''; + public status = ''; + public submittedAt = ''; + public createdAt = ''; + public updatedAt = ''; + public screenshotFileIds = ''; + public clientContext = ''; + public idempotencyKey = ''; + public screenshotFiles: PublicUpload[] = []; + + constructor(state?: Partial) { + if (state) Object.assign(this, state); + } +} + +export function newState(state: State | Record | null): State { + if (state !== null) { + if (state instanceof State) return cloneDeep(state); + return new State(state); + } + return new State(); +} + +export function statusLabel(status: string) { + const map: Record = { + received: '已接收', + pending_review: '待处理', + processing: '处理中', + resolved: '已解决', + rejected: '已拒绝', + closed: '已关闭', + }; + return map[status] || status || '-'; +} + +export const schemas = ref([ + { + field: 'feedbackId', + component: 'NInput', + label: '反馈ID', + componentProps: { placeholder: '请输入反馈ID' }, + }, + { + field: 'contact', + component: 'NInput', + label: '联系方式', + componentProps: { placeholder: '请输入联系方式' }, + }, + { + field: 'tenantCodeHint', + component: 'NInput', + label: '商户线索', + componentProps: { placeholder: '请输入商户编码线索' }, + }, + { + field: 'status', + component: 'NInput', + label: '状态', + componentProps: { placeholder: '请输入状态' }, + }, + { + field: 'keyword', + component: 'NInput', + label: '关键词', + componentProps: { placeholder: '请输入反馈ID/描述/联系方式' }, + }, + { + field: 'createdAt', + component: 'NDatePicker', + label: '创建时间', + componentProps: { + type: 'datetimerange', + clearable: true, + shortcuts: defRangeShortcuts(), + }, + }, +]); + +export const columns = [ + { title: 'ID', key: 'id', align: 'left', width: 80 }, + { title: '反馈ID', key: 'feedbackId', align: 'left', width: 210 }, + { title: '问题描述', key: 'description', align: 'left', width: 320 }, + { title: '联系方式', key: 'contact', align: 'left', width: 170 }, + { title: '商户线索', key: 'tenantCodeHint', align: 'left', width: 140 }, + { + title: '状态', + key: 'status', + align: 'left', + width: 120, + render(row: State) { + return statusLabel(row.status); + }, + }, + { title: '提交时间', key: 'submittedAt', align: 'left', width: 180 }, + { title: '创建时间', key: 'createdAt', align: 'left', width: 180 }, +]; diff --git a/web/src/views/imTenantEntryFeedback/view.vue b/web/src/views/imTenantEntryFeedback/view.vue new file mode 100644 index 0000000..d7f55fb --- /dev/null +++ b/web/src/views/imTenantEntryFeedback/view.vue @@ -0,0 +1,131 @@ + + + + +