Добавлены данные для графика

This commit is contained in:
iriska-gri committed 2024-02-22 09:41:10 +03:00
1 parent 56a5f17857
commit c5aaad5dca
1 file changed
+16 -11
+16 -11
View File
@@ -18,7 +18,7 @@
</v-col> </v-col>
<v-col> <v-col>
<line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/> <!-- <line-chart :dataLineChart="dataLineChart" :dataChart="dataChart"/> -->
</v-col> </v-col>
</v-row> </v-row>
</v-col> </v-col>
@@ -172,15 +172,14 @@ setup(){
const groupUser = user.reduce((acc, item) => { const groupUser = user.reduce((acc, item) => {
if (item.visitdate <= formatDash(filterStore.date_period.enddate)) { if (item.visitdate <= formatDash(filterStore.date_period.enddate)) {
funyearpages(yearpages, item) funyearpages(yearpages, item)
checking_for_entry(pages, item.pages) checking_for_entry(pages, item.pages)
acc['id'] = item.author.id
acc['id'] = item.author.id acc['login'] = item.author.login
acc['login'] = item.author.login acc['post'] = item.author.post
acc['post'] = item.author.post acc['fio'] = splitname(item.author)
acc['fio'] = splitname(item.author) acc['count'] += item.count
acc['count'] += item.count acc['session'] = Object.keys(yearpages).length
acc['session'] = Object.keys(yearpages).length
} }
return acc return acc
}, {count: 0}) }, {count: 0})
@@ -253,7 +252,7 @@ setup(){
const groupedData = data.reduce((acc, item) => { const groupedData = data.reduce((acc, item) => {
if (!acc[item.pages]) { if (!acc[item.pages]) {
acc[item.pages] = { acc[item.pages] = {
now: now:
@@ -312,9 +311,15 @@ setup(){
pages_count.value.data= data_collection(visiting.value, lineCharts) pages_count.value.data= data_collection(visiting.value, lineCharts)
Object.entries(lineCharts).map(e=> {
lineCharts[e[0]].crr = dataChart.value[e[0]].crr
lineCharts[e[0]].br = dataChart.value[e[0]].br
lineCharts[e[0]].ppv = dataChart.value[e[0]].ppv
})
dataLineChart.value = lineCharts dataLineChart.value = lineCharts
} }
watch(()=>filterStore.date_period,(newValue,oldValue)=>{ watch(()=>filterStore.date_period,(newValue,oldValue)=>{