feat(rvw): deliver tenant portal v4 flow and config foundation

Implement RVW V4.0 tenant-aware backend/frontend flow with tenant routing, config APIs, and full portal UX updates. Sync system/RVW/deployment docs to capture verified upload-review-report workflow and next-step admin configuration work.

Made-with: Cursor
This commit is contained in:
2026-03-14 22:29:40 +08:00
parent ba464082cb
commit 16179e16ca
45 changed files with 4753 additions and 93 deletions

View File

@@ -244,6 +244,68 @@ export async function fetchModuleList(): Promise<ModuleInfo[]> {
return result.data;
}
// ==================== RVW Config API ====================
/** 租户审稿配置 */
export interface TenantRvwConfig {
id: string;
tenantId: string;
editorialRules: unknown | null;
methodologyExpertPrompt: string | null;
methodologyHandlebarsTemplate: string | null;
dataForensicsLevel: string;
finerWeights: Record<string, number> | null;
clinicalExpertPrompt: string | null;
createdAt: string;
updatedAt: string;
}
/** 更新审稿配置请求 */
export interface UpdateRvwConfigRequest {
editorialRules?: unknown | null;
methodologyExpertPrompt?: string | null;
methodologyHandlebarsTemplate?: string | null;
dataForensicsLevel?: string;
finerWeights?: Record<string, number> | null;
clinicalExpertPrompt?: string | null;
}
/**
* 获取租户智能审稿配置
*/
export async function fetchRvwConfig(tenantId: string): Promise<TenantRvwConfig | null> {
const response = await fetch(`${API_BASE}/${tenantId}/rvw-config`, {
headers: getAuthHeaders(),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message || '获取审稿配置失败');
}
const result = await response.json();
return result.data;
}
/**
* 保存UPSERT租户智能审稿配置
*/
export async function saveRvwConfig(tenantId: string, data: UpdateRvwConfigRequest): Promise<TenantRvwConfig> {
const response = await fetch(`${API_BASE}/${tenantId}/rvw-config`, {
method: 'PUT',
headers: getAuthHeaders(),
body: JSON.stringify(data),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message || '保存审稿配置失败');
}
const result = await response.json();
return result.data;
}