feat: 1. 将大部分的请求从fetch改成axios方便管理。
2. 给文档类型添加入口模块和相关数据的渲染。并且给文档类型进行功能上的角色权限区分 3. 新增角色权限管理页面
This commit is contained in:
@@ -802,19 +802,10 @@ export interface RuleGroup {
|
||||
*/
|
||||
export async function getRuleTypes(documentTypeIds?: number[], token?: string): Promise<{data: RuleType[]; error?: never} | {data?: never; error: string; status?: number}> {
|
||||
try {
|
||||
// 如果没有传入 documentTypeIds,返回空数组
|
||||
if (!documentTypeIds || documentTypeIds.length === 0) {
|
||||
console.warn('getRuleTypes: 未提供 documentTypeIds');
|
||||
return { data: [] };
|
||||
}
|
||||
|
||||
// 1️⃣ 根据 documentTypeIds 查询 document_types 表
|
||||
const typeIdsStr = documentTypeIds.join(',');
|
||||
const documentTypesParams: PostgrestParams = {
|
||||
select: 'id, name, evaluation_point_groups_ids',
|
||||
filter: {
|
||||
'id': `in.(${typeIdsStr})`
|
||||
},
|
||||
filter: {},
|
||||
token
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user