hbt-prevention-ui/src/service/area.service.ts

43 lines
1.5 KiB
TypeScript

import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class AreaService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area';
return this.deleteBatch(url,params,{},true)
}
public getAreaNumber():Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/number';
return this.get(url,null)
}
public getQrCode(params){
const url = this.prefix.file+'/qrCode/createQrCode';
return this.post(url,params)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area';
if(add){
return this.post(url,params,{},showLoading)
}else{
return this.put(url,params,{},showLoading)
}
}
public getAnalControls():Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
return this.get(url,null,false)
}
}