diff --git a/app/api/cross-checking/cross-files.ts b/app/api/cross-checking/cross-files.ts index 3bae282..44c2ef3 100644 --- a/app/api/cross-checking/cross-files.ts +++ b/app/api/cross-checking/cross-files.ts @@ -25,6 +25,7 @@ export enum CrossCheckingDocType { export interface DocumentType { id: number; name: string; + code: string; evaluation_point_groups_ids?: number[]; } @@ -521,10 +522,10 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number, */ export async function getCrossCheckingDocumentTypes(jwtToken?: string): Promise> { try { - console.log('[getCrossCheckingDocumentTypes] 开始获取交叉评查文档类型'); + // console.log('[getCrossCheckingDocumentTypes] 开始获取交叉评查文档类型'); const response = await postgrestGet('document_types',{ - select: 'id,name,evaluation_point_groups_ids', + select: 'id,name,code,evaluation_point_groups_ids', filter: { evaluation_point_groups_ids: 'not.is.null' }, @@ -547,7 +548,7 @@ export async function getCrossCheckingDocumentTypes(jwtToken?: string): Promise< item.evaluation_point_groups_ids.length > 0 ); - console.log('[getCrossCheckingDocumentTypes] 获取成功,共', filteredData.length, '个文档类型'); + // console.log('[getCrossCheckingDocumentTypes] 获取成功,共', filteredData.length, '个文档类型'); return { success: true, diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index bf05f6a..63c1068 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -392,7 +392,7 @@ export default function Index() { aria-label="交叉评查" > 交叉评查 { diff --git a/app/routes/cross-checking._index.tsx b/app/routes/cross-checking._index.tsx index a5aa7d1..b641f49 100644 --- a/app/routes/cross-checking._index.tsx +++ b/app/routes/cross-checking._index.tsx @@ -11,14 +11,16 @@ import { Table } from '~/components/ui/Table'; import { FilterPanel, FilterSelect, SearchFilter, DateRangeFilter } from '~/components/ui/FilterPanel'; import { Pagination } from '~/components/ui/Pagination'; import { toastService } from '~/components/ui/Toast'; -import { - getCrossCheckingTasks, +import { + getCrossCheckingTasks, getCrossCheckingStats, deleteCrossCheckingTask, getCrossCheckingTaskDetail, + getCrossCheckingDocumentTypes, type CrossCheckingTask, type TaskDocument, type TaskListParams, + type DocumentType, CrossCheckingTaskStatus, CrossCheckingTaskType, CrossCheckingDocType @@ -51,6 +53,8 @@ export type LoaderData = { }; initialLoad?: boolean; frontendJWT?: string; // 新增JWT + documentTypes: DocumentType[]; // 新增:文档类型列表 + documentTypesError?: string; // 新增:文档类型加载错误 }; export async function loader({ request }: LoaderFunctionArgs) { @@ -74,11 +78,12 @@ export async function loader({ request }: LoaderFunctionArgs) { const { userInfo, frontendJWT } = await getUserSession(request); // console.log('frontendJWT', frontendJWT); - - // 获取任务列表和统计数据,传递用户信息和JWT - const [tasksResponse, statsResponse] = await Promise.all([ + + // 获取任务列表、统计数据和文档类型,传递用户信息和JWT + const [tasksResponse, statsResponse, documentTypesResponse] = await Promise.all([ getCrossCheckingTasks(params, userInfo, frontendJWT), - getCrossCheckingStats(userInfo, frontendJWT) + getCrossCheckingStats(userInfo, frontendJWT), + getCrossCheckingDocumentTypes(frontendJWT) ]); // console.log('tasksResponse', tasksResponse.data?.tasks); @@ -102,7 +107,9 @@ export async function loader({ request }: LoaderFunctionArgs) { pageSize: tasksResponse.data?.pageSize || params.pageSize, totalPages: tasksResponse.data?.totalPages || 0, stats: statsResponse.data || { totalTasks: 0, pendingTasks: 0, inProgressTasks: 0, completedTasks: 0 }, - frontendJWT // 新增:返回JWT给客户端 + frontendJWT, // 新增:返回JWT给客户端 + documentTypes: documentTypesResponse.success ? documentTypesResponse.data || [] : [], // 新增:返回文档类型列表 + documentTypesError: documentTypesResponse.error // 新增:返回文档类型加载错误 }, { headers: { "Cache-Control": "max-age=60, s-maxage=180" @@ -212,7 +219,7 @@ const docTypeConfig = { export default function CrossCheckingIndex() { const loaderData = useLoaderData(); - const { tasks, totalCount, currentPage, pageSize, stats, frontendJWT } = loaderData; + const { tasks, totalCount, currentPage, pageSize, stats, frontendJWT, documentTypes, documentTypesError } = loaderData; const [searchParams, setSearchParams] = useSearchParams(); const dateFrom = searchParams.get('dateFrom') || ''; const dateTo = searchParams.get('dateTo') || ''; @@ -697,10 +704,16 @@ export default function CrossCheckingIndex() { label="案卷类型" name="docType" value={searchParams.get('docType') || ''} - options={[ - { value: CrossCheckingDocType.PENALTY, label: "行政处罚" }, - { value: CrossCheckingDocType.PERMIT, label: "行政许可" } - ]} + options={ + documentTypesError + ? [] + : documentTypes && documentTypes.length > 0 + ? documentTypes.map((docType: DocumentType) => ({ + value: docType.code, + label: docType.name + })) + : [] + } onChange={handleFilterChange} className="mr-4 w-[15%]" /> diff --git a/public/images/icon_cross@2x.png b/public/images/icon_cross@2x.png new file mode 100644 index 0000000..a078586 Binary files /dev/null and b/public/images/icon_cross@2x.png differ diff --git a/public/images/icon_jiaocha.png b/public/images/icon_jiaocha.png new file mode 100644 index 0000000..a078586 Binary files /dev/null and b/public/images/icon_jiaocha.png differ