affichage moyennes ok

This commit is contained in:
Haïssous Kayyissa 2023-03-28 21:30:56 +02:00
parent de112a57cc
commit 0e286e3008
6 changed files with 60 additions and 56 deletions

View File

@ -24,7 +24,7 @@
<td>{etablissement.fields.g_ea_lib_vx}</td>
<td>{etablissement.fields.ville_etab}</td>
<td>{etablissement.fields.dep}</td>
<td>{etablissement.fields.list_com}</td>
<td>{etablissement.fields.moyenne}</td>
<td>{etablissement.fields.taux_acces_ens}</td>
</tr>
</tbody>
@ -62,8 +62,10 @@
let moyenne = ((pct_TBF*18)+(pct_TB*16)+(pct_B*14)+(pct_AB*12)+(pct_sansmention*10))/100
etablissement.fields['list_com']=moyenne
etablissement.fields.moyenne=moyenne
console.log(etablissement.fields)
})
this.update()
})
}
}

View File

@ -1,30 +1,30 @@
var filiInfo = {
css: null,
exports: null,
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><h1 class="title is-4 m-2"><a>BUT</a> / <a>BUT - Production</a> / <a>Informatique</a></h1><div class="box mt-2" style="background-color: #EAEAEA; margin: auto; width: 60%;"><p>Moyenne des admis<span class="is-pulled-right">19.3</span></p><p>Nombre de formations<span class="is-pulled-right">5</span></p><p>Capacité<span class="is-pulled-right">90</span></p><p>Sélectivité</p></div><div class="m-4"><line-graph expr12="expr12" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr13="expr13" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr14="expr14" style="height: 6rem;"></line-graph></div></div>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><h1 class="title is-4 m-2"><a>BUT</a> / <a>BUT - Production</a> / <a>Informatique</a></h1><div class="box mt-2" style="background-color: #EAEAEA; margin: auto; width: 60%;"><p>Moyenne des admis<span class="is-pulled-right">19.3</span></p><p>Nombre de formations<span class="is-pulled-right">5</span></p><p>Capacité<span class="is-pulled-right">90</span></p><p>Sélectivité</p></div><div class="m-4"><line-graph expr9="expr9" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr10="expr10" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr11="expr11" style="height: 6rem;"></line-graph></div></div>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr12',
selector: '[expr12]'
redundantAttribute: 'expr9',
selector: '[expr9]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr13',
selector: '[expr13]'
redundantAttribute: 'expr10',
selector: '[expr10]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr14',
selector: '[expr14]'
redundantAttribute: 'expr11',
selector: '[expr11]'
}]),
name: 'fili-info'
};

View File

@ -1,38 +1,38 @@
var mainController = {
css: null,
exports: {},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2"><img class="mt-1 ml-5 mr-auto" style="margin: auto;" src="../resources/logo-parcoursup.svg"/></div><search expr18="expr18"></search></div><div class="column"><fili-info expr19="expr19"></fili-info><school expr20="expr20"></school></div></div><school-info expr21="expr21"></school-info>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2"><img class="mt-1 ml-5 mr-auto" style="margin: auto;" src="../resources/logo-parcoursup.svg"/></div><search expr12="expr12"></search></div><div class="column"><fili-info expr13="expr13"></fili-info><school expr14="expr14"></school></div></div><school-info expr15="expr15"></school-info>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'search',
slots: [],
attributes: [],
redundantAttribute: 'expr18',
selector: '[expr18]'
redundantAttribute: 'expr12',
selector: '[expr12]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'fili-info',
slots: [],
attributes: [],
redundantAttribute: 'expr19',
selector: '[expr19]'
redundantAttribute: 'expr13',
selector: '[expr13]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school',
slots: [],
attributes: [],
redundantAttribute: 'expr20',
selector: '[expr20]'
redundantAttribute: 'expr14',
selector: '[expr14]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school-info',
slots: [],
attributes: [],
redundantAttribute: 'expr21',
selector: '[expr21]'
redundantAttribute: 'expr15',
selector: '[expr15]'
}]),
name: 'main-controller'
};

View File

