From 04d46b39ed83699c4ab5803431f7963e1b87d212 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Mon, 23 Jun 2025 11:16:20 +0200 Subject: [PATCH] MergedPerson Results --- .../searchbar/result/mergedperson.js | 21 ++++++++++++++++--- public/js/components/searchbar/searchbar.js | 5 ++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/public/js/components/searchbar/result/mergedperson.js b/public/js/components/searchbar/result/mergedperson.js index be9d1e735..fb9684303 100644 --- a/public/js/components/searchbar/result/mergedperson.js +++ b/public/js/components/searchbar/result/mergedperson.js @@ -8,6 +8,7 @@ export default { }, emits: [ 'actionexecuted' ], props: { + mode: String, res: Object, actions: Object }, @@ -24,14 +25,23 @@ export default { // Those properties should be the same in all entries const { person_id, name } = this.res.list[0]; // Get first photo (prefer student photo if available) - const photo_url = ((this.students ? this.students.find(el => el.photo_url) : null) || this.employee)?.photo_url; + let photo_url; + if (this.mode == 'simple') { + let foto = (this.students ? this.students.find(el => el.foto) : null)?.foto; + if (foto) + foto = 'data:image/jpeg;base64,' + foto; + photo_url = foto || this.employee?.photo_url; + } else + photo_url = ((this.students ? this.students.find(el => el.photo_url) : null) || this.employee)?.photo_url; return { person_id, name, photo_url, email }; }, employee() { return this.res.list.find(item => [ 'employee', - 'unassigned_employee' + 'unassigned_employee', + 'mitarbeiter', + 'mitarbeiter_ohne_zuordnung' ].includes(item.type)) || null; }, students() { @@ -132,7 +142,12 @@ export default { :action="actions.defaultactionstudent || actions.defaultaction" @actionexecuted="$emit('actionexecuted')" > - {{ student.status }} ({{ student.stg_kuerzel }}) + + diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 49cbdb2ff..fe4b850f1 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -5,6 +5,7 @@ import organisationunit from "./organisationunit.js"; import student from "./result/student.js"; import prestudent from "./result/prestudent.js"; import mergedStudent from "./result/mergedstudent.js"; +import mergedPerson from "./result/mergedperson.js"; export default { props: [ "searchoptions", "searchfunction" ], @@ -32,7 +33,8 @@ export default { organisationunit: organisationunit, student: student, prestudent: prestudent, - mergedStudent + mergedStudent, + mergedPerson }, template: /*html*/`
+