<template>
  <div class="m-subbox m-jdjs">
    <div class="m-jdjs-js">
      <div class="m-jdjs-js-img">
        <img src="../linshi/jiedaotu.jpg" />
      </div>
      <div class="m-jdjs-js-txt">
        {{overview}}
      </div>
    </div>
    <div class="m-jdjs-bg">
      <div class="m-jdjs-bg-title">
        <div class="m-jdjs-bg-title-img">
          <img src="../../../../assets/images/shuju/overview/zjbg-icon.png" />
        </div>
        <div class="m-jdjs-bg-title-txt">总结报告</div>
      </div>
      <div class="m-jdjs-bg-txt">
        {{report}}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "jdjs",
  data() {
    return {
      orgId: this.$store.state.chooseArea.chooseName,
      report: "",
      overview: ""
    }
  },
  watch: {
    "$store.state.chooseArea.chooseName"(val) {
      console.log(val,'val')
      console.log(123)
      if(val.orgId) {
        this.getReport(val)
      }
    }
  },
  mounted() {
    console.log(this.orgId.orgId)
    if(this.orgId.orgId) {
      this.getReport(this.orgId)
    }
  },
  methods: {
    getReport({orgId,level}) {
      this.$http.get('/actual/base/streetOverview/communityOverview?orgId='+orgId+'&level='+level).then(({data: {data}}) => {
        this.overview = data
      })
      this.$http.get('/actual/base/streetOverview/summaryReport?orgId='+orgId+'&level='+level).then(({data: {data}}) => {
        this.report = data
      })
    }
  }
};
</script>

<style lang="scss" src="@/assets/scss/dataBoard/overview/index.scss" scoped/>
