index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div
  3. style="width: 100%;height: 100%"
  4. class="bs-design-wrap"
  5. >
  6. <div
  7. :key="updateKey"
  8. class="custom-border-box"
  9. :style="`
  10. border-top-left-radius: ${radiusLeftTop}px;
  11. border-top-right-radius: ${radiusRightTop}px;
  12. border-bottom-left-radius: ${radiusLeftBottom}px;
  13. border-bottom-right-radius: ${radiusRightBottom}px;
  14. border: ${width}px solid ${color};
  15. opacity: ${opacity/ 100};
  16. background-image: linear-gradient(${gradientDirection}, ${
  17. gradientColor0 ? gradientColor0 : gradientColor1
  18. } , ${gradientColor1 ? gradientColor1 : gradientColor0})
  19. `"
  20. >
  21. <div class="element"
  22. v-if="config.border.isTitle"
  23. :style="`
  24. color:${fontColor};
  25. font-size:${config.border.fontSize}px;
  26. line-height:${config.border.titleHeight}px;
  27. height:${config.border.titleHeight};
  28. padding:0 0 0 20px`"
  29. >
  30. {{config.title}}</div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
  36. export default {
  37. name: 'Border14',
  38. components: {
  39. },
  40. mixins: [refreshComponentMixin],
  41. props: {
  42. // 卡片的属性
  43. config: {
  44. type: Object,
  45. default: () => ({})
  46. }
  47. },
  48. data () {
  49. return {
  50. }
  51. },
  52. computed: {
  53. fontColor () {
  54. return this.config.border.fontColor ? this.config.border.fontColor
  55. : '#fff'
  56. },
  57. color () {
  58. return this.config.border.borderColor || ''
  59. },
  60. width () {
  61. return this.config.border.borderWidth || 2
  62. },
  63. gradientColor0 () {
  64. return this.config.border.gradientColor0 ||this.config.border.gradientColor1|| 'transparent'
  65. },
  66. gradientColor1 () {
  67. return this.config.border.gradientColor1 ||this.config.border.gradientColor0|| 'transparent'
  68. },
  69. radiusLeftTop () {
  70. return this.config.border.radiusLeftTop || 2
  71. },
  72. radiusRightTop () {
  73. return this.config.border.radiusRightTop || 2
  74. },
  75. radiusLeftBottom () {
  76. return this.config.border.radiusLeftBottom || 2
  77. },
  78. radiusRightBottom () {
  79. return this.config.border.radiusRightBottom || 2
  80. },
  81. gradientDirection () {
  82. return this.config.border.gradientDirection || 'to right'
  83. },
  84. opacity () {
  85. return this.config.border.opacity || 100
  86. }
  87. },
  88. watch: {
  89. },
  90. mounted () {
  91. },
  92. methods: {
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .bs-design-wrap {
  98. position: absolute;
  99. width: 100%;
  100. height: 100%;
  101. // padding: 0 16px;
  102. background-color: transparent;
  103. border-radius: 4px;
  104. box-shadow: 0px 0px 0px 0px !important;
  105. box-sizing: border-box;
  106. .custom-border-box {
  107. width: 100%;
  108. height: 100%;
  109. }
  110. }
  111. /*滚动条样式*/
  112. ::v-deep ::-webkit-scrollbar {
  113. width: 4px;
  114. border-radius: 4px;
  115. height: 4px;
  116. }
  117. ::v-deep ::-webkit-scrollbar-thumb {
  118. background: #dddddd !important;
  119. border-radius: 10px;
  120. }
  121. </style>