<!--
author:        Kane Wang <wangkane@qq.com>
date:          2025-10-23 17:52:01
component:     Header
Copyright © CPIC All rights reserved
-->
<template>
    <div class="header-wrapper">
        <span class="company-name">CPIC</span>
        <div class="version-wrapper">
            <span>制度库后台管理</span>
            <span>Build-20251021</span>
        </div>
        <div class="buttons-wrapper">
            <component
                :is="'SwitchButton'"
                class="icons"
                @click="Logout"
            />
        </div>
    </div>
</template>

<script lang="ts">
import { ElMessageBox } from "element-plus";
// import { logout } from "@/utils/account.js";

export default {
    name: "LayoutHeader",
    setup()
    {
        /**
         * 退出登录
         */
        const Logout = (): void =>
        {
            ElMessageBox.confirm(
                "是否要退出系统？",
                "",
                {
                    confirmButtonText: "是",
                    cancelButtonText: "否",
                    type: "warning",
                }
            )
                .then((): void =>
                {
                    // debugger;
                    console.log( "退出" );
                    // logout();
                })
                .catch((): void => {});
        };

        return { Logout, };
    },
};
</script>

<style lang="scss" scoped>
.header-wrapper {
    // @include no-select;

    height: 50px;
    max-height: 50px;

    padding: 0px 15px;

    // position: relative;

    display: flex;
    justify-content: start;
    align-items: center;
    background-color: #1d74b2;
    color: #fff;
    // background-color: $banner-background-color;

    span {
        text-align: left;
    }

    >*+* {
        margin-left: 10px;
    }

    .version-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: start;

        font: {
            size: 0.75rem;
        }

        >*+* {
            margin-top: 1px;
        }
    }

    .company-name {
        font-size: 2rem;
    }

    .buttons-wrapper {
        margin-left: auto;
        padding-top: 5px;
        // border: 1px solid salmon;
    }

    .icons {
        width: 25px;
        height: 25px;
        // margin-right: 8px;
        cursor: pointer;
    }
}
</style>
