bannerStatistics.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="container-banner-statistics">
  3. <div class="table-body-wrapper" style="max-height: calc(100vh - 180px); overflow: auto">
  4. <table border>
  5. <thead>
  6. <td class="thead-rs">名称</td>
  7. <td class="thead-rs">日期</td>
  8. <td class="thead-rs">点击量合计</td>
  9. <td class="thead-rs">点击量</td>
  10. <td class="thead-rs">点击来源</td>
  11. <td class="thead-rs">最近一次点击时间</td>
  12. </thead>
  13. <tbody v-for="item in tableData" :key="item.ViewHistoryID">
  14. <tr v-for="(_item, index) in item.SourceList" :key="_item.LastUpdatedTime">
  15. <td class="thead-rs" :rowspan="item.SourceList.length" v-if="index == 0">{{ item.Remark }}</td>
  16. <td class="thead-rs" :rowspan="item.SourceList.length" v-if="index == 0">{{ item.StartDate }} -- {{ item.EndDate }}</td>
  17. <td class="thead-rs" :rowspan="item.SourceList.length" v-if="index == 0">{{ item.Pv }}</td>
  18. <td class="thead-rs">{{ _item.Pv }}</td>
  19. <td class="thead-rs">
  20. {{ _item.FirstSource == 1 ? "小程序移动端" : _item.FirstSource == 2 ? "小程序PC端" : _item.FirstSource == 3 ? "研报官网" : "" }}
  21. {{ _item.SecondSource == 1 ? "/ 首页" : _item.SecondSource == 2 ? "/ 研报详情页" : "" }}
  22. </td>
  23. <td class="thead-rs">{{ _item.LastUpdatedTime }}</td>
  24. </tr>
  25. </tbody>
  26. </table>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import { departInterence } from "@/api/api.js";
  32. export default {
  33. name: "",
  34. data() {
  35. return {
  36. tableData: [],
  37. };
  38. },
  39. mounted() {
  40. this.getDataList();
  41. },
  42. methods: {
  43. async getDataList() {
  44. const res = await departInterence.getBannerStatistic();
  45. if (res.Ret === 200) {
  46. this.tableData = res.Data || [];
  47. }
  48. },
  49. },
  50. };
  51. </script>
  52. <style scoped lang="scss">
  53. .container-banner-statistics {
  54. .table-body-wrapper {
  55. max-height: calc(100vh - 100px);
  56. overflow-y: scroll;
  57. overflow-x: auto;
  58. border-bottom: 1px solid #dcdfe6;
  59. border-top: 1px solid #dcdfe6;
  60. .table-data-empty {
  61. color: #666666;
  62. height: 530px;
  63. display: flex;
  64. align-items: center;
  65. justify-content: center;
  66. border-left: 1px solid #dcdfe6;
  67. border-right: 1px solid #dcdfe6;
  68. }
  69. }
  70. table {
  71. width: 100%;
  72. font-size: 14px;
  73. color: #666;
  74. thead {
  75. position: sticky;
  76. top: 0;
  77. z-index: 1;
  78. left: 0;
  79. border-left: 1px solid #dcdfe6;
  80. border-right: 1px solid #dcdfe6;
  81. td {
  82. border: none;
  83. outline-color: #dcdfe6;
  84. outline-style: solid;
  85. outline-width: 0.5px;
  86. background-color: #ebeef5 !important ;
  87. color: #333333;
  88. font-weight: 500;
  89. }
  90. }
  91. td,
  92. th {
  93. min-width: 35px;
  94. // word-break: break-all;
  95. border: 1px solid #dcdfe6;
  96. height: 45px;
  97. text-align: center;
  98. background-color: #fff;
  99. }
  100. }
  101. .table-img {
  102. padding: 20px 0;
  103. width: 368px;
  104. height: 107px;
  105. box-sizing: border-box;
  106. }
  107. }
  108. </style>