Популярные страницы
This commit is contained in:
1 parent
acc7176bfc
commit
ca052a8dbf
3 files changed
+136
-24
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<v-card class="h-100 ">
|
||||
<v-card class="h-100 pa-5">
|
||||
<!-- <line-graph v-if="data!==null" :data="data" ref ='linear' :options="options"/> -->
|
||||
<Line v-if="data!==null" :data="data" ref ='linear' :options="options" />
|
||||
</v-card>
|
||||
@@ -102,9 +102,9 @@ export default {
|
||||
borderWidth: 3,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
data: [],
|
||||
func: (val, key)=>{ return crrfunc(key)
|
||||
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))
|
||||
},
|
||||
hidden: true,
|
||||
|
||||
datakey: "crr",
|
||||
customlabel: [],
|
||||
tooltips: true,
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
// console.log(res.labels,"datat");
|
||||
}
|
||||
// res.datasets[1].data=[]
|
||||
|
||||
console.log(res,"reeeees");
|
||||
return res
|
||||
}})
|
||||
|
||||
@@ -196,16 +196,16 @@ export default {
|
||||
|
||||
// const data = ref(datachanged.value)
|
||||
const crrfunc = (date)=>{
|
||||
// console.log(fullper.value, 'fullper');
|
||||
//
|
||||
// let h = new Date('2024-01-20') >=moment(new Date(date)).subtract(between.value*2, '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 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 bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
||||
console.log(bothuser,"currun");
|
||||
return bothuser.size*100/baseunic.size
|
||||
console.log(baseunic.size,bothuser.size, 'fullper');
|
||||
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
||||
}
|
||||
|
||||
const unicperson = (arr) => {
|
||||
@@ -215,9 +215,24 @@ export default {
|
||||
return new Set(arrnew)
|
||||
}
|
||||
|
||||
const data=computed({get() {return JSON.parse(JSON.stringify(dataf.value))
|
||||
const data=computed({get() {
|
||||
|
||||
return JSON.parse(JSON.stringify(dataf.value))
|
||||
}
|
||||
})
|
||||
const linear=ref(null)
|
||||
|
||||
|
||||
|
||||
// watch(()=>data.value,()=>{
|
||||
// console.log(linear.value)
|
||||
// if(linear.value!==null) {
|
||||
|
||||
// console.log(linear.value.chart);
|
||||
// // linear.value.chart.destroy()
|
||||
// linear.value.chart.render(data.value, options)
|
||||
// }
|
||||
// }, {deep:true})
|
||||
|
||||
const options = {
|
||||
plugins: {
|
||||
@@ -275,6 +290,9 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// const arrforline=() => {
|
||||
// console.log(props.dataLineChart);
|
||||
// for (let [key, val] of Object.entries) {}
|
||||
@@ -291,7 +309,7 @@ export default {
|
||||
|
||||
// // console.log(props.dataLineChart,'dataYear2 -------------');
|
||||
// }
|
||||
// const linear=ref(null)
|
||||
|
||||
// watch(()=>props.dataLineChart,(newValue, oldValue)=>{
|
||||
// if (linear.value!==null) {
|
||||
// renderChart(data.value, options)
|
||||
@@ -302,7 +320,7 @@ export default {
|
||||
return {
|
||||
data,
|
||||
options,
|
||||
// linear
|
||||
linear
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<v-data-table-virtual
|
||||
v-model:expanded="expanded"
|
||||
:headers="dessertHeaders"
|
||||
:items="activusers"
|
||||
:items="dataActivusers"
|
||||
item-value="user.fio"
|
||||
show-expand
|
||||
|
||||
@@ -109,12 +109,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import { spravURL } from '@/utils/axios-api'
|
||||
import {checkremote} from '@/utils/universal_functions'
|
||||
import listUser from '@/components/UI//fiousercard/listUser.vue'
|
||||
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
||||
|
||||
import {splitname} from '@/utils/universal_functions'
|
||||
export default {
|
||||
components: {
|
||||
listUser,
|
||||
@@ -131,7 +131,40 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
setup() {
|
||||
setup(props) {
|
||||
|
||||
const dataActivusers = computed({
|
||||
get() {
|
||||
let res = []
|
||||
|
||||
props.activusers.forEach((e) => {
|
||||
|
||||
let ind = res.findIndex(el => el.user.id == e.user.id)
|
||||
if (ind == -1) {
|
||||
res.push({user: e.user,
|
||||
info: {
|
||||
count: e.count,
|
||||
session:new Set([e.visitdate]),
|
||||
pages: 1
|
||||
},
|
||||
tooltip: [{
|
||||
namegapes: e.pages,
|
||||
count: e.count,
|
||||
unic: 1
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// console.log(ind, 'e');
|
||||
})
|
||||
return res
|
||||
}
|
||||
})
|
||||
|
||||
const expanded = ref([])
|
||||
|
||||
@@ -191,7 +224,7 @@ export default {
|
||||
spravURL,
|
||||
expanded,
|
||||
dessertHeaders,
|
||||
|
||||
dataActivusers,
|
||||
subtable,
|
||||
getColor,
|
||||
getColor2,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<v-col lg=8>
|
||||
|
||||
<line-chart
|
||||
|
||||
:key = "`${filterStore.date_period.startdate}-${filterStore.date_period.enddate}`"
|
||||
:dataLineChart="dataLineChart"
|
||||
:period="{before:alldata.beforperiod,period:alldata.period}"
|
||||
:filter = filter
|
||||
@@ -30,7 +30,9 @@
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="w100 ">
|
||||
|
||||
<!-- -------------------------------------------------------------- -->
|
||||
<my-helper :pretext="alldata.period"/>
|
||||
<!-- -------------------------------------------------------------- -->
|
||||
<v-row no-gutters class="h-100 gap">
|
||||
<v-col class="flex-column d-flex">
|
||||
<v-row no-gutters class="flex-column gap" >
|
||||
@@ -44,10 +46,10 @@
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column ">
|
||||
|
||||
<!-- <top-user
|
||||
:activusers = dataActivusers
|
||||
<top-user
|
||||
:activusers = alldata.period
|
||||
|
||||
/> -->
|
||||
/>
|
||||
|
||||
</v-col>
|
||||
<v-col lg=2 class="d-flex flex-column">
|
||||
@@ -98,6 +100,64 @@ export default {
|
||||
|
||||
setup(){
|
||||
|
||||
const dataActivusers = [
|
||||
{
|
||||
"user": {
|
||||
"id": 107,
|
||||
"login": "9966-00-107",
|
||||
"post": "Старший специалист 1 разряда",
|
||||
"fio": "Гришина И.С."
|
||||
},
|
||||
"info": {
|
||||
"count": 8909,
|
||||
"session": 37,
|
||||
"pages": 90
|
||||
},
|
||||
"tooltip": [
|
||||
{
|
||||
"namepages": "О портале",
|
||||
"count": 8424,
|
||||
"unic": 35
|
||||
},
|
||||
{
|
||||
"namepages": "Портал МИ ФНС России по ЦОД №2",
|
||||
"count": 376,
|
||||
"unic": 24
|
||||
},
|
||||
{
|
||||
"namepages": "Отдел кадров и безопасности",
|
||||
"count": 11,
|
||||
"unic": 7
|
||||
},
|
||||
{
|
||||
"namepages": "Лента новостей",
|
||||
"count": 43,
|
||||
"unic": 8
|
||||
},
|
||||
{
|
||||
"namepages": "Об инспекции",
|
||||
"count": 22,
|
||||
"unic": 8
|
||||
},
|
||||
{
|
||||
"namepages": "Часто задаваемые вопросы",
|
||||
"count": 17,
|
||||
"unic": 2
|
||||
},
|
||||
{
|
||||
"namepages": "Безопасность",
|
||||
"count": 8,
|
||||
"unic": 2
|
||||
},
|
||||
{
|
||||
"namepages": "Разделы безопасности",
|
||||
"count": 8,
|
||||
"unic": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
const dataLineChart = ref({})
|
||||
const cardtotal = ref(
|
||||
{
|
||||
@@ -494,7 +554,7 @@ setup(){
|
||||
alldata,
|
||||
cardtotal,
|
||||
dataLineChart,
|
||||
|
||||
filterStore,
|
||||
// visiting,
|
||||
// pages_count,
|
||||
// visitionreduce,
|
||||
@@ -507,7 +567,8 @@ setup(){
|
||||
// dataIndicators,
|
||||
// dataChart,
|
||||
// feedback,
|
||||
filter: ref('d')
|
||||
filter: ref('d'),
|
||||
dataActivusers
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user