07/06/2024 - 22h30
parent
19c2d6ee3f
commit
b19682f330
|
@ -63,6 +63,8 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
const [rowss, setRows] = useState([]);
|
||||
const [selectionModel, setSelectionModel] = React.useState([]);
|
||||
|
||||
const [selectionModel_notes, setselectionModel_notes] = React.useState([]);
|
||||
|
||||
|
||||
const [p_filtre1, setp_filtre1] = useState("");
|
||||
const [p_filtre1_value, setp_filtre1_value] = useState("");
|
||||
|
@ -84,6 +86,8 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
const [gridline_id, setgridline_id] = useState("");
|
||||
|
||||
const [gridline_id_notes, setgridline_id_notes] = useState("");
|
||||
|
||||
const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200);
|
||||
const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(80);
|
||||
|
||||
|
@ -467,6 +471,26 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
]
|
||||
|
||||
|
||||
const columns_notes = [
|
||||
{ field: '_id', headerName: '_id', hide: true, editable: false, Width: 0 },
|
||||
{ field: 'evaluation_id', headerName: 'evaluation_id', hide: true, editable: false, Width: 0 },
|
||||
{ field: 'inscription_id', headerName: 'inscription_id', hide: true, editable: false, Width: 0 },
|
||||
{ field: 'note_evaluation_id', headerName: 'session_id', hide: true, editable: false, Width: 0 },
|
||||
|
||||
{ field: 'id', headerName: 'id', hide: true, Width: 0 },
|
||||
{ field: 'class_eu_id', headerName: 'class_eu_id', hide: true, Width: 0 },
|
||||
{ field: 'type_eval_id', headerName: 'type_eval_id', hide: true, Width: 0 },
|
||||
|
||||
|
||||
{ field: 'class_ue_code', headerName: 'Code UE', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'class_ue_titre', headerName: 'Titre UE', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'note_evaluation_code', headerName: 'Evaluation', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'eval_date_heure_debut', headerName: 'Debut Eval', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'eval_date_heure_fin', headerName: 'Fin Eval', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'note', headerName: 'Note', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
]
|
||||
|
||||
function ExpandableCell_50({ value }) {
|
||||
const [expanded, setExpanded] = React.useState(false);
|
||||
|
||||
|
@ -944,6 +968,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
const [display_detail_historique, setdisplay_detail_historique] = useState("");
|
||||
|
||||
const [display_detail_ue, setdisplay_detail_ue] = useState("");
|
||||
const [display_notes, setdisplay_notes] = useState("");
|
||||
|
||||
const [selected_id, setselected_id] = useState("");
|
||||
|
||||
|
@ -1002,6 +1027,8 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
Get_List_Of_All_PJ(line._id);
|
||||
|
||||
Get_Inscrit_Notes_Of_Evaluations(line._id, session_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1983,6 +2010,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
setsubmenu("sessions");
|
||||
setdisplay_detail_stagiaire();
|
||||
setdisplay_detail_absence();
|
||||
setdisplay_notes("");
|
||||
setdisplay_detail_ue();
|
||||
setdisplay_detail_historique();
|
||||
desableSessionFields();
|
||||
|
@ -1993,6 +2021,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
setdisplay_detail_stagiaire();
|
||||
setdisplay_detail_historique();
|
||||
setdisplay_detail_ue();
|
||||
setdisplay_notes("");
|
||||
setdisplay_detail_absence("1");
|
||||
desableSessionFields();
|
||||
}
|
||||
|
@ -2002,6 +2031,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
setdisplay_detail_stagiaire();
|
||||
setdisplay_detail_absence();
|
||||
setdisplay_detail_ue();
|
||||
setdisplay_notes("");
|
||||
setdisplay_detail_historique("1");
|
||||
desableSessionFields();
|
||||
}
|
||||
|
@ -2018,10 +2048,28 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
setdisplay_detail_stagiaire();
|
||||
setdisplay_detail_absence();
|
||||
setdisplay_detail_historique("");
|
||||
setdisplay_notes("");
|
||||
setdisplay_detail_ue("1");
|
||||
desableSessionFields();
|
||||
}
|
||||
|
||||
function submenu_notes() {
|
||||
|
||||
setsubmenu("notes");
|
||||
|
||||
if (selected_id) {
|
||||
Get_Inscrit_List_Evaluation_Par_UE(selected_id);
|
||||
Get_Inscrit_List_UE(selected_id);
|
||||
}
|
||||
|
||||
setdisplay_detail_stagiaire();
|
||||
setdisplay_detail_absence();
|
||||
setdisplay_detail_historique("");
|
||||
setdisplay_detail_ue("");
|
||||
setdisplay_notes("1");
|
||||
desableSessionFields();
|
||||
}
|
||||
|
||||
|
||||
const [SendEvaluationEmail_api, setSendEvaluationEmail_api] = useState();
|
||||
const [SendEvaluationEmail_message, setSendEvaluationEmail_message] = useState();
|
||||
|
@ -2719,21 +2767,21 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
});
|
||||
|
||||
//---
|
||||
/* var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code": "",
|
||||
"titre": "",
|
||||
"class_id": "",
|
||||
"internal_url": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);*/
|
||||
/* var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code": "",
|
||||
"titre": "",
|
||||
"class_id": "",
|
||||
"internal_url": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);*/
|
||||
|
||||
if (new_data2.length > 0) {
|
||||
setNew_Get_List_UE_From_Class_Id_result(new_data2);
|
||||
// console.log("### setNew_Get_List_UE_From_Class_Id_result = ", new_data2);
|
||||
// console.log("### setNew_Get_List_UE_From_Class_Id_result = ", new_data2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -2813,19 +2861,19 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
});
|
||||
|
||||
//---
|
||||
/* var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"class_id": "",
|
||||
"class_ue_id": "",
|
||||
"class_ue_code": "",
|
||||
"type_evaluation_id": "",
|
||||
"type_evaluation_code": "",
|
||||
"max_note": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);*/
|
||||
/* var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"class_id": "",
|
||||
"class_ue_id": "",
|
||||
"class_ue_code": "",
|
||||
"type_evaluation_id": "",
|
||||
"type_evaluation_code": "",
|
||||
"max_note": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);*/
|
||||
|
||||
if (new_data2.length > 0) {
|
||||
setNew_Getall_Class_List_Evalution_result(new_data2);
|
||||
|
@ -2850,6 +2898,49 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [Get_Inscrit_Notes_Of_Evaluations_api, setGet_Inscrit_Notes_Of_Evaluations_api] = useState();
|
||||
const [Get_Inscrit_Notes_Of_Evaluations_message, setGet_Inscrit_Notes_Of_Evaluations_message] = useState();
|
||||
const [Get_Inscrit_Notes_Of_Evaluations_result, setGet_Inscrit_Notes_Of_Evaluations_result] = useState([]);
|
||||
function Get_Inscrit_Notes_Of_Evaluations(local_inscription, local_session_id) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
var tab_my_inscription_ids = [];
|
||||
tab_my_inscription_ids.push(local_inscription);
|
||||
|
||||
var tab_session_id = [];
|
||||
tab_session_id.push(local_session_id);
|
||||
|
||||
form.append("token", stored_cookie);
|
||||
form.append("tab_session_id", tab_session_id);
|
||||
form.append("tab_inscription_id", tab_my_inscription_ids);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Participant_Notes/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Get_Inscrit_Notes_Of_Evaluations res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Inscrit_Notes_Of_Evaluations res.data.message r_class = " + res.data.message);
|
||||
setGet_Inscrit_Notes_Of_Evaluations_api("true");
|
||||
setGet_Inscrit_Notes_Of_Evaluations_result(res.data.message);
|
||||
}
|
||||
else {
|
||||
setGet_Inscrit_Notes_Of_Evaluations_api("false");
|
||||
setGet_Inscrit_Notes_Of_Evaluations_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Get_Inscrit_Notes_Of_Evaluations = ', error);
|
||||
setGet_Inscrit_Notes_Of_Evaluations_api("false");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Getall_TrainingParticipant();
|
||||
Getall_TrainingSession();
|
||||
|
@ -7636,6 +7727,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
setselected_internal_url(newSelectionModel.row.class_internal_url);
|
||||
setselected_class_id(newSelectionModel.row.class_id);
|
||||
setselected_session_id(newSelectionModel.session_id);
|
||||
|
||||
setselected_row_data_json_age('');
|
||||
setgridline_id(newSelectionModel.row.id);
|
||||
|
@ -7892,6 +7984,9 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
{String(props.formation_initiale) === "1" && String(addOneParticipant) !== "1" && <Button variant="outlined" onClick={submenu_unite_enseignement} className="detail_class_submenu" id='ue' name='ue'>Unit. Enseignement </Button>}
|
||||
|
||||
{String(props.formation_initiale) === "1" && String(addOneParticipant) !== "1" && <Button variant="outlined" onClick={submenu_notes} className="detail_class_submenu" id='notes' name='ue'>Notes </Button>}
|
||||
|
||||
|
||||
{String(addOneParticipant) !== "1" && <Button variant="outlined" onClick={submenu_historique} className="detail_class_submenu" id='historique' name='historique'>Historique </Button>}
|
||||
|
||||
</div>}
|
||||
|
@ -10253,13 +10348,13 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
options={New_Getall_Class_List_Evalution_result}
|
||||
defaultValue={New_Getall_Class_List_Evalution_result.filter((data) => {
|
||||
|
||||
|
||||
|
||||
for (let i = 0; i < New_Get_Inscrit_List_Evaluation_Par_UE_result.length; i++) {
|
||||
//console.log(" lecture de New_Get_Inscrit_List_Evaluation_Par_UE_result[i] = ", New_Get_Inscrit_List_Evaluation_Par_UE_result[i])
|
||||
|
||||
if (data.class_ue_id && String(data.class_ue_id) !== "" && data.class_ue_id === New_Get_Inscrit_List_Evaluation_Par_UE_result[i].class_eu_id &&
|
||||
data.type_evaluation_id === New_Get_Inscrit_List_Evaluation_Par_UE_result[i].type_eval__id
|
||||
data.type_evaluation_id === New_Get_Inscrit_List_Evaluation_Par_UE_result[i].type_eval__id
|
||||
) {
|
||||
//console.log(" GAGNEEEE ");
|
||||
return data;
|
||||
|
@ -10330,6 +10425,151 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
</div>}
|
||||
|
||||
{String(props.formation_initiale) === "1" && String(submenu) === "notes" && String(display_notes) === "1" && String(addOneParticipant) !== "1" && <div className="div_row" style={{ "border": "None", "background": '#F8F9F9', "padding": '5px' }}>
|
||||
|
||||
<h3> Les notes de l'inscrit </h3>
|
||||
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None", paddingRight: '10px' }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
|
||||
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
|
||||
"& .MuiDataGrid-row": {
|
||||
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
|
||||
}
|
||||
},*/
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
setselectionModel_notes(newSelectionModel);
|
||||
/*if (newSelectionModel.length === 1)
|
||||
handleClick_edit_session_From_Line(newSelectionModel);*/
|
||||
if (newSelectionModel.length !== 1) {
|
||||
|
||||
}
|
||||
}}
|
||||
selectionModel={selectionModel_notes}
|
||||
|
||||
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
|
||||
rows={Get_Inscrit_Notes_Of_Evaluations_result.map((item, index) => (
|
||||
{
|
||||
id: index,
|
||||
_id: JSON.parse(item)._id,
|
||||
evaluation_id: JSON.parse(item).evaluation_id,
|
||||
inscription_id: JSON.parse(item).inscription_id,
|
||||
note_evaluation_id: JSON.parse(item).note_evaluation_id,
|
||||
class_eu_id: JSON.parse(item).class_eu_id,
|
||||
type_eval_id: JSON.parse(item).type_eval_id,
|
||||
class_ue_code: JSON.parse(item).class_ue_code,
|
||||
class_ue_titre: JSON.parse(item).class_ue_titre,
|
||||
note_evaluation_code: JSON.parse(item).note_evaluation_code,
|
||||
eval_date_heure_debut: JSON.parse(item).eval_date_heure_debut,
|
||||
eval_date_heure_fin: JSON.parse(item).eval_date_heure_fin,
|
||||
note: JSON.parse(item).note,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns_notes}
|
||||
pageSize={10}
|
||||
className="datagridclass"
|
||||
|
||||
onRowDoubleClick={(newSelectionModel) => {
|
||||
|
||||
}}
|
||||
|
||||
rowsPerPageOptions={[10]}
|
||||
disableSelectionOnClick
|
||||
components={{
|
||||
Toolbar: GridToolbar,
|
||||
}}
|
||||
//sx={datagridSx}
|
||||
getCellClassName={(params) => {
|
||||
//field === 'distantiel'
|
||||
if (params.field === 'distantiel' && String(params.value) === "1") {
|
||||
return 'cell--distantiel';
|
||||
}
|
||||
if (params.field === "presentiel" && String(params.value) == "1") {
|
||||
return 'cell--presentiel';
|
||||
}
|
||||
|
||||
|
||||
//field === "statut"
|
||||
if (params.field === "status" && String(params.value) == "0") {
|
||||
return 'cell--statut--preinscrit';
|
||||
}
|
||||
|
||||
if (params.field === "status" && String(params.value) == "1") {
|
||||
return 'cell--statut--inscrit';
|
||||
}
|
||||
|
||||
if (params.field === "status" && String(params.value) == "-1") {
|
||||
return 'cell--statut--annule';
|
||||
}
|
||||
|
||||
}}
|
||||
getRowClassName={(params) => {
|
||||
// Pour la gestion de la couleur de zone double cliquée
|
||||
if (String(params.row.id) === String(gridline_id)) {
|
||||
|
||||
return 'line--statut--selected';
|
||||
}
|
||||
|
||||
else if (parseInt(String(params.row.id)) % 2 === 0) {
|
||||
return 'line--statut--pair';
|
||||
}
|
||||
else if (parseInt(String(params.row.id)) % 2 !== 0) {
|
||||
return 'line--statut--impair';
|
||||
}
|
||||
|
||||
}}
|
||||
getEstimatedRowHeight={() => 200}
|
||||
getRowHeight={() => "auto"}
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue