header-1.vue 2.2 KB

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