111111
This commit is contained in:
1 parent
9dc96dd514
commit
7c88054d2a
9 files changed
+175
-94
No files matched your search
@@ -95,7 +95,7 @@ export default {
|
|||||||
|
|
||||||
const sorted = Object.entries(topUser)
|
const sorted = Object.entries(topUser)
|
||||||
.sort(([,a],[,b]) => (b.comment.textarr.length - a.comment.textarr.length))
|
.sort(([,a],[,b]) => (b.comment.textarr.length - a.comment.textarr.length))
|
||||||
console.log(sorted[0],'-------------');
|
|
||||||
dataTopUser.value = sorted[0][1]
|
dataTopUser.value = sorted[0][1]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -149,11 +149,10 @@ export default {
|
|||||||
let data2 = moment(filterStore.date_period.startdate)
|
let data2 = moment(filterStore.date_period.startdate)
|
||||||
between.value = data1.diff(data2, 'days') + 1
|
between.value = data1.diff(data2, 'days') + 1
|
||||||
let res = null
|
let res = null
|
||||||
console.log("sdssdss");
|
|
||||||
if (Object.keys(props.dataLineChart).length>0){
|
if (Object.keys(props.dataLineChart).length>0){
|
||||||
res = arrlines
|
res = arrlines
|
||||||
res.labels=[]
|
res.labels=[]
|
||||||
// console.log(props.dataLineChart, 'uuuuuuuuuuuuuuuuuuuuuu');
|
|
||||||
for(let [key,val] of Object.entries(props.dataLineChart))
|
for(let [key,val] of Object.entries(props.dataLineChart))
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -166,7 +165,6 @@ export default {
|
|||||||
res.labels.push(formatComa(key))
|
res.labels.push(formatComa(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(fullper.value,"reeeeeeee"); // console.log(res, "kdjshskjhd");
|
|
||||||
}
|
}
|
||||||
// res.datasets[1].data=[]
|
// res.datasets[1].data=[]
|
||||||
|
|
||||||
@@ -175,7 +173,6 @@ export default {
|
|||||||
|
|
||||||
const fullper = ref([])
|
const fullper = ref([])
|
||||||
const fullpercreate = () => {
|
const fullpercreate = () => {
|
||||||
console.log(props.period, 'ddddddddddddd');
|
|
||||||
let arr = []
|
let arr = []
|
||||||
props.period.period.forEach((e) => {
|
props.period.period.forEach((e) => {
|
||||||
let ind = arr.findIndex(el => el.visitdate == e.visitdate)
|
let ind = arr.findIndex(el => el.visitdate == e.visitdate)
|
||||||
@@ -203,8 +200,6 @@ export default {
|
|||||||
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) < moment(new Date(date)).subtract(between.value, 'd')))
|
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) < moment(new Date(date)).subtract(between.value, 'd')))
|
||||||
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) < new Date(date)))
|
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) < new Date(date)))
|
||||||
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
||||||
// console.log(h);
|
|
||||||
console.log(baseunic, crrunic, bothuser, "date");
|
|
||||||
return parseFloat((bothuser.size*100/baseunic.size).toFixed(2))
|
return parseFloat((bothuser.size*100/baseunic.size).toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const arrforline=() => {
|
const arrforline=() => {
|
||||||
console.log(props.dataLineChart, 'props.dataLineChart');
|
|
||||||
Object.entries(props.dataLineChart).forEach(e => {
|
Object.entries(props.dataLineChart).forEach(e => {
|
||||||
const [key, value] = e
|
const [key, value] = e
|
||||||
arrlines.value.datasets[0].data.push(value.count)
|
arrlines.value.datasets[0].data.push(value.count)
|
||||||
@@ -160,7 +160,7 @@ export default {
|
|||||||
arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
|
arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(props.dataLineChart,'dataYear2 -------------');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -122,12 +122,6 @@ export default {
|
|||||||
return acc
|
return acc
|
||||||
}, res.period.previos)
|
}, res.period.previos)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.log(between, 'props.alldata')
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,46 +4,31 @@
|
|||||||
:ico="'mdi-chart-bar'"
|
:ico="'mdi-chart-bar'"
|
||||||
>
|
>
|
||||||
<template v-slot:filling>
|
<template v-slot:filling>
|
||||||
<v-table
|
<v-data-table-virtual
|
||||||
fixed-header
|
:headers="headers"
|
||||||
density="comfortable"
|
:items="tabledata"
|
||||||
hover
|
height="400"
|
||||||
class="cursor-default h-0 text-caption"
|
item-value="name"
|
||||||
|
@update:sortBy=customSort
|
||||||
|
v-model:sort-by="sortBy"
|
||||||
>
|
>
|
||||||
<thead>
|
<template v-slot:header.name>
|
||||||
<tr>
|
<v-switch label="Всего"
|
||||||
<th class="pl-1">
|
false-value='unic'
|
||||||
<v-switch
|
true-value='total'
|
||||||
v-model="modelrating"
|
v-model="untot"></v-switch>
|
||||||
hide-details
|
</template>
|
||||||
|
<template v-slot:item.now="{ value, item }">
|
||||||
|
|
||||||
:label="modelrating?'Уникальные':'Всего'"
|
<span class="font-weight-medium text-subtitle-2">
|
||||||
color="teal-darken-4"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</th>
|
|
||||||
<th class="text-center"> сегодня </th>
|
|
||||||
<th class="text-center"> за период </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>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr
|
|
||||||
v-for="(val, key) in pages_count.data"
|
|
||||||
:key="key"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<td class="text-left ">{{key}}</td>
|
|
||||||
<td >
|
|
||||||
<v-tooltip
|
<v-tooltip
|
||||||
v-if="val.now.unique.length>0"
|
v-if="value>0"
|
||||||
location="bottom"
|
location="bottom"
|
||||||
>
|
>
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<span v-bind="props" class="cursor-help font-weight-medium text-subtitle-2" :class="getColorNow(modelrating?val.now.unique.length:val.now.countall) ">
|
<span v-bind="props" class="cursor-help font-weight-medium text-subtitle-2" >
|
||||||
{{modelrating?val.now.unique.length:val.now.countall}}
|
{{value}} <!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<v-row
|
<v-row
|
||||||
@@ -51,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-row
|
<v-row
|
||||||
no-gutters v-for="n in val.now.unique"
|
no-gutters v-for="n in item.now.unic"
|
||||||
:key="n"
|
:key="n"
|
||||||
>
|
>
|
||||||
<v-col>
|
<v-col>
|
||||||
@@ -60,22 +45,21 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
<span class='font-weight-regular text-subtitle-2' v-else>
|
|
||||||
0
|
|
||||||
</span>
|
</span>
|
||||||
</td>
|
|
||||||
<td>
|
</template>
|
||||||
|
<template v-slot:item.period="{ value, item }">
|
||||||
|
<span class="font-weight-medium text-subtitle-2">
|
||||||
<v-tooltip
|
<v-tooltip
|
||||||
v-if="val.year.unique.length>0"
|
v-if="value>0"
|
||||||
location="bottom"
|
location="bottom"
|
||||||
>
|
>
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<span
|
<span v-bind="props" class="cursor-help font-weight-medium text-subtitle-2" >
|
||||||
v-bind="props"
|
{{value}} <!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
||||||
class="cursor-help font-weight-medium text-subtitle-2"
|
|
||||||
:class="modelrating?getColorNow(val.year.unique.length):getColorAll(val.year.countall)">
|
|
||||||
{{modelrating?val.year.unique.length:val.year.countall}}
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<v-row
|
<v-row
|
||||||
@@ -83,7 +67,7 @@
|
|||||||
>
|
>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-row
|
<v-row
|
||||||
no-gutters v-for="n in val.year.unique"
|
no-gutters v-for="n in item.period.unic"
|
||||||
:key="n"
|
:key="n"
|
||||||
>
|
>
|
||||||
<v-col>
|
<v-col>
|
||||||
@@ -92,35 +76,99 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
<span class='font-weight-regular text-subtitle-2' v-else>
|
|
||||||
0
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</td>
|
</template>
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</v-table>
|
|
||||||
|
|
||||||
|
</v-data-table-virtual>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</pattern-card>
|
</pattern-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
||||||
import TooltipText from '@/components/UI/tooltip-text.vue'
|
import TooltipText from '@/components/UI/tooltip-text.vue'
|
||||||
|
import {splitname, checking_for_entry, formatDash} from '@/utils/universal_functions'
|
||||||
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { TooltipText, PatternCard },
|
components: { TooltipText, PatternCard },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
pages_count: {
|
pages_count: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => {}
|
default: () => [],
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setup() {
|
setup(props) {
|
||||||
|
|
||||||
|
const sortBy = ref([
|
||||||
|
{
|
||||||
|
"key": "now",
|
||||||
|
"order": "desc"
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
const untot=ref('unic')
|
||||||
|
let headers = ref([
|
||||||
|
{ title: '', align: 'start', key: 'name' },
|
||||||
|
{ title: 'сегодня', align: 'center', key: 'now',
|
||||||
|
value: item => `${untot.value=='unic'?item.now.unic.size:item.now.total}`,
|
||||||
|
},
|
||||||
|
{ title: 'за период', align: 'center', key: 'period',
|
||||||
|
value: item => `${untot.value=='unic'?item.period.unic.size:item.period.total}` },
|
||||||
|
])
|
||||||
|
|
||||||
|
const datas = ()=>{
|
||||||
|
|
||||||
|
let data = []
|
||||||
|
props.pages_count.forEach((e) => {
|
||||||
|
console.log(e.visitdate == moment().format("YYYY-MM-DD"));
|
||||||
|
let ind = data.findIndex(el=>el.name==e.pages)
|
||||||
|
if(ind==-1){
|
||||||
|
let ob = {name:e.pages, now:{unic:new Set(),total:0}, period:{unic:new Set(),total:0}}
|
||||||
|
if (e.visitdate == formatDash(new Date())){
|
||||||
|
ob.now.unic.add(splitname(e.user))
|
||||||
|
ob.now.total = e.count
|
||||||
|
|
||||||
|
}
|
||||||
|
ob.period.unic.add(splitname(e.user))
|
||||||
|
ob.period.total = e.count
|
||||||
|
data.push(ob)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if (e.visitdate == formatDash(new Date())){
|
||||||
|
data[ind].now.unic.add(splitname(e.user))
|
||||||
|
data[ind].now.total +=e.count
|
||||||
|
}
|
||||||
|
|
||||||
|
data[ind].period.unic.add(splitname(e.user))
|
||||||
|
data[ind].period.total +=e.count
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const modelrating = ref(false)
|
const modelrating = ref(false)
|
||||||
|
|
||||||
const getColorAll = (pages) => {
|
const getColorAll = (pages) => {
|
||||||
@@ -136,10 +184,49 @@ export default {
|
|||||||
else return 'text-red'
|
else return 'text-red'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const customSort= ()=> {
|
||||||
|
let arr=tabledata.value
|
||||||
|
console.log(sortBy.value,"error");
|
||||||
|
if (sortBy.value!==undefined && sortBy.value.length>0){
|
||||||
|
let factor=sortBy.value[0].order=='desc'?[-1,1]:[1,-1]
|
||||||
|
if (untot.value=='unic'){
|
||||||
|
arr.sort((a,b)=>{
|
||||||
|
|
||||||
|
if (a[sortBy.value[0].key].unic.size>b[sortBy.value[0].key].unic.size) return factor[0]
|
||||||
|
if (a[sortBy.value[0].key].unic.size<b[sortBy.value[0].key].unic.size) return factor[1]
|
||||||
|
return 0 })
|
||||||
|
}else{
|
||||||
|
arr.sort((a,b)=>{
|
||||||
|
|
||||||
|
if (a[sortBy.value[0].key].total>b[sortBy.value[0].key].total) return factor[0]
|
||||||
|
if (a[sortBy.value[0].key].total<b[sortBy.value[0].key].total) return factor[1]
|
||||||
|
return 0 })
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tabledata.value=arr
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const tabledata = ref(datas())
|
||||||
|
watch(()=>props.pages_count,(newValue)=>{
|
||||||
|
if (newValue!==[]){
|
||||||
|
tabledata.value=datas()
|
||||||
|
customSort()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// tabledata.value=datas.value
|
||||||
return {
|
return {
|
||||||
|
tabledata,
|
||||||
|
sortBy,
|
||||||
|
customSort,
|
||||||
|
untot,
|
||||||
modelrating,
|
modelrating,
|
||||||
getColorAll,
|
getColorAll,
|
||||||
getColorNow
|
getColorNow,
|
||||||
|
headers,
|
||||||
|
datas
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,6 @@
|
|||||||
|
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col >
|
|
||||||
<v-btn block class="text-caption" @click="filter='y'">Год</v-btn>
|
|
||||||
<v-btn block class="text-caption" @click="filter='m'">Месяц</v-btn>
|
|
||||||
<v-btn block class="text-caption" @click="filter='d'">День</v-btn>
|
|
||||||
|
|
||||||
{{filter}}
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="w100 ">
|
<v-col class="w100 ">
|
||||||
@@ -41,16 +34,13 @@
|
|||||||
<v-row no-gutters class="h-100 gap">
|
<v-row no-gutters class="h-100 gap">
|
||||||
<v-col 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" >
|
||||||
<my-helper :pretext="alldata.beforperiod"/>
|
|
||||||
<my-helper :pretext="alldata.period"/>
|
|
||||||
<v-col v-for="x in cardtotal" :key=x>
|
<v-col v-for="x in cardtotal" :key=x>
|
||||||
<card-total :indicator=x />
|
<card-total :indicator=x />
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col lg=4 class="d-flex flex-column">
|
<v-col lg=4 class="d-flex flex-column">
|
||||||
<!-- <rating-page :pages_count=pages_count /> -->
|
<rating-page :pages_count=alldata.period />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col lg=4 class="d-flex flex-column ">
|
<v-col lg=4 class="d-flex flex-column ">
|
||||||
|
|
||||||
@@ -75,7 +65,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
|
||||||
import {pagecounter, splitname, formatComa, formatDash} from '@/utils/universal_functions'
|
import {pagecounter, splitname, formatComa, formatDash, checking_for_entry} from '@/utils/universal_functions'
|
||||||
|
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
||||||
@@ -131,6 +121,11 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const filterStore = usePortalFilterStore()
|
const filterStore = usePortalFilterStore()
|
||||||
const alldata =ref({period: [], staff: 0, beforperiod: []})
|
const alldata =ref({period: [], staff: 0, beforperiod: []})
|
||||||
const visition = () => {
|
const visition = () => {
|
||||||
@@ -138,7 +133,7 @@ setup(){
|
|||||||
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||||
|
|
||||||
alldata.value = preparedata(result.data)
|
alldata.value = preparedata(result.data)
|
||||||
console.log(result.data, 'result.data');
|
// console.log(result.data, 'result.data');
|
||||||
totalfn()
|
totalfn()
|
||||||
|
|
||||||
|
|
||||||
@@ -168,12 +163,17 @@ setup(){
|
|||||||
|
|
||||||
let periodusers = new Set([])
|
let periodusers = new Set([])
|
||||||
let brdata = {}
|
let brdata = {}
|
||||||
|
|
||||||
let filtr = alldata.value.period
|
let filtr = alldata.value.period
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (formatDash(filterStore.date_period.enddate) !=formatDash(new Date())) {
|
if (formatDash(filterStore.date_period.enddate) !=formatDash(new Date())) {
|
||||||
filtr = filtr.filter(e => e.visitdate != formatDash(new Date()))
|
filtr = filtr.filter(e => e.visitdate != formatDash(new Date()))
|
||||||
}
|
}
|
||||||
|
|
||||||
filtr.forEach((e) => {
|
filtr.forEach((e) => {
|
||||||
|
|
||||||
periodusers.add(e.user.id)
|
periodusers.add(e.user.id)
|
||||||
if (!brdata[e.visitdate]) {
|
if (!brdata[e.visitdate]) {
|
||||||
brdata[e.visitdate] = {}
|
brdata[e.visitdate] = {}
|
||||||
@@ -184,17 +184,18 @@ setup(){
|
|||||||
brdata[e.visitdate][user] = []
|
brdata[e.visitdate][user] = []
|
||||||
}
|
}
|
||||||
brdata[e.visitdate][user].push({page:e.fullPath, total:e.count})
|
brdata[e.visitdate][user].push({page:e.fullPath, total:e.count})
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
let traffic ={}
|
let traffic ={}
|
||||||
// console.log(brdata, 'brdatabrdatabrdata')
|
|
||||||
for (let [key, val] of Object.entries(brdata)) {
|
for (let [key, val] of Object.entries(brdata)) {
|
||||||
traffic[key] ={unic: Object.keys(val), count: 0, br:0, pages: 0}
|
traffic[key] ={unic: Object.keys(val), count: 0, br:0, pages: 0}
|
||||||
|
|
||||||
let arr = Object.values(val)
|
let arr = Object.values(val)
|
||||||
traffic[key].br = arr.filter(e=>e.length==1).length
|
traffic[key].br = arr.filter(e=>e.length==1).length
|
||||||
arr.forEach(e=> traffic[key].pages += e.length)
|
arr.forEach(e=> traffic[key].pages += e.length)
|
||||||
// traffic[key].pages += arr
|
|
||||||
arr.flat().reduce((acc, item) => {
|
arr.flat().reduce((acc, item) => {
|
||||||
|
|
||||||
traffic[key].count +=item.total
|
traffic[key].count +=item.total
|
||||||
@@ -204,7 +205,7 @@ setup(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(brdata,'33333333333333');
|
||||||
let bothuser = new Set([...periodusers].filter(element => beforperiodusers.has(element)))
|
let bothuser = new Set([...periodusers].filter(element => beforperiodusers.has(element)))
|
||||||
cardtotal.value.crr.data = bothuser.size*100/beforperiodusers.size
|
cardtotal.value.crr.data = bothuser.size*100/beforperiodusers.size
|
||||||
sumtraffic(traffic)
|
sumtraffic(traffic)
|
||||||
@@ -212,7 +213,7 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sumtraffic= (data) => {
|
const sumtraffic= (data) => {
|
||||||
console.log(data, 'traffic');
|
|
||||||
let ob = {brtot:0, ppvtot: 0, unictot: 0, pagetot: 0}
|
let ob = {brtot:0, ppvtot: 0, unictot: 0, pagetot: 0}
|
||||||
Object.values(data).flat().forEach((e) => {
|
Object.values(data).flat().forEach((e) => {
|
||||||
ob.brtot += e.br
|
ob.brtot += e.br
|
||||||
@@ -223,7 +224,7 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
)
|
)
|
||||||
console.log(ob.ppvtot, ob.unictot, 'xxxxxxxxxxxx');
|
|
||||||
cardtotal.value.br.data = ob.brtot/ob.unictot*100
|
cardtotal.value.br.data = ob.brtot/ob.unictot*100
|
||||||
cardtotal.value.ppv.data = ob.pagetot/ob.unictot
|
cardtotal.value.ppv.data = ob.pagetot/ob.unictot
|
||||||
|
|
||||||
@@ -252,7 +253,7 @@ setup(){
|
|||||||
// const pages_count = ref({data: {}, title: {}})
|
// const pages_count = ref({data: {}, title: {}})
|
||||||
|
|
||||||
|
|
||||||
// pagecounter()
|
// pagecounter()
|
||||||
|
|
||||||
// const visition = () => {
|
// const visition = () => {
|
||||||
|
|
||||||
@@ -493,6 +494,7 @@ setup(){
|
|||||||
alldata,
|
alldata,
|
||||||
cardtotal,
|
cardtotal,
|
||||||
dataLineChart,
|
dataLineChart,
|
||||||
|
|
||||||
// visiting,
|
// visiting,
|
||||||
// pages_count,
|
// pages_count,
|
||||||
// visitionreduce,
|
// visitionreduce,
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col lg=9>
|
<v-col lg=9>
|
||||||
|
|
||||||
<line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/>
|
<!-- <line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/> -->
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col >
|
<v-col >
|
||||||
<v-btn block class="text-caption" @click="filter='year'">Год</v-btn>
|
<v-btn block class="text-caption" @click="filter='year'">Год</v-btn>
|
||||||
<v-btn block class="text-caption" @click="filter='month'">Месяц</v-btn>
|
<v-btn block class="text-caption" @click="filter='month'">Месяц</v-btn>
|
||||||
<v-btn block class="text-caption" @click="filter='day'">День</v-btn>
|
<v-btn block class="text-caption" @click="filter='day'">День</v-btn>
|
||||||
<!-- ------------------------------------------------------------------------- -->
|
<!-- ------------------------------------------------------------------------- -->
|
||||||
<my-helper :pretext="dataLineChart"/>
|
<my-helper :pretext="dataActivusers"/>
|
||||||
{{filter}}
|
{{filter}}
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -169,8 +169,8 @@ class BirthdayText(models.Model):
|
|||||||
|
|
||||||
class Screensaver(models.Model):
|
class Screensaver(models.Model):
|
||||||
img = models.ImageField(upload_to='screengallery/%Y/%m/%d', null=True, verbose_name='Изображение')
|
img = models.ImageField(upload_to='screengallery/%Y/%m/%d', null=True, verbose_name='Изображение')
|
||||||
cdate =models.DateField(default=date.today().replace(year=1990), null=True, verbose_name='Дата начала периода')
|
cdate =models.DateField(default=date.today().replace(year=1992), null=True, verbose_name='Дата начала периода')
|
||||||
enddate = models.DateField(default= date.today().replace(year=1990), verbose_name='Дата окончания периода', null=True)
|
enddate = models.DateField(default= date.today().replace(year=1992), verbose_name='Дата окончания периода', null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
|
|||||||
@@ -182,5 +182,8 @@ class TestwatcherAPIView(ListAPIView):
|
|||||||
'beforperiod': res,
|
'beforperiod': res,
|
||||||
'period': PagesSerializer(per, many= True).data,
|
'period': PagesSerializer(per, many= True).data,
|
||||||
'staff': DictEmployee.objects.filter(Q(deleteddate__isnull= True) | Q(deleteddate__gte = request.GET.get("end"))).count()
|
'staff': DictEmployee.objects.filter(Q(deleteddate__isnull= True) | Q(deleteddate__gte = request.GET.get("end"))).count()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user