safety-eval-service-frontend/src/api/staffInfo/index.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-06-23 18:07:30 +08:00
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
2026-07-07 15:58:05 +08:00
import { apiPost, apiPostDelete, safeAction } from "../enterpriseInfo/http";
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoList = declareRequest(
"staffInfoLoading",
"Get > /safetyEval/org-personnel/page",
"staffInfoList: [] | res.data || [] & staffInfoTotal: 0 | res.data?.total || 0",
);
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoGet = declareRequest(
"staffInfoLoading",
"Get > /safetyEval/org-personnel/get",
"staffInfoDetail: {} | res.data || {}",
);
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoAdd = declareRequest(
"staffInfoLoading",
"Post > @/safetyEval/org-personnel/save",
);
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoEdit = declareRequest(
"staffInfoLoading",
"Post > @/safetyEval/org-personnel/modify",
);
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoRemove = declareRequest(
"staffInfoLoading",
2026-07-07 15:58:05 +08:00
safeAction(async ({ id }) => apiPostDelete("/safetyEval/org-personnel/delete", id)),
2026-07-07 09:07:19 +08:00
);
2026-06-23 18:07:30 +08:00
2026-07-07 09:07:19 +08:00
export const staffInfoResetPassword = declareRequest(
"staffInfoLoading",
2026-07-07 15:58:05 +08:00
safeAction(async ({ id }) => {
const url = `/safetyEval/org-personnel/reset-password?id=${encodeURIComponent(id)}`;
return apiPost(url, {});
}),
2026-07-07 09:07:19 +08:00
);