<template>
    <el-container class="flex-column">
        <div class="table-search">
            <search @success="handleSuccess"></search>
            <optionBtn @success="handleOp" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" :trade="userInfo.trade" :searchKey="searchKey"></optionBtn>
        </div>
        <el-main class="nopadding">
            <div class="table-container">
                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" :trade="userInfo.trade"></tablePage>
            </div>
        </el-main>
    </el-container>  
</template>

<script>
import search from './components/search';
import optionBtn from './components/option';
import tablePage from './components/table';
export default {
    components: {
        search,tablePage,optionBtn
    },
    data(){
        return {
            searchKey:{},
            dataSelect:[],
            dataSelectFull:[],
            userInfo:null
        }
    },
    created(){
		var userInfo = this.$TOOL.data.get("USER_INFO");
		this.userInfo = userInfo;
    },
    methods: {
        handleOp(){
            this.$refs.tablePage.upData(this.searchKey)
        },
        tableHandle(data){
            this.dataSelect = data;
        },
        tableHandleFull(data){
            this.dataSelectFull = data;
        },
        handleSuccess(data){
            this.searchKey = data;
            this.$refs.tablePage.upData(data)
        },
        handleClick(name){
            this.activeName = name;
            this.searchKey.type = name;
            this.$refs.tablePage.upData(this.searchKey)
        }
    }
}
</script>