карточка пользователя
This commit is contained in:
1 parent
51a2a00a13
commit
a6e43d4cd0
3 files changed
+112
-12
No files matched your search
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="mydialog"
|
||||
persistent
|
||||
width="600">
|
||||
<v-card
|
||||
height="350">
|
||||
<v-card-text>
|
||||
dfd
|
||||
</v-card-text>
|
||||
<v-divider/>
|
||||
<v-card-actions class="align-self-end pt-0 ">
|
||||
|
||||
<v-btn
|
||||
color="modal_btn"
|
||||
variant="text"
|
||||
@click= "$emit('update:opendialog', value)"
|
||||
>
|
||||
Закрыть
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
opendialog: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
loging: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
|
||||
setup (props, {emit}) {
|
||||
const userlinks = ref([])
|
||||
|
||||
const infouser = () => {
|
||||
axiosApiInstance.get('api/accounts/getuser/?userlogin='+props.loging).then(res => {
|
||||
userlinks.value=res.data
|
||||
console.log(userlinks.value.fio);
|
||||
})}
|
||||
|
||||
const mydialog = computed({
|
||||
get: () => props.opendialog,
|
||||
set: (value) => emit('update:opendialog', value)
|
||||
})
|
||||
|
||||
|
||||
watch(()=>props.opendialog,(newValue,oldValue)=>{
|
||||
if(newValue){
|
||||
infouser()
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
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},
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
mydialog,
|
||||
userlinks,
|
||||
infouser
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -94,7 +94,7 @@
|
||||
<v-btn
|
||||
color="modal_btn"
|
||||
variant="text"
|
||||
@click="UserDialog=false"
|
||||
@click="menusCloses()"
|
||||
>
|
||||
Закрыть {{UserDialog}}
|
||||
</v-btn>
|
||||
@@ -136,7 +136,7 @@ export default {
|
||||
const tab = ref(false)
|
||||
|
||||
const loadlinksUser=async()=>{
|
||||
console.log(props.loging,'props.logingprops.loging');
|
||||
|
||||
const res = await clearAxios.get('api/accounts/getuser/?userlogin='+props.loging)
|
||||
userlinks.value=res.data
|
||||
}
|
||||
@@ -155,7 +155,8 @@ export default {
|
||||
]
|
||||
|
||||
function menusCloses() {
|
||||
context.emit('menusClose')
|
||||
props.UserDialog=false
|
||||
|
||||
}
|
||||
|
||||
const getUserDialog = computed({
|
||||
|
||||
@@ -8,13 +8,18 @@
|
||||
@click="whatuser(x)">
|
||||
|
||||
</v-list-item>
|
||||
{{menuGetUserDialog}}
|
||||
|
||||
<Card-users
|
||||
<info-user-card
|
||||
:opendialog = open
|
||||
:loging="loging"
|
||||
@update:opendialog="open = $event"
|
||||
/>
|
||||
|
||||
<!-- <Card-users
|
||||
:UserDialog="menuGetUserDialog"
|
||||
:loging="loging"
|
||||
@update:UserDialog="menuGetUserDialog = false"
|
||||
/>
|
||||
@update:UserDialog="menuGetUserDialog = $event"
|
||||
/> -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,12 +31,14 @@ import {useAccountStore} from '@/store/AccountStore'
|
||||
import { spravURL } from '@/utils/axios-api'
|
||||
import {checkremote} from '@/utils/universal_functions'
|
||||
import CardUsers from '@/components/cardUsers.vue'
|
||||
import InfoUserCard from './UI/infoUserCard.vue'
|
||||
|
||||
export default {
|
||||
components: { CardUsers},
|
||||
components: { CardUsers, InfoUserCard},
|
||||
|
||||
setup(){
|
||||
const loging = ref('')
|
||||
const open = ref(false)
|
||||
const menuGetUserDialog=ref(false)
|
||||
const wsfuncs={onliner:function(data){
|
||||
|
||||
@@ -50,10 +57,11 @@ export default {
|
||||
const connect = new WebSocket(baseWS+"ws/watcher/?token="+localStorage.access)
|
||||
|
||||
const whatuser=(x)=> {
|
||||
|
||||
console.log(menuGetUserDialog.value, '1========');
|
||||
loging.value = x
|
||||
menuGetUserDialog.value=true
|
||||
console.log(menuGetUserDialog.value, '========');
|
||||
// menuGetUserDialog.value=true
|
||||
open.value = true
|
||||
console.log(menuGetUserDialog.value, '2========');
|
||||
}
|
||||
|
||||
connect.onmessage=(e)=>{
|
||||
@@ -70,7 +78,7 @@ export default {
|
||||
|
||||
|
||||
|
||||
return {loging, menuGetUserDialog, onlineuser, checkremote,spravURL, whatuser, accountStore}
|
||||
return {loging,open, menuGetUserDialog, onlineuser, checkremote,spravURL, whatuser, accountStore}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user