details.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="content">
  3. <div>
  4. <v-tabs v-model="activeIndex">
  5. <v-tab v-for="item in items" :key="item.path" @click="handleClick(item)">{{ item.title }}</v-tab>
  6. </v-tabs>
  7. </div>
  8. <div style="flex: 1">
  9. <v-tabs-items v-model="activeIndex">
  10. <v-tab-item
  11. v-for="item in items"
  12. :key="item.path"
  13. >
  14. <component :is="item.path" :key="$route.fullPath" />
  15. </v-tab-item>
  16. </v-tabs-items>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import { loadDynamicComponents } from '@/utils'
  22. const vueComponent = require.context('./dynamic', true, /\.vue$/)
  23. const autoComponent = loadDynamicComponents(vueComponent)
  24. export default {
  25. name: 'data-model-details',
  26. components: {
  27. ...autoComponent
  28. },
  29. data () {
  30. return {
  31. activeIndex: 0,
  32. items: [
  33. {
  34. title: '基本信息',
  35. path: 'info'
  36. },
  37. {
  38. title: '关系图谱',
  39. path: 'graph'
  40. },
  41. {
  42. title: '元数据成员',
  43. path: 'metaData'
  44. },
  45. {
  46. title: '数据生产线',
  47. path: 'lineGraph'
  48. },
  49. // {
  50. // title: '数据',
  51. // path: ''
  52. // },
  53. {
  54. title: '接入数据',
  55. path: ''
  56. }
  57. // {
  58. // title: '映射关系',
  59. // path: ''
  60. // },
  61. // {
  62. // title: '数据依赖',
  63. // path: ''
  64. // }
  65. // {
  66. // title: '主数据信息',
  67. // path: ''
  68. // }
  69. ]
  70. }
  71. },
  72. created () {
  73. this.$route.meta.title = this.$route.params.name
  74. const savedTab = new URLSearchParams(window.location.search).get('tab')
  75. if (!savedTab) {
  76. this.activeIndex = 0
  77. return
  78. }
  79. this.activeIndex = this.items.findIndex(e => e.path === savedTab)
  80. },
  81. methods: {
  82. handleClick (item) {
  83. this.$router.push(`${this.$route.path}?tab=${item.path}`)
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. ::v-deep .v-window,.v-window-item {
  90. height: 100%;
  91. }
  92. </style>