<template>
  <div class="widget-progressModule">
    <!--进度统计-->
    <StatisticalProgress />
    <!--工程情况-->
    <ProjectSituationofPM :dataInfo="dataInfo" />
    <!--CWP进度-->
    <!-- <ProgressofCWP /> -->
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import StatisticalProgress from './StatisticalProgress.vue'
import ProjectSituationofPM from './ProjectSituationofPM.vue'
import ProgressofCWP from './ProgressofCWP.vue'
import { getWeekCountData } from '../../../apis'
//统计分析-进度模块
@Component({
  name: 'progressModule',
  components: { StatisticalProgress, ProjectSituationofPM, ProgressofCWP }
})
export default class progressModule extends Vue {
  dataInfo = null
  mounted() {
    this.getPageData()
  }
  get projectCode() {
    return this.$store.state.bigScreen.currentProjectCode
  }
  async getPageData() {
    const res = await getWeekCountData({ code: this.projectCode })
    if (!res.result) return
    Object.keys(res.result).forEach((val) => (res.result[val] = res.result[val] || 0))
    this.dataInfo = res.result
  }
}
</script>

<style></style>