@yelon/bis 15.2.4 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -23
  3. package/{esm2020 → esm2022}/bis.mjs +4 -4
  4. package/{esm2020 → esm2022}/index.mjs +1 -1
  5. package/{esm2020 → esm2022}/layout/bis.config.mjs +10 -10
  6. package/{esm2020 → esm2022}/layout/html-names.mjs +32 -32
  7. package/{esm2020 → esm2022}/layout/icon/style-icons.mjs +795 -795
  8. package/{esm2020 → esm2022}/layout/layout-basic/index.mjs +2 -2
  9. package/{esm2020 → esm2022}/layout/layout-basic/interface.mjs +6 -6
  10. package/{esm2020 → esm2022}/layout/layout-basic/layout-basic.component.mjs +356 -356
  11. package/{esm2020 → esm2022}/layout/layout-nav/index.mjs +4 -4
  12. package/esm2022/layout/layout-nav/layout-nav-application.component.mjs +328 -0
  13. package/{esm2020 → esm2022}/layout/layout-nav/layout-nav-group.component.mjs +125 -124
  14. package/esm2022/layout/layout-nav/layout-nav-tile.component.mjs +16 -0
  15. package/{esm2020 → esm2022}/layout/layout-nav/types.mjs +1 -1
  16. package/{esm2020 → esm2022}/layout/layout.mjs +4 -4
  17. package/{esm2020 → esm2022}/layout/public_api.mjs +12 -12
  18. package/{esm2020 → esm2022}/layout/widgets/index.mjs +6 -6
  19. package/esm2022/layout/widgets/yunzai-clear-storage.component.mjs +46 -0
  20. package/esm2022/layout/widgets/yunzai-fullscreen.component.mjs +46 -0
  21. package/{esm2020 → esm2022}/layout/widgets/yunzai-i18n.component.mjs +147 -146
  22. package/esm2022/layout/widgets/yunzai-notify.component.mjs +184 -0
  23. package/esm2022/layout/widgets/yunzai-theme-btn.component.mjs +202 -0
  24. package/esm2022/layout/widgets/yunzai-user.component.mjs +131 -0
  25. package/esm2022/layout/yunzai-act.guard.mjs +108 -0
  26. package/esm2022/layout/yunzai-auth.service.mjs +174 -0
  27. package/{esm2020 → esm2022}/layout/yunzai-default.interceptor.mjs +209 -209
  28. package/{esm2020 → esm2022}/layout/yunzai-i18n.service.mjs +131 -131
  29. package/{esm2020 → esm2022}/layout/yunzai-lang.mjs +113 -113
  30. package/esm2022/layout/yunzai-layout.module.mjs +77 -0
  31. package/{esm2020 → esm2022}/layout/yunzai-startup.service.mjs +157 -157
  32. package/{esm2020 → esm2022}/public_api.mjs +1 -1
  33. package/{fesm2015 → fesm2022}/bis.mjs +6 -6
  34. package/{fesm2020 → fesm2022}/layout.mjs +3245 -3226
  35. package/fesm2022/layout.mjs.map +1 -0
  36. package/index.d.ts +1 -1
  37. package/index.less +1 -1
  38. package/layout/bis.config.d.ts +3 -3
  39. package/layout/html-names.d.ts +31 -31
  40. package/layout/icon/style-icons.d.ts +1 -1
  41. package/layout/index.d.ts +5 -5
  42. package/layout/layout-basic/index.d.ts +2 -2
  43. package/layout/layout-basic/interface.d.ts +24 -24
  44. package/layout/layout-basic/layout-basic.component.d.ts +32 -32
  45. package/layout/layout-nav/index.d.ts +4 -4
  46. package/layout/layout-nav/layout-nav-application.component.d.ts +27 -27
  47. package/layout/layout-nav/layout-nav-group.component.d.ts +17 -17
  48. package/layout/layout-nav/layout-nav-tile.component.d.ts +6 -6
  49. package/layout/layout-nav/types.d.ts +15 -15
  50. package/layout/public_api.d.ts +12 -12
  51. package/layout/style/index.less +154 -154
  52. package/layout/widgets/index.d.ts +6 -6
  53. package/layout/widgets/yunzai-clear-storage.component.d.ts +11 -11
  54. package/layout/widgets/yunzai-fullscreen.component.d.ts +8 -8
  55. package/layout/widgets/yunzai-i18n.component.d.ts +21 -21
  56. package/layout/widgets/yunzai-notify.component.d.ts +30 -30
  57. package/layout/widgets/yunzai-theme-btn.component.d.ts +32 -32
  58. package/layout/widgets/yunzai-user.component.d.ts +28 -28
  59. package/layout/yunzai-act.guard.d.ts +22 -22
  60. package/layout/yunzai-auth.service.d.ts +21 -21
  61. package/layout/yunzai-default.interceptor.d.ts +27 -27
  62. package/layout/yunzai-i18n.service.d.ts +33 -33
  63. package/layout/yunzai-lang.d.ts +11 -11
  64. package/layout/yunzai-layout.module.d.ts +21 -21
  65. package/layout/yunzai-startup.service.d.ts +37 -37
  66. package/package.json +39 -47
  67. package/public_api.d.ts +2 -2
  68. package/theme-compact.less +3 -3
  69. package/theme-dark.less +46 -46
  70. package/theme-default.less +46 -46
  71. package/esm2020/layout/layout-nav/layout-nav-application.component.mjs +0 -327
  72. package/esm2020/layout/layout-nav/layout-nav-tile.component.mjs +0 -15
  73. package/esm2020/layout/widgets/yunzai-clear-storage.component.mjs +0 -45
  74. package/esm2020/layout/widgets/yunzai-fullscreen.component.mjs +0 -45
  75. package/esm2020/layout/widgets/yunzai-notify.component.mjs +0 -183
  76. package/esm2020/layout/widgets/yunzai-theme-btn.component.mjs +0 -201
  77. package/esm2020/layout/widgets/yunzai-user.component.mjs +0 -130
  78. package/esm2020/layout/yunzai-act.guard.mjs +0 -107
  79. package/esm2020/layout/yunzai-auth.service.mjs +0 -155
  80. package/esm2020/layout/yunzai-layout.module.mjs +0 -76
  81. package/fesm2015/layout.mjs +0 -3218
  82. package/fesm2015/layout.mjs.map +0 -1
  83. package/fesm2020/bis.mjs +0 -6
  84. package/fesm2020/bis.mjs.map +0 -1
  85. package/fesm2020/layout.mjs.map +0 -1
  86. /package/{fesm2015 → fesm2022}/bis.mjs.map +0 -0
