feat: 1. 接入CollaboraViewer选中的高亮效果,清除高亮功能,页面销毁自动清除高亮。
2. 合同模板对比接入monaco editor的效果。 3. 添加交叉评查的案卷类型的数据查询。 fix: 1. 修复文档列表的打开模态框蒙板层显示效果。
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { API_BASE_URL } from '../../config/api-config';
|
||||
import { postgrestPut } from '../postgrest-client';
|
||||
import { postgrestPut, postgrestGet } from '../postgrest-client';
|
||||
import axios from 'axios';
|
||||
|
||||
// 交叉评查任务状态枚举
|
||||
export enum CrossCheckingTaskStatus {
|
||||
PENDING = 'pending',
|
||||
IN_PROGRESS = 'in_progress',
|
||||
IN_PROGRESS = 'in_progress',
|
||||
COMPLETED = 'completed'
|
||||
}
|
||||
|
||||
@@ -21,6 +21,13 @@ export enum CrossCheckingDocType {
|
||||
PERMIT = 'permit' // 行政许可
|
||||
}
|
||||
|
||||
// 文档类型接口(用于交叉评查案卷类型选项)
|
||||
export interface DocumentType {
|
||||
id: number;
|
||||
name: string;
|
||||
evaluation_point_groups_ids?: number[];
|
||||
}
|
||||
|
||||
// 交叉评查任务接口
|
||||
export interface CrossCheckingTask {
|
||||
id: number;
|
||||
@@ -491,11 +498,11 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number,
|
||||
},
|
||||
frontendJWT
|
||||
);
|
||||
|
||||
|
||||
if (response.error) {
|
||||
return { error: response.error, status: response.status };
|
||||
}
|
||||
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('更新文件审核状态失败:', error);
|
||||
@@ -504,4 +511,53 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number,
|
||||
status: 500
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用于交叉评查的文档类型列表
|
||||
* 条件:evaluation_point_groups_ids 不为空
|
||||
* @param jwtToken JWT token
|
||||
* @returns 文档类型列表
|
||||
*/
|
||||
export async function getCrossCheckingDocumentTypes(jwtToken?: string): Promise<ApiResponse<DocumentType[]>> {
|
||||
try {
|
||||
console.log('[getCrossCheckingDocumentTypes] 开始获取交叉评查文档类型');
|
||||
|
||||
const response = await postgrestGet<DocumentType>('document_types',{
|
||||
select: 'id,name,evaluation_point_groups_ids',
|
||||
filter: {
|
||||
evaluation_point_groups_ids: 'not.is.null'
|
||||
},
|
||||
token: jwtToken
|
||||
});
|
||||
|
||||
if (response.error) {
|
||||
console.error('[getCrossCheckingDocumentTypes] 获取失败:', response.error);
|
||||
return {
|
||||
success: false,
|
||||
error: response.error
|
||||
};
|
||||
}
|
||||
|
||||
// 进一步过滤,确保 evaluation_point_groups_ids 是非空数组
|
||||
const dataArray = Array.isArray(response.data) ? response.data : [];
|
||||
const filteredData = dataArray.filter(
|
||||
(item: DocumentType) => item.evaluation_point_groups_ids &&
|
||||
Array.isArray(item.evaluation_point_groups_ids) &&
|
||||
item.evaluation_point_groups_ids.length > 0
|
||||
);
|
||||
|
||||
console.log('[getCrossCheckingDocumentTypes] 获取成功,共', filteredData.length, '个文档类型');
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: filteredData
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('[getCrossCheckingDocumentTypes] 获取交叉评查文档类型失败:', error);
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : '获取文档类型失败'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user