complete ticket

This commit is contained in:
saeid
2019-07-03 09:56:10 +04:30
parent 1ab25bf79d
commit a8bc46151e
11 changed files with 237 additions and 67178 deletions
+1 -3
View File
@@ -72,7 +72,6 @@
<v-list>
<router-link
v-ripple
class="toolbar-items"
:to="{name: 'MyInfo'}"
>
@@ -83,7 +82,6 @@
<router-link
v-ripple
class="toolbar-items"
:to="{name: 'Tickets'}"
>
@@ -116,7 +114,7 @@
</v-card>
</v-menu>
<v-badge v-ripple class="toolbar-items Pointer" @click.native="submitLogout" >
<v-badge class="toolbar-items Pointer" @click.native="submitLogout" >
<v-icon color="tertiary">input</v-icon>
</v-badge>
</v-flex>
@@ -38,7 +38,7 @@ export default {
},
watch: {
search(val) {
val && this.querySelections(val);
val && val.length > 2 && this.querySelections(val);
}
},
methods: {
@@ -48,7 +48,6 @@ export default {
const result = await ApiService.get(urls.userSearch(val));
if (result && result.data.data) {
this.items = result.data.data;
this.user_id = this.data.data.id;
this.loading = false;
}
}
@@ -23,7 +23,7 @@
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import toast from "@/services/global/toast.service";
import { mapMutations } from "vuex";
import { mapMutations, mapGetters } from "vuex";
export default {
data() {
return {
@@ -47,17 +47,26 @@ export default {
this.form.user_id = this.userId;
},
methods: {
...mapMutations("modal", ["closeModal"]),
...mapMutations("modal", ["closeModal", "setResultModal"]),
async register() {
if(this.userId > 0) {
const result = await ApiService.post( urls.storeMessages, this.form );
if (result && result.status == 200) {
this.setResultModal(Math.random(12));
this.closeModal();
}
} else {
toast.error('please Select User');
}
}
},
watch: {
userId(val) {
this.form.user_id = val;
}
},
computed: {
...mapGetters("modal", ["getModalProperties"])
}
};
</script>
+6 -1
View File
@@ -15,13 +15,18 @@ const urls = {
sendVerifyCode : `/password/verifyCode`,
changePassword : `/password/reset`,
storeMessages : `/Messages`,
listMessages : `/Messages`,
listMessages : function(page) {
return `/Messages?page=${page}`;
},
userSearch : function(val) {
return `/users/search?name=${val}`;
},
showMessages : function(user_id) {
return "/Messages/" + user_id;
},
removeUserMessage : function(user_id) {
return "/Messages/User/" + user_id;
},
listTestType : function(filter) {
return "/TestTypes" + filter;
},
+4 -2
View File
@@ -2,6 +2,7 @@
<v-container fluid>
<material-card class=""
v-if="$hasRole('Admin')"
color="black"
title="Admin"
text=""
@@ -26,7 +27,8 @@
</material-card>
<material-card class=""
<material-card
v-if="$hasRole('Supervisor|Admin')"
color="black"
title="Supervisor"
text=""
@@ -50,7 +52,7 @@
</v-layout>
</material-card>
<material-card class=""
<material-card
color="black"
title="User"
text=""
+176 -148
View File
@@ -1,175 +1,203 @@
<template>
<v-container fluid>
<material-card class color="black" title="My Recent ChatList" text>
<v-toolbar flat color="white">
<v-toolbar-title></v-toolbar-title>
<v-divider
class="mx-2"
inset
vertical
></v-divider>
<v-spacer></v-spacer>
<v-btn color="black" @click="newmessage" class="WM-ActionButton mb-2">
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
<span>New Message</span>
</v-btn>
</v-toolbar>
<v-layout class="px-4 my-3">
<v-divider></v-divider>
</v-layout>
<v-layout align-center justify-center wrap class="px-5 mt-3">
<v-flex md12>
<v-data-table :headers="headers" :items="items" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
<span
class="subheading font-weight-light text-white text--darken-3"
v-text="header.text"
/>
</template>
<template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light WM-NoLetterSpacing">{{ item.name }}</td>
<td class="title font-weight-light">
<span class="Chip">
<span class="Count Content">
3 count
</span>
<!-- {{ item.messages_count }} -->
</span>
</td>
<td class="title font-weight-light">
<span class="Chip">
<span class="Unread Content">
3 unread
<!-- {{ item.unread_messages_count }} -->
</span>
</span>
<!-- {{ item.unread_messages_count }} -->
</td>
<td class="text-xs-right">
<v-btn color="pink" @click="showmessages(item.id)" class="WM-ActionButton">
<v-icon class="white--text mr-2 caption">fas fa-chevron-right</v-icon>
<span>Show Message</span>
<v-container fluid>
<material-card class color="black" title="My Recent ChatList" text>
<v-toolbar flat color="white">
<v-toolbar-title></v-toolbar-title>
<v-divider class="mx-2" inset vertical></v-divider>
<v-spacer></v-spacer>
<v-btn color="black" @click="newmessage" class="WM-ActionButton mb-2">
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
<span>New Message</span>
</v-btn>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<div class="text-xs-center" v-if="lastPage > 1">
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
</div>
<v-layout row wrap align-center justify-center class="mt-3">
<router-link :to="{name: 'Dashboard'}">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
<span class="black--text">Back</span>
</v-btn>
</router-link>
</v-layout>
</material-card>
</v-container>
</v-toolbar>
<v-layout class="px-4 my-3">
<v-divider></v-divider>
</v-layout>
<v-layout align-center justify-center wrap class="px-5 mt-3">
<v-flex md12>
<v-data-table :headers="headers" :items="items" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
<span
class="subheading font-weight-light text-white text--darken-3"
v-text="header.text"
/>
</template>
<template slot="items" slot-scope="{ item }">
<td
class="headline font-weight-light WM-NoLetterSpacing"
>{{ item.name }}</td>
<td class="title font-weight-light">
<span class="Chip">
<span class="Count Content">{{ item.messages_count }} count</span>
</span>
</td>
<td class="title font-weight-light">
<span class="Chip">
<span
class="Unread Content"
>{{ item.unread_messages_count }} unread</span>
</span>
</td>
<td class="text-xs-right">
<v-btn
color="pink"
@click="showmessages(item.id)"
class="WM-ActionButton"
>
<v-icon class="white--text mr-2 caption">fas fa-chevron-right</v-icon>
<span>Show Message</span>
</v-btn>
<v-btn
color="pink"
@click="remove(item.id)"
class="WM-ActionButton"
>
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
<span>delete</span>
</v-btn>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<div class="text-xs-center" v-if="lastPage > 1">
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
</div>
<v-layout row wrap align-center justify-center class="mt-3">
<router-link :to="{name: 'Dashboard'}">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
<span class="black--text">Back</span>
</v-btn>
</router-link>
</v-layout>
</material-card>
</v-container>
</template>
<script>
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import { mapMutations } from 'vuex';
import { mapMutations, mapGetters } from "vuex";
export default {
data: () => ({
headers: [
{
sortable: false,
text: "Name",
value: "name"
},
{
sortable: false,
text: "Count Messages",
value: "operator"
},
{
sortable: false,
text: "Unread Message",
value: "operator"
},
{
sortable: false,
text: "Action",
value: "action",
align: "right"
}
],
filter: {
name: ''
data: () => ({
headers: [
{
sortable: false,
text: "Name",
value: "name"
},
{
sortable: false,
text: "Count Messages",
value: "operator"
},
{
sortable: false,
text: "Unread Message",
value: "operator"
},
{
sortable: false,
text: "Action",
value: "action",
align: "right"
}
],
filter: {
name: ""
},
items: [],
refresh: "",
currentPage: 1,
lastPage: 1
}),
created() {
this.load();
},
items: [],
currentPage: 1,
lastPage: 1
}),
created() {
this.load();
},
methods: {
async load(page = 1) {
const result = await ApiService.get(urls.listMessages);
if(result && result.data.data) {
this.items = result.data.data.data;
this.currentPage = result.data.data.current_page;
this.lastPage = result.data.data.last_page;
}
methods: {
async load(page = 1) {
const result = await ApiService.get(urls.listMessages(page));
if (result && result.data.data) {
this.items = result.data.data.data;
this.currentPage = result.data.data.current_page;
this.lastPage = result.data.data.last_page;
}
},
...mapMutations("modal", ["changeCurrentModal"]),
newmessage() {
this.changeCurrentModal({ modal: "modal-ticket-new-message" });
},
showmessages(user_id) {
this.changeCurrentModal({
modal: "modal-ticket-show-messages",
properties: { user_id: user_id }
});
},
async remove(user_id) {
const result = await ApiService.delete(
urls.removeUserMessage(user_id)
);
if (result && result.status == 200) {
for (const key in this.items) {
if (
this.items.hasOwnProperty(key) &&
this.items[key].id == user_id
) {
this.items.splice(key, 1);
}
}
}
}
},
...mapMutations('modal',['changeCurrentModal']),
newmessage() {
this.changeCurrentModal({ modal: "modal-ticket-new-message" });
computed: {
...mapGetters("modal", ["getModalResult"])
},
showmessages(user_id) {
this.changeCurrentModal({ modal: "modal-ticket-show-messages", properties: { user_id : user_id } });
},
},
watch: {
currentPage(page) {
this.load(page);
watch: {
currentPage(page) {
this.load(page);
},
getModalResult() {
this.load();
}
}
}
};
</script>
<style lang="css" scoped>
.WM-ActionButton {
padding: 8px 22px;
padding: 8px 22px;
}
.Chip {
align-items: center;
border-radius: 28px;
display: inline-flex;
font-size: 13px;
margin: 4px;
outline: none;
position: relative;
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
vertical-align: middle;
height:24px;
color:#000;
align-items: center;
border-radius: 28px;
display: inline-flex;
font-size: 13px;
margin: 4px;
outline: none;
position: relative;
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
vertical-align: middle;
height: 24px;
color: #000;
}
.Chip .Content {
align-items: center;
border-radius: 24px;
cursor: default;
display: inline-flex;
height: 32px;
justify-content: space-between;
padding: 0 12px;
vertical-align: middle;
white-space: nowrap;
z-index: 1;
align-items: center;
border-radius: 24px;
cursor: default;
display: inline-flex;
height: 32px;
justify-content: space-between;
padding: 0 12px;
vertical-align: middle;
white-space: nowrap;
z-index: 1;
}
.Chip .Content.Count {
background-color: #b2dfdb;
background-color: #b2dfdb;
}
.Chip .Content.Unread {
background-color: #ffcdd2;
background-color: #ffcdd2;
}
</style>
@@ -1,22 +0,0 @@
<template>
<div>
<v-container grid-list-xs fluid>
<v-layout align-center justify-center wrap class="px-5 my-3">
<v-flex xs12 sm4 md4>
<v-card>
<v-card-title>salam</v-card-title>
<v-card-text>khoobi</v-card-text>
</v-card>
</v-flex>
</v-layout>
<v-layout align-center justify-center wrap class="px-5 my-3">
<v-flex xs12 sm4 md4>
<v-card>
<v-card-title>salam</v-card-title>
<v-card-text>khoobi</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-container>
</div>
</template>