forgeplus-react-v2/src/components/commentsByZone/constants.js

46 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 评论组件类型枚举
*/
export const COMMENT_TYPE = {
NEWS: 'news', // 资讯/文章评论
PROJECT: 'project', // 项目评论
RESOURCE: 'resource', // 资源评论
SKILL: 'skill' // AI 技能评论
};
/**
* 评论组件 Props 类型定义JSDoc 用于 TypeScript/IDE 提示)
* @typedef {Object} CommentsListProps
* @property {string} type - 评论类型:'news' | 'project' | 'resource' | 'skill'
* @property {string|number} id - 资源 ID文章 ID、项目 ID、资源 ID 等)
* @property {Object} [extraParams] - 额外的业务参数(根据不同 type 传递不同参数)
* @property {string} [owner] - 所有者/组织名(用于 Markdown 渲染)
* @property {string} [projectsId] - 项目 ID用于 Markdown 渲染)
* @property {Object} current_user - 当前用户信息
* @property {string} current_user.login - 用户登录名
* @property {boolean} current_user.admin - 是否管理员
* @property {string} current_user.image_url - 用户头像 URL
* @property {string} current_user.username - 用户姓名
* @property {boolean} [isManager] - 是否为仓库/项目管理员
* @property {string} [author] - 评论作者(用于权限判断)
* @property {Function} [reload] - 触发重新加载
* @property {Function} [showNotification] - 显示通知
* @property {Function} [showLoginDialog] - 显示登录弹窗
* @property {Function} [onCommentAdded] - 评论添加回调
* @property {Function} [onCommentDeleted] - 评论删除回调
*/
/**
* 评论列表分页大小
*/
export const COMMENT_PAGE_SIZE = 50;
/**
* 评论分类
*/
export const COMMENT_CATEGORY = {
COMMENT: 'comment', // 仅评论
ALL: 'all', // 评论 + 操作日志
OPERATE: 'operate' // 仅操作日志
};