Skip to content
Snippets Groups Projects
Commit 0afb039c authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Reformat

parent 023dff50
No related branches found
No related tags found
1 merge request!350Resolve "Add simple course book list"
Pipeline #180981 failed
......@@ -131,12 +131,21 @@ export default {
},
filters: {
get() {
return { objType: this.objType, objId: this.objId, filterType: this.filterType, incomplete: this.incomplete };
return {
objType: this.objType,
objId: this.objId,
filterType: this.filterType,
incomplete: this.incomplete,
};
},
set(selectedFilters) {
if (Object.hasOwn(selectedFilters, "incomplete")) {
this.incomplete = selectedFilters.incomplete;
} else if (Object.hasOwn(selectedFilters, "filterType") || Object.hasOwn(selectedFilters, "objId") || Object.hasOwn(selectedFilters, "objType")) {
} else if (
Object.hasOwn(selectedFilters, "filterType") ||
Object.hasOwn(selectedFilters, "objId") ||
Object.hasOwn(selectedFilters, "objType")
) {
this.$router.push({
name: "alsijil.coursebook_by_type_and_date",
params: {
......@@ -149,8 +158,8 @@ export default {
},
});
}
}
}
},
},
},
methods: {
// => [[dt doc ...] ...]
......
<template>
<div class="d-flex flex-grow-1 justify-end">
<div class="d-flex flex-grow-1 justify-end">
<v-autocomplete
:items="selectable"
item-text="name"
......@@ -31,7 +31,7 @@
:input-value="value.incomplete"
@change="
$emit('input', {
incomplete: $event
incomplete: $event,
})
"
dense
......@@ -43,10 +43,7 @@
</template>
<script>
import {
coursesOfPerson,
groupsByPerson,
} from "./coursebook.graphql";
import { coursesOfPerson, groupsByPerson } from "./coursebook.graphql";
export default {
name: "CoursebookFilters",
......@@ -79,7 +76,7 @@ export default {
...this.groups.map((group) => ({ type: "group", ...group })),
{ header: this.$t("alsijil.coursebook.filter.courses") },
...this.courses.map((course) => ({ type: "course", ...course })),
];
];
},
selectLoading() {
return (
......@@ -95,11 +92,18 @@ export default {
},
methods: {
selectObject(selection) {
this.$emit("input", { objType: selection ? selection.type : null, objId: selection ? selection.id : null })
this.$emit("input", {
objType: selection ? selection.type : null,
objId: selection ? selection.id : null,
});
},
selectFilterType(switchValue) {
this.$emit("input", { filterType: switchValue ? "my" : "all", objType: this.value.objType, objId: this.value.objId });
}
this.$emit("input", {
filterType: switchValue ? "my" : "all",
objType: this.value.objType,
objId: this.value.objId,
});
},
},
};
</script>
......@@ -199,9 +199,9 @@ export default {
this.createOrPatch([
{
id: this.documentation.id,
...this.topic !== null && { topic: this.topic },
...this.homework !== null && { homework: this.homework },
...this.groupNote !== null && { groupNote: this.groupNote },
...(this.topic !== null && { topic: this.topic }),
...(this.homework !== null && { homework: this.homework }),
...(this.groupNote !== null && { groupNote: this.groupNote }),
},
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment