web/src/components/common/Panel.vue

88 lines
1.5 KiB
Vue

<template>
<div class="panel" :class="props.isFullHeight ? 'panel--flex' : ''">
<div class="panel-header" v-if="props.showHeader">
<div class="panel-header-title">{{props.title}}</div>
<div class="panel-header-tools" v-if="props.showTools">
<slot name="tools"></slot>
</div>
</div>
<div class="panel-content" :style="!props.showHeader ? 'padding-top: 0' : ''">
<slot></slot>
</div>
</div>
</template>
<style scoped lang="scss">
.panel {
background: #fff;
border-radius: 6px;
&-header {
position: relative;
height: 58px;
padding-right: 18px;
display: flex;
justify-content: space-between;
align-items: center;
&:before {
content: '';
position: absolute;
left: 0;
top: 17px;
width: 7px;
height: 24px;
background: #4D6DE4;
border-radius: 3px;
}
&-title {
width: 150px;
font-weight: 800;
font-size: 20px;
color: #333333;
font-style: normal;
text-indent: 17px;
line-height: 48px;
}
&-tools {
}
}
&-content {
}
}
.panel--flex{
display: flex;
flex-direction: column;
min-height: 0;
height: 100%;
.panel-content{
flex: 1;
min-height: 0;
}
}
</style>
<script setup lang="ts">
const props = defineProps({
title: {
type: String,
default: ''
},
isFullHeight: {
type: Boolean,
default: true
},
showTools: {
type: Boolean,
default: true
},
showHeader: {
type: Boolean,
default: true
}
})
</script>