<template>
    <div class="box_home_reight">
        <div class="flex_home">
            <HeadlineTag type="right" value="工单统计(本周)"></HeadlineTag>
            <div class="box_arch">
                <div class="image_tubbiness">
                    <div class="work_num">{{ resultData.TodaysTicket }}<span>个</span></div>
                    <div class="work_title">今日总数</div>
                </div>
                <div class="right_content">
                    <div class="work_week"><span>进行中:</span>{{ resultData.ConductedTicket }}</div>
                    <div class="work_week"><span>已超时:</span>{{ resultData.TimeoutTicket }}</div>
                </div>
            </div>
        </div>
        <div class="flex_home">
            <HeadlineTag type="right" value="诉求统计"></HeadlineTag>
            <div class="box_arch card_appeal">
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg-icon icon-class="architecture" className="arch_icon" />
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>总数</span>
                        <span class="amount_num">{{ resultData.Demands }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg-icon icon-class="architecture" className="arch_icon" />
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>已处理</span>
                        <span class="amount_num">{{ resultData.DisposeDemands }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg-icon icon-class="architecture" className="arch_icon" />
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>未处理</span>
                        <span class="amount_num">{{ resultData.UnDisposeDemands }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg-icon icon-class="architecture" className="arch_icon" />
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>今日新增</span>
                        <span class="amount_num">+{{ resultData.TodayDisposeDemands }}</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="flex_home">
            <HeadlineTag type="right" value="停车系统"></HeadlineTag>
            <div class="box_arch">
                <div class="box_vehicle">
                    <div class="color-green-line"></div>
                    <span>占用</span>
                    <div class="sum_cle" style="color: rgb(21, 213, 21);">{{ resultData.OccupationDriveway }}</div>
                </div>
                <div class="box_vehicle">
                    <div class="color-orange-line"></div>
                    <span>空闲</span>
                    <div class="sum_cle" style="color: rgb(215, 113, 23);">{{ resultData.IdleDriveway }}</div>
                </div>
            </div>
        </div>
        <div class="flex_home">
            <HeadlineTag type="right" value="报警统计(本周)"></HeadlineTag>
            <div class="box_arch">
                <LineChart :lineData="resultData.AlarmCount"></LineChart>
            </div>
        </div>
    </div>
</template>

<script setup>
import HeadlineTag from '@/components/HeadlineTag'
import LineChart from './LineChart.vue'
const props = defineProps({
    resultData: {
        type: Object,
        default: {}
    }
})
</script>

<style scoped lang="scss">
.box_home_reight {
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.flex_home {
    flex: 1;
    color: #fff;
}

.box_arch {
    display: flex;
    align-items: center;
    height: calc(100% - 40px);
}

.image_tubbiness {
    position: relative;
    flex: none;
    width: 45%;
    height: 100%;
    background: url("@/assets/images/tubbiness.png");
    background-size: 80% 80%;
    background-position: center center;
    background-repeat: no-repeat;

    .work_num {
        position: absolute;
        top: 30%;
        left: 0;
        right: 0;
        text-align: center;
        color: rgb(84, 218, 250);
        font-size: 20px;

        span {
            font-size: 14px;
            color: rgb(158, 174, 195);
        }
    }

    .work_title {
        position: absolute;
        bottom: 20%;
        left: 0px;
        right: 0px;
        text-align: center;
    }
}

.right_content {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;

    .work_week {
        font-size: 22px;
        font-weight: bold;
        color: #fff;

        span {
            padding-right: 10px;
            font-size: 16px;
            color: rgb(214, 218, 222);
        }
    }
}

.card_appeal {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

.appeal_box {
    width: 50%;
    // height: 60px;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.appeal_num {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 15px;

    span {
        font-size: 17px;
    }

    .amount_num {
        padding-top: 5px;
        font-size: 26px;
    }
}

.image_architecture {
    position: relative;
    flex: none;
    width: 40%;
    height: 60%;
    background: url("@/assets/images/brightbase.png");
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
}

.tect_arch {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch_icon {
    width: 80%;
    height: 80%;
    margin-bottom: 10px;
}

.box_vehicle {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-green-line {
    width: 6px;
    height: 6px;
    margin-right: 10px;
    background-color: rgb(21, 213, 21);
}

.color-orange-line {
    width: 6px;
    height: 6px;
    margin-right: 10px;
    background-color: rgb(215, 113, 23);
}

.sum_cle {
    font-size: 28px;
    font-weight: bold;
    padding-left: 10px;
}
</style>