|
|
|
@ -16,7 +16,7 @@ import $ from "jquery"; |
|
|
|
|
import { useParams } from "react-router-dom"; |
|
|
|
|
|
|
|
|
|
export default function DetailRoomEducation() { |
|
|
|
|
const {idRoom} = useParams() |
|
|
|
|
const {idRoom,isBack} = useParams() |
|
|
|
|
const grade = useSelector((state) => state.grade); |
|
|
|
|
const authentication = useSelector((state) => state.authentication); |
|
|
|
|
const [dateStudentChart, setDateStudentChart] = useState(new Date()) |
|
|
|
@ -190,9 +190,15 @@ export default function DetailRoomEducation() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const goToDetailSchool = (item) => { |
|
|
|
|
history.push(replacePathParams(PATH.home.detailSchool, {schoolId: item?.organization_id}) + |
|
|
|
|
"?school_name=" + |
|
|
|
|
encodeURIComponent(item?.organization_name)); |
|
|
|
|
const schoolId = item?.organization_id; |
|
|
|
|
const schoolName = encodeURIComponent(item?.organization_name); |
|
|
|
|
const detailPath = replacePathParams(PATH.home.detailSchool, { schoolId}); |
|
|
|
|
|
|
|
|
|
history.push({ |
|
|
|
|
pathname: detailPath, |
|
|
|
|
search: `?school_name=${schoolName}`, |
|
|
|
|
state: { isBack: true } |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
@ -279,6 +285,27 @@ export default function DetailRoomEducation() { |
|
|
|
|
setIsLoading(false); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const handleExport = () => { |
|
|
|
|
const listHeader = [ |
|
|
|
|
'Stt', |
|
|
|
|
'Tên trường', |
|
|
|
|
'Tiêu chí giao bài', |
|
|
|
|
'Tiêu chú tỷ lệ học sinh làm bài', |
|
|
|
|
'Mức độ hoàn thành tiêu chí', |
|
|
|
|
'Huyện', |
|
|
|
|
'Tỉnh' |
|
|
|
|
];
|
|
|
|
|
const listData = listOrganization.map((item, index) => [ |
|
|
|
|
index + 1, |
|
|
|
|
item.organization_name || '', |
|
|
|
|
item.criteria_level || 0, |
|
|
|
|
item.student_done_per_level || 0, |
|
|
|
|
item.assign_number_level || 0, |
|
|
|
|
item.district || '', |
|
|
|
|
item.province || '', |
|
|
|
|
]); |
|
|
|
|
exportExcel(listHeader, listData, `Danh sách trường.xlsx`); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="flex-1"> |
|
|
|
@ -286,6 +313,7 @@ export default function DetailRoomEducation() { |
|
|
|
|
icon={renderIconHome({ color: "#4D4D4D" })} |
|
|
|
|
title={"Phòng giáo dục " + authentication.user.province} |
|
|
|
|
manager={true} |
|
|
|
|
isBack={isBack} |
|
|
|
|
/> |
|
|
|
|
<div className="container-page-header container-page-sidebar"> |
|
|
|
|
<div className="detail-room-education-container bg-sub-main-green-img"> |
|
|
|
@ -335,7 +363,12 @@ 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"> |
|
|
|
|
<span style={{fontSize: '2rem', fontWeight: 700, padding: '0 3.2rem'}}>Danh sách trường</span> |
|
|
|
|
<PrimaryButton onClick={handleExport}> |
|
|
|
|
Xuất excel |
|
|
|
|
</PrimaryButton> |
|
|
|
|
</div> |
|
|
|
|
<div className="flex gap-16 align-item-center" style={{padding: '1rem 3.2rem'}}> |
|
|
|
|
<RootSelect |
|
|
|
|
data={LIST_SCHOOL_YEAR} |
|
|
|
|