<template>
  <div class="max-big-box-one">
    <div class="big-max-box-one">
      <div class="left-max-box">
        <!--树结构-->
        <el-tree class="max-tree-box TabStrip" :indent="0"
                 ref="dataConfigTree"
                 default-expand-all
                 :expand-on-click-node="false"
                 node-key="id" :highlight-current="false"
                 :data="leftTopData" icon-class="none">
          <div class="tree-box" slot-scope="{ node, data }" @click="clickTree(data,node)">
            <!--<img :class="{'levelImg':node.level==1}" v-if="node.expanded&&node.childNodes[0]"-->
                 <!--src="~@/assets/images/icon_42.png">-->
            <!--<img :class="{'levelImg':node.level==1}" v-if="!node.expanded&&node.childNodes[0]"-->
                 <!--src="~@/assets/images/icon_43.png">-->
            <p class="label-p"
               :class="{'level1':node.level==1,'level2':node.level==2,'level3':node.level==3,'levelColorA':node.checked||node.indeterminate,'levelColorB':!node.checked&&!node.indeterminate}"
            >{{ node.label }}</p>
          </div>
        </el-tree>
      </div>
      <div class="right-max-box">
        <div class="right-top-box">
          <img src="~@/assets/images/xian_1.png">
          <img src="~@/assets/images/icon_08.png">
          <p>战备库房分布</p>
          <img src="~@/assets/images/xian_2.png">
        </div>
        <!--<img class="demo-img" src="~@/assets/images/demo.png">-->
        <iframe
          class="right-max-box-webMapURL"
          :src="webMapURL" scrolling="auto" frameborder="0">
        </iframe>
      </div>
    </div>
  </div>
</template>

<script>
  import { webMap_URL } from '@/api/config'
  import { deptTreeselect } from '@/api/userApi'
  export default {
    name: "distributionOfCombatReadinessForces",//战备力量分布展示
    data () {
      return {
        webMapURL:webMap_URL,
        //树数据
        leftTopData: [],
      }
    },

    created(){

    },
    mounted() {
      this.deptTreeselect();
    },
    methods: {
      //获取数据权限树
      //获取组织架构树状数据
      async deptTreeselect () {
        let self = this;
        const { data } = await deptTreeselect();
        if(data.code==200){
          this.leftTopData = data.data;
        }
      },
      //树状点击事件
      clickTree(data,node){
        if(node.checked){
          this.$refs.dataConfigTree.setCheckedKeys([]);
        }else{
          this.$refs.dataConfigTree.setCheckedKeys([node.data.id]);
        }
      },
    }
  }
</script>

<style scoped lang="stylus">
  .max-big-box-one
    display flex
    flex:1;
    .big-max-box-one
      margin:0 105px;
      flex:1;
      display flex
      .left-max-box
        width:219px;
        .max-tree-box
          z-index:1;
          overflow-x:hidden;
          overflow-y:scroll;
          white-space: nowrap;
          margin-top: 55px;
          .tree-box
            display flex
            img
              display block
              width:20px;
              height:20px;
            p
              margin-left:8px;
      .right-max-box
        width:1490px;
        .right-top-box
          margin:0 auto;
          display flex
          height:47px;
          width:694px;
          img:nth-child(1)
            margin-top:22px;
            height:3px;
            width:242px;
          img:nth-child(2)
            margin: 15px 0px 0 14px;
            height: 20px;
            width: 20px;
            display block
          p:nth-child(3)
            width:166px;
            line-height:47px;
            color:$color_ff;
            font-size:$font_24
          img:nth-child(4)
            margin-top:22px;
            height:3px;
            width:242px;
        .demo-img
          margin-top:10px;
          width:1400px;
          height:680px;
        .right-max-box-webMapURL
          margin-top:10px;
          width:1400px;
          height:680px;
  //树状图
  .el-tree
    background rgba(0,0,0,0) !important
  /*多层级样式*/
  .levelImg{
    margin-top: 7px;
  }
  .level1{
    font-size:$font_17;
    color:$theme !important;
    height:34px;
    line-height 34px
  }
  .level2{
    font-size:$font_14;
    height:22px;
    line-height 22px
  }
  .level3{
    font-size:$font_12;
    height:20px;
    line-height 20px
  }
  .levelColorA{
    color:$color_ff;
  }
  .levelColorB{
    color:$color_91;
  }
  /*层级指引线*/
  .tree-container /deep/ .el-tree > .el-tree-node :after {
    border-top: none;
  }
  .el-tree /deep/ .el-tree-node .el-tree-node {
    position: relative;
    padding-left: 16px !important;
  }
  .el-tree /deep/ .el-tree-node__children {
    padding-left: 16px;
  }

  .el-tree /deep/ .el-tree-node :last-child:before {
    height: 38px;
  }

  .el-tree /deep/ .el-tree > .el-tree-node:before {
    border-left: none;
  }

  .tree-container /deep/ .el-tree > .el-tree-node:after {
    border-top: none;
  }

  .el-tree /deep/ .el-tree-node .el-tree-node:before {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree /deep/ .el-tree-node .el-tree-node:after {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree /deep/ .el-tree-node:before {
    border-left: 1px dashed #4386c6;
    bottom: 0px;
    height: 100%;
    top: -26px;
    width: 1px;
  }

  .el-tree /deep/ .el-tree-node:after {
    border-top: 1px dashed #4386c6;
    height: 20px;
    top: 12px;
    width: 24px;
  }

  .tree-container { //树的parent，样式自定
  }
  .el-tree /deep/ .el-tree-node__content .el-tree-node__expand-icon{
    padding:1px !important
  }
  //修改悬浮样式
  .el-tree /deep/ .el-tree-node:focus > .el-tree-node__content {
    background-color: rgba(0,0,0,0) !important;
  }
  .el-tree /deep/ .el-tree-node__content:hover {    background-color: rgba(0,0,0,0);
  }
  .el-tree /deep/ .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
    background-color: rgba(0,0,0,0);
  }
</style>
