basic.component.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import { Component } from '@angular/core';
  17. import { SettingsService, User } from '@delon/theme';
  18. import { environment } from '@env/environment';
  19. import { CONSTS } from 'src/app/shared/consts';
  20. import { LayoutDefaultOptions } from '../../theme/layout-default';
  21. @Component({
  22. selector: 'layout-basic',
  23. styles: [
  24. `
  25. .alain-default__collapsed .alain-default__aside-user {
  26. width: 64px;
  27. margin-left: 16px;
  28. }
  29. `
  30. ],
  31. template: `
  32. <layout-default [options]="options" [asideUser]="asideUserTpl" [content]="contentTpl" [customError]="null">
  33. <layout-default-header-item direction="left">
  34. <a href="#">
  35. <img src="./assets/logo.jpg" alt="logo" style="height: 50px;height: 50px;float: left;" />
  36. <div
  37. class="alain-default__nav-item_title"
  38. style="letter-spacing: 2px;
  39. font-size: 20px;
  40. font-weight: bolder;
  41. width: 450px;
  42. margin-top: 12px;"
  43. >
  44. Max<span style="color: #FFD700;">Key</span>{{ 'mxk.title' | i18n }}
  45. </div>
  46. </a>
  47. </layout-default-header-item>
  48. <layout-default-header-item direction="right" hidden="mobile">
  49. <div layout-default-header-item-trigger>
  50. <header-i18n></header-i18n>
  51. </div>
  52. </layout-default-header-item>
  53. <layout-default-header-item direction="right" hidden="mobile">
  54. <div layout-default-header-item-trigger nz-dropdown [nzDropdownMenu]="settingsMenu" nzTrigger="click" nzPlacement="bottomRight">
  55. <i nz-icon nzType="setting"></i>
  56. </div>
  57. <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
  58. <div nz-menu style="width: 200px;">
  59. <div nz-menu-item>
  60. <header-rtl></header-rtl>
  61. </div>
  62. <div nz-menu-item>
  63. <header-fullscreen></header-fullscreen>
  64. </div>
  65. <div nz-menu-item>
  66. <header-clear-storage></header-clear-storage>
  67. </div>
  68. </div>
  69. </nz-dropdown-menu>
  70. </layout-default-header-item>
  71. <layout-default-header-item direction="right">
  72. <header-user></header-user>
  73. </layout-default-header-item>
  74. <ng-template #asideUserTpl>
  75. <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="alain-default__aside-user">
  76. <div class="alain-default__aside-user-info">
  77. <strong>{{ user.name }}</strong>
  78. <!--<p class="mb0">{{ user.email }}</p>-->
  79. </div>
  80. <!--
  81. <nz-avatar class="alain-default__aside-user-avatar" [nzSrc]="user.avatar"></nz-avatar>
  82. -->
  83. </div>
  84. <nz-dropdown-menu #userMenu="nzDropdownMenu">
  85. <ul nz-menu>
  86. <!--
  87. <li nz-menu-item routerLink="/pro/account/center">{{ 'menu.account.center' | i18n }}</li>
  88. <li nz-menu-item routerLink="/pro/account/settings">{{ 'menu.account.settings' | i18n }}</li>
  89. -->
  90. </ul>
  91. </nz-dropdown-menu>
  92. </ng-template>
  93. <ng-template #contentTpl>
  94. <router-outlet></router-outlet>
  95. </ng-template>
  96. </layout-default>
  97. <global-footer style="border-top: 1px solid #e5e5e5; min-height: 120px; text-shadow: 0 1px 0 #fff;margin:0;">
  98. <div style="margin-top: 30px">
  99. MaxKey {{ version }}<br />
  100. Copyright
  101. <i nz-icon nzType="copyright"></i> 2022 <a href="//www.maxkey.top" target="_blank">http://www.maxkey.top</a><br />
  102. Licensed under the Apache License, Version 2.0
  103. </div>
  104. </global-footer>
  105. <setting-drawer *ngIf="showSettingDrawer"></setting-drawer>
  106. <theme-btn></theme-btn>
  107. `
  108. })
  109. export class LayoutBasicComponent {
  110. version = CONSTS.VERSION;
  111. options: LayoutDefaultOptions = {
  112. logoExpanded: `./assets/logo-full.svg`,
  113. logoCollapsed: `./assets/logo.svg`,
  114. hideAside: false
  115. };
  116. searchToggleStatus = false;
  117. showSettingDrawer = !environment.production;
  118. get user(): User {
  119. return this.settingsService.user;
  120. }
  121. constructor(private settingsService: SettingsService) { }
  122. }