fix statictic

master
sajjad 3 years ago
parent 619d6bbc7c
commit 72154c82af

@ -3,6 +3,7 @@ import url from "@/router/url"
import { getJson } from "../resources/statisticResource";
export default class StatisticRepository {
async indexAdmin() {
console.log('s');
let response = await axios.get(url("indexAdmin"));
if (response.status === 200) {
return getJson(response.data.data)

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

@ -1,10 +1,18 @@
<template>
<div class="wa__link pa-3">
<router-link :tag="link ? 'a' : 'div'" :to="{ name: link }" :disabled="!link">
<!-- <router-link :tag="link ? 'a' : 'div'" :to="{ name: link }" :disabled="!link"> -->
<router-link
:to="{ name: link }"
:disabled="!link"
custom
v-slot="{ href, navigate }"
>
<a :href="href" @click="navigate" role="link">
<div class="dark icon"><i :class="icon"></i></div>
<div class="mt-1 text__link">
{{ text }}
</div>
</a>
</router-link>
</div>
</template>

Loading…
Cancel
Save