Files
dvcp_v2_webapp/ui/packages/layout/AiPage.vue

101 lines
1.9 KiB
Vue
Raw Normal View History

2024-12-12 15:40:27 +08:00
<script>
import AiTitle from "../basic/AiTitle.vue";
2024-12-12 15:40:27 +08:00
export default {
name: "AiPage",
components: {AiTitle},
props: {
contentString: {default: "card"},
showBack: Boolean
2024-12-12 15:40:27 +08:00
}
}
</script>
<template>
<section class="AiPage">
<slot v-if="$slots.title" name="title"/>
<ai-title v-else-if="$attrs.title" :title="$attrs.title" isShowBottomBorder :isShowBack="showBack" @onBackClick="$router.push({})"/>
2024-12-12 15:40:27 +08:00
<div class="fill main">
<div v-if="$slots.left" class="left">
2024-12-12 15:40:27 +08:00
<slot name="left"/>
</div>
<el-scrollbar class="fill" :class="[contentString,$slots.footer?'hasFooter':'']">
2024-12-12 15:40:27 +08:00
<slot/>
</el-scrollbar>
</div>
<div class="footer" v-if="$slots.footer">
<slot name="footer"/>
2024-12-12 15:40:27 +08:00
</div>
</section>
</template>
<style scoped lang="scss">
.AiPage {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 0 20px;
overflow: hidden;
background: #f3f6f9;
position: relative;
2024-12-12 15:40:27 +08:00
.main {
display: flex;
padding: 20px 0;
gap: 10px;
overflow: hidden;
height: 100%;
& > .fill {
&.card {
padding: 12px 16px 12px;
background: #FFFFFF;
border-radius: 2px;
box-shadow: 0 4px 6px -2px rgba(15, 15, 21, 0.15);
}
&.detail {
margin-left: 50%;
transform: translateX(-50%);
max-width: 1200px;
overflow-y: auto;
:deep(.el-scrollbar__wrap) {
overflow-x: hidden;
}
}
&.hasFooter {
padding-bottom: 64px;
}
}
}
.footer {
position: absolute;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
left:0;
right:0;
height: 64px;
background: #F5F5F5;
box-shadow: 0 1px 0 0 #E5E5E5;
.el-button {
width: 92px;
}
2024-12-12 15:40:27 +08:00
}
.left {
max-width: 50%;
width: auto;
}
}
</style>