<template>
  <div class="app-container part-container">
    <div class="view-content"><Infoheader :companyId="companyId" :companyInfo="companyInfo" :statistic="statistic" v-if="isShow" /></div><!-- 企业信息 -->
    <div class="view-content"><Operations :companyId="companyId" :financial="financial" v-if="isShow" /></div><!-- 公司经营 -->
    <div class="view-content"><Bidding :companyId="companyId" /></div><!--招标偏好、业务往来-->
    <div class="view-content"><Busclue :companyId="companyId" :statistic="statistic" v-if="statistic" /></div><!--商机线索-->
    <div class="view-content"><Relationship :companyId="companyId" :financial="financial" v-if="isShow" /></div><!--关系企业-->
    <div class="view-content"><Senior :companyId="companyId" /></div><!--高管-->
    <div class="view-content"><Risk :companyId="companyId" :statistic="statistic" v-if="isShow" /></div><!--风险概览-->
    <div class="view-content"><Tender :companyId="companyId" /></div><!--招标公告、企业动态-->
  </div>
</template>

<script>
import { statistic } from '@/api/detail/party-a/overview'
import { financial } from '@/api/detail/party-a/financial'
import Infoheader from "./component/infoheader"
import Operations from "./component/operations"
import Bidding from "./component/bidding"
import Busclue from './component/busclue'
import Relationship from './component/relationship'
import Senior from './component/senior'
import Risk from './component/risk'
import Tender from "./component/tender"
export default {
  name: 'Overview',
  props: ['companyId', 'companyInfo'],
  components: {
    Infoheader,
    Operations,
    Bidding,
    Busclue,
    Relationship,
    Senior,
    Risk,
    Tender
  },
  data() {
    return {
      isShow: false,
      statistic: {},
      financial: {}
    }
  },
  created() {
    this.handleQuery()
  },
  methods: {
    async handleQuery() {
      let [statis, financ] = await Promise.all([
        statistic({companyId: this.companyId}),
        financial({cid: this.companyId})
      ])
      if(statis.code==200){
        this.statistic = statis.data
      }
      if(financ.code==200){
        this.financial = financ.data
      }
      this.isShow = true
    }
  }
}
</script>

<style lang="scss" scoped>
  .part-container{
    margin: 0;
    padding: 0;
    .view-content{
      //margin-top: 12px;
    }
  }
</style>
