2022-08-16 23:30:23 +08:00
|
|
|
<template>
|
|
|
|
<div class="main-box">
|
2023-01-09 10:38:54 +08:00
|
|
|
<div class="content-container__header" v-if="slots.header">
|
|
|
|
<slot name="header"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="content-container__app" v-if="slots.app">
|
|
|
|
<slot name="app"></slot>
|
2022-08-16 23:30:23 +08:00
|
|
|
</div>
|
|
|
|
<div class="content-container__toolbar" v-if="slots.toolbar">
|
|
|
|
<slot name="toolbar"></slot>
|
|
|
|
</div>
|
2023-01-30 17:24:46 +08:00
|
|
|
<div class="content-container__search" v-if="slots.search">
|
|
|
|
<el-card>
|
|
|
|
<slot name="search"></slot>
|
|
|
|
</el-card>
|
|
|
|
</div>
|
|
|
|
|
2022-08-16 23:30:23 +08:00
|
|
|
<div class="content-container_form">
|
|
|
|
<slot name="form">
|
|
|
|
<form-button>
|
|
|
|
<slot name="button"></slot>
|
|
|
|
</form-button>
|
|
|
|
</slot>
|
|
|
|
</div>
|
2023-01-09 10:38:54 +08:00
|
|
|
<div class="content-container__main" v-if="slots.main">
|
|
|
|
<el-card>
|
|
|
|
<div class="content-container__title" v-if="slots.title || title">
|
|
|
|
<slot name="title">
|
|
|
|
<back-button
|
|
|
|
:path="backPath"
|
|
|
|
:name="backName"
|
|
|
|
:to="backTo"
|
|
|
|
:header="title"
|
|
|
|
:reload="reload"
|
|
|
|
v-if="showBack"
|
|
|
|
>
|
|
|
|
<template v-if="slots.buttons" #buttons>
|
|
|
|
<slot name="buttons"></slot>
|
|
|
|
</template>
|
|
|
|
</back-button>
|
|
|
|
|
|
|
|
<span v-else>
|
|
|
|
{{ title }}
|
2023-01-12 15:12:01 +08:00
|
|
|
<span v-if="slots.buttons">
|
|
|
|
<el-divider direction="vertical" />
|
|
|
|
<slot name="buttons"></slot>
|
|
|
|
</span>
|
|
|
|
<span style="float: right">
|
|
|
|
<slot v-if="slots.rightButton" name="rightButton"></slot>
|
|
|
|
</span>
|
2023-01-09 10:38:54 +08:00
|
|
|
</span>
|
2023-01-30 17:24:46 +08:00
|
|
|
<div v-if="prop.divider">
|
|
|
|
<div class="divider"></div>
|
|
|
|
</div>
|
2023-01-09 10:38:54 +08:00
|
|
|
</slot>
|
|
|
|
</div>
|
2023-02-01 15:50:39 +08:00
|
|
|
<div v-if="slots.prompt" class="prompt">
|
2023-01-09 10:38:54 +08:00
|
|
|
<slot name="prompt"></slot>
|
|
|
|
</div>
|
2023-01-31 18:52:07 +08:00
|
|
|
<div class="main">
|
|
|
|
<slot name="main"></slot>
|
|
|
|
</div>
|
2023-01-09 10:38:54 +08:00
|
|
|
</el-card>
|
|
|
|
</div>
|
2022-08-16 23:30:23 +08:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed, useSlots } from 'vue';
|
|
|
|
import BackButton from '@/components/back-button/index.vue';
|
|
|
|
import FormButton from './form-button.vue';
|
2023-01-16 15:30:24 +08:00
|
|
|
defineOptions({ name: 'LayoutContent' });
|
2022-08-16 23:30:23 +08:00
|
|
|
const slots = useSlots();
|
|
|
|
const prop = defineProps({
|
2023-01-09 10:38:54 +08:00
|
|
|
title: String,
|
2022-08-16 23:30:23 +08:00
|
|
|
backPath: String,
|
|
|
|
backName: String,
|
|
|
|
backTo: Object,
|
2022-11-23 11:34:44 +08:00
|
|
|
reload: Boolean,
|
2023-01-30 17:24:46 +08:00
|
|
|
divider: Boolean,
|
2022-08-16 23:30:23 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
const showBack = computed(() => {
|
2022-11-23 11:34:44 +08:00
|
|
|
const { backPath, backName, backTo, reload } = prop;
|
|
|
|
return backPath || backName || backTo || reload;
|
2022-08-16 23:30:23 +08:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@use '@/styles/mixins.scss' as *;
|
|
|
|
|
2023-01-09 10:38:54 +08:00
|
|
|
.content-container__search {
|
|
|
|
margin-top: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content-container__title {
|
2022-08-16 23:30:23 +08:00
|
|
|
font-weight: 700;
|
|
|
|
font-size: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content-container__toolbar {
|
2023-02-01 16:15:31 +08:00
|
|
|
margin-top: 20px;
|
2022-08-16 23:30:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.content-container_form {
|
|
|
|
text-align: -webkit-center;
|
|
|
|
width: 60%;
|
|
|
|
margin-left: 15%;
|
|
|
|
.form-button {
|
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
}
|
2023-01-30 09:39:37 +08:00
|
|
|
|
2023-01-09 10:38:54 +08:00
|
|
|
.content-container__main {
|
|
|
|
margin-top: 20px;
|
|
|
|
}
|
|
|
|
|
2023-01-31 18:52:07 +08:00
|
|
|
.main {
|
|
|
|
margin-top: 20px;
|
|
|
|
}
|
|
|
|
|
2023-02-01 15:50:39 +08:00
|
|
|
.prompt {
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
|
|
|
|
2023-01-30 17:24:46 +08:00
|
|
|
.divider {
|
|
|
|
margin-top: 20px;
|
|
|
|
border: 0;
|
|
|
|
border-top: 1px solid #f2f2f2;
|
2023-01-30 09:39:37 +08:00
|
|
|
}
|
2022-08-16 23:30:23 +08:00
|
|
|
</style>
|