Таблица
This commit is contained in:
1 parent
29db3f3aba
commit
39e04e6841
4 files changed
+135
-28
No files matched your search
@@ -1,3 +1,5 @@
|
|||||||
|
[Общие работы по проекту](/COD2/PORTAL_COD2/projects/22)
|
||||||
|
|
||||||
# IS#26 Портал ЦОД-2
|
# IS#26 Портал ЦОД-2
|
||||||
|
|
||||||
Живет на 60м сервере. Тестовый отсутствует
|
Живет на 60м сервере. Тестовый отсутствует
|
||||||
|
|||||||
@@ -1,20 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<v-card class="text-center h-100 d-flex flex-column" >
|
||||||
|
<v-card-title>
|
||||||
|
<v-row no-gutters class="">
|
||||||
|
<v-col lg=2>
|
||||||
|
<v-switch
|
||||||
|
v-model="modelrating"
|
||||||
|
hide-details
|
||||||
|
density="comfortable"
|
||||||
|
:label="modelrating?'уникальные':'всего'"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="ml-n7 pt-2">
|
||||||
|
Рейтинг посещаемости страниц портала
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</v-card-title>
|
||||||
|
<v-divider/>
|
||||||
|
<v-row class=" overflow-auto h-0">
|
||||||
|
<v-col class="d-flex flex-column">
|
||||||
<v-table fixed-header
|
<v-table fixed-header
|
||||||
|
height="0"
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="text-uppercase">
|
<tr class="text-uppercase">
|
||||||
<th>Имя страницы</th>
|
<th>Имя страницы
|
||||||
<!-- <th class="text-center"> на {{selected_days.today}} </th> -->
|
|
||||||
<th class="text-center">за период</th>
|
</th>
|
||||||
|
<th class="text-center"> на {{pages_count.title.today}} </th>
|
||||||
|
<th class="text-center">с {{pages_count.title.year.start}} по {{pages_count.title.year.end}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="x in 9" :key="x">
|
<tr v-for="(val, key) in pages_count.data" :key="key">
|
||||||
<td>{{x}}</td>
|
<td>{{key}} </td>
|
||||||
|
|
||||||
|
<td-tooltip :lines = val.now.unique />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- <tr v-for="(val, key) in pages_count" :key = key>
|
<!-- <tr v-for="(val, key) in pages_count" :key = key>
|
||||||
<td class="text-left">{{key}}</td> -->
|
<td class="text-left">{{key}}</td> -->
|
||||||
<!-- <td class="text-center">{{ modelrating?val.now.unique.size:val.now.countall }} </td>
|
<!-- <td class="text-center">{{ modelrating?val.now.unique.size:val.now.countall }} </td>
|
||||||
@@ -23,14 +50,40 @@
|
|||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import tdTooltip from '@/components/UI/td-tooltip.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
components: { tdTooltip },
|
||||||
|
|
||||||
|
props: {
|
||||||
|
pages_count: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
const modelrating = ref(false)
|
||||||
|
|
||||||
|
return {
|
||||||
|
modelrating
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.v-table {
|
||||||
|
flex: 1!important;
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<td>
|
||||||
|
<v-tooltip
|
||||||
|
location="bottom"
|
||||||
|
v-if="lines.length>0"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<span v-bind="props">
|
||||||
|
{{lines.length}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<v-row
|
||||||
|
no-gutters v-for="n in lines"
|
||||||
|
:key="n">
|
||||||
|
<v-col>
|
||||||
|
{{n}}
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tooltip>
|
||||||
|
<span v-else>
|
||||||
|
0
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
lines: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
visiting- (все данные)
|
visiting- (все данные)
|
||||||
<my-helper :pretext="pages_count"/>
|
<my-helper :pretext="pages_count"/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col lg=5 class="bg-red">
|
<v-col lg=5 class="bg-red d-flex flex-column">
|
||||||
<rating-page/>
|
<rating-page :pages_count=pages_count />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="bg-yellow">3 </v-col>
|
<v-col class="bg-yellow">3 </v-col>
|
||||||
<v-col class="bg-red">4 </v-col>
|
<v-col class="bg-red">4 </v-col>
|
||||||
@@ -216,7 +216,8 @@ setup(){
|
|||||||
const dataLineChart = ref({})
|
const dataLineChart = ref({})
|
||||||
|
|
||||||
const previous = ref({start: new Date(), end: new Date()})
|
const previous = ref({start: new Date(), end: new Date()})
|
||||||
const pages_count = ref({})
|
const selected_days = ref({today: new Date(), year: {start: new Date(), end: new Date()}})
|
||||||
|
const pages_count = ref({data: {}, title: {}})
|
||||||
|
|
||||||
const previous_period =() => {
|
const previous_period =() => {
|
||||||
let days_between = Math.floor((new Date(filterStore.date_period.enddate) - new Date(filterStore.date_period.startdate)) / (1000*60*60*24))
|
let days_between = Math.floor((new Date(filterStore.date_period.enddate) - new Date(filterStore.date_period.startdate)) / (1000*60*60*24))
|
||||||
@@ -264,6 +265,14 @@ setup(){
|
|||||||
// percentage_period: 0
|
// percentage_period: 0
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
const checking_for_entry = (where, what) => {
|
||||||
|
if (!where.includes(what))
|
||||||
|
{
|
||||||
|
where.push(what)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const groupedData = visiting.value.reduce((acc, item) => {
|
const groupedData = visiting.value.reduce((acc, item) => {
|
||||||
|
|
||||||
// Данные для графика по фильтру
|
// Данные для графика по фильтру
|
||||||
@@ -274,28 +283,25 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
lineCharts[item.visitdate]['count'] +=item.count
|
lineCharts[item.visitdate]['count'] +=item.count
|
||||||
if (!lineCharts[item.visitdate]['unic'].includes(splitname(item.author)))
|
checking_for_entry(lineCharts[item.visitdate]['unic'], splitname(item.author))
|
||||||
{
|
|
||||||
lineCharts[item.visitdate]['unic'].push(splitname(item.author))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Данные для таблицы по страницам
|
// Данные для таблицы по страницам
|
||||||
if (!acc[item.pages]) {
|
if (!acc[item.pages]) {
|
||||||
acc[item.pages] = {
|
acc[item.pages] = {
|
||||||
now:
|
now:
|
||||||
{unique: new Set(), countall: 0},
|
{unique: [], countall: 0},
|
||||||
year:
|
year:
|
||||||
{unique: new Set(), countall: 0}
|
{unique: [], countall: 0}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
checking_for_entry(acc[item.pages].year.unique, splitname(item.author))
|
||||||
acc[item.pages].year.unique.add(splitname(item.author))
|
|
||||||
acc[item.pages].year.countall += item.count
|
acc[item.pages].year.countall += item.count
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.visitdate == format2(filterStore.date_period.enddate)) {
|
if (item.visitdate == format2(filterStore.date_period.enddate)) {
|
||||||
acc[item.pages].now.unique.add(splitname(item.author))
|
checking_for_entry(acc[item.pages].now.unique, splitname(item.author))
|
||||||
acc[item.pages].now.countall += item.count
|
acc[item.pages].now.countall += item.count
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,10 +320,11 @@ setup(){
|
|||||||
watch(()=>filterStore.date_period,(newValue,oldValue)=>{
|
watch(()=>filterStore.date_period,(newValue,oldValue)=>{
|
||||||
if(newValue){
|
if(newValue){
|
||||||
visitionreduce()
|
visitionreduce()
|
||||||
|
title_period()
|
||||||
}
|
}
|
||||||
}, {deep:true})
|
}, {deep:true})
|
||||||
|
|
||||||
pages_count.value = groupedData
|
pages_count.value.data = groupedData
|
||||||
|
|
||||||
|
|
||||||
return groupedData
|
return groupedData
|
||||||
@@ -325,7 +332,17 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const title_period = () => {
|
||||||
|
selected_days.value.today = 'сегодня'
|
||||||
|
if (format2(new Date()) != format2(filterStore.date_period.enddate)) {
|
||||||
|
selected_days.value.today = format1(filterStore.date_period.enddate)
|
||||||
|
}
|
||||||
|
selected_days.value.year.start = format1(filterStore.date_period.startdate)
|
||||||
|
selected_days.value.year.end = format1(filterStore.date_period.enddate)
|
||||||
|
pages_count.value.title = selected_days.value
|
||||||
|
}
|
||||||
|
|
||||||
|
title_period()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -335,7 +352,8 @@ setup(){
|
|||||||
visitionreduce,
|
visitionreduce,
|
||||||
dataLineChart,
|
dataLineChart,
|
||||||
previous,
|
previous,
|
||||||
format1
|
format1,
|
||||||
|
selected_days
|
||||||
// countgrupp,
|
// countgrupp,
|
||||||
// activuser,
|
// activuser,
|
||||||
|
|
||||||
@@ -355,7 +373,7 @@ setup(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
// const pages_count = ref({})
|
// const pages_count = ref({})
|
||||||
// const selected_days = ref({today: '', year: ''})
|
|
||||||
// const traffic = ref({
|
// const traffic = ref({
|
||||||
// now: {
|
// now: {
|
||||||
// title: '',
|
// title: '',
|
||||||
@@ -406,13 +424,7 @@ setup(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const periodname = () => {
|
|
||||||
// selected_days.value.today = 'сегодня'
|
|
||||||
// if (format2(new Date()) != format2(enddate.value)) {
|
|
||||||
// selected_days.value.today = format1(enddate.value)
|
|
||||||
// }
|
|
||||||
// selected_days.value.year = [format1(startdate.value), format1(enddate.value)]
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user