<!-- 查看图纸-->
<template>
    <div class='look-page'>
        <div class='eq-list-top'>
            <el-input
                placeholder='搜索生产厂商'
                size='small'
                @change='getList'
                prefix-icon='el-icon-search'
                v-model='keyword'
                style='width:192px;margin-right:12px'
            ></el-input>
            <Select @change='getList' v-model='floor' style='margin-right:12px;' width='120' tipPlace='top' caption='楼层 ：' :selectdata='floorSelect'></Select>
            <Select @change='getList' v-model='floor' width='120' tipPlace='top' caption='文件类型 ：' :selectdata='floorSelect'></Select>
        </div>
        <el-table :data='tableData' style='width: 100%'>
            <el-table-column type='index' label='序号' width='80'></el-table-column>
            <el-table-column prop='lb' label='分类' width='160'>
                <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
            </el-table-column>
            <el-table-column prop='sl' label='文件名称'>
                <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
            </el-table-column>
            <el-table-column prop='unit' label='文件类型'>
                <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
            </el-table-column>
            <el-table-column prop='brand' label='文件大小(M)'>
                <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
            </el-table-column>
            <el-table-column prop='brand' label='操作'>
                <template slot-scope='{row}'>
                    <el-button type='text' size='mini' @click='handleDown(row)'>
                        <i class='el-icon-download'></i>下载
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class='foot'>
            <el-pagination
                background
                layout='prev, pager, next'
                :total='total'
                :page-size='size'
                @prev-click='pageChanged'
                @next-click='pageChanged'
                @current-change='pageChanged'
            ></el-pagination>
        </div>
    </div>
</template>
<script>
import { queryEquipmentList } from '@/api/equipmentList.js'
export default {
    data() {
        return {
            tableData: [{ index: 1 }],
            total: 0,
            currentPage: 1,
            size: 11,
            keyword: '',
            floor: ''
        }
    },
    props: ['major'],
    methods: {
        pageChanged(page, size) {
            this.currentPage = page
            this.getList()
        },
        getList() {
            let postParams = {}
            let data = {
                page: this.currentPage,
                size: this.size,
                plazaId: this.$store.state.plazaId,
                major: this.major
            }
            queryEquipmentList({ data, postParams }).then(res => {
                console.log(res)
                this.tableData = res.data.data
                this.total = res.data.count
            })
        },
        handleDown() {}
    },
    mounted() {
        // this.getList()
    }
}
</script>
<style lang="less" scoped>
.look-page {
    .eq-list-top {
        display: flex;
        margin-bottom: 12px;
    }
    td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .foot {
        height: 32px;
        display: flex;
        justify-content: flex-end;
        margin-top: 28px;
    }
}
</style>