<template>
  <div id="unit" class="flex-row">
    <black-list-list class="binary-left" v-ref:list :row="row"   :style="style" @dblclick="selected" style="width:auto;"></black-list-list>
    <div style="margin-left: 10px;" class="binary-right" v-if="isdetail">
      <!-- <p class="bg-info text-center" style="padding: 8px;" v-if="row.pricecount">气价变更情况汇总</p> -->
      <black-list style="height: 40%; margin-bottom: 100px;"  :data="row" v-ref:gas></black-list>
      <div  v-show="row">
        <ul class="nav nav-tabs" >
          <li class="active"><a href="#">黑名单操作记录</a></li>
        </ul>
        <black-list-record v-ref:update :data="row"></black-list-record>
      </div>
      </div>
  </div>
</template>
<script>
  export default {
    title: '黑名单管理',
    data () {
      return {
        style:'col-sm-2',
        row: null,
        parentData: '',
        isdetail: false,
      }
    },
    methods: {
      selected (obj) {
        console.log()
        this.style='col-sm-3'
        this.row = obj
        console.log(this.row)
        this.isdetail = true
      },
    },
    ready(){
      console.log(this.isdetail,"=============")
    },
    events: {
      'success' (name, row, res) {
        //this.style='col-sm-2'
        this.row = null
        this.isdetail = false
        this.$refs.list.search()
      },
      'error' (name, row, res) {
        this.row = null
        this.isdetail = false
        this.$refs.list.search()
      },
      'close' (res) {
        this.style='col-sm-2'
        this.row = null
        this.isdetail = false
      },
      'search' () {
        this.style='col-sm-2'
        this.row = null
        this.isdetail = false
        // this.$refs.list.search()
      },
      'add' () {
        this.style='col-sm-3'
        this.isdetail = true
        this.$refs.list.$refs.paged.$refs.grid.selectStore.selected = null
        this.row = null
      }
    },
    watch:{
      'isdetail'(val){
        console.log(val,"===================")
      }
    }
  }
</script>
<style>
  .datapanel {
    color: #333;
    background-color: white;
    box-shadow: darkgrey 0.5px 0.5px 0.5px 0.5px ;
    padding: 10px 10px 5px 10px;
    border-radius:10px;
  }
</style>
