146 lines
4.3 KiB
Vue
146 lines
4.3 KiB
Vue
<template>
|
|
|
|
<div id='CONTAINER' class='list'>
|
|
|
|
<div class='list container' data-anim-incoming='1' :data-anim-bounce='gstore.nav_anim.out?1:0'>
|
|
|
|
<!-- <button @click='gstore.nav_out($router)'>Retour</button> -->
|
|
|
|
<!-- FILTERS -->
|
|
<section class='filter'>
|
|
|
|
<div>enseignant</div>
|
|
<div class='null'></div>
|
|
<div>volume horaire</div>
|
|
<div>formations</div>
|
|
|
|
</section>
|
|
|
|
<!-- COURS -->
|
|
<section class='cours'
|
|
v-for='(c,i) in gstore.manage.cours'
|
|
:data-id='c.idCours'>
|
|
|
|
<select v-model='c.idProf' @change='upd_prof(i)'>
|
|
<option value='-1' v-show='c.idProf!=-1'>Aucun enseignant affecté</option>
|
|
<option v-for='p in gstore.manage.prof' :value='p.idProfesseur' v-show='p.idProfesseur!=c.idProf'>{{ `${p.firstName} ${p.lastName}` }}</option>
|
|
</select>
|
|
<div>Cours</div>
|
|
<div>{{ c.volume }}</div>
|
|
<div class='taglist'>
|
|
<div v-for='f in c.formations' data-action>
|
|
<span class='tag'>{{ gstore.form_by_id(f).labelForm || '???' }}</span>
|
|
<span data-remove @click='gstore.rem_form(0, i, f)'></span>
|
|
</div>
|
|
|
|
<div data-action>
|
|
<select class='tag' v-model='gstore.manage.cours[i].add_form'>
|
|
<option value='-' selected disabled>Ajouter</option>
|
|
<option
|
|
v-for='f in gstore.formations'
|
|
v-show='c.formations.indexOf(f.idForm) < 0'
|
|
:value='f.idForm'>{{ f.labelForm }}</option>
|
|
</select>
|
|
<span class='pointer' data-create @click='gstore.add_form(0, i)'></span>
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
<!-- TD -->
|
|
<section class='td'
|
|
v-for='(td,i) in gstore.manage.td'
|
|
:data-id='td.idTD'
|
|
data-anim-incoming='1'
|
|
:data-anim-bounce='gstore.nav_anim.out?1:0'>
|
|
|
|
<select v-model='td.idProf' @change='upd_prof(i)'>
|
|
<option value='-1' v-show='td.idProf!=-1'>Aucun enseignant affecté</option>
|
|
<option v-for='p in gstore.manage.prof' :value='p.idProfesseur' v-show='p.idProfesseur!=td.idProf'>{{ `${p.firstName} ${p.lastName}` }}</option>
|
|
</select>
|
|
<div>TD</div>
|
|
<div>{{ td.volume }}</div>
|
|
<div class='taglist'>
|
|
<div v-for='f in td.formations' data-action>
|
|
<span class='tag'>{{ gstore.form_by_id(f).labelForm || '???' }}</span>
|
|
<span data-remove @click='gstore.rem_form(1, i, f)'></span>
|
|
</div>
|
|
|
|
<div data-action>
|
|
<select class='tag'v-model='gstore.manage.td[i].add_form'>
|
|
<option value='-' selected disabled>Ajouter</option>
|
|
<option
|
|
v-for='f in gstore.formations'
|
|
v-show='td.formations.indexOf(f.idForm) < 0'
|
|
:value='f.idForm'>{{ f.labelForm }}</option>
|
|
</select>
|
|
<span class='pointer' data-create @click='gstore.add_form(1, i)'></span>
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
<!-- TP -->
|
|
<section class='tp'
|
|
v-for='(tp,i) in gstore.manage.tp'
|
|
:data-id='tp.idTP'
|
|
data-anim-incoming='1'
|
|
:data-anim-bounce='gstore.nav_anim.out?1:0'>
|
|
|
|
<select v-model='tp.idProf' @change='upd_prof(i)'>
|
|
<option value='-1' v-show='tp.idProf!=-1'>Aucun enseignant affecté</option>
|
|
<option v-for='p in gstore.manage.prof' :value='p.idProfesseur' v-show='p.idProfesseur!=tp.idProf'>{{ `${p.firstName} ${p.lastName}` }}</option>
|
|
</select>
|
|
<div>TP</div>
|
|
<div>{{ tp.volume }}</div>
|
|
<div class='taglist'>
|
|
<div v-for='f in tp.formations' data-action>
|
|
<span class='tag'>{{ gstore.form_by_id(f).labelForm || '???' }}</span>
|
|
<span data-remove @click='gstore.rem_form(2, i, f)'></span>
|
|
</div>
|
|
|
|
<div data-action>
|
|
<select class='tag' v-model='gstore.manage.tp[i].add_form'>
|
|
<option value='-' selected disabled>Ajouter</option>
|
|
<option
|
|
v-for='f in gstore.formations'
|
|
v-show='tp.formations.indexOf(f.idForm) < 0'
|
|
:value='f.idForm'>{{ f.labelForm }}</option>
|
|
</select>
|
|
<span class='pointer' data-create @click='gstore.add_form(2, i)'></span>
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
name: 'CONTAINER_VIEW',
|
|
data(){
|
|
return { gstore: gstore.get }
|
|
},
|
|
beforeMount(){
|
|
|
|
/* (1) Try to load data */
|
|
gstore.get.load_ue_groups(this.$route.params.code, 3).catch( (err) => { // try at max 3 times (200ms each) for UE to be loaded
|
|
|
|
/* (2) On error -> go to 'view' page */
|
|
gstore.get.router.push('/ue/view/');
|
|
|
|
});
|
|
}
|
|
}
|
|
|
|
</script> |