|
|
@ -204,7 +204,6 @@ import Notification from "../Global/Section/Notification.vue";
|
|
|
|
import UserName from "../Global/Section/UserName.vue";
|
|
|
|
import UserName from "../Global/Section/UserName.vue";
|
|
|
|
import { UserStorage } from "@/utils/storage";
|
|
|
|
import { UserStorage } from "@/utils/storage";
|
|
|
|
import StatisticRepository from "@/abstraction/repository/statisticRepository.js";
|
|
|
|
import StatisticRepository from "@/abstraction/repository/statisticRepository.js";
|
|
|
|
import { mapMutations, mapState } from "vuex";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
UserName,
|
|
|
|
UserName,
|
|
|
@ -215,30 +214,19 @@ export default {
|
|
|
|
type: UserStorage.get() ? UserStorage.get().type : null,
|
|
|
|
type: UserStorage.get() ? UserStorage.get().type : null,
|
|
|
|
statistics: {},
|
|
|
|
statistics: {},
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
...mapState("users", ["filters"]),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
...mapMutations("users", ["SET_FILTER_USER"]),
|
|
|
|
|
|
|
|
async loadStatistic() {
|
|
|
|
async loadStatistic() {
|
|
|
|
let repository = new StatisticRepository();
|
|
|
|
let repository = new StatisticRepository();
|
|
|
|
this.statistics =
|
|
|
|
this.statistics =
|
|
|
|
this.role === "admin"
|
|
|
|
this.type === "admin"
|
|
|
|
? await repository.indexAdmin()
|
|
|
|
? await repository.indexAdmin()
|
|
|
|
: this.role === "trainer"
|
|
|
|
: this.type === "trainer"
|
|
|
|
? await repository.indexTrainer()
|
|
|
|
? await repository.indexTrainer()
|
|
|
|
: this.role === "trainee"
|
|
|
|
: this.type === "trainee"
|
|
|
|
? await repository.indexTrainee()
|
|
|
|
? await repository.indexTrainee()
|
|
|
|
: false;
|
|
|
|
: false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
trainersList() {
|
|
|
|
trainersList() {
|
|
|
|
// this.SET_FILTER_USER({});
|
|
|
|
|
|
|
|
// this.SET_FILTER_USER({
|
|
|
|
|
|
|
|
// role_name: {
|
|
|
|
|
|
|
|
// type: "in",
|
|
|
|
|
|
|
|
// val: "trainer",
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
this.$router.push({
|
|
|
|
this.$router.push({
|
|
|
|
name: "users",
|
|
|
|
name: "users",
|
|
|
|
query: {
|
|
|
|
query: {
|
|
|
@ -247,13 +235,6 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
traineesList() {
|
|
|
|
traineesList() {
|
|
|
|
// this.SET_FILTER_USER({});
|
|
|
|
|
|
|
|
// this.SET_FILTER_USER({
|
|
|
|
|
|
|
|
// role_name: {
|
|
|
|
|
|
|
|
// type: "in",
|
|
|
|
|
|
|
|
// val: "trainee",
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
this.$router.push({
|
|
|
|
this.$router.push({
|
|
|
|
name: "users",
|
|
|
|
name: "users",
|
|
|
|
query: {
|
|
|
|
query: {
|
|
|
|