文档列表documents添加用户id的限制,添加通过统一认证之后数据库中用户数据的添加和角色的添加,添加Sidebar菜单通过数据库请求获取

This commit is contained in:
2025-07-20 21:49:40 +08:00
parent e4ce41cebe
commit d8f3d98c70
17 changed files with 1630 additions and 199 deletions
@@ -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);
};
/**
@@ -2253,15 +2256,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>
@@ -2451,7 +2452,7 @@ export function ReviewPointsList({
</Modal>
{/* 意见列表模态框 */}
{/* 意见列表模态框 */}
<Modal
isOpen={isOpinionListModalOpen}
onClose={handleCloseOpinionListModal}