1.添加移动端用户的检测工具类,移动端用户只能访问对话页面。

2.评查点列表添加文档属性类型字段。
3.优化dify的对话侧边栏的显示效果。
4.评查点规则添加使用文档属性类型的输入框。添加多实体开关的操作开关。
This commit is contained in:
2025-12-30 18:35:48 +08:00
parent d2aba899cc
commit 66d2f7cef4
18 changed files with 552 additions and 56 deletions
+60 -1
View File
@@ -311,7 +311,8 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
isActive: point.is_enabled,
createdAt: formatDate(point.created_at || ''),
updatedAt: formatDate(point.updated_at || ''),
area: point.area || ''
area: point.area || '',
documentAttributeType: point.document_attribute_type || ''
};
});
// console.log('✅ [getRulesList] 成功映射评查点列表数据', response.data.data[0]);
@@ -1045,6 +1046,7 @@ export interface EvaluationPointData {
ruleType?: string; // 评查点类型(一级分组名称)
groupName?: string; // 所属规则组(二级分组名称)
groupId?: string; // 规则组ID(二级分组ID的字符串形式)
document_attribute_type?: string; // 文档属性类型
references_laws: {
name: string;
content: string;
@@ -1217,4 +1219,61 @@ export async function getEvaluationPoint(
status: 500
};
}
}
/**
* 适用属性类型选项
*/
export interface AttributeTypeOption {
code: string;
label: string;
}
/**
* 获取适用属性类型列表
* 从后端获取当前评查点表中所有已使用的 document_attribute_type 去重列表
* @param token JWT token (可选)
* @returns 适用属性类型列表
*/
export async function getAttributeTypes(
token?: string
): Promise<{data: AttributeTypeOption[]; error?: never} | {data?: never; error: string; status?: number}> {
try {
// 调用后端 FastAPI 接口: GET /api/v3/evaluation-points/attribute-types
const response = await apiRequest<{
types: AttributeTypeOption[];
}>(
'/api/v3/evaluation-points/attribute-types',
{
method: 'GET',
headers: {
...(token ? { 'Authorization': `Bearer ${token}` } : {})
}
}
);
if (response.error) {
return { error: response.error, status: response.status };
}
if (!response.data || !Array.isArray(response.data.types)) {
// 返回默认的属性类型列表
return {
data: [
{ code: 'ALL', label: '通用' }
]
};
}
console.log('✅ getAttributeTypes 成功:', response.data.types);
return { data: response.data.types };
} catch (error) {
console.error('❌ 获取适用属性类型列表出错:', error);
// 出错时返回默认列表,不阻塞用户操作
return {
data: [
{ code: 'ALL', label: '通用' }
]
};
}
}