index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="widget-projectPanoramic">
  3. <!--项目概况-->
  4. <ProjectOverview :dataInfo="dataInfo" />
  5. <!--参建单位-->
  6. <ParticipationUnits />
  7. <!--项目图册-->
  8. <ProjectPhotos />
  9. <!--项目进展-->
  10. <ProjectProgressNew :dataInfo="dataInfo" />
  11. <!--项目统计-->
  12. <ProjectIndexStatistic :dataInfo="dataInfo" />
  13. </div>
  14. </template>
  15. <script lang="ts">
  16. import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
  17. import ProjectOverview from './ProjectOverview.vue'
  18. import ParticipationUnits from './ParticipationUnits.vue'
  19. import ProjectPhotos from './ProjectPhotos.vue'
  20. import ProjectProgressNew from './ProjectProgressNew.vue'
  21. import ProjectIndexStatistic from './ProjectIndexStatistic.vue'
  22. import { getEpcProjectInfo } from '../../apis'
  23. //
  24. import pbsTree from '../../districtPageModules/customTools/pbsTree.vue'
  25. //工程全景模块
  26. @Component({
  27. name: 'projectPanoramic',
  28. components: { ProjectOverview, ParticipationUnits, ProjectPhotos, ProjectProgressNew, ProjectIndexStatistic }
  29. })
  30. export default class projectPanoramic extends Vue {
  31. pbsTreeInfo = null
  32. dataInfo = null
  33. mounted() {
  34. this.initModulesContentShow()
  35. this.getPageData()
  36. }
  37. get projectCode() {
  38. return this.$store.state.bigScreen.currentProjectCode
  39. }
  40. get isInitViewer() {
  41. return this.$store.state.bigScreen.isInitViewer
  42. }
  43. @Watch('isInitViewer')
  44. onChangeMethod(val) {
  45. if (val) this.initModulesContentShow()
  46. }
  47. //初始化显示模块内容
  48. initModulesContentShow() {
  49. if (!this.isInitViewer) return
  50. const pbsTreeConstructor = Vue.extend(pbsTree)
  51. this.pbsTreeInfo = new pbsTreeConstructor({
  52. store: this.$store
  53. }).$mount()
  54. ;(this.pbsTreeInfo as any).externalInit()
  55. }
  56. async getPageData() {
  57. const res = await getEpcProjectInfo({ code: this.projectCode })
  58. if (!res.result) return
  59. Object.keys(res.result).forEach((val) => (res.result[val] = res.result[val] || 0))
  60. this.dataInfo = res.result
  61. }
  62. beforeDestroy() {
  63. if (this.pbsTreeInfo) {
  64. ;(this.pbsTreeInfo as any).externalClear()
  65. this.pbsTreeInfo = null
  66. }
  67. }
  68. }
  69. </script>
  70. <style></style>