您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ChartCard.vue 1.6 KiB

2 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <a-card :loading="loading" :body-style="{padding: '20px 24px 8px'}" :bordered="false">
  3. <div class="chart-card-header">
  4. <div class="meta">
  5. <span class="chart-card-title">{{title}}</span>
  6. <span class="chart-card-action">
  7. <slot name="action"></slot>
  8. </span>
  9. </div>
  10. <div class="total"><span>{{total}}</span></div>
  11. </div>
  12. <div class="chart-card-content">
  13. <div class="content-fix">
  14. <slot></slot>
  15. </div>
  16. </div>
  17. <div class="chart-card-footer">
  18. <slot name="footer"></slot>
  19. </div>
  20. </a-card>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'ChartCard',
  25. props: ['title', 'total', 'loading']
  26. }
  27. </script>
  28. <style scoped lang="less">
  29. .chart-card-header{
  30. position: relative;
  31. overflow: hidden;
  32. width: 100%;
  33. }
  34. .chart-card-header .meta{
  35. position: relative;
  36. overflow: hidden;
  37. width: 100%;
  38. color: @text-color-second;
  39. font-size: 14px;
  40. line-height: 22px;
  41. }
  42. .chart-card-action{
  43. cursor: pointer;
  44. position: absolute;
  45. top: 0;
  46. right: 0;
  47. }
  48. .total {
  49. overflow: hidden;
  50. text-overflow: ellipsis;
  51. word-break: break-all;
  52. white-space: nowrap;
  53. margin-top: 4px;
  54. margin-bottom: 0;
  55. font-size: 30px;
  56. line-height: 38px;
  57. height: 38px;
  58. }
  59. .chart-card-footer{
  60. border-top: 1px solid @border-color-base;
  61. padding-top: 9px;
  62. margin-top: 8px;
  63. }
  64. .chart-card-content{
  65. margin-bottom: 12px;
  66. position: relative;
  67. height: 46px;
  68. width: 100%;
  69. }
  70. .chart-card-content .content-fix{
  71. position: absolute;
  72. left: 0;
  73. bottom: 0;
  74. width: 100%;
  75. }
  76. </style>