1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { httpApp } from "@/plugins/axiosIndex";
- import { pickBy } from "lodash-es";
- import { object2QueryString } from "@/utils/utils";
- export function searchOrgs({
- code = "",
- name = "",
- enable = "",
- pageNumber = 1,
- pageSize = 10,
- }) {
- const data = pickBy(
- { code, name, enable, pageNumber, pageSize },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/org/query?" + object2QueryString(data));
- }
- export function toggleEnableOrg({ id, enable }) {
- return httpApp.post("/api/admin/org/enable", { id, enable });
- }
- export function searchOrg(id) {
- return httpApp.post("/api/admin/sys/org/query?" + object2QueryString({ id }));
- }
- export function saveOrg({
- id = "",
- name = "",
- code = "",
- contactName = "",
- contactPhone = "",
- logo = null,
- enableSimulate = 0,
- enableMonitorRecord = 0,
- enableLiveness = 0,
- enable = 0,
- }) {
- const data = pickBy(
- {
- id,
- name,
- code,
- contactName,
- contactPhone,
- // logo,
- enableSimulate,
- enableMonitorRecord,
- enableLiveness,
- enable,
- },
- (v) => v !== ""
- );
- return httpApp.post("/api/admin/org/save", { ...data, logo });
- }
- export function syncOrg() {
- return httpApp.post("/api/admin/sys/sync/org?");
- }
|