Отрисовка

This commit is contained in:
iriska-gri committed 2024-02-20 09:29:08 +03:00
1 parent 39cd38e187
commit c4863cb065
1 file changed
+80 -74
@@ -4,88 +4,94 @@
:ico="'mdi-star-circle'"
>
<template v-slot:filling>
<v-data-table-virtual
v-model:expanded="expanded"
:headers="dessertHeaders"
:items="activusers"
item-value="user.fio"
show-expand
fixed-header
class="h-0 table_top_user"
:sort-by="[{ key: 'info.count', order: 'desc' }]"
density="compact"
>
<template v-slot:item.user="{ value }">
<list-user
:author=value
:from_which = "'top-user'"
/>
</template>
<template v-slot:expanded-row="{ columns, item }">
<tr>
<td :colspan="columns.length">
<v-card class="my-2 elevation-0" color='grey'>
<!-- <v-chip
prepend-icon="mdi-script"
size="small"
class="font-italic my-2"
text="Количество посещенных страниц за выбранный период (всего/уникальные)"
variant="text"
color="grey"
/> -->
<v-divider/>
<v-data-table-virtual
v-model:expanded="expanded"
:headers="dessertHeaders"
:items="activusers"
item-value="user.fio"
show-expand
class="h-0 table_top_user"
:sort-by="[{ key: 'info.count', order: 'desc' }]"
density="compact"
>
<template v-slot:item.user="{ value }">
<list-user
:author=value
:from_which = "'top-user'"
/>
</template>
<template v-slot:headers="{ columns, isSorted, getSortIcon, toggleSort }">
<tr>
<template v-for="column in columns" :key="column.key">
<td class="pa-0">
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
:append-icon="isSorted(column)?getSortIcon(column):''"
variant="text"
class="text-caption"
@click="() => toggleSort(column)"
>
{{ column.title }}
<template v-slot:append>
<v-icon size="x-small"></v-icon>
</template>
</v-btn>
</template>
<span>{{ column.tooltip }}</span>
</v-tooltip>
</td>
</template>
</tr>
</template>
<template v-slot:expanded-row="{ columns, item }">
<tr>
<td :colspan="columns.length">
<v-card class="my-2 elevation-0" color='grey'>
<v-divider/>
<v-data-table
:headers="subtable"
:items="item.tooltip"
items-per-page=-1
class="subtable cursor-default px-3 bg-indigo-lighten-5"
class="subtable cursor-default px-3 bg-grey-lighten-5"
density="compact"
:sort-by="[{ key: 'count', order: 'desc' }]"
>
<template v-slot:header.count="{ column, isSorted, getSortIcon }">
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
max-width="50px"
prepend-icon="mdi-folder-multiple-outline"
variant="text"
>
<v-icon
v-if="isSorted(column)"
:icon="getSortIcon(column)"
size="x-small"
/>
</v-btn>
</template>
<span>Сколько раз посетили страницу в течение заданного периода</span>
</v-tooltip>
</template>
<template v-slot:header.unic="{ column, isSorted, getSortIcon }">
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" max-width="50px" prepend-icon="mdi-folder-outline" variant="text">
<v-icon v-if="isSorted(column)" :icon="getSortIcon(column)"/>
</v-btn>
</template>
<span>Сколько раз посетили страницу в течение заданного периода (1 раз = 1 день)</span>
</v-tooltip>
</template>
<template v-slot:headers="{ columns, isSorted, getSortIcon, toggleSort }">
<tr>
<template v-for="column in columns" :key="column.key">
<td class="pa-0">
<v-btn
:append-icon="isSorted(column)?getSortIcon(column):''"
variant="text"
class="text-caption"
@click="() => toggleSort(column)"
>
{{ column.title }}
<template v-slot:append>
<v-icon size="x-small"></v-icon>
</template>
</v-btn>
</td>
</template>
</tr>
</template>
<template v-slot:item.count="{ value }">
<v-chip :color="getColor(value)" density="compact">
{{ value }}
</v-chip>
<span :class="'text-'+getColor(value) " class="font-weight-medium">
{{ value }}
</span>
</template>
<template v-slot:item.unic="{ value }">
<v-chip :color="getColor2(value)" density="compact">
<span :class="'text-'+getColor2(value) " class="font-weight-medium">
{{ value }}
</v-chip>
</span>
</template>
</v-data-table>
@@ -137,9 +143,9 @@ export default {
key: 'user',
},
{ title: 'просмотры', align: 'start', key: 'info.count', maxWidth: '10' },
{ title: 'сессии', align: 'start', key: 'info.session', maxWidth: '10' },
{ title: 'страницы', align: 'start', key: 'info.pages', maxWidth: '10' },
{ title: 'просмотры', align: 'start', key: 'info.count', tooltip: 'Количество посещенных страниц за период' },
{ title: 'сессии', align: 'start', key: 'info.session', tooltip: 'Сколько дней посещали Портал за период'},
{ title: 'страницы', align: 'start', key: 'info.pages', tooltip: 'Сколько суммарно посещено уникальных страниц за период' },
]
@@ -154,9 +160,9 @@ export default {
maxWidth: '60%',
minWidth: '60%',
},
{ title: 'Всего', align: 'start', key: 'count', width: '20%', maxWidth: '20%'
{ title: 'всего', align: 'center', key: 'count', width: '20%', maxWidth: '20%'
},
{ title: 'Уникальных', align: 'start', key: 'unic', width: '20%', maxWidth: '20%'
{ title: 'уникальных', align: 'center', key: 'unic', width: '20%', maxWidth: '20%'
},