mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-10 19:23:38 +03:30
feat ticket to list
This commit is contained in:
+124
-124
@@ -1,150 +1,150 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-navigation-drawer id="app-drawer" v-model="inputValue" class="black" app absolute dark floating persistent
|
<v-navigation-drawer id="app-drawer" v-model="inputValue" absolute app class="black" dark floating mobile-break-point="991"
|
||||||
mobile-break-point="991" width="260">
|
persistent width="260">
|
||||||
<v-img :src="image" height="100%">
|
<v-img :src="image" height="100%">
|
||||||
<v-layout class="fill-height px-3" tag="v-list" column>
|
<v-layout class="fill-height px-3" column tag="v-list">
|
||||||
<v-list-tile avatar class="px-3 pt-4">
|
<v-list-tile avatar class="px-3 pt-4">
|
||||||
<v-list-tile-title class="title ">
|
<v-list-tile-title class="title ">
|
||||||
<p class="user-name mb-0">{{ $store.state.user.name }}</p>
|
<p class="user-name mb-0">{{ $store.state.user.name }}</p>
|
||||||
<p class="hospital-name mb-0">{{ $store.state.user.medical_center?.name }}</p>
|
<p class="hospital-name mb-0">{{ $store.state.user.medical_center?.name }}</p>
|
||||||
<v-chip small class="user-role mx-0" color="#323232" text-color="#dcdcdc">
|
<v-chip class="user-role mx-0" color="#323232" small text-color="#dcdcdc">
|
||||||
{{ $store.state.roles[0] }}
|
{{ $store.state.roles[0] }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</v-list-tile-title>
|
</v-list-tile-title>
|
||||||
</v-list-tile>
|
</v-list-tile>
|
||||||
<v-divider class="mb-1"/>
|
<v-divider class="mb-1"/>
|
||||||
<v-list-tile v-if="responsive">
|
<v-list-tile v-if="responsive">
|
||||||
<v-text-field class="purple-input search-input" label="Search..." color="purple"/>
|
<v-text-field class="purple-input search-input" color="purple" label="Search..."/>
|
||||||
</v-list-tile>
|
</v-list-tile>
|
||||||
<template v-for="(link, i) in links">
|
<template v-for="(link, i) in links">
|
||||||
|
|
||||||
<v-list-tile v-if="!link.role || $hasRole(link.role)" :key="i" :to="link.to" :active-class="color"
|
<v-list-tile v-if="!link.role || $hasRole(link.role)" :key="i" :active-class="color" :to="link.to"
|
||||||
avatar
|
avatar
|
||||||
class="v-list-item ">
|
class="v-list-item ">
|
||||||
<!-- <v-list-tile-action>-->
|
<!-- <v-list-tile-action>-->
|
||||||
<!-- <v-icon>{{ link.icon }}</v-icon>-->
|
<!-- <v-icon>{{ link.icon }}</v-icon>-->
|
||||||
<!-- </v-list-tile-action>-->
|
<!-- </v-list-tile-action>-->
|
||||||
<v-list-tile-title v-text="link.text"/>
|
<v-list-tile-title v-text="link.text"/>
|
||||||
</v-list-tile>
|
</v-list-tile>
|
||||||
<v-divider class="my-1" v-if="(!link.role || $hasRole(link.role)) && link.line"/>
|
<v-divider v-if="(!link.role || $hasRole(link.role)) && link.line" class="my-1"/>
|
||||||
</template>
|
</template>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
</v-img>
|
</v-img>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Utilities
|
// Utilities
|
||||||
import {
|
import {
|
||||||
mapMutations,
|
mapMutations,
|
||||||
mapState
|
mapState
|
||||||
} from 'vuex'
|
} from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
logo: './img/vuetifylogo.png',
|
logo: './img/vuetifylogo.png',
|
||||||
links: [
|
links: [
|
||||||
{to: {name: 'Dashboard'}, icon: 'mdi-view-dashboard', text: 'Dashboard'},
|
{to: {name: 'Dashboard'}, icon: 'mdi-view-dashboard', text: 'Dashboard'},
|
||||||
{to: {name: 'MyInfo'}, icon: 'mdi-account', text: 'My Info',},
|
{to: {name: 'MyInfo'}, icon: 'mdi-account', text: 'My Info',},
|
||||||
{to: {name: 'SubmitTestResult'}, icon: 'fas fa-vial', text: 'Add a Test Result'},
|
{to: {name: 'SubmitTestResult'}, icon: 'fas fa-vial', text: 'Add a Test Result'},
|
||||||
{to: {name: 'AllResultTest'}, icon: 'description', text: 'Test Results', line: true},
|
{to: {name: 'AllResultTest'}, icon: 'description', text: 'Test Results', line: true},
|
||||||
{to: {name: 'AllItem'}, icon: 'far fa-clone', text: 'Items',},
|
{to: {name: 'AllItem'}, icon: 'far fa-clone', text: 'Items',},
|
||||||
{to: {name: 'MyItem'}, icon: 'far fa-clone', text: 'My Items', line: true},
|
{to: {name: 'MyItem'}, icon: 'far fa-clone', text: 'My Items', line: true},
|
||||||
{to: {name: 'AllPackage'}, icon: 'fas fa-archive', text: 'Packages',},
|
{to: {name: 'AllPackage'}, icon: 'fas fa-archive', text: 'Packages',},
|
||||||
{to: {name: 'MyPackage'}, icon: 'far fa-clone', text: 'My Packages', line: true},
|
{to: {name: 'MyPackage'}, icon: 'far fa-clone', text: 'My Packages', line: true},
|
||||||
{to: {name: 'AllLabels'}, icon: 'fas fa-inbox', text: 'Labels',},
|
{to: {name: 'AllLabels'}, icon: 'fas fa-inbox', text: 'Labels',},
|
||||||
{to: {name: 'AllCycle'}, icon: 'cached', text: 'Cycles', line: true},
|
{to: {name: 'AllCycle'}, icon: 'cached', text: 'Cycles', line: true},
|
||||||
{to: {name: 'ManageMedicalCenter'}, icon: 'far fa-building', text: 'Medical Center', role: 'Admin',},
|
{to: {name: 'ManageMedicalCenter'}, icon: 'far fa-building', text: 'Medical Center', role: 'Admin',},
|
||||||
{to: {name: 'ManageUsers'}, icon: 'far fa-address-book', text: 'Users', role: 'Admin|Supervisor',},
|
{to: {name: 'ManageUsers'}, icon: 'far fa-address-book', text: 'Users', role: 'Admin|Supervisor',},
|
||||||
{to: {name: 'ListTestType'}, icon: 'fas fa-vial', text: 'Manage Test Type', role: 'Admin',},
|
{to: {name: 'ListTestType'}, icon: 'fas fa-vial', text: 'Manage Test Type', role: 'Admin',},
|
||||||
/* { to: {name: 'Statistics'}, icon: 'fas fa-chart-bar', text: 'Statistics', },
|
// {to: {name: 'Statistics'}, icon: 'fas fa-chart-bar', text: 'Statistics',},
|
||||||
{ to: {name: 'Tickets'}, icon: 'style', text: 'Tickets', },*/
|
{to: {name: 'Tickets'}, icon: 'style', text: 'Tickets',},
|
||||||
],
|
],
|
||||||
responsive: false
|
responsive: false
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('app', ['image', 'color']),
|
...mapState('app', ['image', 'color']),
|
||||||
inputValue: {
|
inputValue: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.app.drawer
|
return this.$store.state.app.drawer
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.setDrawer(val)
|
this.setDrawer(val)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
items() {
|
|
||||||
return this.$t('Layout.View.items')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted() {
|
items() {
|
||||||
this.onResponsiveInverted()
|
return this.$t('Layout.View.items')
|
||||||
window.addEventListener('resize', this.onResponsiveInverted)
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
window.removeEventListener('resize', this.onResponsiveInverted)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
...mapMutations('app', ['setDrawer', 'toggleDrawer']),
|
|
||||||
onResponsiveInverted() {
|
|
||||||
if (window.innerWidth < 991) {
|
|
||||||
this.responsive = true
|
|
||||||
} else {
|
|
||||||
this.responsive = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.onResponsiveInverted()
|
||||||
|
window.addEventListener('resize', this.onResponsiveInverted)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.onResponsiveInverted)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations('app', ['setDrawer', 'toggleDrawer']),
|
||||||
|
onResponsiveInverted() {
|
||||||
|
if (window.innerWidth < 991) {
|
||||||
|
this.responsive = true
|
||||||
|
} else {
|
||||||
|
this.responsive = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#app-drawer {
|
#app-drawer {
|
||||||
.title {
|
.title {
|
||||||
.user-name {
|
.user-name {
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
font-size: 18px !important;
|
font-size: 18px !important;
|
||||||
}
|
|
||||||
|
|
||||||
.hospital-name {
|
|
||||||
line-height: 20px;
|
|
||||||
font-family: 'Montserrat-Light';
|
|
||||||
color: #c6c6c6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-chip.user-role {
|
|
||||||
border-radius: 4px;
|
|
||||||
height: 20px !important;
|
|
||||||
line-height: 20px;
|
|
||||||
font-size: 12px;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-list .v-list-item {
|
.hospital-name {
|
||||||
.v-list__tile {
|
line-height: 20px;
|
||||||
padding-top: 0;
|
font-family: 'Montserrat-Light';
|
||||||
padding-bottom: 0;
|
color: #c6c6c6;
|
||||||
border-radius: 5px;
|
|
||||||
|
|
||||||
.v-list__tile__title {
|
|
||||||
font-family: 'Montserrat-light';
|
|
||||||
color: #e9e9e9;
|
|
||||||
//letter-spacing: 1px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-list__tile.v-list__tile--active .v-list__tile__title {
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-list .v-list-item:not(:nth-child(3)) {
|
.v-chip.user-role {
|
||||||
margin: 5px 15px;
|
border-radius: 4px;
|
||||||
|
height: 20px !important;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-list .v-list-item {
|
||||||
|
.v-list__tile {
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
.v-list__tile__title {
|
||||||
|
font-family: 'Montserrat-light';
|
||||||
|
color: #e9e9e9;
|
||||||
|
//letter-spacing: 1px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.v-list__tile.v-list__tile--active .v-list__tile__title {
|
||||||
margin-bottom: 30px !important;
|
color: #000;
|
||||||
padding-left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-list .v-list-item:not(:nth-child(3)) {
|
||||||
|
margin: 5px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
margin-bottom: 30px !important;
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
prepend-icon="fas fa-search"
|
prepend-icon="fas fa-search"
|
||||||
color="black"
|
color="black"
|
||||||
></v-autocomplete>
|
/>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<ticket-send-message :user-id="user_id" />
|
<ticket-send-message :user-id="user_id" />
|
||||||
@@ -52,7 +52,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
+163
-179
@@ -1,215 +1,199 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<material-card class color="black" title="My Recent ChatList" text>
|
<material-card class color="black" text title="My Recent ChatList">
|
||||||
<v-toolbar flat color="white">
|
<v-toolbar color="white" flat>
|
||||||
<v-toolbar-title></v-toolbar-title>
|
<v-toolbar-title></v-toolbar-title>
|
||||||
<v-divider class="mx-2" inset vertical></v-divider>
|
<v-divider class="mx-2" inset vertical></v-divider>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer/>
|
||||||
<v-btn color="black" @click="newmessage" class="WM-ActionButton mb-2 mr-4">
|
<v-btn class="WM-ActionButton mb-2 mr-4" color="black" @click="newmessage">
|
||||||
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
|
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
|
||||||
<span>New Message</span>
|
<span>New Message</span>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-layout class="px-4 my-3">
|
<v-layout class="px-4 my-3">
|
||||||
<v-divider></v-divider>
|
<v-divider/>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<v-layout align-center justify-center wrap class="px-5 mt-3">
|
<v-layout align-center class="px-5 mt-3" justify-center wrap>
|
||||||
<v-flex md12>
|
<v-flex md12>
|
||||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||||
<template slot="headerCell" slot-scope="{ header }">
|
<template slot="headerCell" slot-scope="{ header }">
|
||||||
<span
|
<span
|
||||||
class="subheading font-weight-light text-white text--darken-3"
|
class="subheading font-weight-light text-white text--darken-3"
|
||||||
v-text="header.text"
|
v-text="header.text"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template slot="items" slot-scope="{ item }">
|
<template slot="items" slot-scope="{ item }">
|
||||||
<td
|
<td class="headline font-weight-light WM-NoLetterSpacing">{{ item.name }}</td>
|
||||||
class="headline font-weight-light WM-NoLetterSpacing"
|
<td class="title font-weight-light">
|
||||||
>{{ item.name }}</td>
|
|
||||||
<td class="title font-weight-light">
|
|
||||||
<span class="Chip">
|
<span class="Chip">
|
||||||
<span class="Count Content">{{ item.messages_count }} count</span>
|
<span class="Count Content">{{ item.messages_count }} count</span>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="title font-weight-light">
|
<td class="title font-weight-light">
|
||||||
<span class="Chip">
|
<span class="Chip">
|
||||||
<span class="Unread Content">{{ item.unread_messages_count }} unread</span>
|
<span class="Unread Content">{{ item.unread_messages_count }} unread</span>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-xs-left FlexBtn justify-self-end">
|
<td class="text-xs-left FlexBtn justify-self-end">
|
||||||
<v-tooltip bottom open-on-hover>
|
<v-tooltip bottom open-on-hover>
|
||||||
<template v-slot:activator="{ on, attrs }">
|
<template v-slot:activator="{ on, attrs }">
|
||||||
<v-btn
|
<v-btn
|
||||||
color="cyan"
|
class="WM-ActionButton"
|
||||||
@click="showmessages(item.id)"
|
color="cyan"
|
||||||
class="WM-ActionButton"
|
v-bind="attrs"
|
||||||
v-bind="attrs"
|
@click="showmessages(item.id)"
|
||||||
v-on="on"
|
v-on="on">
|
||||||
>
|
<v-icon class="white--text mr-2 caption">fas fa-eye</v-icon>
|
||||||
<v-icon class="white--text mr-2 caption">fas fa-eye</v-icon>
|
<span>Show Message</span>
|
||||||
<span>Show Message</span>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span>Show Message</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<v-tooltip bottom open-on-hover>
|
|
||||||
<template v-slot:activator="{ on, attrs }">
|
|
||||||
<v-btn
|
|
||||||
color="pink"
|
|
||||||
@click="remove(item.id)"
|
|
||||||
class="WM-ActionButton"
|
|
||||||
v-bind="attrs"
|
|
||||||
v-on="on"
|
|
||||||
>
|
|
||||||
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
|
|
||||||
<span>delete</span>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span>delete</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</td>
|
|
||||||
</template>
|
|
||||||
</v-data-table>
|
|
||||||
</v-flex>
|
|
||||||
</v-layout>
|
|
||||||
<v-divider></v-divider>
|
|
||||||
<div class="text-xs-center" v-if="lastPage > 1">
|
|
||||||
<v-pagination color="black" 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>
|
</v-btn>
|
||||||
</router-link>
|
</template>
|
||||||
</v-layout>
|
<span>Show Message</span>
|
||||||
</material-card>
|
</v-tooltip>
|
||||||
</v-container>
|
<v-tooltip bottom open-on-hover>
|
||||||
|
<template v-slot:activator="{ on, attrs }">
|
||||||
|
<v-btn
|
||||||
|
class="WM-ActionButton"
|
||||||
|
color="pink"
|
||||||
|
v-bind="attrs"
|
||||||
|
@click="remove(item.id)"
|
||||||
|
v-on="on">
|
||||||
|
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
|
||||||
|
<span>delete</span>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<span>delete</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</td>
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
<v-divider/>
|
||||||
|
<div v-if="lastPage > 1" class="text-xs-center">
|
||||||
|
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6" color="black"></v-pagination>
|
||||||
|
</div>
|
||||||
|
<v-layout align-center class="mt-3" justify-center row wrap>
|
||||||
|
<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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ApiService } from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import { urls } from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import { mapMutations, mapGetters } from "vuex";
|
import {mapMutations, mapGetters} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{sortable: false, text: "Name", value: "name"},
|
||||||
sortable: false,
|
{sortable: false, text: "Count Messages", value: "operator"},
|
||||||
text: "Name",
|
{sortable: false, text: "Unread Message", value: "operator"},
|
||||||
value: "name"
|
{sortable: false, text: "Action", value: "action", align: "left",}
|
||||||
},
|
],
|
||||||
{
|
filter: {
|
||||||
sortable: false,
|
name: ""
|
||||||
text: "Count Messages",
|
|
||||||
value: "operator"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sortable: false,
|
|
||||||
text: "Unread Message",
|
|
||||||
value: "operator"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sortable: false,
|
|
||||||
text: "Action",
|
|
||||||
value: "action",
|
|
||||||
align: "left",
|
|
||||||
}
|
|
||||||
],
|
|
||||||
filter: {
|
|
||||||
name: ""
|
|
||||||
},
|
|
||||||
items: [],
|
|
||||||
refresh: "",
|
|
||||||
currentPage: 1,
|
|
||||||
lastPage: 1
|
|
||||||
}),
|
|
||||||
created() {
|
|
||||||
this.load();
|
|
||||||
},
|
},
|
||||||
methods: {
|
items: [],
|
||||||
async load(page = 1) {
|
refresh: "",
|
||||||
const result = await ApiService.get(urls.listMessages(page));
|
currentPage: 1,
|
||||||
if (result && result.data.data) {
|
lastPage: 1
|
||||||
this.items = result.data.data.data;
|
}),
|
||||||
this.currentPage = result.data.data.current_page;
|
created() {
|
||||||
this.lastPage = result.data.data.last_page;
|
this.load();
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
...mapMutations("modal", ["changeCurrentModal"]),
|
async load(page = 1) {
|
||||||
newmessage() {
|
const result = await ApiService.get(urls.listMessages(page));
|
||||||
this.changeCurrentModal({ modal: "modal-ticket-new-message" });
|
if (result && result.data.data) {
|
||||||
},
|
this.items = result.data.data.data;
|
||||||
showmessages(user_id) {
|
this.currentPage = result.data.data.current_page;
|
||||||
this.changeCurrentModal({
|
this.lastPage = result.data.data.last_page;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
...mapMutations("modal", ["changeCurrentModal"]),
|
||||||
...mapGetters("modal", ["getModalResult"])
|
newmessage() {
|
||||||
|
this.changeCurrentModal({modal: "modal-ticket-new-message"});
|
||||||
},
|
},
|
||||||
watch: {
|
showmessages(user_id) {
|
||||||
currentPage(page) {
|
this.changeCurrentModal({
|
||||||
this.load(page);
|
modal: "modal-ticket-show-messages",
|
||||||
},
|
properties: {user_id: user_id}
|
||||||
getModalResult() {
|
});
|
||||||
this.load();
|
},
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters("modal", ["getModalResult"])
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
currentPage(page) {
|
||||||
|
this.load(page);
|
||||||
|
},
|
||||||
|
getModalResult() {
|
||||||
|
this.load();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.WM-ActionButton {
|
.WM-ActionButton {
|
||||||
padding: 8px 22px;
|
padding: 8px 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chip {
|
.Chip {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 28px;
|
border-radius: 28px;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
outline: none;
|
outline: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
|
transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chip .Content {
|
.Chip .Content {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chip .Content.Count {
|
.Chip .Content.Count {
|
||||||
background-color: #b2dfdb;
|
background-color: #b2dfdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Chip .Content.Unread {
|
.Chip .Content.Unread {
|
||||||
background-color: #ffcdd2;
|
background-color: #ffcdd2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user