<template>
 <div class="other-hader h100">
   <div class="title" @click="$router.push('/home')">数据治理与监控系统</div>
   <div class="user-info">
     <div class="fr right-info">
       <div>
         <span  class="fa fa-user"></span>
         <span>{{username}}</span>
       </div>
       <div @click="eqit">
         <span class="fa fa-sign-out"></span>
         <span>退出</span>
       </div>
     </div>
   </div>
 </div>
</template>

<script>
import {useRootStore} from "@/stores/useStore";
import {showConfirm} from "@/unit/element-ui/tip";
import {editLoginState} from "@/service/show-platform";
import router from "@/router";
import {Base64} from "js-base64";

export default {
  name: "OtherHeader",
  setup() {
    const store = useRootStore();
    const username = store.userInfo.ptjk_username;
    function eqit() {

      showConfirm(() => {
        editLoginState(store.userInfo.ptjk_usercode,store.userInfo.ptjk_userkeycode,'0').then(res => {

          store.userInfo = {}
          localStorage.removeItem('dataWatchLoginUserInfo')
          router.push('/login')
        })

      },'确定要退出吗','系统提示',{
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
    }
    return {
      store,
      username,
      eqit
    }
  }
}
</script>

<style scoped lang="scss">
.other-hader{
  .user-info{
    position: absolute;
    right: 20px;
  }
  display: flex;
  align-items: center;
  .right-info{
    margin-right: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    >div{
      &:hover{
        color: #37639c;
        background-color: #fff;
      }
      padding: 15px 20px;
      .fa{
        margin-right: 8px;
      }

    }
    height: 100%;
    display: flex;
    align-items: center;
  }
  .title{
    cursor: pointer;
    margin: auto;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 35px;
    font-family: 宋体;
  }

}
</style>
