|
|
|
@ -1,12 +1,12 @@ |
|
|
|
|
import { useEffect, useState } from "react"; |
|
|
|
|
import Header from "../../../_components/Header"; |
|
|
|
|
import { renderIconButton, renderIconHome } from "../../../_components/renderIcon"; |
|
|
|
|
import { renderIconButton, renderIconHome, renderIconSearchInput } from "../../../_components/renderIcon"; |
|
|
|
|
import RateStar from "../../../_components/RateStar"; |
|
|
|
|
import { defaultMonthYearSemester, getListMonthBySemester, LIST_SCHOOL_YEAR, LIST_SEMESTER, PRIMARY_COLOR } from "../../../_constants/common"; |
|
|
|
|
import { configConstants, PATH } from "../../../_constants"; |
|
|
|
|
import RootSelect from "../../../_components/RootSelect"; |
|
|
|
|
import PrimaryButton from "../../../_components/Button/PrimaryButton"; |
|
|
|
|
import { useSelector } from "react-redux"; |
|
|
|
|
import { useDispatch, useSelector } from "react-redux"; |
|
|
|
|
import './detailRoomEducation.style.scss' |
|
|
|
|
import BoxDoughnutChart from "../../../_components/boxChart/BoxDoughnutChar"; |
|
|
|
|
import BoxDoughnutBarChart from "../../../_components/boxChart/BoxDoughnutBarChart"; |
|
|
|
@ -14,6 +14,8 @@ import { apiCaller, history } from "../../../_helpers"; |
|
|
|
|
import { exportExcel, replacePathParams } from "../../../_helpers/utils"; |
|
|
|
|
import $ from "jquery"; |
|
|
|
|
import { useLocation, useParams } from "react-router-dom"; |
|
|
|
|
import InputText from "../../../_components/Auth/InputText"; |
|
|
|
|
import { alertActions } from "../../../_actions"; |
|
|
|
|
|
|
|
|
|
export default function DetailRoomEducation() { |
|
|
|
|
const {idRoom} = useParams() |
|
|
|
@ -41,6 +43,8 @@ export default function DetailRoomEducation() { |
|
|
|
|
const [offsetOnline, setOffsetOnline] = useState(0); |
|
|
|
|
const [isEndOnlineClasses, setIsEndOnlineClasses] = useState(false); |
|
|
|
|
const [isLoading, setIsLoading] = useState(false); |
|
|
|
|
const [searchText, setSearchText] = useState(''); |
|
|
|
|
const dispatch = useDispatch(); |
|
|
|
|
|
|
|
|
|
const getListOrganization = async () => { |
|
|
|
|
try { |
|
|
|
@ -308,7 +312,36 @@ export default function DetailRoomEducation() { |
|
|
|
|
]); |
|
|
|
|
exportExcel(listHeader, listData, `Danh sách trường.xlsx`); |
|
|
|
|
}; |
|
|
|
|
const getDataTeacher = async () => { |
|
|
|
|
try { |
|
|
|
|
setIsLoading(true); |
|
|
|
|
const endPoint = `/api_teacher/get_teacher_info?search=${searchText}`; |
|
|
|
|
const res = await apiCaller(endPoint, "GET"); |
|
|
|
|
setIsLoading(false); |
|
|
|
|
if (res?.status) { |
|
|
|
|
const teacherId = res?.data?.[0]?.teacher_id; |
|
|
|
|
const teacherName = encodeURIComponent(res?.data?.[0]?.teacher_name); |
|
|
|
|
const detailPath = replacePathParams(PATH.home.detailTeacher, { teacherId}); |
|
|
|
|
|
|
|
|
|
history.push({ |
|
|
|
|
pathname: detailPath, |
|
|
|
|
search: `?teacher_name=${teacherName}`, |
|
|
|
|
state: { isBack: true } |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} catch (err) { |
|
|
|
|
setIsLoading(false); |
|
|
|
|
dispatch( |
|
|
|
|
alertActions.error({ |
|
|
|
|
message: err?.toString(), |
|
|
|
|
}), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleSubmit = () =>{ |
|
|
|
|
getDataTeacher() |
|
|
|
|
} |
|
|
|
|
return ( |
|
|
|
|
<div className="flex-1"> |
|
|
|
|
<Header |
|
|
|
@ -365,12 +398,35 @@ export default function DetailRoomEducation() { |
|
|
|
|
</div> |
|
|
|
|
<div className="detail-room-education-right-side"> |
|
|
|
|
<div className="detail-room-education-list-container"> |
|
|
|
|
<div className="d-flex detail-room-education-list-header"> |
|
|
|
|
<div> |
|
|
|
|
<span style={{fontSize: '2rem', fontWeight: 700, padding: '0 3.2rem'}}>Danh sách trường</span> |
|
|
|
|
|
|
|
|
|
<div className="d-flex detail-education-department-list-header"> |
|
|
|
|
<InputText |
|
|
|
|
className="criteria-manage-search-input criteria-manage-item" |
|
|
|
|
value={searchText} |
|
|
|
|
setValue={setSearchText} |
|
|
|
|
type="text" |
|
|
|
|
name="searchText" |
|
|
|
|
placeholder={"Nhập email hoặc số điện thoại giáo viên"} |
|
|
|
|
renderLabelIcon={renderIconSearchInput} |
|
|
|
|
onKeyUp={(e) => { |
|
|
|
|
if (e.which == 13 && !isFilterSchool) { |
|
|
|
|
handleSubmit(); |
|
|
|
|
} |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
<PrimaryButton |
|
|
|
|
isDisabled={false} |
|
|
|
|
onClick={handleSubmit} |
|
|
|
|
> |
|
|
|
|
{"Tìm kiếm"} |
|
|
|
|
</PrimaryButton> |
|
|
|
|
<PrimaryButton onClick={handleExport}> |
|
|
|
|
Xuất excel |
|
|
|
|
</PrimaryButton> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div className="flex gap-16 align-item-center" style={{padding: '1rem 3.2rem'}}> |
|
|
|
|
<RootSelect |
|
|
|
|
data={LIST_SCHOOL_YEAR} |
|
|
|
|