<template>
  <div style="float: left;clear:both;">
    <div v-for="(item,index) in list " class="status_tree2 clear" :key="index">
      <div v-show="item.isshow">
        <div class="clear" :style="{marginBottom:'20px',display:(parseInt(item.pid)===0?'block':'flex')}">
          <div v-if="item.isleaf===false" :style="{paddingLeft:(parseInt(item.pid)===0?'0px':'20px'),width:(parseInt(item.pid)===0?'100%':'10%')}"
            :class="[(parseInt(item.pid)===0?'clear':''),'title','fl']">{{item.name}}</div>
          <div class="fl " v-if="item.isleaf===false" :style="{width:(parseInt(item.pid)===0?'100%':'90%')}">
            <div v-if="item.level==='last'" v-for="(item2,index2) in item.cList" class="op fl" @click="outStatusChild($event,item2)"
              :style="{backgroundColor:item2.color}">{{item2.name}}</div>
            <tree-menus v-if="item.level==='parent'" :list="item.cList" class="clear"></tree-menus>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style>
  .status_tree2 .title {
    width: 90px;
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    float: left;
    display: inline-block;
    word-wrap: break-word;
    font-family: 'Arial Bold Oblique', 'Arial Bold', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: oblique;
    font-size: 19px;
    text-align: left;
    color: #333333;
  }

  .status_tree2 .op {
    background-color: #5cb85c;
    color: white;
    margin: 5px;
    margin-left: 0;
    border-radius: 1px;
    -webkit-box-shadow: 0 0 1px #bbb;
    box-shadow: 0 0 1px #bbb;
    margin-right: 20px;
    width: 120px;
    overflow: hidden;
    float: left;
    line-height: 30px;
    font-size: 15px;
    height: 30px;
    text-align: center;
  }

  .p1 {
    font-family: 'Arial Bold Oblique', 'Arial Bold', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: oblique;
    font-size: 15px;
    color: #103981;
    text-align: center;
  }

  .p2 {
    font-family: 'Arial Bold Oblique', 'Arial Bold', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: oblique;
    font-size: 15px;
    color: #103981;
    text-align: center;
  }

  .p3 {}

  .p4 {
    font-family: 'Arial Bold Oblique', 'Arial Bold', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: oblique;
    font-size: 12px;
    color: #103981;
    text-align: left;
  }

  .p5 {
    font-family: 'Arial Bold Oblique', 'Arial Bold', 'Arial Normal', 'Arial';
    font-weight: 700;
    font-style: oblique;
    font-size: 12px;
    color: #103981;
    text-align: left;
  }
</style>
<script>
export default {
    name: 'treeMenus',
    props: {
        list: Array
    },
    data () {
        return {
            addModal: false,
            loading: false
        }
    },
    created () {},
    methods: {
        outStatusChild (e, item) {
            this.$emit('activeName', item)
        }
    }
}
</script>
