| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- /**
- * Copyright (c) 2013-Now https://jeesite.com All rights reserved.
- * No deletion without permission, or be held responsible to law.
- * @author ThinkGem
- */
- import { defHttp } from '@jeesite/core/utils/http/axios';
- import { useGlobSetting } from '@jeesite/core/hooks/setting';
- import { downloadByData } from '@jeesite/core/utils/file/download';
- import type { Result, UploadFileParams } from '@jeesite/types/axios';
- import type { AxiosProgressEvent, AxiosResponse } from 'axios';
- const { adminPath, ctxAdminPath, ctxPath } = useGlobSetting();
- export interface BaseStationSearchParams {
- mnc: string | number;
- lac: string | number;
- ci: string | number;
- }
- export interface BaseStationSearchLocation {
- latitude?: string | number | null;
- lat?: string | number | null;
- y?: string | number | null;
- longitude?: string | number | null;
- lng?: string | number | null;
- lon?: string | number | null;
- x?: string | number | null;
- range?: string | number | null;
- radius?: string | number | null;
- address?: string | null;
- addr?: string | null;
- stationName?: string | null;
- stationAddr?: string | null;
- lac?: string | number | null;
- ci?: string | number | null;
- cid?: string | number | null;
- mnc?: string | number | null;
- operatorName?: string | null;
- yys?: string | null;
- }
- export type BaseStationSearchResponse =
- | Array<string | number | null>
- | BaseStationSearchLocation
- | BaseStationSearchLocation[]
- | {
- data?: Array<string | number | null> | BaseStationSearchLocation | BaseStationSearchLocation[] | null;
- rows?: BaseStationSearchLocation[] | null;
- list?: BaseStationSearchLocation[] | null;
- records?: BaseStationSearchLocation[] | null;
- result?: Array<string | number | null> | BaseStationSearchLocation | BaseStationSearchLocation[] | null;
- };
- export interface BaseStationImportRow {
- field1?: string;
- lac?: string;
- cid?: string;
- yys?: string;
- field4?: string;
- field5?: string;
- field6?: string;
- field7?: string;
- field8?: string;
- }
- export interface BaseStationImportPayload {
- data?: BaseStationImportRow[];
- file?: string;
- path?: string;
- filePath?: string;
- result?: string | Recordable | null;
- }
- export interface BaseStationImportResponse {
- code?: number;
- message?: string;
- msg?: string;
- data?: BaseStationImportPayload | string | Recordable | null;
- path?: string;
- result?: string | Recordable | null;
- }
- export type BaseStationTemplateResponse =
- | string
- | {
- code?: number;
- message?: string;
- msg?: string;
- data?: string | { path?: string; filePath?: string; file?: string } | null;
- path?: string;
- filePath?: string;
- file?: string;
- };
- export interface BaseStationConvertResponse {
- code?: number;
- message?: string;
- msg?: string;
- data?: string | Recordable | null;
- path?: string;
- result?: string | Recordable | null;
- }
- export const searchBaseStation = (params: BaseStationSearchParams) =>
- defHttp.get<BaseStationSearchResponse>({ url: adminPath + '/tower/qry', params });
- export const importBaseStationFile = (
- params: UploadFileParams,
- onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
- caseId?: string | number,
- ) =>
- defHttp.uploadFile<BaseStationImportResponse>(
- {
- url:
- ctxPath +
- adminPath +
- '/tower/covFile' +
- (caseId !== undefined && caseId !== null && String(caseId).trim()
- ? `?caseId=${encodeURIComponent(String(caseId).trim())}`
- : ''),
- onUploadProgress,
- },
- params,
- );
- export const fetchBaseStationTemplatePath = () =>
- defHttp.get<BaseStationTemplateResponse>(
- { url: adminPath + '/tower/tmpFile' },
- { isTransformResponse: false, errorMessageMode: 'message' },
- );
- export const convertBaseStationData = (file: string) =>
- defHttp.get<string>(
- { url: adminPath + '/tower/covFile', params: { file } },
- { errorMessageMode: 'none', skipSuccessMessage: true },
- );
|