pro_detail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class='flex flex-justify-start'>
  3. <div class="full-height">
  4. <pro-left :data="data" :code='code' @success='listSucc'/>
  5. </div>
  6. <div style='margin-left: 300px' class='full-width'>
  7. <basic-container>
  8. <basic-tab :tabs='tabs' @change='change'></basic-tab>
  9. </basic-container>
  10. <basic-container style='margin-top: 0'>
  11. <div v-if='currentTab.value === 1'>
  12. <div v-for='(item,index) in resultList' :key='item.id'>
  13. <a :href='`#header`+(index+1)'>
  14. <div class='full-width' :id="`header`+(index+1)">
  15. <params1 v-if='item.dictKey === "1" ' :info='item'/>
  16. </div>
  17. </a>
  18. </div>
  19. </div>
  20. <div v-else-if='currentTab.value === 2'>
  21. <div v-for='(item,index) in resultList' :key='item.id'>
  22. <a :href='`#header`+(index+1)'>
  23. <div class='full-width' :id="`header`+(index+1)">
  24. <inspect1 v-if='item.dictKey === "1" ' :info='item'/>
  25. </div>
  26. </a>
  27. </div>
  28. </div>
  29. <div v-else-if='currentTab.value === 3'>
  30. tab3
  31. </div>
  32. </basic-container>
  33. </div>
  34. </div>
  35. </template>
  36. <route>
  37. {
  38. name: '项目详情',
  39. meta: { keepAlive: true }
  40. }
  41. </route>
  42. <script>
  43. import proLeft from '@/views/home/component/pro_left.vue'
  44. import BasicContainer from '@/components/basic-container/main.vue'
  45. import BasicTab from '@/components/basic-tab/index.vue'
  46. import params1 from '@/views/home/component/params/params1.vue'
  47. import inspect1 from '@/views/home/component/inspect/Inspect1.vue'
  48. export default {
  49. name: 'pro_detail',
  50. components: { BasicContainer, proLeft, BasicTab, params1, inspect1 },
  51. data () {
  52. return {
  53. id: '',
  54. data: {},
  55. tabs: [
  56. { name: '项目信息管理', value: 1, code: 'params_type' },
  57. { name: '项目督查情况', value: 2, code: 'inspect_type' },
  58. { name: '项目数据明细管理', value: 3 }
  59. ],
  60. currentTab: null,
  61. resultList: [],
  62. code: 'params_type'
  63. }
  64. },
  65. created () {
  66. this.id = this.$route.query.id
  67. this.currentTab = this.tabs[0]
  68. this.proInfo()
  69. },
  70. methods: {
  71. change (res, index) {
  72. this.currentTab = res
  73. this.code = this.currentTab.code
  74. },
  75. /**
  76. * 项目信息
  77. */
  78. proInfo () {
  79. this.$api.project.projectInfo(this.id).then(res => {
  80. if (res.code === 200) {
  81. this.data = res.data
  82. }
  83. })
  84. },
  85. listSucc (list) {
  86. this.resultList = list
  87. }
  88. }
  89. }
  90. </script>
  91. <style scoped>
  92. </style>