1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import { defHttp } from '/@/utils/http/axios';
- import {
- PageParams,
- CorporationListGetResultModel,
- UpdateCompanyParam,
- DeviceListItem,
- DeviceGetResultModel,
- } from './model';
- import { Result, UploadFileParams } from '/#/axios';
- enum Api {
- selectCompanyNum = '/zfb-api/zfb/company/selectCompanyNum',
- listAllCompany = '/zfb-api/zfb/company/getListAll',
- selectCompanyByType = '/zfb-api/zfb/company/selectCompanyByType',
- uploadLogo = '/zfb-api/zfb/company/uploadLogo',
- updateCompany = '/zfb-api/zfb/company/updateCompany',
- selectCompanyDevice = '/zfb-api/zfb/company/selectCompanyDevice',
- }
- /**
- * @description: Get sample list value
- */
- export const ListApi = (params: PageParams) =>
- defHttp.post<CorporationListGetResultModel>({
- url: Api.selectCompanyNum,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export const ListAllCompanyApi = (params: PageParams) =>
- defHttp.post<CorporationListGetResultModel>({
- url: Api.listAllCompany,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export const ListVerifyApi = (params: PageParams) =>
- defHttp.post<CorporationListGetResultModel>({
- url: Api.selectCompanyByType,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export const selectCompanyDevice = (params: UpdateCompanyParam) =>
- defHttp.post<Result>({
- url: Api.updateCompany,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export const updateCompnayApi = (params: UpdateCompanyParam) =>
- defHttp.post<Result>({
- url: Api.updateCompany,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export const companyDeviceApi = (params: DeviceListItem) =>
- defHttp.post<DeviceGetResultModel>({
- url: Api.selectCompanyDevice,
- params,
- headers: {
- // @ts-ignore
- ignoreCancelToken: true,
- },
- });
- export function uploadLogoApi(
- params: UploadFileParams,
- onUploadProgress: (progressEvent: ProgressEvent) => void,
- ) {
- return defHttp.uploadFile<Result>(
- {
- url: Api.uploadLogo,
- onUploadProgress,
- },
- params,
- );
- }
|