12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import { httpApp } from "@/plugins/axiosApp";
- /** 机构分页查询 */
- export function getSubOrgList(params: {
- code?: string;
- name?: string;
- enable?: boolean;
- rootOrgId: string;
- pageNo?: number;
- pageSize?: number;
- }) {
- return httpApp.post("/api/ess/org/page", params);
- }
- /** 更新机构 */
- export function updateSubOrg(params: {
- code?: string;
- enable?: boolean;
- id?: number;
- name?: string;
- rootOrgId?: string;
- }) {
- // params.rootId = params.rootOrgId;
- return httpApp.post("/api/ess/org/save", params);
- }
- /** 禁用、启用机构 */
- export function toggleSubOrg(enable: boolean, ids: number[]) {
- return httpApp.post(
- `/api/ess/org/${enable ? "enable" : "disable"}`,
- new URLSearchParams([["ids", ids.join(",")]])
- );
- }
- /** 删除机构 */
- export function delOrg(ids: number[]) {
- return httpApp.post(
- `/api/ess/org/delete`,
- new URLSearchParams([["ids", ids.join(",")]])
- // { ids: ids.join(",") },
- // { headers: { "content-type": "application/x-www-form-urlencoded" } }
- );
- }
- /** 导入机构 */
- export function importOrg(rootOrgId: string, file: File) {
- const f = new FormData();
- f.append("rootOrgId", rootOrgId);
- f.append("file", file);
- return httpApp.post(`/api/ess/org/import`, f);
- }
- /** 导出机构 */
- export function exportOrg(params: {
- rootOrgId: string;
- code: string;
- name: string;
- enable?: boolean;
- }) {
- return httpApp.post(`/api/ess/org/export`, params);
- }
|