index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <el-container>
  3. <el-header>
  4. <el-row type="flex" style="height:100%;" justify="space-between" align="middle">
  5. <div>航空工业集团快递智能柜管理程序</div>
  6. <div>
  7. <el-dropdown @command="onUserEdit">
  8. <span class="el-dropdown-link">
  9. <i class="el-icon-user" style="margin-right: 10px"></i>管理员
  10. <i class="el-icon-arrow-down el-icon--right"></i>
  11. </span>
  12. <el-dropdown-menu slot="dropdown">
  13. <el-dropdown-item command="logout">退出登录</el-dropdown-item>
  14. <!-- <el-dropdown-item>修改密码</el-dropdown-item> -->
  15. </el-dropdown-menu>
  16. </el-dropdown>
  17. </div>
  18. </el-row>
  19. </el-header>
  20. <el-container style="height: 100%; border: 1px solid #eee">
  21. <el-aside width="250px">
  22. <el-menu
  23. router
  24. class="el-menu"
  25. background-color="#545c64"
  26. text-color="#fff"
  27. active-text-color="#ffd04b"
  28. :default-active="curPath"
  29. >
  30. <el-menu-item index="express" route="express">
  31. <i class="el-icon-menu"></i>
  32. <span slot="title">柜体控制</span>
  33. </el-menu-item>
  34. <el-menu-item index="order" route="order">
  35. <i class="el-icon-s-order"></i>
  36. <span slot="title">订单管理</span>
  37. </el-menu-item>
  38. <el-menu-item index="log" route="log">
  39. <i class="el-icon-document"></i>
  40. <span slot="title">日志管理</span>
  41. </el-menu-item>
  42. <el-menu-item index="message" route="message">
  43. <i class="el-icon-message"></i>
  44. <span slot="title">消息通知</span>
  45. </el-menu-item>
  46. <el-menu-item index="view" route="view">
  47. <i class="el-icon-s-platform"></i>
  48. <span slot="title">操作记录</span>
  49. </el-menu-item>
  50. <el-menu-item index="status" route="status">
  51. <i class="el-icon-search"></i>
  52. <span slot="title">运营人员管理</span>
  53. </el-menu-item>
  54. </el-menu>
  55. </el-aside>
  56. <el-main class="el-menu">
  57. <router-view />
  58. </el-main>
  59. </el-container>
  60. </el-container>
  61. </template>
  62. <script>
  63. import { loginOut } from "@/api";
  64. export default {
  65. created() {
  66. this.curPath = this.$route.name;
  67. },
  68. data() {
  69. return {
  70. curPath: "",
  71. };
  72. },
  73. methods: {
  74. onUserEdit(command) {
  75. if (command == "logout") {
  76. this.$confirm("确认退出该账号?", "退出", {
  77. confirmButtonText: "确定",
  78. cancelButtonText: "取消",
  79. type: "warning",
  80. })
  81. .then(() => {
  82. this.onLoginOut();
  83. })
  84. .catch(() => {
  85. return false;
  86. });
  87. }
  88. },
  89. onLoginOut() {
  90. loginOut().then((res) => {
  91. if (res && res.msg == "ok") {
  92. this.$router.replace({ path: "/login" });
  93. }
  94. });
  95. },
  96. },
  97. };
  98. </script>
  99. <style scoped>
  100. .el-menu {
  101. height: calc(100vh - 62px);
  102. }
  103. .el-dropdown-link {
  104. color: #409eff;
  105. }
  106. </style>