<template>
  <div class="widget-qualityModule">
    <!--质量验评情况-->
    <QualityEvaluationNew :dataInfo="dataInfo" />
    <!--近期工程情况-->
    <ProjectSituationofQMNew :dataInfo="dataInfo" />
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import QualityEvaluationNew from './QualityEvaluationNew.vue'
import ProjectSituationofQMNew from './ProjectSituationofQMNew.vue'
import { getWeekCountData } from '../../../apis'
//统计分析-质量模块
@Component({
  name: 'qualityModule',
  components: { QualityEvaluationNew, ProjectSituationofQMNew }
})
export default class qualityModule 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>