<template>
    <el-container class="flex-column">
        <div class="table-search">
            <search @success="handleSuccess"></search>
            <el-alert type="warning" show-icon title="栏目提醒" description="1、一台打印机可绑定多个门店，但一个门店只可绑定一台打印机。2、打印机状态并非实时更新，需要查看状态的时候请点击【查询状态】按钮，等待1-3分钟后刷新列表查看" :closable="false" style="margin-bottom: 10px;"></el-alert>
            <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn>
        </div>
        <el-main class="nopadding">
            <div class="table-container">
                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></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:[],
        }
    },
    methods: {
        tableHandle(data){
            this.dataSelect = data;
        },
        tableHandleFull(data){
            this.dataSelectFull = data;
        },
        handleSuccess(data){
            this.$refs.tablePage.upData(data)
        },
        handleClick(name){
            this.activeName = name;
            this.searchKey.type = name;
            this.$refs.tablePage.upData(this.searchKey)
        }
    }
}
</script>