<template>
  <div id="show-platform" v-loading="loading" element-loading-text="数据分析中" element-loading-spinner="el-icon-loading"  element-loading-background="rgba(0, 0, 0, 0.8)">
    <map-use/>

    <my-header/>
    <login-out/>
    <left-menu v-show="leftShowType!=='Statistics'" :leftShowType="leftShowType" @setLeftShow="setLeftShow" @setLayerDetailModelShow = "setLayerDetailModelShow" />
    <statistics-info v-show="leftShowType!=='Menu'" :leftShowType="leftShowType"  @setLeftShow="setLeftShow"/>
    <right-tool @setToolType="setToolType" @setControlType="setControlType" />
    <bottom-category :type="type" @setLeftShow="setLeftShow"/>
    <bottom-category-button :type="type" @setType="setType"/>
    <address-search v-if="toolType=='addressSearch'" />
    <space-statistics v-if="toolType=='spaceStatistics'" @setToolType ="setToolType"  @setToolDetailType="setToolDetailType" @setLoading = "setLoading"  />
    <space-statistics-result v-if="toolDetailType=='spaceStatisticsResult'" @setToolDetailType="setToolDetailType" @setLoading = "setLoading"  />
    <round-view v-if="toolType=='roundView'"  />

    <buffer-analysis v-if="toolType=='bufferAnalysis'" @setToolType ="setToolType" @setToolDetailType="setToolDetailType" @setLoading = "setLoading" />
    <fly-way v-if="toolType=='flyWay'" @setToolDetailType="setToolDetailType" />
    <fly-item v-if="toolDetailType=='flyItem'" @setToolDetailType="setToolDetailType" />
    <bookmark v-if="toolType=='bookmark'"/>
    <greenbelt  v-if="toolType=='greenbelt'" @setToolType ="setToolType"  @setToolDetailType="setToolDetailType"/>
    <greenbelt-analysis  v-if="toolDetailType=='greenbeltAnalysis'" @setToolType ="setToolType"  @setToolDetailType="setToolDetailType" />
    <greenbelt-analysis-dynamic v-if="toolDetailType=='greenbeltAnalysisDynamic'" @setToolType ="setToolType"  @setToolDetailType="setToolDetailType" @setLoading = "setLoading"  @setToolDetailResultType = "setToolDetailResultType"/>
    <greenbelt-analysis-dynamic-result v-if="toolDetailResultType=='greenbeltAnalysisDynamicResult'"  @setToolDetailResultType = "setToolDetailResultType" @setLoading = "setLoading"  />
<!--    <composi-ana v-if="toolType=='compositionAnalysis'" @setToolType ="setToolType"  />-->
    <base-map-change v-if="controlType=='baseMapChange'" />
    <composition-analysis v-if="toolType=='compositionAnalysis'" @setToolType ="setToolType"   @setToolDetailType="setToolDetailType" @setLoading = "setLoading"   />
    <composition-result v-if="toolDetailType=='compositionResult'" @setToolDetailType="setToolDetailType" @setLoading = "setLoading"   />
    <sun-analysis v-if="toolType=='sunAnalysis'"  @setToolDetailType ="setToolDetailType" />
    <single-sun-analysis v-if="toolDetailType=='singleSunAnalysis'" @setToolDetailType="setToolDetailType" />
    <single-sun-analysis-detail v-if="toolDetailType=='singleSunAnalysisDetail'" @setToolDetailType="setToolDetailType"  />
    <buffer-analysis-result v-if="toolDetailType=='bufferAnalysisResult'" @setToolDetailType="setToolDetailType"  @setLoading = "setLoading"  />
    <more-screen v-if="toolType=='moreScreen'" @setScreenList ="setScreenList" />
    <perspective-analysis v-if="toolType=='perspectiveAnalysis'"  @setToolDetailType ="setToolDetailType" />
    <perspective-area v-if="toolDetailType=='perspectiveWatchArea'" @setToolDetailType="setToolDetailType"/>
    <single-layer-detail-model :dialog-visible.sync = "layerDetailModelShow" title="资源详细信息" ref="single_layer_detail_model" />
    <single-screen-select :position="item.position" :mapID ="item.mapID" :viewID="item.viewID" v-for="item in screenList" :key="item.id"/>
    <coordinate-transform v-if="toolType=='coordinateTransform'" @setToolType ="setToolType" @setToolDetailType="setToolDetailType" @setLoading = "setLoading"  />
    <coordinate-transform-result v-if="toolDetailType=='coordinateTransformResult'" @setToolDetailType="setToolDetailType"  @setLoading = "setLoading" />
  </div>
</template>

