feat(web-admin): add OA instance comment API clients

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-09-20 21:29:19 +08:00
1 parent 55e1306eba
commit a1b95b1f0b
1 file changed
+48
+48
View File
@@ -331,6 +331,54 @@ export function fetchOaInstanceDetail(id: string) {
})
}
export type OaCommentAttachmentRef = {
fieldKey: string
fieldLabel?: string
url: string
fileName: string
}
export type OaInstanceComment = {
id: string
instanceId?: string
content: string
attachmentRefs: OaCommentAttachmentRef[]
status: 'normal' | 'revoked' | string
revokedTime?: string
createBy: string
createByName?: string
createTime: string
canRevoke?: boolean
}
export function fetchOaFormAttachments(instanceId: string) {
return request.get<{ items: Array<{ fieldKey: string; fieldLabel: string; files: OaCommentAttachmentRef[] }> }>({
url: `${BASE}/instances/${instanceId}/form-attachments`
})
}
export function fetchOaInstanceComments(instanceId: string) {
return request.get<{ list: OaInstanceComment[] }>({
url: `${BASE}/instances/${instanceId}/comments`
})
}
export function fetchCreateOaComment(
instanceId: string,
data: { content: string; attachmentRefs?: OaCommentAttachmentRef[] }
) {
return request.post<OaInstanceComment>({
url: `${BASE}/instances/${instanceId}/comments`,
data
})
}
export function fetchRevokeOaComment(instanceId: string, commentId: string) {
return request.post<OaInstanceComment>({
url: `${BASE}/instances/${instanceId}/comments/${commentId}/revoke`
})
}
export function fetchOaTasks(
kind: 'pending' | 'done' | 'mine' | 'cc',
params?: {