From 55200b2a3c6b379ee497efc0c8059a61040f9714 Mon Sep 17 00:00:00 2001 From: oetrb <oetrb@github.com> Date: Wed, 7 Oct 2020 23:40:43 +0200 Subject: [PATCH] . --- src/components/Courses.vue | 2 +- src/components/Teachers.vue | 61 +++++++++++++++++++++++++++++++------ src/models/course.js | 33 ++++++++++---------- src/models/teacher.js | 19 ++++++++++++ 4 files changed, 88 insertions(+), 27 deletions(-) create mode 100644 src/models/teacher.js diff --git a/src/components/Courses.vue b/src/components/Courses.vue index c5a2be2..35b4dff 100644 --- a/src/components/Courses.vue +++ b/src/components/Courses.vue @@ -567,7 +567,7 @@ export default { }, filteredRows() { return this.rows.filter(row => { - const angebotsnummer = row.angebotsnummer.toString().toLowerCase(); + const angebotsnummer = row.angebotsnummer.toLowerCase(); const angebot = row.angebot.toLowerCase(); const kursname = row.kursname.toLowerCase(); const veranstaltungsart = row.veranstaltungsart.toLowerCase(); diff --git a/src/components/Teachers.vue b/src/components/Teachers.vue index 0a75a2e..7289fec 100644 --- a/src/components/Teachers.vue +++ b/src/components/Teachers.vue @@ -20,8 +20,21 @@ <label class="form-check-label" for="checkbox_headerline"></label> </div> </th> - <th v-on:click="sortTable('angebotsnummer')"><img id='imgsortangebotsnummer' :src="require('../assets/'+sortImg)">Angebotsnummer</th> - <th v-on:click="sortTable('notiz')"><img id="imgsortnotiz" :src="require('../assets/'+sortImg)">Notiz</th> + <th v-on:click="sortTable('teachers_id')"><img id='imgsortteachersid' :src="require('../assets/'+sortImg)">Lehrer-ID</th> + <th v-on:click="sortTable('anrede')"><img id='imgsortanrede' :src="require('../assets/'+sortImg)">Anrede</th> + <th v-on:click="sortTable('grad')"><img id='imgsortgrad' :src="require('../assets/'+sortImg)">Grad</th> + <th v-on:click="sortTable('firstname')"><img id='imgsortfirstname' :src="require('../assets/'+sortImg)">Vorname</th> + <th v-on:click="sortTable('lastname')"><img id='imgsortlastname' :src="require('../assets/'+sortImg)">Nachname</th> + <th v-on:click="sortTable('street')"><img id='imgsortstreet' :src="require('../assets/'+sortImg)">Straße</th> + <th v-on:click="sortTable('zip')"><img id='imgsortzip' :src="require('../assets/'+sortImg)">Postleitzahl</th> + <th v-on:click="sortTable('city')"><img id='imgsortcity' :src="require('../assets/'+sortImg)">Ort</th> + <th v-on:click="sortTable('addaddress')"><img id='imgsortaddaddress' :src="require('../assets/'+sortImg)">zusätzliche Adresse</th> + <th v-on:click="sortTable('personal_questionnaire')"><img id='imgsortpersonal_questionaire' :src="require('../assets/'+sortImg)">persönlicher Fragebogen</th> + <th v-on:click="sortTable('summeruni_17')"><img id='imgsortsummeruni_17' :src="require('../assets/'+sortImg)">SommerUni 17</th> + <th v-on:click="sortTable('summeruni_18')"><img id='imgsortsummeruni_18' :src="require('../assets/'+sortImg)">SommerUni 18</th> + <th v-on:click="sortTable('summeruni_19')"><img id='imgsortsummeruni_19' :src="require('../assets/'+sortImg)">SommerUni 19</th> + <th v-on:click="sortTable('summeruni_20')"><img id='imgsortsummeruni_20' :src="require('../assets/'+sortImg)">SommerUni 20</th> + <th v-on:click="sortTable('natlab_20')"><img id='imgsortnatlab_20' :src="require('../assets/'+sortImg)">NatLab 20</th> </tr> <tr v-for="row in filteredRows" :key="row.id"> <td scope="row"> @@ -30,7 +43,21 @@ <label class="form-check-label" for="checkbox_tablerow"></label> </div> </td> - <td>{{row.angebotsnummer}}</td> + <td>{{row.id}}</td> + <td>{{row.anrede}}</td> + <td>{{row.grad}}</td> + <td>{{row.firstname}}</td> + <td>{{row.lastname}}</td> + <td>{{row.street}}</td> + <td>{{row.zip}}</td> + <td>{{row.city}}</td> + <td>{{row.addaddress}}</td> + <td>{{row.personal_questionnaire}}</td> + <td>{{row.summeruni_17}}</td> + <td>{{row.summeruni_18}}</td> + <td>{{row.summeruni_19}}</td> + <td>{{row.summeruni_20}}</td> + <td>{{row.natlab_20}}</td> </tr> </table> </div> @@ -542,14 +569,28 @@ export default { } return Object.keys(this.rows[0]) }, - //filteredRows() { - //return this.rows.filter(row => { - //const angebotsnummer = row.angebotsnummer.toString().toLowerCase(); - //const angebot = row.angebot.toLowerCase(); + filteredRows() { + return this.rows.filter(row => { + const teachers_id = row.id.toString().toLowerCase(); + const anrede = row.anrede.toLowerCase(); + const grad = row.grad.toLowerCase(); + const firstname = row.firstname.toLowerCase(); + const lastname = row.lastname.toLowerCase(); + const street = row.street.toLowerCase(); + const zip = row.zip.toLowerCase(); + const city = row.city.toLowerCase(); + const addaddress = row.addaddress.toLowerCase(); + const personal_questionnaire = row.personal_questionnaire.toLowerCase(); + const summeruni_17 = row.summeruni_17.toLowerCase(); + const summeruni_18 = row.summeruni_18.toLowerCase(); + const summeruni_19 = row.summeruni_19.toLowerCase(); + const summeruni_20 = row.summeruni_20.toLowerCase(); + const natlab_20 = row.natlab_20.toLowerCase(); + const searchTerm = this.filter.toLowerCase(); - //return angebotsnummer.includes(searchTerm) || angebot.includes(searchTerm) || kursname.includes(searchTerm) || veranstaltungsart.includes(searchTerm) || kursdatum.includes(searchTerm) || thema.includes(searchTerm) || kursort.includes(searchTerm) || begleitendeLehrkraft.includes(searchTerm) || betreuendeStudenten.includes(searchTerm) || betreuendeStudenten.includes(searchTerm) || anzahlderAnwesenden.includes(searchTerm) || anzahlderAngemeldeten.includes(searchTerm) || kursleiter.includes(searchTerm) || notiz.includes(searchTerm); - //}); - //} + return teachers_id.includes(searchTerm) || anrede.includes(searchTerm) || grad.includes(searchTerm) || firstname.includes(searchTerm) || lastname.includes(searchTerm) || street.includes(searchTerm) || zip.includes(searchTerm) || city.includes(searchTerm) || addaddress.includes(searchTerm) || personal_questionnaire.includes(searchTerm) || summeruni_17.includes(searchTerm) || summeruni_18.includes(searchTerm) || summeruni_19.includes(searchTerm) || summeruni_20.includes(searchTerm) || natlab_20.includes(searchTerm); + }); + } } } </script> diff --git a/src/models/course.js b/src/models/course.js index 3f6febe..18a4d4e 100644 --- a/src/models/course.js +++ b/src/models/course.js @@ -1,19 +1,20 @@ export default class Course { - constructor(coursenumber, courseoffer, coursename, eventtype, coursedate, topic, courselocation, accompanyingteacher, supervisingstudents, presentstudents, registeredstudents, instructor, notefield) { - this.coursenumber = coursenumber; - this.courseoffer = courseoffer; - this.coursename = coursename; - this.eventtype = eventtype; - this.coursedate = coursedate; - this.topic = topic; - this.courselocation = courselocation; - this.accompanyingteacher = accompanyingteacher; - this.supervisingstudents = supervisingstudents; - this.presentstudents = presentstudents; - this.registeredstudents = registeredstudents; - this.instructor = instructor; - this.notefield = notefield; + constructor(teachers_id, anrede, grad, firstname, lastname, street, zip, city, addaddress, personal_questionnaire, summeruni_17, summeruni_18, summeruni_19, summeruni_20, natlab_20) { + this.teachers_id = teachers_id; + this.anrede = anrede; + this.grad = grad; + this.firstname = firstname; + this.lastname = lastname; + this.street = street; + this.zip = zip; + this.city = city; + this.addaddress = addaddress; + this.personal_questionnaire = personal_questionnaire; + this.summeruni_17 = summeruni_17; + this.summeruni_18 = summeruni_18; + this.summeruni_19 = summeruni_19; + this.summeruni_20 = summeruni_20; + this.natlab_20 = natlab_20; } - -} \ No newline at end of file +} diff --git a/src/models/teacher.js b/src/models/teacher.js new file mode 100644 index 0000000..92ba6e1 --- /dev/null +++ b/src/models/teacher.js @@ -0,0 +1,19 @@ +export default class Teacher { + + constructor(coursenumber, courseoffer, coursename, eventtype, coursedate, topic, courselocation, accompanyingteacher, supervisingstudents, presentstudents, registeredstudents, instructor, notefield) { + this.coursenumber = coursenumber; + this.courseoffer = courseoffer; + this.coursename = coursename; + this.eventtype = eventtype; + this.coursedate = coursedate; + this.topic = topic; + this.courselocation = courselocation; + this.accompanyingteacher = accompanyingteacher; + this.supervisingstudents = supervisingstudents; + this.presentstudents = presentstudents; + this.registeredstudents = registeredstudents; + this.instructor = instructor; + this.notefield = notefield; + } + +} \ No newline at end of file -- GitLab