@jdlinker/linker
Version:
jdLinker 系统模块
99 lines (98 loc) • 3.63 kB
text/typescript
// import { defHttp } from '@jdlinker/func';
// import { useMessage } from '@jdlinker/func';
//
// const { createConfirm } = useMessage();
//
// enum Api {
// save = '/gateway/device/add',
// edit = '/gateway/device/edit',
// }
//
// export const queryList = (params) => {
// return defHttp.get({ url: '/gateway/device/list', params });
// };
//
// export const queryGatewayDetail = (id: string) => {
// return defHttp.get({ url: `/gateway/device/detail/_query/${id}` }, { isTransformResponse: false });
// };
//
// // 启用设备网关
// export const startUp = (id: string, handleSuccess) => {
// return defHttp.post({ url: `/gateway/device/${id}/_startup` }).then(() => {
// handleSuccess();
// });
// };
//
// // 禁用设备网关
// export const shutDown = (id: string, handleSuccess) => {
// return defHttp.post({ url: `/gateway/device/${id}/_shutdown` }, { joinParamsToUrl: true }).then(() => {
// handleSuccess();
// });
// };
//
// // 保存或者更新
// export const saveOrUpdate = (params, isUpdate) => {
// const url = isUpdate ? Api.edit : Api.save;
// // if (params.configuration) {
// // params.configuration = params.configuration;
// // }
// return defHttp.post({ url: url, params }, { isTransformResponse: false });
// };
//
// // 删除
// export const deleteOne = (params, handleSuccess) => {
// return defHttp.delete({ url: '/gateway/device/delete', params }, { joinParamsToUrl: true }).then(() => {
// handleSuccess();
// });
// };
//
// // 批量删除
// export const batchDelete = (params, handleSuccess) => {
// createConfirm({
// iconType: 'warning',
// title: '确认删除',
// content: '是否删除选中数据',
// okText: '确认',
// cancelText: '取消',
// onOk: () => {
// return defHttp.delete({ url: '/gateway/device/deleteBatch', data: params }, { joinParamsToUrl: true }).then(() => {
// handleSuccess();
// });
// },
// });
// };
//
// export const getProviders = () => defHttp.get({ url: `/gateway/device/providers` }, { isTransformResponse: false });
//
// export const getNetworkList = (networkType: string, params?: any) =>
// defHttp.get({ url: `/network/config/${networkType}/_alive`, params }, { isTransformResponse: false });
//
// export const getProtocolList = (transport?: string, params?: any) => {
// return defHttp.get({ url: `/protocol/supports/${transport ? transport : ''}`, params }, { isTransformResponse: false });
// };
//
// export const getChildConfigView = (id: string) => {
// return defHttp.get({ url: `/protocol/${id}/transports` });
// };
//
// export const getConfigView = (id: string, transport: string) => defHttp.get({ url: `/protocol/${id}/transport/${transport}` });
//
// export const getClusters = () => defHttp.get({ url: `/network/resources/clusters` });
//
// //引导页-不在提示
// export const productGuide = () => defHttp.get({ url: `/user/settings/product/guide` });
//
// export const productGuideSave = (data: any) => defHttp.post({ url: `/user/settings/product/guide`, data });
//
// export const productGuideDetail = () => defHttp.delete({ url: `/user/settings/product/guide` });
//
// export const getResourcesCurrent = () => defHttp.get({ url: `/network/resources/alive/_current` }, { isTransformResponse: false });
//
// export const queryGateway = (params) => {
// return defHttp.get({ url: '/gateway/device/select/_query', params });
// };
//
// export const detail = (id: string) => {
// const params = { id: id };
// return defHttp.get({ url: `/gateway/device/queryById`, params }, { isTransformResponse: false });
// };