рейтинг
This commit is contained in:
1 parent
ed7da81b23
commit
98825f27c9
1 file changed
+39
-12
@@ -16,10 +16,15 @@
|
|||||||
>
|
>
|
||||||
<template v-slot:header.name>
|
<template v-slot:header.name>
|
||||||
<!-- <my-helper :pretext="tabledata"/> -->
|
<!-- <my-helper :pretext="tabledata"/> -->
|
||||||
<v-switch label="Всего"
|
<v-switch
|
||||||
false-value='unic'
|
:label="untot"
|
||||||
true-value='total'
|
false-value='уникальные'
|
||||||
v-model="untot"></v-switch>
|
true-value='всего'
|
||||||
|
hide-details
|
||||||
|
v-model="untot"
|
||||||
|
class="myleft ml-n4"
|
||||||
|
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:item.name="{ value }">
|
<template v-slot:item.name="{ value }">
|
||||||
<span class="font-weight-medium text-grey-darken-3 myleft text-subtitle-1">
|
<span class="font-weight-medium text-grey-darken-3 myleft text-subtitle-1">
|
||||||
@@ -35,7 +40,7 @@
|
|||||||
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-1 " >
|
<span v-bind="props" :class="'untot'=='уникальные'?getColorTooday1(value):getColorTooday2(value) " class="cursor-help font-weight-medium text-subtitle-1 " >
|
||||||
{{value}}
|
{{value}}
|
||||||
<!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
<!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
||||||
</span>
|
</span>
|
||||||
@@ -67,7 +72,7 @@
|
|||||||
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-1" >
|
<span v-bind="props" :class="'untot'=='уникальные'?getColorPeriod1(value):getColorPeriod2(value)" class="cursor-help font-weight-medium text-subtitle-1" >
|
||||||
{{value}}
|
{{value}}
|
||||||
<!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
<!-- {{modelrating?val.now.unique.length:val.now.countall}} -->
|
||||||
</span>
|
</span>
|
||||||
@@ -129,14 +134,14 @@ export default {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const untot=ref('unic')
|
const untot=ref('уникальные')
|
||||||
let headers = ref([
|
let headers = ref([
|
||||||
{ title: '', align: 'start', key: 'name' },
|
{ title: '', align: 'start', key: 'name' },
|
||||||
{ title: 'сегодня', align: 'center', key: 'now',
|
{ title: 'сегодня', align: 'center', key: 'now',
|
||||||
value: item => `${untot.value=='unic'?item.now.unic.size:item.now.total}`,
|
value: item => `${untot.value=='уникальные'?item.now.unic.size:item.now.total}`,
|
||||||
},
|
},
|
||||||
{ title: 'за период', align: 'center', key: 'period',
|
{ title: 'за период', align: 'center', key: 'period',
|
||||||
value: item => `${untot.value=='unic'?item.period.unic.size:item.period.total}` },
|
value: item => `${untot.value=='уникальные'?item.period.unic.size:item.period.total}` },
|
||||||
])
|
])
|
||||||
|
|
||||||
const datas = ()=>{
|
const datas = ()=>{
|
||||||
@@ -181,8 +186,27 @@ export default {
|
|||||||
|
|
||||||
const modelrating = ref(false)
|
const modelrating = ref(false)
|
||||||
|
|
||||||
const getColorAll = (pages) => {
|
const getColorTooday1 = (pages) => {
|
||||||
|
if (pages > 10) return 'text-green'
|
||||||
|
else if (pages > 5) return 'text-orange'
|
||||||
|
else return 'text-red'
|
||||||
|
}
|
||||||
|
|
||||||
|
const getColorPeriod1 = (pages) => {
|
||||||
|
console.log(pages, 'ssssssssssssssssssssssssssssssss');
|
||||||
|
if (pages > 30) return 'text-green'
|
||||||
|
else if (pages > 15) return 'text-orange'
|
||||||
|
else return 'text-red'
|
||||||
|
}
|
||||||
|
|
||||||
|
const getColorTooday2 = (pages) => {
|
||||||
|
if (pages > 50) return 'text-green'
|
||||||
|
else if (pages > 25) return 'text-orange'
|
||||||
|
else return 'text-red'
|
||||||
|
}
|
||||||
|
|
||||||
|
const getColorPeriod2 = (pages) => {
|
||||||
|
console.log(pages, 'ssssssssssssssssssssssssssssssss');
|
||||||
if (pages > 100) return 'text-green'
|
if (pages > 100) return 'text-green'
|
||||||
else if (pages > 50) return 'text-orange'
|
else if (pages > 50) return 'text-orange'
|
||||||
else return 'text-red'
|
else return 'text-red'
|
||||||
@@ -199,7 +223,7 @@ export default {
|
|||||||
|
|
||||||
if (sortBy.value!==undefined && sortBy.value.length>0){
|
if (sortBy.value!==undefined && sortBy.value.length>0){
|
||||||
let factor=sortBy.value[0].order=='desc'?[-1,1]:[1,-1]
|
let factor=sortBy.value[0].order=='desc'?[-1,1]:[1,-1]
|
||||||
if (untot.value=='unic'){
|
if (untot.value=='уникальные'){
|
||||||
arr.sort((a,b)=>{
|
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[0]
|
||||||
@@ -232,7 +256,10 @@ export default {
|
|||||||
customSort,
|
customSort,
|
||||||
untot,
|
untot,
|
||||||
modelrating,
|
modelrating,
|
||||||
getColorAll,
|
getColorTooday1,
|
||||||
|
getColorPeriod1,
|
||||||
|
getColorTooday2,
|
||||||
|
getColorPeriod2,
|
||||||
getColorNow,
|
getColorNow,
|
||||||
headers,
|
headers,
|
||||||
datas
|
datas
|
||||||
|
|||||||
Reference in new issue
Block a user