@@ -1,3218 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, HostListener, Injectable, Inject, Input, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
3
- import { Subject, takeUntil, of, catchError, forkJoin, map as map$1, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
4
- import * as i1$4 from '@yelon/util';
5
- import { WINDOW, hasFavicon, setFavicon, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
6
- import * as i1$5 from '@yelon/theme/layout-default';
7
- import * as i1$3 from '@yelon/cache';
8
- import { CacheService } from '@yelon/cache';
9
- import * as i3$3 from '@yelon/socket';
10
- import * as i4$1 from '@angular/common';
11
- import { registerLocaleData, DOCUMENT, CommonModule } from '@angular/common';
12
- import * as i5$1 from '@angular/router';
13
- import { Router, RouterModule } from '@angular/router';
14
- import * as i6$1 from '@yelon/abc/reuse-tab';
15
- import * as i3 from 'ng-zorro-antd/core/transition-patch';
16
- import * as i6 from 'ng-zorro-antd/menu';
17
- import * as i7 from 'ng-zorro-antd/dropdown';
18
- import * as i8 from 'ng-zorro-antd/icon';
19
- import * as i9 from 'ng-zorro-antd/avatar';
20
- import * as i1 from 'ng-zorro-antd/modal';
21
- import * as i1$1 from 'ng-zorro-antd/message';
22
- import * as i1$2 from '@yelon/theme';
23
- import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, el_GR as el_GR$1, es_ES as es_ES$1, fr_FR as fr_FR$1, hr_HR as hr_HR$1, it_IT as it_IT$1, ko_KR as ko_KR$1, pl_PL as pl_PL$1, sl_SI as sl_SI$1, tr_TR as tr_TR$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
24
- import screenfull from 'screenfull';
25
- import { __decorate } from 'tslib';
26
- import { InputBoolean } from '@yelon/util/decorator';
27
- import ngEn from '@angular/common/locales/en';
28
- import { zhCN, zhTW, enUS, el, es, fr, hr, it, ko, pl, sl, tr } from 'date-fns/locale';
29
- import { map } from 'rxjs/operators';
30
- import * as i2 from 'ng-zorro-antd/i18n';
31
- import { zh_CN, zh_TW, en_US, el_GR, es_ES, fr_FR, hr_HR, it_IT, ko_KR, pl_PL, sl_SI, tr_TR } from 'ng-zorro-antd/i18n';
32
- import ngElGr from '@angular/common/locales/el';
33
- import ngEsEs from '@angular/common/locales/es';
34
- import ngFr from '@angular/common/locales/fr';
35
- import ngHr from '@angular/common/locales/hr';
36
- import ngIt from '@angular/common/locales/it';
37
- import ngKo from '@angular/common/locales/ko';
38
- import ngPl from '@angular/common/locales/pl';
39
- import ngSl from '@angular/common/locales/sl';
40
- import ngTr from '@angular/common/locales/tr';
41
- import ngZh from '@angular/common/locales/zh';
42
- import ngZhTw from '@angular/common/locales/zh-Hant';
43
- import * as i3$1 from '@angular/cdk/platform';
44
- import * as i4 from '@yelon/util/config';
45
- import { YunzaiConfigService as YunzaiConfigService$1 } from '@yelon/util/config';
46
- import { formatDistanceToNow } from 'date-fns';
47
- import { log } from '@yelon/util/other';
48
- import * as i4$2 from '@yelon/abc/notice-icon';
49
- import { YUNZAI_THEME_BTN_KEYS } from '@yelon/theme/theme-btn';
50
- import * as i3$2 from '@angular/cdk/bidi';
51
- import * as i8$1 from 'ng-zorro-antd/tooltip';
52
- import { YA_SERVICE_TOKEN, ALLOW_ANONYMOUS } from '@yelon/auth';
53
- import * as i5 from '@angular/forms';
54
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
55
- import * as i7$1 from 'ng-zorro-antd/grid';
56
- import * as i9$1 from 'ng-zorro-antd/input';
57
- import * as i8$2 from 'ng-zorro-antd/tabs';
58
- import { HttpErrorResponse, HttpResponse, HttpResponseBase, HttpClientModule } from '@angular/common/http';
59
- import { NzNotificationService } from 'ng-zorro-antd/notification';
60
- import { YunzaiSharedYelonModule, YunzaiSharedZorroModule } from '@yelon/bcs';
61
- import { AccountBookTwoTone, AccountBookFill, AccountBookOutline, AlertTwoTone, AlertFill, AlibabaOutline, AimOutline, AlipayCircleFill, AlertOutline, AlignCenterOutline, AlipayCircleOutline, AlipayOutline, AlignLeftOutline, AlignRightOutline, AmazonOutline, AliwangwangOutline, AliyunOutline, AlipaySquareFill, AmazonCircleFill, AndroidFill, AliwangwangFill, AntCloudOutline, AmazonSquareFill, AndroidOutline, ApartmentOutline, ApiTwoTone, ApiFill, ApiOutline, AntDesignOutline, AppstoreAddOutline, AppstoreFill, AppleOutline, AppstoreOutline, ArrowDownOutline, AppleFill, ArrowsAltOutline, AppstoreTwoTone, ArrowUpOutline, AreaChartOutline, ArrowLeftOutline, AudioFill, ArrowRightOutline, AudioTwoTone, AuditOutline, AudioMutedOutline, BackwardFill, AudioOutline, BackwardOutline, BankFill, BarcodeOutline, BellFill, BankTwoTone, BarsOutline, BankOutline, BehanceCircleFill, BehanceSquareFill, BoldOutline, BellOutline, BehanceOutline, BlockOutline, BehanceSquareOutline, BgColorsOutline, BellTwoTone, BarChartOutline, BookTwoTone, BookFill, BorderOuterOutline, BorderLeftOutline, BorderBottomOutline, BorderHorizontalOutline, BorderTopOutline, BorderOutline, BorderInnerOutline, BorderRightOutline, BoxPlotOutline, BoxPlotFill, BoxPlotTwoTone, BookOutline, BorderlessTableOutline, BorderVerticleOutline, BuildTwoTone, BuildOutline, BugFill, BugOutline, BugTwoTone, BulbFill, BulbTwoTone, BuildFill, BulbOutline, CalculatorFill, CalculatorTwoTone, CalendarFill, CalendarOutline, CalculatorOutline, CalendarTwoTone, CameraOutline, CameraFill, CameraTwoTone, CarTwoTone, CaretDownOutline, CarOutline, CaretLeftFill, CarFill, CaretRightOutline, CaretDownFill, CaretUpOutline, CaretRightFill, CarryOutFill, CarryOutOutline, CaretLeftOutline, CaretUpFill, BranchesOutline, CarryOutTwoTone, CheckCircleFill, CheckCircleOutline, CheckSquareOutline, CheckCircleTwoTone, CiCircleTwoTone, CheckOutline, CheckSquareTwoTone, CiOutline, CheckSquareFill, CiTwoTone, ChromeOutline, ClockCircleOutline, CiCircleOutline, ChromeFill, ClearOutline, CloseCircleTwoTone, CiCircleFill, CloseCircleOutline, ClockCircleFill, CloseCircleFill, ClockCircleTwoTone, CloseOutline, CloseSquareOutline, CloseSquareFill, CloudFill, CloseSquareTwoTone, CloudDownloadOutline, CloudTwoTone, CloudServerOutline, CloudUploadOutline, CloudSyncOutline, ClusterOutline, CodeSandboxCircleFill, CodeFill, CodepenCircleOutline, CloudOutline, CodeSandboxOutline, CodeOutline, CodeSandboxSquareFill, CodeTwoTone, CodepenSquareFill, CodepenOutline, CoffeeOutline, ColumnWidthOutline, CompressOutline, ColumnHeightOutline, CodepenCircleFill, CompassTwoTone, CommentOutline, ContainerFill, CompassOutline, ConsoleSqlOutline, ContactsOutline, ContainerTwoTone, ContactsFill, ContactsTwoTone, ContainerOutline, ControlFill, CopyFill, CopyOutline, CompassFill, CopyTwoTone, CopyrightOutline, CopyrightCircleOutline, ControlTwoTone, ControlOutline, CreditCardFill, CopyrightTwoTone, CrownFill, CopyrightCircleFill, CrownOutline, CustomerServiceTwoTone, CreditCardOutline, CustomerServiceOutline, DashboardTwoTone, CrownTwoTone, CreditCardTwoTone, CustomerServiceFill, DashboardFill, DashOutline, DatabaseOutline, DatabaseTwoTone, DatabaseFill, DashboardOutline, DeleteTwoTone, DeleteRowOutline, DeleteColumnOutline, DeliveredProcedureOutline, DeleteOutline, CopyrightCircleTwoTone, DesktopOutline, DeleteFill, DiffOutline, DiffFill, DeploymentUnitOutline, DiffTwoTone, DingtalkOutline, DollarCircleFill, DislikeFill, DingtalkSquareFill, DisconnectOutline, DollarCircleTwoTone, DollarOutline, DingtalkCircleFill, DislikeTwoTone, DollarTwoTone, DownCircleFill, DislikeOutline, DollarCircleOutline, DoubleLeftOutline, DownSquareFill, DownOutline, DownSquareOutline, DownSquareTwoTone, DownCircleTwoTone, DoubleRightOutline, DownCircleOutline, DownloadOutline, DotChartOutline, DribbbleCircleFill, DribbbleOutline, DribbbleSquareOutline, DropboxCircleFill, DingdingOutline, EditOutline, DribbbleSquareFill, DropboxSquareFill, EllipsisOutline, EnvironmentFill, EditFill, EnterOutline, EuroCircleFill, EuroTwoTone, EuroCircleOutline, EditTwoTone, EuroOutline, EnvironmentTwoTone, ExclamationCircleFill, ExpandAltOutline, EuroCircleTwoTone, ExclamationCircleTwoTone, EnvironmentOutline, ExperimentOutline, ExperimentFill, ExpandOutline, ExceptionOutline, ExportOutline, ExperimentTwoTone, ExclamationCircleOutline, ExclamationOutline, EyeFill, EyeInvisibleFill, EyeInvisibleTwoTone, DropboxOutline, DragOutline, FacebookOutline, FacebookFill, EyeTwoTone, EyeOutline, FastForwardFill, FieldBinaryOutline, FieldNumberOutline, FastBackwardOutline, FileAddFill, FastBackwardFill, FileExcelFill, FastForwardOutline, FieldStringOutline, FileDoneOutline, FileAddTwoTone, FileExcelTwoTone, FileExclamationFill, FileAddOutline, FileExclamationOutline, FieldTimeOutline, FileImageTwoTone, FileExcelOutline, FileExclamationTwoTone, FileImageFill, FileGifOutline, FileFill, FileMarkdownTwoTone, FileMarkdownOutline, FallOutline, FileImageOutline, EyeInvisibleOutline, FilePdfOutline, FileSearchOutline, FilePptTwoTone, FilePdfTwoTone, FileJpgOutline, FileTextFill, FilePptOutline, FileSyncOutline, FilePptFill, FileUnknownOutline, FileProtectOutline, FileTextTwoTone, FileWordFill, FileUnknownTwoTone, FileWordTwoTone, FileUnknownFill, FileTextOutline, FileZipFill, FilterTwoTone, FilterFill, FileWordOutline, FireOutline, FireTwoTone, FileZipOutline, FilterOutline, FlagTwoTone, FileTwoTone, FilePdfFill, FileOutline, FileMarkdownFill, FileZipTwoTone, FlagOutline, FolderAddTwoTone, FolderOpenFill, FireFill, FlagFill, FolderOutline, FolderViewOutline, FolderTwoTone, FontColorsOutline, FolderOpenTwoTone, FolderFill, ForwardOutline, FolderOpenOutline, ForkOutline, ForwardFill, FormatPainterOutline, FormatPainterFill, FormOutline, FrownFill, FrownTwoTone, FullscreenOutline, FontSizeOutline, FundFill, FunctionOutline, FundViewOutline, FullscreenExitOutline, GifOutline, FundProjectionScreenOutline, FundTwoTone, FolderAddFill, FunnelPlotTwoTone, GiftOutline, FunnelPlotFill, FundOutline, FrownOutline, GithubOutline, GoldFill, FolderAddOutline, GitlabFill, GiftFill, GitlabOutline, GoldTwoTone, GoogleCircleFill, GiftTwoTone, GooglePlusCircleFill, GoldOutline, GithubFill, GoogleOutline, GooglePlusOutline, GoogleSquareFill, GoldenFill, HddTwoTone, GooglePlusSquareFill, GlobalOutline, HeartOutline, HeartTwoTone, GroupOutline, HeartFill, HeatMapOutline, GatewayOutline, FunnelPlotOutline, HddFill, HomeFill, HighlightFill, HomeOutline, HistoryOutline, HighlightOutline, HddOutline, HourglassFill, HomeTwoTone, HourglassTwoTone, Html5Outline, Html5Fill, IdcardFill, Html5TwoTone, HourglassOutline, IdcardTwoTone, IdcardOutline, IeOutline, IeCircleFill, IeSquareFill, InboxOutline, ImportOutline, InfoCircleOutline, InfoCircleTwoTone, InsertRowAboveOutline, InsertRowRightOutline, InfoCircleFill, InfoOutline, InsertRowBelowOutline, HighlightTwoTone, InsuranceFill, InstagramFill, InteractionFill, InsertRowLeftOutline, InstagramOutline, InteractionOutline, ItalicOutline, InteractionTwoTone, LayoutOutline, IssuesCloseOutline, LayoutFill, LaptopOutline, LeftCircleFill, LayoutTwoTone, KeyOutline, LeftOutline, LeftCircleOutline, LeftSquareOutline, LeftSquareFill, LeftCircleTwoTone, LikeFill, LeftSquareTwoTone, LineOutline, LikeTwoTone, LinkedinOutline, LineChartOutline, LineHeightOutline, LinkedinFill, LinkOutline, LikeOutline, InsuranceOutline, Loading3QuartersOutline, LockFill, InsuranceTwoTone, MacCommandOutline, LockTwoTone, LoadingOutline, MailOutline, LoginOutline, MedicineBoxOutline, MailFill, MailTwoTone, MacCommandFill, ManOutline, MedicineBoxFill, MedicineBoxTwoTone, MediumCircleFill, MediumOutline, MehFill, MediumWorkmarkOutline, MenuFoldOutline, MehOutline, MediumSquareFill, MessageTwoTone, MehTwoTone, MergeCellsOutline, MinusCircleFill, MenuOutline, MenuUnfoldOutline, MessageFill, MinusCircleTwoTone, LockOutline, MinusOutline, MinusCircleOutline, LogoutOutline, MessageOutline, MoneyCollectFill, MinusSquareOutline, MinusSquareTwoTone, MobileOutline, MobileTwoTone, MoneyCollectOutline, MoreOutline, NotificationFill, NotificationOutline, MoneyCollectTwoTone, NodeIndexOutline, NodeExpandOutline, MonitorOutline, OrderedListOutline, NodeCollapseOutline, NumberOutline, PaperClipOutline, NotificationTwoTone, PauseCircleFill, PartitionOutline, PauseOutline, OneToOneOutline, PayCircleOutline, PayCircleFill, MinusSquareFill, PauseCircleOutline, PauseCircleTwoTone, PicCenterOutline, PicRightOutline, PercentageOutline, MobileFill, PictureOutline, PictureFill, PhoneTwoTone, PhoneFill, PieChartFill, PictureTwoTone, PieChartOutline, PlaySquareFill, PlayCircleTwoTone, PlayCircleFill, PlusCircleFill, PlaySquareTwoTone, PlaySquareOutline, PlayCircleOutline, PieChartTwoTone, PlusCircleOutline, PlusSquareFill, PoundCircleFill, PlusSquareOutline, PlusOutline, PoundOutline, PoundCircleOutline, PlusSquareTwoTone, PlusCircleTwoTone, PoweroffOutline, PoundCircleTwoTone, PhoneOutline, PrinterFill, PicLeftOutline, ProjectTwoTone, PrinterOutline, ProjectFill, ProfileOutline, ProfileTwoTone, ProjectOutline, PropertySafetyFill, PullRequestOutline, PropertySafetyOutline, PushpinOutline, PushpinTwoTone, PropertySafetyTwoTone, PushpinFill, QqOutline, QqCircleFill, QrcodeOutline, QqSquareFill, QuestionCircleTwoTone, QuestionCircleFill, RadarChartOutline, RadiusUprightOutline, QuestionCircleOutline, QuestionOutline, ReadFill, RadiusUpleftOutline, RadiusBottomleftOutline, RadiusSettingOutline, RadiusBottomrightOutline, ProfileFill, PrinterTwoTone, ReadOutline, ReconciliationFill, ReloadOutline, ReconciliationOutline, RedEnvelopeTwoTone, RedditCircleFill, RedoOutline, RedEnvelopeFill, RedditOutline, RestTwoTone, RightCircleOutline, RestOutline, RedditSquareFill, RestFill, RightCircleTwoTone, RightOutline, RightSquareFill, RightCircleFill, RightSquareOutline, RetweetOutline, RiseOutline, RightSquareTwoTone, RobotFill, RocketOutline, RobotOutline, RocketTwoTone, RocketFill, RedEnvelopeOutline, RollbackOutline, RotateRightOutline, RotateLeftOutline, ReconciliationTwoTone, SafetyCertificateTwoTone, SaveOutline, SafetyOutline, SaveFill, SaveTwoTone, ScheduleFill, SafetyCertificateOutline, ScanOutline, ScheduleTwoTone, SearchOutline, ScheduleOutline, SecurityScanTwoTone, SecurityScanOutline, ScissorOutline, SelectOutline, SecurityScanFill, SendOutline, SettingOutline, SettingTwoTone, SettingFill, ShareAltOutline, ShopOutline, ShopFill, ShopTwoTone, ShrinkOutline, ShakeOutline, ShoppingOutline, ShoppingCartOutline, ShoppingFill, SisternodeOutline, ShoppingTwoTone, SafetyCertificateFill, SkinOutline, SignalFill, SketchOutline, SkinTwoTone, SketchSquareFill, SkypeFill, SkinFill, SlackCircleFill, SlackSquareFill, SlidersTwoTone, SkypeOutline, SlidersFill, SlackSquareOutline, SmallDashOutline, SmileTwoTone, SlidersOutline, SnippetsFill, SnippetsOutline, SmileOutline, SolutionOutline, SlackOutline, SnippetsTwoTone, SoundTwoTone, SortAscendingOutline, SoundFill, SortDescendingOutline, SmileFill, SoundOutline, SplitCellsOutline, SketchCircleFill, StarOutline, StockOutline, StarTwoTone, StepForwardFill, StarFill, StepBackwardFill, StepForwardOutline, StopFill, SubnodeOutline, SwapLeftOutline, StopOutline, StopTwoTone, SwapRightOutline, SwapOutline, SwitcherTwoTone, SwitcherOutline, SyncOutline, StrikethroughOutline, SwitcherFill, TagOutline, TabletTwoTone, TabletOutline, TabletFill, TableOutline, TagsFill, TagFill, TagsTwoTone, TaobaoCircleOutline, StepBackwardOutline, TagsOutline, TagTwoTone, TaobaoOutline, ThunderboltOutline, TaobaoSquareFill, TeamOutline, TaobaoCircleFill, ThunderboltTwoTone, ToolFill, ThunderboltFill, ToTopOutline, ToolOutline, ToolTwoTone, TrademarkCircleFill, TrophyFill, TrademarkCircleTwoTone, TransactionOutline, TrademarkCircleOutline, TranslationOutline, TwitterCircleFill, TrophyOutline, TrademarkOutline, TrophyTwoTone, TwitterSquareFill, UnlockFill, TwitterOutline, UnderlineOutline, UndoOutline, UpCircleFill, UngroupOutline, UnlockTwoTone, UnlockOutline, UpOutline, UsbFill, UpCircleOutline, UnorderedListOutline, UpCircleTwoTone, UpSquareFill, UpSquareOutline, UserAddOutline, UsbTwoTone, UsergroupDeleteOutline, UpSquareTwoTone, UserOutline, UsbOutline, UserDeleteOutline, UserSwitchOutline, VerticalLeftOutline, VerticalAlignBottomOutline, VerifiedOutline, UsergroupAddOutline, UploadOutline, VerticalAlignMiddleOutline, VerticalAlignTopOutline, VerticalRightOutline, VideoCameraOutline, VideoCameraAddOutline, VideoCameraTwoTone, VideoCameraFill, WalletOutline, WalletFill, WarningFill, WarningOutline, WechatOutline, WalletTwoTone, WeiboCircleFill, WarningTwoTone, WeiboSquareFill, WeiboOutline, WeiboSquareOutline, WeiboCircleOutline, WechatFill, WhatsAppOutline, WifiOutline, WomanOutline, YoutubeFill, YahooOutline, WindowsFill, WindowsOutline, YoutubeOutline, YuqueOutline, ZhihuCircleFill, YuqueFill, ZhihuOutline, ZhihuSquareFill, ZoomInOutline, ZoomOutOutline, YahooFill } from '@ant-design/icons-angular/icons';
62
- import * as i3$4 from '@yelon/acl';
63
-
64
- var NavType;
65
- (function (NavType) {
66
- NavType["APPLICATION"] = "application";
67
- NavType["GROUP"] = "group";
68
- NavType["TILE"] = "tile";
69
- })(NavType || (NavType = {}));
70
-
71
- class YunzaiClearStorageComponent {
72
- constructor(modalSrv, messageSrv) {
73
- this.modalSrv = modalSrv;
74
- this.messageSrv = messageSrv;
75
- }
76
- _click() {
77
- this.modalSrv.confirm({
78
- nzTitle: 'Make sure clear all local storage?',
79
- nzOnOk: () => {
80
- localStorage.clear();
81
- this.messageSrv.success('Clear Finished!');
82
- }
83
- });
84
- }
85
- }
86
- YunzaiClearStorageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiClearStorageComponent, deps: [{ token: i1.NzModalService }, { token: i1$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
87
- YunzaiClearStorageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage", host: { listeners: { "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
88
- <i nz-icon nzType="tool"></i>
89
- {{ 'storage.clear' | i18n }}
90
- `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiClearStorageComponent, decorators: [{
92
- type: Component,
93
- args: [{
94
- selector: 'yunzai-clearstorage',
95
- template: `
96
- <i nz-icon nzType="tool"></i>
97
- {{ 'storage.clear' | i18n }}
98
- `,
99
- host: {
100
- '[class.d-block]': 'true'
101
- },
102
- changeDetection: ChangeDetectionStrategy.OnPush
103
- }]
104
- }], ctorParameters: function () { return [{ type: i1.NzModalService }, { type: i1$1.NzMessageService }]; }, propDecorators: { _click: [{
105
- type: HostListener,
106
- args: ['click']
107
- }] } });
108
-
109
- class YunzaiFullScreenComponent {
110
- constructor() {
111
- this.status = false;
112
- }
113
- _resize() {
114
- this.status = screenfull.isFullscreen;
115
- }
116
- _click() {
117
- if (screenfull.isEnabled) {
118
- screenfull.toggle();
119
- }
120
- }
121
- }
122
- YunzaiFullScreenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiFullScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
123
- YunzaiFullScreenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen", host: { listeners: { "window:resize": "_resize()", "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
124
- <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
125
- {{ (status ? 'exitFullscreen' : 'fullscreen') | i18n }}
126
- `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiFullScreenComponent, decorators: [{
128
- type: Component,
129
- args: [{
130
- selector: 'yunzai-fullscreen',
131
- template: `
132
- <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
133
- {{ (status ? 'exitFullscreen' : 'fullscreen') | i18n }}
134
- `,
135
- host: {
136
- '[class.d-block]': 'true'
137
- },
138
- changeDetection: ChangeDetectionStrategy.OnPush
139
- }]
140
- }], propDecorators: { _resize: [{
141
- type: HostListener,
142
- args: ['window:resize']
143
- }], _click: [{
144
- type: HostListener,
145
- args: ['click']
146
- }] } });
147
-
148
- const BUSINESS_DEFAULT_CONFIG = {
149
- baseUrl: '/backstage',
150
- systemCode: 'portal',
151
- loginForm: null,
152
- refreshTokenEnabled: true,
153
- refreshTokenType: 're-request'
154
- };
155
- function mergeBisConfig(srv) {
156
- return srv.merge('bis', BUSINESS_DEFAULT_CONFIG);
157
- }
158
-
159
- const YUNZAI_LANGS = {
160
- 'zh-CN': {
161
- text: '简体中文',
162
- ng: ngZh,
163
- zorro: zh_CN,
164
- date: zhCN,
165
- yelon: zh_CN$1,
166
- abbr: '🇨🇳'
167
- },
168
- 'zh-TW': {
169
- text: '繁体中文',
170
- ng: ngZhTw,
171
- zorro: zh_TW,
172
- date: zhTW,
173
- yelon: zh_TW$1,
174
- abbr: '🇭🇰'
175
- },
176
- 'en-US': {
177
- text: 'English',
178
- ng: ngEn,
179
- zorro: en_US,
180
- date: enUS,
181
- yelon: en_US$1,
182
- abbr: '🇬🇧'
183
- },
184
- 'el-GR': {
185
- text: 'Ελληνικά',
186
- ng: ngElGr,
187
- zorro: el_GR,
188
- date: el,
189
- yelon: el_GR$1,
190
- abbr: '🇬🇷'
191
- },
192
- 'es-ES': {
193
- text: 'Español',
194
- ng: ngEsEs,
195
- zorro: es_ES,
196
- date: es,
197
- yelon: es_ES$1,
198
- abbr: '🇪🇸'
199
- },
200
- 'fr-FR': {
201
- text: 'Français',
202
- ng: ngFr,
203
- zorro: fr_FR,
204
- date: fr,
205
- yelon: fr_FR$1,
206
- abbr: '🇫🇷'
207
- },
208
- 'hr-HR': {
209
- text: 'Hrvatski',
210
- ng: ngHr,
211
- zorro: hr_HR,
212
- date: hr,
213
- yelon: hr_HR$1,
214
- abbr: '🇭🇷'
215
- },
216
- 'it-IT': {
217
- text: 'Italiano',
218
- ng: ngIt,
219
- zorro: it_IT,
220
- date: it,
221
- yelon: it_IT$1,
222
- abbr: '🇮🇹'
223
- },
224
- 'ko-KR': {
225
- text: '한국어',
226
- ng: ngKo,
227
- zorro: ko_KR,
228
- date: ko,
229
- yelon: ko_KR$1,
230
- abbr: '🇰🇷'
231
- },
232
- 'pl-PL': {
233
- text: 'Polski',
234
- ng: ngPl,
235
- zorro: pl_PL,
236
- date: pl,
237
- yelon: pl_PL$1,
238
- abbr: '🇵🇱'
239
- },
240
- 'sl-SI': {
241
- text: 'Slovenščina',
242
- ng: ngSl,
243
- zorro: sl_SI,
244
- date: sl,
245
- yelon: sl_SI$1,
246
- abbr: '🇸🇮'
247
- },
248
- 'tr-TR': {
249
- text: 'Türkçe',
250
- ng: ngTr,
251
- zorro: tr_TR,
252
- date: tr,
253
- yelon: tr_TR$1,
254
- abbr: '🇹🇷'
255
- }
256
- };
257
-
258
- const DEFAULT = 'zh-CN';
259
- class YunzaiI18NService extends YunzaiI18nBaseService {
260
- constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv, cacheService) {
261
- super(cogSrv);
262
- this.http = http;
263
- this.settings = settings;
264
- this.nzI18nService = nzI18nService;
265
- this.yelonLocaleService = yelonLocaleService;
266
- this.platform = platform;
267
- this.cacheService = cacheService;
268
- this._defaultLang = DEFAULT;
269
- this.destroy$ = new Subject();
270
- const defaultLang = this.getDefaultLang();
271
- this.bis = mergeBisConfig(cogSrv);
272
- this.getLangs()
273
- .pipe(takeUntil(this.destroy$))
274
- .subscribe(langs => {
275
- this._defaultLang = langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
276
- });
277
- }
278
- getDefaultLang() {
279
- if (!this.platform.isBrowser) {
280
- return DEFAULT;
281
- }
282
- if (this.settings.layout.lang) {
283
- return this.settings.layout.lang;
284
- }
285
- let res = (navigator.languages ? navigator.languages[0] : null) || navigator.language;
286
- const arr = res.split('-');
287
- return arr.length <= 1 ? res : `${arr[0]}-${arr[1].toUpperCase()}`;
288
- }
289
- loadLangData(lang) {
290
- if (ngDevMode) {
291
- return this.http.get(`assets/tmp/i18n/${lang}.json`);
292
- }
293
- else {
294
- if (this.getLang(lang)) {
295
- return of(this.getLang(lang));
296
- }
297
- return this.http
298
- .get(`${this.bis.baseUrl}/i18n/api/v2/language/${lang}?_allow_anonymous`)
299
- .pipe(catchError(() => this.http.get(`assets/tmp/i18n/${lang}.json`)));
300
- }
301
- }
302
- use(lang, data) {
303
- if (this._currentLang === lang)
304
- return;
305
- if (!ngDevMode) {
306
- this.cacheLang(lang, data);
307
- }
308
- this._data = this.flatData(data, []);
309
- const item = YUNZAI_LANGS[lang];
310
- if (item) {
311
- registerLocaleData(item.ng);
312
- this.nzI18nService.setLocale(item.zorro);
313
- this.nzI18nService.setDateLocale(item.date);
314
- this.yelonLocaleService.setLocale(item.yelon);
315
- this._currentLang = lang;
316
- this._change$.next(lang);
317
- }
318
- else {
319
- registerLocaleData(ngEn);
320
- this.nzI18nService.setLocale(en_US);
321
- this.nzI18nService.setDateLocale(enUS);
322
- this.yelonLocaleService.setLocale(en_US$1);
323
- this._currentLang = lang;
324
- this._change$.next(lang);
325
- }
326
- }
327
- getLangs() {
328
- const langs = Object.keys(YUNZAI_LANGS).map(code => {
329
- const item = YUNZAI_LANGS[code];
330
- return { code, text: item.text, abbr: item.abbr, image: undefined };
331
- });
332
- if (ngDevMode) {
333
- return of(langs);
334
- }
335
- else {
336
- if (this.getCachedLangs().length > 0) {
337
- return of(this.getCachedLangs());
338
- }
339
- return this.http.get(`${this.bis.baseUrl}/i18n/api/v2/language?_allow_anonymous`).pipe(map((response) => {
340
- this.cacheLangs(response.data);
341
- return response.data;
342
- }), catchError(() => of(langs)));
343
- }
344
- }
345
- cacheLang(lang, data) {
346
- const key = `_yz_lang_${lang}`;
347
- this.cacheService.set(key, data);
348
- }
349
- getLang(lang) {
350
- const key = `_yz_lang_${lang}`;
351
- return this.cacheService.get(key, { mode: 'none' });
352
- }
353
- cacheLangs(langs) {
354
- const key = `_yz_langs`;
355
- this.cacheService.set(key, langs);
356
- }
357
- getCachedLangs() {
358
- const key = `_yz_langs`;
359
- return this.cacheService.get(key, { mode: 'none' }) || [];
360
- }
361
- ngOnDestroy() {
362
- this.destroy$.complete();
363
- }
364
- }
365
- YunzaiI18NService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Injectable });
366
- YunzaiI18NService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiI18NService, providedIn: 'root' });
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiI18NService, decorators: [{
368
- type: Injectable,
369
- args: [{ providedIn: 'root' }]
370
- }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
371
-
372
- class YunzaiI18NComponent {
373
- get curLangCode() {
374
- return this.settings.layout.lang;
375
- }
376
- constructor(settings, i18n, doc) {
377
- this.settings = settings;
378
- this.i18n = i18n;
379
- this.doc = doc;
380
- this.destroy$ = new Subject();
381
- /** Whether to display language text */
382
- this.showLangText = true;
383
- this.langs = [];
384
- this.i18n
385
- .getLangs()
386
- .pipe(takeUntil(this.destroy$))
387
- .subscribe(langs => {
388
- this.langs = langs;
389
- });
390
- }
391
- change(lang) {
392
- const spinEl = this.doc.createElement('div');
393
- spinEl.setAttribute('class', `page-loading ant-spin ant-spin-lg ant-spin-spinning`);
394
- spinEl.innerHTML = `<span class="ant-spin-dot ant-spin-dot-spin"><i></i><i></i><i></i><i></i></span>`;
395
- this.doc.body.appendChild(spinEl);
396
- this.i18n.loadLangData(lang).subscribe(res => {
397
- this.i18n.use(lang, res);
398
- this.settings.setLayout('lang', lang);
399
- setTimeout(() => this.doc.location.reload());
400
- });
401
- }
402
- ngOnDestroy() {
403
- this.destroy$.complete();
404
- }
405
- }
406
- YunzaiI18NComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
407
- YunzaiI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
408
- <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
409
- <i nz-icon nzType="global"></i>
410
- {{ 'lang.nav' | i18n }}
411
- <i nz-icon nzType="down"></i>
412
- </div>
413
- <i
414
- *ngIf="!showLangText"
415
- nz-dropdown
416
- [nzDropdownMenu]="langMenu"
417
- nzPlacement="bottomRight"
418
- nz-icon
419
- nzType="global"
420
- ></i>
421
- <nz-dropdown-menu data-event-id="_nav_lang" #langMenu="nzDropdownMenu">
422
- <ul nz-menu>
423
- <li
424
- data-event-id="_nav_lang"
425
- [attr.data-text]="item.text"
426
- nz-menu-item
427
- *ngFor="let item of langs"
428
- [nzSelected]="item.code === curLangCode"
429
- (click)="change(item.code)"
430
- >
431
- <span *ngIf="!item.icon" role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
432
- <img
433
- *ngIf="item.icon"
434
- style="margin-right:4px"
435
- width="50px"
436
- height="30px"
437
- [src]="'data:image/png;base64,' + item.icon"
438
- [alt]="item.abbr"
439
- class="pr-xs"
440
- />
441
- {{ item.text }}
442
- </li>
443
- </ul>
444
- </nz-dropdown-menu>
445
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
446
- __decorate([
447
- InputBoolean()
448
- ], YunzaiI18NComponent.prototype, "showLangText", void 0);
449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiI18NComponent, decorators: [{
450
- type: Component,
451
- args: [{
452
- selector: 'yunzai-i18n',
453
- template: `
454
- <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
455
- <i nz-icon nzType="global"></i>
456
- {{ 'lang.nav' | i18n }}
457
- <i nz-icon nzType="down"></i>
458
- </div>
459
- <i
460
- *ngIf="!showLangText"
461
- nz-dropdown
462
- [nzDropdownMenu]="langMenu"
463
- nzPlacement="bottomRight"
464
- nz-icon
465
- nzType="global"
466
- ></i>
467
- <nz-dropdown-menu data-event-id="_nav_lang" #langMenu="nzDropdownMenu">
468
- <ul nz-menu>
469
- <li
470
- data-event-id="_nav_lang"
471
- [attr.data-text]="item.text"
472
- nz-menu-item
473
- *ngFor="let item of langs"
474
- [nzSelected]="item.code === curLangCode"
475
- (click)="change(item.code)"
476
- >
477
- <span *ngIf="!item.icon" role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
478
- <img
479
- *ngIf="item.icon"
480
- style="margin-right:4px"
481
- width="50px"
482
- height="30px"
483
- [src]="'data:image/png;base64,' + item.icon"
484
- [alt]="item.abbr"
485
- class="pr-xs"
486
- />
487
- {{ item.text }}
488
- </li>
489
- </ul>
490
- </nz-dropdown-menu>
491
- `,
492
- changeDetection: ChangeDetectionStrategy.OnPush
493
- }]
494
- }], ctorParameters: function () {
495
- return [{ type: i1$2.SettingsService }, { type: YunzaiI18NService, decorators: [{
496
- type: Inject,
497
- args: [YUNZAI_I18N_TOKEN]
498
- }] }, { type: undefined, decorators: [{
499
- type: Inject,
500
- args: [DOCUMENT]
501
- }] }];
502
- }, propDecorators: { showLangText: [{
503
- type: Input
504
- }] } });
505
-
506
- class YunzaiNotifyComponent {
507
- constructor(injector, msg, y18n, nzI18n, cdr, httpClient) {
508
- this.injector = injector;
509
- this.msg = msg;
510
- this.y18n = y18n;
511
- this.nzI18n = nzI18n;
512
- this.cdr = cdr;
513
- this.httpClient = httpClient;
514
- this.data = [
515
- {
516
- key: 'msg',
517
- title: this.y18n.fanyi('notify.message'),
518
- list: [],
519
- emptyText: this.y18n.fanyi('notify.message.empty'),
520
- emptyImage: './assets/tmp/img/message.svg',
521
- clearText: this.y18n.fanyi('notify.message.clear')
522
- },
523
- {
524
- key: 'todo',
525
- title: this.y18n.fanyi('notify.todo'),
526
- list: [],
527
- emptyText: this.y18n.fanyi('notify.todo.empty'),
528
- emptyImage: './assets/tmp/img/todo.svg',
529
- clearText: this.y18n.fanyi('notify.todo.clear')
530
- },
531
- {
532
- key: 'notice',
533
- title: this.y18n.fanyi('notify.notice'),
534
- list: [],
535
- emptyText: this.y18n.fanyi('notify.notice.empty'),
536
- emptyImage: './assets/tmp/img/notice.svg',
537
- clearText: this.y18n.fanyi('notify.notice.clear')
538
- }
539
- ];
540
- this.loading = false;
541
- this.count = 0;
542
- this.subs = [];
543
- }
544
- ngOnInit() {
545
- this.loadData();
546
- }
547
- loadData() {
548
- this.count = 0;
549
- this.loading = true;
550
- this.subs.push(forkJoin(this.loadTodo(), this.loadMessage()).subscribe(() => {
551
- this.loading = false;
552
- this.cdr.detectChanges();
553
- }));
554
- }
555
- loadMessage() {
556
- log('notify.component: ', 'fetch message list');
557
- const formatMessageStatus = (status) => {
558
- switch (status) {
559
- case '0':
560
- return { extra: this.y18n.fanyi('notify.unread'), color: 'red' };
561
- case '1':
562
- return { extra: this.y18n.fanyi('notify.readed'), color: 'green' };
563
- default:
564
- return { extra: this.y18n.fanyi('notify.nostatus'), color: 'primary' };
565
- }
566
- };
567
- return this.httpClient
568
- .post(`/message-center-3/my-msg-and-todo/msg-list`, {
569
- pageNum: 1,
570
- pageSize: 10,
571
- status: '0'
572
- })
573
- .pipe(map$1((response) => {
574
- const viewMessage = this.data.filter(d => d.key === 'msg')[0];
575
- viewMessage.list = response.data.list.map((m) => {
576
- return Object.assign(Object.assign({}, m), { avatar: (m === null || m === void 0 ? void 0 : m.imgUrl) || './assets/tmp/img/message.png', title: m.systemName, description: m.content, extra: formatMessageStatus(m.status).extra, color: formatMessageStatus(m.status).color, datetime: formatDistanceToNow(new Date(m.date), { locale: this.nzI18n.getDateLocale() }) });
577
- });
578
- this.count += viewMessage.list.length;
579
- }));
580
- }
581
- loadTodo() {
582
- log('notify.component: ', 'fetch todo list');
583
- const formatTodoStatus = (status) => {
584
- switch (status) {
585
- case '0':
586
- return { extra: this.y18n.fanyi('notify.unstart'), color: 'red' };
587
- case '1':
588
- return { extra: this.y18n.fanyi('notify.started'), color: 'green' };
589
- default:
590
- return { extra: this.y18n.fanyi('notify.nostatus'), color: 'primary' };
591
- }
592
- };
593
- return this.httpClient
594
- .post(`/message-center-3/my-msg-and-todo/todo-list`, {
595
- pageNum: 1,
596
- pageSize: 10,
597
- status: '0'
598
- })
599
- .pipe(map$1((response) => {
600
- const viewTodo = this.data.filter(d => d.key === 'todo')[0];
601
- viewTodo.list = response.data.list.map((t) => {
602
- return Object.assign(Object.assign({}, t), { avatar: (t === null || t === void 0 ? void 0 : t.imgUrl) || './assets/tmp/img/todo.png', title: t.systemName, description: t.content, datetime: formatDistanceToNow(new Date(t.date), { locale: this.nzI18n.getDateLocale() }), extra: formatTodoStatus(t.status).extra, color: formatTodoStatus(t.status).color });
603
- });
604
- this.count += viewTodo.list.length;
605
- }));
606
- }
607
- clear(type) {
608
- const t = this.data.filter(d => d.title === type)[0];
609
- if (t.key == 'msg' || t.key == 'notice') {
610
- this.subs.push(this.httpClient.post(`/message-center-3/my-msg-and-todo/msg-clear`, {}).subscribe(_ => {
611
- this.msg.success(`${this.y18n.fanyi('notify.clear')} ${type}`);
612
- this.loadData();
613
- }));
614
- }
615
- if (t.key == 'todo') {
616
- this.loadData();
617
- }
618
- }
619
- select(res) {
620
- this.injector.get(WINDOW).open(res.item.url);
621
- this.loadData();
622
- }
623
- ngOnDestroy() {
624
- this.subs.forEach(a => a.unsubscribe());
625
- }
626
- }
627
- YunzaiNotifyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiNotifyComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YUNZAI_I18N_TOKEN }, { token: i2.NzI18nService }, { token: i0.ChangeDetectorRef }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
628
- YunzaiNotifyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiNotifyComponent, selector: "yunzai-notify", ngImport: i0, template: `
629
- <notice-icon
630
- [data]="data"
631
- [count]="count"
632
- [loading]="loading"
633
- btnClass="yunzai-default__nav-item"
634
- btnIconClass="yunzai-default__nav-item-icon"
635
- (select)="select($event)"
636
- (clear)="clear($event)"
637
- ></notice-icon>
638
- `, isInline: true, dependencies: [{ kind: "component", type: i4$2.NoticeIconComponent, selector: "notice-icon", inputs: ["data", "count", "loading", "popoverVisible", "btnClass", "btnIconClass", "centered"], outputs: ["select", "clear", "popoverVisibleChange"], exportAs: ["noticeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiNotifyComponent, decorators: [{
640
- type: Component,
641
- args: [{
642
- selector: 'yunzai-notify',
643
- template: `
644
- <notice-icon
645
- [data]="data"
646
- [count]="count"
647
- [loading]="loading"
648
- btnClass="yunzai-default__nav-item"
649
- btnIconClass="yunzai-default__nav-item-icon"
650
- (select)="select($event)"
651
- (clear)="clear($event)"
652
- ></notice-icon>
653
- `,
654
- changeDetection: ChangeDetectionStrategy.OnPush
655
- }]
656
- }], ctorParameters: function () {
657
- return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: YunzaiI18NService, decorators: [{
658
- type: Inject,
659
- args: [YUNZAI_I18N_TOKEN]
660
- }] }, { type: i2.NzI18nService }, { type: i0.ChangeDetectorRef }, { type: i1$2._HttpClient }];
661
- } });
662
-
663
- class YunzaiThemBtnComponent {
664
- constructor(renderer, configSrv, platform, doc, directionality, KEYS) {
665
- this.renderer = renderer;
666
- this.configSrv = configSrv;
667
- this.platform = platform;
668
- this.doc = doc;
669
- this.directionality = directionality;
670
- this.KEYS = KEYS;
671
- this.theme = 'default';
672
- this.types = [
673
- { key: 'default', text: 'theme.default', color: '#2163ff' },
674
- { key: 'compact', text: 'theme.compact', color: '#2163ff' },
675
- { key: 'dark', text: 'theme.dark', color: '#020202' },
676
- { key: 'yuhong', text: 'theme.yuhong', color: '#C04851' },
677
- { key: 'danjuhuang', text: 'theme.danjuhuang', color: '#FBA414' },
678
- { key: 'xinghuang', text: 'theme.xinghuang', color: '#F28E16' },
679
- { key: 'shilv', text: 'theme.shilv', color: '#57C3C2' },
680
- { key: 'zhulv', text: 'theme.zhulv', color: '#1BA784' },
681
- { key: 'youlan', text: 'theme.youlan', color: '#1781B5' },
682
- { key: 'dianqing', text: 'theme.dianqing', color: '#1661AB' },
683
- { key: 'shangengzi', text: 'theme.shangengzi', color: '#61649F' },
684
- { key: 'shuiniuhui', text: 'theme.shuiniuhui', color: '#2F2F35' }
685
- ];
686
- this.devTips = `When the dark.css file can't be found, you need to run it once: npm run theme`;
687
- this.deployUrl = '';
688
- this.destroy$ = new Subject();
689
- this.dir = 'ltr';
690
- }
691
- ngOnInit() {
692
- var _a;
693
- this.dir = this.directionality.value;
694
- (_a = this.directionality.change) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this.destroy$)).subscribe((direction) => {
695
- this.dir = direction;
696
- });
697
- this.initTheme();
698
- }
699
- initTheme() {
700
- if (!this.platform.isBrowser) {
701
- return;
702
- }
703
- this.theme = localStorage.getItem(this.KEYS) || 'default';
704
- this.updateChartTheme();
705
- this.onThemeChange(this.theme);
706
- }
707
- updateChartTheme() {
708
- this.configSrv.set('chart', { theme: this.theme === 'dark' ? 'dark' : '' });
709
- }
710
- onThemeChange(theme) {
711
- if (!this.platform.isBrowser) {
712
- return;
713
- }
714
- this.theme = theme;
715
- this.renderer.setAttribute(this.doc.body, 'data-theme', theme);
716
- const dom = this.doc.getElementById(this.KEYS);
717
- if (dom) {
718
- dom.remove();
719
- }
720
- localStorage.removeItem(this.KEYS);
721
- if (theme !== 'default') {
722
- const el = this.doc.createElement('link');
723
- el.type = 'text/css';
724
- el.rel = 'stylesheet';
725
- el.id = this.KEYS;
726
- el.href = `${this.deployUrl}assets/style.${theme}.css`;
727
- localStorage.setItem(this.KEYS, theme);
728
- this.doc.body.append(el);
729
- }
730
- this.updateChartTheme();
731
- }
732
- ngOnDestroy() {
733
- const el = this.doc.getElementById(this.KEYS);
734
- if (el != null) {
735
- this.doc.body.removeChild(el);
736
- }
737
- this.destroy$.next();
738
- this.destroy$.complete();
739
- }
740
- }
741
- YunzaiThemBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiThemBtnComponent, deps: [{ token: i0.Renderer2 }, { token: i4.YunzaiConfigService }, { token: i3$1.Platform }, { token: DOCUMENT }, { token: i3$2.Directionality, optional: true }, { token: YUNZAI_THEME_BTN_KEYS }], target: i0.ɵɵFactoryTarget.Component });
742
- YunzaiThemBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: { types: "types", devTips: "devTips", deployUrl: "deployUrl" }, ngImport: i0, template: `
743
- <div
744
- data-event-id="_nav_theme"
745
- class="yunzai-default__nav-item"
746
- nz-dropdown
747
- [nzDropdownMenu]="iconMenu"
748
- nzTrigger="click"
749
- nzPlacement="bottomRight"
750
- >
751
- <svg nz-tooltip class="anticon" role="img" width="21" height="21" viewBox="0 0 21 21" fill="currentColor">
752
- <g fill-rule="evenodd">
753
- <g fill-rule="nonzero">
754
- <path
755
- d="M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z"
756
- ></path>
757
- </g>
758
- </g>
759
- </svg>
760
- </div>
761
- <nz-dropdown-menu #iconMenu="nzDropdownMenu">
762
- <ul nz-menu>
763
- <li
764
- nz-menu-item
765
- data-event-id="_nav_theme"
766
- [attr.data-text]="theme.text | i18n"
767
- *ngFor="let theme of types"
768
- (click)="onThemeChange(theme.key)"
769
- [style]="{ color: theme.color }"
770
- >
771
- <i nz-icon nzType="bg-colors"></i>
772
- {{ theme.text | i18n }}
773
- </li>
774
- </ul>
775
- <!-- <div nz-menu class="wd-xl animated jello">-->
776
- <!-- <div nz-row [nzJustify]="'space-between'" [nzAlign]="'middle'" class="app-icons">-->
777
- <!-- <div nz-col [nzSpan]="4" *ngFor="let theme of types" (click)="onThemeChange(theme.key)">-->
778
- <!-- <i nz-icon nzType="bg-colors" class="text-white" [style]="{ backgroundColor: theme.color }"></i>-->
779
- <!-- <span [ngStyle]="{ color: theme.color }">{{ theme.text | i18n }}</span>-->
780
- <!-- </div>-->
781
- <!-- </div>-->
782
- <!-- </div>-->
783
- </nz-dropdown-menu>
784
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8$1.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiThemBtnComponent, decorators: [{
786
- type: Component,
787
- args: [{
788
- selector: 'yunzai-theme-btn',
789
- template: `
790
- <div
791
- data-event-id="_nav_theme"
792
- class="yunzai-default__nav-item"
793
- nz-dropdown
794
- [nzDropdownMenu]="iconMenu"
795
- nzTrigger="click"
796
- nzPlacement="bottomRight"
797
- >
798
- <svg nz-tooltip class="anticon" role="img" width="21" height="21" viewBox="0 0 21 21" fill="currentColor">
799
- <g fill-rule="evenodd">
800
- <g fill-rule="nonzero">
801
- <path
802
- d="M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z"
803
- ></path>
804
- </g>
805
- </g>
806
- </svg>
807
- </div>
808
- <nz-dropdown-menu #iconMenu="nzDropdownMenu">
809
- <ul nz-menu>
810
- <li
811
- nz-menu-item
812
- data-event-id="_nav_theme"
813
- [attr.data-text]="theme.text | i18n"
814
- *ngFor="let theme of types"
815
- (click)="onThemeChange(theme.key)"
816
- [style]="{ color: theme.color }"
817
- >
818
- <i nz-icon nzType="bg-colors"></i>
819
- {{ theme.text | i18n }}
820
- </li>
821
- </ul>
822
- <!-- <div nz-menu class="wd-xl animated jello">-->
823
- <!-- <div nz-row [nzJustify]="'space-between'" [nzAlign]="'middle'" class="app-icons">-->
824
- <!-- <div nz-col [nzSpan]="4" *ngFor="let theme of types" (click)="onThemeChange(theme.key)">-->
825
- <!-- <i nz-icon nzType="bg-colors" class="text-white" [style]="{ backgroundColor: theme.color }"></i>-->
826
- <!-- <span [ngStyle]="{ color: theme.color }">{{ theme.text | i18n }}</span>-->
827
- <!-- </div>-->
828
- <!-- </div>-->
829
- <!-- </div>-->
830
- </nz-dropdown-menu>
831
- `,
832
- changeDetection: ChangeDetectionStrategy.OnPush
833
- }]
834
- }], ctorParameters: function () {
835
- return [{ type: i0.Renderer2 }, { type: i4.YunzaiConfigService }, { type: i3$1.Platform }, { type: undefined, decorators: [{
836
- type: Inject,
837
- args: [DOCUMENT]
838
- }] }, { type: i3$2.Directionality, decorators: [{
839
- type: Optional
840
- }] }, { type: undefined, decorators: [{
841
- type: Inject,
842
- args: [YUNZAI_THEME_BTN_KEYS]
843
- }] }];
844
- }, propDecorators: { types: [{
845
- type: Input
846
- }], devTips: [{
847
- type: Input
848
- }], deployUrl: [{
849
- type: Input
850
- }] } });
851
-
852
- class YunzaiUserComponent {
853
- constructor(injector, msg, tokenService,
854
- // @ts-ignore
855
- configService, cacheService) {
856
- this.injector = injector;
857
- this.msg = msg;
858
- this.tokenService = tokenService;
859
- this.configService = configService;
860
- this.cacheService = cacheService;
861
- this.icon = '';
862
- this.username = '';
863
- this.menus = [];
864
- this.config = mergeBisConfig(configService);
865
- }
866
- ngOnInit() {
867
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
868
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
869
- this.username = user.realname ? user.realname : '未命名';
870
- this.icon = user.avatarId
871
- ? `${this.config.baseUrl}/filecenter/file/${user.avatarId}`
872
- : `./assets/tmp/img/avatar.jpg`;
873
- this.menus = projectInfo.profileList;
874
- }
875
- logout() {
876
- localStorage.clear();
877
- this.tokenService.clear();
878
- this.injector.get(WINDOW).location.href = `${this.config.baseUrl}/cas-proxy/app/logout`;
879
- }
880
- to(href) {
881
- if (href) {
882
- this.injector.get(WINDOW).open(href);
883
- }
884
- else {
885
- this.msg.error('该菜单没有配置链接!');
886
- }
887
- }
888
- }
889
- YunzaiUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Component });
890
- YunzaiUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiUserComponent, selector: "yunzai-user", ngImport: i0, template: `
891
- <div
892
- class="yunzai-default__nav-item d-flex align-items-center px-sm"
893
- data-event-id="_nav_user"
894
- nz-dropdown
895
- nzPlacement="bottomRight"
896
- [nzDropdownMenu]="userMenu"
897
- >
898
- <div class="yz-user-name">
899
- <nz-avatar [nzSrc]="icon" nzSize="small" class="mr-sm"></nz-avatar>
900
- {{ username }}
901
- </div>
902
- </div>
903
- <nz-dropdown-menu #userMenu="nzDropdownMenu">
904
- <div nz-menu class="width-sm">
905
- <div
906
- data-event-id="_nav_user"
907
- [attr.data-name]="m.name | i18n"
908
- nz-menu-item
909
- *ngFor="let m of menus"
910
- (click)="to(m.url)"
911
- >
912
- <i nz-icon [nzType]="m.icon" class="mr-sm"></i>
913
- {{ m.name | i18n }}
914
- </div>
915
- <li nz-menu-divider></li>
916
- <div data-event-id="_nav_user" data-name="注销登录" nz-menu-item (click)="logout()">
917
- <i nz-icon nzType="logout" class="mr-sm"></i>
918
- {{ 'logout' | i18n }}
919
- </div>
920
- </div>
921
- </nz-dropdown-menu>
922
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i6.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i9.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiUserComponent, decorators: [{
924
- type: Component,
925
- args: [{
926
- selector: 'yunzai-user',
927
- template: `
928
- <div
929
- class="yunzai-default__nav-item d-flex align-items-center px-sm"
930
- data-event-id="_nav_user"
931
- nz-dropdown
932
- nzPlacement="bottomRight"
933
- [nzDropdownMenu]="userMenu"
934
- >
935
- <div class="yz-user-name">
936
- <nz-avatar [nzSrc]="icon" nzSize="small" class="mr-sm"></nz-avatar>
937
- {{ username }}
938
- </div>
939
- </div>
940
- <nz-dropdown-menu #userMenu="nzDropdownMenu">
941
- <div nz-menu class="width-sm">
942
- <div
943
- data-event-id="_nav_user"
944
- [attr.data-name]="m.name | i18n"
945
- nz-menu-item
946
- *ngFor="let m of menus"
947
- (click)="to(m.url)"
948
- >
949
- <i nz-icon [nzType]="m.icon" class="mr-sm"></i>
950
- {{ m.name | i18n }}
951
- </div>
952
- <li nz-menu-divider></li>
953
- <div data-event-id="_nav_user" data-name="注销登录" nz-menu-item (click)="logout()">
954
- <i nz-icon nzType="logout" class="mr-sm"></i>
955
- {{ 'logout' | i18n }}
956
- </div>
957
- </div>
958
- </nz-dropdown-menu>
959
- `,
960
- changeDetection: ChangeDetectionStrategy.OnPush
961
- }]
962
- }], ctorParameters: function () {
963
- return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: undefined, decorators: [{
964
- type: Inject,
965
- args: [YA_SERVICE_TOKEN]
966
- }] }, { type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }];
967
- } });
968
-
969
- class LayoutNavApplicationComponent {
970
- constructor(cacheService, i18n, http, inject) {
971
- this.cacheService = cacheService;
972
- this.i18n = i18n;
973
- this.http = http;
974
- this.inject = inject;
975
- this.state = {
976
- active: false,
977
- type: 'all',
978
- topic: undefined,
979
- topics: [],
980
- list: [],
981
- search: null,
982
- destroy$: new Subject()
983
- };
984
- }
985
- ngOnInit() {
986
- this.fetchAllTopic();
987
- this.attachNav('all');
988
- }
989
- fetchAllTopic() {
990
- this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
991
- }
992
- attachNav(type, topic) {
993
- this.state.type = type;
994
- this.clearSearch();
995
- if (type === 'all') {
996
- this.displayAllNav();
997
- }
998
- if (type === 'mine') {
999
- this.displayMineNav();
1000
- }
1001
- if (type === 'other' && topic) {
1002
- this.displayOtherNav(topic);
1003
- }
1004
- }
1005
- clearSearch() {
1006
- this.state.search = null;
1007
- }
1008
- displayAllNav() {
1009
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
1010
- }
1011
- displayMineNav() {
1012
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1013
- this.state.list = temp
1014
- .filter((topic) => {
1015
- topic.children = topic.children.filter((child) => {
1016
- return child.auth;
1017
- });
1018
- return topic;
1019
- })
1020
- .filter((topic) => {
1021
- return topic.children.length > 0;
1022
- });
1023
- }
1024
- displayOtherNav(topic) {
1025
- this.state.topic = topic;
1026
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1027
- this.state.list = temp.filter(t => t.key === topic.key)[0].children;
1028
- }
1029
- diffChange(flag) {
1030
- if (flag) {
1031
- this.state.active = flag;
1032
- }
1033
- else {
1034
- this.state.active = !this.state.active;
1035
- }
1036
- }
1037
- open(topic) {
1038
- if (topic.key) {
1039
- this.http
1040
- .post(`/app-manager/web-scan/save`, {
1041
- appId: topic.key,
1042
- createDate: new Date()
1043
- })
1044
- .pipe(takeUntil(this.state.destroy$))
1045
- .subscribe();
1046
- }
1047
- switch (topic.target) {
1048
- case 'href':
1049
- this.inject.get(WINDOW).location.href = topic.url;
1050
- break;
1051
- case 'blank':
1052
- this.inject.get(WINDOW).location.href = topic.url;
1053
- break;
1054
- case 'target':
1055
- this.inject.get(WINDOW).location.href = topic.url;
1056
- break;
1057
- default:
1058
- this.inject.get(WINDOW).location.href = topic.url;
1059
- break;
1060
- }
1061
- }
1062
- onSearch() {
1063
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1064
- if (this.state.search) {
1065
- this.state.list = temp
1066
- .filter((topic) => {
1067
- if (this.i18n.fanyi(topic.name).includes(this.state.search)) {
1068
- return topic;
1069
- }
1070
- else {
1071
- topic.children = topic.children.filter((child) => {
1072
- return this.i18n.fanyi(child.name).includes(this.state.search);
1073
- });
1074
- return topic;
1075
- }
1076
- })
1077
- .filter((topic) => {
1078
- return topic.children.length > 0;
1079
- });
1080
- }
1081
- else {
1082
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
1083
- }
1084
- }
1085
- ngOnDestroy() {
1086
- this.state.destroy$.complete();
1087
- }
1088
- }
1089
- LayoutNavApplicationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: i1$3.CacheService }, { token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1090
- LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
1091
- <!-- search start-->
1092
- <ng-template #search>
1093
- <div nz-row class="yz-application-list-search">
1094
- <nz-input-group [nzPrefix]="prefixTemplate">
1095
- <input
1096
- data-event-id="_nav_search"
1097
- type="text"
1098
- nz-input
1099
- placeholder="{{ 'application.search' | i18n }}"
1100
- [(ngModel)]="state.search"
1101
- (ngModelChange)="onSearch()"
1102
- />
1103
- <ng-template #prefixTemplate>
1104
- <i nz-icon nzType="search" nzTheme="outline"></i>
1105
- </ng-template>
1106
- </nz-input-group>
1107
- </div>
1108
- </ng-template>
1109
- <!-- search end -->
1110
-
1111
- <!-- right menu start -->
1112
- <ng-template #ld>
1113
- <div class="yz-application-list">
1114
- <ul>
1115
- <li *ngFor="let topic of state.list">
1116
- <h5>{{ topic.name | i18n }}</h5>
1117
- <a
1118
- data-event-id="_nav_item"
1119
- [attr.data-name]="nav.name | i18n"
1120
- href="javascript:;"
1121
- *ngFor="let nav of topic.children"
1122
- (click)="open(nav)"
1123
- >{{ nav.name | i18n }}</a
1124
- >
1125
- </li>
1126
- </ul>
1127
- </div>
1128
- </ng-template>
1129
- <!-- right menu end -->
1130
-
1131
- <!-- button start-->
1132
- <div data-event-id="_nav_app" class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
1133
- <!-- button end-->
1134
-
1135
- <!-- header start-->
1136
- <div class="yz-application" nz-row *ngIf="state.active">
1137
- <div nz-col [nzSpan]="3" class="yz-application-topic">
1138
- <div data-event-id="_nav_topic" data-name="全部应用" class="yz-application-text" (click)="attachNav('all')">{{
1139
- 'mode.nav.all' | i18n
1140
- }}</div>
1141
- <div data-event-id="_nav_topic" data-name="我的应用" class="yz-application-text" (click)="attachNav('mine')">{{
1142
- 'mode.nav.mine' | i18n
1143
- }}</div>
1144
- <div
1145
- data-event-id="_nav_topic"
1146
- [attr.data-name]="nav.name | i18n"
1147
- class="yz-application-text"
1148
- *ngFor="let nav of state.topics"
1149
- (click)="attachNav('other', nav)"
1150
- >{{ nav.name | i18n }}</div
1151
- >
1152
- </div>
1153
- <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
1154
- <div *ngIf="state.type === 'all'">
1155
- <ng-template [ngTemplateOutlet]="search"></ng-template>
1156
- <ng-template [ngTemplateOutlet]="ld"></ng-template>
1157
- </div>
1158
- <div *ngIf="state.type === 'mine'">
1159
- <ng-template [ngTemplateOutlet]="search"></ng-template>
1160
- <ng-template [ngTemplateOutlet]="ld"></ng-template>
1161
- </div>
1162
- <div *ngIf="state.type === 'other'" class="yz-application-list">
1163
- <div class="yz-application-list-item">
1164
- <ul>
1165
- <li
1166
- data-event-id="_nav_item"
1167
- [attr.data-name]="nav.name | i18n"
1168
- *ngFor="let nav of state.list"
1169
- (click)="open(nav)"
1170
- >
1171
- <a href="javascript:;">
1172
- <h4>{{ nav.name | i18n }}</h4>
1173
- <p>{{ nav.intro | i18n }}</p>
1174
- </a>
1175
- </li>
1176
- </ul>
1177
- </div>
1178
- </div>
1179
- </div>
1180
- </div>
1181
- <!-- header end-->
1182
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavApplicationComponent, decorators: [{
1184
- type: Component,
1185
- args: [{
1186
- selector: `layout-nav-application`,
1187
- template: `
1188
- <!-- search start-->
1189
- <ng-template #search>
1190
- <div nz-row class="yz-application-list-search">
1191
- <nz-input-group [nzPrefix]="prefixTemplate">
1192
- <input
1193
- data-event-id="_nav_search"
1194
- type="text"
1195
- nz-input
1196
- placeholder="{{ 'application.search' | i18n }}"
1197
- [(ngModel)]="state.search"
1198
- (ngModelChange)="onSearch()"
1199
- />
1200
- <ng-template #prefixTemplate>
1201
- <i nz-icon nzType="search" nzTheme="outline"></i>
1202
- </ng-template>
1203
- </nz-input-group>
1204
- </div>
1205
- </ng-template>
1206
- <!-- search end -->
1207
-
1208
- <!-- right menu start -->
1209
- <ng-template #ld>
1210
- <div class="yz-application-list">
1211
- <ul>
1212
- <li *ngFor="let topic of state.list">
1213
- <h5>{{ topic.name | i18n }}</h5>
1214
- <a
1215
- data-event-id="_nav_item"
1216
- [attr.data-name]="nav.name | i18n"
1217
- href="javascript:;"
1218
- *ngFor="let nav of topic.children"
1219
- (click)="open(nav)"
1220
- >{{ nav.name | i18n }}</a
1221
- >
1222
- </li>
1223
- </ul>
1224
- </div>
1225
- </ng-template>
1226
- <!-- right menu end -->
1227
-
1228
- <!-- button start-->
1229
- <div data-event-id="_nav_app" class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
1230
- <!-- button end-->
1231
-
1232
- <!-- header start-->
1233
- <div class="yz-application" nz-row *ngIf="state.active">
1234
- <div nz-col [nzSpan]="3" class="yz-application-topic">
1235
- <div data-event-id="_nav_topic" data-name="全部应用" class="yz-application-text" (click)="attachNav('all')">{{
1236
- 'mode.nav.all' | i18n
1237
- }}</div>
1238
- <div data-event-id="_nav_topic" data-name="我的应用" class="yz-application-text" (click)="attachNav('mine')">{{
1239
- 'mode.nav.mine' | i18n
1240
- }}</div>
1241
- <div
1242
- data-event-id="_nav_topic"
1243
- [attr.data-name]="nav.name | i18n"
1244
- class="yz-application-text"
1245
- *ngFor="let nav of state.topics"
1246
- (click)="attachNav('other', nav)"
1247
- >{{ nav.name | i18n }}</div
1248
- >
1249
- </div>
1250
- <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
1251
- <div *ngIf="state.type === 'all'">
1252
- <ng-template [ngTemplateOutlet]="search"></ng-template>
1253
- <ng-template [ngTemplateOutlet]="ld"></ng-template>
1254
- </div>
1255
- <div *ngIf="state.type === 'mine'">
1256
- <ng-template [ngTemplateOutlet]="search"></ng-template>
1257
- <ng-template [ngTemplateOutlet]="ld"></ng-template>
1258
- </div>
1259
- <div *ngIf="state.type === 'other'" class="yz-application-list">
1260
- <div class="yz-application-list-item">
1261
- <ul>
1262
- <li
1263
- data-event-id="_nav_item"
1264
- [attr.data-name]="nav.name | i18n"
1265
- *ngFor="let nav of state.list"
1266
- (click)="open(nav)"
1267
- >
1268
- <a href="javascript:;">
1269
- <h4>{{ nav.name | i18n }}</h4>
1270
- <p>{{ nav.intro | i18n }}</p>
1271
- </a>
1272
- </li>
1273
- </ul>
1274
- </div>
1275
- </div>
1276
- </div>
1277
- </div>
1278
- <!-- header end-->
1279
- `
1280
- }]
1281
- }], ctorParameters: function () { return [{ type: i1$3.CacheService }, { type: YunzaiI18NService }, { type: i1$2._HttpClient }, { type: i0.Injector }]; } });
1282
-
1283
- class LayoutNavGroupComponent {
1284
- constructor(inject, cacheService, http) {
1285
- this.inject = inject;
1286
- this.cacheService = cacheService;
1287
- this.http = http;
1288
- this.state = {
1289
- topics: [],
1290
- destroy$: new Subject()
1291
- };
1292
- }
1293
- ngOnInit() {
1294
- this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
1295
- }
1296
- open(topic) {
1297
- if (topic.key) {
1298
- this.http
1299
- .post(`/app-manager/web-scan/save`, {
1300
- appId: topic.key,
1301
- createDate: new Date()
1302
- })
1303
- .pipe(takeUntil(this.state.destroy$))
1304
- .subscribe();
1305
- }
1306
- switch (topic.target) {
1307
- case 'href':
1308
- this.inject.get(WINDOW).location.href = topic.url;
1309
- break;
1310
- case 'blank':
1311
- this.inject.get(WINDOW).location.href = topic.url;
1312
- break;
1313
- case 'target':
1314
- this.inject.get(WINDOW).location.href = topic.url;
1315
- break;
1316
- default:
1317
- this.inject.get(WINDOW).location.href = topic.url;
1318
- break;
1319
- }
1320
- }
1321
- ngOnDestroy() {
1322
- this.state.destroy$.complete();
1323
- }
1324
- }
1325
- LayoutNavGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$3.CacheService }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
1326
- LayoutNavGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: LayoutNavGroupComponent, selector: "layout-nav-group", ngImport: i0, template: `
1327
- <div class="yz-application-group">
1328
- <nz-tabset>
1329
- <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1330
- <ng-template #groupTitleTpl>
1331
- <a
1332
- data-event-id="_nav_topic"
1333
- [attr.data-name]="menu.name | i18n"
1334
- nz-dropdown
1335
- [nzDropdownMenu]="menuTpl"
1336
- [nzTrigger]="'click'"
1337
- [nzOverlayClassName]="'yz-application-dropdown'"
1338
- >
1339
- <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1340
- {{ menu.name | i18n }}
1341
- <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down" nzTheme="outline"></i>
1342
- </a>
1343
- <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1344
- <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1345
- <ng-container *ngFor="let item of menu.children">
1346
- <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item (click)="open(item)">
1347
- <i nz-icon *ngIf="item.icon" [nzType]="item.icon" nzTheme="outline"></i>{{ item.name | i18n }}
1348
- </li>
1349
- </ng-container>
1350
- </ul>
1351
- </nz-dropdown-menu>
1352
- </ng-template>
1353
- </nz-tab>
1354
- </nz-tabset>
1355
- </div>
1356
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "directive", type: i7.NzDropDownADirective, selector: "a[nz-dropdown]" }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i8$2.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { kind: "component", type: i8$2.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1357
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavGroupComponent, decorators: [{
1358
- type: Component,
1359
- args: [{
1360
- selector: `layout-nav-group`,
1361
- template: `
1362
- <div class="yz-application-group">
1363
- <nz-tabset>
1364
- <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1365
- <ng-template #groupTitleTpl>
1366
- <a
1367
- data-event-id="_nav_topic"
1368
- [attr.data-name]="menu.name | i18n"
1369
- nz-dropdown
1370
- [nzDropdownMenu]="menuTpl"
1371
- [nzTrigger]="'click'"
1372
- [nzOverlayClassName]="'yz-application-dropdown'"
1373
- >
1374
- <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1375
- {{ menu.name | i18n }}
1376
- <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down" nzTheme="outline"></i>
1377
- </a>
1378
- <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1379
- <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1380
- <ng-container *ngFor="let item of menu.children">
1381
- <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item (click)="open(item)">
1382
- <i nz-icon *ngIf="item.icon" [nzType]="item.icon" nzTheme="outline"></i>{{ item.name | i18n }}
1383
- </li>
1384
- </ng-container>
1385
- </ul>
1386
- </nz-dropdown-menu>
1387
- </ng-template>
1388
- </nz-tab>
1389
- </nz-tabset>
1390
- </div>
1391
- `
1392
- }]
1393
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$3.CacheService }, { type: i1$2._HttpClient }]; } });
1394
-
1395
- class LayoutNavTileComponent {
1396
- constructor() { }
1397
- }
1398
- LayoutNavTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1399
- LayoutNavTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: LayoutNavTileComponent, selector: "layout-nav-tile", ngImport: i0, template: `<template></template>`, isInline: true });
1400
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LayoutNavTileComponent, decorators: [{
1401
- type: Component,
1402
- args: [{
1403
- selector: `layout-nav-tile`,
1404
- template: `<template></template>`
1405
- }]
1406
- }], ctorParameters: function () { return []; } });
1407
-
1408
- class YunzaiLayoutBasicComponent {
1409
- get options() {
1410
- return this.state.options;
1411
- }
1412
- get navType() {
1413
- return this.state.navType;
1414
- }
1415
- get aside() {
1416
- return this.state.aside;
1417
- }
1418
- get displayReusetab() {
1419
- return this.state.display.reusetab;
1420
- }
1421
- get reusetabCSS() {
1422
- let cascadingStyleSheet = {};
1423
- if (!this.state.display.nav) {
1424
- cascadingStyleSheet = Object.assign(Object.assign({}, cascadingStyleSheet), { top: '0px' });
1425
- }
1426
- if (!this.state.display.aside) {
1427
- cascadingStyleSheet = Object.assign(Object.assign({}, cascadingStyleSheet), { left: '24px' });
1428
- }
1429
- return cascadingStyleSheet;
1430
- }
1431
- constructor(layoutDisplayService, cacheService, stompService, win) {
1432
- this.layoutDisplayService = layoutDisplayService;
1433
- this.cacheService = cacheService;
1434
- this.stompService = stompService;
1435
- this.win = win;
1436
- this.NavType = NavType;
1437
- this.state = {
1438
- options: {
1439
- logoExpanded: `./assets/logo-full.svg`,
1440
- logoCollapsed: `./assets/logo.svg`
1441
- },
1442
- aside: {
1443
- name: '',
1444
- intro: '',
1445
- icon: ''
1446
- },
1447
- display: {
1448
- nav: true,
1449
- aside: true,
1450
- reusetab: true
1451
- },
1452
- navType: NavType.APPLICATION,
1453
- destroy$: new Subject()
1454
- };
1455
- }
1456
- ngOnInit() {
1457
- this.initLogo();
1458
- this.initFavicon();
1459
- this.initNavType();
1460
- this.initAside();
1461
- this.addLayoutDisplayListener();
1462
- this.stompService.listen();
1463
- this.toIndex();
1464
- }
1465
- initFavicon() {
1466
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1467
- if (projectInfo.faviconUrl) {
1468
- hasFavicon(projectInfo.faviconUrl).then((has) => {
1469
- if (has) {
1470
- setFavicon(projectInfo.faviconUrl);
1471
- }
1472
- else {
1473
- setFavicon('./assets/favicon.ico');
1474
- }
1475
- });
1476
- }
1477
- }
1478
- initAside() {
1479
- const aside = this.cacheService.get('_yz_current', { mode: 'none' });
1480
- this.state.aside = Object.assign({}, aside);
1481
- }
1482
- initLogo() {
1483
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1484
- this.state.options.logoExpanded = projectInfo.maxLogoUrl ? projectInfo.maxLogoUrl : `./assets/logo-full.svg`;
1485
- this.state.options.logoCollapsed = projectInfo.miniLogoUrl ? projectInfo.miniLogoUrl : `./assets/logo.svg`;
1486
- }
1487
- initNavType() {
1488
- var _a;
1489
- // from browser cache
1490
- const navType = this.cacheService.get('_yz_header_type', { mode: 'none' });
1491
- if (navType !== null) {
1492
- this.state.navType = navType;
1493
- return;
1494
- }
1495
- // from project info
1496
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1497
- let fetchedNavType = undefined;
1498
- if (projectInfo.headerStyle && projectInfo.headerStyle.length > 0) {
1499
- fetchedNavType = (_a = projectInfo.headerStyle.pop()) === null || _a === void 0 ? void 0 : _a.value;
1500
- }
1501
- // default value
1502
- if (!fetchedNavType) {
1503
- fetchedNavType = NavType.APPLICATION;
1504
- }
1505
- }
1506
- toIndex() {
1507
- const defaultRoute = this.cacheService.get('_yz_defaultRoute', { mode: 'none' });
1508
- log$1('YunzaiLayoutBasicComponent: ', `todo: the default route was ${defaultRoute}, 但是还没想好如何实现.`);
1509
- }
1510
- onNavTypeChange(type) {
1511
- this.cacheService.set('_yz_header_type', type);
1512
- this.win.location.reload();
1513
- }
1514
- addLayoutDisplayListener() {
1515
- this.layoutDisplayService.listen('reuseTab', (display) => {
1516
- this.state.display.reusetab = display;
1517
- });
1518
- this.layoutDisplayService.listen('nav', (display) => {
1519
- this.state.display.nav = display;
1520
- });
1521
- this.layoutDisplayService.listen('aside', (display) => {
1522
- this.state.display.aside = display;
1523
- });
1524
- }
1525
- ngOnDestroy() {
1526
- this.state.destroy$.complete();
1527
- }
1528
- }
1529
- YunzaiLayoutBasicComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutBasicComponent, deps: [{ token: i1$5.LayoutDisplayService }, { token: i1$3.CacheService }, { token: i3$3.StompService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component });
1530
- YunzaiLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: YunzaiLayoutBasicComponent, selector: "yz-layout-basic", ngImport: i0, template: `<layout-default
1531
- [options]="options"
1532
- [asideUser]="asideUserTpl"
1533
- [content]="displayReusetab ? contentTpl : noneTpl"
1534
- >
1535
- <!-- nav -->
1536
- <layout-default-header-item direction="left">
1537
- <ng-container [ngSwitch]="navType">
1538
- <ng-container *ngSwitchCase="NavType.APPLICATION">
1539
- <layout-nav-application></layout-nav-application>
1540
- </ng-container>
1541
- <ng-container *ngSwitchCase="NavType.GROUP"> <layout-nav-group></layout-nav-group></ng-container>
1542
- <ng-container *ngSwitchCase="NavType.TILE"> <layout-nav-tile></layout-nav-tile> </ng-container>
1543
- <ng-container *ngSwitchDefault> <layout-nav-application></layout-nav-application> </ng-container>
1544
- </ng-container>
1545
- </layout-default-header-item>
1546
- <!-- nav end -->
1547
- <layout-default-header-item direction="right" hidden="mobile">
1548
- <yunzai-notify></yunzai-notify>
1549
- </layout-default-header-item>
1550
- <layout-default-header-item direction="right" hidden="mobile">
1551
- <yunzai-theme-btn></yunzai-theme-btn>
1552
- </layout-default-header-item>
1553
- <!-- setting -->
1554
- <layout-default-header-item direction="right" hidden="mobile">
1555
- <div
1556
- data-event-id="_nav_settings"
1557
- layout-default-header-item-trigger
1558
- nz-dropdown
1559
- [nzDropdownMenu]="settingsMenu"
1560
- nzTrigger="click"
1561
- nzPlacement="bottomRight"
1562
- >
1563
- <i nz-icon nzType="setting"></i>
1564
- </div>
1565
- <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1566
- <div nz-menu style="width: 200px;">
1567
- <div data-event-id="_nav_mode" nz-menu-item>
1568
- {{ 'mode.nav' | i18n }}
1569
- </div>
1570
-
1571
- <div
1572
- data-event-id="_nav_mode"
1573
- data-type="application"
1574
- nz-menu-item
1575
- (click)="onNavTypeChange(NavType.APPLICATION)"
1576
- >
1577
- <i nz-icon nzType="appstore" class="mr-sm"></i>
1578
- {{ 'mode.nav.application' | i18n }}
1579
- </div>
1580
- <div data-event-id="_nav_mode" data-type="group" nz-menu-item (click)="onNavTypeChange(NavType.GROUP)">
1581
- <i nz-icon nzType="group" class="mr-sm"></i>
1582
- {{ 'mode.nav.group' | i18n }}
1583
- </div>
1584
- <div data-event-id="_nav_mode" data-type="tile" nz-menu-item (click)="onNavTypeChange(NavType.TILE)">
1585
- <i nz-icon nzType="appstore" class="mr-sm"></i>
1586
- {{ 'mode.nav.tile' | i18n }}
1587
- </div>
1588
- <div data-event-id="_nav_fullscreen" nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1589
- <div data-event-id="_nav_clearstorage" nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
1590
- <div data-event-id="_nav_i18n" nz-menu-item> <yunzai-i18n></yunzai-i18n> </div>
1591
- </div>
1592
- </nz-dropdown-menu>
1593
- </layout-default-header-item>
1594
- <layout-default-header-item direction="right">
1595
- <yunzai-user></yunzai-user>
1596
- </layout-default-header-item>
1597
- <!-- setting end -->
1598
- </layout-default>
1599
- <ng-template #asideUserTpl>
1600
- <div
1601
- data-event-id="_route_user"
1602
- nz-dropdown
1603
- nzTrigger="click"
1604
- [nzDropdownMenu]="userMenu"
1605
- class="yunzai-default__aside-user"
1606
- >
1607
- <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1608
- <div class="yunzai-default__aside-user-info">
1609
- <strong>{{ aside.name | i18n }}</strong>
1610
- <p class="mb0">{{ aside.intro | i18n }}</p>
1611
- </div>
1612
- </div>
1613
- <nz-dropdown-menu #userMenu="nzDropdownMenu">
1614
- <ul nz-menu>
1615
- <li data-event-id="_route_backhome" nz-menu-item routerLink="/">{{ 'back.home' | i18n }}</li>
1616
- </ul>
1617
- </nz-dropdown-menu>
1618
- </ng-template>
1619
- <ng-template #contentTpl>
1620
- <reuse-tab #reuseTab [ngStyle]="reusetabCSS"></reuse-tab>
1621
- <router-outlet (activate)="reuseTab.activate($event)" (attach)="reuseTab.activate($event)"></router-outlet>
1622
- </ng-template>
1623
- <ng-template #noneTpl>
1624
- <router-outlet></router-outlet>
1625
- </ng-template> `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i5$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i5$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6$1.ReuseTabComponent, selector: "reuse-tab, [reuse-tab]", inputs: ["mode", "i18n", "debug", "max", "tabMaxWidth", "excludes", "allowClose", "keepingScroll", "storageState", "keepingScrollContainer", "customContextMenu", "tabBarExtraContent", "tabBarGutter", "tabBarStyle", "tabType", "routeParamMatchMode", "disabled", "titleRender", "canClose"], outputs: ["change", "close"], exportAs: ["reuseTab"] }, { kind: "component", type: i1$5.LayoutDefaultComponent, selector: "layout-default", inputs: ["options", "asideUser", "asideBottom", "nav", "content", "customError"], exportAs: ["layoutDefault"] }, { kind: "component", type: i1$5.LayoutDefaultHeaderItemComponent, selector: "layout-default-header-item", inputs: ["hidden", "direction"] }, { kind: "directive", type: i1$5.LayoutDefaultHeaderItemTriggerDirective, selector: "[layout-default-header-item-trigger]" }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i9.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "component", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage" }, { kind: "component", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen" }, { kind: "component", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: ["showLangText"] }, { kind: "component", type: YunzaiNotifyComponent, selector: "yunzai-notify" }, { kind: "component", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: ["types", "devTips", "deployUrl"] }, { kind: "component", type: YunzaiUserComponent, selector: "yunzai-user" }, { kind: "component", type: LayoutNavApplicationComponent, selector: "layout-nav-application" }, { kind: "component", type: LayoutNavGroupComponent, selector: "layout-nav-group" }, { kind: "component", type: LayoutNavTileComponent, selector: "layout-nav-tile" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1626
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutBasicComponent, decorators: [{
1627
- type: Component,
1628
- args: [{
1629
- selector: `yz-layout-basic`,
1630
- template: `<layout-default
1631
- [options]="options"
1632
- [asideUser]="asideUserTpl"
1633
- [content]="displayReusetab ? contentTpl : noneTpl"
1634
- >
1635
- <!-- nav -->
1636
- <layout-default-header-item direction="left">
1637
- <ng-container [ngSwitch]="navType">
1638
- <ng-container *ngSwitchCase="NavType.APPLICATION">
1639
- <layout-nav-application></layout-nav-application>
1640
- </ng-container>
1641
- <ng-container *ngSwitchCase="NavType.GROUP"> <layout-nav-group></layout-nav-group></ng-container>
1642
- <ng-container *ngSwitchCase="NavType.TILE"> <layout-nav-tile></layout-nav-tile> </ng-container>
1643
- <ng-container *ngSwitchDefault> <layout-nav-application></layout-nav-application> </ng-container>
1644
- </ng-container>
1645
- </layout-default-header-item>
1646
- <!-- nav end -->
1647
- <layout-default-header-item direction="right" hidden="mobile">
1648
- <yunzai-notify></yunzai-notify>
1649
- </layout-default-header-item>
1650
- <layout-default-header-item direction="right" hidden="mobile">
1651
- <yunzai-theme-btn></yunzai-theme-btn>
1652
- </layout-default-header-item>
1653
- <!-- setting -->
1654
- <layout-default-header-item direction="right" hidden="mobile">
1655
- <div
1656
- data-event-id="_nav_settings"
1657
- layout-default-header-item-trigger
1658
- nz-dropdown
1659
- [nzDropdownMenu]="settingsMenu"
1660
- nzTrigger="click"
1661
- nzPlacement="bottomRight"
1662
- >
1663
- <i nz-icon nzType="setting"></i>
1664
- </div>
1665
- <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1666
- <div nz-menu style="width: 200px;">
1667
- <div data-event-id="_nav_mode" nz-menu-item>
1668
- {{ 'mode.nav' | i18n }}
1669
- </div>
1670
-
1671
- <div
1672
- data-event-id="_nav_mode"
1673
- data-type="application"
1674
- nz-menu-item
1675
- (click)="onNavTypeChange(NavType.APPLICATION)"
1676
- >
1677
- <i nz-icon nzType="appstore" class="mr-sm"></i>
1678
- {{ 'mode.nav.application' | i18n }}
1679
- </div>
1680
- <div data-event-id="_nav_mode" data-type="group" nz-menu-item (click)="onNavTypeChange(NavType.GROUP)">
1681
- <i nz-icon nzType="group" class="mr-sm"></i>
1682
- {{ 'mode.nav.group' | i18n }}
1683
- </div>
1684
- <div data-event-id="_nav_mode" data-type="tile" nz-menu-item (click)="onNavTypeChange(NavType.TILE)">
1685
- <i nz-icon nzType="appstore" class="mr-sm"></i>
1686
- {{ 'mode.nav.tile' | i18n }}
1687
- </div>
1688
- <div data-event-id="_nav_fullscreen" nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1689
- <div data-event-id="_nav_clearstorage" nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
1690
- <div data-event-id="_nav_i18n" nz-menu-item> <yunzai-i18n></yunzai-i18n> </div>
1691
- </div>
1692
- </nz-dropdown-menu>
1693
- </layout-default-header-item>
1694
- <layout-default-header-item direction="right">
1695
- <yunzai-user></yunzai-user>
1696
- </layout-default-header-item>
1697
- <!-- setting end -->
1698
- </layout-default>
1699
- <ng-template #asideUserTpl>
1700
- <div
1701
- data-event-id="_route_user"
1702
- nz-dropdown
1703
- nzTrigger="click"
1704
- [nzDropdownMenu]="userMenu"
1705
- class="yunzai-default__aside-user"
1706
- >
1707
- <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1708
- <div class="yunzai-default__aside-user-info">
1709
- <strong>{{ aside.name | i18n }}</strong>
1710
- <p class="mb0">{{ aside.intro | i18n }}</p>
1711
- </div>
1712
- </div>
1713
- <nz-dropdown-menu #userMenu="nzDropdownMenu">
1714
- <ul nz-menu>
1715
- <li data-event-id="_route_backhome" nz-menu-item routerLink="/">{{ 'back.home' | i18n }}</li>
1716
- </ul>
1717
- </nz-dropdown-menu>
1718
- </ng-template>
1719
- <ng-template #contentTpl>
1720
- <reuse-tab #reuseTab [ngStyle]="reusetabCSS"></reuse-tab>
1721
- <router-outlet (activate)="reuseTab.activate($event)" (attach)="reuseTab.activate($event)"></router-outlet>
1722
- </ng-template>
1723
- <ng-template #noneTpl>
1724
- <router-outlet></router-outlet>
1725
- </ng-template> `
1726
- }]
1727
- }], ctorParameters: function () {
1728
- return [{ type: i1$5.LayoutDisplayService }, { type: i1$3.CacheService }, { type: i3$3.StompService }, { type: undefined, decorators: [{
1729
- type: Inject,
1730
- args: [WINDOW]
1731
- }] }];
1732
- } });
1733
-
1734
- class ActGuard {
1735
- constructor(configService, cacheService, pathToRegexp, router) {
1736
- this.configService = configService;
1737
- this.cacheService = cacheService;
1738
- this.pathToRegexp = pathToRegexp;
1739
- this.router = router;
1740
- this.bis = BUSINESS_DEFAULT_CONFIG;
1741
- this.menus = [];
1742
- this.links = [];
1743
- log$1('act: ');
1744
- this.bis = mergeBisConfig(this.configService);
1745
- log$1('act: config ', this.bis);
1746
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
1747
- log$1('act: user ', user);
1748
- this.menus = deepCopy(user.menu).filter((m) => m.systemCode && m.systemCode === this.bis.systemCode);
1749
- log$1('act: menus ', this.menus);
1750
- this.getAllLinks(this.menus, this.links);
1751
- log$1('act: links ', this.links);
1752
- }
1753
- canActivate(_, state) {
1754
- log$1('act: can activate ', state);
1755
- if (this.preHandle(state)) {
1756
- return true;
1757
- }
1758
- log$1('act: can activate child prehandle success');
1759
- let canactivate = false;
1760
- this.links.forEach((link) => {
1761
- const regexp = this.pathToRegexp.stringToRegexp(link, null, null);
1762
- log$1(`act: ${link} test ${state.url.split('?')[0]}`);
1763
- if (regexp.test(state.url.split('?')[0])) {
1764
- canactivate = true;
1765
- log$1(`act: test value ${canactivate}`);
1766
- return;
1767
- }
1768
- });
1769
- if (canactivate) {
1770
- log$1(`act: test sucess`);
1771
- return true;
1772
- }
1773
- else {
1774
- log$1(`act: test error`);
1775
- this.router.navigate(['displayIndex']);
1776
- return false;
1777
- }
1778
- }
1779
- canActivateChild(_, state) {
1780
- log$1('act: can activate child ', state);
1781
- if (this.preHandle(state)) {
1782
- return true;
1783
- }
1784
- log$1('act: can activate child prehandle success');
1785
- let canactivate = false;
1786
- this.links.forEach((link) => {
1787
- const regexp = this.pathToRegexp.stringToRegexp(link, null, null);
1788
- if (regexp.test(state.url.split('?')[0])) {
1789
- log$1(`act: ${link} test ${state.url.split('?')[0]}`);
1790
- canactivate = true;
1791
- log$1(`act: test value ${canactivate}`);
1792
- return;
1793
- }
1794
- });
1795
- if (canactivate) {
1796
- log$1(`act: test sucess`);
1797
- return true;
1798
- }
1799
- else {
1800
- log$1(`act: test error`);
1801
- this.router.navigate(['displayIndex']);
1802
- return false;
1803
- }
1804
- }
1805
- preHandle(state) {
1806
- return (state.url.includes('error') ||
1807
- state.url.includes('exception') ||
1808
- state.url.includes('displayIndex') ||
1809
- state.url === '' ||
1810
- state.url === null ||
1811
- state.url === '/' ||
1812
- state.url.includes('iframePage'));
1813
- }
1814
- getAllLinks(menu, links) {
1815
- menu.forEach((sider) => {
1816
- if (sider.link) {
1817
- links.push(sider.link);
1818
- }
1819
- if (sider.children && sider.children.length > 0) {
1820
- this.getAllLinks(sider.children, links);
1821
- }
1822
- });
1823
- }
1824
- }
1825
- ActGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActGuard, deps: [{ token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }, { token: i1$4.PathToRegexpService }, { token: i5$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1826
- ActGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActGuard, providedIn: 'root' });
1827
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ActGuard, decorators: [{
1828
- type: Injectable,
1829
- args: [{
1830
- providedIn: 'root'
1831
- }]
1832
- }], ctorParameters: function () { return [{ type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }, { type: i1$4.PathToRegexpService }, { type: i5$1.Router }]; } });
1833
-
1834
- class YunzaiAuthService {
1835
- constructor(injector) {
1836
- this.injector = injector;
1837
- this.config = mergeBisConfig(this.configService);
1838
- }
1839
- get configService() {
1840
- return this.injector.get(YunzaiConfigService);
1841
- }
1842
- get tokenService() {
1843
- return this.injector.get(YA_SERVICE_TOKEN);
1844
- }
1845
- get httpClient() {
1846
- return this.injector.get(_HttpClient);
1847
- }
1848
- get cacheService() {
1849
- return this.injector.get(CacheService);
1850
- }
1851
- askToken() {
1852
- log$1('yz.auth.service: ', 'askToken');
1853
- if (this.config.loginForm) {
1854
- return this.fetchTokenByUP();
1855
- }
1856
- else {
1857
- return this.fetchTokenByCas();
1858
- }
1859
- }
1860
- fetchTokenByUP() {
1861
- log$1('yz.auth.service: ', 'fetchTokenByUP');
1862
- return this.httpClient.post(`/auth/oauth/token?_allow_anonymous=true`, this.config.loginForm).pipe(map$1((response) => {
1863
- const { access_token, expires_in, refresh_token, scope, token_type } = response;
1864
- return {
1865
- token: access_token,
1866
- expired: expires_in,
1867
- refreshToken: refresh_token,
1868
- tokenType: token_type,
1869
- scope
1870
- };
1871
- }));
1872
- }
1873
- fetchTokenByCas() {
1874
- log$1('yz.auth.service: ', 'fetchTokenByCas');
1875
- const uri = encodeURIComponent(this.injector.get(WINDOW).location.href);
1876
- return this.httpClient
1877
- .get(`/cas-proxy/app/validate_full?callback=${uri}&_allow_anonymous=true&timestamp=${new Date().getTime()}`)
1878
- .pipe(map$1((response) => {
1879
- var _a;
1880
- switch (response.errcode) {
1881
- case 2000:
1882
- const { access_token, expires_in, refresh_token, scope, token_type } = response.data;
1883
- // 如果token不一致,清除缓存
1884
- const token = (_a = this.tokenService.get()) === null || _a === void 0 ? void 0 : _a.token;
1885
- if (token && access_token && token !== access_token) {
1886
- this.cacheService.clear();
1887
- }
1888
- return {
1889
- token: access_token,
1890
- expired: expires_in,
1891
- refreshToken: refresh_token,
1892
- tokenType: token_type,
1893
- scope
1894
- };
1895
- case 2001:
1896
- this.injector.get(WINDOW).location.href = response.msg;
1897
- throw Error("Cookie Error: Can't find Cas Cookie,So jump to login!");
1898
- default:
1899
- if (response.data) {
1900
- console.error(response.data);
1901
- throw Error(response.data);
1902
- }
1903
- else if (response.msg) {
1904
- console.error(response.msg);
1905
- throw Error(response.msg);
1906
- }
1907
- else {
1908
- console.error('cas unknown error');
1909
- throw Error('Unknown Error: Cas auth exception!');
1910
- }
1911
- }
1912
- }));
1913
- }
1914
- login() {
1915
- log$1('yz.auth.service: ', 'login white login form->', this.config.loginForm);
1916
- return this.askToken().pipe(mergeMap(token => {
1917
- log$1('yz.auth.service: get token->', token);
1918
- this.configService.set('auth', {
1919
- token_send_key: 'Authorization',
1920
- token_send_template: `${token.tokenType} \${token}`,
1921
- token_send_place: 'header'
1922
- });
1923
- log$1('yz.auth.service: ', 'set token');
1924
- this.tokenService.set(token);
1925
- return this.cacheInit();
1926
- }), mergeAll());
1927
- }
1928
- cacheInit() {
1929
- log$1('yz.auth.service: ', 'cacheInit');
1930
- const tenant = this.cacheService.get('_yz_tenant', { mode: 'none' });
1931
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
1932
- const header = this.cacheService.get('_yz_header', { mode: 'none' });
1933
- const project = this.cacheService.get('_yz_project_info', { mode: 'none' });
1934
- return forkJoin(of(user), of(header), of(project)).pipe(mergeMap(([u, h, p]) => {
1935
- let list = [];
1936
- // user cache
1937
- if (!u || !tenant) {
1938
- log$1('yz.auth.service: ', 'fetch user cache');
1939
- list.push(this.httpClient.get(`/auth/user`).pipe(map$1((user) => {
1940
- this.cacheService.set('_yz_tenant', user.tenantId);
1941
- this.cacheService.set('_yz_user', user.principal);
1942
- })));
1943
- }
1944
- else {
1945
- log$1('yz.auth.service: ', 'user recache');
1946
- list.push(of(() => { }));
1947
- }
1948
- // header cache
1949
- if (!h) {
1950
- log$1('yz.auth.service: ', 'fetch header cache');
1951
- list.push(this.httpClient.get(`/auth/allheader/v2`).pipe(map$1((header) => {
1952
- this.cacheService.set('_yz_header', header.data);
1953
- })));
1954
- }
1955
- else {
1956
- log$1('yz.auth.service: ', 'header recache');
1957
- list.push(of(() => { }));
1958
- }
1959
- // project cache
1960
- if (!p) {
1961
- log$1('yz.auth.service: ', 'fetch project cache');
1962
- list.push(this.httpClient.get(`/app-manager/project/info`).pipe(map$1((info) => {
1963
- this.cacheService.set('_yz_project_info', info.data);
1964
- })));
1965
- }
1966
- else {
1967
- log$1('yz.auth.service: ', 'project recache');
1968
- list.push(of(() => { }));
1969
- }
1970
- return forkJoin(list);
1971
- }));
1972
- }
1973
- }
1974
- YunzaiAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiAuthService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1975
- YunzaiAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiAuthService, providedIn: 'root' });
1976
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiAuthService, decorators: [{
1977
- type: Injectable,
1978
- args: [{ providedIn: 'root' }]
1979
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
1980
-
1981
- const CODEMESSAGE = {
1982
- 200: '服务器成功返回请求的数据。',
1983
- 201: '新建或修改数据成功。',
1984
- 202: '一个请求已经进入后台排队(异步任务)。',
1985
- 204: '删除数据成功。',
1986
- 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
1987
- 401: '用户没有权限(令牌、用户名、密码错误)。',
1988
- 403: '用户得到授权,但是访问是被禁止的。',
1989
- 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
1990
- 406: '请求的格式不可得。',
1991
- 410: '请求的资源被永久删除,且不会再得到的。',
1992
- 422: '当创建一个对象时,发生一个验证错误。',
1993
- 500: '服务器发生错误,请检查服务器。',
1994
- 502: '网关错误。',
1995
- 503: '服务不可用,服务器暂时过载或维护。',
1996
- 504: '网关超时。'
1997
- };
1998
- class YunzaiDefaultInterceptor {
1999
- get notification() {
2000
- return this.injector.get(NzNotificationService);
2001
- }
2002
- get tokenSrv() {
2003
- return this.injector.get(YA_SERVICE_TOKEN);
2004
- }
2005
- get http() {
2006
- return this.injector.get(_HttpClient);
2007
- }
2008
- get config() {
2009
- return mergeBisConfig(this.injector.get(YunzaiConfigService$1));
2010
- }
2011
- goTo(url) {
2012
- setTimeout(() => this.injector.get(Router).navigateByUrl(url));
2013
- }
2014
- constructor(injector) {
2015
- this.injector = injector;
2016
- this.jump = false;
2017
- this.refreshToking = false;
2018
- this.refreshToken$ = new BehaviorSubject(null);
2019
- if (this.config.refreshTokenType === 'auth-refresh') {
2020
- console.error("can't use auth-refresh, please change yz.default.interceptor to default.interceptor!");
2021
- }
2022
- }
2023
- checkStatus(ev) {
2024
- if ((ev.status >= 200 && ev.status < 300) || ev.status === 401) {
2025
- return;
2026
- }
2027
- if (ev instanceof HttpErrorResponse && (ev.error.message || ev.error.errorMessage)) {
2028
- if (ev.error.errorMessage) {
2029
- this.notification.error(`发生了一些错误 `, ev.error.errorMessage);
2030
- }
2031
- else {
2032
- this.notification.error(`发生了一些错误 `, ev.error.message);
2033
- }
2034
- return;
2035
- }
2036
- if (ev instanceof HttpResponse && ev.body.errorMessage) {
2037
- this.notification.error(`发生了一些错误 `, ev.body.errorMessage);
2038
- return;
2039
- }
2040
- const errortext = CODEMESSAGE[ev.status] || ev.statusText;
2041
- this.notification.error(`请求错误 ${ev.status}: ${ev.url}`, errortext);
2042
- }
2043
- ToLogin() {
2044
- this.notification.error(`未登录或登录状态已过期,5秒后将跳转到登录页面。`, ``);
2045
- setTimeout(() => {
2046
- localStorage.clear();
2047
- this.injector.get(WINDOW).location.href = `${this.config.baseUrl}/cas-proxy/app/logout`;
2048
- }, 5000);
2049
- }
2050
- reAttachToken(req) {
2051
- var _a;
2052
- const token = (_a = this.tokenSrv.get()) === null || _a === void 0 ? void 0 : _a.token;
2053
- return req.clone({
2054
- setHeaders: {
2055
- Authorization: `Bearer ${token}`
2056
- }
2057
- });
2058
- }
2059
- refreshTokenRequest() {
2060
- const model = this.tokenSrv.get();
2061
- const form = new FormData();
2062
- form.set('refresh_token', model === null || model === void 0 ? void 0 : model.refreshToken);
2063
- form.set('grant_type', 'refresh_token');
2064
- form.set('scope', 'webapp');
2065
- log('yz.default.interceptor: use the refresh token to request a new token', model === null || model === void 0 ? void 0 : model.refreshToken);
2066
- // return this.http.post(`/auth/user/token/refresh?_allow_anonymous=true`, form);
2067
- return this.http.post(`/auth/oauth/getOrCreateToken/webapp`, form);
2068
- }
2069
- tryRefreshToken(ev, req, next) {
2070
- // 连刷新Token的请求都错了,那就是真错了
2071
- if (['/auth/oauth/getOrCreateToken/webapp'].some(url => req.url.includes(url))) {
2072
- this.ToLogin();
2073
- return throwError(() => ev);
2074
- }
2075
- // 正在刷新token,所有其他请求排队
2076
- if (this.refreshToking) {
2077
- return this.refreshToken$.pipe(filter(v => !!v), take(1), switchMap(() => next.handle(this.reAttachToken(req))));
2078
- }
2079
- //尝试调用刷新 Token
2080
- this.refreshToking = true;
2081
- this.refreshToken$.next(null);
2082
- // 处理Token
2083
- return this.refreshTokenRequest().pipe(switchMap(res => {
2084
- log('yz.default.interceptor: refresh token accessed -> ', res);
2085
- // 重新保存新 token
2086
- const { access_token, expires_in, refresh_token, scope, token_type } = res;
2087
- this.tokenSrv.set({
2088
- token: access_token,
2089
- expired: expires_in,
2090
- refreshToken: refresh_token,
2091
- tokenType: token_type,
2092
- scope
2093
- });
2094
- // 通知后续请求继续执行
2095
- this.refreshToking = false;
2096
- this.refreshToken$.next(res);
2097
- // 重新发起请求
2098
- return next.handle(this.reAttachToken(req));
2099
- }), catchError(err => {
2100
- this.refreshToking = false;
2101
- this.ToLogin();
2102
- return throwError(() => err);
2103
- }));
2104
- }
2105
- getAdditionalHeaders(headers) {
2106
- const res = {};
2107
- const lang = this.injector.get(YUNZAI_I18N_TOKEN).currentLang;
2108
- if (!(headers === null || headers === void 0 ? void 0 : headers.has('Accept-Language')) && lang) {
2109
- res['Accept-Language'] = lang;
2110
- }
2111
- return res;
2112
- }
2113
- handleData(ev, req, next) {
2114
- this.checkStatus(ev);
2115
- switch (ev.status) {
2116
- case 200:
2117
- return of(ev);
2118
- case 401:
2119
- if (this.config.refreshTokenEnabled && this.config.refreshTokenType === 're-request') {
2120
- const unAuthorizationReq = req.clone();
2121
- unAuthorizationReq.headers.delete('Authorization');
2122
- return this.tryRefreshToken(ev, unAuthorizationReq, next);
2123
- }
2124
- this.ToLogin();
2125
- break;
2126
- case 403:
2127
- case 404:
2128
- case 500:
2129
- if (this.jump) {
2130
- this.goTo(`/exception/${ev.status}`);
2131
- }
2132
- break;
2133
- default:
2134
- if (ev instanceof HttpErrorResponse) {
2135
- console.warn('未可知错误,大部分是由于后端不支持跨域CORS或无效配置引起,请参考 https://ng.yunzainfo.com/docs/server 解决跨域问题', ev);
2136
- }
2137
- break;
2138
- }
2139
- if (ev instanceof HttpErrorResponse) {
2140
- return throwError(() => ev);
2141
- }
2142
- else {
2143
- return of(ev);
2144
- }
2145
- }
2146
- intercept(req, next) {
2147
- if (req.context.get(ALLOW_ANONYMOUS))
2148
- return next.handle(req);
2149
- log('yz.default.interceptor.ts: ', 'request ', req);
2150
- // 统一加前缀
2151
- let url = req.url;
2152
- if (!url.startsWith('https://') && !url.startsWith('http://')) {
2153
- url = this.config.baseUrl + url;
2154
- }
2155
- if (url.includes('.json') && url.includes('assets')) {
2156
- url = req.url;
2157
- }
2158
- if (url.includes('i18n'))
2159
- return next.handle(req);
2160
- // 加入语言头
2161
- const newReq = req.clone({ url, setHeaders: this.getAdditionalHeaders(req.headers) });
2162
- return next.handle(newReq).pipe(mergeMap(ev => {
2163
- // 允许统一对请求错误处理
2164
- if (ev instanceof HttpResponseBase) {
2165
- return this.handleData(ev, newReq, next);
2166
- }
2167
- // 若一切都正常,则后续操作
2168
- return of(ev);
2169
- }), catchError((err) => this.handleData(err, newReq, next)));
2170
- }
2171
- }
2172
- YunzaiDefaultInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiDefaultInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2173
- YunzaiDefaultInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiDefaultInterceptor });
2174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiDefaultInterceptor, decorators: [{
2175
- type: Injectable
2176
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2177
-
2178
- const WIDGETS = [
2179
- YunzaiClearStorageComponent,
2180
- YunzaiFullScreenComponent,
2181
- YunzaiI18NComponent,
2182
- YunzaiNotifyComponent,
2183
- YunzaiThemBtnComponent,
2184
- YunzaiUserComponent
2185
- ];
2186
- const LAYOUT_NAV_COMPONENTS = [LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent];
2187
- const COMPONENTS = [YunzaiLayoutBasicComponent];
2188
- class YunzaiLayoutModule {
2189
- }
2190
- YunzaiLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2191
- YunzaiLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutModule, declarations: [YunzaiLayoutBasicComponent, YunzaiClearStorageComponent,
2192
- YunzaiFullScreenComponent,
2193
- YunzaiI18NComponent,
2194
- YunzaiNotifyComponent,
2195
- YunzaiThemBtnComponent,
2196
- YunzaiUserComponent, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent], imports: [HttpClientModule,
2197
- CommonModule,
2198
- FormsModule,
2199
- RouterModule,
2200
- ReactiveFormsModule,
2201
- YunzaiSharedYelonModule,
2202
- YunzaiSharedZorroModule], exports: [YunzaiLayoutBasicComponent, YunzaiClearStorageComponent,
2203
- YunzaiFullScreenComponent,
2204
- YunzaiI18NComponent,
2205
- YunzaiNotifyComponent,
2206
- YunzaiThemBtnComponent,
2207
- YunzaiUserComponent, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent] });
2208
- YunzaiLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutModule, providers: [
2209
- {
2210
- provide: YUNZAI_THEME_BTN_KEYS,
2211
- useValue: 'site-theme'
2212
- }
2213
- ], imports: [HttpClientModule,
2214
- CommonModule,
2215
- FormsModule,
2216
- RouterModule,
2217
- ReactiveFormsModule,
2218
- YunzaiSharedYelonModule,
2219
- YunzaiSharedZorroModule] });
2220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiLayoutModule, decorators: [{
2221
- type: NgModule,
2222
- args: [{
2223
- imports: [
2224
- HttpClientModule,
2225
- CommonModule,
2226
- FormsModule,
2227
- RouterModule,
2228
- ReactiveFormsModule,
2229
- YunzaiSharedYelonModule,
2230
- YunzaiSharedZorroModule
2231
- ],
2232
- providers: [
2233
- {
2234
- provide: YUNZAI_THEME_BTN_KEYS,
2235
- useValue: 'site-theme'
2236
- }
2237
- ],
2238
- declarations: [...COMPONENTS, ...WIDGETS, ...LAYOUT_NAV_COMPONENTS],
2239
- exports: [...COMPONENTS, ...WIDGETS, ...LAYOUT_NAV_COMPONENTS]
2240
- }]
2241
- }] });
2242
-
2243
- /*
2244
- * Automatically generated by 'ng g ng-yunzai:plugin icon'
2245
- * @see https://ng.yunzainfo.com/cli/plugin#icon
2246
- */
2247
- const ICONS = [
2248
- AccountBookTwoTone,
2249
- AccountBookFill,
2250
- AccountBookOutline,
2251
- AlertTwoTone,
2252
- AlertFill,
2253
- AlibabaOutline,
2254
- AimOutline,
2255
- AlipayCircleFill,
2256
- AlertOutline,
2257
- AlignCenterOutline,
2258
- AlipayCircleOutline,
2259
- AlipayOutline,
2260
- AlignLeftOutline,
2261
- AlignRightOutline,
2262
- AmazonOutline,
2263
- AliwangwangOutline,
2264
- AliyunOutline,
2265
- AlipaySquareFill,
2266
- AmazonCircleFill,
2267
- AndroidFill,
2268
- AliwangwangFill,
2269
- AntCloudOutline,
2270
- AmazonSquareFill,
2271
- AndroidOutline,
2272
- ApartmentOutline,
2273
- ApiTwoTone,
2274
- ApiFill,
2275
- ApiOutline,
2276
- AntDesignOutline,
2277
- AppstoreAddOutline,
2278
- AppstoreFill,
2279
- AppleOutline,
2280
- AppstoreOutline,
2281
- ArrowDownOutline,
2282
- AppleFill,
2283
- ArrowsAltOutline,
2284
- AppstoreTwoTone,
2285
- ArrowUpOutline,
2286
- AreaChartOutline,
2287
- ArrowLeftOutline,
2288
- AudioFill,
2289
- ArrowRightOutline,
2290
- AudioTwoTone,
2291
- AuditOutline,
2292
- AudioMutedOutline,
2293
- BackwardFill,
2294
- AudioOutline,
2295
- BackwardOutline,
2296
- BankFill,
2297
- BarcodeOutline,
2298
- BellFill,
2299
- BankTwoTone,
2300
- BarsOutline,
2301
- BankOutline,
2302
- BehanceCircleFill,
2303
- BehanceSquareFill,
2304
- BoldOutline,
2305
- BellOutline,
2306
- BehanceOutline,
2307
- BlockOutline,
2308
- BehanceSquareOutline,
2309
- BgColorsOutline,
2310
- BellTwoTone,
2311
- BarChartOutline,
2312
- BookTwoTone,
2313
- BookFill,
2314
- BorderOuterOutline,
2315
- BorderLeftOutline,
2316
- BorderBottomOutline,
2317
- BorderHorizontalOutline,
2318
- BorderTopOutline,
2319
- BorderOutline,
2320
- BorderInnerOutline,
2321
- BorderRightOutline,
2322
- BoxPlotOutline,
2323
- BoxPlotFill,
2324
- BoxPlotTwoTone,
2325
- BookOutline,
2326
- BorderlessTableOutline,
2327
- BorderVerticleOutline,
2328
- BuildTwoTone,
2329
- BuildOutline,
2330
- BugFill,
2331
- BugOutline,
2332
- BugTwoTone,
2333
- BulbFill,
2334
- BulbTwoTone,
2335
- BuildFill,
2336
- BulbOutline,
2337
- CalculatorFill,
2338
- CalculatorTwoTone,
2339
- CalendarFill,
2340
- CalendarOutline,
2341
- CalculatorOutline,
2342
- CalendarTwoTone,
2343
- CameraOutline,
2344
- CameraFill,
2345
- CameraTwoTone,
2346
- CarTwoTone,
2347
- CaretDownOutline,
2348
- CarOutline,
2349
- CaretLeftFill,
2350
- CarFill,
2351
- CaretRightOutline,
2352
- CaretDownFill,
2353
- CaretUpOutline,
2354
- CaretRightFill,
2355
- CarryOutFill,
2356
- CarryOutOutline,
2357
- CaretLeftOutline,
2358
- CaretUpFill,
2359
- BranchesOutline,
2360
- CarryOutTwoTone,
2361
- CheckCircleFill,
2362
- CheckCircleOutline,
2363
- CheckSquareOutline,
2364
- CheckCircleTwoTone,
2365
- CiCircleTwoTone,
2366
- CheckOutline,
2367
- CheckSquareTwoTone,
2368
- CiOutline,
2369
- CheckSquareFill,
2370
- CiTwoTone,
2371
- ChromeOutline,
2372
- ClockCircleOutline,
2373
- CiCircleOutline,
2374
- ChromeFill,
2375
- ClearOutline,
2376
- CloseCircleTwoTone,
2377
- CiCircleFill,
2378
- CloseCircleOutline,
2379
- ClockCircleFill,
2380
- CloseCircleFill,
2381
- ClockCircleTwoTone,
2382
- CloseOutline,
2383
- CloseSquareOutline,
2384
- CloseSquareFill,
2385
- CloudFill,
2386
- CloseSquareTwoTone,
2387
- CloudDownloadOutline,
2388
- CloudTwoTone,
2389
- CloudServerOutline,
2390
- CloudUploadOutline,
2391
- CloudSyncOutline,
2392
- ClusterOutline,
2393
- CodeSandboxCircleFill,
2394
- CodeFill,
2395
- CodepenCircleOutline,
2396
- CloudOutline,
2397
- CodeSandboxOutline,
2398
- CodeOutline,
2399
- CodeSandboxSquareFill,
2400
- CodeTwoTone,
2401
- CodepenSquareFill,
2402
- CodepenOutline,
2403
- CoffeeOutline,
2404
- ColumnWidthOutline,
2405
- CompressOutline,
2406
- ColumnHeightOutline,
2407
- CodepenCircleFill,
2408
- CompassTwoTone,
2409
- CommentOutline,
2410
- ContainerFill,
2411
- CompassOutline,
2412
- ConsoleSqlOutline,
2413
- ContactsOutline,
2414
- ContainerTwoTone,
2415
- ContactsFill,
2416
- ContactsTwoTone,
2417
- ContainerOutline,
2418
- ControlFill,
2419
- CopyFill,
2420
- CopyOutline,
2421
- CompassFill,
2422
- CopyTwoTone,
2423
- CopyrightOutline,
2424
- CopyrightCircleOutline,
2425
- ControlTwoTone,
2426
- ControlOutline,
2427
- CreditCardFill,
2428
- CopyrightTwoTone,
2429
- CrownFill,
2430
- CopyrightCircleFill,
2431
- CrownOutline,
2432
- CustomerServiceTwoTone,
2433
- CreditCardOutline,
2434
- CustomerServiceOutline,
2435
- DashboardTwoTone,
2436
- CrownTwoTone,
2437
- CreditCardTwoTone,
2438
- CustomerServiceFill,
2439
- DashboardFill,
2440
- DashOutline,
2441
- DatabaseOutline,
2442
- DatabaseTwoTone,
2443
- DatabaseFill,
2444
- DashboardOutline,
2445
- DeleteTwoTone,
2446
- DeleteRowOutline,
2447
- DeleteColumnOutline,
2448
- DeliveredProcedureOutline,
2449
- DeleteOutline,
2450
- CopyrightCircleTwoTone,
2451
- DesktopOutline,
2452
- DeleteFill,
2453
- DiffOutline,
2454
- DiffFill,
2455
- DeploymentUnitOutline,
2456
- DiffTwoTone,
2457
- DingtalkOutline,
2458
- DollarCircleFill,
2459
- DislikeFill,
2460
- DingtalkSquareFill,
2461
- DisconnectOutline,
2462
- DollarCircleTwoTone,
2463
- DollarOutline,
2464
- DingtalkCircleFill,
2465
- DislikeTwoTone,
2466
- DollarTwoTone,
2467
- DownCircleFill,
2468
- DislikeOutline,
2469
- DollarCircleOutline,
2470
- DoubleLeftOutline,
2471
- DownSquareFill,
2472
- DownOutline,
2473
- DownSquareOutline,
2474
- DownSquareTwoTone,
2475
- DownCircleTwoTone,
2476
- DoubleRightOutline,
2477
- DownCircleOutline,
2478
- DownloadOutline,
2479
- DotChartOutline,
2480
- DribbbleCircleFill,
2481
- DribbbleOutline,
2482
- DribbbleSquareOutline,
2483
- DropboxCircleFill,
2484
- DingdingOutline,
2485
- EditOutline,
2486
- DribbbleSquareFill,
2487
- DropboxSquareFill,
2488
- EllipsisOutline,
2489
- EnvironmentFill,
2490
- EditFill,
2491
- EnterOutline,
2492
- EuroCircleFill,
2493
- EuroTwoTone,
2494
- EuroCircleOutline,
2495
- EditTwoTone,
2496
- EuroOutline,
2497
- EnvironmentTwoTone,
2498
- ExclamationCircleFill,
2499
- ExpandAltOutline,
2500
- EuroCircleTwoTone,
2501
- ExclamationCircleTwoTone,
2502
- EnvironmentOutline,
2503
- ExperimentOutline,
2504
- ExperimentFill,
2505
- ExpandOutline,
2506
- ExceptionOutline,
2507
- ExportOutline,
2508
- ExperimentTwoTone,
2509
- ExclamationCircleOutline,
2510
- ExclamationOutline,
2511
- EyeFill,
2512
- EyeInvisibleFill,
2513
- EyeInvisibleTwoTone,
2514
- DropboxOutline,
2515
- DragOutline,
2516
- FacebookOutline,
2517
- FacebookFill,
2518
- EyeTwoTone,
2519
- EyeOutline,
2520
- FastForwardFill,
2521
- FieldBinaryOutline,
2522
- FieldNumberOutline,
2523
- FastBackwardOutline,
2524
- FileAddFill,
2525
- FastBackwardFill,
2526
- FileExcelFill,
2527
- FastForwardOutline,
2528
- FieldStringOutline,
2529
- FileDoneOutline,
2530
- FileAddTwoTone,
2531
- FileExcelTwoTone,
2532
- FileExclamationFill,
2533
- FileAddOutline,
2534
- FileExclamationOutline,
2535
- FieldTimeOutline,
2536
- FileImageTwoTone,
2537
- FileExcelOutline,
2538
- FileExclamationTwoTone,
2539
- FileImageFill,
2540
- FileGifOutline,
2541
- FileFill,
2542
- FileMarkdownTwoTone,
2543
- FileMarkdownOutline,
2544
- FallOutline,
2545
- FileImageOutline,
2546
- EyeInvisibleOutline,
2547
- FilePdfOutline,
2548
- FileSearchOutline,
2549
- FilePptTwoTone,
2550
- FilePdfTwoTone,
2551
- FileJpgOutline,
2552
- FileTextFill,
2553
- FilePptOutline,
2554
- FileSyncOutline,
2555
- FilePptFill,
2556
- FileUnknownOutline,
2557
- FileProtectOutline,
2558
- FileTextTwoTone,
2559
- FileWordFill,
2560
- FileUnknownTwoTone,
2561
- FileWordTwoTone,
2562
- FileUnknownFill,
2563
- FileTextOutline,
2564
- FileZipFill,
2565
- FilterTwoTone,
2566
- FilterFill,
2567
- FileWordOutline,
2568
- FireOutline,
2569
- FireTwoTone,
2570
- FileZipOutline,
2571
- FilterOutline,
2572
- FlagTwoTone,
2573
- FileTwoTone,
2574
- FilePdfFill,
2575
- FileOutline,
2576
- FileMarkdownFill,
2577
- FileZipTwoTone,
2578
- FlagOutline,
2579
- FolderAddTwoTone,
2580
- FolderOpenFill,
2581
- FireFill,
2582
- FlagFill,
2583
- FolderOutline,
2584
- FolderViewOutline,
2585
- FolderTwoTone,
2586
- FontColorsOutline,
2587
- FolderOpenTwoTone,
2588
- FolderFill,
2589
- ForwardOutline,
2590
- FolderOpenOutline,
2591
- ForkOutline,
2592
- ForwardFill,
2593
- FormatPainterOutline,
2594
- FormatPainterFill,
2595
- FormOutline,
2596
- FrownFill,
2597
- FrownTwoTone,
2598
- FullscreenOutline,
2599
- FontSizeOutline,
2600
- FundFill,
2601
- FunctionOutline,
2602
- FundViewOutline,
2603
- FullscreenExitOutline,
2604
- GifOutline,
2605
- FundProjectionScreenOutline,
2606
- FundTwoTone,
2607
- FolderAddFill,
2608
- FunnelPlotTwoTone,
2609
- GiftOutline,
2610
- FunnelPlotFill,
2611
- FundOutline,
2612
- FrownOutline,
2613
- GithubOutline,
2614
- GoldFill,
2615
- FolderAddOutline,
2616
- GitlabFill,
2617
- GiftFill,
2618
- GitlabOutline,
2619
- GoldTwoTone,
2620
- GoogleCircleFill,
2621
- GiftTwoTone,
2622
- GooglePlusCircleFill,
2623
- GoldOutline,
2624
- GithubFill,
2625
- GoogleOutline,
2626
- GooglePlusOutline,
2627
- GoogleSquareFill,
2628
- GoldenFill,
2629
- HddTwoTone,
2630
- GooglePlusSquareFill,
2631
- GlobalOutline,
2632
- HeartOutline,
2633
- HeartTwoTone,
2634
- GroupOutline,
2635
- HeartFill,
2636
- HeatMapOutline,
2637
- GatewayOutline,
2638
- FunnelPlotOutline,
2639
- HddFill,
2640
- HomeFill,
2641
- HighlightFill,
2642
- HomeOutline,
2643
- HistoryOutline,
2644
- HighlightOutline,
2645
- HddOutline,
2646
- HourglassFill,
2647
- HomeTwoTone,
2648
- HourglassTwoTone,
2649
- Html5Outline,
2650
- Html5Fill,
2651
- IdcardFill,
2652
- Html5TwoTone,
2653
- HourglassOutline,
2654
- IdcardTwoTone,
2655
- IdcardOutline,
2656
- IeOutline,
2657
- IeCircleFill,
2658
- IeSquareFill,
2659
- InboxOutline,
2660
- ImportOutline,
2661
- InfoCircleOutline,
2662
- InfoCircleTwoTone,
2663
- InsertRowAboveOutline,
2664
- InsertRowRightOutline,
2665
- InfoCircleFill,
2666
- InfoOutline,
2667
- InsertRowBelowOutline,
2668
- HighlightTwoTone,
2669
- InsuranceFill,
2670
- InstagramFill,
2671
- InteractionFill,
2672
- InsertRowLeftOutline,
2673
- InstagramOutline,
2674
- InteractionOutline,
2675
- ItalicOutline,
2676
- InteractionTwoTone,
2677
- LayoutOutline,
2678
- IssuesCloseOutline,
2679
- LayoutFill,
2680
- LaptopOutline,
2681
- LeftCircleFill,
2682
- LayoutTwoTone,
2683
- KeyOutline,
2684
- LeftOutline,
2685
- LeftCircleOutline,
2686
- LeftSquareOutline,
2687
- LeftSquareFill,
2688
- LeftCircleTwoTone,
2689
- LikeFill,
2690
- LeftSquareTwoTone,
2691
- LineOutline,
2692
- LikeTwoTone,
2693
- LinkedinOutline,
2694
- LineChartOutline,
2695
- LineHeightOutline,
2696
- LinkedinFill,
2697
- LinkOutline,
2698
- LikeOutline,
2699
- InsuranceOutline,
2700
- Loading3QuartersOutline,
2701
- LockFill,
2702
- InsuranceTwoTone,
2703
- MacCommandOutline,
2704
- LockTwoTone,
2705
- LoadingOutline,
2706
- MailOutline,
2707
- LoginOutline,
2708
- MedicineBoxOutline,
2709
- MailFill,
2710
- MailTwoTone,
2711
- MacCommandFill,
2712
- ManOutline,
2713
- MedicineBoxFill,
2714
- MedicineBoxTwoTone,
2715
- MediumCircleFill,
2716
- MediumOutline,
2717
- MehFill,
2718
- MediumWorkmarkOutline,
2719
- MenuFoldOutline,
2720
- MehOutline,
2721
- MediumSquareFill,
2722
- MessageTwoTone,
2723
- MehTwoTone,
2724
- MergeCellsOutline,
2725
- MinusCircleFill,
2726
- MenuOutline,
2727
- MenuUnfoldOutline,
2728
- MessageFill,
2729
- MinusCircleTwoTone,
2730
- LockOutline,
2731
- MinusOutline,
2732
- MinusCircleOutline,
2733
- LogoutOutline,
2734
- MessageOutline,
2735
- MoneyCollectFill,
2736
- MinusSquareOutline,
2737
- MinusSquareTwoTone,
2738
- MobileOutline,
2739
- MobileTwoTone,
2740
- MoneyCollectOutline,
2741
- MoreOutline,
2742
- NotificationFill,
2743
- NotificationOutline,
2744
- MoneyCollectTwoTone,
2745
- NodeIndexOutline,
2746
- NodeExpandOutline,
2747
- MonitorOutline,
2748
- OrderedListOutline,
2749
- NodeCollapseOutline,
2750
- NumberOutline,
2751
- PaperClipOutline,
2752
- NotificationTwoTone,
2753
- PauseCircleFill,
2754
- PartitionOutline,
2755
- PauseOutline,
2756
- OneToOneOutline,
2757
- PayCircleOutline,
2758
- PayCircleFill,
2759
- MinusSquareFill,
2760
- PauseCircleOutline,
2761
- PauseCircleTwoTone,
2762
- PicCenterOutline,
2763
- PicRightOutline,
2764
- PercentageOutline,
2765
- MobileFill,
2766
- PictureOutline,
2767
- PictureFill,
2768
- PhoneTwoTone,
2769
- PhoneFill,
2770
- PieChartFill,
2771
- PictureTwoTone,
2772
- PieChartOutline,
2773
- PlaySquareFill,
2774
- PlayCircleTwoTone,
2775
- PlayCircleFill,
2776
- PlusCircleFill,
2777
- PlaySquareTwoTone,
2778
- PlaySquareOutline,
2779
- PlayCircleOutline,
2780
- PieChartTwoTone,
2781
- PlusCircleOutline,
2782
- PlusSquareFill,
2783
- PoundCircleFill,
2784
- PlusSquareOutline,
2785
- PlusOutline,
2786
- PoundOutline,
2787
- PoundCircleOutline,
2788
- PlusSquareTwoTone,
2789
- PlusCircleTwoTone,
2790
- PoweroffOutline,
2791
- PoundCircleTwoTone,
2792
- PhoneOutline,
2793
- PrinterFill,
2794
- PicLeftOutline,
2795
- ProjectTwoTone,
2796
- PrinterOutline,
2797
- ProjectFill,
2798
- ProfileOutline,
2799
- ProfileTwoTone,
2800
- ProjectOutline,
2801
- PropertySafetyFill,
2802
- PullRequestOutline,
2803
- PropertySafetyOutline,
2804
- PushpinOutline,
2805
- PushpinTwoTone,
2806
- PropertySafetyTwoTone,
2807
- PushpinFill,
2808
- QqOutline,
2809
- QqCircleFill,
2810
- QrcodeOutline,
2811
- QqSquareFill,
2812
- QuestionCircleTwoTone,
2813
- QuestionCircleFill,
2814
- RadarChartOutline,
2815
- RadiusUprightOutline,
2816
- QuestionCircleOutline,
2817
- QuestionOutline,
2818
- ReadFill,
2819
- RadiusUpleftOutline,
2820
- RadiusBottomleftOutline,
2821
- RadiusSettingOutline,
2822
- RadiusBottomrightOutline,
2823
- ProfileFill,
2824
- PrinterTwoTone,
2825
- ReadOutline,
2826
- ReconciliationFill,
2827
- ReloadOutline,
2828
- ReconciliationOutline,
2829
- RedEnvelopeTwoTone,
2830
- RedditCircleFill,
2831
- RedoOutline,
2832
- RedEnvelopeFill,
2833
- RedditOutline,
2834
- RestTwoTone,
2835
- RightCircleOutline,
2836
- RestOutline,
2837
- RedditSquareFill,
2838
- RestFill,
2839
- RightCircleTwoTone,
2840
- RightOutline,
2841
- RightSquareFill,
2842
- RightCircleFill,
2843
- RightSquareOutline,
2844
- RetweetOutline,
2845
- RiseOutline,
2846
- RightSquareTwoTone,
2847
- RobotFill,
2848
- RocketOutline,
2849
- RobotOutline,
2850
- RocketTwoTone,
2851
- RocketFill,
2852
- RedEnvelopeOutline,
2853
- RollbackOutline,
2854
- RotateRightOutline,
2855
- RotateLeftOutline,
2856
- ReconciliationTwoTone,
2857
- SafetyCertificateTwoTone,
2858
- SaveOutline,
2859
- SafetyOutline,
2860
- SaveFill,
2861
- SaveTwoTone,
2862
- ScheduleFill,
2863
- SafetyCertificateOutline,
2864
- ScanOutline,
2865
- ScheduleTwoTone,
2866
- SearchOutline,
2867
- ScheduleOutline,
2868
- SecurityScanTwoTone,
2869
- SecurityScanOutline,
2870
- ScissorOutline,
2871
- SelectOutline,
2872
- SecurityScanFill,
2873
- SendOutline,
2874
- SettingOutline,
2875
- SettingTwoTone,
2876
- SettingFill,
2877
- ShareAltOutline,
2878
- ShopOutline,
2879
- ShopFill,
2880
- ShopTwoTone,
2881
- ShrinkOutline,
2882
- ShakeOutline,
2883
- ShoppingOutline,
2884
- ShoppingCartOutline,
2885
- ShoppingFill,
2886
- SisternodeOutline,
2887
- ShoppingTwoTone,
2888
- SafetyCertificateFill,
2889
- SkinOutline,
2890
- SignalFill,
2891
- SketchOutline,
2892
- SkinTwoTone,
2893
- SketchSquareFill,
2894
- SkypeFill,
2895
- SkinFill,
2896
- SlackCircleFill,
2897
- SlackSquareFill,
2898
- SlidersTwoTone,
2899
- SkypeOutline,
2900
- SlidersFill,
2901
- SlackSquareOutline,
2902
- SmallDashOutline,
2903
- SmileTwoTone,
2904
- SlidersOutline,
2905
- SnippetsFill,
2906
- SnippetsOutline,
2907
- SmileOutline,
2908
- SolutionOutline,
2909
- SlackOutline,
2910
- SnippetsTwoTone,
2911
- SoundTwoTone,
2912
- SortAscendingOutline,
2913
- SoundFill,
2914
- SortDescendingOutline,
2915
- SmileFill,
2916
- SoundOutline,
2917
- SplitCellsOutline,
2918
- SketchCircleFill,
2919
- StarOutline,
2920
- StockOutline,
2921
- StarTwoTone,
2922
- StepForwardFill,
2923
- StarFill,
2924
- StepBackwardFill,
2925
- StepForwardOutline,
2926
- StopFill,
2927
- SubnodeOutline,
2928
- SwapLeftOutline,
2929
- StopOutline,
2930
- StopTwoTone,
2931
- SwapRightOutline,
2932
- SwapOutline,
2933
- SwitcherTwoTone,
2934
- SwitcherOutline,
2935
- SyncOutline,
2936
- StrikethroughOutline,
2937
- SwitcherFill,
2938
- TagOutline,
2939
- TabletTwoTone,
2940
- TabletOutline,
2941
- TabletFill,
2942
- TableOutline,
2943
- TagsFill,
2944
- TagFill,
2945
- TagsTwoTone,
2946
- TaobaoCircleOutline,
2947
- StepBackwardOutline,
2948
- TagsOutline,
2949
- TagTwoTone,
2950
- TaobaoOutline,
2951
- ThunderboltOutline,
2952
- TaobaoSquareFill,
2953
- TeamOutline,
2954
- TaobaoCircleFill,
2955
- ThunderboltTwoTone,
2956
- ToolFill,
2957
- ThunderboltFill,
2958
- ToTopOutline,
2959
- ToolOutline,
2960
- ToolTwoTone,
2961
- TrademarkCircleFill,
2962
- TrophyFill,
2963
- TrademarkCircleTwoTone,
2964
- TransactionOutline,
2965
- TrademarkCircleOutline,
2966
- TranslationOutline,
2967
- TwitterCircleFill,
2968
- TrophyOutline,
2969
- TrademarkOutline,
2970
- TrophyTwoTone,
2971
- TwitterSquareFill,
2972
- UnlockFill,
2973
- TwitterOutline,
2974
- UnderlineOutline,
2975
- UndoOutline,
2976
- UpCircleFill,
2977
- UngroupOutline,
2978
- UnlockTwoTone,
2979
- UnlockOutline,
2980
- UpOutline,
2981
- UsbFill,
2982
- UpCircleOutline,
2983
- UnorderedListOutline,
2984
- UpCircleTwoTone,
2985
- UpSquareFill,
2986
- UpSquareOutline,
2987
- UserAddOutline,
2988
- UsbTwoTone,
2989
- UsergroupDeleteOutline,
2990
- UpSquareTwoTone,
2991
- UserOutline,
2992
- UsbOutline,
2993
- UserDeleteOutline,
2994
- UserSwitchOutline,
2995
- VerticalLeftOutline,
2996
- VerticalAlignBottomOutline,
2997
- VerifiedOutline,
2998
- UsergroupAddOutline,
2999
- UploadOutline,
3000
- VerticalAlignMiddleOutline,
3001
- VerticalAlignTopOutline,
3002
- VerticalRightOutline,
3003
- VideoCameraOutline,
3004
- VideoCameraAddOutline,
3005
- VideoCameraTwoTone,
3006
- VideoCameraFill,
3007
- WalletOutline,
3008
- WalletFill,
3009
- WarningFill,
3010
- WarningOutline,
3011
- WechatOutline,
3012
- WalletTwoTone,
3013
- WeiboCircleFill,
3014
- WarningTwoTone,
3015
- WeiboSquareFill,
3016
- WeiboOutline,
3017
- WeiboSquareOutline,
3018
- WeiboCircleOutline,
3019
- WechatFill,
3020
- WhatsAppOutline,
3021
- WifiOutline,
3022
- WomanOutline,
3023
- YoutubeFill,
3024
- YahooOutline,
3025
- WindowsFill,
3026
- WindowsOutline,
3027
- YoutubeOutline,
3028
- YuqueOutline,
3029
- ZhihuCircleFill,
3030
- YuqueFill,
3031
- ZhihuOutline,
3032
- ZhihuSquareFill,
3033
- ZoomInOutline,
3034
- ZoomOutOutline,
3035
- YahooFill
3036
- ];
3037
-
3038
- class YunzaiStartupService {
3039
- constructor(iconSrv, menuService, i18n, win, settingService, aclService, titleService, yzAuthService, cacheService, configService) {
3040
- this.menuService = menuService;
3041
- this.i18n = i18n;
3042
- this.win = win;
3043
- this.settingService = settingService;
3044
- this.aclService = aclService;
3045
- this.titleService = titleService;
3046
- this.yzAuthService = yzAuthService;
3047
- this.cacheService = cacheService;
3048
- this.configService = configService;
3049
- this.config = BUSINESS_DEFAULT_CONFIG;
3050
- this.config = mergeBisConfig(this.configService);
3051
- iconSrv.addIcon(...ICONS);
3052
- }
3053
- load() {
3054
- log$1('startup.service: ', 'load');
3055
- let defaultLang = this.settingService.layout.lang || this.i18n.defaultLang;
3056
- return this.i18n.loadLangData(defaultLang).pipe(mergeMap(langData => {
3057
- log$1('startup.service: ', 'set i18n, defaultLang->', defaultLang, ' langData->', langData);
3058
- this.i18n.use(defaultLang, langData);
3059
- return of(null);
3060
- }), mergeMap(() => {
3061
- return this.yzAuthService.login();
3062
- }), mergeMap(v => {
3063
- // preloader finish
3064
- this.systemInit();
3065
- log$1('startup.service: preloader finish');
3066
- if (this.win && this.win.appBootstrap) {
3067
- this.win.appBootstrap();
3068
- }
3069
- return of(v);
3070
- }));
3071
- }
3072
- systemInit() {
3073
- log$1('startup.service: system init');
3074
- // user
3075
- const yunzaiUser = this.cacheService.get('_yz_user', { mode: 'none' });
3076
- // menu
3077
- const yunzaiMenus = deepCopy(yunzaiUser.menu).filter(m => m.systemCode && m.systemCode === this.config.systemCode);
3078
- mapYzSideToYelonMenu(yunzaiMenus);
3079
- const currentMenu = yunzaiMenus.pop();
3080
- if (currentMenu) {
3081
- // logo app
3082
- this.settingService.setApp({ name: currentMenu.text, description: currentMenu.intro });
3083
- this.settingService.setUser({
3084
- name: yunzaiUser.realname,
3085
- avatar: `${this.config.baseUrl}/filecenter/file/${yunzaiUser.avatarId}` || '',
3086
- email: yunzaiUser.email
3087
- });
3088
- // title
3089
- this.titleService.default = currentMenu && currentMenu.text ? currentMenu.text : 'default application name';
3090
- this.titleService.setTitle(currentMenu && currentMenu.text ? currentMenu.text : 'no title');
3091
- // acl
3092
- const abilities = [];
3093
- generateAbility([currentMenu], abilities, '');
3094
- this.aclService.attachRole((yunzaiUser === null || yunzaiUser === void 0 ? void 0 : yunzaiUser.roles.map((role) => {
3095
- return role.roleValue;
3096
- }).filter((a) => !!a)) || []);
3097
- this.aclService.attachAbility(abilities);
3098
- // aside menu
3099
- this.menuService.add([currentMenu]);
3100
- // cache current
3101
- this.cacheService.set('_yz_current', {
3102
- name: currentMenu.text,
3103
- intro: currentMenu.intro || '',
3104
- icon: currentMenu.appIconUrl || './assets/tmp/img/avatar.jpg'
3105
- });
3106
- // cache displayIndex
3107
- const attributes = currentMenu.attribute;
3108
- if (attributes) {
3109
- const attr = JSON.parse(attributes);
3110
- if (attr && attr.defaultRoute) {
3111
- this.cacheService.set('_yz_defaultRoute', attr.defaultRoute);
3112
- }
3113
- else {
3114
- this.cacheService.set('_yz_defaultRoute', '/displayIndex');
3115
- }
3116
- }
3117
- else {
3118
- this.cacheService.set('_yz_defaultRoute', '/displayIndex');
3119
- }
3120
- }
3121
- }
3122
- }
3123
- YunzaiStartupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiStartupService, deps: [{ token: i8.NzIconService }, { token: i1$2.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: WINDOW }, { token: i1$2.SettingsService }, { token: i3$4.ACLService }, { token: i1$2.TitleService }, { token: YunzaiAuthService }, { token: i1$3.CacheService }, { token: i1$4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
3124
- YunzaiStartupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiStartupService });
3125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: YunzaiStartupService, decorators: [{
3126
- type: Injectable
3127
- }], ctorParameters: function () {
3128
- return [{ type: i8.NzIconService }, { type: i1$2.MenuService }, { type: YunzaiI18NService, decorators: [{
3129
- type: Inject,
3130
- args: [YUNZAI_I18N_TOKEN]
3131
- }] }, { type: undefined, decorators: [{
3132
- type: Inject,
3133
- args: [WINDOW]
3134
- }] }, { type: i1$2.SettingsService }, { type: i3$4.ACLService }, { type: i1$2.TitleService }, { type: YunzaiAuthService }, { type: i1$3.CacheService }, { type: i1$4.YunzaiConfigService }];
3135
- } });
3136
- function mapYzSideToYelonMenu(menus) {
3137
- menus.forEach(menu => {
3138
- menu.badgeDot = menu.badge_dot || null;
3139
- menu.badgeStatus = menu.badge_status || null;
3140
- menu.shortcutRoot = menu.shortcut_root || null;
3141
- menu.reuse = true;
3142
- if (menu.children) {
3143
- mapYzSideToYelonMenu(menu.children);
3144
- }
3145
- });
3146
- }
3147
- function generateAbility(menus, abilities, prefix) {
3148
- menus.forEach(menu => {
3149
- if (menu.link) {
3150
- prefix += menu.link;
3151
- }
3152
- else {
3153
- prefix += '';
3154
- }
3155
- if (menu.menuAuths) {
3156
- menu.menuAuths.forEach((a) => {
3157
- abilities.push(`${prefix}:${a}`);
3158
- abilities.push(a);
3159
- });
3160
- }
3161
- if (menu.children) {
3162
- generateAbility(menu.children, abilities, prefix);
3163
- }
3164
- });
3165
- }
3166
- function YunzaiStartupServiceFactory(startupService) {
3167
- return () => startupService.load();
3168
- }
3169
- //@ts-ignore
3170
- const YUNZAI_APPINIT_PROVIDES = [
3171
- YunzaiStartupService,
3172
- {
3173
- provide: APP_INITIALIZER,
3174
- useFactory: YunzaiStartupServiceFactory,
3175
- deps: [YunzaiStartupService],
3176
- multi: true
3177
- }
3178
- ];
3179
-
3180
- // 埋点转换表
3181
- const HTML_NAMES_MAPPING = {
3182
- _route_icon: '路由-图标',
3183
- _route_link: '路由-跳转',
3184
- _route_toggle: '路由-显示/隐藏',
3185
- _route_group: '路由-分组',
3186
- _route_user: '路由-用户头像',
3187
- _route_backhome: '路由-返回首页',
3188
- _nav_search: '导航-搜索',
3189
- _nav_topic: '导航-主题',
3190
- _nav_item: '导航-应用',
3191
- _nav_notify: '导航-铃铛',
3192
- _nav_msg: '导航-消息',
3193
- _nav_todo: '导航-待办',
3194
- _nav_notice: '导航-通知',
3195
- _nav_clear_msg: '导航-清空消息',
3196
- _nav_clear_todo: '导航-清空待办',
3197
- _nav_clear_notice: '导航-清空通知',
3198
- _nav_theme: '导航-主题',
3199
- _nav_settings: '导航-设置',
3200
- _nav_user: '导航-用户头像',
3201
- _nav_lang: '导航-语言',
3202
- _nav_logo: '导航-Logo',
3203
- _nav_toggle: '导航-显示/隐藏',
3204
- _nav_app: '导航-应用与服务',
3205
- _reusetab: '多标签',
3206
- _reusetab_refresh: '多标签-刷新',
3207
- _reusetab_close: '多标签-关闭',
3208
- _reusetab_closeOther: '多标签-关闭其他',
3209
- _reusetab_closeRight: '多标签-关闭右侧',
3210
- _reusetab_custom: '多标签-自定义'
3211
- };
3212
-
3213
- /**
3214
- * Generated bundle index. Do not edit.
3215
- */
3216
-
3217
- export { ActGuard, BUSINESS_DEFAULT_CONFIG, HTML_NAMES_MAPPING, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, YUNZAI_APPINIT_PROVIDES, YUNZAI_LANGS, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
3218
- //# sourceMappingURL=layout.mjs.map