1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354 |
- import qs from 'qs';
- import { request } from '@/utils';
- import type {
- AccountParams,
- AddInterface,
- AgreementUpdate,
- AIAdvancedParamItem,
- AIOptimizeDetail,
- AIOptimizeDevData,
- AIStartStopDeviceItem,
- AIStartStopDeviceParams,
- AIStartStopOptimizeInfo,
- AlarmEvent,
- AlarmEventHistoryItemData,
- AlarmHistory,
- AlarmHistoryItem,
- AlarmPageParams,
- AlgorithmConfigInfo,
- AllDevicesList,
- AutomaticMatching,
- BatchUpdate,
- ChangeState,
- CharacterPageItem,
- CharacterPageItemData,
- CharacterParams,
- CoolingHistoryDataQuery,
- CoolingHistoryDataResult,
- CoolingRealTimeDataQuery,
- CoolingRealTimeDataResult,
- CoolingStatisticsQuery,
- CoolingStatisticsResult,
- CustomParameters,
- DeviceBindQuery,
- DeviceCop,
- DeviceGroup,
- DeviceGroupItem,
- DeviceGroupListQuery,
- DeviceParamGroup,
- DeviceParams,
- DeviceParamType,
- DevicePermissionsParams,
- DevicesList,
- DevicesListItemData,
- DeviceTypeCount,
- DevWorkHisDataQuery,
- DevWorkHistoryData,
- DevWorkRealTimeData,
- DevWorkRTDQuery,
- DictTypeData,
- DictTypeDataParams,
- ElectricityStatisticsQuery,
- ElectricityStatisticsResult,
- EquipmentDetailsForm,
- EquipmentDetailsItem,
- EquipmentTypeItem,
- EquipmentUpdateForm,
- EventTriggerData,
- GatewayBody,
- GatewayInformation,
- GatewayInterface,
- GatewayLinkProtocolQuery,
- GatewayListItemData,
- GatewayModelInfo,
- GatewayParameterBody,
- GatewayParameterItemData,
- GetListItem,
- GroupingList,
- GroupingListData,
- GroupModuleBatchItem,
- GroupModuleDevData,
- GroupModuleInfo,
- GroupModuleQuery,
- GroupRegions,
- InfoListByOrg,
- InterfaceData,
- InterfaceLsit,
- LimitForm,
- ListEquipmentParametersItemData,
- ListInfo,
- ListInterfaces,
- ListPhysicalInterfaces,
- loginForm,
- LoginUser,
- MonitoringForm,
- MonitorPointInfo,
- MonitorPointItem,
- NoticePageItemData,
- OperateLogData,
- OperateLogQuery,
- Organization,
- OrganizationInfo,
- OrganizationItem,
- OrganizationListItem,
- OrganizationListItemData,
- OrganizationListParams,
- OutdooForm,
- PageParams,
- ParameterVerification,
- ParamValueListAutomaticQuery,
- PermissionGroupItem,
- PermissionList,
- PointTimeSeriesQuery,
- PostProtocolPage,
- PostProtocolPageItem,
- PostProtocolPageItemData,
- ProtocolBaseInfo,
- ProtocolGatewayListListItem,
- ProtocolItemData,
- ProtocolList,
- ProtocolListData,
- ProtocolListItem,
- ProtocolListQuery,
- ProtocolParamData,
- ProtocolParamInfo,
- ProtocolParamSearchParams,
- ProtocolReset,
- ProtocolStandardParam,
- ProtocolStandardParamData,
- ProtocolStandardParamQuery,
- RegionQuery,
- RegionsPointsItem,
- RolePermissions,
- RolePermissionsItem,
- RolePermissionsParams,
- SerialNumberItem,
- SerialNumberItemData,
- SmartCtrlLogData,
- SmartCtrlLogQuery,
- SubmitDeviceGroup,
- SubmitSorting,
- TempHumidityControlSettings,
- TreeStructure,
- UploadLogo,
- UserPageItemData,
- UserPageParams,
- VerificationAgreement,
- VerificationEquipment,
- WarningItem,
- } from '@/types';
- /**
- * 获取认证授权服务 url
- */
- const apiUaa = (path: string, params?: unknown) => {
- const apiUrl = params ? `${path}?${qs.stringify(params)}` : path;
- return `/api-uaa${apiUrl}`;
- };
- /**
- * 获取系统服务 url
- */
- const apiSys = (path: string, params?: unknown) => {
- const apiUrl = params ? `${path}?${qs.stringify(params)}` : path;
- return `/api-sys${apiUrl}`;
- };
- /**
- * 获取业务服务 url
- */
- const apiBiz = (path: string, params?: unknown) => {
- const apiUrl = params ? `${path}?${qs.stringify(params, { arrayFormat: 'repeat' })}` : path;
- return `/api-biz${apiUrl}`;
- };
- // ----- 认证授权服务 -----
- // 登录和注销
- export const loginUser = async (params: LoginUser) => {
- const data = await request<loginForm>(apiUaa('/oauth/token', params), {
- method: 'POST',
- headers: {
- Authorization: 'Basic ' + btoa('unimat:unimat'),
- },
- });
- return data;
- };
- export const logoutUser = async () => {
- await request(apiUaa('/oauth/remove/token'));
- };
- export const refreshUser = async () => {
- await request(apiUaa('/oauth/token'));
- };
- // ----- 系统服务 -----
- // 字典类型表
- export const getDictTypeData = async (params: DictTypeDataParams) => {
- const data = await request<DictTypeData[]>(apiSys('/sysDictType/typeAndData', params));
- return data;
- };
- // 菜单权限表
- export const getSubPermList = async (id: number) => {
- const data = await request<TreeStructure[]>(apiSys(`/sysPermission/subPermList/${id}`));
- return data;
- };
- export const getPermissionCheckTree = async (roleId: number) => {
- const data = await request<TreeStructure[]>(apiSys(`/sysPermission/permissionCheckTree/${roleId}`));
- return data;
- };
- // 角色和菜单关联表
- export const addGrantRolePermissions = async (params: RolePermissionsParams) => {
- await request(apiSys('/sysRolePermission/grantRolePermissions'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 角色和组织关联表
- export const getFindRolesByOrgIds = async (params: number[]) => {
- const data = await request<CharacterPageItem[]>(apiSys('/sysRoleOrg/findRolesByOrgIds'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 角色信息表
- export const addRolePermissions = async (params: RolePermissions) => {
- await request(apiSys('/sysRole/addRolePermissions'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getRolePermissions = async (id: number) => {
- const data = await request<RolePermissionsItem>(apiSys(`/sysRole/getRolePermissions/${id}`), {
- method: 'POST',
- });
- return data;
- };
- // 角色信息表
- export const addCharacter = async (params: CharacterParams) => {
- await request(apiSys('/sysRole/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const updateCharacter = async (params: CharacterParams) => {
- await request(apiSys('/sysRole/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getCharacterPageList = async (params: PageParams) => {
- const data = await request<CharacterPageItemData>(apiSys('/sysRole/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const deleteCharacter = async (id: number) => {
- await request(apiSys(`/sysRole/delete/${id}`), {
- method: 'POST',
- });
- };
- export const addUpdateRolePermissions = async (params: RolePermissions) => {
- await request(apiSys('/sysRole/updateRolePermissions'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 组织表
- export const addOrganization = async (params: OrganizationItem) => {
- const data = await request<number>(apiSys('/sysOrg/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const updateOrganization = async (params: OrganizationItem) => {
- await request<number>(apiSys('/sysOrg/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const addUploadLogo = async (file: Blob) => {
- const formData = new FormData();
- formData.append('file', file);
- const data = await request<UploadLogo>(apiSys('/sysOrg/uploadLogo'), {
- method: 'POST',
- body: formData,
- });
- return data;
- };
- export const getSubOrgsByToken = async () => {
- const data = await request<Organization[]>(apiSys('/sysOrg/subOrgsByToken'));
- return data;
- };
- export const getOrganizationList = async (params: OrganizationListParams) => {
- const data = await request<OrganizationListItemData>(apiSys('/sysOrg/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getOrganizationAllList = async (params?: string) => {
- const data = await request<OrganizationListItem[]>(apiSys('/sysOrg/getList'), {
- method: 'POST',
- body: JSON.stringify({ orgName: params }),
- });
- return data;
- };
- export const getDownloadLogo = async (fileName: string) => {
- const data = await request(apiSys(`/sysOrg/downloadLogo/${fileName}`), {
- method: 'POST',
- });
- return data;
- };
- // 菜单权限表
- export const getOrgInfo = async (id: number) => {
- const data = await request<OrganizationInfo>(apiSys(`/sysOrg/info/${id}`));
- return data;
- };
- // 用户信息表
- export const addAccount = async (params: AccountParams) => {
- await request(apiSys('/sysUser/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const updateAccount = async (params: AccountParams) => {
- await request(apiSys('/sysUser/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const batchDeleteAccount = async (params: number[]) => {
- await request(apiSys('/sysUser/batchDelete/'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getUserPageList = async (params: UserPageParams) => {
- const data = await request<UserPageItemData>(apiSys('/sysUser/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // ----- 业务服务 -----
- // 报警事件
- export const addAlarmEvent = async (params: AlarmEvent) => {
- await request(apiBiz('/alarmEvent/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const alarmEventChangeState = async (params: ChangeState) => {
- await request(apiBiz('/alarmEvent/changeState'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const deleteAlarmEvent = async (id: number) => {
- await request(apiBiz(`/alarmEvent/delete/${id}`), {
- method: 'POST',
- });
- };
- export const getAlarmEventGetPageList = async (params: AlarmPageParams) => {
- const data = await request<EventTriggerData>(apiBiz('/alarmEvent/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getAlarmEventInfo = async (id: number) => {
- const data = await request<AlarmEvent>(apiBiz(`/alarmEvent/info/${id}`));
- return data;
- };
- export const updateAlarmEvent = async (params: AlarmEvent) => {
- await request(apiBiz('/alarmEvent/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 报警历史表
- export const getAlarmHistoryList = async (params: AlarmHistory) => {
- const data = await request<AlarmEventHistoryItemData>(apiBiz('/alarmHistory/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 算法配置
- export const getAlgorithmConfigInfo = async (devGroupId: number) => {
- const data = await request<AlgorithmConfigInfo>(apiBiz(`/algorithmConfig/info/byGroup/${devGroupId}`));
- return data;
- };
- export const addAlgorithmConfigUpdate = async (params: Partial<AlgorithmConfigInfo>) => {
- await request(apiBiz('/algorithmConfig/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 环境监控-监测点预警配置
- export const addBatchMonitorPointAlarm = async (params: WarningItem[]) => {
- await request(apiBiz('/monitorPointAlarm/addBatch'), {
- method: 'POST',
- body: JSON.stringify({ monitorPointAlarms: params }),
- });
- };
- export const getMonitorPointAlarm = async (pointId: number) => {
- const data = await request<MonitorPointItem[]>(apiBiz(`/monitorPointAlarm/point/${pointId}`));
- return data;
- };
- export const updateBatchMonitorPointAlarm = async (params: WarningItem[]) => {
- await request(apiBiz('/monitorPointAlarm/updateBatch'), {
- method: 'POST',
- body: JSON.stringify({ monitorPointAlarms: params }),
- });
- };
- export const getMonitorPointAlarmHistory = async (devGroupId: number) => {
- const data = await request<AlarmHistoryItem[]>(apiBiz(`/monitorPointAlarm/history/${devGroupId}`));
- return data;
- };
- // 环境监控-区域
- export const addRegion = async (params: RegionQuery) => {
- await request(apiBiz('/region/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const regionUpdate = async (params: RegionQuery) => {
- await request(apiBiz('/region/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const regionDelete = async (id: number) => {
- await request(apiBiz(`/region/delete/${id}`), {
- method: 'POST',
- });
- };
- export const getGroupRegions = async (devGroupId: number) => {
- const data = await request<GroupRegions[]>(apiBiz(`/region/groupRegions/${devGroupId}`), {
- method: 'POST',
- });
- return data;
- };
- export const getRegionsPointsData = async (devGroupId: number) => {
- const data = await request<RegionsPointsItem[]>(apiBiz(`/region/pointsData/${devGroupId}`), {
- method: 'POST',
- });
- return data;
- };
- export const getRegionsPointsValue = async (devGroupId: number, params: { endTime: string }) => {
- const data = await request<RegionsPointsItem[]>(apiBiz(`/region/pointsValue/${devGroupId}`), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 环境监控-监测点
- export const addMonitorPoint = async (params: MonitoringForm) => {
- await request(apiBiz('/monitorPoint/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const deleteMonitorPoint = async (id: number) => {
- await request(apiBiz(`/monitorPoint/delete/${id}`), {
- method: 'POST',
- });
- };
- export const updateMonitorPoint = async (params: MonitoringForm) => {
- await request(apiBiz('/monitorPoint/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const updateRegionMonitorPoint = async (params: OutdooForm) => {
- await request(apiBiz('/region/monitorPoint/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getMonitorPointInfo = async (id: number) => {
- const data = await request<MonitorPointInfo>(apiBiz(`/monitorPoint/info/${id}`));
- return data;
- };
- export const updateLimits = async (params: LimitForm) => {
- await request(apiBiz('/monitorPoint/updateLimits'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getPointTimeSeries = async (params: PointTimeSeriesQuery, pointId: number) => {
- const data = await request<TempHumidityControlSettings>(apiBiz(`/monitorPoint/pointTimeSeries/${pointId}`), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 设备组列表
- export const getPageList = async () => {
- const data = await request<DeviceGroupItem[]>(apiBiz('/deviceGroup/getList'), {
- method: 'POST',
- });
- return data;
- };
- export const addDeviceGroup = async (params: SubmitDeviceGroup) => {
- await request(apiBiz('/deviceGroup/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const addDeviceGroupUpdate = async (params: SubmitDeviceGroup) => {
- await request(apiBiz('/deviceGroup/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const deleteDeviceGroup = async (id: number) => {
- await request(apiBiz(`/deviceGroup/delete/${id}`), {
- method: 'POST',
- });
- };
- export const addDevicePermissions = async (params: DevicePermissionsParams) => {
- await request(apiBiz('/deviceGroup/update/role'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getAllGroupList = async (params: PermissionList) => {
- const data = await request<PermissionGroupItem[]>(apiBiz('/deviceGroup/getAllList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 设备列表
- export const deviceAdd = async (equipmentInformationForm: EquipmentDetailsForm) => {
- const data = await request<number>(apiBiz('/device/add'), {
- method: 'POST',
- body: JSON.stringify(equipmentInformationForm),
- });
- return data;
- };
- export const getDeviceGroupList = async (params: DeviceGroupListQuery) => {
- const data = await request<DeviceGroup[]>(apiBiz('/deviceGroup/getDeviceGroupList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const addDeviceBind = async (params: DeviceBindQuery) => {
- await request(apiBiz('/device/bind'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const deviceDeletion = async (ids: number[]) => {
- await request(apiBiz('/device/delete/batch'), {
- method: 'POST',
- body: JSON.stringify(ids),
- });
- };
- export const equipmentDetails = async (id: number) => {
- const data = await request<EquipmentDetailsItem>(apiBiz(`/device/getBasicInfo/${id}`), {
- method: 'POST',
- });
- return data;
- };
- export const queryDevicesList = async (devicesList: DevicesList) => {
- const data = await request<DevicesListItemData>(apiBiz('/device/getPageList'), {
- method: 'POST',
- body: JSON.stringify(devicesList),
- });
- return data;
- };
- export const noPaginationDevicesList = async () => {
- const data = await request<AllDevicesList[]>(apiBiz('/device/getList'), {
- method: 'POST',
- });
- return data;
- };
- export const getDeviceListSimple = async (deviceId: number) => {
- const data = await request<DeviceParams[]>(apiBiz(`/device/listSimple/${deviceId}`));
- return data;
- };
- export const getDeviceParams = async (deviceId: number, isProcessData?: boolean) => {
- const data = await request<DeviceParamGroup[]>(apiBiz('/device/protocolParamVerify'), {
- method: 'POST',
- body: JSON.stringify({
- deviceId,
- isProcessData,
- }),
- });
- return data;
- };
- export const getDeviceListOptions = async (deviceId: number) => {
- const data = await request<DeviceParamType[]>(apiBiz(`/device/listOptions/${deviceId}`));
- return data;
- };
- export const updateDeviceCop = async (params: DeviceCop[]) => {
- await request(apiBiz('/device/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 设备工况
- export const getDevWorkTypeCount = async (deviceGroupId: number, deviceTypes: number[]) => {
- const data = await request<DeviceTypeCount[]>(apiBiz('/deviceCondition/getTypeCount'), {
- method: 'POST',
- body: JSON.stringify({
- deviceGroupId,
- deviceTypes,
- }),
- });
- return data;
- };
- export const getDevWorkRealTimeData = async (params: DevWorkRTDQuery) => {
- const data = await request<DevWorkRealTimeData[]>(apiBiz('/deviceCondition/getRTDList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getDevWorkHistoryData = async (params: DevWorkHisDataQuery) => {
- const data = await request<DevWorkHistoryData[]>(apiBiz('/deviceCondition/getHisList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 设备网关
- export const deviceGatewayUpdate = async (equipmentUpdateForm: EquipmentUpdateForm[]) => {
- await request(apiBiz('/deviceGateway/update'), {
- method: 'POST',
- body: JSON.stringify(equipmentUpdateForm),
- });
- };
- // 设备协议参数验证
- export const postParameterVerification = async (deviceId: number) => {
- const data = await request<ParameterVerification[]>(apiBiz('/protocolParamVerify/list'), {
- method: 'POST',
- body: JSON.stringify({
- deviceId,
- }),
- });
- return data;
- };
- // 设备参数分组
- export const equipmentParametersList = async (groupingList: GroupingList[]) => {
- await request(apiBiz('/deviceParamGroup/update/batch'), {
- method: 'POST',
- body: JSON.stringify(groupingList),
- });
- };
- export const queryEquipmentParametersList = async (deviceId: number) => {
- const data = await request<GroupingListData[]>(apiBiz('/deviceParamGroup/getList'), {
- method: 'POST',
- body: JSON.stringify({ deviceId }),
- });
- return data;
- };
- // 设备参数关系表
- export const submitSortingList = async (submitSorting: SubmitSorting[]) => {
- await request(apiBiz('/deviceParamGroupRel/update/batch'), {
- method: 'POST',
- body: JSON.stringify(submitSorting),
- });
- };
- // 设备自定义参数表
- export const submitCustomParameters = async (customParameters: CustomParameters[]) => {
- await request(apiBiz('/protocolParamCustomDev/update/batch'), {
- method: 'POST',
- body: JSON.stringify(customParameters),
- });
- };
- // 网关基本信息
- export const addGateway = async () => {
- await request(apiBiz('/gateway/add'));
- };
- export const gatewayDelete = async (id: number) => {
- await request(apiBiz(`/gateway/delete/${id}`), {
- method: 'POST',
- });
- };
- export const getAllGatewayList = async () => {
- const data = await request<SerialNumberItem[]>(apiBiz('/gateway/getGtwLinkList'), {
- method: 'POST',
- });
- return data;
- };
- export const validateGatewayInfo = async (registerGatewayForm: VerificationEquipment) => {
- const data = await request<GatewayInformation>(apiBiz('/gateway/validate', registerGatewayForm), {
- method: 'POST',
- });
- return data;
- };
- export const gatewayList = async (gatewayBody: GatewayBody) => {
- const data = await request<GatewayListItemData>(apiBiz('/gateway/getPageList'), {
- method: 'POST',
- body: JSON.stringify(gatewayBody),
- });
- return data;
- };
- // 网关通讯
- export const gatewayLinkAdd = async (addInterface: AddInterface) => {
- await request(apiBiz('/gatewayLink/add'), {
- method: 'POST',
- body: JSON.stringify(addInterface),
- });
- };
- export const addGatewayLinkBatchUpdate = async (params: BatchUpdate[]) => {
- await request(apiBiz('/gatewayLink/batchUpdate'), {
- method: 'POST',
- body: JSON.stringify({ gatewayLinks: params }),
- });
- };
- export const gatewayLinkDelete = async (id: number) => {
- await request(apiBiz(`/gatewayLink/delete/${id}`), {
- method: 'POST',
- });
- };
- export const gatewayLinkGetList = async (gatewayId: number) => {
- const data = await request<InterfaceData[]>(apiBiz(`/gatewayLink/getList/${gatewayId}`), {
- method: 'POST',
- });
- return data;
- };
- export const gatewayLinkUpdate = async (agreementUpdate: AgreementUpdate) => {
- await request(apiBiz('/gatewayLink/update'), {
- method: 'POST',
- body: JSON.stringify(agreementUpdate),
- });
- };
- export const getGatewayLinks = async (gatewayId: number) => {
- const data = await request<InterfaceLsit[]>(apiBiz(`/gatewayLink/getGatewayLinks/${gatewayId}`));
- return data;
- };
- // 网关型号
- export const getGatewayModelInfo = async (id: number) => {
- const data = await request<GatewayModelInfo>(apiBiz(`/gatewayModel/info/${id}`));
- return data;
- };
- export const getGatewayModelInterfaces = async (id: number) => {
- const data = await request<GatewayInterface[]>(apiBiz(`/gatewayModel/interfaces/${id}`), {
- method: 'POST',
- });
- return data;
- };
- // 网关物理接口协议
- export const obtainListPhysicalInterfaces = async (id: number) => {
- const data = await request<ListPhysicalInterfaces[]>(apiBiz(`/gatewayInterfaceProtocol/getProtocols/${id}`));
- return data;
- };
- // 网关型号物理接口
- export const obtainListInterfaces = async (id: number) => {
- const data = await request<ListInterfaces[]>(apiBiz(`/gatewayPhysicalInterface/getInterfaces/${id}`));
- return data;
- };
- // 网关接口协议
- export const getParamValueListAutomatic = async (params: ParamValueListAutomaticQuery) => {
- const data = await request<AutomaticMatching>(apiBiz('/gatewayLinkProtocol/getParamValueListAutomatic'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getAllGatewayLinkProtocol = async <T>(params: GatewayLinkProtocolQuery) => {
- const data = await request<T>(apiBiz('/gatewayLinkProtocol/getLinkParams'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const gatewayLinkProtocolList = async <T>(protocolListItem: ProtocolListItem) => {
- const data = await request<T>(apiBiz('/gatewayLinkProtocol/getParamPageList'), {
- method: 'POST',
- body: JSON.stringify(protocolListItem),
- });
- return data;
- };
- export const gatewayLinkProtocolGatewayList = async (protocolGatewayListListItem: ProtocolGatewayListListItem) => {
- const data = await request<ListEquipmentParametersItemData>(
- apiBiz('/gatewayLinkProtocol/getParamPageListByGateway'),
- {
- method: 'POST',
- body: JSON.stringify(protocolGatewayListListItem),
- },
- );
- return data;
- };
- export const gatewayLinkList = async (id: number) => {
- const data = await request<VerificationAgreement[]>(apiBiz(`/gatewayLinkProtocol/getProtocolInfoList/${id}`), {
- method: 'POST',
- });
- return data;
- };
- export const gatewayLinkProtocolReset = async (protocolReset: ProtocolReset) => {
- await request(apiBiz('/gatewayLinkProtocol/reset'), {
- method: 'POST',
- body: JSON.stringify(protocolReset),
- });
- };
- export const postProtocolCandidatesList = async (protocolList: ProtocolList, gatewayId: number) => {
- const data = await request<ProtocolItemData>(apiBiz(`/gatewayLinkProtocol/getProtocolCandidates/${gatewayId}`), {
- method: 'POST',
- body: JSON.stringify(protocolList),
- });
- return data;
- };
- export const gatewayParameterList = async (gatewayParameterBody: GatewayParameterBody) => {
- const data = await request<GatewayParameterItemData>(apiBiz('/gatewayLinkProtocol/getParamValuePageList'), {
- method: 'POST',
- body: JSON.stringify(gatewayParameterBody),
- });
- return data;
- };
- // 组织网关
- export const orgGatewayRegister = async (gatewayId: number) => {
- await request(apiBiz('/orgGateway/register'), {
- method: 'POST',
- body: JSON.stringify({ gatewayId }),
- });
- };
- export const orgGatewayUnregister = async (gatewayId: number) => {
- await request(apiBiz(`/orgGateway/unregister/${gatewayId}`), {
- method: 'POST',
- });
- };
- export const orgGatewaySerialNumber = async (protocolList: ProtocolList) => {
- const data = await request<SerialNumberItemData>(apiBiz('/orgGateway/getGatewayPageList'), {
- method: 'POST',
- body: JSON.stringify(protocolList),
- });
- return data;
- };
- // 能耗分析
- export const getElectricityDataStatistics = async (params: ElectricityStatisticsQuery) => {
- const data = await request<ElectricityStatisticsResult>(
- apiBiz('/deviceElectricityDataChange/getElectricityDataStatistics'),
- {
- method: 'POST',
- body: JSON.stringify(params),
- },
- );
- return data;
- };
- export const downloadElectricityHisData = async (params: ElectricityStatisticsQuery) => {
- const blob = await request<Blob>(apiBiz('/deviceElectricityDataChange/download', params));
- return blob;
- };
- // 能效分析
- export const getCoolingRealTimeData = async (params: CoolingRealTimeDataQuery) => {
- const data = await request<CoolingRealTimeDataResult>(apiBiz('/deviceCoolingData/rtd'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getCoolingHistoryData = async (params: CoolingHistoryDataQuery) => {
- const data = await request<CoolingHistoryDataResult>(apiBiz('/deviceCoolingData/his'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const getCoolingDataStatistics = async (params: CoolingStatisticsQuery) => {
- const data = await request<CoolingStatisticsResult>(apiBiz('/deviceCoolingDataChange/getCoolingDataStatistics'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const downloadCoolingHisData = async (params: CoolingStatisticsQuery) => {
- const blob = await request<Blob>(apiBiz('/deviceCoolingDataChange/download', params));
- return blob;
- };
- // 平台标准协议参数
- export const getProtocolStandardParam = async (paramId: number) => {
- const data = await request<ProtocolStandardParam>(apiBiz(`/platformProtocolInfo/info/${paramId}`));
- return data;
- };
- export const getProtocolStandardParamList = async (params: ProtocolStandardParamQuery) => {
- const data = await request<ProtocolStandardParamData>(apiBiz('/platformProtocolInfo/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 协议参数
- export const addProtocolParam = async (params: Partial<ProtocolParamInfo>) => {
- await request(apiBiz('/protocolParamInfo/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const updateProtocolParam = async (params: Partial<ProtocolParamInfo>) => {
- await request(apiBiz('/protocolParamInfo/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getProtocolParamList = async (params: ProtocolParamSearchParams) => {
- const data = await request<ProtocolParamData>(apiBiz('/protocolParamInfo/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const batchDeleleProtocolParam = async (params: number[]) => {
- await request(apiBiz('/protocolParamInfo/batchDeleleByIds'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- // 协议基本信息
- export const addProtocolBaseInfo = async (params: Partial<ProtocolBaseInfo>) => {
- const data = await request<number>(apiBiz('/protocolBaseInfo/add'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const addTempProtocol = async (params: Partial<ProtocolBaseInfo>) => {
- const data = await request<number>(apiBiz('/protocolBaseInfo/addTemp'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- export const downloadProtocolTemplate = async (fileName: string) => {
- const blob = await request<Blob>(apiBiz(`/protocolBaseInfo/downloadTemplate/${fileName}`));
- return blob;
- };
- export const uploadUserProtocol = async (protocolType: string, file: Blob) => {
- const formData = new FormData();
- formData.append('file', file);
- const data = await request<Pick<ProtocolBaseInfo, 'id' | 'protocolName' | 'protocolType'>>(
- apiBiz('/protocolBaseInfo/uploadUserTemplate', { protocolType }),
- {
- method: 'POST',
- body: formData,
- },
- );
- return data;
- };
- export const reUploadUserProtocol = async (protocolType: string, id: number, file: Blob) => {
- const formData = new FormData();
- formData.append('file', file);
- const data = await request<Pick<ProtocolBaseInfo, 'id' | 'protocolName' | 'protocolType'>>(
- apiBiz('/protocolBaseInfo/resetConfiguration', { protocolType, id }),
- {
- method: 'POST',
- body: formData,
- },
- );
- return data;
- };
- export const downloadUserProtocol = async (id: number) => {
- const blob = await request<Blob>(apiBiz('/protocolBaseInfo/downloadUserProtocol', { id }));
- return blob;
- };
- /**
- * @deprecated
- */
- export const getUploadProtocol = async (protocolType: string, protocolName: string) => {
- const data = await request<ProtocolBaseInfo>(
- apiBiz('/protocolBaseInfo/findUploadProtocolBaseInfo', {
- protocolType,
- protocolName,
- }),
- );
- return data;
- };
- export const getProtocolBaseInfo = async (id: number) => {
- const data = await request<ProtocolBaseInfo>(apiBiz(`/protocolBaseInfo/info/${id}`));
- return data;
- };
- export const updateProtocolBaseInfo = async (params: Partial<ProtocolBaseInfo>) => {
- await request(apiBiz('/protocolBaseInfo/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const deleteProtocolBaseInfo = async (id: number) => {
- await request(apiBiz(`/protocolBaseInfo/delete/${id}`), {
- method: 'POST',
- });
- };
- export const completeProtocolConfig = async (id: number) => {
- await request(apiBiz(`/protocolBaseInfo/completeConfiguration/${id}`), {
- method: 'POST',
- });
- };
- export const getProtocolList = async (params: ProtocolListQuery) => {
- const data = await request<ProtocolListData>(apiBiz('/protocolBaseInfo/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 协议参数表
- export const postProtocolPageList = async (postProtocolPage: PostProtocolPage) => {
- const data = await request<PostProtocolPageItemData>(apiBiz('/protocolParamInfo/page/list'), {
- method: 'POST',
- body: JSON.stringify(postProtocolPage),
- });
- return data;
- };
- export const postProtocolGetList = async (getListItem: GetListItem) => {
- const data = await request<PostProtocolPageItem[]>(apiBiz('/protocolParamInfo/getList'), {
- method: 'POST',
- body: JSON.stringify(getListItem),
- });
- return data;
- };
- // 全局参数
- export const groupList = async (listInfo: ListInfo) => {
- const data = await request<EquipmentTypeItem[]>(apiBiz('/deviceGlobalData/getList'), {
- method: 'POST',
- body: JSON.stringify(listInfo),
- });
- return data;
- };
- // 站内通知
- export const getUnreadNotifications = async () => {
- const data = await request<number>(apiBiz('/stationNotify/leftSize'), {
- method: 'POST',
- });
- return data;
- };
- export const getNoticePageList = async (params: PageParams) => {
- const data = await request<NoticePageItemData>(apiBiz('/stationNotify/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 组态
- export const getGroupModuleInfo = async (params: GroupModuleQuery) => {
- const data = await request<GroupModuleInfo>(apiBiz('/moduleInfo/info'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 组织与设备限制
- export const getInfoListByOrgId = async (orgId: number) => {
- const data = await request<InfoListByOrg[]>(apiBiz(`/orgDeviceLimit/infoListByOrgId/${orgId}`));
- return data;
- };
- export const updateGroupModuleInfo = async (params: Partial<GroupModuleInfo>) => {
- await request(apiBiz('/moduleInfo/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getGroupModuleDevData = async (deviceId: number, deviceType: number) => {
- const data = await request<GroupModuleDevData>(apiBiz('/moduleInfo/info/device/detail'), {
- method: 'POST',
- body: JSON.stringify({
- deviceId,
- deviceType,
- }),
- });
- return data;
- };
- export const updateGroupModuleDevData = async (deviceId: number, deviceParamCode: string, value: number | string) => {
- await request(apiBiz('/moduleInfo/update/status'), {
- method: 'POST',
- body: JSON.stringify({
- deviceId,
- deviceParamCode,
- value,
- }),
- });
- };
- export const getGroupModuleDevStatus = async (groupId: number) => {
- const data = await request<GroupModuleBatchItem[]>(apiBiz('/moduleInfo/info/batch/status'), {
- method: 'POST',
- body: JSON.stringify({
- groupId,
- }),
- });
- return data;
- };
- // AI智能启停和寻优,高级设置
- export const getAIStartStopData = async (groupId: number, startType: number) => {
- const data = await request<AIStartStopDeviceItem[]>(apiBiz('/moduleInfoAi/info/startType'), {
- method: 'POST',
- body: JSON.stringify({
- groupId,
- startType,
- }),
- });
- return data;
- };
- export const updateAIStartStopData = async (params: AIStartStopDeviceParams) => {
- await request(apiBiz('/moduleInfoAi/update/startType'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getAIOptimizeDevData = async (groupId: number) => {
- const data = await request<AIOptimizeDevData>(apiBiz(`/moduleInfoAi/get/info/${groupId}`));
- return data;
- };
- export const getAIOptimizeDetail = async (groupId: number, deviceType: number) => {
- const data = await request<AIOptimizeDetail>(apiBiz('/moduleInfoAi/infoDetail'), {
- method: 'POST',
- body: JSON.stringify({
- groupId,
- deviceType,
- }),
- });
- return data;
- };
- export const updateAIStartStopOptimize = async (params: AIStartStopOptimizeInfo) => {
- await request(apiBiz('/moduleInfoAi/update'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const updateAIOptimizeSetting = async (params: AIOptimizeDetail) => {
- await request(apiBiz('/moduleInfoAi/update/infoDetail'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- };
- export const getAIAdvancedSetting = async (groupId: number) => {
- const data = await request<AIAdvancedParamItem[]>(apiBiz('/moduleInfoAi/info/advancedSetting'), {
- method: 'POST',
- body: JSON.stringify({
- groupId,
- }),
- });
- return data;
- };
- // 智控日志
- export const getSmartCtrlLog = async (params: SmartCtrlLogQuery) => {
- const data = await request<SmartCtrlLogData>(apiBiz('/algLogInfo/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
- // 操作日志
- export const getOperateLog = async (params: OperateLogQuery) => {
- const data = await request<OperateLogData>(apiBiz('/controlLogInfo/getPageList'), {
- method: 'POST',
- body: JSON.stringify(params),
- });
- return data;
- };
|