$
This commit is contained in:
parent
294598a814
commit
d79d09070c
@ -235,6 +235,8 @@ export default class View {
|
||||
|
||||
let modal = document.createElement("modal")
|
||||
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
const close = () => {
|
||||
riot.unmount(modal, false)
|
||||
this.left.style.filter = "none"
|
||||
@ -250,7 +252,7 @@ export default class View {
|
||||
type: type,
|
||||
capacity: capacity,
|
||||
wish: voeuxtotal,
|
||||
nhacad: Math.round(100 - admishorsacad),
|
||||
nhacad: Math.floor(100 - admishorsacad),
|
||||
|
||||
manPercent: man,
|
||||
womanPercent: woman,
|
||||
@ -339,13 +341,27 @@ export default class View {
|
||||
})
|
||||
|
||||
let moyform = nbformation
|
||||
let moycap = Math.round(capacity / totcapacity)
|
||||
let moyselectivity = Math.round(selectivity / totselectivity)
|
||||
let moycap = Math.floor(capacity / totcapacity)
|
||||
let moyselectivity = Math.floor(selectivity / totselectivity)
|
||||
|
||||
let sumOMoy = 0
|
||||
|
||||
data.forEach((e) => {
|
||||
let sammoy = (e.fields.pct_sansmention * 11) / 20
|
||||
let asbmoy = (e.fields.pct_ab * 13) / 20
|
||||
let bimoy = (e.fields.pct_b * 15) / 20
|
||||
let trbmoy = (e.fields.pct_tb * 17) / 20
|
||||
let trbfmoy = (e.fields.pct_tbf * 19) / 20
|
||||
sumOMoy += parseFloat(((sammoy + asbmoy + bimoy + trbmoy + trbfmoy) / 5).toFixed(1))
|
||||
})
|
||||
|
||||
let moyad = parseFloat(sumOMoy / nbformation).toFixed(1)
|
||||
|
||||
return {
|
||||
capacitycount: moycap,
|
||||
nformcount: moyform,
|
||||
selectivitycount: moyselectivity
|
||||
selectivitycount: moyselectivity,
|
||||
moyad: moyad
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,8 +380,8 @@ export default class View {
|
||||
})
|
||||
|
||||
let man = tot - woman
|
||||
let moywomen = Math.round(100 * woman / tot)
|
||||
let moyman = Math.round(100 * man / tot)
|
||||
let moywomen = Math.floor(100 * woman / tot)
|
||||
let moyman = Math.floor(100 * man / tot)
|
||||
|
||||
return {
|
||||
man: `${moyman}%`,
|
||||
@ -392,10 +408,10 @@ export default class View {
|
||||
})
|
||||
|
||||
let tot = gen + pro + tech + autre
|
||||
let moygen = Math.round(100 * gen / tot)
|
||||
let moytech = Math.round(100 * tech / tot)
|
||||
let moypro = Math.round(100 * pro / tot)
|
||||
let moyautre = Math.round(100 * autre / tot)
|
||||
let moygen = Math.floor(100 * gen / tot)
|
||||
let moytech = Math.floor(100 * tech / tot)
|
||||
let moypro = Math.floor(100 * pro / tot)
|
||||
let moyautre = Math.floor(100 * autre / tot)
|
||||
|
||||
return {
|
||||
gen: `${moygen}%`,
|
||||
@ -426,11 +442,11 @@ export default class View {
|
||||
})
|
||||
|
||||
let tot = p + ab + b + tb + tbf
|
||||
let moyp = Math.round(100 * p / tot)
|
||||
let moyab = Math.round(100 * ab / tot)
|
||||
let moyb = Math.round(100 * b / tot)
|
||||
let moytb = Math.round(100 * tb / tot)
|
||||
let moytbf = Math.round(100 * tbf / tot)
|
||||
let moyp = Math.floor(100 * p / tot)
|
||||
let moyab = Math.floor(100 * ab / tot)
|
||||
let moyb = Math.floor(100 * b / tot)
|
||||
let moytb = Math.floor(100 * tb / tot)
|
||||
let moytbf = Math.floor(100 * tbf / tot)
|
||||
|
||||
return {
|
||||
p: `${moyp}%`,
|
||||
@ -448,6 +464,7 @@ export default class View {
|
||||
|
||||
if(data.length > 0) {
|
||||
riot.mount(elem, {
|
||||
moyad: gen.moyad,
|
||||
capacitycount: gen.capacitycount,
|
||||
nformcount: gen.nformcount,
|
||||
selectivitycount: gen.selectivitycount,
|
||||
|
@ -273,7 +273,7 @@
|
||||
<div id="generalysticsfragment-gen">
|
||||
<div class="generalysticsfragment-gen-component">
|
||||
<span class="generalysticsfragment-gen-text">Moyenne des admis</span>
|
||||
<span class="generalysticsfragment-gen-text">?</span>
|
||||
<span class="generalysticsfragment-gen-text">{ this.props.moyad }</span>
|
||||
</div>
|
||||
|
||||
<div class="generalysticsfragment-gen-component">
|
||||
|
@ -4,13 +4,12 @@
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #7A90A4;
|
||||
box-shadow: 0px 0px 9px 1px black;
|
||||
width: 85%;
|
||||
height: 85%;
|
||||
height: 55%;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -18,17 +18,6 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<app id="root"></app>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/riot@latest/riot+compiler.min.js"></script>
|
||||
<script src="https://unpkg.com/riot@latest/dist/riot.min.js"></script>
|
||||
<script src="https://unpkg.com/riot@latest/dist/riot+compiler.min.js"></script>
|
||||
<script src="https://unpkg.com/babel-polyfill@7.12.1/dist/polyfill.min.js"></script>
|
||||
<script src="https://unpkg.com/@riotjs/hydrate@latest/dist/hydrate.min.js"></script>
|
||||
<script src="https://unpkg.com/axios@latest/dist/axios.min.js"></script>
|
||||
<script src="https://unpkg.com/lodash@latest/lodash.min.js"></script>
|
||||
<script src="pages.js"></script>
|
||||
<script src="register-global-components.js"></script>
|
||||
<script src="index.js"></script>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user