nursing_unit_vue/src/views/iot/tplink/region/RegionInfo.api.ts

83 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-03-21 10:15:35 +08:00
import { defHttp } from '/@/utils/http/axios';
enum Api {
2025-06-30 09:47:35 +08:00
queryProjectTreeSync = '/iot/tplink/projectInfo/queryRegionTreeSync',
queryRegionTreeSync = '/iot/tplink/regionInfo/queryRegionTreeSync',
syncProject = '/iot/tplink/projectInfo/sync',
syncRegion = '/iot/tplink/regionInfo/sync',
syncRegionChildren = '/iot/tplink/regionInfo/syncChildren',
list = '/iot/tplink/regionInfo/list',
sync = '/iot/tplink/regionInfo/sync',
add = '/iot/tplink/regionInfo/add',
edit = '/iot/tplink/regionInfo/edit',
delete = '/iot/tplink/regionInfo/delete',
queryChildrenByParentId = '/sys/sysDepart/queryChildrenByParentId',
2025-03-21 10:15:35 +08:00
}
2025-04-08 15:34:00 +08:00
/**
*
* @param params
*/
export const queryProjectTreeSync = (params?) => defHttp.get({ url: Api.queryProjectTreeSync, params });
/**
*
* @param params
*/
export const queryRegionTreeSync = (params?) => defHttp.get({ url: Api.queryRegionTreeSync, params });
/**
*
* @param params
*/
export const syncProject = (params?) => defHttp.get({ url: Api.syncProject, params });
/**
*
* @param params
*/
export const syncRegionChildren = (params?) => defHttp.get({ url: Api.syncRegionChildren, params });
/**
*
* @param params
*/
export const syncRegion = (params?) => defHttp.get({ url: Api.syncRegion, params });
/**
* parentId获取区域列表
* @param params
*/
export const queryArea = (params?) => defHttp.get({ url: Api.queryChildrenByParentId, params });
2025-03-21 10:15:35 +08:00
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const sync = (params) => defHttp.get({ url: Api.sync, params });
/**
2025-04-08 15:34:00 +08:00
*
2025-03-21 10:15:35 +08:00
* @param params
*/
export const saveOrUpdateRegion = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.add;
return defHttp.post({ url: url, params });
};
/**
2025-04-08 15:34:00 +08:00
*
2025-03-21 10:15:35 +08:00
*/
export const deleteRegion = (params,handleSuccess) => {
return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};