fix null in showing
Gitea Actions Demo / build_and_push (push) Successful in 1m20s
Details
Gitea Actions Demo / build_and_push (push) Successful in 1m20s
Details
This commit is contained in:
parent
3cbea181ec
commit
a158abb69f
|
|
@ -195,19 +195,20 @@ const chartOptions = {
|
||||||
callbacks: {
|
callbacks: {
|
||||||
label: function (context: any) {
|
label: function (context: any) {
|
||||||
currentCoordinates.value = lineCoordinates.value[context.dataIndex];
|
currentCoordinates.value = lineCoordinates.value[context.dataIndex];
|
||||||
let label = context.dataset.label || '';
|
let show_data = [];
|
||||||
|
if (data.value.datasets[0].data[context.dataIndex]) {
|
||||||
if (label) {
|
show_data.push("Скорость: " + Math.floor(data.value.datasets[0].data[context.dataIndex]));
|
||||||
label += ': ';
|
|
||||||
}
|
}
|
||||||
if (context.parsed.x !== null) {
|
if (data.value.datasets[1].data[context.dataIndex]) {
|
||||||
label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y);
|
show_data.push("Пульс: " + data.value.datasets[1].data[context.dataIndex]);
|
||||||
}
|
}
|
||||||
return ["Скорость: " + Math.floor(data.value.datasets[0].data[context.dataIndex]),
|
if (data.value.datasets[2].data[context.dataIndex]) {
|
||||||
"Пульс: " + data.value.datasets[1].data[context.dataIndex],
|
show_data.push("Мощность: " + data.value.datasets[2].data[context.dataIndex]);
|
||||||
"Мощность: " + data.value.datasets[2].data[context.dataIndex],
|
}
|
||||||
"Подъем: " + data.value.datasets[3].data[context.dataIndex],
|
if (Math.floor(data.value.datasets[3].data[context.dataIndex])) {
|
||||||
];
|
show_data.push("Подъем: " + Math.floor(data.value.datasets[3].data[context.dataIndex]));
|
||||||
|
}
|
||||||
|
return show_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@
|
||||||
<VaIcon name="delete_forever" size="22px" color="#bbc1c3" class="news-item-icon" @click="(event: any) => deleteItem(item.id, event)"/>
|
<VaIcon name="delete_forever" size="22px" color="#bbc1c3" class="news-item-icon" @click="(event: any) => deleteItem(item.id, event)"/>
|
||||||
</div>
|
</div>
|
||||||
<ul class="metadata">
|
<ul class="metadata">
|
||||||
<li><span>Скорость:</span> {{ speedConvert(item.speed) }} км/ч</li>
|
<li v-if="item.speed"><span>Скорость:</span> {{ speedConvert(item.speed) }} км/ч</li>
|
||||||
<li><span>Пульс:</span> {{ item.heart_rate }} уд /мин</li>
|
<li v-if="item.heart_rate"><span>Пульс:</span> {{ item.heart_rate }} уд /мин</li>
|
||||||
<li><span>Каденс:</span> {{ item.cadence }} об/мин</li>
|
<li v-if="item.cadence"><span>Каденс:</span> {{ item.cadence }} об/мин</li>
|
||||||
<li><span>Расстояние:</span> {{ distConvert(item.distantion) }} км</li>
|
<li v-if="item.distantion"><span>Расстояние:</span> {{ distConvert(item.distantion) }} км</li>
|
||||||
<li><span>Продолжительность:</span> {{ secondsToDuration(item.duraion_sec) }} </li>
|
<li v-if="item.duraion_sec"><span>Продолжительность:</span> {{ secondsToDuration(item.duraion_sec) }} </li>
|
||||||
<li><span>Мощность:</span> {{ Math.round(item.power) }} Вт</li>
|
<li v-if="item.power"><span>Мощность:</span> {{ Math.round(item.power) }} Вт</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="item.attachment"
|
<div v-if="item.attachment"
|
||||||
class="image-container"
|
class="image-container"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue