<template>
  <div id="unit" class="flex-row">
    <black-list-list class="binary-left" v-ref:list :row="row"   :style="style" @select-changed="selected"
                     style="width:auto;"></black-list-list>
    <div class="binary-right" style="overflow-y: auto;" v-if="isdetail" :style="{width: isdetail?'50%':'auto'}">
      <!-- <p class="bg-info text-center" style="padding: 8px;" v-if="row.pricecount">气价变更情况汇总</p> -->
      <black-list style="height: 55%; margin-bottom: 30px;"  :data="row" v-ref:gas></black-list>
      <div  v-show="row" class="auto">
        <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  v-show="row" class="auto">
        <ul class="nav nav-tabs" >
          <li class="active"><a href="#">限购充值明细</a></li>
        </ul>
        <black-list-detail v-ref:update :data="row"></black-list-detail>
      </div>
      <div class="auto">
        <upload :blodid="blodid" cols="col-sm-12" isremark="true" fusetype="黑名单"></upload>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    title: '黑名单管理',
    data () {
      return {
        style: 'col-sm-2 form-group',
        row: null,
        blodid: '',
        parentData: '',
        isdetail: false
      }
    },
    methods: {
      selected (obj) {
        if (obj.val) {
          this.style = 'col-sm-3 form-group'
          this.row = obj.val
          this.blodid = this.row.f_userinfo_id
          this.isdetail = true
        }
      }
    },
    ready () {
      console.log(this.isdetail, '=============')
    },
    events: {
      'success' (name, row, res) {
        // this.style='col-sm-2'
        this.row = null
        this.blodid = ''
        this.isdetail = false
        this.$refs.list.search()
      },
      'error' (name, row, res) {
        this.row = null
        this.blodid = ''
        this.isdetail = false
        this.$refs.list.search()
      },
      'close' (res) {
        this.style = 'col-sm-2 form-group'
        this.row = null
        this.blodid = ''
        this.isdetail = false
      },
      'search' () {
        this.style = 'col-sm-2 form-group'
        this.row = null
        this.blodid = ''
        this.isdetail = false
        // this.$refs.list.search()
      },
      'add' () {
        this.style = 'col-sm-3 form-group'
        this.isdetail = true
        this.blodid = ''
        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>
