<template>
  <a-layout>
    <a-layout-content>
      <a-row :gutter="10">
        <a-col :span="leftWidth">
          <tree-group @sendCurrentNodeinfo="sendCurrentNodeinfo"></tree-group>
        </a-col>
        <a-col :span="rightWidth" style="position: relative;">
          <plan-content :currentSelectTreeNodePsn="currentNodeinfo.currentSelectTreeNodePsn" :currentSelectTreeNodeId="currentNodeinfo.currentSelectTreeNodeId"></plan-content>
          <div class="open_board">
            <a-icon type="left" v-if="isOpen" @click="closeLeft"/>
            <a-icon type="right" v-else @click="openLeft"/>
          </div>
        </a-col>
      </a-row>
    </a-layout-content>
  </a-layout>
</template>

<script>
import planContent from './planManageProvinceNew/planContentCounty.vue';
import treeGroup from './planManageProvinceNew/treeGroupCounty.vue';
export default {
  data() {
    return {
      leftWidth: 6,
      rightWidth: 18,
      isOpen: true,
      orgType: '111',
      currentNodeinfo: {}, // 当前选择树节点的信息，从子组件接收过来传给另一个子组件
    };
  },
  components: {
    treeGroup,
    planContent,
  },
  created() {},
  methods: {
    closeLeft() {
      this.isOpen = false;
      this.leftWidth = 0;
      this.rightWidth = 24;
    },
    openLeft() {
      this.isOpen = true;
      this.leftWidth = 6;
      this.rightWidth = 18;
    },
    sendCurrentNodeinfo(data) {
      this.currentNodeinfo = data;
    },
  },
};
</script>

<style lang='less' scoped>
.content_title {
  span {
    padding: 0 10px;
    font-size: 16px;
  }
  .hrs{
    display: inline-block;
    width: calc(100% - 40px);
    margin-left:10px;
    height: 1px;
    vertical-align: middle;
    background-color: #ddd;
  }
}
.open_board {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 30px;
  line-height: 30px;
  border: solid 1px #ddd;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  text-align: center;
  background-color: #bbebff;
  cursor: pointer;
}
</style>
