1
This commit is contained in:
commit
8c95bbf909
126 files changed
+16922
No files matched your search
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="menuAuthDialog"
|
||||
persistent
|
||||
width="400"
|
||||
>
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn
|
||||
v-bind="props"
|
||||
append-icon="mdi-login"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<v-icon color="white"></v-icon>
|
||||
</template>
|
||||
Войти
|
||||
<template v-slot:append>
|
||||
<v-icon color="white"/>
|
||||
</template>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="text-h5">Вход в портал</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12" class="py-0">
|
||||
<v-text-field
|
||||
v-model="anon.username"
|
||||
label="Логин"
|
||||
variant="underlined"
|
||||
:error-messages="errorer('username')"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="12" class="py-0">
|
||||
<v-text-field
|
||||
v-model="anon.password"
|
||||
label="Пароль"
|
||||
variant="underlined"
|
||||
type="password"
|
||||
:error-messages="errorer('password')"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer/>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="menuAuthDialog = false"
|
||||
>
|
||||
Отмена
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="logging"
|
||||
>
|
||||
Войти
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
<v-progress-linear v-show="AppStore.loading" indeterminate></v-progress-linear>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import {useAppStore} from '@/store/app'
|
||||
import { useVuelidate } from '@vuelidate/core'
|
||||
import { required, helpers } from '@vuelidate/validators'
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
|
||||
const req= helpers.withMessage('Обязательное поле', required)
|
||||
|
||||
export default {
|
||||
|
||||
setup(){
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
const AppStore= useAppStore()
|
||||
const menuAuthDialog = ref(false)
|
||||
|
||||
const anon=reactive({
|
||||
username:"9966-00-125",
|
||||
password:""
|
||||
})
|
||||
|
||||
const rules = computed(()=> {
|
||||
return {
|
||||
username: { req, latin: helpers.withMessage(()=> 'Логин имееет вид "0000-00-000"', (value) => /(\d{4,4}[-]\d{2,2}[-]\d{3,3})+$/.test(value.toString()))}, // Matches state.firstName
|
||||
password: { req } // Matches state.lastName
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const v$ = useVuelidate(rules, anon)
|
||||
|
||||
const errorer = (field) => {
|
||||
let errors = v$.value[field].$error?v$.value[field].$errors[0].$message:''
|
||||
return errors
|
||||
}
|
||||
|
||||
const logging=async()=>{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (!v$.value.$error) {
|
||||
await accountStore.logging(anon)
|
||||
}
|
||||
else {
|
||||
console.log(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
v$.value.$validate()
|
||||
})
|
||||
|
||||
return {
|
||||
accountStore,
|
||||
AppStore,
|
||||
menuAuthDialog,
|
||||
anon,
|
||||
v$,
|
||||
logging,
|
||||
errorer,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,3 @@
|
||||
import myHelper from '@/components/UI/my-helper';
|
||||
|
||||
export default [myHelper]
|
||||
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<div class="pa-0 align-self-center">
|
||||
<v-menu
|
||||
v-model="menu"
|
||||
:close-on-content-click="false"
|
||||
:nudge-width="500"
|
||||
offset-x
|
||||
>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
size="large"
|
||||
color="indigo"
|
||||
icon="mdi-owl"
|
||||
@click="menu=!menu"
|
||||
></v-icon>
|
||||
|
||||
</template>
|
||||
|
||||
<v-card
|
||||
class="h-50 overflow-auto overflow-x-hidden">
|
||||
<v-row class="ma-3">
|
||||
<v-col >
|
||||
|
||||
<pre>
|
||||
{{pretext}}
|
||||
</pre>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "myHelper",
|
||||
|
||||
props: {
|
||||
pretext: {
|
||||
type:Object,
|
||||
default:()=>{}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
fav: true,
|
||||
menu: false,
|
||||
message: false,
|
||||
hints: true,
|
||||
}),
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.whmy {
|
||||
height: 80vh;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<v-card class="pt-2">
|
||||
<v-card-title>
|
||||
<span class="text-h5">Обратная связь</span>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text class="px-2 py-0">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col class="flex-grow-0 py-0 text-no-wrap align-self-center text-button">Оцените сайт
|
||||
<!-- <my-helper
|
||||
:pretext = "result.data"
|
||||
/> -->
|
||||
|
||||
</v-col>
|
||||
<v-divider/>
|
||||
</v-row>
|
||||
<v-row
|
||||
v-for="(x, key) in btns"
|
||||
:key = key
|
||||
>
|
||||
<v-col class="flex-grow-0 pb-0">
|
||||
<v-icon
|
||||
|
||||
size="large"
|
||||
:color="x.color"
|
||||
:icon="x.ico"
|
||||
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="pb-0" lg=3>
|
||||
|
||||
{{x.name}}
|
||||
</v-col>
|
||||
<v-col class="py-0">
|
||||
<v-rating
|
||||
v-model="x.rating"
|
||||
hover
|
||||
half-increments
|
||||
size="small"
|
||||
color="yellow-darken-3"
|
||||
/>
|
||||
</v-col>
|
||||
<v-divider/>
|
||||
</v-row >
|
||||
<!-- <v-row>
|
||||
<v-divider/>
|
||||
<v-col class="px-3 ">
|
||||
{{myLabel()}}
|
||||
</v-col>
|
||||
<v-divider/>
|
||||
</v-row> -->
|
||||
|
||||
<v-row class="mt-6">
|
||||
<v-col class="pa-0 px-3">
|
||||
<v-textarea
|
||||
label="Ваши комментарии сделают портал лучше"
|
||||
hide-details
|
||||
variant="outlined"
|
||||
rows="5"
|
||||
row-height="15"
|
||||
v-model="comment"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<!-- <small>вы оценили сайт на <pre>{{ rating }}</pre></small> -->
|
||||
</v-card-text>
|
||||
<v-card-actions class="pt-0">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="menusCloses"
|
||||
>
|
||||
Закрыть
|
||||
|
||||
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="feedAll"
|
||||
|
||||
>
|
||||
Отправить
|
||||
</v-btn>
|
||||
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
LikeDialog: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, context) {
|
||||
const comment = ref("")
|
||||
const btns = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
axiosApiInstance.get('api/feedback/formfeed/')
|
||||
.then(data => btns.value = data.data)
|
||||
})
|
||||
|
||||
const ratingStatus = computed(() => {
|
||||
const decFeed = []
|
||||
btns.value.map(e =>
|
||||
{
|
||||
const { id, rating } = {...e}
|
||||
decFeed.push({id:id, rating:rating})
|
||||
});
|
||||
return { decFeed }
|
||||
});
|
||||
|
||||
function feedAll() {
|
||||
const feedObj = {}
|
||||
feedObj.ratingstatus = ratingStatus.value.decFeed
|
||||
feedObj.usercomment = comment.value
|
||||
axiosApiInstance.post('api/feedback/comment/', feedObj)
|
||||
}
|
||||
|
||||
function menusCloses() {
|
||||
context.emit('menusClose')
|
||||
}
|
||||
|
||||
return {btns, comment, feedAll, menusCloses}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// function myLabel() {
|
||||
// let labels = ''
|
||||
// if (rating.value <= 1)
|
||||
// labels = 'Мы обязательно все исправим, с учего начать в первую очередь?'
|
||||
// if (rating.value > 1 && rating.value <= 2)
|
||||
// labels = 'УПС-С! А что вам не поравилось?'
|
||||
// if (rating.value > 2 && rating.value <= 3)
|
||||
// labels = 'Спасибо за обратную связь, что нам стоит улучшить?'
|
||||
// if (rating.value > 3 && rating.value <= 4)
|
||||
// labels = 'Мы рады, что портал вам понравился,скажите, за что вы поставили такую оценку?'
|
||||
// if (rating.value > 4 && rating.value <= 5)
|
||||
// labels = 'Класс, а что нам удалось сделать лучше всего?'
|
||||
|
||||
// return labels
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.custom_subtitle {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.v-selection-control__input {
|
||||
width: 46%!important;
|
||||
height: 46%!important;
|
||||
|
||||
border-radius: 0!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="text-h5">Карточка пользователя</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="flex-column d-flex pb-0">
|
||||
<v-row class="flex-grow-0">
|
||||
<v-divider/>
|
||||
<v-col
|
||||
class="pa-0"
|
||||
lg=4
|
||||
>
|
||||
<v-img
|
||||
class="h-100"
|
||||
cover
|
||||
:src="accountStore.user.photo"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="pa-0">
|
||||
<v-list class="pt-0 custom_subtitle">
|
||||
<v-list-item
|
||||
v-for="n in basicInformation()"
|
||||
:key="n"
|
||||
>
|
||||
<template #title>
|
||||
<span class="font-weight-medium">
|
||||
{{n.title}}
|
||||
</span>
|
||||
</template>
|
||||
<template #subtitle>
|
||||
<span class="text-subtitle-1">
|
||||
{{n.info}}
|
||||
</span>
|
||||
</template>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col>
|
||||
<v-divider/>
|
||||
</v-row>
|
||||
|
||||
<v-row class="flex-grow-0">
|
||||
|
||||
<v-list class="pa-0 pt-3 custom_subtitle">
|
||||
<v-list-item
|
||||
v-for="n in subInformation()"
|
||||
:key="n"
|
||||
class="py-0"
|
||||
density
|
||||
>
|
||||
<template #title>
|
||||
<span class="font-weight-medium">
|
||||
{{n.title}}
|
||||
</span>
|
||||
|
||||
<span class="text-subtitle-1">
|
||||
{{n.info}}
|
||||
</span>
|
||||
</template>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-row>
|
||||
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions class="align-self-end pt-0">
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="menusCloses"
|
||||
>
|
||||
Отмена
|
||||
</v-btn>
|
||||
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { clearAxios } from '@/utils/axios-api'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
|
||||
export default {
|
||||
|
||||
props: {
|
||||
menuGetUserDialog: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
loging: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
setup(props, context) {
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
const userlinks = ref([])
|
||||
|
||||
const loadlinksUser=async()=>{
|
||||
// console.log(`accountStore`, accountStore);
|
||||
const res = await clearAxios.get('api/accounts/getuser/?userlogin='+props.loging)
|
||||
userlinks.value=res.data
|
||||
}
|
||||
|
||||
const basicInformation = () => [
|
||||
{title: 'Отдел:', info: userlinks.value.department},
|
||||
{title: 'ФИО:', info: userlinks.value.fio},
|
||||
{title: 'Должность:', info: userlinks.value.post},
|
||||
]
|
||||
|
||||
const subInformation = () => [
|
||||
{title: 'E-mail: ', info: userlinks.value.email},
|
||||
{title: 'Телефон: ', info: userlinks.value.tel},
|
||||
{title: 'Комната: ', info: userlinks.value.room},
|
||||
{title: 'Логин: ', info: userlinks.value.login},
|
||||
]
|
||||
|
||||
function menusCloses() {
|
||||
context.emit('menusClose')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadlinksUser()
|
||||
})
|
||||
|
||||
return {
|
||||
menusCloses,
|
||||
userlinks,
|
||||
accountStore,
|
||||
basicInformation,
|
||||
subInformation
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.custom_subtitle .v-list-item-subtitle {
|
||||
opacity: 1!important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
|
||||
<v-carousel
|
||||
cover
|
||||
height="500"
|
||||
hide-delimiters
|
||||
hide-delimiter-background
|
||||
show-arrows="hover"
|
||||
color="white"
|
||||
|
||||
|
||||
|
||||
>
|
||||
|
||||
|
||||
<v-carousel-item
|
||||
v-for="(x, i) in carous" :key="i"
|
||||
|
||||
:src="`${burl}${x.link}`"
|
||||
cover
|
||||
eager
|
||||
>
|
||||
|
||||
|
||||
<v-container
|
||||
fill-height
|
||||
fluid
|
||||
pa-0 ma-0 pb-3
|
||||
class="flex-column h-100 d-flex"
|
||||
>
|
||||
<v-card class="bgCard h-100 d-flex flex-column">
|
||||
<v-card-title class="ma-2 text-h3 text-uppercase titles text-text_carous py-6">
|
||||
{{x.title}}
|
||||
</v-card-title>
|
||||
<v-card-text class="ml-2 mb-2 text-black w-50 flex-grow-0 py-3 text-text_carous text-h5 bgText overflow-auto font-weight-medium">
|
||||
|
||||
{{x.text}}
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
|
||||
</v-container>
|
||||
|
||||
</v-carousel-item>
|
||||
|
||||
</v-carousel>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
import {getfromserverfree} from '@/utils/universal_functions'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
setup() {
|
||||
const burl = baseURL.slice(0,-1)
|
||||
const carous=ref([{link: ""}])
|
||||
|
||||
|
||||
getfromserverfree("api/navigation/carousels/", carous)
|
||||
|
||||
|
||||
|
||||
return { burl, carous}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.bgCard {
|
||||
/* #ffffff6b #ffffff8c*/
|
||||
background: #ffffff38 ;
|
||||
}
|
||||
|
||||
.bgText {
|
||||
background: #ffffffb0;
|
||||
line-height: 3.0rem!important;
|
||||
|
||||
}
|
||||
|
||||
.titles {
|
||||
font-family: cursive !important;
|
||||
background: #ffffff8c;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<v-card class="d-flex ml-3">
|
||||
<v-sheet
|
||||
class="mx-auto"
|
||||
elevation="0"
|
||||
max-width="690"
|
||||
|
||||
>
|
||||
<v-slide-group
|
||||
v-model="model"
|
||||
class="pa-0"
|
||||
selected-class="bg-primary"
|
||||
mandatory
|
||||
show-arrows
|
||||
|
||||
>
|
||||
|
||||
<v-slide-group-item
|
||||
v-for="n in digitalData"
|
||||
:key="n"
|
||||
|
||||
>
|
||||
|
||||
|
||||
<v-card
|
||||
|
||||
class="ma-2 mt-4 d-flex flex-column"
|
||||
height="160"
|
||||
width="179"
|
||||
elevation="0"
|
||||
|
||||
>
|
||||
<v-img
|
||||
height="200"
|
||||
:src="`${burl}${n.img}`"
|
||||
cover
|
||||
class="text-white"
|
||||
>
|
||||
<v-card class="h-100 text-center g text-numeral">
|
||||
<v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
|
||||
{{n.status}}
|
||||
</v-card-title>
|
||||
<v-card-text class="numstyle mt-4 py-0 font-weight-bold">
|
||||
{{n.num}}
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
</v-img>
|
||||
</v-card>
|
||||
|
||||
|
||||
</v-slide-group-item>
|
||||
</v-slide-group>
|
||||
</v-sheet>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
digitalData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
|
||||
setup() {
|
||||
const burl = baseURL.slice(0,-1)
|
||||
const model = ref(false)
|
||||
|
||||
|
||||
return {model, burl}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.numstyle {
|
||||
font-size: 3.875rem!important;
|
||||
line-height: 5.25rem!important;
|
||||
font-family: cursive !important;
|
||||
background: #ffffffb0;
|
||||
}
|
||||
|
||||
.statstyle {
|
||||
background: #ffffffb0;
|
||||
font-size: 1rem!important;
|
||||
}
|
||||
|
||||
.g {
|
||||
/* background-color: rgb(240 248 255 / 35%);; */
|
||||
background-color: rgb(255 255 255);;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<v-container class="py-1 newsVH bg-transparent overflow-auto">
|
||||
<v-card
|
||||
class="mx-auto mb-0 "
|
||||
v-for="(x, i) in newss" :key= i
|
||||
>
|
||||
<v-img
|
||||
:src="`${burl}${x.link}`"
|
||||
height="164px"
|
||||
cover
|
||||
/>
|
||||
|
||||
<v-card-title>
|
||||
{{x.title}}
|
||||
</v-card-title>
|
||||
|
||||
<v-card-subtitle>
|
||||
{{limitText(x.text)}}
|
||||
</v-card-subtitle>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="teal-accent-4"
|
||||
variant="text"
|
||||
>
|
||||
{{x.author.fio}}
|
||||
|
||||
</v-btn>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
:icon="x.show ? 'mdi-chevron-up' : 'mdi-chevron-down'"
|
||||
@click="x.show = !x.show"
|
||||
></v-btn>
|
||||
</v-card-actions>
|
||||
|
||||
<v-expand-transition>
|
||||
<div v-show="x.show">
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-text>
|
||||
{{x.text}}
|
||||
</v-card-text>
|
||||
</div>
|
||||
</v-expand-transition>
|
||||
</v-card>
|
||||
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { ref,computed,watch } from 'vue'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
export default {
|
||||
|
||||
setup(){
|
||||
|
||||
const newss=ref([])
|
||||
const show=ref(false)
|
||||
|
||||
const burl = baseURL.slice(0,-1)
|
||||
|
||||
const limitText=(text)=> {
|
||||
return text.split(' ').slice(0, 10).join(' ')
|
||||
}
|
||||
|
||||
|
||||
getfromserver("api/navigation/news/", newss)
|
||||
|
||||
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
||||
if(newValue){
|
||||
getfromserver("api/navigation/news/",newss)
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
|
||||
return {
|
||||
newss,
|
||||
show,
|
||||
burl,
|
||||
limitText
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.newsVH {
|
||||
height: 93vh;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-list-item v-for="x in onlineuser"
|
||||
:key="x"
|
||||
:prepend-avatar="checkremote( `${spravURL}${x}.jpg`)"
|
||||
title="x"
|
||||
nav
|
||||
@click="whatuser(x)"
|
||||
>
|
||||
<v-dialog
|
||||
v-model="menuGetUserDialog"
|
||||
persistent
|
||||
width="600"
|
||||
>
|
||||
<Card-users
|
||||
:menuGetUserDialog="menuGetUserDialog"
|
||||
:loging="loging"
|
||||
@menusClose="menuGetUserDialog=false"
|
||||
/>
|
||||
|
||||
|
||||
</v-dialog>
|
||||
</v-list-item>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref,watch } from 'vue'
|
||||
import { baseWS } from '@/utils/axios-api'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import { spravURL } from '@/utils/axios-api'
|
||||
import {checkremote} from '@/utils/universal_functions'
|
||||
import CardUsers from '@/components/cardUsers.vue'
|
||||
|
||||
export default {
|
||||
components: { CardUsers},
|
||||
|
||||
setup(){
|
||||
const loging = ref('')
|
||||
const menuGetUserDialog=ref(false)
|
||||
const wsfuncs={onliner:function(data){
|
||||
// console.log(onlineuser)
|
||||
let newset = new Set(data)
|
||||
onlineuser.value = Array.from(newset)
|
||||
// console.log(onlineuser)
|
||||
|
||||
}}
|
||||
const accountStore = useAccountStore()
|
||||
let onlineuser= ref(['ds'])
|
||||
|
||||
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
||||
|
||||
const whatuser=(x)=> {
|
||||
loging.value = x
|
||||
menuGetUserDialog.value=true
|
||||
|
||||
}
|
||||
|
||||
connect.onmessage=(e)=>{
|
||||
let data = JSON.parse(e.data)
|
||||
wsfuncs[data['message']['action']](data.message.data)
|
||||
}
|
||||
|
||||
watch(()=>accountStore.cod2user,function(){
|
||||
// console.log('newValue')
|
||||
if (!accountStore.cod2user.value){
|
||||
connect.close()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
return {loging, menuGetUserDialog, onlineuser, checkremote,spravURL, whatuser}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in new issue
Block a user