pageRight.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div id="pageRight">
  3. <div class="headerContainer">
  4. <div class="projectContainer">
  5. <el-select
  6. v-model="selectProject"
  7. value-key="id"
  8. filterable
  9. placeholder="请选择"
  10. >
  11. <el-option
  12. v-for="item in projects"
  13. :key="item.id"
  14. :label="item.name"
  15. :value="item"
  16. >
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="userContainer">
  21. <el-popover trigger="hover" popper-class="el-user-popover">
  22. <div class="userPropExit" @click="loginOut">
  23. <i class="el-icon-switch-button"></i>
  24. <span class="user-pro-oper">退出登录</span>
  25. </div>
  26. <div class="userPropLine"></div>
  27. <div class="userPropUpPass">
  28. <i class="el-icon-unlock"></i>
  29. <span class="user-pro-oper">修改密码</span>
  30. </div>
  31. <div class="userInfo" slot="reference">
  32. <span v-text="user.name"></span>
  33. <i class="el-icon-fa-user fa fa-user"></i>
  34. </div>
  35. </el-popover>
  36. </div>
  37. </div>
  38. <div class="breadcContainer">
  39. <el-breadcrumb separator-class="el-icon-arrow-right">
  40. <el-breadcrumb-item
  41. v-for="bread in breadcrumbs"
  42. :to="bread.to"
  43. :key="bread.to"
  44. v-text="bread.label"
  45. ></el-breadcrumb-item>
  46. </el-breadcrumb>
  47. </div>
  48. <div class="contentContainer">
  49. <router-view class="page-content"></router-view>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import { mapState } from "vuex";
  55. import { sessionStore } from "@/store/sessionStore";
  56. import { logicConfig } from '@/logicConfig'
  57. export default {
  58. props: [],
  59. data() {
  60. return {};
  61. },
  62. computed: {
  63. ...mapState(["breadcrumbs", "projects", "user"]),
  64. selectProject: {
  65. set(value) {
  66. this.$store.commit("updateSelectProject", value);
  67. },
  68. get() {
  69. return this.$store.state.selectProject;
  70. },
  71. },
  72. },
  73. methods: {
  74. //注销
  75. loginOut: function () {
  76. this.$store.commit("loginOut");
  77. sessionStore.loginOut();
  78. this.$router.replace({ path: logicConfig.routerNameConfig.loginRouteName });
  79. },
  80. },
  81. created() {},
  82. watch: {},
  83. mounted() {},
  84. components: {},
  85. };
  86. </script>
  87. <style scoped>
  88. #pageRight {
  89. width: 100%;
  90. height: 100%;
  91. display: flex;
  92. flex-direction: column;
  93. }
  94. .breadcContainer {
  95. height: 31px;
  96. border-bottom: 1px solid #333;
  97. margin: 0 10px 10px 10px;
  98. }
  99. .contentContainer {
  100. flex: 1;
  101. margin: 0 10px 10px 10px;
  102. }
  103. .headerContainer {
  104. height: 50px;
  105. background: #2b3643;
  106. display: flex;
  107. flex-direction: row;
  108. align-items: center;
  109. }
  110. .projectContainer {
  111. flex: 1;
  112. }
  113. .userContainer {
  114. flex: 1;
  115. }
  116. .userInfo {
  117. float: right;
  118. margin-right: 20px;
  119. font-size: 18px;
  120. color: #409eff;
  121. cursor: pointer;
  122. }
  123. .el-icon-fa-user {
  124. font-family: FontAwesome !important;
  125. margin-left: 4px;
  126. }
  127. .user-pro-oper {
  128. margin-left: 4px;
  129. }
  130. .userPropExit {
  131. margin: 4px 8px 0px 8px;
  132. cursor: pointer;
  133. }
  134. .userPropUpPass {
  135. margin: 0px 8px;
  136. cursor: pointer;
  137. }
  138. .userPropLine {
  139. border-bottom: solid 1px #c0c4cc;
  140. }
  141. </style>