54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import { defHttp } from '/@/utils/http/axios';
|
|
|
|
enum Api {
|
|
departPreview = '/iot/device/manager/departPreview',
|
|
nuPreview = '/iot/device/manager/nuPreview',
|
|
configList = '/iot/device/config/queryList',
|
|
nuList = '/iot/device/manager/nuList',
|
|
savePreview = '/iot/device/manager/savePreview',
|
|
updatePreview = '/iot/device/manager/updatePreview',
|
|
deletePreview = '/iot/device/manager/deletePreview',
|
|
batchSave = '/iot/device/manager/batchSave',
|
|
queryQuantityByOrgCode = '/iot/device/manager/queryQuantityByOrgCode',
|
|
getNuListByOrgCode = '/iot/device/manager/getNuListByOrgCode',
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
* @param params
|
|
*/
|
|
export const departPreview = (params) => defHttp.get({ url: Api.departPreview, params });
|
|
export const nuPreview = (params) => defHttp.get({ url: Api.nuPreview, params });
|
|
export const configList = (params) => defHttp.get({ url: Api.configList, params });
|
|
export const nuList = (params) => defHttp.get({ url: Api.nuList, params });
|
|
/**
|
|
* 新增机构
|
|
* @param id
|
|
*/
|
|
export const savePreview = (params, isUpdate) => {
|
|
let url = isUpdate ? Api.updatePreview : Api.savePreview;
|
|
return defHttp.post({ url: url, params });
|
|
};
|
|
|
|
/**
|
|
* 批量保存
|
|
* @param params
|
|
* @returns
|
|
*/
|
|
export const batchSave = (params) => {
|
|
return defHttp.post({ url: Api.batchSave, params });
|
|
};
|
|
|
|
/**
|
|
* 删除
|
|
* @param id
|
|
*/
|
|
export const deletePreview = (params) => defHttp.post({ url: Api.deletePreview, params });
|
|
|
|
export const queryQuantityByOrgCode = (params) => {
|
|
return defHttp.get({ url: Api.queryQuantityByOrgCode, params });
|
|
};
|
|
|
|
export const getNuListByOrgCode = (params) => {
|
|
return defHttp.get({ url: Api.getNuListByOrgCode, params });
|
|
}; |