123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- import { request } from 'umi';
- import { projectId } from '@/config/api';
- import userData from '@/config/user';
- export async function getMapList(body: any, options?: { [key: string]: any }) {
- return request<API.MapInfoRes>(
- `/sgadmin/duoduo-service/setup-service/map/queryMapInfo?${commonParams()}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- ...(options || {}),
- data: body,
- },
- );
- }
- export async function getBuildingList(body: any, options?: { [key: string]: any }) {
-
- return request<API.BuildFloorList>(
- `/sgadmin/duoduo-service/object-service/object/building/query?${commonParams()}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- ...(options || {}),
- data: body,
- },
- );
- }
- export async function getFloorList(body: any, options?: { [key: string]: any }) {
-
- return request<API.BuildFloorList>(
- `/sgadmin/duoduo-service/object-service/object/floor/query?${commonParams()}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- ...(options || {}),
- data: body,
- },
- );
- }
- export async function queryDeviceTimeManage(params: any, options?: { [key: string]: any }) {
-
- return request<API.DeviceTimeType>(
- `/sgadmin/duoduo-service/setup-service/deviceManage/queryDeviceTimeManage?${commonParams()}`,
- {
- method: 'GET',
- params: {
- ...params,
- },
- ...(options || {}),
- },
- );
- }
- function getProjectId() {
- const id = projectId;
- return id;
- }
- function commonParams() {
- var userObj = userData.getInstance();
- const user = userObj.getUser();
- return `openid=${user.id}&pubname=sgadmin&projectId=${getProjectId()}&userId=${user.id}`;
- }
- export async function queryPropertyData(params: any, options?: { [key: string]: any }) {
- return request<API.DeviceTimeType>(
- `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData`,
- {
- method: 'GET',
- params: params,
- ...(options || {}),
- },
- );
- }
- export async function queryEnvironmentParam(body: any, otherParam: { [key: string]: any }) {
-
- return request<API.EnvironmentParam>(
- `/sgadmin/duoduo-service/object-service/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}¶m=${otherParam.param}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- data: body,
- },
- );
- }
- export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
-
- return request<API.EnvironmentParam>(
- `/sgadmin/duoduo-service/object-service/object/equipment/queryEquipStatistics`,
- {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- },
- ...(options || {}),
- params: {
- ...params,
- },
- },
- );
- }
- export async function querySpace(body: any, options?: { [key: string]: any }) {
-
- return request<API.EnvironmentParam>(
- `/sgadmin/duoduo-service/object-service/object/space/query?${commonParams()}`,
- {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- ...(options || {}),
- data: body,
- },
- );
- }
- export async function checkToken(header: any, options?: { [key: string]: any }) {
- return request<API.EnvironmentParam>(`/sgadmin/duoduo-service/setup-service/user/zjCheckToken`, {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- ...header,
- },
- ...(options || {}),
- });
- }
- export async function reFreshCheckToken(header: any, options?: { [key: string]: any }) {
- return request<API.EnvironmentParam>(`/sgadmin/sso/auth/zjFreshCheckToken`, {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- ...header,
- },
- ...(options || {}),
- });
- }
|