add chat-card

1. add chat card
2. fix settings (output object)
3. add input phone and email to user
4. fix empty string to null
This commit is contained in:
2025-07-29 13:26:46 +03:00
parent 462ed2b671
commit feb351424e
14 changed files with 215 additions and 118 deletions

View File

@@ -26,7 +26,7 @@
:key="item.id"
@right="handleSlide($event, item.id)"
right-color="red"
@click="goChat(item.invite_link)"
@click="goChatInfo(item.id)"
>
<template #right>
<q-icon size="lg" name="mdi-link-off"/>
@@ -169,6 +169,11 @@
import { useUsersStore } from 'stores/users'
import type { WebApp } from '@twa-dev/types'
import { useI18n } from "vue-i18n"
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
const search = ref('')
@@ -259,8 +264,8 @@
tg.openTelegramLink(tgShareUrl)
}
function goChat (invite: string) {
tg.openTelegramLink(invite)
async function goChatInfo (chatId: number) {
await router.push({ name: 'chat_info', params: { id: route.params.id, chatId }})
}
// fix fab jumping
@@ -273,7 +278,6 @@
}, 300)
})
onDeactivated(() => {
showFab.value = false
if (timerId.value) {

View File

@@ -238,7 +238,7 @@
import { useRouter, useRoute } from 'vue-router'
import { useUsersStore } from 'stores/users'
import { useCompaniesStore } from 'stores/companies'
import type { User } from 'types/Users'
import { useUserSection } from 'composables/useUserSection'
defineOptions({ inheritAttrs: false })
const router = useRouter()
@@ -255,6 +255,7 @@
const showDialogBlockUser = ref<boolean>(false)
const currentSlideEvent = ref<SlideEvent | null>(null)
const closedByUserAction = ref(false)
const { userSection } = useUserSection()
const mapUsers = computed(() => users.map(el => ({
...el,
@@ -284,35 +285,6 @@
const displayUsers = computed(() => displayUsersAll.value.filter(el => !el.is_blocked))
function userSection (user: User) {
const tname = () => {
return user.firstname
? user.lastname
? user.firstname + ' ' + user.lastname
: user.firstname
: user.lastname ?? ''
}
const section1 = user.fullname ?? tname()
const section2_1 = user.fullname ? tname() : ''
const section2_2 = user.username ?? ''
const section3 = (
user.company_id && companiesStore.companyById(user.company_id)
? companiesStore.companyById(user.company_id)?.name + ((user.role || user.department ) ? ' / ' :'')
: '') +
(user.department ? user.department + (user.role ? ' / ' : '') : '') +
(user.role ?? '')
return {
section1,
section2_1, section2_2,
section3
}
}
async function goUserInfo (id: number) {
await router.push({ name: 'user_info', params: { id: route.params.id, userId: id }})
}