header-1.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div id="header-1">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="8" class="one">
  6. <span>{{ siteInfo.zhTitle }}</span>
  7. </el-col>
  8. <el-col :span="16" class="two">
  9. <el-button
  10. size="small"
  11. plain
  12. v-for="(item, index) in moduleList"
  13. :key="index"
  14. @click="modulePath(item)"
  15. :class="[active == item.active ? 'active' : '']"
  16. >{{ item.name }}</el-button
  17. >
  18. <el-dropdown @command="toDrop">
  19. <el-button type="danger" plain>
  20. {{ user && user._id ? user.name || user.unit_name || user.nick_name : '暂无昵称' }}
  21. <i class="el-icon-arrow-down el-icon--right"></i>
  22. </el-button>
  23. <el-dropdown-menu>
  24. <el-dropdown-item icon="el-icon-user" command="center">个人中心</el-dropdown-item>
  25. <el-dropdown-item icon="el-icon-switch-button" command="logout">退出登录</el-dropdown-item>
  26. </el-dropdown-menu>
  27. </el-dropdown>
  28. </el-col>
  29. </el-col>
  30. </el-row>
  31. </div>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref } from 'vue';
  35. import type { Ref } from 'vue';
  36. import { studio_style_Info } from '../../../layout/site';
  37. // import { studio_style_Info } from '@common/src/layout/site';
  38. let siteInfo = studio_style_Info.webInfo;
  39. let active: 3;
  40. let moduleList: Ref<any[]> = ref([]);
  41. let user: Ref<{ _id: string; name: string; unit_name: string; nick_name: string }> = ref({ _id: '', name: '', unit_name: '', nick_name: '' });
  42. const toDrop = () => {};
  43. const modulePath = (value: any) => {
  44. console.log(value);
  45. };
  46. </script>
  47. <style lang="scss" scoped>
  48. .main {
  49. display: flex;
  50. flex-direction: row;
  51. .one {
  52. span {
  53. display: inline-block;
  54. background-color: #ffc000;
  55. padding: 8px 10px;
  56. border: 1px solid #ffffff;
  57. }
  58. }
  59. .two {
  60. text-align: right;
  61. button {
  62. margin: 0 0 0 10px;
  63. }
  64. .el-button {
  65. margin: 0 0 0 10px;
  66. }
  67. .active {
  68. color: #07c4a8;
  69. }
  70. }
  71. }
  72. </style>