<script setup>
import {useRolesStore} from "@/stores/modules/roles.js";
import {Refresh} from "@element-plus/icons-vue";

const rolesStore = useRolesStore()
</script>

<template>
  <el-container class="layout">
    <el-aside width="200px">
      <h3>DDTD后台管理</h3>
      <el-menu
          router
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
      >
        <el-menu-item index="/gameLogin">
          <el-icon>
            <User/>
          </el-icon>
          <span>游戏登陆</span>
        </el-menu-item>


        <el-sub-menu index="/toolBox">
          <template #title>
            <el-icon>
              <Suitcase/>
            </el-icon>
            <span>工具箱</span>
          </template>
          <el-menu-item index="/toolBox/byte">
            <el-icon>
              <ChatSquare/>
            </el-icon>
            <span>字节</span>
          </el-menu-item>

          <el-menu-item index="/toolBox/common">
            <el-icon>
              <Star/>
            </el-icon>
            <span>常用</span>
          </el-menu-item>

          <el-menu-item index="/toolBox/test">
            <el-icon>
              <VideoPlay/>
            </el-icon>
            <span>测试</span>
          </el-menu-item>
        </el-sub-menu>

        <el-menu-item index="/maze">
          <el-icon>
            <MagicStick/>
          </el-icon>
          <span>迷宫寻宝</span>
        </el-menu-item>

        <el-menu-item index="/autoCounterPart">
          <el-icon>
            <Burger/>
          </el-icon>
          <span>自动副本</span>
        </el-menu-item>

        <el-menu-item index="/buy">
          <el-icon>
            <ShoppingCart/>
          </el-icon>
          <span>急急急买</span>
        </el-menu-item>

        <el-menu-item index="/code">
          <el-icon>
            <Key/>
          </el-icon>
          <span>验证码</span>
        </el-menu-item>

        <el-menu-item index="/station">
          <el-icon>
            <Chicken/>
          </el-icon>
          <span>战场</span>
        </el-menu-item>

        <el-menu-item index="/farm">
          <el-icon>
            <Pear/>
          </el-icon>
          <span>农场</span>
        </el-menu-item>

      </el-menu>
    </el-aside>
    <el-container>
      <el-header>
        <el-select
            style="width: 150px"
            placeholder="选择角色"
            v-model="rolesStore.currentRole"
        >
          <el-option v-for="(item, index) in rolesStore.liveRoles" :key="index" :label="item" :value="item"></el-option>

        </el-select>
        <el-button @click="rolesStore.getRoles()" type="primary" :icon="Refresh" circle class="refresh"></el-button>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>

</template>

<style scoped lang="less">

.layout {
  height: 100vh;

  .el-aside {
    height: 100%;
    border-right: 1px solid #777;
    background-color: #545c64;

    h3 {
      text-align: center;
      line-height: 60px;
      color: white;
    }

    .el-menu {
      border: none;
    }

  }

  .el-header {
    border-bottom: 1px solid #777;
    height: 50px;
    line-height: 50px;

    .refresh {
      margin-left: 10px;
    }
  }


}


</style>
