ChartCard.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <!-- 外边框 -->
  3. <div>
  4. <!-- 需要提出一个组件 -->
  5. <div class="displayFlex">
  6. <div class="borders2"></div>
  7. <div class="chartTitle">
  8. {{ title }}
  9. <div class="chartTitleBorder"></div>
  10. </div>
  11. </div>
  12. <div style="height: 87px">
  13. <!-- 需要重写 -->
  14. <LineChart :categoryData="['2020年', '2021年', '2022年']" :valueData="[1024, 1026, 1025]" />
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import LineChart from "@/components/chart/LineChart.vue";
  20. export default {
  21. name: "ChartCard",
  22. components: { LineChart },
  23. data() {
  24. return {};
  25. },
  26. mounted() {},
  27. /**
  28. * title: 标题(必填)
  29. */
  30. props: ["title"],
  31. methods: {},
  32. watch: {}
  33. };
  34. </script>
  35. <style lang="less" scoped>
  36. .displayFlex {
  37. display: flex;
  38. align-content: center;
  39. align-items: center;
  40. justify-content: space-between;
  41. flex-wrap: nowrap;
  42. position: relative;
  43. .borders {
  44. position: absolute;
  45. left: 50%;
  46. top: 50%;
  47. transform: translate(-50%, -50%) rotate(45deg);
  48. width: 110px;
  49. height: 100px;
  50. background: linear-gradient(to left, #00aaff, #00aaff) left top no-repeat,
  51. linear-gradient(to bottom, #00aaff, #00aaff) left top no-repeat,
  52. linear-gradient(to left, #00aaff, #00aaff) right top no-repeat,
  53. linear-gradient(to bottom, #00aaff, #00aaff) right top no-repeat,
  54. linear-gradient(to left, #00aaff, #00aaff) left bottom no-repeat,
  55. linear-gradient(to bottom, #00aaff, #00aaff) left bottom no-repeat,
  56. linear-gradient(to left, #00aaff, #00aaff) right bottom no-repeat,
  57. linear-gradient(to left, #00aaff, #00aaff) right bottom no-repeat;
  58. background-size: 6px 6px, 6px 6px, 6px 6px, 6px 6px;
  59. }
  60. }
  61. .borders2 {
  62. width: 10px;
  63. height: 10px;
  64. background-color: #74ffff;
  65. transform: rotate(45deg);
  66. }
  67. .chartTitle {
  68. position: relative;
  69. width: 100%;
  70. font-size: 18px;
  71. font-family: pingfangSC;
  72. font-weight: bold;
  73. color: #74ffff;
  74. margin-left: 10px;
  75. background: linear-gradient(180deg, #ffffff 0%, #33eeff 100%);
  76. -webkit-background-clip: text;
  77. -webkit-text-fill-color: transparent;
  78. border-bottom: 1px solid transparent;
  79. border-image: --webkit-linear-gradient(to right, #33eeff, transparent) 1;
  80. border-image: --moz-linear-gradient(to right, #33eeff, transparent) 1;
  81. border-image: linear-gradient(to right, #33eeff, transparent) 1;
  82. }
  83. .chartTitleBorder {
  84. position: absolute;
  85. right: 0;
  86. bottom: -2px;
  87. width: 10px;
  88. height: 3px;
  89. background: #00a8ff;
  90. border-radius: 2px;
  91. }
  92. </style>