feat(projects): 增加意见反馈

This commit is contained in:
2026-06-27 08:55:33 +08:00
parent 570f284230
commit a4884035cd
25 changed files with 1536 additions and 7 deletions

82
src/typings/api/feedback.d.ts vendored Normal file
View File

@@ -0,0 +1,82 @@
declare namespace Api {
/**
* namespace Feedback
*
* backend api module: "feedback"(用户意见反馈)
*/
namespace Feedback {
/** 反馈分页查询参数GET querytype/status 传字符串即可,后端按 Integer 解析) */
interface FeedbackSearchParams {
pageNo: number;
pageSize: number;
/** 反馈分类,字典 feedback_type */
type?: string | number | null;
/** 处理状态,字典 feedback_status */
status?: string | number | null;
/** 标题关键词,模糊匹配 */
title?: string;
}
/**
* 反馈记录。
* - id/creator 在 API 适配层已统一为 string
* - content 为富文本 HTML 字符串(详细描述支持图文);
* - attachments 由后端 attachmentUrls(JSON 字符串) 解析为完整附件对象数组,与任务附件同构。
*/
interface FeedbackItem {
id: string;
/** 反馈分类,字典 feedback_type */
type: number;
title: string;
/** 详细描述,富文本 HTML */
content: string;
/** 内容纯文本预览API 适配层预算,列表列直接取,免每次渲染重跑去标签正则) */
contentPreview: string;
/** 附件对象列表(含 fileId/url/name 等,支持下载与会话级清理) */
attachments: Api.Project.AttachmentItem[];
/** 联系方式(选填) */
contact?: string;
/** 处理状态,字典 feedback_status */
status: number;
/** 提交人用户 id字符串 */
creator: string;
/** 提交人姓名(后端回填,缺失时前端回退展示 creator */
creatorName?: string;
createTime: string;
}
/** 提交反馈参数(页面层传 attachments 对象数组api 层 stringify 成 attachmentUrls */
interface FeedbackSubmitParams {
type: number;
title: string;
content: string;
attachments: Api.Project.AttachmentItem[];
contact?: string;
}
/** 更新反馈参数(编辑态;后端更新接口待提供,见根目录后端诉求文档) */
interface FeedbackUpdateParams extends FeedbackSubmitParams {
id: string;
}
/** 分页返回(后端 { list, total } 形态) */
interface FeedbackListResult {
total: number;
list: FeedbackItem[];
}
/**
* 反馈统计聚合(左侧分面面板用;全量口径,不随筛选变化)。
* typeCounts / statusCounts 已在 API 适配层归一化为 Record<码值字符串, 数量>
* 由后端覆盖各自字典的全部码值(无数据为 0
*/
interface FeedbackStat {
/** 全部反馈总数 */
total: number;
/** 各分类计数key=分类码值字符串feedback_type */
typeCounts: Record<string, number>;
/** 各状态计数key=状态码值字符串feedback_status */
statusCounts: Record<string, number>;
}
}
}