吉安感知网项目-前端
chenyao
7 days ago c2e0774ce8fecf5ef512afa3ff6125fd2f5377b9
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
<!--
 * @Author       : yuan
 * @Date         : 2025-06-14 15:19:16
 * @LastEditors  : yuan
 * @LastEditTime : 2026-01-14 10:10:35
 * @FilePath     : \applications\drone-command\src\components\basic-container\main.vue
 * @Description  :
 * Copyright 2025 OBKoro1, All Rights Reserved.
 * 2025-06-14 15:19:16
-->
<template>
  <div class="basic-container" :style="styleName" :class="{ 'basic-container--block': block }">
    <el-card class="basic-container__card">
      <slot></slot>
    </el-card>
  </div>
</template>
 
<script>
export default {
  name: 'basicContainer',
  props: {
    radius: {
      type: [String, Number],
      default: 10,
    },
    background: {
      type: String,
    },
    block: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    styleName () {
      return {
        borderRadius: `${this.radius}px`,
        background: this.background,
      }
    },
  },
}
</script>
 
<style lang="scss" scoped>
.basic-container {
  margin-top: 109px;
 
  height: 0;
  flex: 1;
 
  padding: 6px 30px;
  // box-sizing: border-box;
  // height: 100%;
 
  .basic-container__card {
    display: flex;
    flex-direction: column;
    height: 100% !important;
    overflow: hidden;
    background: transparent;
 
    ::v-deep(.el-card__body) {
      padding: 0 !important;
      //height: 0 !important;
      flex: 1 !important;
      display: flex;
      flex-direction: column;
 
      overflow: hidden;
      box-sizing: border-box;
    }
  }
 
  &--block {
    height: 100%;
 
    .basic-container__card {
      height: 100%;
    }
  }
 
  &__card {
    width: 100%;
  }
}
</style>