<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 || 0 }}<span>个</span></div>
                    <div class="work_title">今日总数</div>
                </div>
                <div class="right_content">
                    <div class="work_week"><span>进行中:</span>{{ resultData.ConductedTicket || 0 }}</div>
                    <div class="work_week"><span>已超时:</span>{{ resultData.TimeoutTicket || 0 }}</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 class="arch_icon" aria-hidden="true">
                                <defs>
                                    <linearGradient id="myGradientil" x1="0%" y1="20%" x2="100%" y2="80%">
                                        <stop offset="0%" stop-color="rgba(4, 223, 247)" />
                                        <stop offset="50%" stop-color="rgba(255,255,255)" />
                                        <stop offset="100%" stop-color="rgba(4, 223, 247)" />
                                    </linearGradient>
                                </defs>
                                <use xlink:href="#icon-totality" fill="url('#myGradientil')" />
                            </svg>
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>总数</span>
                        <span class="amount_num">{{ resultData.Demands || 0 }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg class="arch_icon" aria-hidden="true">
                                <defs>
                                    <linearGradient id="myGradientil" x1="0%" y1="20%" x2="100%" y2="80%">
                                        <stop offset="0%" stop-color="rgb(4, 223, 247)" />
                                        <stop offset="50%" stop-color="rgb(255,255,255)" />
                                        <stop offset="100%" stop-color="rgb(4, 223, 247)" />
                                    </linearGradient>
                                </defs>
                                <use xlink:href="#icon-processed" fill="url('#myGradientil')" />
                            </svg>
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>已处理</span>
                        <span class="amount_num">{{ resultData.DisposeDemands || 0 }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg class="arch_icon" aria-hidden="true">
                                <defs>
                                    <linearGradient id="myGradientil" x1="0%" y1="20%" x2="100%" y2="80%">
                                        <stop offset="0%" stop-color="rgb(4, 223, 247)" />
                                        <stop offset="50%" stop-color="rgb(255,255,255)" />
                                        <stop offset="100%" stop-color="rgb(4, 223, 247)" />
                                    </linearGradient>
                                </defs>
                                <use xlink:href="#icon-forbid" fill="url('#myGradientil')" />
                            </svg>
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>未处理</span>
                        <span class="amount_num">{{ resultData.UnDisposeDemands || 0 }}</span>
                    </div>
                </div>
                <div class="appeal_box">
                    <div class="image_architecture">
                        <div class="tect_arch">
                            <svg class="arch_icon" aria-hidden="true">
                                <defs>
                                    <linearGradient id="myGradientil" x1="0%" y1="20%" x2="100%" y2="80%">
                                        <stop offset="0%" stop-color="rgb(4, 223, 247)" />
                                        <stop offset="50%" stop-color="rgb(255,255,255)" />
                                        <stop offset="100%" stop-color="rgb(4, 223, 247)" />
                                    </linearGradient>
                                </defs>
                                <use xlink:href="#icon-trend" fill="url('#myGradientil')" />
                            </svg>
                        </div>
                    </div>
                    <div class="appeal_num">
                        <span>今日新增</span>
                        <span class="amount_num">+{{ resultData.TodayDisposeDemands || 0 }}</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="flex_home">
            <HeadlineTag type="right" value="停车系统"></HeadlineTag>
            <div class="box_arch">
                <div class="box_vehicle">
                    <div class="tect_arch_tc">
                        <svg class="arch_icon_tc" aria-hidden="true">
                            <defs>
                                <linearGradient id="myleisure" x1="0%" y1="100%" x2="0%" y2="0%">
                                    <stop offset="0%" stop-color="rgb(21, 213, 21)" />
                                    <stop offset="100%" stop-color="rgb(255,255,255)" />
                                </linearGradient>
                            </defs>
                            <use xlink:href="#icon-leisure" fill="url('#myleisure')" />
                        </svg>
                    </div>
                    <div style="display: flex;align-items: center;">
                        <div class="color-green-line"></div>
                        <span>空闲</span>
                        <div class="sum_cle" style="color: rgb(21, 213, 21);">{{ resultData.IdleDriveway || 0 }}</div>
                    </div>
                </div>
                <div class="box_vehicle">
                    <div class="tect_arch_tc">
                        <svg class="arch_icon_tc" aria-hidden="true">
                            <defs>
                                <linearGradient id="myforbid" x1="0%" y1="100%" x2="0%" y2="0%">
                                    <stop offset="0%" stop-color="rgb(215, 113, 23)" />
                                    <stop offset="100%" stop-color="rgb(255,255,255)" />
                                </linearGradient>
                            </defs>
                            <use xlink:href="#icon-forbid" fill="url('#myforbid')" />
                        </svg>
                    </div>
                    <div style="display: flex;align-items: center;">
                        <div class="color-orange-line"></div>
                        <span>占用</span>
                        <div class="sum_cle" style="color: rgb(215, 113, 23);">{{ resultData.OccupationDriveway || 0 }}
                        </div>
                    </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: #ffffff;
        }
    }

    .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 {
    width: 40%;
    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;
}

.tect_arch_tc {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch_icon_tc {
    width: 70%;
    height: auto;
    margin-bottom: 20px;
}

.arch_icon {
    width: 70%;
    height: 70%;
    margin-bottom: 20px;
}

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

.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>