mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 20:11:06 +03:30
new C'hnages
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-container>
|
||||
<material-card class color="black" title="New Message" text>
|
||||
<v-layout wrap class="px-4 mb-3">
|
||||
<v-flex xs12 sm12 md12>
|
||||
<v-autocomplete
|
||||
:items="items"
|
||||
:loading="loading"
|
||||
:search-input.sync="search"
|
||||
v-model="user_id"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
label="Search"
|
||||
persistent-hint
|
||||
prepend-icon="fas fa-search"
|
||||
color="black"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<ticket-send-message :user-id="user_id" />
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
items: [],
|
||||
search: "",
|
||||
user_id: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
search(val) {
|
||||
val && val.length > 2 && this.querySelections(val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async querySelections(val) {
|
||||
if (!this.loading) {
|
||||
this.loading = true;
|
||||
const result = await ApiService.get(urls.userSearch(val));
|
||||
if (result && result.data.data) {
|
||||
this.items = result.data.data;
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-container>
|
||||
<material-card class color="black" title="Show Message" text max-width="600px">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<div
|
||||
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">
|
||||
<span>{{ item.text }}</span>
|
||||
<span class="caption"></span>
|
||||
</div>
|
||||
<div class="Chat Cyan" style="float:right" v-else>
|
||||
<span >{{ item.text }}</span>
|
||||
<span class="caption"></span>
|
||||
</div>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<ticket-send-message :user-id="user_id" />
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
import { mapGetters } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user_id: 0,
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.Chat {
|
||||
padding: 10px 15px;
|
||||
margin: 1% 0;
|
||||
color: white;
|
||||
border-radius: 10px;
|
||||
width: fit-content;
|
||||
display: block;
|
||||
box-shadow: 5px 15px 20px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.Chat.Cyan {
|
||||
background: cornflowerblue;
|
||||
text-align: right;
|
||||
float: right;
|
||||
clear: right;
|
||||
}
|
||||
.Chat.White {
|
||||
background: #fff;
|
||||
color: black;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user