15/08/23 - 20h

recette2
cherif 2023-08-15 20:04:52 +02:00
parent 98d6416539
commit 9af7f9982c
4 changed files with 232 additions and 60 deletions

View File

@ -31,6 +31,7 @@ import Box from '@mui/material/Box';
import { Typography, LinearProgress } from '@mui/material';
import styled from 'styled-components';
import { CiTrash } from "react-icons/ci";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
const DisplayPartnerSession = (props) => {
const history = useHistory();
@ -152,12 +153,12 @@ const DisplayPartnerSession = (props) => {
color="success"
sx={{ color: "#1bd900" }}
variant="determinate"
value={(params?.row.taux_replissage*100).toFixed(2)}
value={(params?.row.taux_replissage * 100).toFixed(2)}
/>
<Typography
variant="body2"
color="text.secondary"
>{`${(params?.row.taux_replissage*100).toFixed(0)}%`}</Typography>
>{`${(params?.row.taux_replissage * 100).toFixed(0)}%`}</Typography>
</>
);
},
@ -514,12 +515,12 @@ const DisplayPartnerSession = (props) => {
var filtre3_value = "";
// Recuperation des valeurs de filtres
if (filtre1) {
if (p_filtre1_value ) {
filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value);
}
if (filtre2) {
if (p_filtre2_value ) {
filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value);
}
@ -534,7 +535,7 @@ const DisplayPartnerSession = (props) => {
// Verification s'il faut faire une recherche avec une option like.
//console.log(" p_filtre1 = ", p_filtre1, " filtre1_value = ", filtre1_value);
if (filtre1 && String(filtre1_value) !== "") {
if (p_filtre1_value || p_filtre2_value) {
myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List_filter_like/";
}
@ -561,6 +562,40 @@ const DisplayPartnerSession = (props) => {
}
function Getall_TrainingSession_no_filter(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingSession res.data.status = " + res.data.status);
//console.log(" In Getall_TrainingSession res.data.message r_class = " + res.data.message);
setGetall_TrainingSession_api("true");
setGetall_TrainingSession_result(res.data.message);
setRows(res.data.message);
}
else {
setGetall_TrainingSession_api("false");
setGetall_TrainingSession_message(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_TrainingSession = ', error);
setGetall_TrainingSession_api("false");
//setmyApimyApiMessage("")
})
}
const [Edite_session, setEdite_session] = useState();
/* Envoi de l'envoi de l'email de confirmation de la validation de l'inscription */
@ -3558,7 +3593,7 @@ const DisplayPartnerSession = (props) => {
setp_filtre2();
setp_filtre2_value();
Getall_TrainingSession();
Getall_TrainingSession_no_filter();
}
@ -3585,8 +3620,11 @@ const DisplayPartnerSession = (props) => {
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre1 &&
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -3606,18 +3644,39 @@ const DisplayPartnerSession = (props) => {
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
setp_filtre1_value("");
}} />
</InputAdornment>
),
}}
/>}
/>
}
</div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div>
{!!p_filtre1_value &&
{p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
@ -3638,7 +3697,7 @@ const DisplayPartnerSession = (props) => {
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre1 &&
{String(p_filtre2).length > 3 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -3658,8 +3717,7 @@ const DisplayPartnerSession = (props) => {
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
setp_filtre2_value("");
}} />
</InputAdornment>
),
@ -3667,8 +3725,25 @@ const DisplayPartnerSession = (props) => {
/>}
</div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div>
}
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

View File

@ -18,11 +18,13 @@ import { useHistory } from "react-router-dom";
import axios from "axios";
import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
import { LuScreenShare, LuScreenShareOff } from "react-icons/lu";
import MenuItem from '@mui/material/MenuItem';
import InputAdornment from '@mui/material/InputAdornment';
import Box from '@mui/material/Box';
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
const DistplayPartnerTraningsPage = (props) => {
@ -149,11 +151,7 @@ const DistplayPartnerTraningsPage = (props) => {
form.append(filtre3, filtre3_value);
}
//console.log(" filtres1 = " + filtre1 + " = " + filtre1_value);
//console.log(" filtres2 = " + filtre2 + " = " + filtre2_value);
//console.log(" filtres3 = " + filtre3 + " = " + filtre3_value);
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
@ -771,9 +769,7 @@ const DistplayPartnerTraningsPage = (props) => {
setp_filtre3();
setp_filtre3_value();
GetAllClass_new_no_filter();
}
@ -820,8 +816,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre1 &&
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -841,20 +837,39 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
setp_filtre1_value("");
}} />
</InputAdornment>
),
}}
/>}
/>
}
</div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div>
{!!p_filtre1_value &&
{p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
@ -875,8 +890,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre1 &&
<div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
{String(p_filtre2).length > 3 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -896,8 +911,7 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
setp_filtre2_value("");
}} />
</InputAdornment>
),
@ -905,10 +919,35 @@ const DistplayPartnerTraningsPage = (props) => {
/>}
</div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add' >
<Tooltip id="my-tooltip03" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip03" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline
onClick={(e) => {
setp_filtre3("1");
}}
/>
</a>
</div>}
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div>
}
{!!p_filtre2_value &&
{p_filtre3 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
@ -929,8 +968,8 @@ const DistplayPartnerTraningsPage = (props) => {
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{!!p_filtre2 &&
<div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
{String(p_filtre3).length > 3 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -950,8 +989,7 @@ const DistplayPartnerTraningsPage = (props) => {
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre3();
setp_filtre3_value();
setp_filtre3_value("");
}} />
</InputAdornment>
),
@ -959,6 +997,16 @@ const DistplayPartnerTraningsPage = (props) => {
/>}
</div>
{String(p_filtre3).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip05" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip05" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre3();
setp_filtre3_value();
}} />
</a>
</div>}
</div>
}

View File

@ -1711,7 +1711,7 @@
.texte_area_filter {
float: left;
width: 47% !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
@ -1719,6 +1719,30 @@
margin-bottom: 2px !important;
}
.texte_area_filter_value {
float: left !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
}
.filter_bton_add {
float: left;
width: 5% !important;
font-size: xx-large !important;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
text-align: right;
cursor: pointer;
}
.titre1 {
font-family: "Quicksand", "Signika", sans-serif;
font-size: medium;

View File

@ -805,7 +805,7 @@
.texte_area_filter {
float: left;
width: 47% !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
@ -813,6 +813,30 @@
margin-bottom: 2px !important;
}
.texte_area_filter_value {
float: left !important;
width: 40% !important;
font-size: x-small !important;
font-family: "verdana", "Quicksand", "Signika", sans-serif;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
}
.filter_bton_add {
float: left;
width: 5% !important;
font-size: xx-large !important;
margin: 0.4rem !important;
margin-top: 0px !important;
margin-bottom: 2px !important;
text-align: right;
cursor: pointer;
}
.div_row {
float: left;
//border: 1px solid black;
@ -904,6 +928,7 @@
border-radius: 5px;
background: white;
border: solid gainsboro 1px;
padding-top: 0.5rem !important;
}
.training_caract {