BoutiqueColumn.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="boutiqueColumn">
  3. <el-breadcrumb separator-class="el-icon-arrow-right">
  4. <el-breadcrumb-item>传统媒体</el-breadcrumb-item>
  5. <el-breadcrumb-item>重点栏目分析</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-loading></el-loading>
  8. <el-tabs
  9. tab-position="top"
  10. style="max-height: 100%;"
  11. @tab-click="selectTab"
  12. v-model="select"
  13. >
  14. <el-tab-pane
  15. v-for="(item, i) in columnNames"
  16. :key="i"
  17. :label="item.programName"
  18. :name="item.component"
  19. >
  20. <div
  21. class="tab-body"
  22. v-if="item.component === select || selectA[item.component]"
  23. >
  24. <component :is="item.component" :item="item"></component>
  25. </div>
  26. </el-tab-pane>
  27. </el-tabs>
  28. </div>
  29. </template>
  30. <script>
  31. // @ is an alias to /src
  32. import { epgList } from "@/api/index";
  33. // 重点栏目分析
  34. import huashanlunjian from "./views/huashanlunjian.vue";
  35. import dialogueSecretary from "./views/dialogueSecretary.vue";
  36. import policeStory from "./views/policeStory.vue";
  37. import shaanxiNewsSimulcast from "./views/shaanxiNewsSimulcast.vue";
  38. import hundredBrokenPlays from "./views/hundredBrokenPlays.vue";
  39. import urbanExpressNews from "./views/urbanExpressNews.vue";
  40. export default {
  41. name: "boutiqueColumn",
  42. data() {
  43. return {
  44. columnNames: [],
  45. select: "",
  46. selectA: {},
  47. };
  48. },
  49. mounted() {
  50. epgList().then(programList => {
  51. this.columnNames = programList || [];
  52. this.select = (this.columnNames[0] || {}).component;
  53. this.selectA[this.select] = true;
  54. });
  55. },
  56. computed: {},
  57. methods: {
  58. selectTab(tab) {
  59. try {
  60. this.select = this.columnNames[tab.index].component;
  61. this.selectA[this.select] = true;
  62. } catch (err) {
  63. console.log(err);
  64. }
  65. },
  66. },
  67. beforeUnmount: function() {},
  68. components: {
  69. huashanlunjian,
  70. dialogueSecretary,
  71. policeStory,
  72. shaanxiNewsSimulcast,
  73. hundredBrokenPlays,
  74. urbanExpressNews,
  75. },
  76. };
  77. </script>
  78. <style>
  79. .boutiqueColumn {
  80. padding: 10px 15px;
  81. box-sizing: border-box;
  82. }
  83. .tab-body {
  84. padding-bottom: 20px;
  85. }
  86. .export{
  87. float: right!important;
  88. margin: 10px;
  89. }
  90. </style>