com-funnel.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <style scoped>
  2. .item{
  3. margin-bottom: 2px;
  4. display: flex;
  5. align-items: center;
  6. }
  7. .item .center{
  8. height: 100%;
  9. text-align: center;
  10. }
  11. .right{
  12. width: 0;
  13. height: 0;
  14. border-style: solid;
  15. }
  16. .left{
  17. width: 0;
  18. height: 0;
  19. border-style: solid;
  20. }
  21. </style>
  22. <template id="com-funnel">
  23. <div class="com-funnel"flex="dir:top cross:center">
  24. <div class="item" style="height: 53px">
  25. <div class="left" style="border-color: transparent #1e60ff transparent transparent;border-width: 0 33.5px 53px 0;"></div>
  26. <div class="center" style="background-color: #1e60ff;width: 180px;line-height: 53px;font-size: 20px">{{`${dataList[0].text}: ${dataList[0].num}`}}</div>
  27. <div class="right" style="border-color: #1e60ff transparent transparent transparent;border-width: 53px 33.5px 0 0;"></div>
  28. </div>
  29. <div class="item" style="height: 60px;">
  30. <div class="left" style="border-color: transparent #0032c1 transparent transparent;border-width: 0 36px 60px 0;"></div>
  31. <div class="center" style="background-color: #0032c1;width: 108px;line-height: 60px;font-size: 17px">{{`${dataList[1].text}: ${dataList[1].num}`}}</div>
  32. <div class="right" style="border-color: #0032c1 transparent transparent transparent;border-width: 60px 36px 0 0;"></div>
  33. </div>
  34. <!-- <div class="item" style="height: 88px">-->
  35. <!-- <div class="left" style="border-color: transparent #002390 transparent transparent;border-width: 0 54px 88px 0;"></div>-->
  36. <!-- <div class="center" style="background-color: #002390">{{`${dataList[2].text}: ${dataList[2].num}`}}</div>-->
  37. <!-- <div class="right" style="border-color: #002390 transparent transparent transparent;border-width: 88px 54px 0 0;"></div>-->
  38. <!-- </div>-->
  39. <div class="item" style="height: 88px">
  40. <div class="center" style="position: relative;width: 67px">
  41. <div class="left" style="border-color: transparent #002390 transparent transparent;border-width: 0 54px 88px 0;position: absolute;left: -20.5px;top: 0;"></div>
  42. <div class="text" style="position: absolute;z-index: 3;top: 15px;width:65px;font-size: 14px;left:50%;transform:translateX(-50%);">{{`${dataList[2].text}: ${dataList[2].num}`}}</div>
  43. <div class="right" style="border-color: #002390 transparent transparent transparent;border-width: 88px 54px 0 0;position: absolute;right: -20.5px;top: 0"></div>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. Vue.component('com-funnel', {
  50. template: '#com-funnel',
  51. props: {
  52. dataList: {
  53. type: Array,
  54. default: () => []
  55. }
  56. },
  57. computed: {
  58. },
  59. data() {
  60. return {
  61. data: '',
  62. };
  63. },
  64. created() {
  65. // this.data = JSON.parse(JSON.stringify(this.count));
  66. },
  67. methods: {
  68. },
  69. });
  70. </script>