feat: extend DocumentType interface with code, entryModuleId, isEnabled, ruleSetIds
This commit is contained in:
@@ -126,6 +126,10 @@ export enum DocumentStatus {
|
|||||||
export interface DocumentType {
|
export interface DocumentType {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
|
code?: string;
|
||||||
|
entryModuleId?: number;
|
||||||
|
isEnabled?: boolean;
|
||||||
|
ruleSetIds?: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提取结果接口
|
// 提取结果接口
|
||||||
@@ -542,9 +546,13 @@ export async function getDocumentTypes(token?: string): Promise<{data: DocumentT
|
|||||||
const body = response.data;
|
const body = response.data;
|
||||||
|
|
||||||
if (body?.data && Array.isArray(body.data)) {
|
if (body?.data && Array.isArray(body.data)) {
|
||||||
const types: DocumentType[] = body.data.map((item: { id: number; name: string; code?: string }) => ({
|
const types: DocumentType[] = body.data.map((item: { id: number; name: string; code?: string; entryModuleId?: number; isEnabled?: boolean; ruleSetIds?: number[] }) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
code: item.code,
|
||||||
|
entryModuleId: item.entryModuleId,
|
||||||
|
isEnabled: item.isEnabled,
|
||||||
|
ruleSetIds: item.ruleSetIds,
|
||||||
}));
|
}));
|
||||||
return { data: types };
|
return { data: types };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user