Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

71 linhas
3.0 KiB

  1. <header class="top-header">
  2. <div class="header-left">
  3. <div class="breadcrumb">
  4. {% if currentPage == 'dashboard' %}
  5. <span class="current">控制台</span>
  6. {% else %}
  7. <a href="/admin/dashboard.html">控制台</a>
  8. {% if breadcrumb %}
  9. {% for item in breadcrumb %}
  10. <span class="sep">/</span>
  11. {% if loop.last %}
  12. <span class="current">{{ item.name }}</span>
  13. {% else %}
  14. <a href="{{ item.url }}">{{ item.name }}</a>
  15. {% endif %}
  16. {% endfor %}
  17. {% elif pageTitle or (columnInfo and columnInfo.name) %}
  18. <span class="sep">/</span>
  19. <span class="current">{{ pageTitle or columnInfo.name }}</span>
  20. {% endif %}
  21. {% endif %}
  22. </div>
  23. </div>
  24. <div class="header-right">
  25. <button class="header-btn" title="刷新" onclick="location.reload()">
  26. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
  27. </button>
  28. <button class="header-btn" title="全屏" onclick="toggleFullscreen()">
  29. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>
  30. </button>
  31. <div class="header-user" id="userDropdown">
  32. <div class="header-avatar" onclick="document.getElementById('userDropdown').classList.toggle('open')">
  33. <div class="avatar-placeholder">{{ adminUser.nickname[0] if adminUser.nickname else '管' }}</div>
  34. <span>{{ adminUser.nickname or adminUser.username or '管理员' }}</span>
  35. <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" style="margin-left:4px;"><polyline points="6 9 12 15 18 9"/></svg>
  36. </div>
  37. <div class="user-dropdown-menu">
  38. <a href="javascript:void(0)" class="dropdown-item dropdown-item-danger" onclick="confirmLogout()">
  39. <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
  40. 退出登录
  41. </a>
  42. </div>
  43. </div>
  44. </div>
  45. </header>
  46. <script>
  47. function toggleFullscreen() {
  48. if (!document.fullscreenElement) {
  49. document.documentElement.requestFullscreen();
  50. } else {
  51. document.exitFullscreen();
  52. }
  53. }
  54. function confirmLogout() {
  55. ElementPlus.ElMessageBox.confirm('确定要退出登录吗?', '提示', {
  56. confirmButtonText: '确定',
  57. cancelButtonText: '取消',
  58. type: 'warning'
  59. }).then(function() {
  60. window.location.href = '/admin/logout.html';
  61. }).catch(function() {});
  62. }
  63. // 点击外部关闭下拉
  64. document.addEventListener('click', function(e) {
  65. var dd = document.getElementById('userDropdown');
  66. if (dd && !dd.contains(e.target)) {
  67. dd.classList.remove('open');
  68. }
  69. });
  70. </script>