You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.2 KiB
29 lines
1.2 KiB
import httpRequest, { type BaseResponse } from "../httpRequest";
|
|
import { addTxnRecord, injectFluidsRecord } from "../txn";
|
|
import type { OperationCmd } from "../globalCmd/globalCmd";
|
|
|
|
export function saveTaskName(params: { name: String }) {
|
|
return httpRequest<BaseResponse<any>>({ url: `/api/tasks/`, method: "POST", params });
|
|
}
|
|
|
|
//结束实验
|
|
export function stopTask(params: { taskId: String }) {
|
|
return httpRequest<BaseResponse<string>>({ url: `/api/tasks/stop`, method: "POST", params });
|
|
}
|
|
|
|
//结束实验
|
|
export function getIngTask() {
|
|
return httpRequest<BaseResponse<any>>({ url: `/api/tasks/getIngTask`, method: "GET" });
|
|
}
|
|
|
|
//批量加热
|
|
export function startHeat(params: { command: OperationCmd; params: [] }) {
|
|
const commandId = addTxnRecord({ ...params, category: "task" });
|
|
return httpRequest<BaseResponse<string>>({ url: "/api/cmd/startHeat", params: { ...params, commandId }, method: "POST" });
|
|
}
|
|
|
|
//批量加液
|
|
export function injectFluid(params: any) {
|
|
const commandId = injectFluidsRecord({ injectFluids: params.injectFluids, command: "injectFluid", category: "task" });
|
|
return httpRequest<BaseResponse<string>>({ url: "/api/cmd/injectFluid", params: { ...params, commandId }, method: "POST" });
|
|
}
|