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

42 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 IntegralRuleService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/point/rule/list';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/point/rule';
return this.deleteBatch(url,params,{},showLoading)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
if(add){
const url = this.prefix.prevention+'/point/rule';
return this.post(url,params,{},showLoading)
}else{
const url = this.prefix.prevention+'/point/rule';
return this.put(url,params,{},showLoading)
}
}
//获取编号
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/point/rule/number';
return this.get(url,params)
}
//查询详情
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/point/rule/'+params.id;
return this.get(url)
}
}