1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
| <script setup>
| import {computed} from "vue";
|
| const props = defineProps({
| direction: {
| type: String,
| default: "",
| },
| height: {
| type: String,
| default: "100%",
| },
| noBg: {
| type: Boolean,
| default: false,
| },
| loading: {
| type: Boolean,
| default: false,
| },
| bgImg: {
| type: Boolean,
| default: false
| },
| });
|
| const svg = `
| <path class="path" d="
| M 30 15
| L 28 17
| M 25.61 25.61
| A 15 15, 0, 0, 1, 15 30
| A 15 15, 0, 1, 1, 27.99 7.5
| L 15 15
| " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
| `
|
| const getRootClass = computed(()=>{
| return {
| "direction-row": props.direction === "row",
| "bg-img": props.bgImg
| };
| });
|
| const getRootStyle = computed(()=>{
| return {
| height: props.height,
| };
| });
| </script>
|
| <template>
| <div
| class="flex-layout"
| :class="getRootClass"
| :style="getRootStyle"
| v-loading="loading"
| element-loading-text="拼命加载中"
| :element-loading-spinner="svg"
| element-loading-background="rgba(0, 0, 0, 0.2)">
| <div class="flex-layout-header">
| <slot name="header"></slot>
| </div>
| <div class="flex-layout-body" :class="{ 'no-bg': noBg }">
| <slot></slot>
| </div>
| <div class="flex-layout-footer">
| <slot name="footer"></slot>
| </div>
| </div>
| </template>
|
| <style scoped>
| .flex-layout {
| display: flex;
| flex-direction: column;
| height: 100%;
| &.bg-img {
| background-image: url("../assets/images/dw_bg.jpg");
| background-size: 100% 100%;
| }
| &.direction-row {
| flex-direction: row;
| }
| &.full-ht {
| height: 100%;
| }
| }
|
| .flex-layout-body {
| flex: 1;
| background-color: #052272;
| }
| .flex-layout-body.no-bg {
| background-color: #05227200;
| }
| </style>
|
|