@ -10,14 +10,14 @@ var schoolInfo = {
this.update();
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr15="expr15" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr0="expr0" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled,
redundantAttribute: 'expr15',
selector: '[expr15]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr16="expr16" class="delete is-medium">X</button><p><h2></h2></p><line-graph expr17="expr17" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr16',
selector: '[expr16]',
redundantAttribute: 'expr0',
selector: '[expr0]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr1="expr1" class="delete is-medium">X</button><p><h2></h2></p><line-graph expr2="expr2" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr1',
selector: '[expr1]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -29,8 +29,8 @@ var schoolInfo = {
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr17',
selector: '[expr17]'
redundantAttribute: 'expr2',
selector: '[expr2]'
}])
}]),
name: 'school-info'

View File

@ -56,59 +56,61 @@ var school = {
let pct_TB = etablissement.fields.pct_tb;
let pct_TBF = etablissement.fields.pct_tbf;
let moyenne = (pct_TBF * 18 + pct_TB * 16 + pct_B * 14 + pct_AB * 12 + pct_sansmention * 10) / 100;
etablissement.fields['list_com'] = moyenne;
etablissement.fields.moyenne = moyenne;
console.log(etablissement.fields);
});
this.update();
});
}
};
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<main class="container"><div class="block control has-icons-left is-inline-block is-pulled-right"><input class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead><tbody><tr expr0="expr0"></tr></tbody></table></main>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<main class="container"><div class="block control has-icons-left is-inline-block is-pulled-right"><input class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead><tbody><tr expr58="expr58"></tr></tbody></table></main>', [{
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<td expr1="expr1"> </td><td expr2="expr2"> </td><td expr3="expr3"> </td><td expr4="expr4"> </td><td expr5="expr5"> </td>', [{
redundantAttribute: 'expr1',
selector: '[expr1]',
template: template('<td expr59="expr59"> </td><td expr60="expr60"> </td><td expr61="expr61"> </td><td expr62="expr62"> </td><td expr63="expr63"> </td>', [{
redundantAttribute: 'expr59',
selector: '[expr59]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.g_ea_lib_vx
}]
}, {
redundantAttribute: 'expr2',
selector: '[expr2]',
redundantAttribute: 'expr60',
selector: '[expr60]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.ville_etab
}]
}, {
redundantAttribute: 'expr3',
selector: '[expr3]',
redundantAttribute: 'expr61',
selector: '[expr61]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.dep
}]
}, {
redundantAttribute: 'expr4',
selector: '[expr4]',
redundantAttribute: 'expr62',
selector: '[expr62]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.list_com
evaluate: _scope => _scope.etablissement.fields.moyenne
}]
}, {
redundantAttribute: 'expr5',
selector: '[expr5]',
redundantAttribute: 'expr63',
selector: '[expr63]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.taux_acces_ens
}]
}]),
redundantAttribute: 'expr0',
selector: '[expr0]',
redundantAttribute: 'expr58',
selector: '[expr58]',
itemName: 'etablissement',
indexName: null,
evaluate: _scope => _scope.state.items

View File

@ -119,9 +119,9 @@ var search = {
}
};
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr6="expr6" class="input" type="input"/><button expr7="expr7" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr8="expr8" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr6',
selector: '[expr6]',
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr16="expr16" class="input" type="input"/><button expr17="expr17" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr18="expr18" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr16',
selector: '[expr16]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeydown',
@ -132,8 +132,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
redundantAttribute: 'expr7',
selector: '[expr7]',
redundantAttribute: 'expr17',
selector: '[expr17]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -143,33 +143,33 @@ var search = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<button expr9="expr9" class="button is-fullwidth"><span style="font-size: .75em;"><strong expr10="expr10"> </strong></span><div style="margin-left: auto;"></div><span expr11="expr11" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr9',
selector: '[expr9]',
template: template('<button expr19="expr19" class="button is-fullwidth"><span style="font-size: .75em;"><strong expr20="expr20"> </strong></span><div style="margin-left: auto;"></div><span expr21="expr21" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr19',
selector: '[expr19]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
evaluate: _scope => () => _scope.filter(_scope.item.name)
}]
}, {
redundantAttribute: 'expr10',
selector: '[expr10]',
redundantAttribute: 'expr20',
selector: '[expr20]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr11',
selector: '[expr11]',
redundantAttribute: 'expr21',
selector: '[expr21]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
redundantAttribute: 'expr8',
selector: '[expr8]',
redundantAttribute: 'expr18',
selector: '[expr18]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items