FusionVermicelli.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div class="manuscriptIssued">
  3. <el-loading></el-loading>
  4. <el-breadcrumb separator-class="el-icon-arrow-right">
  5. <el-breadcrumb-item>全媒体平台</el-breadcrumb-item>
  6. <el-breadcrumb-item>融合号粉丝量排行榜</el-breadcrumb-item>
  7. </el-breadcrumb>
  8. <div class="groupType">
  9. <el-row class="mb-4">
  10. <el-button
  11. v-for="(cur,ind) in tabs.btns"
  12. :key="ind"
  13. :class="cur == btnFocus ? 'btnFocus' : ''"
  14. @click="handleClick(cur)"
  15. >{{ cur }}</el-button
  16. >
  17. </el-row>
  18. </div>
  19. <div class="card-rank">
  20. <div>
  21. <el-table
  22. :data="tableData"
  23. header-row-class-name="card-tabs-header"
  24. >
  25. <el-table-column align="center" prop="title" label="关键词" />
  26. <el-table-column align="center" prop="fansCount" label="粉丝量" />
  27. </el-table>
  28. </div>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import { getFansCnt, getAccountType } from "@/api/index";
  34. const ElLoading = require("element-plus/lib/el-loading/index");
  35. import "element-plus/lib/theme-chalk/el-loading.css";
  36. export default {
  37. name: "FusionVermicelli",
  38. data() {
  39. return {
  40. activeName: 1,
  41. btnFocus: "",
  42. tabs: {
  43. name: "融合号粉丝量排行榜",
  44. btns: [],
  45. },
  46. tableData: [],
  47. typeData: [],
  48. };
  49. },
  50. mounted() {
  51. this.setFansCntTypeData();
  52. },
  53. methods: {
  54. handleClick(e) {
  55. this.btnFocus = e;
  56. this.setTableData();
  57. },
  58. setTableData() {
  59. const that = this;
  60. this.tableData = [];
  61. this.load = ElLoading.default.service();
  62. getFansCnt({ type: this.btnFocus })
  63. .then((res) => {
  64. that.tableData = res;
  65. that.load.close();
  66. })
  67. .catch((err) => {
  68. that.tableData = [];
  69. console.log("catch", err);
  70. });
  71. },
  72. setFansCntTypeData() {
  73. const that = this;
  74. getAccountType()
  75. .then((res) => {
  76. const [item] = res;
  77. that.btnFocus = item;
  78. that.tabs.btns = res;
  79. that.setTableData();
  80. })
  81. .catch((err) => {
  82. that.tabs.btns = [];
  83. console.log("catch", err);
  84. });
  85. },
  86. },
  87. };
  88. </script>
  89. <style>
  90. .manuscriptIssued {
  91. margin: 10px;
  92. }
  93. .card-tabs,
  94. .el-tabs__header {
  95. padding: 0 100px;
  96. }
  97. .groupType {
  98. padding: 15px 10px;
  99. box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
  100. }
  101. .card-rank {
  102. padding: 10px 15px;
  103. box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
  104. display: flex;
  105. align-items: flex-start;
  106. justify-content: space-between;
  107. }
  108. .card-rank div {
  109. width: 100%;
  110. }
  111. h4 {
  112. text-align: left;
  113. color: #e18116;
  114. margin-bottom: 50px;
  115. font-weight: bold;
  116. }
  117. .card-tabs-header th {
  118. background: #f5f7fa !important;
  119. }
  120. .btnFocus {
  121. color:#FFF !important;
  122. border-color:#409eff !important;
  123. background-color:#409eff !important;
  124. }
  125. </style>