index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div
  3. style="width: 100%;height: 100%"
  4. class="bs-design-wrap"
  5. >
  6. <dv-border-box-4
  7. :id="'dataV' + config.code"
  8. :background-color="backgroundColor"
  9. :color='borderColor'
  10. :key="updateKey"
  11. >
  12. <div class="element"
  13. :style="`
  14. color:${color};
  15. font-size:${config.border.fontSize}px;
  16. line-height:${config.border.titleHeight}px;
  17. height:${config.border.titleHeight};
  18. padding:0 0 0 20px`"
  19. >
  20. {{config.title}}</div>
  21. </dv-border-box-4>
  22. </div>
  23. </template>
  24. <script>
  25. import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
  26. import DvBorderBox4 from '@jiaminghi/data-view/lib/components/borderBox4/src/main.vue'
  27. import '@jiaminghi/data-view/lib/components/borderBox4/src/main.css'
  28. export default {
  29. name: 'Border4',
  30. components: {
  31. DvBorderBox4
  32. },
  33. mixins: [refreshComponentMixin],
  34. props: {
  35. // 卡片的属性
  36. config: {
  37. type: Object,
  38. default: () => ({})
  39. }
  40. },
  41. data () {
  42. return {
  43. }
  44. },
  45. computed: {
  46. borderColor () {
  47. return this.config.border.borderMainColor ||
  48. this.config.border.borderSecondaryColor
  49. ? [
  50. this.config.border.borderMainColor,
  51. this.config.border.borderSecondaryColor
  52. ]
  53. : null
  54. },
  55. color () {
  56. return this.config.border.fontColor ? this.config.border.fontColor
  57. : '#fff'
  58. },
  59. backgroundColor () {
  60. return this.config.border.backgroundColor
  61. ? this.config.border.backgroundColor
  62. : 'transparent'
  63. },
  64. // colorType () {
  65. // return this.config.border.colorType
  66. // }
  67. },
  68. watch: {
  69. },
  70. mounted () {},
  71. methods: {}
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .bs-design-wrap {
  76. position: absolute;
  77. width: 100%;
  78. height: 100%;
  79. // padding: 0 16px;
  80. background-color: transparent;
  81. border-radius: 4px;
  82. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  83. box-sizing: border-box;
  84. }
  85. /*滚动条样式*/
  86. ::v-deep ::-webkit-scrollbar {
  87. width: 4px;
  88. border-radius: 4px;
  89. height: 4px;
  90. }
  91. ::v-deep ::-webkit-scrollbar-thumb {
  92. background: #dddddd !important;
  93. border-radius: 10px;
  94. }
  95. </style>