staff_data/apps/web/src/app/main/staffinfo_show/page.tsx

40 lines
869 B
TypeScript
Raw Normal View History

2025-03-12 08:23:33 +08:00
import { MagnifyingGlassIcon } from "@heroicons/react/24/outline";
2025-03-19 15:57:48 +08:00
import { Button, Input } from "antd";
import { useCallback, useEffect} from "react";
2025-03-12 09:48:35 +08:00
import _ from "lodash";
2025-03-12 11:45:18 +08:00
import { useMainContext } from "../layout/MainProvider";
import StaffTable from "./stafftable/page";
2025-03-19 15:57:48 +08:00
2025-03-12 08:23:33 +08:00
export default function StaffMessage() {
2025-03-19 15:57:48 +08:00
const { form, formValue, setFormValue, setVisible, setSearchValue, editingRecord } = useMainContext();
useEffect(() => {
setFormValue({
username: "",
deptId: "",
absent: false,
positionId: "",
trainSituations: "",
});
}, []);
2025-03-12 08:23:33 +08:00
const handleNew = () => {
2025-03-12 11:45:18 +08:00
form.setFieldsValue(formValue);
2025-03-12 08:23:33 +08:00
setVisible(true);
2025-03-19 15:57:48 +08:00
};
2025-03-12 09:48:35 +08:00
const handleSearch = useCallback(
_.debounce((value: string) => {
2025-03-12 11:45:18 +08:00
setSearchValue(value);
2025-03-12 09:48:35 +08:00
}, 500),
[]
);
2025-03-19 15:57:48 +08:00
2025-03-12 08:23:33 +08:00
return (
2025-03-19 15:57:48 +08:00
<>
<StaffTable />
</>
2025-03-12 08:23:33 +08:00
);
}