2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2021-07-14 04:50:06 +00:00
|
|
|
<div
|
|
|
|
class="small-2 report-card"
|
|
|
|
:class="{ active: selected }"
|
|
|
|
@click="onClick(index)"
|
|
|
|
>
|
|
|
|
<h3 class="heading">
|
2022-03-28 07:38:23 +00:00
|
|
|
<span>{{ heading }}</span>
|
|
|
|
<fluent-icon
|
|
|
|
v-if="infoText"
|
|
|
|
v-tooltip="infoText"
|
|
|
|
size="14"
|
|
|
|
icon="info"
|
|
|
|
class="info-icon"
|
|
|
|
/>
|
2021-07-14 04:50:06 +00:00
|
|
|
</h3>
|
2022-03-14 12:45:27 +00:00
|
|
|
<div class="metric-wrap">
|
|
|
|
<h4 class="metric">
|
|
|
|
{{ point }}
|
|
|
|
</h4>
|
|
|
|
<span v-if="trend !== 0" :class="trendClass">{{ trendValue }}</span>
|
|
|
|
</div>
|
2021-07-14 04:50:06 +00:00
|
|
|
<p class="desc">
|
|
|
|
{{ desc }}
|
|
|
|
</p>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-12-27 08:19:31 +00:00
|
|
|
heading: { type: String, default: '' },
|
2022-03-28 07:38:23 +00:00
|
|
|
infoText: { type: String, default: '' },
|
2021-12-27 08:19:31 +00:00
|
|
|
point: { type: [Number, String], default: '' },
|
2022-03-14 12:45:27 +00:00
|
|
|
trend: { type: Number, default: null },
|
2021-12-27 08:19:31 +00:00
|
|
|
index: { type: Number, default: null },
|
|
|
|
desc: { type: String, default: '' },
|
2019-08-14 09:48:44 +00:00
|
|
|
selected: Boolean,
|
2021-12-27 08:19:31 +00:00
|
|
|
onClick: { type: Function, default: () => {} },
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
2022-03-14 12:45:27 +00:00
|
|
|
computed: {
|
|
|
|
trendClass() {
|
|
|
|
if (this.trend > 0) {
|
|
|
|
return 'metric-trend metric-up';
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'metric-trend metric-down';
|
|
|
|
},
|
|
|
|
trendValue() {
|
|
|
|
if (this.trend > 0) {
|
|
|
|
return `+${this.trend}%`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return `${this.trend}%`;
|
|
|
|
},
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
};
|
|
|
|
</script>
|