<template>
   <div>
       <div style="height: 60px; text-align: center; font-size: 20px; display: block; font-weight: bold; background-color: #0071a9; color: #fff; line-height: 60px; ">
                      
        </div>
        <div style="height: calc(100% - 60px)">
                <div style="height:50px">
                    <span style="margin-left:15px">筛选：</span>
                        <input v-model="searchText" type="text" style="width:162px;height: 22px;margin-top: 12px;margin-left: 15px">
            </div>
            <div style="overflow-y:auto;height: calc(100% - 50px)">
                <table class="public_table" >
                    <tbody>
                            <tr v-for="(item,index) in data_filter" @click="locate(item)">
                                <td v-text="item.name"></td>
                            </tr>
                    </tbody>
            </table>
            </div>
        </div>
   </div>
</template>

<script>
  module.exports = {
        data: function() {
            debugger;
            return {
                  searchText:""
            }
        }, 
        props:["dataxself"],
        methods:{
             locate:function(item){
                 parent.vue_left.locate(item);
             }
        },
        computed:{
            datax:{
                set:function(value){
                    //this.dataxself=value;
                    //console.log(value);
                },get:function(){
                    debugger;
                    return this.dataxself.data[0].data;
                    //console.log(this.dataxself);
                }
            },
            data_filter: function () {
                    console.log(this.datax);
                    if (this.searchText) {
                        var temp = [];
                        for (var i = 0; i < this.datax.length; i++) {
                            if (this.datax[i].name&&this.datax[i].name.strcontains(this.searchText)) {
                                temp.push(this.datax[i]);
                            }
                        }
                        return temp;
                    }
                    return this.datax;
           }
        },
        mounted(){//挂载的时候执行
            console.log(this.dataxself);
        }
  }
</script>
<style scoped>
    .bt_h1{
        text-align: center;
        font-size: 20px;
    
        font-weight: 500;
        margin-top: 8px;
    }
    .table-a table{border:1px solid #F00} 
    .bg_tr tr:hover{
        background-color: #ece5e500 ! important;
    }

    .bg_tr td{
       text-align: center;
    }
    .tr_th{
        background: linear-gradient(#415dc0, #9aaab5);
    }
    .tr_th th{
        text-align: center;
    }

</style>

