Quy_FE 2 months ago
commit 0c99db8cb9
  1. 28
      src/_screens/home/detail-room-education/index.js
  2. 34
      src/_screens/home/education-department/index.js

@ -208,17 +208,29 @@ export default function DetailRoomEducation() {
} }
useEffect(() => { useEffect(() => {
getDataStatisticCircle() const fetchData = async () => {
getListOrganization() await getDataStatisticCircle();
}, []) await getListOrganization();
};
fetchData();
}, []);
useEffect(() => { useEffect(() => {
getDataStudentChart() const fetchStudentData = async () => {
}, [dateStudentChart]) await getDataStudentChart();
};
fetchStudentData();
}, [dateStudentChart]);
useEffect(() => { useEffect(() => {
getDataTeacherChart() const fetchTeacherData = async () => {
}, [dateTeacherChart]) await getDataTeacherChart();
};
fetchTeacherData();
}, [dateTeacherChart]);
useEffect(() => { useEffect(() => {
if (isLoadingListOrganization || isLoadingStatisticCircle || isLoadingStudentChart || isLoadingTeacherChart) { if (isLoadingListOrganization || isLoadingStatisticCircle || isLoadingStudentChart || isLoadingTeacherChart) {
@ -461,7 +473,7 @@ export default function DetailRoomEducation() {
<div className="detail-room-education-item" key={index} onClick={() => goToDetailSchool(item)}> <div className="detail-room-education-item" key={index} onClick={() => goToDetailSchool(item)}>
<div className="detail-room-education-item-content"> <div className="detail-room-education-item-content">
<div className="detail-room-education-avatar"> <div className="detail-room-education-avatar">
<img src={configConstants.BASE_URL + item?.avatar} /> <img src={item?.avatar ? configConstants.BASE_URL + item?.avatar : "/assets/imgs/avatar_school.png"} />
</div> </div>
<div className="detail-room-education-detail"> <div className="detail-room-education-detail">
<div className="detail-room-education-info"> <div className="detail-room-education-info">

@ -95,18 +95,30 @@ export default function EducationDepartmentHome() {
}); });
} }
useEffect(async () => { useEffect(() => {
await getDataOrganization() const fetchData = async () => {
await getDataStatisticCircle() await getDataOrganization();
}, []) await getDataStatisticCircle();
};
fetchData();
}, []);
useEffect(() => {
const fetchStudentData = async () => {
await getDataStudentChart();
};
fetchStudentData();
}, [dateStudentChart]);
useEffect(async () => { useEffect(() => {
await getDataStudentChart() const fetchTeacherData = async () => {
}, [dateStudentChart]) await getDataTeacherChart();
};
useEffect(async () => { fetchTeacherData();
await getDataTeacherChart() }, [dateTeacherChart]);
}, [dateTeacherChart])
const getDataTeacher = async () => { const getDataTeacher = async () => {
try { try {
@ -231,7 +243,7 @@ export default function EducationDepartmentHome() {
</div> </div>
} }
<div className="d-flex justify-content-center" style={{marginTop: '3rem'}}> <div className="d-flex justify-content-center" style={{marginTop: '3rem'}}>
<PrimaryButton className="d-flex" style={{textDecoration: 'underline'}} onClick={goToOutstandingTeacher}> <PrimaryButton style={{textDecoration: 'underline'}} onClick={goToOutstandingTeacher}>
Top 10 giáo viên tiêu biểu Top 10 giáo viên tiêu biểu
<div style={{marginLeft: 8, paddingBottom: 4}}>{renderIconButton()}</div> <div style={{marginLeft: 8, paddingBottom: 4}}>{renderIconButton()}</div>
</PrimaryButton> </PrimaryButton>

Loading…
Cancel
Save