<template>
    <el-dialog title="记录" width="500px" :visible.sync="dialogVisible">
        <el-steps :active="list.length" direction="vertical" :space="100">
            <el-step :title="item.content" :description="item.time" v-for="item in list" :key="item.id"></el-step>
        </el-steps>
        <el-empty description="暂无记录" v-if="!list.length"></el-empty>
    </el-dialog>
</template>

<script>
import { recordList } from '@/api/application'
export default {
    data() {
        return {
            dialogVisible: false,
            loading: false,
            list: []
        }
    },
    methods: {
        // 查询存取酒记录
        async recordList(storageId) {
            try {
                this.loading = true
                const res = await recordList({ storageId: storageId })
                this.list = res.content
                this.loading = false
            } catch (error) {
                console.log(error);
            }
        },
        show(id) {
            this.dialogVisible = true
            this.recordList(id)
        }
    }
}
</script>