<template>
    <div class="m_main">
        <div class="m_header">
            <img class="img_logo" src="../../assets/img/hszh_logo.jpg"/>
            <div class="personal-info">
                <div>
                    <i class="iconfont icon-tongzhi1 icon-style"><span class="spTopItem">系统消息</span></i>
                </div>
                <el-dropdown @command="handleCommand">
              <span class="el-dropdown-link">
                  <i class="iconfont icon-icon- icon-style" style="display:inline-block;"><span class="spTopItem">个人信息</span></i>
              </span>
                    <el-dropdown-menu slot="dropdown" >
                        <el-dropdown-item style="min-width: 80px;" command="logout">退出</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
                <el-dropdown @command="handleCommand" >
            <span class="el-dropdown-link">
                <i class="iconfont icon-kefu icon-style"><span class="spTopItem">客服服务</span></i>
            </span>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item style="min-width: 80px;" command="sys/profile">意见反馈</el-dropdown-item>
                        <el-dropdown-item style="min-width: 80px;" command="sys/editpassword">在线客服</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
                <el-dropdown @command="handleCommand" >
            <span class="el-dropdown-link">
                <i class="iconfont icon-shezhi icon-style"><span class="spTopItem">系统设置</span></i>
            </span>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item command="md/basicDataInfo">基础信息</el-dropdown-item>
                        <el-dropdown-item command="sys/staff" divided>员工</el-dropdown-item>
                        <el-dropdown-item command="sys/department">部门</el-dropdown-item>
                        <el-dropdown-item command="sys/rolePermission">角色与权限设置</el-dropdown-item>
                        <el-dropdown-item command="sys/tenant">租户</el-dropdown-item>
                        <el-dropdown-item command="sys/systemSet" divided>系统设置</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
            </div>
        </div>
        <div class="m_content">
            <div class="m_content_left">

            </div>
            <div class="m_content_right"></div>
        </div>
    </div>
</template>

<script>
  import VueCookie from 'vue-cookie'
  export default {
    name: 'n-main',
    data() {
      return {}
    },
    methods: {
      handleCommand(command) {
        console.log(command)
        if (command === 'logout') {
          VueCookie.delete('profile')
          this.$router.push('/login')
        } else {
          this.$router.push('/' + command)
        }
      }
    }
  }
</script>

<style lang="scss">
.m_main {
  width: 100%;
  height: 100%;

  .m_header {
    width: 100%;
    height: 60px;
    text-align: left;
    padding: 10px;
    .img_logo {
      height: 40px;
    }
    .personal-info {
      width: 500px;
      float: right;
      text-align: left;
      cursor: pointer;
      margin-right: 50px;
      div {
        width: 25%;
        float: left;
        color: rgb(72, 97, 106);
        b {
          font-weight: normal;
          font-size: 14px;
        }
      }
      .spTopItem {
        font-size: 14px;
        margin-left: 5px;
      }
    }
  }
}
</style>