<template lang="html">
  <div class="flex-row">
      <div class="basic-main ">
        <div class="row" style="width: 50%;height: 10%">
          <div class="col-sm-4 form-group">
              <label class="font_normal_body">街道:</label>
              <input type="text" class="input_search" v-model="model.f_road" style="width: 60%"
                     condition=" f_street like '{}%'"placeholder="输入街道">
          </div>
          <div class="col-sm-4 form-group">
              <label class="font_normal_body">小区:</label>
              <input type="text" class="input_search" v-model="model.f_districtname"  style="width: 60%"
                     condition=" f_districtname like '{}%'"placeholder="输入小区">
          </div>
            <div class="col-sm-4 form-group">
                <button class="button_search" @click="search()" style="margin-top: 1%">查询</button>
            </div>
        </div>
          <div class="row" style="height: 90%">
              <hhhh  :show="true" class="sapn" v-ref:h></hhhh>
          </div>
      </div>
      <!-- <div class="span">

      </div> -->

  </div>
</template>

<script>
export default {
  title: '树状图',
  data () {
    return {
      model: {
        f_road: '',
        f_districtname: ''
      },
      f_road: '1',
      f_districtname: '1'
    }
  },
  methods: {
    search () {
      if (this.model.f_road === '') {
        this.f_road = '1'
      } else {
        this.f_road = this.model.f_road
      }
      if (this.model.f_districtname === '') {
        this.f_districtname = '1'
      } else {
        this.f_districtname = this.model.f_districtname
      }
      let data = {f_districtname: this.f_districtname, f_road: this.f_road}
      this.$refs.h.searchuserinfotree(data)
    }
  }
}
</script>
