import { YTRequest } from "basic" import { ApiUrl } from "./ApiUrl" import { ResponseResult } from "./GreenPlantApi" //获取养护事项类型 export interface ClockTaskItem { oaid?:string delFlag: number, itemIcon: string, itemId: number, itemName: string, } //新增养护事项参数 export interface InsertEditClockTaskParam{ itemIcon: string, itemId: number, itemName: string, oaid?: string } //查询养护图标列表 export interface ClockTaskIcon{ iconId:number, iconUrl:string } export class ClockTaskApi{ /** * 事项相关 * @returns */ static async getClockTaskList(){ return await YTRequest.post(ApiUrl.GET_CLOCK_TASK_LIST,{}) } static async insertClockTask(params:InsertEditClockTaskParam){ return await YTRequest.post(ApiUrl.INSERT_CLOCK_TASK_ITEM,params) } static async getClockTaskIconList(){ return await YTRequest.post(ApiUrl.GET_CLOCK_TASK_ICON_LIST,{}) } /** * 打卡记录相关 */ static async getClockLogList(params:GetClockLogParams){ return await YTRequest.post,GetClockLogParams>(ApiUrl.GET_CLOCK_LOG_LIST,params) } static async insertClockLog(params:InsertClockParam){ if(params.messageId==0){ params.messageId=null }else{ params.messageId=params.messageId } return await YTRequest.post(ApiUrl.INSERT_CLOCK_LOG,params) } } export interface InsertClockParam{ plantsId:number, itemId:number, clockDate:string, clockTime:string, remark:string, messageId?:number|null } export interface GetClockLogParams{ page: number, pageSizes: number, plantsId: number } export interface ClockLog{ clockId: string, itemId: string, plantsId: string, itemName: string, itemIcon: string, plantsName: string, remark: string|null, clockDate: string, clockTime: string }