<template>
  <div id="perspective-area"   class="map-tool-model">
    <common-map-tool-title @close="close" title="可视域分析"/>
<!--    <div class="explain_border">-->
<!--      <span class="explain_content">请单击场景，放置观察点以及目标点</span>-->
<!--    </div>-->
    <div class="main_content  p20">
      <div class="single-block">
        <common-num-title title="选择绘制缓冲区要素类型" :num="1"/>
        <div class="single-row single_content">
          <button @click="selectSingleType" class="single_button">绘制视线</button>
        </div>
      </div>
      <div class="single-block">
        <common-num-title  title="选择角度" :num="2"/>
        <div class="single-row">
          <el-slider class="single_distance"
                     v-model="buffer_distance"
                     :max = "179" :min = "60"
                     show-input>
          </el-slider>
        </div>
      </div>
      <div class="bottom-btn">
        <div class="btn single_button" style="margin-right: 60px"  @click="clearPerspectiveArea()">清除</div>
        <div class="btn single_button" @click="runPerspectiveArea">运行分析</div>
      </div>
<!--      <div class="single_content">-->
<!--        <button @click="selectSingleType" class="single_button">绘制视线</button>-->
<!--      </div>-->
<!--      <div class="single_content">-->
<!--        <button @click="runPerspectiveArea" class="single_button">可视域分析</button>-->
<!--      </div>-->
<!--      <div class="single_content">-->
<!--        <button @click="clearPerspectiveArea" class="single_button">清除</button>-->
<!--      </div>-->
    </div>
  </div>


<!--  selectSingleType,runPerspectiveArea   -->
</template>

<script>
import CommonMapToolTitle from "@/components/common/CommonMapToolTitle";
import CommonNumTitle from "@/components/common/CommonNumTitle";
import {
  drawByType,
  importantAreaPosition,
  setWatchLineAny,
  ViewshedAnalysis,
  ViewshedArea,
  ViewshedLine
} from "@/units/map/AddLayer";
import {createNamespacedHelpers} from "vuex";
const {mapState,mapActions} = createNamespacedHelpers('platform')
export default {
  name: "PerspectiveArea",
  components:{CommonMapToolTitle,CommonNumTitle},
  computed:{
    ...mapState({
      currentDrawInfo:'currentDrawInfo'
    })
  },
  data(){
    return{
      buffer_distance:60,
      position:{
        X:'',
        Y:'',
        Z:'',
        radius:''
      }
    }
  },
  methods:{
    selectSingleType(){
      ViewshedLine('point',true)
    },
    close(){
      this.$emit('setToolDetailType','')
    },
    runPerspectiveArea(){
      ViewshedArea(true,this.buffer_distance)
    },
    clearPerspectiveArea(){
      ViewshedArea(false)
    }
  }
}
</script>

<style scoped lang="scss">
::v-deep{
  .el-select__tags{
    white-space: nowrap;
    overflow: hidden;
  }
  .el-select__input{
    color: #fff;
  }
  .el-select-dropdown__wrap{
    max-height: 150px;
  }
  .el-scrollbar__wrap{
    overflow-y: scroll;
    height: 100%;
  }
  .el-select-dropdown{
    position: absolute !important;
    left: 0px !important;
    border: 1px solid #00a1ff !important;
    background-color: rgba(0, 31, 112, 0.8) !important;
  }
  .el-select-dropdown__item.hover, .el-select-dropdown__item:hover{
    background-color: rgba(0, 31, 112, 1);
    color: #409EFF;
  }
  .el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{
    background-color: rgba(0, 31, 112, 1);
    color: #409EFF;
  }
  .el-select-dropdown.is-multiple .el-select-dropdown__item.selected{
    background-color: rgba(0, 31, 112, 1);
    color: #409EFF;
  }
  .el-tag.el-tag--info .el-tag__close{
    color: transparent !important;
  }
  .el-select .el-tag__close.el-icon-close{
    color: #409EFF  !important;
    background-color: transparent  !important;
  }
  .el-popper[x-placement^=bottom] .popper__arrow::after{
    border-bottom-color: rgba(0, 31, 112, 1);
  }
  .el-tag.el-tag--info {
    background-color: rgba(0, 31, 112, 0.8);
    border-color: #00a1ff;
    color: #409EFF;
  }
  .el-select-dropdown__item{
    color:#fff
  }
  .el-input-number__decrease, .el-input-number__increase{
    background: transparent;
    color: #fff;
  }
  .el-slider__runway.show-input{
    margin-right: 120px;
  }
  .el-slider__input{
    width: 110px;
  }
}
#perspective-area{
  position: absolute;
  z-index: 1;
  width: 300px;
  top: 89px;
  right: 120px;
  .explain_border{
    margin: 10px;
    padding: 5px 10px;
    .explain_content{
      font-size: 16px;
    }
  }
  .main_content{
    .single-block {
      display: flex;
      flex-direction: column;

      .title_type{
        color: #fff;
        .span_1{
          padding-left: 15px;
        }
        .span_2{
          padding-left: 130px;
        }
        padding-bottom: 5px;
      }
      .single-row {
        padding-bottom: 10px;
        color: #fff;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        .single_distance{
          width: 95%;
          padding-left: 5%;
        }
        .type_icon{
          cursor: pointer;
          padding: 5px 20px;
          margin-left: 20px;
          border-radius: 2px;
          border: 1px solid rgba(0, 170, 255, 0.8);
        }
        .type_icon_chosen{
          background-color: rgba(0, 204, 255, 0.7);
        }
      }
      .single_result{
        padding-left: 20px;
        color: #fff;
      }
    }
    .single_content{
      height:40px;
      display: flex;
      justify-content: center;
      align-items: center;
      .single_button{
        color:#fff;
        width: 100%;
        padding: 5px;
        cursor: pointer;
        text-align: center;
        background-color: #0079c1;
        border: 1px solid #0079c1;
      }
    }
  }
}
</style>
