<template>
    <!-- 基础管理-设备管理-使用记录 -->
    <div>
        <el-form size="small" :inline="true" ref="queryForm" :model="queryParams">
            <el-form-item label="领用人" prop="user">
                <el-input
                    clearable
                    placeholder="请输入领用人"
                    v-model="queryParams.chargePerson"
                    @keyup.enter.native="handleQuery"
                />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-form>

        <el-table :data="recordList" border>
            <el-table-column label="序号" align="center" type="index" width="55" />
            <el-table-column
                align="center"
                :key="item.prop"
                :label="item.label"
                :prop="item.prop"
                v-for="item in columnList"
            />
        </el-table>
    </div>
</template>

<script>
export default {
    name: 'UseRecordTable',
    data() {
        return {
            queryParams: {
                user: '',
            },
            recordList: [],
            columnList: [
                { prop: 'deviceName', label: '设备名称' },
                { prop: 'deviceCode', label: '设备编码' },
                { prop: 'user', label: '领用人' },
                { prop: 'useTime', label: '领用日期' },
                { prop: 'returnUser', label: '归还人' },
                { prop: 'returnTime', label: '归还日期' },
            ],
        }
    },
    methods: {
        handleQuery() {
            console.log(this.queryParams)
        },
        resetQuery() {
            this.queryParams = {}
        },
    },
}
</script>
