<template>
  <div class="widget-statisticalAnalysis">
    <!--专题切换-->
    <ThemeSwitch />
    <!--进度模块-->
    <ProgressModule v-if="currentActive == 'progress'" />
    <!--质量模块-->
    <QulityModule v-if="currentActive == 'quality'" />
    <!--安全模块-->
    <SecurityModule v-if="currentActive == 'security'" />
    <!--投资模块-->
    <InvestModule v-if="currentActive == 'invest'" />
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
import ThemeSwitch from './ThemeSwitch.vue'
import ProgressModule from './progressModule/index.vue'
import QulityModule from './qualityModule/index.vue'
import SecurityModule from './securityModule/index.vue'
import InvestModule from './investModule/index.vue'
import { getStaticticalInfo } from '@/views/groupPage/apis'
//统计分析模块
@Component({
  name: 'statisticalAnalysis',
  components: { ThemeSwitch, ProgressModule, QulityModule, SecurityModule, InvestModule }
})
export default class statisticalAnalysis extends Vue {
  get currentActive() {
    return this.$store.state.bigScreen.currentStatisticalActive
  }
  @Watch('currentActive')
  onChangeMethod(val) {
    if (val == 'progress') this.getStaData()
  }
  async getStaData() {
    const result = await getStaticticalInfo({})
    if (!result || !result.result) return
    this.$store.state.bigScreen.statisticalAnalysisInfo = result.result
  }
  destroyed() {
    this.$store.state.bigScreen.currentStatisticalActive = null
  }
}
</script>

<style></style>