index.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div
  3. :class="`bs-card`"
  4. style="width: 100%;height: 100%;position: relative;"
  5. >
  6. <div
  7. :style="{
  8. width: '100%',
  9. height: '100%',
  10. display: 'flex',
  11. flexDirection: 'column',
  12. boxSizing: 'border-box',
  13. backgroundColor: customize.backgroundColor,
  14. border:`${customize.border}px`,
  15. borderStyle: customize.borderStyle,
  16. borderColor: `${customize.borderColor}`
  17. }"
  18. >
  19. <header
  20. :style="{
  21. color: customize.headerColor,
  22. padding: '8px 0',
  23. lineHeight: '16px',
  24. borderBottom: `${customize.titleBottomLineWidth}px solid ${customize.titleBottomLineColor}`,
  25. fontSize: '16px',
  26. boxSizing: 'border-box',
  27. display: 'flex',
  28. justifyContent: 'space-between',
  29. }"
  30. >
  31. <span
  32. :style="{
  33. display: 'inline-block',
  34. borderLeft: `${customize.titleLineWidth}px solid ${customize.titleLineColor}`,
  35. paddingLeft: customize.titlePaddingLeft+'px'
  36. }"
  37. >
  38. {{ config.title }}
  39. </span>
  40. </header>
  41. <div
  42. :style="{
  43. flex: 1,
  44. position: 'relative'
  45. }"
  46. />
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import commonMixins from '../../../js/mixins/commonMixins'
  52. import paramsMixins from '../../../js/mixins/paramsMixins'
  53. export default {
  54. name: 'Card',
  55. components: {},
  56. // mixins: [paramsMixins, commonMixins],
  57. props: {
  58. // 卡片的属性
  59. config: {
  60. type: Object,
  61. default: () => ({})
  62. }
  63. },
  64. data () {
  65. return {
  66. customClass: {}
  67. }
  68. },
  69. mounted () {
  70. // this.chartInit()
  71. },
  72. watch: {},
  73. computed: {
  74. customize () {
  75. return this.config.option.customize
  76. }
  77. },
  78. methods: {
  79. // dataFormatting (config, data) {
  80. // // 文本数据配置原则:选择数据集则以后端返回的数据为主,否则以设置面板中标题设置为准
  81. // if (config.dataSource.businessKey) {
  82. // config.customize.title = data && data.data && data.data.length ? data.data[0][config.dataSource.metricField] : '暂无数据'
  83. // }
  84. // return config
  85. // }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. </style>