测试 用electron + springboot 构建桌面应用
he wei
2022-03-22 5d912947c883b162026939a367bfe81cc35d2bbc
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<template>
  <div class="flex-box" :class="sizeClass">
    <div class="flex-box-border border-top-left"></div>
    <div class="flex-box-border border-top-right"></div>
    <div class="flex-box-border border-bottom-left"></div>
    <div class="flex-box-border border-bottom-right"></div>
    <div
      class="flex-box-header"
      v-if="!noHeader"
      :class="{ 'no-header-bg': noHeaderBg }"
    >
      <flex-layout direction="row" no-bg>
        <div slot="header">
          <title-icon
            v-if="type == 'title'"
            :size="size"
            class="title-icon-position"
          ></title-icon>
          <i v-else class="iconfont el-icon-fold"></i>
          <span class="header-text">{{ title }}</span>
        </div>
        <div class="flex-header-tools">
          <slot name="tools"></slot>
        </div>
      </flex-layout>
    </div>
    <div class="flex-box-body">
      <slot></slot>
    </div>
    <div class="flex-box-footer">
      <slot name="footer"></slot>
    </div>
  </div>
</template>
 
<script>
import titleIcon from "@/components/title-icon";
export default {
  name: "FlexBox",
  components: {
    titleIcon,
  },
  props: {
    type: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
    noHeader: {
      type: Boolean,
      default: false,
    },
    noHeaderBg: {
      type: Boolean,
      default: false,
    },
    size: {
      type: String,
      default: "",
    },
  },
  computed: {
    sizeClass() {
      let size = this.size;
      let result = "";
      switch (size) {
        case "mini":
          result = "flex-box-mini";
          break;
      }
      return result;
    },
  },
};
</script>
 
<style scoped>
.flex-box {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
 
.flex-box-border {
  position: absolute;
  display: inline-block;
  z-index: 9;
}
.flex-box.flex-box-mini > .flex-box-border {
  width: 8px;
  height: 8px;
}
 
.flex-box-border.border-top-left {
  top: 0;
  left: 0;
  border-top: 2px solid #00feff;
  border-left: 2px solid #00feff;
}
 
.flex-box-border.border-top-right {
  top: 0;
  right: 0;
  border-top: 2px solid #00feff;
  border-right: 2px solid #00feff;
}
 
.flex-box-border.border-bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid #00feff;
  border-left: 2px solid #00feff;
}
 
.flex-box-border.border-bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid #00feff;
  border-right: 2px solid #00feff;
}
 
.flex-box-header {
  position: relative;
  padding: 12px 0;
  font-size: 14px;
  color: #00fefe;
  font-weight: bold;
}
 
.flex-box-header.no-header-bg {
  background: none;
  padding: 8px 0;
}
 
.flex-header-tools {
  position: absolute;
  top: 8px;
  right: 16px;
  z-index: 9;
}
 
.flex-box-header .iconfont {
  font-size: 10px;
  margin-right: 8px;
  margin-left: 16px;
  transform: rotate(90deg);
}
 
.header-text {
  font-weight: bold;
}
 
.flex-box-body {
  position: relative;
  flex: 1;
  overflow: hidden;
  box-sizing: border-box;
}
.title-icon-position {
  margin-left: 16px;
}
</style>