61569d139aadb722e7860b15e9816ccfefc549e7.svn-base 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. <div class="field">
  19. <slot name="footer"></slot>
  20. </div>
  21. </div>
  22. </a-card>
  23. </template>
  24. <script>
  25. export default {
  26. name: "ChartCard",
  27. props: {
  28. title: {
  29. type: String,
  30. default: ''
  31. },
  32. total: {
  33. type: String,
  34. default: ''
  35. },
  36. loading: {
  37. type: Boolean,
  38. default: false
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="less" scoped>
  44. .chart-card-header {
  45. position: relative;
  46. overflow: hidden;
  47. width: 100%;
  48. .meta {
  49. position: relative;
  50. overflow: hidden;
  51. width: 100%;
  52. color: rgba(0, 0, 0, .45);
  53. font-size: 14px;
  54. line-height: 22px;
  55. }
  56. }
  57. .chart-card-action {
  58. cursor: pointer;
  59. position: absolute;
  60. top: 0;
  61. right: 0;
  62. }
  63. .chart-card-footer {
  64. border-top: 1px solid #e8e8e8;
  65. padding-top: 9px;
  66. margin-top: 8px;
  67. > * {
  68. position: relative;
  69. }
  70. .field {
  71. white-space: nowrap;
  72. overflow: hidden;
  73. text-overflow: ellipsis;
  74. margin: 0;
  75. }
  76. }
  77. .chart-card-content {
  78. margin-bottom: 12px;
  79. position: relative;
  80. height: 46px;
  81. width: 100%;
  82. .content-fix {
  83. position: absolute;
  84. left: 0;
  85. bottom: 0;
  86. width: 100%;
  87. }
  88. }
  89. .total {
  90. overflow: hidden;
  91. text-overflow: ellipsis;
  92. word-break: break-all;
  93. white-space: nowrap;
  94. color: #000;
  95. margin-top: 4px;
  96. margin-bottom: 0;
  97. font-size: 30px;
  98. line-height: 38px;
  99. height: 38px;
  100. }
  101. </style>