<template>
    <div class="intelligentHint">
        <h2 style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd">智能提醒</h2>
        <header class="header">
            <div class="left">
                <E-Cold-Store class="chart_a"></E-Cold-Store>
            </div>
            <div class="right">
                <div class="cell" v-for="item in tableData" :key="item.id">
                    <h3 class="h3">
                        <span class="title">无害化处理编号:</span>
                        <span class="content">{{ item.id }}</span>
                    </h3>
                    <el-steps :active="C_a(item.status)">
                        <el-step title="无害化申请"></el-step>
                        <el-step title="无害化确认"></el-step>
                        <el-step title="无害化处理"></el-step>
                        <el-step title="生产无害化处理单"></el-step>
                    </el-steps>
                </div>
            </div>
        </header>
        <footer class="footer">
            <el-carousel
                height="150px"
                :interval="5000"
                direction="vertical"
                indicator-position="none"
            >
                <el-carousel-item v-for="item in tableData" :key="item.id">
                    <div :class="['item', 'item_'+ item.id%3]">
                        <div class="left el-icon-mobile-phone"></div>
                        <div class="right">
                            <p class="top">帮助提示</p>
                            <p class="middle">{{`无害化处理 ${item.id} ${item.status==0?'未确认,请及时确认':'已确认'}`}}</p>
                            <span class="bottom">查看详情</span>
                        </div>
                    </div>
                </el-carousel-item>
            </el-carousel>
        </footer>
    </div>
</template>

<script>
import EColdStore from "./charts/EColdStore";
import {
    reqHarmlessList,
} from "@/api/harmless.js";

const pageSize = 3

export default {
    name: "intelligentHint",
    components: {
        "E-Cold-Store": EColdStore
    },
    data() {
        return {
            tableData: []
        };
    },
    created() {
        this.getHarmlessList()
    },
    methods: {
        // 无害化确认列表
        getHarmlessList() {
            reqHarmlessList({
                searchStr: '',
                pageSize,
                pageNum: 1
            })
                .then(res => {
                    this.tableData = res.content;
                    this.totalPages = res.totalPages;
                })
                .catch(err => {
                    console.log(err);
                });
        },
        // 计算步骤条的active （因为现在只有两个状态，要显示四个状态）
        C_a(v) {
            return v == 0 ? 1 : 4
        }
    }
};
</script>

<style lang="scss" scoped>
.intelligentHint {
    .header {
        display: flex;
        padding-right: 11%;
        .left {
            width: 50%;
            height: 400px;
        }
        .right {
            width: 50%;
            height: 400px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            .cell{
                    .h3{
                        margin: 35px 0 10px 0;
                        .title{
                            font-size: 18px;
                            margin-right: 10px;
                            color: #383838;
                        }
                        .content{
                            color: #555;
                            font-size: 20px;
                        }
                    }
                }
        }
    }
    .footer {
        margin-top: 120px;
        .item {
            height: 100%;
            display: flex;
            box-sizing: border-box;
            border-radius: 10px;
            align-items: center;
            .left {
                font-size: 30px;
                margin-left: 20px;
                margin-right: 20px;
            }
            .right {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                .top {
                    font-size: 20px;
                    font-weight: 600;
                    color: #746363;
                }
                .middle {
                    font-size: 16px;
                    margin: 10px 0;
                    color: #999;
                }
                .bottom {
                    font-size: 16px;
                    color: rgb(48, 115, 240);
                }
            }
        }
        .item_0 {
            background-color: #ebf5ff;
            .left {
                color: #0079fe;
            }
        }
        .item_1 {
            background-color: #e6faf0;
            .left {
                color: #4bd863;
            }
        }
        .item_2 {
            background-color: #ffeee6;
            .left {
                color: #ff3b30;
            }
        }
    }
}
</style>
