Отрисовка

This commit is contained in:
iriska-gri committed 2024-02-19 16:59:30 +03:00
1 parent 1542b1e28f
commit 39cd38e187
4 files changed
+41 -86

No files matched your search

@@ -1,5 +1,5 @@
<template> <template>
<v-card class="text-center h-100 d-flex flex-column"> <v-card class="text-center h-100 d-flex flex-column ">
<v-row no-gutters class="flex-grow-0"> <v-row no-gutters class="flex-grow-0">
<v-col class="d-flex flex-column pa-1"> <v-col class="d-flex flex-column pa-1">
<v-chip <v-chip
@@ -18,7 +18,7 @@
<v-col class="flex-column d-flex"> <v-col class="flex-column d-flex">
<v-card-text class="px-3 py-1 flex-column d-flex h-0"> <v-card-text class="px-3 py-1 flex-column d-flex h-0 overflow-x-auto overflow-x-hidden">
<slot name="filling"></slot> <slot name="filling"></slot>
</v-card-text> </v-card-text>
</v-col> </v-col>
@@ -6,9 +6,9 @@
<template v-slot:filling> <template v-slot:filling>
<v-table <v-table
fixed-header fixed-header
density="compact" density="comfortable"
hover hover
class="cursor-default h-0" class="cursor-default h-0 "
> >
<thead> <thead>
<tr> <tr>
@@ -32,9 +32,10 @@
<tr <tr
v-for="(val, key) in pages_count.data" v-for="(val, key) in pages_count.data"
:key="key" :key="key"
> >
<td class="text-left">{{key}}</td> <td class="text-left ">{{key}}</td>
<td> <td >
<tooltip-text <tooltip-text
v-if="val.now.unique.length>0" v-if="val.now.unique.length>0"
:text="modelrating?val.now.unique.length:val.now.countall" :text="modelrating?val.now.unique.length:val.now.countall"
@@ -54,7 +55,7 @@
0 0
</span> </span>
</td> </td>
<td> <td >
<tooltip-text <tooltip-text
v-if="val.year.unique.length>0" v-if="val.year.unique.length>0"
:text="modelrating?val.year.unique.length:val.year.countall" :text="modelrating?val.year.unique.length:val.year.countall"
@@ -4,15 +4,14 @@
:ico="'mdi-star-circle'" :ico="'mdi-star-circle'"
> >
<template v-slot:filling> <template v-slot:filling>
<v-data-table <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
items-per-page-text="" fixed-header
:items-per-page-options=perpage class="h-0 table_top_user"
show-current-page
:sort-by="[{ key: 'info.count', order: 'desc' }]" :sort-by="[{ key: 'info.count', order: 'desc' }]"
density="compact" density="compact"
> >
@@ -26,27 +25,31 @@
<template v-slot:expanded-row="{ columns, item }"> <template v-slot:expanded-row="{ columns, item }">
<tr> <tr>
<td :colspan="columns.length"> <td :colspan="columns.length">
<v-card class="my-2 elevation-5" > <v-card class="my-2 elevation-0" color='grey'>
<v-chip <!-- <v-chip
prepend-icon="mdi-script" prepend-icon="mdi-script"
size="small" size="small"
class="font-italic my-2" class="font-italic my-2"
text="Количество посещенных страниц за выбранный период (всего/уникальные)" text="Количество посещенных страниц за выбранный период (всего/уникальные)"
variant="text" variant="text"
color="grey" color="grey"
/> /> -->
<v-divider/> <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" class="subtable cursor-default px-3 bg-indigo-lighten-5"
density="compact" density="compact"
:sort-by="[{ key: 'count', order: 'desc' }]" :sort-by="[{ key: 'count', order: 'desc' }]"
> >
<template v-slot:header.count="{ column, isSorted, getSortIcon }"> <template v-slot:header.count="{ column, isSorted, getSortIcon }">
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn <v-btn
v-bind="props"
max-width="50px" max-width="50px"
prepend-icon="mdi-folder-multiple-outline" prepend-icon="mdi-folder-multiple-outline"
variant="text" variant="text"
@@ -54,8 +57,12 @@
<v-icon <v-icon
v-if="isSorted(column)" v-if="isSorted(column)"
:icon="getSortIcon(column)" :icon="getSortIcon(column)"
size="x-small"
/> />
</v-btn> </v-btn>
</template>
<span>Сколько раз посетили страницу в течение заданного периода</span>
</v-tooltip>
</template> </template>
<template v-slot:header.unic="{ column, isSorted, getSortIcon }"> <template v-slot:header.unic="{ column, isSorted, getSortIcon }">
@@ -65,7 +72,7 @@
<v-icon v-if="isSorted(column)" :icon="getSortIcon(column)"/> <v-icon v-if="isSorted(column)" :icon="getSortIcon(column)"/>
</v-btn> </v-btn>
</template> </template>
<span>Сколько раз посетили в течение заданного периода (1 раз = 1 день)</span> <span>Сколько раз посетили страницу в течение заданного периода (1 раз = 1 день)</span>
</v-tooltip> </v-tooltip>
</template> </template>
@@ -90,7 +97,7 @@
</tr> </tr>
</template> </template>
</v-data-table> </v-data-table-virtual>
</template> </template>
</pattern-card> </pattern-card>
</template> </template>
@@ -125,14 +132,14 @@ export default {
const dessertHeaders = [ const dessertHeaders = [
{ {
title: '', title: '',
align: 'start', align: '',
sortable: false, sortable: false,
key: 'user', key: 'user',
}, },
{ title: 'Просмотры', align: 'start', key: 'info.count', maxWidth: '10' }, { title: 'просмотры', align: 'start', key: 'info.count', maxWidth: '10' },
{ title: 'Сессии', align: 'start', key: 'info.session', maxWidth: '10' }, { title: 'сессии', align: 'start', key: 'info.session', maxWidth: '10' },
{ title: 'Страницы', align: 'start', key: 'info.pages', maxWidth: '10' }, { title: 'страницы', align: 'start', key: 'info.pages', maxWidth: '10' },
] ]
@@ -155,59 +162,6 @@ export default {
] ]
const desserts = [
{
user: {
login: "9966-00-001",
post: "Начальник инспекции",
fio: "Толоко Б.Б."
},
info: {
count: 253,
session: 4,
pages: 5
},
tooltip: [
{
namepages: "О портале",
count: 241,
unic: 3
}],
},
{
user: {
login: "9966-00-107",
post: "Старший специалист 1 разряда",
fio: "Гришина И.С."
},
info: {
count: 6010,
session: 21,
pages: 56
},
tooltip: [
{
namepages: "О портале",
count: 241,
unic: 3
},
{
namepages: "Портал МИ ФНС России по ЦОД №2",
count: 120,
unic: 27
},
],
},
]
@@ -223,14 +177,6 @@ export default {
else return 'red' else return 'red'
} }
const perpage =
[
{value: 10, title: '10'},
{value: 25, title: '25'},
{value: 50, title: '50'},
{value: 100, title: '100'},
{value: -1, title: 'лох'}
]
return { return {
@@ -238,11 +184,11 @@ export default {
spravURL, spravURL,
expanded, expanded,
dessertHeaders, dessertHeaders,
desserts,
subtable, subtable,
getColor, getColor,
getColor2, getColor2,
perpage
} }
} }
} }
@@ -252,4 +198,12 @@ export default {
.subtable .v-data-table-footer { .subtable .v-data-table-footer {
display: none display: none
} }
.subtable tbody {
text-align: start!important;
}
.table_top_user .v-data-table__td {
padding: 0!important;
}
</style> </style>
+2 -2
View File
@@ -23,7 +23,7 @@
</v-col> </v-col>
<v-col class="w100 "> <v-col class="w100 ">
<v-row no-gutters class="h-100 gap"> <v-row no-gutters class="h-100 gap">
<v-col lg=2 class="flex-column d-flex"> <v-col class="flex-column d-flex">
<v-row no-gutters class="flex-column gap" > <v-row no-gutters class="flex-column gap" >
<v-col v-for="x in dataIndicators" :key=x> <v-col v-for="x in dataIndicators" :key=x>
<card-total :indicator=x /> <card-total :indicator=x />
@@ -42,7 +42,7 @@
/> />
</v-col> </v-col>
<v-col class="d-flex flex-column"> <v-col lg=2 class="d-flex flex-column">
<feedmodul <feedmodul
:feedback="feedback" :feedback="feedback"
/> />