diff --git a/front-end/src/components/Personnel/Students/Students.vue b/front-end/src/components/Personnel/Students/Students.vue index a83316e16..6b1f5187c 100644 --- a/front-end/src/components/Personnel/Students/Students.vue +++ b/front-end/src/components/Personnel/Students/Students.vue @@ -68,6 +68,17 @@ row-hover @row-click="onEdit" > + + + { + data.sort((a, b) => { + const titleA = a.title; + const titleB = b.title; + + const numA = Number(titleA); + const numB = Number(titleB); + + const isNumA = !Number.isNaN(numA); + const isNumB = !Number.isNaN(numB); + + if (isNumA && isNumB) { + return numA - numB; + } + + if (isNumA) { + return -1; + } + + if (isNumB) { + return 1; + } + + return titleA.localeCompare(titleB); + }); this.SET_ROOMS(data); this.SET_IS_LOADED({ field: "_roomsLoaded", value: true }); },