diff --git a/apps/web-antd/src/api/license/comment/index.ts b/apps/web-antd/src/api/license/comment/index.ts new file mode 100644 index 0000000..457a77f --- /dev/null +++ b/apps/web-antd/src/api/license/comment/index.ts @@ -0,0 +1,43 @@ +import type { Dayjs } from 'dayjs'; + +import { requestClient } from '#/api/request'; + +export namespace CommentApi { + /** 客户信息 */ + export interface Comment { + id: number; // 主键 + projectId?: number; // 项目ID + userId?: number; // 用户ID + parentId?: number; // 父评论ID + author?: string; // 评论人 + avatar?: string; // 头像 + replyUserId?: number; // 回复用户ID + replyUser?: string; // 回复用户 + updateTime?: Dayjs; // 更新时间 + depth?: number; // 评论深度 + content?: string; // 评论内容 + children?: Comment[]; // 子评论 + } +} + +/** 查询评论树形列表 */ +export function getCommentTree(projectId: number, sort: boolean = false) { + return requestClient.get( + `/license/comment/tree?projectId=${projectId}&sort=${sort}`, + ); +} + +/** 新增评论 */ +export function createComment(data: CommentApi.Comment) { + return requestClient.post('/license/comment/create', data); +} + +/** 修改评论 */ +export function updateComment(data: CommentApi.Comment) { + return requestClient.post('/license/comment/update', data); +} + +/** 删除客户 */ +export function deleteComment(id: number) { + return requestClient.delete(`/license/comment/delete?id=${id}`); +} diff --git a/apps/web-antd/src/locales/langs/en-US/comment.json b/apps/web-antd/src/locales/langs/en-US/comment.json new file mode 100644 index 0000000..8093a07 --- /dev/null +++ b/apps/web-antd/src/locales/langs/en-US/comment.json @@ -0,0 +1,11 @@ +{ + "postComment": "Post Comment", + "replyComment": "Reply Comment", + "hotComment": "All Comments", + "reply": "Reply", + "cancelReply": "Cancel Reply", + "delete": "Delete", + "comment": "Comment", + "deleteCommentTitle": "Are you sure you want to delete this comment?", + "sortByTime": "Sort by Time" +} diff --git a/apps/web-antd/src/locales/langs/zh-CN/comment.json b/apps/web-antd/src/locales/langs/zh-CN/comment.json new file mode 100644 index 0000000..7913a48 --- /dev/null +++ b/apps/web-antd/src/locales/langs/zh-CN/comment.json @@ -0,0 +1,11 @@ +{ + "postComment": "发表评论", + "replyComment": "回复评论", + "hotComment": "全部评论", + "reply": "回复", + "cancelReply": "取消回复", + "delete": "删除", + "comment": "评论", + "deleteCommentTitle": "确定删除该条评论吗?", + "sortByTime": "按时间排序" +} diff --git a/apps/web-antd/src/views/license/project/comment/child-comment.vue b/apps/web-antd/src/views/license/project/comment/child-comment.vue new file mode 100644 index 0000000..28aba1c --- /dev/null +++ b/apps/web-antd/src/views/license/project/comment/child-comment.vue @@ -0,0 +1,150 @@ + + diff --git a/apps/web-antd/src/views/license/project/comment/create-comment.vue b/apps/web-antd/src/views/license/project/comment/create-comment.vue new file mode 100644 index 0000000..f7e06e8 --- /dev/null +++ b/apps/web-antd/src/views/license/project/comment/create-comment.vue @@ -0,0 +1,64 @@ + + + diff --git a/apps/web-antd/src/views/license/project/comment/index.vue b/apps/web-antd/src/views/license/project/comment/index.vue new file mode 100644 index 0000000..8ef991f --- /dev/null +++ b/apps/web-antd/src/views/license/project/comment/index.vue @@ -0,0 +1,109 @@ + + + diff --git a/apps/web-antd/src/views/license/project/data.ts b/apps/web-antd/src/views/license/project/data.ts index 13e47e3..6827c47 100644 --- a/apps/web-antd/src/views/license/project/data.ts +++ b/apps/web-antd/src/views/license/project/data.ts @@ -510,11 +510,11 @@ export function useGridColumns( code: 'edit', show: hasAccessByCodes(['license:project:update']), }, - // { - // code: 'progress', - // text: $t('project.progress'), - // show: hasAccessByCodes(['license:project:update']), - // }, + { + code: 'progress', + text: $t('project.progress'), + show: hasAccessByCodes(['license:project:update']), + }, { code: 'delete', show: hasAccessByCodes(['license:project:delete']), diff --git a/apps/web-antd/src/views/license/project/modules/progress.vue b/apps/web-antd/src/views/license/project/modules/progress.vue index b5b724b..d0bfb30 100644 --- a/apps/web-antd/src/views/license/project/modules/progress.vue +++ b/apps/web-antd/src/views/license/project/modules/progress.vue @@ -1,14 +1,20 @@