Merge remote-tracking branch 'origin/shiy-login' into Wren

This commit is contained in:
2025-07-21 12:35:04 +08:00
23 changed files with 1809 additions and 290 deletions
@@ -8,7 +8,7 @@ import { StatusBadge } from '../ui/StatusBadge';
import { Pagination } from '../ui/Pagination';
import { LoadingIndicator } from '../ui/SkeletonScreen';
import type { ReviewFileUI } from '~/api/evaluation_points/rules-files';
import { updateDocumentAuditStatus } from '~/api/evaluation_points/rules-files';
// import { updateDocumentAuditStatus } from '~/api/evaluation_points/rules-files';
import { toastService } from '../ui/Toast';
// 导出样式链接
@@ -49,10 +49,13 @@ export function DocumentListModal({
// 检查audit_status是否为0,如果是则更新为2
if (auditStatus === 0 || auditStatus === null) {
try {
const response = await updateDocumentAuditStatus(fileId, 2);
if (response.error) {
throw new Error(response.error);
}
// TODO: 这里需要从父组件传递 userId,或者重新设计这个函数的调用方式
// 暂时跳过状态更新,直接进入查看
// const response = await updateDocumentAuditStatus(fileId, 2, userId);
// if (response.error) {
// throw new Error(response.error);
// }
console.warn('DocumentListModal: 跳过审核状态更新,需要传递 userId 参数');
} catch (error) {
console.error('更新文件审核状态时出错:', error);
toastService.error(`更新文件审核状态时出错:${error instanceof Error ? error.message : '未知错误'}`);
@@ -516,14 +516,16 @@ export function ReviewPointsList({
/**
* 加载意见列表数据
*/
const loadOpinionListData = async (page: number = 1, pageSize: number = 10) => {
console.log('加载意见列表数据', selectedReviewPoint);
if (!selectedReviewPoint?.documentId) return;
const loadOpinionListData = async (page: number = 1, pageSize: number = 10, documentId?: string | number) => {
// 使用传入的documentId或者从selectedReviewPoint获取
const targetDocumentId = documentId || selectedReviewPoint?.documentId;
console.log('加载意见列表数据', targetDocumentId);
if (!targetDocumentId) return;
setOpinionListLoading(true);
try {
console.log('加载意见列表数据', selectedReviewPoint.documentId, page, pageSize);
const response = await getCrossCheckingOpinions(selectedReviewPoint.documentId, page, pageSize);
console.log('加载意见列表数据', targetDocumentId, page, pageSize);
const response = await getCrossCheckingOpinions(targetDocumentId, page, pageSize);
console.log('意见列表数据', response);
if (response.error) {
@@ -555,7 +557,8 @@ export function ReviewPointsList({
setSelectedReviewPoint(reviewPoint);
setIsOpinionListModalOpen(true);
console.log('打开意见列表模态框');
loadOpinionListData(1, 10);
// 直接传递reviewPoint的documentId,避免依赖状态更新
loadOpinionListData(1, 10, reviewPoint.documentId);
};
/**
@@ -2261,15 +2264,13 @@ export function ReviewPointsList({
{/* 悬浮状态:横向排列,显示图标,数字放大 */}
<div className="absolute top-0 right-0 opacity-0 scale-0 group-hover:opacity-100 group-hover:scale-100 flex items-center bg-blue-50 px-3 py-2 rounded-lg border border-blue-200 shadow-lg transition-all duration-300 origin-top-right">
<button className="flex items-center" aria-label="点击查看详情">
<div className="flex flex-col">
<i className="ri-chat-1-line text-blue-600 text-base"></i>
<span className="text-xl text-blue-600 font-bold">{scoringProposals.length}</span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
</div>
</button>
<div className="flex flex-col">
<i className="ri-chat-1-line text-blue-600 text-base"></i>
<span className="text-xl text-blue-600 font-bold">{scoringProposals.length}</span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
<span className="text-xs text-blue-500 leading-tight whitespace-wrap"></span>
</div>
</div>
</button>
@@ -2459,7 +2460,7 @@ export function ReviewPointsList({
</Modal>
{/* 意见列表模态框 */}
{/* 意见列表模态框 */}
<Modal
isOpen={isOpinionListModalOpen}
onClose={handleCloseOpinionListModal}