DepartmentSelectTree增加新接口

master
LiuJiaNan 2026-01-07 15:35:29 +08:00
parent c3bf282fbb
commit bd64a7ec35
2 changed files with 23 additions and 4 deletions

View File

@ -1,7 +1,18 @@
import type { FC } from "react";
import type { Params } from "../../../LeftTree/Department/Gwj";
import type { BasicSelectTreeProps } from "../../Basic";
/**
*
*/
export interface Params {
/** 企业id */
eqCorpinfoId?: string;
/** 父级部门id */
eqParentId?: string;
/** 企业类型 */
corpinfoTypeList?: number[];
}
/**
*
*/
@ -14,8 +25,8 @@ export interface DepartmentSelectTreeProps extends Omit<BasicSelectTreeProps, "t
isNeedCorpInfoId?: boolean;
/** 是否需要父级部门id默认 false */
isNeedParentId?: boolean;
/** 查询当前登陆人部门还是所有企业部门all 的话 isNeedCorpInfoId、isNeedParentId、params 不生效 */
searchType?: "current" | "all";
/** 查询当前登陆人部门还是所有企业部门 */
searchType?: "current" | "all" | "company";
}
/**

View File

@ -28,7 +28,15 @@ function DepartmentSelectTree(props) {
return;
}
const { data } = await request(searchType === "current" ? "/basicInfo/department/listTree" : "/basicInfo/department/listAllTree", "post", params);
let requestUrl = "";
if (searchType === "current")
requestUrl = "/basicInfo/department/listTree";
if (searchType === "all")
requestUrl = "/basicInfo/department/listAllTree";
if (searchType === "company")
requestUrl = "/basicInfo/department/listAllTreeByCorpType";
const { data } = await request(requestUrl, "post", params);
setTreeData(data);
};