Отрисовка

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