3328350766
6 天以前 761eb03d6b3bebd0b197179564c84d89d3d12a0d
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
<template>
  <div
    style="width: 100%;height: 100%"
    class="bs-design-wrap"
  >
    <div
      :key="updateKey"
      class="custom-border-box"
      :style="`
        border-top-left-radius: ${radiusLeftTop}px;
        border-top-right-radius: ${radiusRightTop}px;
        border-bottom-left-radius: ${radiusLeftBottom}px;
        border-bottom-right-radius: ${radiusRightBottom}px;
        border: ${width}px solid ${color};
        opacity: ${opacity/ 100};
        background-image: linear-gradient(${gradientDirection}, ${
        gradientColor0 ? gradientColor0 : gradientColor1
      } , ${gradientColor1 ? gradientColor1 : gradientColor0})
      `"
    >
      <div
        v-if="config.border.isTitle"
        class="element"
        :style="`
      color:${fontColor};
      font-size:${config.border.fontSize}px;
      line-height:${config.border.titleHeight}px;
      height:${config.border.titleHeight};
      padding:0 0 0 20px`"
      >
        {{ config.title }}
      </div>
    </div>
  </div>
</template>
<script>
import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
export default {
  name: 'Border14',
  components: {
  },
  mixins: [refreshComponentMixin],
  props: {
    // 卡片的属性
    config: {
      type: Object,
      default: () => ({})
    }
  },
  data () {
    return {
    }
  },
  computed: {
    fontColor () {
      return this.config.border.fontColor ? this.config.border.fontColor
        : '#fff'
    },
    color () {
      return this.config.border.borderColor || ''
    },
    width () {
      return this.config.border.borderWidth || 0
    },
    gradientColor0 () {
      if (this.config.border.gradientColor&&this.config.border.gradientColor.length) {
        return this.config.border.gradientColor[0] || this.config.border.gradientColor[1]
      } else {
        return 'transparent'
      }
    },
    gradientColor1 () {
      if (this.config.border.gradientColor&&this.config.border.gradientColor.length) {
        return this.config.border.gradientColor[1] || this.config.border.gradientColor[0]
      } else {
        return 'transparent'
      }
    },
    radiusLeftTop () {
      return this.config.border.radiusLeftTop || 2
    },
    radiusRightTop () {
      return this.config.border.radiusRightTop || 2
    },
    radiusLeftBottom () {
      return this.config.border.radiusLeftBottom || 2
    },
    radiusRightBottom () {
      return this.config.border.radiusRightBottom || 2
    },
    gradientDirection () {
      return this.config.border.gradientDirection || 'to right'
    },
    opacity () {
      return this.config.border.opacity || 100
    }
  },
  watch: {
  },
  mounted () {
  },
  methods: {
  }
}
</script>
 
<style lang="scss" scoped>
.bs-design-wrap {
  position: absolute;
  width: 100%;
  height: 100%;
  // padding: 0 16px;
  background-color: transparent;
  border-radius: 4px;
  box-shadow: 0px 0px 0px 0px !important;
  box-sizing: border-box;
  .custom-border-box {
    width: 100%;
    height: 100%;
  }
}
 
/*滚动条样式*/
::v-deep ::-webkit-scrollbar {
  width: 4px;
  border-radius: 4px;
  height: 4px;
}
 
::v-deep ::-webkit-scrollbar-thumb {
  background: #dddddd !important;
  border-radius: 10px;
}
</style>