mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-10 19:23:38 +03:30
fix : ticket style and issues
This commit is contained in:
@@ -15,7 +15,17 @@
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
prepend-icon="fas fa-search"
|
prepend-icon="fas fa-search"
|
||||||
color="black"
|
color="black"
|
||||||
/>
|
>
|
||||||
|
<template v-slot:no-data>
|
||||||
|
<v-list-tile>
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title class="black--text">
|
||||||
|
{{ loading ? 'Searching...' : 'please search the contact name' }}
|
||||||
|
</v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</v-list-tile>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<ticket-send-message :user-id="user_id" />
|
<ticket-send-message :user-id="user_id" />
|
||||||
|
|||||||
@@ -1,81 +1,127 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<v-container>
|
<v-container>
|
||||||
<material-card class color="black" title="Show Message" text max-width="600px">
|
<material-card class="ma-auto" color="black" max-width="600px" text title="Show Message">
|
||||||
<v-layout row wrap>
|
<div class="chat-container" ref="chatContainer">
|
||||||
<v-flex xs12>
|
<v-layout row wrap class="messages">
|
||||||
<div
|
<v-flex v-for="item in items" :key="item.id" xs12>
|
||||||
class="mx-2 my-3"
|
|
||||||
v-for="item in items"
|
|
||||||
:key="item.id"
|
|
||||||
|
|
||||||
>
|
<div class="Chat White" v-if="item.sender_user_id == user_id">
|
||||||
<div class="Chat White" v-if="item.sender_user_id == user_id">
|
<pre>{{ item.text }}</pre>
|
||||||
<span>{{ item.text }}</span>
|
<span class="caption"></span>
|
||||||
<span class="caption"></span>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="Chat Cyan" style="float:right" v-else>
|
<div class="Chat Cyan" style="float:right" v-else>
|
||||||
<span >{{ item.text }}</span>
|
<pre>{{ item.text }}</pre>
|
||||||
<span class="caption"></span>
|
<span class="caption"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<ticket-send-message :user-id="user_id" />
|
</div>
|
||||||
</material-card>
|
<ticket-send-message :user-id="user_id"/>
|
||||||
</v-container>
|
</material-card>
|
||||||
</div>
|
</v-container>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { ApiService } from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import { urls } from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import { mapGetters } from "vuex";
|
import {mapGetters} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user_id: 0,
|
user_id: 0,
|
||||||
items: {}
|
items: {}
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.user_id = this.getModalProperties.user_id;
|
|
||||||
this.load();
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters("modal", ["getModalProperties"])
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async load() {
|
|
||||||
const result = await ApiService.get(
|
|
||||||
urls.showMessages(this.user_id)
|
|
||||||
);
|
|
||||||
if (result && result.data.data) {
|
|
||||||
this.items = result.data.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.user_id = this.getModalProperties.user_id;
|
||||||
|
this.load();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters("modal", ["getModalProperties"])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async load() {
|
||||||
|
const result = await ApiService.get(
|
||||||
|
urls.showMessages(this.user_id)
|
||||||
|
);
|
||||||
|
if (result && result.data.data) {
|
||||||
|
this.items = result.data.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
items() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const container = this.$refs.chatContainer;
|
||||||
|
if (container) {
|
||||||
|
container.scrollTop = container.scrollHeight;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.Chat {
|
.chat-container {
|
||||||
|
max-height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 0 10px;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: #d3d3d3 transparent;
|
||||||
|
|
||||||
|
.Chat {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
margin: 1% 0;
|
margin-bottom: 5px;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
display: block;
|
display: block;
|
||||||
box-shadow: 5px 15px 20px rgba(0, 0, 0, 0.2);
|
//box-shadow: 5px 15px 20px rgba(0, 0, 0, 0.2);
|
||||||
}
|
pre {
|
||||||
.Chat.Cyan {
|
margin: 0;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 14px;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.Chat.Cyan {
|
||||||
background: cornflowerblue;
|
background: cornflowerblue;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
float: right;
|
float: right;
|
||||||
clear: right;
|
clear: right;
|
||||||
}
|
}
|
||||||
.Chat.White {
|
|
||||||
background: #fff;
|
.Chat.White {
|
||||||
|
background: #efefef;
|
||||||
color: black;
|
color: black;
|
||||||
float: left;
|
float: left;
|
||||||
clear: left;
|
clear: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-container::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-container::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #7d7d7d;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,72 +1,80 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<v-card-text>
|
<v-card-text class="py-0">
|
||||||
<v-container grid-list-md>
|
<v-container grid-list-md class="pa-0">
|
||||||
<v-flex xs12 sm12 md12>
|
<v-flex md12 sm12 xs12>
|
||||||
<v-textarea name="input-7-1" v-model="form.message" color="black" label="Message" hint="Hint text"></v-textarea>
|
<v-textarea v-model="form.message" color="black" label="Message"
|
||||||
</v-flex>
|
name="input-7-1" rows="2"/>
|
||||||
</v-container>
|
</v-flex>
|
||||||
</v-card-text>
|
</v-container>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-layout align-center class="px-3" justify-center row wrap>
|
||||||
<v-layout row wrap>
|
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" style="padding:10px 60px"
|
||||||
<v-btn color="black" class="mr-2 WM-ActionButton" @click="register()">
|
@click="closeModal">
|
||||||
<v-icon class="white--text mr-2 caption">fas fa-chevron-right</v-icon>
|
<v-icon class="black--text mr-2 caption">fas fa-times</v-icon>
|
||||||
<span>Send</span>
|
<span class="black--text">Close</span>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-layout>
|
<v-spacer/>
|
||||||
</v-card-actions>
|
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="register()">
|
||||||
</div>
|
<v-icon class="white--text mr-2 caption">fas fa-chevron-right</v-icon>
|
||||||
|
<span class="white--text">Send</span>
|
||||||
|
</v-btn>
|
||||||
|
</v-layout>
|
||||||
|
|
||||||
|
</v-card-actions>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { ApiService } from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import { urls } from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import toast from "@/services/global/toast.service";
|
import toast from "@/services/global/toast.service";
|
||||||
import { mapMutations, mapGetters } from "vuex";
|
import {mapMutations, mapGetters} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form : {
|
form: {
|
||||||
message: '',
|
message: '',
|
||||||
user_id : '',
|
user_id: '',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
userId: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
},
|
},
|
||||||
props: {
|
message: {
|
||||||
userId: {
|
type: String,
|
||||||
type : Number,
|
default: ''
|
||||||
default : 0
|
|
||||||
},
|
|
||||||
message: {
|
|
||||||
type : String,
|
|
||||||
default : ''
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
},
|
||||||
this.form.user_id = this.userId;
|
mounted() {
|
||||||
},
|
this.form.user_id = this.userId;
|
||||||
methods: {
|
},
|
||||||
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
methods: {
|
||||||
async register() {
|
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||||
if(this.userId > 0) {
|
async register() {
|
||||||
const result = await ApiService.post( urls.storeMessages, this.form );
|
if (this.userId > 0) {
|
||||||
if (result && result.status == 200) {
|
const result = await ApiService.post(urls.storeMessages, this.form);
|
||||||
this.setResultModal(Math.random(12));
|
if (result && result.status == 200) {
|
||||||
this.closeModal();
|
this.setResultModal(Math.random(12));
|
||||||
}
|
this.closeModal();
|
||||||
} else {
|
|
||||||
toast.error('please Select User');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
watch: {
|
toast.error('please Select User');
|
||||||
userId(val) {
|
}
|
||||||
this.form.user_id = val;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters("modal", ["getModalProperties"])
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
userId(val) {
|
||||||
|
this.form.user_id = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters("modal", ["getModalProperties"])
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<material-card class color="black" text title="My Recent ChatList">
|
<material-card class color="black" text title="My Recent ChatList">
|
||||||
<v-toolbar color="white" flat>
|
<v-toolbar color="white" flat>
|
||||||
<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-spacer/>
|
<v-spacer/>
|
||||||
<v-btn class="WM-ActionButton mb-2 mr-4" color="black" @click="newmessage">
|
<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>
|
||||||
|
|||||||
Reference in New Issue
Block a user