07/04/2024 - 13h19
parent
e4d5914456
commit
dd228700f6
|
@ -10013,6 +10013,8 @@ const DisplayPartnerSession = (props) => {
|
|||
/* Recuperation des evaluations */
|
||||
const [selectionModel_evaluation, setSelectionModel_evaluation] = React.useState([]);
|
||||
const [rowss_evaluation, setRows_evaluation] = useState([]);
|
||||
|
||||
|
||||
const [GetListePreinscrit_evaluation_api, setGetListePreinscrit_evaluation_api] = useState();
|
||||
const [GetListePreinscrit_evaluation_meassage, setGetListePreinscrit_evaluation_meassage] = useState();
|
||||
const [GetListePreinscrit_evaluation_result, setGetListePreinscrit_evaluation_result] = useState([])
|
||||
|
|
|
@ -10,7 +10,7 @@ import { getCookie } from 'react-use-cookie';
|
|||
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
|
||||
import excel_icone from "../mysy_img/excel_icone.png";
|
||||
import Popup from 'reactjs-popup';
|
||||
import fileDownload from 'js-file-download'
|
||||
import fileDownload from 'js-file-download';
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import { AiFillCloseCircle, } from "react-icons/ai";
|
||||
import parse from 'html-react-parser'
|
||||
|
|
|
@ -11,7 +11,7 @@ import CheckOut from "./CheckOut";
|
|||
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
|
||||
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
|
||||
import 'react-tooltip/dist/react-tooltip.css'
|
||||
|
||||
import fileDownload from 'js-file-download';
|
||||
import Popup from 'reactjs-popup'
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
|
||||
|
@ -40,74 +40,78 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
const [isLoading, setLoading] = useState();
|
||||
|
||||
|
||||
function ExpandableCell_50({ value }) {
|
||||
const [expanded, setExpanded] = React.useState(false);
|
||||
|
||||
return (
|
||||
<nav>
|
||||
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
|
||||
|
||||
{expanded ? value : String(value).slice(0, 50)}
|
||||
{value.length > 50 && (
|
||||
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
||||
<Link
|
||||
type="button"
|
||||
component="button"
|
||||
sx={{ fontSize: 'inherit' }}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
>
|
||||
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
|
||||
</Link>
|
||||
)}
|
||||
</div>}
|
||||
|
||||
{!value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
|
||||
|
||||
</div>
|
||||
}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const columns_q_position = [
|
||||
{ field: 'id', headerName: 'id', hide: true },
|
||||
{ field: '_id', headerName: '_id', hide: true },
|
||||
{ field: 'Form. Code', headerName: 'form_code', minwidth: 200, flex: 1, hideable: true, resizable: true, },
|
||||
{ field: 'email', headerName: 'email', minwidth: 200, flex: 1, hideable: true, resizable: true, },
|
||||
{ field: 'nom', headerName: 'nom', minwidth: 200, flex: 1, hide: false, editable: true, },
|
||||
{ field: 'prenom', headerName: 'prenom', minwidth: 200, flex: 1, hide: false, editable: false, },
|
||||
{ field: 'form_code', headerName: 'Form. Code', hide: true, minwidth: 200, flex: 1, hideable: true, resizable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'email', headerName: 'email', minwidth: 300, flex: 1, hideable: true, resizable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'nom', headerName: 'nom', minwidth: 300, flex: 1, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'prenom', headerName: 'prenom', minwidth: 300, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{
|
||||
field: 'status', headerName: 'Statut', width: 100, editable: false, flex: true,
|
||||
valueFormatter: (params) => {
|
||||
if (String(params.value) === "0")
|
||||
return "Init";
|
||||
return "Init.";
|
||||
else if (String(params.value) === "1")
|
||||
return "Envoyé";
|
||||
return "Env.";
|
||||
else if (String(params.value) === "2")
|
||||
return "Répondu";
|
||||
return "Rép.";
|
||||
else
|
||||
return " ?";
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
field: 'date_envoie', headerName: 'Date Envoi', width: 150, editable: false,
|
||||
valueFormatter: (params) => {
|
||||
return String(params.value).substring(0, 16)
|
||||
if (params.value)
|
||||
return String(params.value).substring(0, 16)
|
||||
else
|
||||
return ""
|
||||
|
||||
},
|
||||
},
|
||||
{/*
|
||||
field: "voir", headerName: 'voir',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
{
|
||||
field: 'date_reponse', headerName: 'Date Réponse', width: 150, editable: false,
|
||||
valueFormatter: (params) => {
|
||||
if (params.value)
|
||||
return String(params.value).substring(0, 16)
|
||||
else
|
||||
return ""
|
||||
|
||||
<Button
|
||||
|
||||
onClick={(event) => {
|
||||
//handleClick_valide_emargement(event, cellValues);
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<FcApproval />
|
||||
|
||||
</Button>
|
||||
|
||||
);
|
||||
}
|
||||
*/ },
|
||||
|
||||
{/*
|
||||
field: "envoyer", headerName: 'Envoyer',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
|
||||
<Button
|
||||
|
||||
onClick={(event) => {
|
||||
//handleClick_valide_emargement(event, cellValues);
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<FcApproval />
|
||||
|
||||
</Button>
|
||||
|
||||
);
|
||||
}
|
||||
*/},
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
@ -413,6 +417,37 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
}
|
||||
|
||||
|
||||
function Export_survey_datatab_class() {
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
var nom_fichier_cmd = "export_reponses.xlsx";
|
||||
|
||||
var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_Survey_with_filter/" + stored_cookie + "/" + selected_session_id+"/pos/";
|
||||
|
||||
|
||||
setLoading(true);
|
||||
axios.get(url, { responseType: 'blob', },)
|
||||
.then((res) => {
|
||||
setLoading(false);
|
||||
//console.log(" In Export_Dashbord_to_CSV res.data = " + res.data);
|
||||
if (String(res.data) === String("false")) {
|
||||
alert("Impossible d'exporter les réponses (2) ");
|
||||
} else {
|
||||
fileDownload(res.data, nom_fichier_cmd)
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.error('Error:', error);
|
||||
alert(" Impossible d'exporter les réponses ")
|
||||
|
||||
});
|
||||
|
||||
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<div className="module_evaluation_positionnement">
|
||||
|
@ -615,8 +650,13 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
|
||||
|
||||
<Button className="bton_emarge" onClick={(event) => {
|
||||
Getall_Survey_Q_Positionnement_By_Session();
|
||||
}}>Actualiser la liste</Button><br />
|
||||
Getall_Survey_Q_Positionnement_By_Session();
|
||||
}}>Actualiser la liste</Button>
|
||||
|
||||
<Button className="bton_emarge" onClick={(event) => {
|
||||
Export_survey_datatab_class();
|
||||
}}>Exporter (excel)</Button><br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -652,8 +692,14 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
py: 1,
|
||||
},
|
||||
|
||||
'& .line--attestion_envoye': {
|
||||
backgroundColor: '#ccffcc',
|
||||
'& .line--positionnement_envoye': {
|
||||
backgroundColor: '#F9E79F',
|
||||
color: 'black',
|
||||
|
||||
},
|
||||
|
||||
'& .line--positionnement_repondu': {
|
||||
backgroundColor: '#ABEBC6',
|
||||
color: 'black',
|
||||
fontWeight: '600',
|
||||
},
|
||||
|
@ -682,9 +728,9 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
nom: JSON.parse(item).nom,
|
||||
prenom: JSON.parse(item).prenom,
|
||||
status: JSON.parse(item).statut,
|
||||
form_code: JSON.parse(item).formulaire.description,
|
||||
|
||||
|
||||
form_code: JSON.parse(item).formulaire.code,
|
||||
date_envoie: JSON.parse(item).date_envoi,
|
||||
date_reponse: JSON.parse(item).date_reponse,
|
||||
}
|
||||
))}
|
||||
|
||||
|
@ -696,8 +742,6 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
|
||||
}}
|
||||
|
||||
|
||||
|
||||
rowsPerPageOptions={[10]}
|
||||
disableSelectionOnClick
|
||||
components={{
|
||||
|
@ -706,25 +750,17 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
//sx={datagridSx}
|
||||
getCellClassName={(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';
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
getRowClassName={(params) => {
|
||||
|
||||
|
||||
if (String(params.row.status) === "1") {
|
||||
return 'line--positionnement_envoye';
|
||||
}
|
||||
|
||||
return 'line--attestion_envoye';
|
||||
if (String(params.row.status) === "2") {
|
||||
return 'line--positionnement_repondu';
|
||||
}
|
||||
|
||||
// Pour la gestion de la couleur de zone double cliquée
|
||||
|
@ -814,7 +850,7 @@ const Module_Evaluation_Positionnement = (props) => {
|
|||
{' '}
|
||||
{String(actionmass_q_position_val) === "resend" &&
|
||||
|
||||
<font color="red"> Confirmer l'envoi de en masse de {selectionModel_q_position.length} attestation(s) de formation.
|
||||
<font color="red"> Confirmer l'envoi de en masse de {selectionModel_q_position.length} questionnaire(s) de positionnement.
|
||||
</font>}
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
|
|
|
@ -149,9 +149,27 @@ function SurveyDocument() {
|
|||
form.append("survey_id", survey_id);
|
||||
form.append("list_response", myJSON);
|
||||
|
||||
var is_empty_field = 0;
|
||||
|
||||
for (let i = 0; i < Object.keys(tab_variable).length; i++) {
|
||||
|
||||
var key = Object.keys(tab_variable)[i];
|
||||
var val = tab_variable[key];
|
||||
|
||||
document.getElementsByName(key)[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
if( String(val).length === 0 ){
|
||||
document.getElementsByName(key)[0].style.backgroundColor = "#F9E79F";
|
||||
is_empty_field = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( is_empty_field === 1 ){
|
||||
alert(" Le questionnaire n'est pas correctement rempli");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(" form == ", form);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Record_Survey_Data_No_Token/";
|
||||
|
||||
|
@ -261,7 +279,8 @@ function SurveyDocument() {
|
|||
}
|
||||
|
||||
{question.type && String(question.type) === "entier" && question.max_note &&
|
||||
<div>
|
||||
<div id={question._id}
|
||||
name={question._id}>
|
||||
<TextField
|
||||
margin="dense"
|
||||
fullWidth
|
||||
|
@ -275,7 +294,8 @@ function SurveyDocument() {
|
|||
</div>
|
||||
}
|
||||
{question.type && String(question.type) === "bool" &&
|
||||
<div>
|
||||
<div id={question._id}
|
||||
name={question._id}>
|
||||
<FormControl>
|
||||
|
||||
<RadioGroup
|
||||
|
|
Loading…
Reference in New Issue