1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <div class="widget-projectPanoramic">
-
- <ProjectOverview :dataInfo="dataInfo" />
-
- <ParticipationUnits />
-
- <ProjectPhotos />
-
- <ProjectProgressNew :dataInfo="dataInfo" />
-
- <ProjectIndexStatistic :dataInfo="dataInfo" />
- </div>
- </template>
- <script lang="ts">
- import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
- import ProjectOverview from './ProjectOverview.vue'
- import ParticipationUnits from './ParticipationUnits.vue'
- import ProjectPhotos from './ProjectPhotos.vue'
- import ProjectProgressNew from './ProjectProgressNew.vue'
- import ProjectIndexStatistic from './ProjectIndexStatistic.vue'
- import { getEpcProjectInfo } from '../../apis'
- import pbsTree from '../../districtPageModules/customTools/pbsTree.vue'
- @Component({
- name: 'projectPanoramic',
- components: { ProjectOverview, ParticipationUnits, ProjectPhotos, ProjectProgressNew, ProjectIndexStatistic }
- })
- export default class projectPanoramic extends Vue {
- pbsTreeInfo = null
- dataInfo = null
- mounted() {
- this.initModulesContentShow()
- this.getPageData()
- }
- get projectCode() {
- return this.$store.state.bigScreen.currentProjectCode
- }
- get isInitViewer() {
- return this.$store.state.bigScreen.isInitViewer
- }
- @Watch('isInitViewer')
- onChangeMethod(val) {
- if (val) this.initModulesContentShow()
- }
-
- initModulesContentShow() {
- if (!this.isInitViewer) return
- const pbsTreeConstructor = Vue.extend(pbsTree)
- this.pbsTreeInfo = new pbsTreeConstructor({
- store: this.$store
- }).$mount()
- ;(this.pbsTreeInfo as any).externalInit()
- }
- async getPageData() {
- const res = await getEpcProjectInfo({ code: this.projectCode })
- if (!res.result) return
- Object.keys(res.result).forEach((val) => (res.result[val] = res.result[val] || 0))
- this.dataInfo = res.result
- }
- beforeDestroy() {
- if (this.pbsTreeInfo) {
- ;(this.pbsTreeInfo as any).externalClear()
- this.pbsTreeInfo = null
- }
- }
- }
- </script>
- <style></style>
|