<script>
import MapUse from "@/view/show-platform/common/MapUse";
import MyHeader from "@/view/show-platform/common/MyHeader";
import LeftMenu from "@/view/show-platform/common/LeftMenu";
import StatisticsInfo from "@/view/show-platform/common/StatisticsInfo";
import RightTool from "@/view/show-platform/common/RightTool";
import BottomCategory from "@/view/show-platform/common/BottomCategory";
import LoginOut from "@/view/show-platform/common/LoginOut";
import BottomCategoryButton from "@/view/show-platform/common/BottomCategoryButton";
import AddressSearch from "@/view/show-platform/common/tool-component/AddressSearch";
import SingleLayerDetailModel from "@/view/show-platform/common/tool-component/single-layer-detail/SingleLayerDetailModel";
import FlyWay from "@/view/show-platform/common/tool-component/fly-way/FlyWay";
import FlyItem from "@/view/show-platform/common/tool-component/fly-way/FlyItem";
import Bookmark from "@/view/show-platform/common/tool-component/Bookmark";
import MoreScreen from "@/view/show-platform/common/tool-component/more-screen/MoreScreen";
import SingleScreenSelect from "@/view/show-platform/common/tool-component/more-screen/SingleScreenSelect";
import PerspectiveAnalysis from "@/view/show-platform/common/tool-component/perspective-analysis/PerspectiveAnalysis";
import PerspectiveArea from "@/view/show-platform/common/tool-component/perspective-analysis/PerspectiveArea";
import SpaceStatistics from "@/view/show-platform/common/tool-component/space-statistics/SpaceStatistics";
import GreenbeltAnalysis from "@/view/show-platform/common/tool-component/greenbeltAnalysis/GreenbeltAnalysis";
import CompositionAnalysis from "@/view/show-platform/common/tool-component/compositionAnalysis/CompositionAnalysis";
import CompositionResult from "@/view/show-platform/common/tool-component/compositionAnalysis/CompositionResult";
import BufferAnalysis from "@/view/show-platform/common/tool-component/bufferAnalysis/BufferAnalysis";
import ComposiAna from "@/view/show-platform/common/tool-component/compositionAnalysis/ComposiAna";
import BaseMapChange from "@/view/show-platform/common/tool-component/baseMapChange/BaseMapChange";
import BufferAnalysisResult from "@/view/show-platform/common/tool-component/bufferAnalysis/BufferAnalysisResult";
import Greenbelt from "@/view/show-platform/common/tool-component/greenbeltAnalysis/Greenbelt";
import GreenbeltAnalysisDynamic from "@/view/show-platform/common/tool-component/greenbeltAnalysis/GreenbeltAnalysisDynamic";
import GreenbeltAnalysisDynamicResult from "@/view/show-platform/common/tool-component/greenbeltAnalysis/GreenbeltAnalysisDynamicResult";
import CoordinateTransform from "@/view/show-platform/common/tool-component/coordinateTransform/CoordinateTransform";
import CoordinateTransformResult from "@/view/show-platform/common/tool-component/coordinateTransform/CoordinateTransformResult";
import SpaceStatisticsResult from "@/view/show-platform/common/tool-component/space-statistics/SpaceStatisticsResult";
import RoundView from "@/view/show-platform/common/tool-component/roundView/RoundView";
import SunAnalysis from "@/view/show-platform/common/tool-component/sunAnalysis/SunAnalysis";
import SingleSunAnalysis from "@/view/show-platform/common/tool-component/sunAnalysis/SingleSunAnalysis";
import SingleSunAnalysisDetail from "@/view/show-platform/common/tool-component/sunAnalysis/SingleSunAnalysisDetail";
import {
  addBufferLayer,
  calculation3D,
  changeShowSlice,
  clearMapDraw, getDefinedLayer,
  setMapCircleWatch,
  setMapScreenSplit, setMapSumAna,
  setWatchLineAny, ViewshedArea,
} from "@/units/map/AddLayer";
export default {
  name: "ShowPlatform",
  components: {BottomCategoryButton, LoginOut, MapUse,MyHeader,
    LeftMenu,StatisticsInfo,RightTool,BottomCategory,AddressSearch,
    SingleLayerDetailModel,FlyWay,FlyItem,Bookmark,MoreScreen,SingleScreenSelect,
    PerspectiveAnalysis,PerspectiveArea,SpaceStatistics,GreenbeltAnalysis,CompositionAnalysis,
    CompositionResult,BufferAnalysis,ComposiAna,BaseMapChange,BufferAnalysisResult,Greenbelt,GreenbeltAnalysisDynamic,
    GreenbeltAnalysisDynamicResult,CoordinateTransform,CoordinateTransformResult,SpaceStatisticsResult,RoundView,SunAnalysis,SingleSunAnalysis,SingleSunAnalysisDetail},
  data(){
    return{
      loading: false,
      layerDetailModelShow:false,
      leftShowType:'Menu',
      type:'categoryShow',
      toolType:'',
      controlType:'',
      toolDetailType:'',
      toolDetailResultType:'',
      screenList:[
      ]
    }
  },
  methods:{
    setType(type){
      this.type = type;
    },
    setLoading(type){
      this.loading = type;
    },
    setToolDetailType(type){
      this.toolDetailType = type;
    },
    setToolDetailResultType(type){
      this.toolDetailResultType = type;
    },
    setLayerDetailModelShow(code){
      this.layerDetailModelShow = true;
      this.$refs["single_layer_detail_model"].layerCode = code;
    },
    setLeftShow(leftShowType){
      this.leftShowType = leftShowType;
    },
    setScreenList(screenList){
      this.screenList = screenList;
    },
    setControlType(controlType){
      debugger
      this.controlType = controlType;
    },
    setToolType(toolType){
      this.toolType = toolType;
      switch (toolType){
        case '':
          clearMapDraw(true,true,true);
          changeShowSlice("clear")
          setMapCircleWatch(false)
          setMapScreenSplit(false);
          calculation3D('',false);
          addBufferLayer(true);
          this.screenList = [];
          setMapSumAna(false);
          getDefinedLayer(true);
          setWatchLineAny('line',false);
          ViewshedArea(false)
          this.toolDetailType = ''
          break;
        default:
          break;
      }
    }
  }
}
</script>

<style scoped lang="scss">
#show-platform{
  width: 100%;
  height:100%;
  overflow: hidden;
}

</style>
