const handleWork = async (taskStepId: string, Task: string) => {
const empId = localStorage.getItem("empId")
setTask(Task)
const response = await OperateTask({ operateType: Task, taskStepId: taskStepId, daqId: empId })
if (response.code == 200) {
message.success(`${handleStatusWork(Task)}成功`, 1);
} else {
message.warning(response.message);
}
}
<div className='laycloth_btn'>标签:实战,Task,封装,id,item,handleWork,&&,222,operateType From: https://blog.51cto.com/u_15460007/6050156
{item.operateType == "-1" && (
<Button onClick={() => { handleWork(item.id, "START") }}>开工</Button>
)}
{item.operateType == "0" && (
<Button onClick={() => { handleWork(item.id, "PAUSE") }}>暂停</Button>
)}
{item.operateType == "1" && (
<Button onClick={() => { handleWork(item.id, "REPORT") }}>报工</Button>
)
}
{item.operateType == "1" && (
<Button onClick={() => { handleWork(item.id, "RESUME") }}>复工</Button>
)
}
</div>