This commit is contained in:
iriska-gri committed 2024-02-29 17:05:00 +03:00
1 parent 5ac653d8f1
commit acc7176bfc
3 files changed
+14 -11

No files matched your search

@@ -4,7 +4,7 @@
<!-- <line-graph v-if="data!==null" :data="data" ref ='linear' :options="options"/> --> <!-- <line-graph v-if="data!==null" :data="data" ref ='linear' :options="options"/> -->
<Line v-if="data!==null" :data="data" ref ='linear' :options="options" /> <Line v-if="data!==null" :data="data" ref ='linear' :options="options" />
</v-card> </v-card>
</template> </template>
<script> <script>
@@ -164,7 +164,7 @@ export default {
res.labels.push(formatComa(key)) res.labels.push(formatComa(key))
} }
// console.log(res.labels,"datat");
} }
// res.datasets[1].data=[] // res.datasets[1].data=[]
@@ -185,7 +185,7 @@ export default {
} }
}) })
fullper.value= [...props.period.before, ...arr] fullper.value= [...props.period.before, ...arr]
} }
@@ -196,11 +196,16 @@ export default {
// const data = ref(datachanged.value) // const data = ref(datachanged.value)
const crrfunc = (date)=>{ 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 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 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)))
return parseFloat((bothuser.size*100/baseunic.size).toFixed(2)) console.log(bothuser,"currun");
return bothuser.size*100/baseunic.size
} }
const unicperson = (arr) => { const unicperson = (arr) => {
@@ -258,9 +263,7 @@ export default {
} }
}, },
y1: { y1: {
ticks: {
stepSize: 10
},
type: 'linear', type: 'linear',
display: true, display: true,
position: 'right', position: 'right',
@@ -45,7 +45,7 @@
:icon="val.previos<val.user.length?'mdi-arrow-up-bold':'mdi-arrow-down-bold'" :icon="val.previos<val.user.length?'mdi-arrow-up-bold':'mdi-arrow-down-bold'"
/> />
<!-- --> <!-- -->
{{parseFloat((100 - val.user.length * 100 /val.previos).toFixed(2))}} % {{parseFloat((val.user.length * 100 /val.previos).toFixed(2))-100}} %
</td> </td>
<td v-if="!val.previos"></td> <td v-if="!val.previos"></td>
</tr> </tr>
+3 -3
View File
@@ -12,12 +12,12 @@
<!-- v-else --> <!-- v-else -->
<v-row no-gutters class="flex-column gap ma-1" > <v-row no-gutters class="flex-column gap ma-1" >
<toolbar-filter/> <toolbar-filter/>
<v-col lg=3 class="w100"> <v-col lg=4 class="w100">
<v-row no-gutters class="h-100 gap"> <v-row no-gutters class="h-100 gap">
<v-col > <v-col lg=2>
<portal-traffic :alldata=alldata /> <portal-traffic :alldata=alldata />
</v-col> </v-col>
<v-col lg=9> <v-col lg=8>
<line-chart <line-chart