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

53 lines
2.0 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 PlanService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/plan/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/plan';
return this.deleteBatch(url,params,{},true)
}
// 详情
public selectById(id:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/plan/'+id;
return this.get(url,null,showLoading)
}
public deliver(params:any,showLoading?:boolean):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/plan/deliver';
return this.post(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/plan';
if(add){
return this.post(url,params,{},showLoading)
}else{
return this.put(url,params,{},showLoading)
}
}
public getRecordTabList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/task/table';
return this.get(url,params,true)
}
public getRecordList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/task/inspect';
return this.get(url,params,true)
}
public getTroubleList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/trouble/list';
return this.get(url,params,true)
}
}