index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script setup lang="ts">
  2. import { ref } from 'vue'
  3. import type { TabsPaneContext } from 'element-plus'
  4. import CombinedDisplay from '/src/views/reportManage/dataCenter/combinedDisplay/index.vue'
  5. // import DataExport from '/src/views/reportManage/dataCenter/normalDisplay/components/DataExport.vue'
  6. import CompareData from '/src/views/reportManage/dataCenter/normalDisplay/components/CompareData.vue'
  7. import NormalDisplay from '/src/views/reportManage/dataCenter/normalDisplay/index.vue'
  8. const activeName = ref('NormalDisplay')
  9. const tabsComponents: any = {
  10. NormalDisplay,
  11. CombinedDisplay,
  12. // CompareData,
  13. // DataExport,
  14. }
  15. const panes = [
  16. { label: '普通展示', name: 'NormalDisplay' },
  17. { label: '合并展示', name: 'CombinedDisplay' },
  18. // { label: '对比数据', name: 'CompareData' },
  19. // { label: '数据导出', name: 'DataExport' },
  20. ]
  21. /**
  22. *
  23. * @param tab
  24. * @param event
  25. */
  26. function handleTabClick(tab: TabsPaneContext, event: Event) {
  27. return 'test name'
  28. }
  29. </script>
  30. <template>
  31. <div class="pr-2">
  32. <el-tabs v-model="activeName" type="border-card" class="demo-tabs" @tab-click="handleTabClick">
  33. <el-tab-pane v-for="pane in panes" :key="pane.name" :label="pane.label" :name="pane.name"></el-tab-pane>
  34. <component :is="tabsComponents[activeName]"></component>
  35. </el-tabs>
  36. </div>
  37. </template>
  38. <style scoped>
  39. .demo-tabs > .el-tabs__content {
  40. padding: 32px;
  41. color: #6b778c;
  42. font-size: 32px;
  43. font-weight: 600;
  44. }
  45. </style>