40 lines
872 B
TypeScript
40 lines
872 B
TypeScript
import { defHttp } from '/@/utils/http/axios';
|
|
|
|
enum Api {
|
|
list = '/iot/projectInfo/list',
|
|
sync = '/iot/projectInfo/sync',
|
|
add = '/iot/projectInfo/add',
|
|
edit = '/iot/projectInfo/edit',
|
|
delete = '/iot/projectInfo/delete',
|
|
}
|
|
|
|
/**
|
|
* 列表接口
|
|
* @param params
|
|
*/
|
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
|
|
|
/**
|
|
* 项目信息同步
|
|
* @param params
|
|
*/
|
|
export const sync = (params) => defHttp.get({ url: Api.sync, params });
|
|
|
|
/**
|
|
* 保存或者更新项目
|
|
* @param params
|
|
*/
|
|
export const saveOrUpdatePrject = (params, isUpdate) => {
|
|
let url = isUpdate ? Api.edit : Api.add;
|
|
return defHttp.post({ url: url, params });
|
|
};
|
|
|
|
/**
|
|
* 删除项目
|
|
*/
|
|
export const deletePrject = (params,handleSuccess) => {
|
|
return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
};
|