a
This commit is contained in:
1 parent
6144fa7df2
commit
a68fa255e4
2 files changed
+26
-18
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<v-card class="h-100">
|
||||
<v-card class="h-100 ">
|
||||
<line-graph :data="data" :options="options"/>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
},
|
||||
|
||||
setup(props, {emit}) {
|
||||
|
||||
|
||||
const arrlines = {}
|
||||
|
||||
const data = computed({
|
||||
@@ -151,23 +151,19 @@ export default {
|
||||
}
|
||||
|
||||
const arrforline=() => {
|
||||
// let datas =
|
||||
// props.visiting.reduce((acc, item) => {
|
||||
// if (!acc[item.visitdate]) {
|
||||
// acc[item.visitdate] = {unic: [], count: 0}
|
||||
// }
|
||||
// acc[item.visitdate]['count'] += item.count
|
||||
// if (!acc[item.visitdate]['unic'].includes(splitname(item.author)))
|
||||
// {
|
||||
// acc[item.visitdate]['unic'].push(splitname(item.author))
|
||||
|
||||
// }
|
||||
// return acc
|
||||
// }, {})
|
||||
let dataYear = {}
|
||||
|
||||
Object.entries(props.dataLineChart).forEach(e => {
|
||||
// console.log(e,' e');
|
||||
|
||||
const [key, value] = e
|
||||
console.log(value,' e');
|
||||
let year = dataYear[new Date(key).getFullYear()]
|
||||
if (!dataYear[year]) {
|
||||
dataYear[year] = {count: 0}}
|
||||
dataYear[year].count += value.count
|
||||
|
||||
|
||||
|
||||
arrlines.value.datasets[0].data.push(value.count)
|
||||
arrlines.value.datasets[1].data.push(value.unic.length)
|
||||
arrlines.value.datasets[2].data.push(value.crr)
|
||||
@@ -177,7 +173,9 @@ export default {
|
||||
arrlines.value.datasets[1].customlabel.push(props.dataLineChart[key].unic)
|
||||
})
|
||||
|
||||
console.log(dataYear);
|
||||
}
|
||||
|
||||
return {
|
||||
data,
|
||||
options,
|
||||
|
||||
@@ -13,13 +13,18 @@
|
||||
<toolbar-filter/>
|
||||
<v-col lg=3 class="w100">
|
||||
<v-row no-gutters class="h-100 gap">
|
||||
<v-col lg=3 >
|
||||
<v-col >
|
||||
<portal-traffic :traffic=dataAttendance />
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col lg=9>
|
||||
|
||||
<line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-btn>1</v-btn>
|
||||
<v-btn>2</v-btn>
|
||||
<v-btn>3</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="w100 ">
|
||||
@@ -310,6 +315,11 @@ setup(){
|
||||
|
||||
pages_count.value.data= data_collection(visiting.value, lineCharts)
|
||||
|
||||
const gruppitovka= () => {
|
||||
console.log(visiting.value, 'dataLineChart');
|
||||
}
|
||||
gruppitovka()
|
||||
|
||||
Object.entries(lineCharts).map(e=> {
|
||||
lineCharts[e[0]].crr = dataChart.value[e[0]].crr
|
||||
lineCharts[e[0]].br = dataChart.value[e[0]].br
|
||||
|
||||
Reference in new issue
Block a user