master
sajjad_talkhabi 2 years ago
parent 28d12a38cd
commit 203a4e4cee

@ -104,8 +104,8 @@ export default {
});
},
chageRole() {
this.$emit("userId", this.user.id);
this.$_openModal("changeRole", {
userId: this.user.id,
role: this.user.role_id ? this.user.role_id : null,
roles: this.getRoles,
});

@ -44,17 +44,14 @@
</template>
<template #items="{ item }">
<v-col cols="12" class="pb-0">
<UserItem :user="item" @userId="userId" />
<UserItem :user="item" />
</v-col>
</template>
</data-iterator>
</div>
<!-- <div class="text-center mt-40 mb-5">
<pagination :pagination="getPaginationUser" @pagination="changePagination" />
</div> -->
</main-back>
<div class="text-center">
<ChangeRoleModal :userId="id" v-if="isModal('modal_changeRole')" /><FiltersModal
<ChangeRoleModal v-if="isModal('modal_changeRole')" /><FiltersModal
@filter="load"
v-if="isModal('modal_filters')"
/>
@ -79,7 +76,6 @@ export default {
},
data: () => ({
role: UserStorage.getRole() ? UserStorage.getRole() : null,
id: null,
}),
computed: {
...mapGetters("users", [
@ -111,10 +107,9 @@ export default {
}
},
async load() {
this.role === "admin" ? await this.loadUsers() : await this.loadTrainerTrainee();
},
userId(id) {
this.id = id;
this.role === "admin"
? await this.loadUsers()
: await this.loadTrainerTrainee();
},
},
async created() {

@ -67,23 +67,22 @@ import { mapActions } from "vuex";
import toast from "@/utils/toast";
export default {
name: "modal_changeRole",
props: {
userId: {},
},
data: () => ({
role_id: null,
currectRoleId: null,
changeRoleRequestLoading: false,
roles: null,
user_id: null,
}),
computed: {
form() {
return { userId: this.userId };
return { userId: this.user_id };
},
},
methods: {
...mapActions("users", ["updateRole"]),
openModal({ role, roles }) {
openModal({ role, roles, userId }) {
this.user_id = userId;
this.roles = { ...roles };
this.currectRoleId = role ? role : 0;
this.role_id = role ? role : 0;

@ -22,14 +22,10 @@
</v-container>
</template>
<script>
import { mapState } from 'vuex';
import UsersHome from "../components/Users/Items";
export default {
components: {
UsersHome,
},
computed: {
...mapState('users', ['filters']),
},
};
</script>
Loading…
Cancel
Save