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

76 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-03-14 17:32:08 +08:00
import { defHttp } from '/@/utils/http/axios';
enum Api {
2025-03-20 17:39:13 +08:00
queryProjectTreeSync = '/iot/projectInfo/queryRegionTreeSync',
queryRegionTreeSync = '/iot/regionInfo/queryRegionTreeSync',
syncProject = '/iot/projectInfo/sync',
syncRegion = '/iot/regionInfo/sync',
syncRegionChildren = '/iot/regionInfo/syncChildren',
2025-03-14 17:32:08 +08:00
list = '/iot/regionInfo/list',
sync = '/iot/regionInfo/sync',
2025-03-20 09:26:41 +08:00
add = '/iot/regionInfo/add',
edit = '/iot/regionInfo/edit',
delete = '/iot/regionInfo/delete',
2025-03-14 17:32:08 +08:00
}
2025-03-20 17:39:13 +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
*/
2025-03-21 15:10:58 +08:00
export const syncRegionChildren = (params?) => defHttp.get({ url: Api.syncRegionChildren, params });
2025-03-20 17:39:13 +08:00
2025-03-21 15:10:58 +08:00
/**
*
* @param params
*/
export const syncRegion = (params?) => defHttp.get({ url: Api.syncRegion, params });
2025-03-20 17:39:13 +08:00
2025-03-14 17:32:08 +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-03-20 09:26:41 +08:00
/**
*
* @param params
*/
export const saveOrUpdateRegion = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.add;
return defHttp.post({ url: url, params });
};
/**
*
*/
export const deleteRegion = (params,handleSuccess) => {
return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};