<template>
  <div id="peopleManage">
     <containerCmp v-if="agencies" :titHeader="agencies.name" active="peopleManage">
       <div class="centerCmp">
         <mapCmp :agencies="agencies"></mapCmp>
       </div>
       <div class="leftCmp">
         <dv-border-box-12 class="leftCmp-1">
           <pieCmp></pieCmp>
         </dv-border-box-12>
         <dv-border-box-12 class="leftCmp-1">
           <people-scroll-board v-if="!userInfo" @onEmit="handleClick"></people-scroll-board>
           <peopleThermometry v-if="userInfo" @onEmit="handleClick"></peopleThermometry>
         </dv-border-box-12>
         <dv-border-box-12 class="leftCmp-1">
           <moreCmp></moreCmp>
         </dv-border-box-12>
       </div>
       <div class="rightCmp">
         <dv-border-box-13 class="rightCmp-1">
           <peopleCapture  v-if="!userInfo" @onEmit="handleClick"></peopleCapture>
           <carCapture v-if="userInfo" showType="4" @onEmit="handleClick"></carCapture>
         </dv-border-box-13>
         <dv-border-box-13 class="rightCmp-1">
           <estateSearch v-if="!userInfo" title="人员查询" @onSearch="onSearch"></estateSearch>
           <parkSearch v-if="userInfo" title="人员查询" @onSearch="onSearch"></parkSearch>
         </dv-border-box-13>
         <dv-border-box-13 class="rightCmp-1">
           <scrollBoard v-if="!userInfo" ref="searchList" showType="people" @onEmit="handleClick"></scrollBoard>
            <scrollBoard v-if="userInfo" ref="searchList" showType="parkPeople" @onEmit="handleClick"></scrollBoard>
         </dv-border-box-13>
       </div>
     </containerCmp>
  </div>
</template>

<script>
  import containerCmp from "./common/containerCmp.vue"
import scrollBoard from './components/scrollBoard'
import peopleScrollBoard from './components/peopleScrollBoard.vue'
import topBar from './components/topBar.vue'
import moreCmp from './components/moreCmp.vue'
import pieCmp from './components/pieCmp.vue'
import parkSearch from './components/parkSearch.vue'
import estateSearch from './components/estateSearch.vue'
import mapCmp from './components/map.vue'
import peopleCapture from './components/peopleCapture.vue'
import {getUserInfo} from "../../util/util";
import peopleThermometry from './components/peopleThermometry.vue'
import  carCapture from "./components/carCapture.vue"
export default {
  name: 'DataView2',
  components: {
    carCapture,
    containerCmp,
    peopleScrollBoard,
    peopleThermometry,
    topBar,
    moreCmp,
    pieCmp,
    parkSearch,
    estateSearch,
    mapCmp,
    scrollBoard,
    peopleCapture
  },
  data () {
    return {
      agencies:'',
      userInfo:false

    }
  },
  created() {
    this.agencies = JSON.parse(localStorage.getItem('agencies2'))
  },
  mounted() {
    this.userInfo = getUserInfo()
  },
  methods:{
    handleClick(row,params){
      this.$datavAlert({
        title:params.title,
        showType:params.type,
        detailData:row
      })
    },
    onSearch(data){
      this.$refs.searchList.loadData(data)
    },
    handleClickMap(){
      this.$router.push({path:'index3'})
    }
  }
}
</script>

<style lang="less">
#peopleManage {
  .leftCmp-1,.rightCmp-1{
    height:33.33%;
  }
}
</style>
