cosmos-explorer/src/views/SummaryParmetersComponent.vue

117 lines
2.8 KiB
Vue
Raw Normal View History

2021-08-03 12:07:55 +00:00
<template>
<b-card
v-if="data"
no-body
:class="`card-statistics ${data.class} `"
>
<b-card-header>
<b-card-title>{{ data.title }}</b-card-title>
</b-card-header>
<b-card-body class="statistics-body">
<b-row>
<b-col
v-for="item in data.items"
:key="item.icon"
xl="3"
md="6"
sm="6"
:class="item.customClass"
>
2021-08-06 13:21:08 +00:00
<div
v-if="typeof item.title ==='object'"
>
<b-button
:id="item.subtitle"
variant="outline-primary"
class="ml-2"
size="sm"
>
{{ item.subtitle }}
</b-button>
<b-popover
:target="item.subtitle"
variant="primary"
triggers="hover"
placement="bottom"
>
<template #title>
<span>{{ item.subtitle }}</span>
</template>
<span>
<array-field-component
v-if="Array.isArray(item.title)"
:tablefield="item.title"
/>
<object-field-component
v-else
:tablefield="item.title"
/></span>
</b-popover>
</div>
<b-media
v-else
no-body
>
2021-08-03 12:07:55 +00:00
<b-media-aside
class="mr-2"
>
<b-avatar
v-if="item.icon"
size="48"
:variant="item.color"
>
<feather-icon
size="24"
:icon="item.icon"
/>
</b-avatar>
</b-media-aside>
<b-media-body class="my-auto">
<h4 class="font-weight-bolder mb-0">
2021-08-06 13:21:08 +00:00
{{ item.title || '-' }}
2021-08-03 12:07:55 +00:00
</h4>
2021-08-07 07:17:08 +00:00
<b-card-text class="font-small-3 mb-1 text-capitalize">
2021-08-08 12:55:55 +00:00
{{ item.subtitle }}
2021-08-03 12:07:55 +00:00
</b-card-text>
</b-media-body>
</b-media>
</b-col>
</b-row>
</b-card-body>
</b-card>
</template>
<script>
import {
2021-08-06 13:21:08 +00:00
BCard, BCardHeader, BCardTitle, BCardText, BCardBody, BRow, BCol, BMedia, BMediaAside, BAvatar, BMediaBody, BPopover, BButton,
2021-08-03 12:07:55 +00:00
} from 'bootstrap-vue'
2021-08-06 13:21:08 +00:00
import ObjectFieldComponent from './ObjectFieldComponent.vue'
import ArrayFieldComponent from './ArrayFieldComponent.vue'
2021-08-03 12:07:55 +00:00
export default {
components: {
BRow,
BCol,
BCard,
BCardHeader,
BCardTitle,
BCardText,
BCardBody,
BMedia,
BAvatar,
BMediaAside,
BMediaBody,
2021-08-06 13:21:08 +00:00
BPopover,
BButton,
ObjectFieldComponent,
ArrayFieldComponent,
2021-08-03 12:07:55 +00:00
},
props: {
data: {
2021-08-06 13:21:08 +00:00
type: [Object, Array],
2021-08-03 12:07:55 +00:00
default: () => {},
},
},
}
</script>