@yelon/bis 12.0.16 → 13.0.0-beta.1

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 (102) hide show
  1. package/bis.d.ts +1 -0
  2. package/{esm2015/bis.js → esm2020/bis.mjs} +0 -0
  3. package/esm2020/layout/act.guard.mjs +108 -0
  4. package/{esm2015/layout/bis.config.js → esm2020/layout/bis.config.mjs} +0 -0
  5. package/esm2020/layout/contact/contact.component.mjs +492 -0
  6. package/esm2020/layout/contact/contact.service.mjs +146 -0
  7. package/esm2020/layout/layout.mjs +5 -0
  8. package/esm2020/layout/layout.module.mjs +73 -0
  9. package/{esm2015/layout/path-to-regexp.service.js → esm2020/layout/path-to-regexp.service.mjs} +9 -8
  10. package/{esm2015/layout/public_api.js → esm2020/layout/public_api.mjs} +3 -3
  11. package/esm2020/layout/stomp.config.mjs +18 -0
  12. package/{esm2015/layout/widgets/index.js → esm2020/layout/widgets/index.mjs} +0 -0
  13. package/esm2020/layout/widgets/yz.application.component.mjs +271 -0
  14. package/esm2020/layout/widgets/yz.clear-storage.component.mjs +45 -0
  15. package/esm2020/layout/widgets/yz.fullscreen.component.mjs +45 -0
  16. package/esm2020/layout/widgets/yz.i18n.component.mjs +115 -0
  17. package/esm2020/layout/widgets/yz.notify.component.mjs +184 -0
  18. package/esm2020/layout/widgets/yz.them-btn.component.mjs +196 -0
  19. package/esm2020/layout/widgets/yz.user.component.mjs +112 -0
  20. package/esm2020/layout/yz.auth.service.mjs +156 -0
  21. package/esm2020/layout/yz.basic.component.mjs +207 -0
  22. package/esm2020/layout/yz.default.interceptor.mjs +203 -0
  23. package/esm2020/layout/yz.i18n.service.mjs +93 -0
  24. package/esm2020/layout/yz.startup.service.mjs +137 -0
  25. package/esm2020/layout/yz.stomp.service.mjs +88 -0
  26. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  27. package/{esm2015/shared/public_api.js → esm2020/shared/public_api.mjs} +0 -0
  28. package/esm2020/shared/shared-yelon.module.mjs +108 -0
  29. package/{esm2015/shared/shared-zorro.module.js → esm2020/shared/shared-zorro.module.mjs} +0 -0
  30. package/{esm2015/shared/shared.js → esm2020/shared/shared.mjs} +0 -0
  31. package/esm2020/shared/shared.module.mjs +116 -0
  32. package/{esm2015/shared/style-icons.js → esm2020/shared/style-icons.mjs} +0 -0
  33. package/fesm2015/{bis.js → bis.mjs} +1 -1
  34. package/fesm2015/bis.mjs.map +1 -0
  35. package/fesm2015/layout.mjs +2787 -0
  36. package/fesm2015/layout.mjs.map +1 -0
  37. package/fesm2015/{shared.js → shared.mjs} +113 -12
  38. package/fesm2015/shared.mjs.map +1 -0
  39. package/fesm2020/bis.mjs +6 -0
  40. package/fesm2020/bis.mjs.map +1 -0
  41. package/fesm2020/layout.mjs +2796 -0
  42. package/fesm2020/layout.mjs.map +1 -0
  43. package/fesm2020/shared.mjs +1106 -0
  44. package/fesm2020/shared.mjs.map +1 -0
  45. package/layout/act.guard.d.ts +3 -0
  46. package/layout/contact/contact.component.d.ts +169 -0
  47. package/layout/contact/contact.service.d.ts +118 -0
  48. package/layout/layout.d.ts +1 -1
  49. package/layout/layout.module.d.ts +18 -0
  50. package/layout/package.json +5 -6
  51. package/layout/path-to-regexp.service.d.ts +3 -0
  52. package/layout/public_api.d.ts +2 -0
  53. package/layout/widgets/yz.application.component.d.ts +3 -0
  54. package/layout/widgets/yz.clear-storage.component.d.ts +3 -0
  55. package/layout/widgets/yz.fullscreen.component.d.ts +3 -1
  56. package/layout/widgets/yz.i18n.component.d.ts +3 -0
  57. package/layout/widgets/yz.notify.component.d.ts +8 -3
  58. package/layout/widgets/yz.them-btn.component.d.ts +3 -0
  59. package/layout/widgets/yz.user.component.d.ts +3 -0
  60. package/layout/yz.auth.service.d.ts +3 -0
  61. package/layout/yz.basic.component.d.ts +11 -2
  62. package/layout/yz.default.interceptor.d.ts +3 -0
  63. package/layout/yz.i18n.service.d.ts +3 -0
  64. package/layout/yz.startup.service.d.ts +4 -1
  65. package/layout/yz.stomp.service.d.ts +6 -3
  66. package/package.json +46 -18
  67. package/shared/package.json +5 -6
  68. package/shared/shared-zorro.module.d.ts +2 -2
  69. package/shared/shared.d.ts +1 -0
  70. package/shared/shared.module.d.ts +93 -0
  71. package/bis.metadata.json +0 -1
  72. package/bundles/bis.umd.js +0 -18
  73. package/bundles/bis.umd.js.map +0 -1
  74. package/bundles/layout.umd.js +0 -2080
  75. package/bundles/layout.umd.js.map +0 -1
  76. package/bundles/shared.umd.js +0 -1253
  77. package/bundles/shared.umd.js.map +0 -1
  78. package/esm2015/layout/act.guard.js +0 -115
  79. package/esm2015/layout/layout.js +0 -6
  80. package/esm2015/layout/layout.module.js +0 -37
  81. package/esm2015/layout/stomp.config.js +0 -20
  82. package/esm2015/layout/widgets/yz.application.component.js +0 -200
  83. package/esm2015/layout/widgets/yz.clear-storage.component.js +0 -39
  84. package/esm2015/layout/widgets/yz.fullscreen.component.js +0 -36
  85. package/esm2015/layout/widgets/yz.i18n.component.js +0 -78
  86. package/esm2015/layout/widgets/yz.notify.component.js +0 -154
  87. package/esm2015/layout/widgets/yz.them-btn.component.js +0 -146
  88. package/esm2015/layout/widgets/yz.user.component.js +0 -81
  89. package/esm2015/layout/yz.auth.service.js +0 -158
  90. package/esm2015/layout/yz.basic.component.js +0 -101
  91. package/esm2015/layout/yz.default.interceptor.js +0 -204
  92. package/esm2015/layout/yz.i18n.service.js +0 -102
  93. package/esm2015/layout/yz.startup.service.js +0 -138
  94. package/esm2015/layout/yz.stomp.service.js +0 -91
  95. package/esm2015/shared/shared-yelon.module.js +0 -108
  96. package/esm2015/shared/shared.module.js +0 -16
  97. package/fesm2015/bis.js.map +0 -1
  98. package/fesm2015/layout.js +0 -1869
  99. package/fesm2015/layout.js.map +0 -1
  100. package/fesm2015/shared.js.map +0 -1
  101. package/layout/layout.metadata.json +0 -1
  102. package/shared/shared.metadata.json +0 -1
@@ -0,0 +1,2787 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, ChangeDetectionStrategy, Inject, Input, Optional, HostListener, EventEmitter, ViewChild, Output, isDevMode, NgModule, APP_INITIALIZER } from '@angular/core';
3
+ import * as i1$2 from '@yelon/util';
4
+ import { WINDOW, log as log$1, deepCopy } from '@yelon/util';
5
+ import * as i2$1 from '@yelon/cache';
6
+ import { CacheService } from '@yelon/cache';
7
+ import * as i9$1 from '@angular/common';
8
+ import { registerLocaleData, DOCUMENT, CommonModule } from '@angular/common';
9
+ import ngEn from '@angular/common/locales/en';
10
+ import ngZh from '@angular/common/locales/zh';
11
+ import ngZhTw from '@angular/common/locales/zh-Hant';
12
+ import { zhCN, zhTW, enUS } from 'date-fns/locale';
13
+ import * as i1 from '@yelon/theme';
14
+ import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
15
+ import * as i2 from 'ng-zorro-antd/i18n';
16
+ import { zh_CN, zh_TW, en_US } from 'ng-zorro-antd/i18n';
17
+ import * as i3 from '@angular/cdk/platform';
18
+ import * as i4 from '@yelon/util/config';
19
+ import { YunzaiConfigService } from '@yelon/util/config';
20
+ import * as i4$1 from 'ng-zorro-antd/input';
21
+ import * as i5 from 'ng-zorro-antd/grid';
22
+ import * as i8 from 'ng-zorro-antd/core/transition-patch';
23
+ import * as i7 from '@angular/forms';
24
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
25
+ import * as i9 from 'ng-zorro-antd/icon';
26
+ import { __decorate } from 'tslib';
27
+ import { InputBoolean } from '@yelon/util/decorator';
28
+ import * as i2$2 from 'ng-zorro-antd/dropdown';
29
+ import * as i6 from 'ng-zorro-antd/menu';
30
+ import { forkJoin, Subject, of, BehaviorSubject, throwError } from 'rxjs';
31
+ import { map, takeUntil, mergeMap, mergeAll, filter, take, switchMap, catchError } from 'rxjs/operators';
32
+ import { formatDistanceToNow } from 'date-fns';
33
+ import { log } from '@yelon/util/other';
34
+ import * as i1$1 from 'ng-zorro-antd/message';
35
+ import * as i4$2 from '@yelon/abc/notice-icon';
36
+ import { YUNZAI_THEME_BTN_KEYS } from '@yelon/theme/theme-btn';
37
+ import * as i3$1 from '@angular/cdk/bidi';
38
+ import * as i5$1 from 'ng-zorro-antd/tooltip';
39
+ import { YA_SERVICE_TOKEN, mergeConfig } from '@yelon/auth';
40
+ import * as i4$3 from 'ng-zorro-antd/avatar';
41
+ import * as i1$3 from 'ng-zorro-antd/modal';
42
+ import screenfull from 'screenfull';
43
+ import { HttpClientModule, HttpErrorResponse, HttpResponse, HttpResponseBase } from '@angular/common/http';
44
+ import * as i17 from '@angular/router';
45
+ import { RouterModule, Router } from '@angular/router';
46
+ import { YzSharedModule, ICONS } from '@yelon/bis/shared';
47
+ import * as i2$3 from 'ng-zorro-antd/tabs';
48
+ import * as i3$2 from '@yelon/abc/sg';
49
+ import * as i5$2 from 'ng-zorro-antd/spin';
50
+ import * as i6$1 from 'ng-zorro-antd/tree';
51
+ import * as i7$1 from 'ng-zorro-antd/list';
52
+ import * as i8$1 from '@yelon/abc/st';
53
+ import * as i9$2 from 'ng-zorro-antd/button';
54
+ import * as i14 from 'ng-zorro-antd/core/wave';
55
+ import { RxStomp } from '@stomp/rx-stomp';
56
+ import * as i3$3 from 'ng-zorro-antd/notification';
57
+ import { NzNotificationService } from 'ng-zorro-antd/notification';
58
+ import * as i3$4 from '@yelon/theme/layout-default';
59
+ import * as i13 from '@yelon/abc/reuse-tab';
60
+ import * as i3$5 from '@yelon/acl';
61
+
62
+ const DEFAULT = 'zh-CN';
63
+ const LANGS = {
64
+ 'zh-CN': {
65
+ text: '简体中文',
66
+ ng: ngZh,
67
+ zorro: zh_CN,
68
+ date: zhCN,
69
+ yelon: zh_CN$1,
70
+ abbr: '🇨🇳'
71
+ },
72
+ 'zh-TW': {
73
+ text: '繁体中文',
74
+ ng: ngZhTw,
75
+ zorro: zh_TW,
76
+ date: zhTW,
77
+ yelon: zh_TW$1,
78
+ abbr: '🇭🇰'
79
+ },
80
+ 'en-US': {
81
+ text: 'English',
82
+ ng: ngEn,
83
+ zorro: en_US,
84
+ date: enUS,
85
+ yelon: en_US$1,
86
+ abbr: '🇬🇧'
87
+ }
88
+ };
89
+ class YzI18NService extends YunzaiI18nBaseService {
90
+ constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv) {
91
+ super(cogSrv);
92
+ this.http = http;
93
+ this.settings = settings;
94
+ this.nzI18nService = nzI18nService;
95
+ this.yelonLocaleService = yelonLocaleService;
96
+ this.platform = platform;
97
+ this._defaultLang = DEFAULT;
98
+ this._langs = Object.keys(LANGS).map(code => {
99
+ const item = LANGS[code];
100
+ return { code, text: item.text, abbr: item.abbr };
101
+ });
102
+ const defaultLang = this.getDefaultLang();
103
+ this._defaultLang = this._langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
104
+ }
105
+ getDefaultLang() {
106
+ if (!this.platform.isBrowser) {
107
+ return DEFAULT;
108
+ }
109
+ if (this.settings.layout.lang) {
110
+ return this.settings.layout.lang;
111
+ }
112
+ let res = (navigator.languages ? navigator.languages[0] : null) || navigator.language;
113
+ const arr = res.split('-');
114
+ return arr.length <= 1 ? res : `${arr[0]}-${arr[1].toUpperCase()}`;
115
+ }
116
+ loadLangData(lang) {
117
+ return this.http.get(`assets/tmp/i18n/${lang}.json`);
118
+ }
119
+ use(lang, data) {
120
+ if (this._currentLang === lang)
121
+ return;
122
+ this._data = this.flatData(data, []);
123
+ const item = LANGS[lang];
124
+ registerLocaleData(item.ng);
125
+ this.nzI18nService.setLocale(item.zorro);
126
+ this.nzI18nService.setDateLocale(item.date);
127
+ this.yelonLocaleService.setLocale(item.yelon);
128
+ this._currentLang = lang;
129
+ this._change$.next(lang);
130
+ }
131
+ getLangs() {
132
+ return this._langs;
133
+ }
134
+ }
135
+ YzI18NService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzI18NService, deps: [{ token: i1._HttpClient }, { token: i1.SettingsService }, { token: i2.NzI18nService }, { token: i1.YelonLocaleService }, { token: i3.Platform }, { token: i4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
136
+ YzI18NService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzI18NService, providedIn: 'root' });
137
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzI18NService, decorators: [{
138
+ type: Injectable,
139
+ args: [{ providedIn: 'root' }]
140
+ }], ctorParameters: function () { return [{ type: i1._HttpClient }, { type: i1.SettingsService }, { type: i2.NzI18nService }, { type: i1.YelonLocaleService }, { type: i3.Platform }, { type: i4.YunzaiConfigService }]; } });
141
+
142
+ var TOPIC;
143
+ (function (TOPIC) {
144
+ TOPIC[TOPIC["FULL"] = 0] = "FULL";
145
+ TOPIC[TOPIC["OWN"] = 1] = "OWN";
146
+ TOPIC[TOPIC["EVERY"] = 2] = "EVERY";
147
+ })(TOPIC || (TOPIC = {}));
148
+ class YzHeaderApplicationComponent {
149
+ constructor(inject, cacheService, i18n, http) {
150
+ this.inject = inject;
151
+ this.cacheService = cacheService;
152
+ this.i18n = i18n;
153
+ this.http = http;
154
+ this.T = TOPIC;
155
+ this.active = false;
156
+ this.topicData = [];
157
+ this.listData = [];
158
+ this.topic = TOPIC.FULL;
159
+ this.searchValue = null;
160
+ this.subs = [];
161
+ }
162
+ ngOnInit() {
163
+ this.topicData = this.cacheService.get('_yz_header', { mode: 'none' });
164
+ this.listData = this.cacheService.get('_yz_header', { mode: 'none' });
165
+ }
166
+ ngOnDestroy() {
167
+ this.subs.forEach(f => f.unsubscribe());
168
+ }
169
+ diffChange(flag) {
170
+ if (flag) {
171
+ this.active = flag;
172
+ }
173
+ else {
174
+ this.active = !this.active;
175
+ }
176
+ }
177
+ initTopic(topic) {
178
+ this.searchValue = null;
179
+ this.listData = this.cacheService.get('_yz_header', { mode: 'none' });
180
+ this.topic = topic;
181
+ }
182
+ full() {
183
+ this.initTopic(TOPIC.FULL);
184
+ }
185
+ own() {
186
+ this.initTopic(TOPIC.OWN);
187
+ const temp = this.cacheService.get('_yz_header', { mode: 'none' });
188
+ this.listData = temp
189
+ .filter((topic) => {
190
+ topic.children = topic.children.filter((child) => {
191
+ return child.auth;
192
+ });
193
+ return topic;
194
+ })
195
+ .filter((topic) => {
196
+ return topic.children.length > 0;
197
+ });
198
+ }
199
+ every(e) {
200
+ this.initTopic(TOPIC.EVERY);
201
+ this.choosed = e;
202
+ const temp = this.cacheService.get('_yz_header', { mode: 'none' });
203
+ this.listData = [...temp.filter(t => t.key === e.key)[0].children];
204
+ }
205
+ onSearch() {
206
+ const temp = this.cacheService.get('_yz_header', { mode: 'none' });
207
+ // 如果搜索输入的有值
208
+ if (this.searchValue) {
209
+ // 过滤菜单过滤出搜索的值
210
+ this.listData = temp
211
+ .filter((topic) => {
212
+ if (this.i18n.fanyi(topic.name).includes(this.searchValue)) {
213
+ return topic;
214
+ }
215
+ else {
216
+ topic.children = topic.children.filter((child) => {
217
+ return this.i18n.fanyi(child.name).includes(this.searchValue);
218
+ });
219
+ return topic;
220
+ }
221
+ })
222
+ .filter((topic) => {
223
+ return topic.children.length > 0;
224
+ });
225
+ }
226
+ else {
227
+ // 如果没有值,取消搜索
228
+ this.listData = this.cacheService.get('_yz_header', { mode: 'none' });
229
+ }
230
+ }
231
+ open(topic) {
232
+ if (topic.key) {
233
+ this.subs.push(this.http
234
+ .post(`/app-manager/web-scan/save`, {
235
+ appId: topic.key,
236
+ createDate: new Date()
237
+ })
238
+ .subscribe());
239
+ }
240
+ switch (topic.target) {
241
+ case 'href':
242
+ this.inject.get(WINDOW).location.href = topic.url;
243
+ break;
244
+ case 'blank':
245
+ this.inject.get(WINDOW).location.href = topic.url;
246
+ break;
247
+ case 'target':
248
+ this.inject.get(WINDOW).location.href = topic.url;
249
+ break;
250
+ default:
251
+ this.inject.get(WINDOW).location.href = topic.url;
252
+ break;
253
+ }
254
+ }
255
+ }
256
+ YzHeaderApplicationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderApplicationComponent, deps: [{ token: i0.Injector }, { token: i2$1.CacheService }, { token: YzI18NService }, { token: i1._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
257
+ YzHeaderApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderApplicationComponent, selector: "yz-header-application", ngImport: i0, template: `
258
+ <!-- template start-->
259
+ <ng-template #search>
260
+ <div nz-row class="yz-application-list-search">
261
+ <nz-input-group [nzPrefix]="prefixTemplate">
262
+ <input
263
+ type="text"
264
+ nz-input
265
+ placeholder="{{ 'application.search' | i18n }}"
266
+ [(ngModel)]="searchValue"
267
+ (ngModelChange)="onSearch()"
268
+ />
269
+ <ng-template #prefixTemplate>
270
+ <i nz-icon nzType="search" nzTheme="outline"></i>
271
+ </ng-template>
272
+ </nz-input-group>
273
+ </div>
274
+ </ng-template>
275
+ <ng-template #ld>
276
+ <div class="yz-application-list">
277
+ <ul>
278
+ <li *ngFor="let d of listData">
279
+ <h5>{{ d.name }}</h5>
280
+ <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
281
+ </li>
282
+ </ul>
283
+ </div>
284
+ </ng-template>
285
+ <!-- template end-->
286
+
287
+ <!-- button start-->
288
+ <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'application.button' | i18n }}</div>
289
+ <!-- button end-->
290
+
291
+ <!-- header start-->
292
+ <div class="yz-application" nz-row *ngIf="active">
293
+ <div nz-col [nzSpan]="3" class="yz-application-topic">
294
+ <div class="yz-application-text" (click)="full()">{{ 'application.all' | i18n }}</div>
295
+ <div class="yz-application-text" (click)="own()">{{ 'application.mine' | i18n }}</div>
296
+ <div class="yz-application-text" *ngFor="let d of topicData" (click)="every(d)">
297
+ {{ d.name }}
298
+ </div>
299
+ </div>
300
+ <div nz-col [nzSpan]="21" [ngSwitch]="topic" class="yz-application-container">
301
+ <div *ngSwitchCase="T.FULL">
302
+ <ng-template [ngTemplateOutlet]="search"></ng-template>
303
+ <ng-template [ngTemplateOutlet]="ld"></ng-template>
304
+ </div>
305
+ <div *ngSwitchCase="T.OWN">
306
+ <ng-template [ngTemplateOutlet]="search"></ng-template>
307
+ <ng-template [ngTemplateOutlet]="ld"></ng-template>
308
+ </div>
309
+ <div *ngSwitchCase="T.EVERY" class="yz-application-list">
310
+ <div class="yz-application-list-item">
311
+ <ul>
312
+ <li *ngFor="let d of listData" (click)="open(d)">
313
+ <a href="javascript:;">
314
+ <h4>{{ d.name }}</h4>
315
+ <p>{{ d.intro }}</p>
316
+ </a>
317
+ </li>
318
+ </ul>
319
+ </div>
320
+ </div>
321
+ </div>
322
+ </div>
323
+ <!-- header end-->
324
+ `, isInline: true, components: [{ type: i4$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }], directives: [{ type: i5.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { type: i8.ɵ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"] }, { type: i4$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "disabled"], exportAs: ["nzInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.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"] }, { type: i9$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i9$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i9$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
325
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderApplicationComponent, decorators: [{
326
+ type: Component,
327
+ args: [{
328
+ selector: 'yz-header-application',
329
+ template: `
330
+ <!-- template start-->
331
+ <ng-template #search>
332
+ <div nz-row class="yz-application-list-search">
333
+ <nz-input-group [nzPrefix]="prefixTemplate">
334
+ <input
335
+ type="text"
336
+ nz-input
337
+ placeholder="{{ 'application.search' | i18n }}"
338
+ [(ngModel)]="searchValue"
339
+ (ngModelChange)="onSearch()"
340
+ />
341
+ <ng-template #prefixTemplate>
342
+ <i nz-icon nzType="search" nzTheme="outline"></i>
343
+ </ng-template>
344
+ </nz-input-group>
345
+ </div>
346
+ </ng-template>
347
+ <ng-template #ld>
348
+ <div class="yz-application-list">
349
+ <ul>
350
+ <li *ngFor="let d of listData">
351
+ <h5>{{ d.name }}</h5>
352
+ <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
353
+ </li>
354
+ </ul>
355
+ </div>
356
+ </ng-template>
357
+ <!-- template end-->
358
+
359
+ <!-- button start-->
360
+ <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'application.button' | i18n }}</div>
361
+ <!-- button end-->
362
+
363
+ <!-- header start-->
364
+ <div class="yz-application" nz-row *ngIf="active">
365
+ <div nz-col [nzSpan]="3" class="yz-application-topic">
366
+ <div class="yz-application-text" (click)="full()">{{ 'application.all' | i18n }}</div>
367
+ <div class="yz-application-text" (click)="own()">{{ 'application.mine' | i18n }}</div>
368
+ <div class="yz-application-text" *ngFor="let d of topicData" (click)="every(d)">
369
+ {{ d.name }}
370
+ </div>
371
+ </div>
372
+ <div nz-col [nzSpan]="21" [ngSwitch]="topic" class="yz-application-container">
373
+ <div *ngSwitchCase="T.FULL">
374
+ <ng-template [ngTemplateOutlet]="search"></ng-template>
375
+ <ng-template [ngTemplateOutlet]="ld"></ng-template>
376
+ </div>
377
+ <div *ngSwitchCase="T.OWN">
378
+ <ng-template [ngTemplateOutlet]="search"></ng-template>
379
+ <ng-template [ngTemplateOutlet]="ld"></ng-template>
380
+ </div>
381
+ <div *ngSwitchCase="T.EVERY" class="yz-application-list">
382
+ <div class="yz-application-list-item">
383
+ <ul>
384
+ <li *ngFor="let d of listData" (click)="open(d)">
385
+ <a href="javascript:;">
386
+ <h4>{{ d.name }}</h4>
387
+ <p>{{ d.intro }}</p>
388
+ </a>
389
+ </li>
390
+ </ul>
391
+ </div>
392
+ </div>
393
+ </div>
394
+ </div>
395
+ <!-- header end-->
396
+ `,
397
+ changeDetection: ChangeDetectionStrategy.OnPush
398
+ }]
399
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2$1.CacheService }, { type: YzI18NService }, { type: i1._HttpClient }]; } });
400
+
401
+ class YzHeaderI18NComponent {
402
+ constructor(settings, i18n, doc) {
403
+ this.settings = settings;
404
+ this.i18n = i18n;
405
+ this.doc = doc;
406
+ /** Whether to display language text */
407
+ this.showLangText = true;
408
+ }
409
+ get langs() {
410
+ return this.i18n.getLangs();
411
+ }
412
+ get curLangCode() {
413
+ return this.settings.layout.lang;
414
+ }
415
+ change(lang) {
416
+ const spinEl = this.doc.createElement('div');
417
+ spinEl.setAttribute('class', `page-loading ant-spin ant-spin-lg ant-spin-spinning`);
418
+ spinEl.innerHTML = `<span class="ant-spin-dot ant-spin-dot-spin"><i></i><i></i><i></i><i></i></span>`;
419
+ this.doc.body.appendChild(spinEl);
420
+ this.i18n.loadLangData(lang).subscribe(res => {
421
+ this.i18n.use(lang, res);
422
+ this.settings.setLayout('lang', lang);
423
+ setTimeout(() => this.doc.location.reload());
424
+ });
425
+ }
426
+ }
427
+ YzHeaderI18NComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderI18NComponent, deps: [{ token: i1.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
428
+ YzHeaderI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderI18NComponent, selector: "yz-header-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
429
+ <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
430
+ <i nz-icon nzType="global"></i>
431
+ {{ 'menu.lang' | i18n }}
432
+ <i nz-icon nzType="down"></i>
433
+ </div>
434
+ <i
435
+ *ngIf="!showLangText"
436
+ nz-dropdown
437
+ [nzDropdownMenu]="langMenu"
438
+ nzPlacement="bottomRight"
439
+ nz-icon
440
+ nzType="global"
441
+ ></i>
442
+ <nz-dropdown-menu #langMenu="nzDropdownMenu">
443
+ <ul nz-menu>
444
+ <li
445
+ nz-menu-item
446
+ *ngFor="let item of langs"
447
+ [nzSelected]="item.code === curLangCode"
448
+ (click)="change(item.code)"
449
+ >
450
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
451
+ {{ item.text }}
452
+ </li>
453
+ </ul>
454
+ </nz-dropdown-menu>
455
+ `, isInline: true, components: [{ type: i2$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i8.ɵ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"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
456
+ __decorate([
457
+ InputBoolean()
458
+ ], YzHeaderI18NComponent.prototype, "showLangText", void 0);
459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderI18NComponent, decorators: [{
460
+ type: Component,
461
+ args: [{
462
+ selector: 'yz-header-i18n',
463
+ template: `
464
+ <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
465
+ <i nz-icon nzType="global"></i>
466
+ {{ 'menu.lang' | i18n }}
467
+ <i nz-icon nzType="down"></i>
468
+ </div>
469
+ <i
470
+ *ngIf="!showLangText"
471
+ nz-dropdown
472
+ [nzDropdownMenu]="langMenu"
473
+ nzPlacement="bottomRight"
474
+ nz-icon
475
+ nzType="global"
476
+ ></i>
477
+ <nz-dropdown-menu #langMenu="nzDropdownMenu">
478
+ <ul nz-menu>
479
+ <li
480
+ nz-menu-item
481
+ *ngFor="let item of langs"
482
+ [nzSelected]="item.code === curLangCode"
483
+ (click)="change(item.code)"
484
+ >
485
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
486
+ {{ item.text }}
487
+ </li>
488
+ </ul>
489
+ </nz-dropdown-menu>
490
+ `,
491
+ changeDetection: ChangeDetectionStrategy.OnPush
492
+ }]
493
+ }], ctorParameters: function () {
494
+ return [{ type: i1.SettingsService }, { type: YzI18NService, decorators: [{
495
+ type: Inject,
496
+ args: [YUNZAI_I18N_TOKEN]
497
+ }] }, { type: undefined, decorators: [{
498
+ type: Inject,
499
+ args: [DOCUMENT]
500
+ }] }];
501
+ }, propDecorators: { showLangText: [{
502
+ type: Input
503
+ }] } });
504
+
505
+ class YzHeaderNotifyComponent {
506
+ constructor(injector, msg, y18n, nzI18n, cdr, httpClient) {
507
+ this.injector = injector;
508
+ this.msg = msg;
509
+ this.y18n = y18n;
510
+ this.nzI18n = nzI18n;
511
+ this.cdr = cdr;
512
+ this.httpClient = httpClient;
513
+ this.data = [
514
+ {
515
+ key: 'msg',
516
+ title: this.y18n.fanyi('notify.message'),
517
+ list: [],
518
+ emptyText: this.y18n.fanyi('notify.message.emptyText'),
519
+ emptyImage: './assets/tmp/img/message.svg',
520
+ clearText: this.y18n.fanyi('notify.message.clearText')
521
+ },
522
+ {
523
+ key: 'todo',
524
+ title: this.y18n.fanyi('notify.todo'),
525
+ list: [],
526
+ emptyText: this.y18n.fanyi('notify.todo.emptyText'),
527
+ emptyImage: './assets/tmp/img/todo.svg',
528
+ clearText: this.y18n.fanyi('notify.todo.clearText')
529
+ },
530
+ {
531
+ key: 'notice',
532
+ title: this.y18n.fanyi('notify.notice'),
533
+ list: [],
534
+ emptyText: this.y18n.fanyi('notify.notice.emptyText'),
535
+ emptyImage: './assets/tmp/img/notice.svg',
536
+ clearText: this.y18n.fanyi('notify.notice.clearText')
537
+ }
538
+ ];
539
+ this.loading = false;
540
+ this.count = 0;
541
+ this.subs = [];
542
+ }
543
+ ngOnInit() {
544
+ this.loadData();
545
+ }
546
+ loadData() {
547
+ this.count = 0;
548
+ this.loading = true;
549
+ this.subs.push(forkJoin(this.loadTodo(), this.loadMessage()).subscribe(() => {
550
+ this.loading = false;
551
+ this.cdr.detectChanges();
552
+ }));
553
+ }
554
+ loadMessage() {
555
+ log('notify.component: ', 'fetch message list');
556
+ const formatMessageStatus = (status) => {
557
+ switch (status) {
558
+ case '0':
559
+ return { extra: this.y18n.fanyi('notify.unread'), color: 'red' };
560
+ case '1':
561
+ return { extra: this.y18n.fanyi('notify.readed'), color: 'green' };
562
+ default:
563
+ return { extra: this.y18n.fanyi('notify.nostatus'), color: 'primary' };
564
+ }
565
+ };
566
+ return this.httpClient
567
+ .post(`/message-center-3/my-msg-and-todo/msg-list`, {
568
+ pageNum: 1,
569
+ pageSize: 10,
570
+ status: '0'
571
+ })
572
+ .pipe(map((response) => {
573
+ const viewMessage = this.data.filter(d => d.key === 'msg')[0];
574
+ viewMessage.list = response.data.list.map((m) => {
575
+ 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() }) });
576
+ });
577
+ this.count += viewMessage.list.length;
578
+ }));
579
+ }
580
+ loadTodo() {
581
+ log('notify.component: ', 'fetch todo list');
582
+ const formatTodoStatus = (status) => {
583
+ switch (status) {
584
+ case '0':
585
+ return { extra: this.y18n.fanyi('notify.unstart'), color: 'red' };
586
+ case '1':
587
+ return { extra: this.y18n.fanyi('notify.started'), color: 'green' };
588
+ default:
589
+ return { extra: this.y18n.fanyi('notify.nostatus'), color: 'primary' };
590
+ }
591
+ };
592
+ return this.httpClient
593
+ .post(`/message-center-3/my-msg-and-todo/todo-list`, {
594
+ pageNum: 1,
595
+ pageSize: 10,
596
+ status: '0'
597
+ })
598
+ .pipe(map((response) => {
599
+ const viewTodo = this.data.filter(d => d.key === 'todo')[0];
600
+ viewTodo.list = response.data.list.map((t) => {
601
+ 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 });
602
+ });
603
+ this.count += viewTodo.list.length;
604
+ }));
605
+ }
606
+ clear(type) {
607
+ const t = this.data.filter(d => d.title === type)[0];
608
+ if (t.key == 'msg' || t.key == 'notice') {
609
+ this.subs.push(this.httpClient.post(`/message-center-3/my-msg-and-todo/msg-clear`, {}).subscribe(_ => {
610
+ this.msg.success(`${this.y18n.fanyi('notify.clear')} ${type}`);
611
+ this.loadData();
612
+ }));
613
+ }
614
+ if (t.key == 'todo') {
615
+ this.loadData();
616
+ }
617
+ }
618
+ select(res) {
619
+ this.injector.get(WINDOW).open(res.item.url);
620
+ this.loadData();
621
+ }
622
+ ngOnDestroy() {
623
+ this.subs.forEach(a => a.unsubscribe());
624
+ }
625
+ }
626
+ YzHeaderNotifyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderNotifyComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YUNZAI_I18N_TOKEN }, { token: i2.NzI18nService }, { token: i0.ChangeDetectorRef }, { token: i1._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
627
+ YzHeaderNotifyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderNotifyComponent, selector: "yz-header-notify", ngImport: i0, template: `
628
+ <notice-icon
629
+ [data]="data"
630
+ [count]="count"
631
+ [loading]="loading"
632
+ btnClass="yunzai-default__nav-item"
633
+ btnIconClass="yunzai-default__nav-item-icon"
634
+ (select)="select($event)"
635
+ (clear)="clear($event)"
636
+ ></notice-icon>
637
+ `, isInline: true, components: [{ type: i4$2.NoticeIconComponent, selector: "notice-icon", inputs: ["data", "count", "loading", "popoverVisible", "btnClass", "btnIconClass"], outputs: ["select", "clear", "popoverVisibleChange"], exportAs: ["noticeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderNotifyComponent, decorators: [{
639
+ type: Component,
640
+ args: [{
641
+ selector: 'yz-header-notify',
642
+ template: `
643
+ <notice-icon
644
+ [data]="data"
645
+ [count]="count"
646
+ [loading]="loading"
647
+ btnClass="yunzai-default__nav-item"
648
+ btnIconClass="yunzai-default__nav-item-icon"
649
+ (select)="select($event)"
650
+ (clear)="clear($event)"
651
+ ></notice-icon>
652
+ `,
653
+ changeDetection: ChangeDetectionStrategy.OnPush
654
+ }]
655
+ }], ctorParameters: function () {
656
+ return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: YzI18NService, decorators: [{
657
+ type: Inject,
658
+ args: [YUNZAI_I18N_TOKEN]
659
+ }] }, { type: i2.NzI18nService }, { type: i0.ChangeDetectorRef }, { type: i1._HttpClient }];
660
+ } });
661
+
662
+ class YzHeaderThemBtnComponent {
663
+ constructor(renderer, configSrv, platform, doc, directionality, KEYS) {
664
+ this.renderer = renderer;
665
+ this.configSrv = configSrv;
666
+ this.platform = platform;
667
+ this.doc = doc;
668
+ this.directionality = directionality;
669
+ this.KEYS = KEYS;
670
+ this.theme = 'default';
671
+ this.types = [
672
+ { key: 'default', text: 'theme.default', color: '#2163ff' },
673
+ { key: 'compact', text: 'theme.compact', color: '#2163ff' },
674
+ { key: 'dark', text: 'theme.dark', color: '#020202' },
675
+ { key: 'yuhong', text: 'theme.yuhong', color: '#C04851' },
676
+ { key: 'danjuhuang', text: 'theme.danjuhuang', color: '#FBA414' },
677
+ { key: 'xinghuang', text: 'theme.xinghuang', color: '#F28E16' },
678
+ { key: 'shilv', text: 'theme.shilv', color: '#57C3C2' },
679
+ { key: 'zhulv', text: 'theme.zhulv', color: '#1BA784' },
680
+ { key: 'youlan', text: 'theme.youlan', color: '#1781B5' },
681
+ { key: 'dianqing', text: 'theme.dianqing', color: '#1661AB' },
682
+ { key: 'shangengzi', text: 'theme.shangengzi', color: '#61649F' },
683
+ { key: 'shuiniuhui', text: 'theme.shuiniuhui', color: '#2F2F35' }
684
+ ];
685
+ this.devTips = `When the dark.css file can't be found, you need to run it once: npm run theme`;
686
+ this.deployUrl = '';
687
+ this.destroy$ = new Subject();
688
+ this.dir = 'ltr';
689
+ }
690
+ ngOnInit() {
691
+ var _a;
692
+ this.dir = this.directionality.value;
693
+ (_a = this.directionality.change) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this.destroy$)).subscribe((direction) => {
694
+ this.dir = direction;
695
+ });
696
+ this.initTheme();
697
+ }
698
+ initTheme() {
699
+ if (!this.platform.isBrowser) {
700
+ return;
701
+ }
702
+ this.theme = localStorage.getItem(this.KEYS) || 'default';
703
+ this.updateChartTheme();
704
+ this.onThemeChange(this.theme);
705
+ }
706
+ updateChartTheme() {
707
+ this.configSrv.set('chart', { theme: this.theme === 'dark' ? 'dark' : '' });
708
+ }
709
+ onThemeChange(theme) {
710
+ if (!this.platform.isBrowser) {
711
+ return;
712
+ }
713
+ this.theme = theme;
714
+ this.renderer.setAttribute(this.doc.body, 'data-theme', theme);
715
+ const dom = this.doc.getElementById(this.KEYS);
716
+ if (dom) {
717
+ dom.remove();
718
+ }
719
+ localStorage.removeItem(this.KEYS);
720
+ if (theme !== 'default') {
721
+ const el = this.doc.createElement('link');
722
+ el.type = 'text/css';
723
+ el.rel = 'stylesheet';
724
+ el.id = this.KEYS;
725
+ el.href = `${this.deployUrl}assets/style.${theme}.css`;
726
+ localStorage.setItem(this.KEYS, theme);
727
+ this.doc.body.append(el);
728
+ }
729
+ this.updateChartTheme();
730
+ }
731
+ ngOnDestroy() {
732
+ const el = this.doc.getElementById(this.KEYS);
733
+ if (el != null) {
734
+ this.doc.body.removeChild(el);
735
+ }
736
+ this.destroy$.next();
737
+ this.destroy$.complete();
738
+ }
739
+ }
740
+ YzHeaderThemBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderThemBtnComponent, deps: [{ token: i0.Renderer2 }, { token: i4.YunzaiConfigService }, { token: i3.Platform }, { token: DOCUMENT }, { token: i3$1.Directionality, optional: true }, { token: YUNZAI_THEME_BTN_KEYS }], target: i0.ɵɵFactoryTarget.Component });
741
+ YzHeaderThemBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderThemBtnComponent, selector: "yz-header-theme-btn", inputs: { types: "types", devTips: "devTips", deployUrl: "deployUrl" }, ngImport: i0, template: `
742
+ <div
743
+ class="yunzai-default__nav-item"
744
+ nz-dropdown
745
+ [nzDropdownMenu]="iconMenu"
746
+ nzTrigger="click"
747
+ nzPlacement="bottomRight"
748
+ >
749
+ <svg nz-tooltip class="anticon" role="img" width="21" height="21" viewBox="0 0 21 21" fill="currentColor">
750
+ <g fill-rule="evenodd">
751
+ <g fill-rule="nonzero">
752
+ <path
753
+ 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"
754
+ ></path>
755
+ </g>
756
+ </g>
757
+ </svg>
758
+ </div>
759
+ <nz-dropdown-menu #iconMenu="nzDropdownMenu">
760
+ <ul nz-menu>
761
+ <li
762
+ nz-menu-item
763
+ *ngFor="let theme of types"
764
+ (click)="onThemeChange(theme.key)"
765
+ [style]="{ color: theme.color }"
766
+ >
767
+ <i nz-icon nzType="bg-colors"></i>
768
+ {{ theme.text | i18n }}
769
+ </li>
770
+ </ul>
771
+ <!-- <div nz-menu class="wd-xl animated jello">-->
772
+ <!-- <div nz-row [nzJustify]="'space-between'" [nzAlign]="'middle'" class="app-icons">-->
773
+ <!-- <div nz-col [nzSpan]="4" *ngFor="let theme of types" (click)="onThemeChange(theme.key)">-->
774
+ <!-- <i nz-icon nzType="bg-colors" class="text-white" [style]="{ backgroundColor: theme.color }"></i>-->
775
+ <!-- <span [ngStyle]="{ color: theme.color }">{{ theme.text | i18n }}</span>-->
776
+ <!-- </div>-->
777
+ <!-- </div>-->
778
+ <!-- </div>-->
779
+ </nz-dropdown-menu>
780
+ `, isInline: true, components: [{ type: i2$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }], directives: [{ type: i2$2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i5$1.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.ɵ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"] }, { type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderThemBtnComponent, decorators: [{
782
+ type: Component,
783
+ args: [{
784
+ selector: 'yz-header-theme-btn',
785
+ template: `
786
+ <div
787
+ class="yunzai-default__nav-item"
788
+ nz-dropdown
789
+ [nzDropdownMenu]="iconMenu"
790
+ nzTrigger="click"
791
+ nzPlacement="bottomRight"
792
+ >
793
+ <svg nz-tooltip class="anticon" role="img" width="21" height="21" viewBox="0 0 21 21" fill="currentColor">
794
+ <g fill-rule="evenodd">
795
+ <g fill-rule="nonzero">
796
+ <path
797
+ 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"
798
+ ></path>
799
+ </g>
800
+ </g>
801
+ </svg>
802
+ </div>
803
+ <nz-dropdown-menu #iconMenu="nzDropdownMenu">
804
+ <ul nz-menu>
805
+ <li
806
+ nz-menu-item
807
+ *ngFor="let theme of types"
808
+ (click)="onThemeChange(theme.key)"
809
+ [style]="{ color: theme.color }"
810
+ >
811
+ <i nz-icon nzType="bg-colors"></i>
812
+ {{ theme.text | i18n }}
813
+ </li>
814
+ </ul>
815
+ <!-- <div nz-menu class="wd-xl animated jello">-->
816
+ <!-- <div nz-row [nzJustify]="'space-between'" [nzAlign]="'middle'" class="app-icons">-->
817
+ <!-- <div nz-col [nzSpan]="4" *ngFor="let theme of types" (click)="onThemeChange(theme.key)">-->
818
+ <!-- <i nz-icon nzType="bg-colors" class="text-white" [style]="{ backgroundColor: theme.color }"></i>-->
819
+ <!-- <span [ngStyle]="{ color: theme.color }">{{ theme.text | i18n }}</span>-->
820
+ <!-- </div>-->
821
+ <!-- </div>-->
822
+ <!-- </div>-->
823
+ </nz-dropdown-menu>
824
+ `,
825
+ changeDetection: ChangeDetectionStrategy.OnPush
826
+ }]
827
+ }], ctorParameters: function () {
828
+ return [{ type: i0.Renderer2 }, { type: i4.YunzaiConfigService }, { type: i3.Platform }, { type: undefined, decorators: [{
829
+ type: Inject,
830
+ args: [DOCUMENT]
831
+ }] }, { type: i3$1.Directionality, decorators: [{
832
+ type: Optional
833
+ }] }, { type: undefined, decorators: [{
834
+ type: Inject,
835
+ args: [YUNZAI_THEME_BTN_KEYS]
836
+ }] }];
837
+ }, propDecorators: { types: [{
838
+ type: Input
839
+ }], devTips: [{
840
+ type: Input
841
+ }], deployUrl: [{
842
+ type: Input
843
+ }] } });
844
+
845
+ const BUSINESS_DEFAULT_CONFIG = {
846
+ baseUrl: '/backstage',
847
+ systemCode: 'portal',
848
+ loginForm: null,
849
+ refreshTokenEnabled: true,
850
+ refreshTokenType: 're-request'
851
+ };
852
+ function mergeBisConfig(srv) {
853
+ return srv.merge('bis', BUSINESS_DEFAULT_CONFIG);
854
+ }
855
+
856
+ class YzHeaderUserComponent {
857
+ constructor(injector, msg, tokenService,
858
+ // @ts-ignore
859
+ configService, cacheService) {
860
+ this.injector = injector;
861
+ this.msg = msg;
862
+ this.tokenService = tokenService;
863
+ this.configService = configService;
864
+ this.cacheService = cacheService;
865
+ this.icon = '';
866
+ this.username = '';
867
+ this.menus = [];
868
+ this.config = mergeBisConfig(configService);
869
+ }
870
+ ngOnInit() {
871
+ const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
872
+ const user = this.cacheService.get('_yz_user', { mode: 'none' });
873
+ this.username = user.realname ? user.realname : '未命名';
874
+ this.icon = user.avatarId
875
+ ? `${this.config.baseUrl}/filecenter/file/${user.avatarId}`
876
+ : `./assets/tmp/img/avatar.jpg`;
877
+ this.menus = projectInfo.profileList;
878
+ }
879
+ logout() {
880
+ localStorage.clear();
881
+ this.tokenService.clear();
882
+ this.injector.get(WINDOW).location.href = `${this.config.baseUrl}/cas-proxy/app/logout`;
883
+ }
884
+ to(href) {
885
+ if (href) {
886
+ this.injector.get(WINDOW).open(href);
887
+ }
888
+ else {
889
+ this.msg.error('该菜单没有配置链接!');
890
+ }
891
+ }
892
+ }
893
+ YzHeaderUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$2.YunzaiConfigService }, { token: i2$1.CacheService }], target: i0.ɵɵFactoryTarget.Component });
894
+ YzHeaderUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderUserComponent, selector: "yz-header-user", ngImport: i0, template: `
895
+ <div
896
+ class="yunzai-default__nav-item d-flex align-items-center px-sm"
897
+ nz-dropdown
898
+ nzPlacement="bottomRight"
899
+ [nzDropdownMenu]="userMenu"
900
+ >
901
+ <nz-avatar [nzSrc]="icon" nzSize="small" class="mr-sm"></nz-avatar>
902
+ {{ username }}
903
+ </div>
904
+ <nz-dropdown-menu #userMenu="nzDropdownMenu">
905
+ <div nz-menu class="width-sm">
906
+ <div nz-menu-item *ngFor="let m of menus" (click)="to(m.url)">
907
+ <i nz-icon [nzType]="m.icon" class="mr-sm"></i>
908
+ {{ m.name | i18n }}
909
+ </div>
910
+ <li nz-menu-divider></li>
911
+ <div nz-menu-item (click)="logout()">
912
+ <i nz-icon nzType="logout" class="mr-sm"></i>
913
+ {{ 'menu.account.logout' | i18n }}
914
+ </div>
915
+ </div>
916
+ </nz-dropdown-menu>
917
+ `, isInline: true, components: [{ type: i4$3.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { type: i2$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }], directives: [{ type: i2$2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.ɵ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"] }, { type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { type: i6.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderUserComponent, decorators: [{
919
+ type: Component,
920
+ args: [{
921
+ selector: 'yz-header-user',
922
+ template: `
923
+ <div
924
+ class="yunzai-default__nav-item d-flex align-items-center px-sm"
925
+ nz-dropdown
926
+ nzPlacement="bottomRight"
927
+ [nzDropdownMenu]="userMenu"
928
+ >
929
+ <nz-avatar [nzSrc]="icon" nzSize="small" class="mr-sm"></nz-avatar>
930
+ {{ username }}
931
+ </div>
932
+ <nz-dropdown-menu #userMenu="nzDropdownMenu">
933
+ <div nz-menu class="width-sm">
934
+ <div nz-menu-item *ngFor="let m of menus" (click)="to(m.url)">
935
+ <i nz-icon [nzType]="m.icon" class="mr-sm"></i>
936
+ {{ m.name | i18n }}
937
+ </div>
938
+ <li nz-menu-divider></li>
939
+ <div nz-menu-item (click)="logout()">
940
+ <i nz-icon nzType="logout" class="mr-sm"></i>
941
+ {{ 'menu.account.logout' | i18n }}
942
+ </div>
943
+ </div>
944
+ </nz-dropdown-menu>
945
+ `,
946
+ changeDetection: ChangeDetectionStrategy.OnPush
947
+ }]
948
+ }], ctorParameters: function () {
949
+ return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: undefined, decorators: [{
950
+ type: Inject,
951
+ args: [YA_SERVICE_TOKEN]
952
+ }] }, { type: i1$2.YunzaiConfigService }, { type: i2$1.CacheService }];
953
+ } });
954
+
955
+ class YzHeaderClearStorageComponent {
956
+ constructor(modalSrv, messageSrv) {
957
+ this.modalSrv = modalSrv;
958
+ this.messageSrv = messageSrv;
959
+ }
960
+ _click() {
961
+ this.modalSrv.confirm({
962
+ nzTitle: 'Make sure clear all local storage?',
963
+ nzOnOk: () => {
964
+ localStorage.clear();
965
+ this.messageSrv.success('Clear Finished!');
966
+ }
967
+ });
968
+ }
969
+ }
970
+ YzHeaderClearStorageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderClearStorageComponent, deps: [{ token: i1$3.NzModalService }, { token: i1$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
971
+ YzHeaderClearStorageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderClearStorageComponent, selector: "yz-header-clear-storage", host: { listeners: { "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
972
+ <i nz-icon nzType="tool"></i>
973
+ {{ 'menu.clear.local.storage' | i18n }}
974
+ `, isInline: true, directives: [{ type: i8.ɵ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"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
975
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderClearStorageComponent, decorators: [{
976
+ type: Component,
977
+ args: [{
978
+ selector: 'yz-header-clear-storage',
979
+ template: `
980
+ <i nz-icon nzType="tool"></i>
981
+ {{ 'menu.clear.local.storage' | i18n }}
982
+ `,
983
+ host: {
984
+ '[class.d-block]': 'true'
985
+ },
986
+ changeDetection: ChangeDetectionStrategy.OnPush
987
+ }]
988
+ }], ctorParameters: function () { return [{ type: i1$3.NzModalService }, { type: i1$1.NzMessageService }]; }, propDecorators: { _click: [{
989
+ type: HostListener,
990
+ args: ['click']
991
+ }] } });
992
+
993
+ class YzHeaderFullScreenComponent {
994
+ constructor() {
995
+ this.status = false;
996
+ }
997
+ _resize() {
998
+ this.status = screenfull.isFullscreen;
999
+ }
1000
+ _click() {
1001
+ if (screenfull.isEnabled) {
1002
+ screenfull.toggle();
1003
+ }
1004
+ }
1005
+ }
1006
+ YzHeaderFullScreenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderFullScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1007
+ YzHeaderFullScreenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzHeaderFullScreenComponent, selector: "yz-header-fullscreen", host: { listeners: { "window:resize": "_resize()", "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
1008
+ <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
1009
+ {{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
1010
+ `, isInline: true, directives: [{ type: i8.ɵ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"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1011
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzHeaderFullScreenComponent, decorators: [{
1012
+ type: Component,
1013
+ args: [{
1014
+ selector: 'yz-header-fullscreen',
1015
+ template: `
1016
+ <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
1017
+ {{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
1018
+ `,
1019
+ host: {
1020
+ '[class.d-block]': 'true'
1021
+ },
1022
+ changeDetection: ChangeDetectionStrategy.OnPush
1023
+ }]
1024
+ }], propDecorators: { _resize: [{
1025
+ type: HostListener,
1026
+ args: ['window:resize']
1027
+ }], _click: [{
1028
+ type: HostListener,
1029
+ args: ['click']
1030
+ }] } });
1031
+
1032
+ class ContactService {
1033
+ constructor(http, cache) {
1034
+ this.http = http;
1035
+ this.cache = cache;
1036
+ }
1037
+ /**
1038
+ * 部门树查询
1039
+ *
1040
+ * @param clas 包含班级
1041
+ * @param his 包含历史班级
1042
+ * @param grade 系部
1043
+ * @param gradeID 系部ID
1044
+ * @returns 可观察部门树
1045
+ */
1046
+ dept(clas, his, grade, gradeID) {
1047
+ let baseUrl = `/auth/baseDepartMent/tree?debug=false`;
1048
+ if (clas) {
1049
+ baseUrl += `&includeClass=true`;
1050
+ }
1051
+ else {
1052
+ baseUrl += `&includeClass=false`;
1053
+ }
1054
+ if (his) {
1055
+ baseUrl += `&includeHisClass=true`;
1056
+ }
1057
+ else {
1058
+ baseUrl += `&includeHisClass=false`;
1059
+ }
1060
+ if (grade) {
1061
+ baseUrl += `&deptTypes=2,class`;
1062
+ }
1063
+ if (gradeID) {
1064
+ baseUrl += `&gradeId=${gradeID}`;
1065
+ }
1066
+ return this.http.get(baseUrl).pipe(map((response) => {
1067
+ return response.data || [];
1068
+ }));
1069
+ }
1070
+ page(uri, page) {
1071
+ return this.http.post(`${uri}/queryListForPage`, page);
1072
+ }
1073
+ pageBaseUser(page) {
1074
+ return this.page('/auth/baseUser', page);
1075
+ }
1076
+ getUserByIds(ids) {
1077
+ return this.http
1078
+ .post('/auth/baseUser/users', {
1079
+ userIds: ids
1080
+ })
1081
+ .pipe((response) => {
1082
+ return response.data || [];
1083
+ });
1084
+ }
1085
+ /**
1086
+ * 查询人员信息
1087
+ *
1088
+ * @param userIds[] 用户id数组,["aaa","bbb","ccc"]
1089
+ */
1090
+ getUserByUserIds(userIds) {
1091
+ return this.http
1092
+ .post(`/auth/baseUser/users`, {
1093
+ userIds: userIds
1094
+ })
1095
+ .pipe(map((response) => {
1096
+ return response.data ? response.data : [];
1097
+ }));
1098
+ }
1099
+ /**
1100
+ * 获取角色组角色
1101
+ *
1102
+ * @param roleGroupCode 角色组code
1103
+ */
1104
+ getGroupRole(roleGroupCode) {
1105
+ return this.http
1106
+ .post(`/auth/baseRole/findGroupRole`, {
1107
+ roleGroupCode: roleGroupCode
1108
+ })
1109
+ .pipe(map((response) => {
1110
+ return response.data ? response.data : [];
1111
+ }));
1112
+ }
1113
+ /**
1114
+ * 查询当前用户好友分组
1115
+ */
1116
+ getFriendGroup() {
1117
+ return this.http.post(`/contact/appcontact/findGroup`, {}).pipe(map((response) => {
1118
+ return response.data ? response.data : [];
1119
+ }));
1120
+ }
1121
+ /**
1122
+ * 查询年级
1123
+ */
1124
+ getGrade() {
1125
+ return this.http.get(`/auth/gradeYear/queryListForPage`).pipe(map((response) => {
1126
+ return response.data ? response.data : [];
1127
+ }));
1128
+ }
1129
+ /**
1130
+ * 查询人员类别列表
1131
+ */
1132
+ getRylbs() {
1133
+ return this.http.post(`/auth/baseTeacher/queryRylbs`, {}).pipe(map((response) => {
1134
+ return response.data ? response.data : [];
1135
+ }));
1136
+ }
1137
+ /**
1138
+ * 获取学生公寓树
1139
+ *
1140
+ * @param isPower 是否带有权限,默认false
1141
+ * @param treeType 树类型 0:宿舍楼 1:宿舍楼+层 2:宿舍楼+层+房间
1142
+ */
1143
+ getDormTree(isPower, treeType) {
1144
+ const user = this.cache.get('_yz_user', { mode: 'none' });
1145
+ let params = {};
1146
+ if (isPower) {
1147
+ params = {
1148
+ isPower: isPower,
1149
+ userId: user.userId,
1150
+ treeType: treeType
1151
+ };
1152
+ }
1153
+ else {
1154
+ params = {
1155
+ isPower: isPower,
1156
+ treeType: treeType
1157
+ };
1158
+ }
1159
+ return this.http.post(`/auth/dorm/tree`, params).pipe(map((response) => {
1160
+ return response.data ? response.data : [];
1161
+ }));
1162
+ }
1163
+ }
1164
+ ContactService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ContactService, deps: [{ token: i1._HttpClient }, { token: i2$1.CacheService }], target: i0.ɵɵFactoryTarget.Injectable });
1165
+ ContactService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ContactService, providedIn: 'root' });
1166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ContactService, decorators: [{
1167
+ type: Injectable,
1168
+ args: [{
1169
+ providedIn: 'root'
1170
+ }]
1171
+ }], ctorParameters: function () { return [{ type: i1._HttpClient }, { type: i2$1.CacheService }]; } });
1172
+
1173
+ class ContactComponent {
1174
+ constructor(contact, changeDetectorRef) {
1175
+ this.contact = contact;
1176
+ this.changeDetectorRef = changeDetectorRef;
1177
+ this.subs = [];
1178
+ /**
1179
+ * tabset
1180
+ */
1181
+ this.nzTabsetSearch = null;
1182
+ this.nzTabsetLoading = false;
1183
+ /**
1184
+ * 树展开状态
1185
+ */
1186
+ this.nzExpandAll = true;
1187
+ /**
1188
+ * 部门树和部门查询的一些选项/可传可不传
1189
+ */
1190
+ this.nzDepts = [];
1191
+ this._nzDeptsCopy = [];
1192
+ this.nzDeptTreeVirtualHeight = null;
1193
+ this.nzDeptClass = true;
1194
+ this.nzDeptClassHistory = true;
1195
+ this.nzDeptGrade = false;
1196
+ this.nzDeptGradeID = null;
1197
+ /**
1198
+ * 角色树
1199
+ */
1200
+ this.nzRoles = [];
1201
+ this._nzRolesCopy = [];
1202
+ this.nzRoleTreeVirtualHeight = null;
1203
+ /**
1204
+ * 好友分组
1205
+ */
1206
+ this.nzFriendGroups = [];
1207
+ this._nzFriendGroupsCopy = [];
1208
+ /**
1209
+ * 联系人
1210
+ */
1211
+ this.defaultContacts = [];
1212
+ this.nzContacts = [];
1213
+ this.nzContactLoading = false;
1214
+ /**
1215
+ * 提交和提交按钮
1216
+ */
1217
+ this.button = true;
1218
+ this.confirmed = new EventEmitter();
1219
+ }
1220
+ /**
1221
+ * 初始化,首先加载部门树和默认选中的人的数据
1222
+ */
1223
+ ngOnInit() {
1224
+ this.onTabsetDept();
1225
+ this.onContactsInit();
1226
+ }
1227
+ /**
1228
+ * 视图初始化完毕后进行table初始化
1229
+ */
1230
+ ngAfterViewInit() {
1231
+ this.onTableInit();
1232
+ }
1233
+ /**
1234
+ * 初始化默认选中联系人
1235
+ */
1236
+ onContactsInit() {
1237
+ if (this.defaultContacts && this.defaultContacts.length > 0) {
1238
+ this.nzContactLoading = true;
1239
+ this.subs.push(this.contact.getUserByUserIds(this.defaultContacts).subscribe(contacts => {
1240
+ this.nzContacts = contacts;
1241
+ this.nzContactLoading = false;
1242
+ this.refresh();
1243
+ }));
1244
+ }
1245
+ }
1246
+ /**
1247
+ * table初始化
1248
+ */
1249
+ onTableInit() {
1250
+ // 设置表头
1251
+ this.st.resetColumns({
1252
+ columns: [
1253
+ { title: '选择', type: 'checkbox' },
1254
+ { title: '序号', type: 'no' },
1255
+ { title: '姓名', index: 'realName' },
1256
+ { title: '学号/工号', index: 'userCode' },
1257
+ { title: '部门', index: 'dept.deptName' }
1258
+ ]
1259
+ });
1260
+ // 订阅table点击checkbox事件变化
1261
+ this.subs.push(this.st.change.subscribe(e => {
1262
+ if (e.type === 'checkbox') {
1263
+ // 点击checkbox新增联系人
1264
+ const contactIds = this.nzContacts.map(c => c.userId);
1265
+ this.nzContacts = this.nzContacts.concat(e.checkbox.filter(c => !contactIds.includes(c.userId)));
1266
+ // 取消checkbox取消联系人
1267
+ const cancelIds = this.st.list.filter(d => !d.checked).map(d => d.userId);
1268
+ this.nzContacts = this.nzContacts.filter(d => !cancelIds.includes(d.userId));
1269
+ }
1270
+ }));
1271
+ }
1272
+ /**
1273
+ * tabset进入加载状态
1274
+ */
1275
+ onTabsetLoadStart() {
1276
+ this.nzTabsetLoading = true;
1277
+ }
1278
+ /**
1279
+ * tabset取消加载状态
1280
+ */
1281
+ onTabsetLoadEnd() {
1282
+ this.nzTabsetLoading = false;
1283
+ }
1284
+ /**
1285
+ * tabset搜索框清除
1286
+ */
1287
+ onTabsetSearchClean() {
1288
+ this.nzDepts = this._nzDeptsCopy;
1289
+ this.nzRoles = this._nzRolesCopy;
1290
+ this.nzFriendGroups = this._nzFriendGroupsCopy;
1291
+ this.nzTabsetSearch = null;
1292
+ }
1293
+ /**
1294
+ * tabset搜索框输入
1295
+ *
1296
+ * @param type 类型
1297
+ * @param value 值
1298
+ */
1299
+ onTabsetSearchChange(type, value) {
1300
+ this.onTabsetLoadStart();
1301
+ if (!value || value === '') {
1302
+ this.nzDepts = this._nzDeptsCopy;
1303
+ this.nzRoles = this._nzRolesCopy;
1304
+ this.nzFriendGroups = this._nzFriendGroupsCopy;
1305
+ }
1306
+ else {
1307
+ const trees = [];
1308
+ if (type === 'dept') {
1309
+ this.searchTree(value, this._nzDeptsCopy, trees);
1310
+ this.nzDepts = trees;
1311
+ }
1312
+ if (type === 'role') {
1313
+ this.searchTree(value, this._nzRolesCopy, trees);
1314
+ this.nzRoles = trees;
1315
+ }
1316
+ if (type === 'friendGroup') {
1317
+ this.nzFriendGroups = this._nzFriendGroupsCopy.filter(f => {
1318
+ return !f.name.indexOf(value);
1319
+ });
1320
+ }
1321
+ }
1322
+ this.onTabsetLoadEnd();
1323
+ this.refresh();
1324
+ }
1325
+ /**
1326
+ * tabset切换到部门
1327
+ */
1328
+ onTabsetDept() {
1329
+ this.onTabsetSearchClean();
1330
+ if (!this.nzDepts || this.nzDepts.length === 0) {
1331
+ this.onTabsetDeptFlush();
1332
+ }
1333
+ }
1334
+ /**
1335
+ * tabset切换到角色
1336
+ */
1337
+ onTabsetRole() {
1338
+ this.onTabsetSearchClean();
1339
+ if (!this.nzRoles || this.nzRoles.length === 0) {
1340
+ this.onTabsetRoleFlush(null);
1341
+ }
1342
+ }
1343
+ /**
1344
+ * tabset切换到好友分组
1345
+ */
1346
+ onTabsetFriendGroup() {
1347
+ this.onTabsetSearchClean();
1348
+ if (!this.nzFriendGroups || this.nzFriendGroups.length === 0) {
1349
+ this.onTabsetFriendGroupFlush();
1350
+ }
1351
+ }
1352
+ /**
1353
+ * 获取部门树
1354
+ */
1355
+ onTabsetDeptFlush() {
1356
+ this.onTabsetLoadStart();
1357
+ this.subs.push(this.contact
1358
+ .dept(this.nzDeptClass, this.nzDeptClassHistory, this.nzDeptGrade, this.nzDeptGradeID)
1359
+ .subscribe((trees) => {
1360
+ this.expandTree(trees);
1361
+ this.nzDepts = trees;
1362
+ this._nzDeptsCopy = trees;
1363
+ this.onTabsetLoadEnd();
1364
+ this.refresh();
1365
+ }));
1366
+ }
1367
+ // 获取角色树
1368
+ onTabsetRoleFlush(groupRoleCode) {
1369
+ this.onTabsetLoadStart();
1370
+ this.subs.push(this.contact.getGroupRole(groupRoleCode).subscribe((roles) => {
1371
+ this.expandTree(roles);
1372
+ this.nzRoles = roles;
1373
+ this._nzRolesCopy = roles;
1374
+ this.onTabsetLoadEnd();
1375
+ this.refresh();
1376
+ }));
1377
+ }
1378
+ // 获取好友分组列表
1379
+ onTabsetFriendGroupFlush() {
1380
+ this.onTabsetLoadStart();
1381
+ this.subs.push(this.contact.getFriendGroup().subscribe((group) => {
1382
+ this.nzFriendGroups = group;
1383
+ this._nzFriendGroupsCopy = group;
1384
+ this.onTabsetLoadEnd();
1385
+ this.refresh();
1386
+ }));
1387
+ }
1388
+ /**
1389
+ * 部门树点击
1390
+ *
1391
+ * @param e 节点
1392
+ */
1393
+ onDeptClick(e) {
1394
+ var _a;
1395
+ // 构造分页请求,直接传入stTable组件,剩下的所有交给组件自己完成
1396
+ this.st.data = '/auth/baseUser/queryListForPage';
1397
+ this.st.req = {
1398
+ allInBody: true,
1399
+ method: 'POST',
1400
+ type: 'page',
1401
+ reName: {
1402
+ pi: 'pageNum',
1403
+ ps: 'pageSize'
1404
+ },
1405
+ body: {
1406
+ pageParam: {
1407
+ deptId: (_a = e.keys) === null || _a === void 0 ? void 0 : _a.pop()
1408
+ }
1409
+ }
1410
+ };
1411
+ // table数据预处理
1412
+ this.st.res = {
1413
+ process: data => {
1414
+ this.onTableCheck(data);
1415
+ return data;
1416
+ }
1417
+ };
1418
+ // 加载第一页
1419
+ this.st.load(1);
1420
+ }
1421
+ /**
1422
+ * 角色树点击
1423
+ *
1424
+ * @param e 节点
1425
+ */
1426
+ onRoleClick(e) {
1427
+ var _a;
1428
+ // 构造分页请求,直接传入stTable组件,剩下的所有交给组件自己完成
1429
+ this.st.data = '/auth/baseUser/queryListForPage';
1430
+ this.st.req = {
1431
+ allInBody: true,
1432
+ method: 'POST',
1433
+ type: 'page',
1434
+ reName: {
1435
+ pi: 'pageNum',
1436
+ ps: 'pageSize'
1437
+ },
1438
+ body: {
1439
+ pageParam: {
1440
+ roleId: (_a = e.keys) === null || _a === void 0 ? void 0 : _a.pop()
1441
+ }
1442
+ }
1443
+ };
1444
+ // table数据预处理
1445
+ this.st.res = {
1446
+ process: data => {
1447
+ this.onTableCheck(data);
1448
+ return data;
1449
+ }
1450
+ };
1451
+ // 加载第一页
1452
+ this.st.load(1);
1453
+ }
1454
+ /**
1455
+ * 好友分组点击
1456
+ *
1457
+ * @param e 分组
1458
+ */
1459
+ onFriendGroupClick(e) {
1460
+ // 构造分页请求,直接传入stTable组件,剩下的所有交给组件自己完成
1461
+ this.st.data = '/auth/baseUser/queryListForPage';
1462
+ this.st.req = {
1463
+ allInBody: true,
1464
+ method: 'POST',
1465
+ type: 'page',
1466
+ reName: {
1467
+ pi: 'pageNum',
1468
+ ps: 'pageSize'
1469
+ },
1470
+ body: {
1471
+ pageParam: {
1472
+ friendGroupId: e.id
1473
+ }
1474
+ }
1475
+ };
1476
+ // table数据预处理
1477
+ this.st.res = {
1478
+ process: data => {
1479
+ this.onTableCheck(data);
1480
+ return data;
1481
+ }
1482
+ };
1483
+ // 加载第一页
1484
+ this.st.load(1);
1485
+ }
1486
+ /**
1487
+ * 点击右侧联系人进行删除
1488
+ *
1489
+ * @param c 点击的联系人
1490
+ */
1491
+ onContactRemove(c) {
1492
+ this.nzContacts = this.nzContacts.filter(contact => {
1493
+ return contact.userId != c.userId;
1494
+ });
1495
+ this.st.reload();
1496
+ }
1497
+ /**
1498
+ * 预处理table当前页数据,和nzContat对比,确定checkbox状态
1499
+ *
1500
+ * @param data 预处理数据
1501
+ */
1502
+ onTableCheck(data) {
1503
+ const ids = this.nzContacts.map(u => u.userId);
1504
+ data.forEach(d => {
1505
+ if (ids.includes(d.userId)) {
1506
+ d.checked = true;
1507
+ }
1508
+ else {
1509
+ d.checked = false;
1510
+ }
1511
+ });
1512
+ }
1513
+ /**
1514
+ * 递归树寻找name相同节点
1515
+ *
1516
+ * @param name 名称
1517
+ * @param trees 需要递归的树
1518
+ * @param list 搜索结果
1519
+ */
1520
+ searchTree(name, trees, list) {
1521
+ if (trees && trees.length && trees.length > 0) {
1522
+ trees.forEach((tree) => {
1523
+ if (tree.title.indexOf(name) != -1) {
1524
+ list.push(tree);
1525
+ }
1526
+ if (tree.children) {
1527
+ this.searchTree(name, tree.children, list);
1528
+ }
1529
+ });
1530
+ }
1531
+ }
1532
+ /**
1533
+ * 递归树展开所有有子节点的节点
1534
+ *
1535
+ * @param trees 需要展开的树
1536
+ */
1537
+ expandTree(trees) {
1538
+ if (trees && trees.length && trees.length > 0) {
1539
+ trees.forEach(tree => {
1540
+ if (!tree.children || tree.children.length === 0) {
1541
+ tree.expanded = false;
1542
+ tree.isLeaf = true;
1543
+ }
1544
+ if (tree.children) {
1545
+ tree.expanded = this.nzExpandAll;
1546
+ tree.isLeaf = false;
1547
+ this.expandTree(tree.children);
1548
+ }
1549
+ });
1550
+ }
1551
+ }
1552
+ /**
1553
+ * 刷新当前页面
1554
+ */
1555
+ refresh() {
1556
+ this.changeDetectorRef.detectChanges();
1557
+ }
1558
+ /**
1559
+ * 确认按钮output数据
1560
+ */
1561
+ confirm() {
1562
+ this.confirmed.next(this.nzContacts);
1563
+ }
1564
+ /**
1565
+ * 销毁函数
1566
+ */
1567
+ ngOnDestroy() {
1568
+ this.nzDepts = [];
1569
+ this.nzRoles = [];
1570
+ this.nzContacts = [];
1571
+ this.subs.forEach(s => s.unsubscribe());
1572
+ }
1573
+ }
1574
+ ContactComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ContactComponent, deps: [{ token: ContactService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1575
+ ContactComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ContactComponent, selector: "contact", inputs: { nzTabsetSearch: "nzTabsetSearch", nzTabsetLoading: "nzTabsetLoading", nzExpandAll: "nzExpandAll", nzDepts: "nzDepts", nzDeptTreeVirtualHeight: "nzDeptTreeVirtualHeight", nzDeptClass: "nzDeptClass", nzDeptClassHistory: "nzDeptClassHistory", nzDeptGrade: "nzDeptGrade", nzDeptGradeID: "nzDeptGradeID", nzRoles: "nzRoles", nzRoleTreeVirtualHeight: "nzRoleTreeVirtualHeight", nzFriendGroups: "nzFriendGroups", defaultContacts: "defaultContacts", nzContacts: "nzContacts", nzContactLoading: "nzContactLoading", button: "button" }, outputs: { confirmed: "confirmed" }, viewQueries: [{ propertyName: "st", first: true, predicate: ["st"], descendants: true }], ngImport: i0, template: "<nz-row [nzGutter]=\"16\">\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"8\" [nzXl]=\"6\" [nzXXl]=\"6\">\n <nz-tabset nzCentered>\n <nz-tab nzTitle=\"\u90E8\u95E8\" (nzSelect)=\"onTabsetDept()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('dept', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-tree\n class=\"nz-tabset-content\"\n (nzClick)=\"onDeptClick($event)\"\n [nzBlockNode]=\"true\"\n [nzShowLine]=\"true\"\n [nzHideUnMatched]=\"true\"\n [nzVirtualHeight]=\"nzDeptTreeVirtualHeight\"\n [nzData]=\"nzDepts\"\n ></nz-tree>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n <nz-tab nzTitle=\"\u89D2\u8272\" (nzSelect)=\"onTabsetRole()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('role', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-tree\n class=\"nz-tabset-content\"\n (nzClick)=\"onRoleClick($event)\"\n [nzBlockNode]=\"true\"\n [nzShowLine]=\"true\"\n [nzHideUnMatched]=\"true\"\n [nzVirtualHeight]=\"nzRoleTreeVirtualHeight\"\n [nzData]=\"nzRoles\"\n ></nz-tree>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n <nz-tab nzTitle=\"\u597D\u53CB\" (nzSelect)=\"onTabsetFriendGroup()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('friendGroup', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u597D\u53CB\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-list class=\"nz-tabset-content\" nzItemLayout=\"horizontal\" [nzSplit]=\"false\" nzSize=\"small\">\n <nz-list-item\n class=\"nz-tabset-content-item\"\n *ngFor=\"let group of nzFriendGroups\"\n (click)=\"onFriendGroupClick(group)\"\n >\n <nz-list-item-meta>\n <nz-list-item-meta-title>\n {{ group.name }}\n </nz-list-item-meta-title>\n </nz-list-item-meta>\n </nz-list-item>\n </nz-list>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n </nz-tabset>\n </nz-col>\n\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"16\" [nzXl]=\"13\" [nzXXl]=\"13\">\n <st #st responsiveHideHeaderFooter></st>\n </nz-col>\n\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"24\" [nzXl]=\"5\" [nzXXl]=\"5\">\n <nz-spin [nzSpinning]=\"nzContactLoading\">\n <nz-list nzItemLayout=\"horizontal\" [nzSplit]=\"false\" nzSize=\"small\">\n <nz-list-item\n class=\"nz-tabset-content-item\"\n *ngFor=\"let contact of nzContacts\"\n (click)=\"onContactRemove(contact)\"\n >\n <nz-list-item-meta>\n <nz-list-item-meta-title>\n {{ contact.realName }}\n </nz-list-item-meta-title>\n </nz-list-item-meta>\n </nz-list-item>\n </nz-list>\n </nz-spin>\n </nz-col>\n</nz-row>\n\n<nz-row *ngIf=\"button\">\n <nz-col [nzSpan]=\"4\" [nzOffset]=\"20\">\n <button nz-button nzType=\"primary\" (click)=\"confirm()\">\u786E\u5B9A</button>\n </nz-col>\n</nz-row>\n\n<ng-template #searchInputTpl>\n <i nz-icon nzType=\"close\" nzTheme=\"outline\" *ngIf=\"nzTabsetSearch\" (click)=\"onTabsetSearchClean()\"></i>\n <i nz-icon nzType=\"search\" nzTheme=\"outline\" *ngIf=\"!nzTabsetSearch\"></i>\n</ng-template>\n", styles: [".nz-tabset-input{width:100%}.nz-tabset-content{padding:20px}.nz-tabset-sg{padding-right:38px!important;padding-left:38px!important}.nz-tabset-content-item:hover{background-color:#f1f1f1;cursor:pointer}\n"], components: [{ type: i2$3.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"] }, { type: i2$3.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { type: i3$2.SGContainerComponent, selector: "sg-container, [sg-container]", inputs: ["gutter", "sg-container", "col"], exportAs: ["sgContainer"] }, { type: i3$2.SGComponent, selector: "sg", inputs: ["col"], exportAs: ["sg"] }, { type: i4$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { type: i5$2.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }, { type: i6$1.NzTreeComponent, selector: "nz-tree", inputs: ["nzShowIcon", "nzHideUnMatched", "nzBlockNode", "nzExpandAll", "nzSelectMode", "nzCheckStrictly", "nzShowExpand", "nzShowLine", "nzCheckable", "nzAsyncData", "nzDraggable", "nzMultiple", "nzExpandedIcon", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzTreeTemplate", "nzBeforeDrop", "nzData", "nzExpandedKeys", "nzSelectedKeys", "nzCheckedKeys", "nzSearchValue", "nzSearchFunc"], outputs: ["nzExpandedKeysChange", "nzSelectedKeysChange", "nzCheckedKeysChange", "nzSearchValueChange", "nzClick", "nzDblClick", "nzContextMenu", "nzCheckBoxChange", "nzExpandChange", "nzOnDragStart", "nzOnDragEnter", "nzOnDragOver", "nzOnDragLeave", "nzOnDrop", "nzOnDragEnd"], exportAs: ["nzTree"] }, { type: i7$1.NzListComponent, selector: "nz-list, [nz-list]", inputs: ["nzDataSource", "nzBordered", "nzGrid", "nzHeader", "nzFooter", "nzItemLayout", "nzRenderItem", "nzLoading", "nzLoadMore", "nzPagination", "nzSize", "nzSplit", "nzNoResult"], exportAs: ["nzList"] }, { type: i7$1.NzListItemComponent, selector: "nz-list-item, [nz-list-item]", inputs: ["nzActions", "nzContent", "nzExtra", "nzNoFlex"], exportAs: ["nzListItem"] }, { type: i7$1.NzListItemMetaComponent, selector: "nz-list-item-meta, [nz-list-item-meta]", inputs: ["nzAvatar", "nzTitle", "nzDescription"], exportAs: ["nzListItemMeta"] }, { type: i7$1.NzListItemMetaTitleComponent, selector: "nz-list-item-meta-title", exportAs: ["nzListItemMetaTitle"] }, { type: i8$1.STComponent, selector: "st", inputs: ["req", "res", "page", "data", "columns", "contextmenu", "ps", "pi", "total", "loading", "loadingDelay", "loadingIndicator", "bordered", "size", "scroll", "singleSort", "multiSort", "rowClassName", "clickRowClassName", "widthMode", "widthConfig", "resizable", "header", "showHeader", "footer", "bodyHeader", "body", "expandRowByClick", "expandAccordion", "expand", "noResult", "responsive", "responsiveHideHeaderFooter", "virtualScroll", "virtualItemSize", "virtualMaxBufferPx", "virtualMinBufferPx", "customRequest", "virtualForTrackBy"], outputs: ["error", "change"], exportAs: ["st"] }, { type: i9$2.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }], directives: [{ type: i5.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { type: i5.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"] }, { type: i8.ɵ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"] }, { type: i4$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "disabled"], exportAs: ["nzInput"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i14.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }] });
1576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ContactComponent, decorators: [{
1577
+ type: Component,
1578
+ args: [{ selector: 'contact', template: "<nz-row [nzGutter]=\"16\">\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"8\" [nzXl]=\"6\" [nzXXl]=\"6\">\n <nz-tabset nzCentered>\n <nz-tab nzTitle=\"\u90E8\u95E8\" (nzSelect)=\"onTabsetDept()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('dept', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-tree\n class=\"nz-tabset-content\"\n (nzClick)=\"onDeptClick($event)\"\n [nzBlockNode]=\"true\"\n [nzShowLine]=\"true\"\n [nzHideUnMatched]=\"true\"\n [nzVirtualHeight]=\"nzDeptTreeVirtualHeight\"\n [nzData]=\"nzDepts\"\n ></nz-tree>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n <nz-tab nzTitle=\"\u89D2\u8272\" (nzSelect)=\"onTabsetRole()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('role', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-tree\n class=\"nz-tabset-content\"\n (nzClick)=\"onRoleClick($event)\"\n [nzBlockNode]=\"true\"\n [nzShowLine]=\"true\"\n [nzHideUnMatched]=\"true\"\n [nzVirtualHeight]=\"nzRoleTreeVirtualHeight\"\n [nzData]=\"nzRoles\"\n ></nz-tree>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n <nz-tab nzTitle=\"\u597D\u53CB\" (nzSelect)=\"onTabsetFriendGroup()\">\n <div sg-container=\"2\">\n <sg col=\"1\" class=\"nz-tabset-sg\">\n <nz-input-group class=\"nz-tabset-input\" [nzSuffix]=\"searchInputTpl\">\n <input\n nz-input\n [(ngModel)]=\"nzTabsetSearch\"\n (ngModelChange)=\"onTabsetSearchChange('friendGroup', $event)\"\n type=\"text\"\n placeholder=\"\u8BF7\u8F93\u5165\u597D\u53CB\u540D\u79F0\"\n />\n </nz-input-group>\n </sg>\n <sg col=\"1\">\n <nz-spin [nzSpinning]=\"nzTabsetLoading\">\n <nz-list class=\"nz-tabset-content\" nzItemLayout=\"horizontal\" [nzSplit]=\"false\" nzSize=\"small\">\n <nz-list-item\n class=\"nz-tabset-content-item\"\n *ngFor=\"let group of nzFriendGroups\"\n (click)=\"onFriendGroupClick(group)\"\n >\n <nz-list-item-meta>\n <nz-list-item-meta-title>\n {{ group.name }}\n </nz-list-item-meta-title>\n </nz-list-item-meta>\n </nz-list-item>\n </nz-list>\n </nz-spin>\n </sg>\n </div>\n </nz-tab>\n </nz-tabset>\n </nz-col>\n\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"16\" [nzXl]=\"13\" [nzXXl]=\"13\">\n <st #st responsiveHideHeaderFooter></st>\n </nz-col>\n\n <nz-col [nzXs]=\"24\" [nzSm]=\"24\" [nzMd]=\"24\" [nzLg]=\"24\" [nzXl]=\"5\" [nzXXl]=\"5\">\n <nz-spin [nzSpinning]=\"nzContactLoading\">\n <nz-list nzItemLayout=\"horizontal\" [nzSplit]=\"false\" nzSize=\"small\">\n <nz-list-item\n class=\"nz-tabset-content-item\"\n *ngFor=\"let contact of nzContacts\"\n (click)=\"onContactRemove(contact)\"\n >\n <nz-list-item-meta>\n <nz-list-item-meta-title>\n {{ contact.realName }}\n </nz-list-item-meta-title>\n </nz-list-item-meta>\n </nz-list-item>\n </nz-list>\n </nz-spin>\n </nz-col>\n</nz-row>\n\n<nz-row *ngIf=\"button\">\n <nz-col [nzSpan]=\"4\" [nzOffset]=\"20\">\n <button nz-button nzType=\"primary\" (click)=\"confirm()\">\u786E\u5B9A</button>\n </nz-col>\n</nz-row>\n\n<ng-template #searchInputTpl>\n <i nz-icon nzType=\"close\" nzTheme=\"outline\" *ngIf=\"nzTabsetSearch\" (click)=\"onTabsetSearchClean()\"></i>\n <i nz-icon nzType=\"search\" nzTheme=\"outline\" *ngIf=\"!nzTabsetSearch\"></i>\n</ng-template>\n", styles: [".nz-tabset-input{width:100%}.nz-tabset-content{padding:20px}.nz-tabset-sg{padding-right:38px!important;padding-left:38px!important}.nz-tabset-content-item:hover{background-color:#f1f1f1;cursor:pointer}\n"] }]
1579
+ }], ctorParameters: function () { return [{ type: ContactService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { nzTabsetSearch: [{
1580
+ type: Optional
1581
+ }, {
1582
+ type: Input
1583
+ }], nzTabsetLoading: [{
1584
+ type: Optional
1585
+ }, {
1586
+ type: Input
1587
+ }], nzExpandAll: [{
1588
+ type: Optional
1589
+ }, {
1590
+ type: Input
1591
+ }], nzDepts: [{
1592
+ type: Optional
1593
+ }, {
1594
+ type: Input
1595
+ }], nzDeptTreeVirtualHeight: [{
1596
+ type: Optional
1597
+ }, {
1598
+ type: Input
1599
+ }], nzDeptClass: [{
1600
+ type: Optional
1601
+ }, {
1602
+ type: Input
1603
+ }], nzDeptClassHistory: [{
1604
+ type: Optional
1605
+ }, {
1606
+ type: Input
1607
+ }], nzDeptGrade: [{
1608
+ type: Optional
1609
+ }, {
1610
+ type: Input
1611
+ }], nzDeptGradeID: [{
1612
+ type: Optional
1613
+ }, {
1614
+ type: Input
1615
+ }], nzRoles: [{
1616
+ type: Optional
1617
+ }, {
1618
+ type: Input
1619
+ }], nzRoleTreeVirtualHeight: [{
1620
+ type: Optional
1621
+ }, {
1622
+ type: Input
1623
+ }], nzFriendGroups: [{
1624
+ type: Optional
1625
+ }, {
1626
+ type: Input
1627
+ }], st: [{
1628
+ type: ViewChild,
1629
+ args: ['st', { static: false }]
1630
+ }], defaultContacts: [{
1631
+ type: Optional
1632
+ }, {
1633
+ type: Input
1634
+ }], nzContacts: [{
1635
+ type: Optional
1636
+ }, {
1637
+ type: Input
1638
+ }], nzContactLoading: [{
1639
+ type: Optional
1640
+ }, {
1641
+ type: Input
1642
+ }], button: [{
1643
+ type: Optional
1644
+ }, {
1645
+ type: Input
1646
+ }], confirmed: [{
1647
+ type: Output
1648
+ }] } });
1649
+
1650
+ const STOMP_DEFAULT_CONFIG = {
1651
+ connectHeaders: {
1652
+ login: 'guest',
1653
+ passcode: 'guest'
1654
+ },
1655
+ brokerURL: '/websocket/ws/',
1656
+ heartbeatIncoming: 1000 * 60,
1657
+ heartbeatOutgoing: 1000 * 60,
1658
+ reconnectDelay: 30000000,
1659
+ debug: msg => {
1660
+ log$1(msg);
1661
+ }
1662
+ };
1663
+ function mergeStompConfig(srv) {
1664
+ return srv.merge('stomp', STOMP_DEFAULT_CONFIG);
1665
+ }
1666
+
1667
+ class YzStompService {
1668
+ constructor(csr, cache, injector, notification) {
1669
+ this.csr = csr;
1670
+ this.cache = cache;
1671
+ this.injector = injector;
1672
+ this.notification = notification;
1673
+ this.config = null;
1674
+ this.bisConfig = null;
1675
+ this.rxStomp = null;
1676
+ this.subs = [];
1677
+ if (!this.user) {
1678
+ this.user = this.cache.get('_yz_user', { mode: 'none' });
1679
+ }
1680
+ if (!this.config) {
1681
+ this.config = mergeStompConfig(this.csr);
1682
+ }
1683
+ if (!this.bisConfig) {
1684
+ this.bisConfig = mergeBisConfig(csr);
1685
+ }
1686
+ if (!this.rxStomp) {
1687
+ this.rxStomp = new RxStomp();
1688
+ if (isDevMode()) {
1689
+ log$1('yz.stomp.service: is dev mode');
1690
+ log$1('yz.stomp.service: ', `config is ${JSON.stringify(this.config)}`);
1691
+ this.rxStomp.configure(this.config);
1692
+ return;
1693
+ }
1694
+ const { location } = this.injector.get(DOCUMENT);
1695
+ const { protocol, host } = location;
1696
+ log$1('yz.stomp.service: ', `protocol is ${protocol},host is ${host}`);
1697
+ if (protocol.includes('http') && !protocol.includes('https')) {
1698
+ this.config.brokerURL = `ws://${host}${this.config.brokerURL}`;
1699
+ }
1700
+ if (protocol.includes('https')) {
1701
+ this.config.brokerURL = `wss://${host}${this.config.brokerURL}`;
1702
+ }
1703
+ log$1('yz.stomp.service: ', `config is ${this.config}`);
1704
+ this.rxStomp.configure(this.config);
1705
+ }
1706
+ }
1707
+ listen() {
1708
+ this.subs.push(this.rxStomp.watch(`/topic/layout_${this.user.username}`).subscribe(message => {
1709
+ this.createNotification(JSON.parse(message.body));
1710
+ }));
1711
+ this.subs.push(this.rxStomp.watch(`/topic/layout_xx_${this.user.username}`).subscribe((message) => {
1712
+ this.logoutNotification(JSON.parse(message.body));
1713
+ }));
1714
+ this.rxStomp.activate();
1715
+ }
1716
+ createNotification(message) {
1717
+ this.notification.create(message.type, message.title, `<a href=${message.href}>${message.content}</a>`);
1718
+ }
1719
+ logoutNotification(message) {
1720
+ this.notification.create(message.type, message.title, `${message.content},剩余时间5秒`);
1721
+ setTimeout(() => {
1722
+ this.cache.clear();
1723
+ localStorage.clear();
1724
+ this.injector.get(WINDOW).location.href = `${this.bisConfig.baseUrl}/cas-proxy/app/logout`;
1725
+ }, 5000);
1726
+ }
1727
+ unListen() {
1728
+ this.subs.forEach(s => s.unsubscribe());
1729
+ this.rxStomp.deactivate().then();
1730
+ }
1731
+ publish(parameters) {
1732
+ this.rxStomp.publish(parameters);
1733
+ }
1734
+ watch(destination, headers) {
1735
+ return this.rxStomp.watch(destination, headers);
1736
+ }
1737
+ }
1738
+ YzStompService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStompService, deps: [{ token: i1$2.YunzaiConfigService }, { token: i2$1.CacheService }, { token: i0.Injector }, { token: i3$3.NzNotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
1739
+ YzStompService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStompService, providedIn: 'root' });
1740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStompService, decorators: [{
1741
+ type: Injectable,
1742
+ args: [{ providedIn: 'root' }]
1743
+ }], ctorParameters: function () { return [{ type: i1$2.YunzaiConfigService }, { type: i2$1.CacheService }, { type: i0.Injector }, { type: i3$3.NzNotificationService }]; } });
1744
+
1745
+ class YzLayoutBasicComponent {
1746
+ constructor(cacheService, yzStompService, layoutService) {
1747
+ this.cacheService = cacheService;
1748
+ this.yzStompService = yzStompService;
1749
+ this.layoutService = layoutService;
1750
+ this.options = {
1751
+ logoExpanded: `./assets/logo-full.svg`,
1752
+ logoCollapsed: `./assets/logo.svg`
1753
+ };
1754
+ this.intro = '';
1755
+ this.text = '';
1756
+ this.icon = '';
1757
+ this.showReuseTab = true;
1758
+ this.showHeader = true;
1759
+ this.showSider = true;
1760
+ }
1761
+ get reuseStyleSheet() {
1762
+ let cascadingStyleSheet = {};
1763
+ if (!this.showHeader) {
1764
+ cascadingStyleSheet = Object.assign(Object.assign({}, cascadingStyleSheet), { top: 0 });
1765
+ }
1766
+ if (!this.showSider) {
1767
+ cascadingStyleSheet = Object.assign(Object.assign({}, cascadingStyleSheet), { left: '24px' });
1768
+ }
1769
+ return cascadingStyleSheet;
1770
+ }
1771
+ ngOnInit() {
1772
+ const current = this.cacheService.get('_yz_current', { mode: 'none' });
1773
+ const project = this.cacheService.get('_yz_project_info', { mode: 'none' });
1774
+ this.text = current.text ? current.text : '应用名称';
1775
+ this.intro = current.intro ? current.intro : '应用描述';
1776
+ this.icon = current.icon ? current.icon : `./assets/tmp/img/avatar.jpg`;
1777
+ this.options.logoExpanded = project.maxLogoUrl ? project.maxLogoUrl : `./assets/logo-full.svg`;
1778
+ this.options.logoCollapsed = project.miniLogoUrl ? project.miniLogoUrl : `./assets/logo.svg`;
1779
+ this.yzStompService.listen();
1780
+ this.layoutService.reuseTab.asObservable().subscribe(show => (this.showReuseTab = show));
1781
+ this.layoutService.header.asObservable().subscribe(show => (this.showHeader = show));
1782
+ this.layoutService.sidebar.asObservable().subscribe(show => (this.showSider = show));
1783
+ }
1784
+ ngOnDestroy() {
1785
+ this.yzStompService.unListen();
1786
+ }
1787
+ }
1788
+ YzLayoutBasicComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzLayoutBasicComponent, deps: [{ token: i2$1.CacheService }, { token: YzStompService }, { token: i3$4.LayoutService }], target: i0.ɵɵFactoryTarget.Component });
1789
+ YzLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: YzLayoutBasicComponent, selector: "yz-layout-basic", ngImport: i0, template: `
1790
+ <layout-default [options]="options" [asideUser]="asideUserTpl" [content]="showReuseTab ? contentTpl : noneTpl">
1791
+ <layout-default-header-item direction="left">
1792
+ <yz-header-application></yz-header-application>
1793
+ </layout-default-header-item>
1794
+
1795
+ <layout-default-header-item direction="right" hidden="mobile">
1796
+ <yz-header-notify></yz-header-notify>
1797
+ </layout-default-header-item>
1798
+
1799
+ <layout-default-header-item direction="right" hidden="mobile">
1800
+ <yz-header-theme-btn></yz-header-theme-btn>
1801
+ </layout-default-header-item>
1802
+
1803
+ <layout-default-header-item direction="right" hidden="mobile">
1804
+ <div
1805
+ layout-default-header-item-trigger
1806
+ nz-dropdown
1807
+ [nzDropdownMenu]="settingsMenu"
1808
+ nzTrigger="click"
1809
+ nzPlacement="bottomRight"
1810
+ >
1811
+ <i nz-icon nzType="setting"></i>
1812
+ </div>
1813
+ <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1814
+ <div nz-menu style="width: 200px;">
1815
+ <div nz-menu-item>
1816
+ <yz-header-fullscreen></yz-header-fullscreen>
1817
+ </div>
1818
+ <div nz-menu-item>
1819
+ <yz-header-clear-storage></yz-header-clear-storage>
1820
+ </div>
1821
+ <div nz-menu-item>
1822
+ <yz-header-i18n></yz-header-i18n>
1823
+ </div>
1824
+ </div>
1825
+ </nz-dropdown-menu>
1826
+ </layout-default-header-item>
1827
+ <layout-default-header-item direction="right">
1828
+ <yz-header-user></yz-header-user>
1829
+ </layout-default-header-item>
1830
+ <ng-template #asideUserTpl>
1831
+ <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1832
+ <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="icon"></nz-avatar>
1833
+ <div class="yunzai-default__aside-user-info">
1834
+ <strong>{{ text }}</strong>
1835
+ <p class="mb0">{{ intro }}</p>
1836
+ </div>
1837
+ </div>
1838
+ <nz-dropdown-menu #userMenu="nzDropdownMenu">
1839
+ <ul nz-menu>
1840
+ <li nz-menu-item routerLink="/">{{ 'menu.backtohome' | i18n }}</li>
1841
+ </ul>
1842
+ </nz-dropdown-menu>
1843
+ </ng-template>
1844
+ <ng-template #contentTpl>
1845
+ <reuse-tab #reuseTab [ngStyle]="reuseStyleSheet"></reuse-tab>
1846
+ <router-outlet (activate)="reuseTab.activate($event)"></router-outlet>
1847
+ </ng-template>
1848
+ <ng-template #noneTpl>
1849
+ <router-outlet></router-outlet>
1850
+ </ng-template>
1851
+ </layout-default>
1852
+ `, isInline: true, components: [{ type: i3$4.LayoutDefaultComponent, selector: "layout-default", inputs: ["options", "asideUser", "nav", "content", "customError"], exportAs: ["layoutDefault"] }, { type: i3$4.LayoutDefaultHeaderItemComponent, selector: "layout-default-header-item", inputs: ["hidden", "direction"] }, { type: YzHeaderApplicationComponent, selector: "yz-header-application" }, { type: YzHeaderNotifyComponent, selector: "yz-header-notify" }, { type: YzHeaderThemBtnComponent, selector: "yz-header-theme-btn", inputs: ["types", "devTips", "deployUrl"] }, { type: i2$2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { type: YzHeaderFullScreenComponent, selector: "yz-header-fullscreen" }, { type: YzHeaderClearStorageComponent, selector: "yz-header-clear-storage" }, { type: YzHeaderI18NComponent, selector: "yz-header-i18n", inputs: ["showLangText"] }, { type: YzHeaderUserComponent, selector: "yz-header-user" }, { type: i4$3.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { type: i13.ReuseTabComponent, selector: "reuse-tab, [reuse-tab]", inputs: ["mode", "i18n", "debug", "max", "tabMaxWidth", "excludes", "allowClose", "keepingScroll", "keepingScrollContainer", "customContextMenu", "tabBarExtraContent", "tabBarGutter", "tabBarStyle", "tabType", "routeParamMatchMode", "disabled", "titleRender"], outputs: ["change", "close"], exportAs: ["reuseTab"] }], directives: [{ type: i3$4.LayoutDefaultHeaderItemTriggerDirective, selector: "[layout-default-header-item-trigger]" }, { type: i2$2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i8.ɵ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"] }, { type: i9.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { type: i17.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i17.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "i18n": i1.I18nPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzLayoutBasicComponent, decorators: [{
1854
+ type: Component,
1855
+ args: [{
1856
+ selector: 'yz-layout-basic',
1857
+ template: `
1858
+ <layout-default [options]="options" [asideUser]="asideUserTpl" [content]="showReuseTab ? contentTpl : noneTpl">
1859
+ <layout-default-header-item direction="left">
1860
+ <yz-header-application></yz-header-application>
1861
+ </layout-default-header-item>
1862
+
1863
+ <layout-default-header-item direction="right" hidden="mobile">
1864
+ <yz-header-notify></yz-header-notify>
1865
+ </layout-default-header-item>
1866
+
1867
+ <layout-default-header-item direction="right" hidden="mobile">
1868
+ <yz-header-theme-btn></yz-header-theme-btn>
1869
+ </layout-default-header-item>
1870
+
1871
+ <layout-default-header-item direction="right" hidden="mobile">
1872
+ <div
1873
+ layout-default-header-item-trigger
1874
+ nz-dropdown
1875
+ [nzDropdownMenu]="settingsMenu"
1876
+ nzTrigger="click"
1877
+ nzPlacement="bottomRight"
1878
+ >
1879
+ <i nz-icon nzType="setting"></i>
1880
+ </div>
1881
+ <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1882
+ <div nz-menu style="width: 200px;">
1883
+ <div nz-menu-item>
1884
+ <yz-header-fullscreen></yz-header-fullscreen>
1885
+ </div>
1886
+ <div nz-menu-item>
1887
+ <yz-header-clear-storage></yz-header-clear-storage>
1888
+ </div>
1889
+ <div nz-menu-item>
1890
+ <yz-header-i18n></yz-header-i18n>
1891
+ </div>
1892
+ </div>
1893
+ </nz-dropdown-menu>
1894
+ </layout-default-header-item>
1895
+ <layout-default-header-item direction="right">
1896
+ <yz-header-user></yz-header-user>
1897
+ </layout-default-header-item>
1898
+ <ng-template #asideUserTpl>
1899
+ <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1900
+ <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="icon"></nz-avatar>
1901
+ <div class="yunzai-default__aside-user-info">
1902
+ <strong>{{ text }}</strong>
1903
+ <p class="mb0">{{ intro }}</p>
1904
+ </div>
1905
+ </div>
1906
+ <nz-dropdown-menu #userMenu="nzDropdownMenu">
1907
+ <ul nz-menu>
1908
+ <li nz-menu-item routerLink="/">{{ 'menu.backtohome' | i18n }}</li>
1909
+ </ul>
1910
+ </nz-dropdown-menu>
1911
+ </ng-template>
1912
+ <ng-template #contentTpl>
1913
+ <reuse-tab #reuseTab [ngStyle]="reuseStyleSheet"></reuse-tab>
1914
+ <router-outlet (activate)="reuseTab.activate($event)"></router-outlet>
1915
+ </ng-template>
1916
+ <ng-template #noneTpl>
1917
+ <router-outlet></router-outlet>
1918
+ </ng-template>
1919
+ </layout-default>
1920
+ `,
1921
+ changeDetection: ChangeDetectionStrategy.OnPush
1922
+ }]
1923
+ }], ctorParameters: function () { return [{ type: i2$1.CacheService }, { type: YzStompService }, { type: i3$4.LayoutService }]; } });
1924
+
1925
+ /*
1926
+ * @Author: cui <devcui@outlook.com>
1927
+ * @Editor: microsoft vscode
1928
+ * @Date: 2021-11-27 11:30:50
1929
+ * @LastEditTime: 2021-11-27 14:38:46
1930
+ * @LastEditors: cui <devcui@outlook.com>
1931
+ * @Description: empty description
1932
+ * @FilePath: \yelon\packages\bis\layout\layout.module.ts
1933
+ * LICENSE HERE
1934
+ */
1935
+ const COMPONENTS = [
1936
+ ContactComponent,
1937
+ YzLayoutBasicComponent,
1938
+ YzHeaderApplicationComponent,
1939
+ YzHeaderNotifyComponent,
1940
+ YzHeaderThemBtnComponent,
1941
+ YzHeaderUserComponent,
1942
+ YzHeaderFullScreenComponent,
1943
+ YzHeaderClearStorageComponent,
1944
+ YzHeaderI18NComponent
1945
+ ];
1946
+ class YunzaiLayoutModule {
1947
+ }
1948
+ YunzaiLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1949
+ YunzaiLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiLayoutModule, declarations: [ContactComponent,
1950
+ YzLayoutBasicComponent,
1951
+ YzHeaderApplicationComponent,
1952
+ YzHeaderNotifyComponent,
1953
+ YzHeaderThemBtnComponent,
1954
+ YzHeaderUserComponent,
1955
+ YzHeaderFullScreenComponent,
1956
+ YzHeaderClearStorageComponent,
1957
+ YzHeaderI18NComponent], imports: [HttpClientModule, CommonModule, FormsModule, RouterModule, ReactiveFormsModule, YzSharedModule], exports: [ContactComponent,
1958
+ YzLayoutBasicComponent,
1959
+ YzHeaderApplicationComponent,
1960
+ YzHeaderNotifyComponent,
1961
+ YzHeaderThemBtnComponent,
1962
+ YzHeaderUserComponent,
1963
+ YzHeaderFullScreenComponent,
1964
+ YzHeaderClearStorageComponent,
1965
+ YzHeaderI18NComponent] });
1966
+ YunzaiLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiLayoutModule, providers: [
1967
+ {
1968
+ provide: YUNZAI_THEME_BTN_KEYS,
1969
+ useValue: 'site-theme'
1970
+ }
1971
+ ], imports: [[HttpClientModule, CommonModule, FormsModule, RouterModule, ReactiveFormsModule, YzSharedModule]] });
1972
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YunzaiLayoutModule, decorators: [{
1973
+ type: NgModule,
1974
+ args: [{
1975
+ imports: [HttpClientModule, CommonModule, FormsModule, RouterModule, ReactiveFormsModule, YzSharedModule],
1976
+ providers: [
1977
+ {
1978
+ provide: YUNZAI_THEME_BTN_KEYS,
1979
+ useValue: 'site-theme'
1980
+ }
1981
+ ],
1982
+ declarations: [...COMPONENTS],
1983
+ exports: [...COMPONENTS]
1984
+ }]
1985
+ }] });
1986
+
1987
+ class YzAuthService {
1988
+ constructor(injector) {
1989
+ this.injector = injector;
1990
+ this.option = mergeConfig(this.csr);
1991
+ this.bis = mergeBisConfig(this.csr);
1992
+ }
1993
+ get csr() {
1994
+ return this.injector.get(YunzaiConfigService);
1995
+ }
1996
+ get tokenService() {
1997
+ return this.injector.get(YA_SERVICE_TOKEN);
1998
+ }
1999
+ get httpClient() {
2000
+ return this.injector.get(_HttpClient);
2001
+ }
2002
+ get cacheService() {
2003
+ return this.injector.get(CacheService);
2004
+ }
2005
+ askToken() {
2006
+ var _a;
2007
+ log('yz.auth.service: ', 'askToken');
2008
+ if ((_a = this.tokenService.get()) === null || _a === void 0 ? void 0 : _a.token) {
2009
+ return of(this.tokenService.get());
2010
+ }
2011
+ else {
2012
+ if (this.bis.loginForm) {
2013
+ return this.fetchTokenByUP();
2014
+ }
2015
+ else {
2016
+ return this.fetchTokenByCas();
2017
+ }
2018
+ }
2019
+ }
2020
+ fetchTokenByUP() {
2021
+ log('yz.auth.service: ', 'fetchTokenByUP');
2022
+ return this.httpClient.post(`/auth/oauth/token?_allow_anonymous=true`, this.bis.loginForm).pipe(map((response) => {
2023
+ const { access_token, expires_in, refresh_token, scope, token_type } = response;
2024
+ return {
2025
+ token: access_token,
2026
+ expired: expires_in,
2027
+ refreshToken: refresh_token,
2028
+ tokenType: token_type,
2029
+ scope
2030
+ };
2031
+ }));
2032
+ }
2033
+ fetchTokenByCas() {
2034
+ log('yz.auth.service: ', 'fetchTokenByCas');
2035
+ const uri = encodeURIComponent(this.injector.get(WINDOW).location.href);
2036
+ return this.httpClient
2037
+ .get(`/cas-proxy/app/validate_full?callback=${uri}&_allow_anonymous=true&timestamp=${new Date().getTime()}`)
2038
+ .pipe(map((response) => {
2039
+ switch (response.errcode) {
2040
+ case 2000:
2041
+ const { access_token, expires_in, refresh_token, scope, token_type } = response.data;
2042
+ return {
2043
+ token: access_token,
2044
+ expired: expires_in,
2045
+ refreshToken: refresh_token,
2046
+ tokenType: token_type,
2047
+ scope
2048
+ };
2049
+ case 2001:
2050
+ this.injector.get(WINDOW).location.href = response.msg;
2051
+ throw Error("Cookie Error: Can't find Cas Cookie,So jump to login!");
2052
+ default:
2053
+ if (response.data) {
2054
+ console.error(response.data);
2055
+ throw Error(response.data);
2056
+ }
2057
+ else if (response.msg) {
2058
+ console.error(response.msg);
2059
+ throw Error(response.msg);
2060
+ }
2061
+ else {
2062
+ console.error('cas unknown error');
2063
+ throw Error('Unknown Error: Cas auth exception!');
2064
+ }
2065
+ }
2066
+ }));
2067
+ }
2068
+ login() {
2069
+ log('yz.auth.service: ', 'login white login form->', this.bis.loginForm);
2070
+ return this.askToken().pipe(mergeMap(token => {
2071
+ log('yz.auth.service: get token->', token);
2072
+ this.csr.set('auth', {
2073
+ token_send_key: 'Authorization',
2074
+ token_send_template: `${token.tokenType} \${token}`,
2075
+ token_send_place: 'header'
2076
+ });
2077
+ log('yz.auth.service: ', 'set token');
2078
+ this.tokenService.set(token);
2079
+ return this.cacheInit();
2080
+ }), mergeAll());
2081
+ }
2082
+ cacheInit() {
2083
+ log('yz.auth.service: ', 'cacheInit');
2084
+ const user = this.cacheService.get('_yz_user', { mode: 'none' });
2085
+ const header = this.cacheService.get('_yz_header', { mode: 'none' });
2086
+ const project = this.cacheService.get('_yz_project_info', { mode: 'none' });
2087
+ return forkJoin(of(user), of(header), of(project)).pipe(mergeMap(([u, h, p]) => {
2088
+ let list = [];
2089
+ // user cache
2090
+ if (!u) {
2091
+ log('yz.auth.service: ', 'fetch user cache');
2092
+ list.push(this.httpClient.get(`/auth/user`).pipe(map((user) => {
2093
+ this.cacheService.set('_yz_user', user.principal);
2094
+ })));
2095
+ }
2096
+ else {
2097
+ log('yz.auth.service: ', 'user recache');
2098
+ list.push(of(() => { }));
2099
+ }
2100
+ // header cache
2101
+ if (!h) {
2102
+ log('yz.auth.service: ', 'fetch header cache');
2103
+ list.push(this.httpClient.get(`/auth/allheader/v2`).pipe(map((header) => {
2104
+ this.cacheService.set('_yz_header', header.data);
2105
+ })));
2106
+ }
2107
+ else {
2108
+ log('yz.auth.service: ', 'header recache');
2109
+ list.push(of(() => { }));
2110
+ }
2111
+ // project cache
2112
+ if (!p) {
2113
+ log('yz.auth.service: ', 'fetch project cache');
2114
+ list.push(this.httpClient.get(`/app-manager/project/info`).pipe(map((info) => {
2115
+ this.cacheService.set('_yz_project_info', info.data);
2116
+ })));
2117
+ }
2118
+ else {
2119
+ log('yz.auth.service: ', 'project recache');
2120
+ list.push(of(() => { }));
2121
+ }
2122
+ return forkJoin(list);
2123
+ }));
2124
+ }
2125
+ }
2126
+ YzAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzAuthService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2127
+ YzAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzAuthService, providedIn: 'root' });
2128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzAuthService, decorators: [{
2129
+ type: Injectable,
2130
+ args: [{ providedIn: 'root' }]
2131
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2132
+
2133
+ const CODEMESSAGE = {
2134
+ 200: '服务器成功返回请求的数据。',
2135
+ 201: '新建或修改数据成功。',
2136
+ 202: '一个请求已经进入后台排队(异步任务)。',
2137
+ 204: '删除数据成功。',
2138
+ 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
2139
+ 401: '用户没有权限(令牌、用户名、密码错误)。',
2140
+ 403: '用户得到授权,但是访问是被禁止的。',
2141
+ 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
2142
+ 406: '请求的格式不可得。',
2143
+ 410: '请求的资源被永久删除,且不会再得到的。',
2144
+ 422: '当创建一个对象时,发生一个验证错误。',
2145
+ 500: '服务器发生错误,请检查服务器。',
2146
+ 502: '网关错误。',
2147
+ 503: '服务不可用,服务器暂时过载或维护。',
2148
+ 504: '网关超时。'
2149
+ };
2150
+ /**
2151
+ * 默认HTTP拦截器,其注册细节见 `app.module.ts`
2152
+ */
2153
+ class YzDefaultInterceptor {
2154
+ constructor(injector) {
2155
+ this.injector = injector;
2156
+ this.jump = false;
2157
+ this.refreshToking = false;
2158
+ this.refreshToken$ = new BehaviorSubject(null);
2159
+ if (this.config.refreshTokenType === 'auth-refresh') {
2160
+ console.error("can't use auth-refresh, please change yz.default.interceptor to default.interceptor!");
2161
+ }
2162
+ }
2163
+ get notification() {
2164
+ return this.injector.get(NzNotificationService);
2165
+ }
2166
+ get tokenSrv() {
2167
+ return this.injector.get(YA_SERVICE_TOKEN);
2168
+ }
2169
+ get http() {
2170
+ return this.injector.get(_HttpClient);
2171
+ }
2172
+ get config() {
2173
+ return mergeBisConfig(this.injector.get(YunzaiConfigService));
2174
+ }
2175
+ goTo(url) {
2176
+ setTimeout(() => this.injector.get(Router).navigateByUrl(url));
2177
+ }
2178
+ checkStatus(ev) {
2179
+ if ((ev.status >= 200 && ev.status < 300) || ev.status === 401) {
2180
+ return;
2181
+ }
2182
+ if (ev instanceof HttpErrorResponse && (ev.error.message || ev.error.errorMessage)) {
2183
+ if (ev.error.errorMessage) {
2184
+ this.notification.error(`发生了一些错误 `, ev.error.errorMessage);
2185
+ }
2186
+ else {
2187
+ this.notification.error(`发生了一些错误 `, ev.error.message);
2188
+ }
2189
+ return;
2190
+ }
2191
+ if (ev instanceof HttpResponse && ev.body.errorMessage) {
2192
+ this.notification.error(`发生了一些错误 `, ev.body.errorMessage);
2193
+ return;
2194
+ }
2195
+ const errortext = CODEMESSAGE[ev.status] || ev.statusText;
2196
+ this.notification.error(`请求错误 ${ev.status}: ${ev.url}`, errortext);
2197
+ }
2198
+ ToLogin() {
2199
+ this.notification.error(`未登录或登录状态已过期,5秒后将跳转到登录页面。`, ``);
2200
+ setTimeout(() => {
2201
+ localStorage.clear();
2202
+ this.injector.get(WINDOW).location.href = `${this.config.baseUrl}/cas-proxy/app/logout`;
2203
+ }, 5000);
2204
+ }
2205
+ reAttachToken(req) {
2206
+ var _a;
2207
+ const token = (_a = this.tokenSrv.get()) === null || _a === void 0 ? void 0 : _a.token;
2208
+ return req.clone({
2209
+ setHeaders: {
2210
+ Authorization: `Bearer ${token}`
2211
+ }
2212
+ });
2213
+ }
2214
+ refreshTokenRequest() {
2215
+ const model = this.tokenSrv.get();
2216
+ const form = new FormData();
2217
+ form.set('refresh_token', model === null || model === void 0 ? void 0 : model.refreshToken);
2218
+ log('yz.default.interceptor: use the refresh token to request a new token', model === null || model === void 0 ? void 0 : model.refreshToken);
2219
+ return this.http.post(`/auth/user/token/refresh?_allow_anonymous=true`, form);
2220
+ }
2221
+ tryRefreshToken(ev, req, next) {
2222
+ // 连刷新Token的请求都错了,那就是真错了
2223
+ if (['/auth/oauth/token'].some(url => req.url.includes(url))) {
2224
+ this.ToLogin();
2225
+ return throwError(ev);
2226
+ }
2227
+ // 正在刷新token,所有其他请求排队
2228
+ if (this.refreshToking) {
2229
+ return this.refreshToken$.pipe(filter(v => !!v), take(1), switchMap(() => next.handle(this.reAttachToken(req))));
2230
+ }
2231
+ //尝试调用刷新 Token
2232
+ this.refreshToking = true;
2233
+ this.refreshToken$.next(null);
2234
+ // 处理Token
2235
+ return this.refreshTokenRequest().pipe(switchMap(res => {
2236
+ log('yz.default.interceptor: refresh token accessed -> ', res);
2237
+ // 重新保存新 token
2238
+ const { access_token, expires_in, refresh_token, scope, token_type } = res;
2239
+ this.tokenSrv.set({
2240
+ token: access_token,
2241
+ expired: expires_in,
2242
+ refreshToken: refresh_token,
2243
+ tokenType: token_type,
2244
+ scope
2245
+ });
2246
+ // 通知后续请求继续执行
2247
+ this.refreshToking = false;
2248
+ this.refreshToken$.next(res);
2249
+ // 重新发起请求
2250
+ return next.handle(this.reAttachToken(req));
2251
+ }), catchError(err => {
2252
+ this.refreshToking = false;
2253
+ this.ToLogin();
2254
+ return throwError(err);
2255
+ }));
2256
+ }
2257
+ getAdditionalHeaders(headers) {
2258
+ const res = {};
2259
+ const lang = this.injector.get(YUNZAI_I18N_TOKEN).currentLang;
2260
+ if (!(headers === null || headers === void 0 ? void 0 : headers.has('Accept-Language')) && lang) {
2261
+ res['Accept-Language'] = lang;
2262
+ }
2263
+ return res;
2264
+ }
2265
+ handleData(ev, req, next) {
2266
+ this.checkStatus(ev);
2267
+ switch (ev.status) {
2268
+ case 200:
2269
+ return of(ev);
2270
+ case 401:
2271
+ if (this.config.refreshTokenEnabled && this.config.refreshTokenType === 're-request') {
2272
+ return this.tryRefreshToken(ev, req, next);
2273
+ }
2274
+ this.ToLogin();
2275
+ break;
2276
+ case 403:
2277
+ case 404:
2278
+ case 500:
2279
+ if (this.jump) {
2280
+ this.goTo(`/exception/${ev.status}`);
2281
+ }
2282
+ break;
2283
+ default:
2284
+ if (ev instanceof HttpErrorResponse) {
2285
+ console.warn('未可知错误,大部分是由于后端不支持跨域CORS或无效配置引起,请参考 https://ng.yunzainfo.com/docs/server 解决跨域问题', ev);
2286
+ }
2287
+ break;
2288
+ }
2289
+ if (ev instanceof HttpErrorResponse) {
2290
+ return throwError(ev);
2291
+ }
2292
+ else {
2293
+ return of(ev);
2294
+ }
2295
+ }
2296
+ intercept(req, next) {
2297
+ log('yz.default.interceptor.ts: ', 'request ', req);
2298
+ // 统一加前缀
2299
+ let url = req.url;
2300
+ if (!url.startsWith('https://') && !url.startsWith('http://')) {
2301
+ url = this.config.baseUrl + url;
2302
+ }
2303
+ if (url.includes('.json') && url.includes('assets')) {
2304
+ url = req.url;
2305
+ }
2306
+ // 加入语言头
2307
+ const newReq = req.clone({ url, setHeaders: this.getAdditionalHeaders(req.headers) });
2308
+ return next.handle(newReq).pipe(mergeMap(ev => {
2309
+ // 允许统一对请求错误处理
2310
+ if (ev instanceof HttpResponseBase) {
2311
+ return this.handleData(ev, newReq, next);
2312
+ }
2313
+ // 若一切都正常,则后续操作
2314
+ return of(ev);
2315
+ }), catchError((err) => this.handleData(err, newReq, next)));
2316
+ }
2317
+ }
2318
+ YzDefaultInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzDefaultInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2319
+ YzDefaultInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzDefaultInterceptor });
2320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzDefaultInterceptor, decorators: [{
2321
+ type: Injectable
2322
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2323
+
2324
+ function mapYzSideToYelonMenu(menus) {
2325
+ menus.forEach(menu => {
2326
+ menu.badgeDot = menu.badge_dot || null;
2327
+ menu.badgeStatus = menu.badge_status || null;
2328
+ menu.shortcutRoot = menu.shortcut_root || null;
2329
+ menu.reuse = true;
2330
+ if (menu.children) {
2331
+ mapYzSideToYelonMenu(menu.children);
2332
+ }
2333
+ });
2334
+ }
2335
+ function generateAbility(menus, abilities, prefix) {
2336
+ menus.forEach(menu => {
2337
+ if (menu.link) {
2338
+ prefix += menu.link;
2339
+ }
2340
+ else {
2341
+ prefix += '';
2342
+ }
2343
+ if (menu.menuAuths) {
2344
+ menu.menuAuths.forEach((a) => {
2345
+ abilities.push(`${prefix}:${a}`);
2346
+ abilities.push(a);
2347
+ });
2348
+ }
2349
+ if (menu.children) {
2350
+ generateAbility(menu.children, abilities, prefix);
2351
+ }
2352
+ });
2353
+ }
2354
+ class YzStartupService {
2355
+ constructor(iconSrv, menuService, i18n, settingService, aclService, titleService, yzAuthService, cacheService, configService) {
2356
+ this.menuService = menuService;
2357
+ this.i18n = i18n;
2358
+ this.settingService = settingService;
2359
+ this.aclService = aclService;
2360
+ this.titleService = titleService;
2361
+ this.yzAuthService = yzAuthService;
2362
+ this.cacheService = cacheService;
2363
+ this.configService = configService;
2364
+ this.bis = BUSINESS_DEFAULT_CONFIG;
2365
+ this.bis = mergeBisConfig(this.configService);
2366
+ iconSrv.addIcon(...ICONS);
2367
+ }
2368
+ load() {
2369
+ log$1('startup.service: ', 'load');
2370
+ const defaultLang = this.i18n.defaultLang;
2371
+ return this.i18n.loadLangData(defaultLang).pipe(mergeMap(langData => {
2372
+ log$1('startup.service: ', 'set i18n, defaultLang->', defaultLang, ' langData->', langData);
2373
+ this.i18n.use(defaultLang, langData);
2374
+ return of(null);
2375
+ }), mergeMap(() => {
2376
+ return this.yzAuthService.login();
2377
+ }), mergeMap(v => {
2378
+ // preloader finish
2379
+ this.systemInit();
2380
+ log$1('startup.service: preloader finish');
2381
+ const win = window;
2382
+ if (win && win.appBootstrap) {
2383
+ win.appBootstrap();
2384
+ }
2385
+ return of(v);
2386
+ }));
2387
+ }
2388
+ systemInit() {
2389
+ log$1('startup.service: system init');
2390
+ // user
2391
+ const user = this.cacheService.get('_yz_user', { mode: 'none' });
2392
+ // menu
2393
+ const ms = deepCopy(user.menu).filter((m) => m.systemCode && m.systemCode === this.bis.systemCode);
2394
+ mapYzSideToYelonMenu(ms);
2395
+ const currentMenu = ms.pop() || [];
2396
+ this.menuService.add([currentMenu]);
2397
+ // logo app
2398
+ this.settingService.setApp({ name: currentMenu.text, description: currentMenu.intro });
2399
+ this.settingService.setUser({
2400
+ name: user.realname || 'no name',
2401
+ avatar: `${this.bis.baseUrl}/filecenter/file/${user.avatarId}` || '',
2402
+ email: user.email || 'no email'
2403
+ });
2404
+ // title
2405
+ this.titleService.default = currentMenu && currentMenu.text ? currentMenu.text : 'default application name';
2406
+ this.titleService.setTitle(currentMenu && currentMenu.text ? currentMenu.text : 'no title');
2407
+ // acl
2408
+ const abilities = [];
2409
+ generateAbility([currentMenu], abilities, '');
2410
+ this.aclService.attachRole((user === null || user === void 0 ? void 0 : user.roles.map((role) => {
2411
+ return role.roleValue;
2412
+ }).filter((a) => !!a)) || []);
2413
+ this.aclService.attachAbility(abilities);
2414
+ // cache current
2415
+ this.cacheService.set('_yz_current', {
2416
+ text: currentMenu.text,
2417
+ intro: currentMenu.intro,
2418
+ icon: currentMenu.appIconUrl
2419
+ });
2420
+ }
2421
+ }
2422
+ YzStartupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStartupService, deps: [{ token: i9.NzIconService }, { token: i1.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: i1.SettingsService }, { token: i3$5.ACLService }, { token: i1.TitleService }, { token: YzAuthService }, { token: i2$1.CacheService }, { token: i1$2.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2423
+ YzStartupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStartupService });
2424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: YzStartupService, decorators: [{
2425
+ type: Injectable
2426
+ }], ctorParameters: function () {
2427
+ return [{ type: i9.NzIconService }, { type: i1.MenuService }, { type: YzI18NService, decorators: [{
2428
+ type: Inject,
2429
+ args: [YUNZAI_I18N_TOKEN]
2430
+ }] }, { type: i1.SettingsService }, { type: i3$5.ACLService }, { type: i1.TitleService }, { type: YzAuthService }, { type: i2$1.CacheService }, { type: i1$2.YunzaiConfigService }];
2431
+ } });
2432
+ function YzStartupServiceFactory(startupService) {
2433
+ return () => startupService.load();
2434
+ }
2435
+ //@ts-ignore
2436
+ const YZ_APPINIT_PROVIDES = [
2437
+ YzStartupService,
2438
+ {
2439
+ provide: APP_INITIALIZER,
2440
+ useFactory: YzStartupServiceFactory,
2441
+ deps: [YzStartupService],
2442
+ multi: true
2443
+ }
2444
+ ];
2445
+
2446
+ class PathToRegexpService {
2447
+ constructor() {
2448
+ this.DEFAULT_DELIMITER = '/';
2449
+ this.PATH_REGEXP = new RegExp(['(\\\\.)', '(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?'].join('|'), 'g');
2450
+ }
2451
+ parse(str, options) {
2452
+ const tokens = [];
2453
+ let key = 0;
2454
+ let index = 0;
2455
+ let path = '';
2456
+ const defaultDelimiter = (options && options.delimiter) || this.DEFAULT_DELIMITER;
2457
+ const whitelist = (options && options.whitelist) || undefined;
2458
+ let pathEscaped = false;
2459
+ let res;
2460
+ while ((res = this.PATH_REGEXP.exec(str)) !== null) {
2461
+ const m = res[0];
2462
+ const escaped = res[1];
2463
+ const offset = res.index;
2464
+ path += str.slice(index, offset);
2465
+ index = offset + m.length;
2466
+ // Ignore already escaped sequences.
2467
+ if (escaped) {
2468
+ path += escaped[1];
2469
+ pathEscaped = true;
2470
+ continue;
2471
+ }
2472
+ let prev = '';
2473
+ const name = res[2];
2474
+ const capture = res[3];
2475
+ const group = res[4];
2476
+ const modifier = res[5];
2477
+ if (!pathEscaped && path.length) {
2478
+ const k = path.length - 1;
2479
+ const c = path[k];
2480
+ const matches = whitelist ? whitelist.indexOf(c) > -1 : true;
2481
+ if (matches) {
2482
+ prev = c;
2483
+ path = path.slice(0, k);
2484
+ }
2485
+ }
2486
+ // Push the current path onto the tokens.
2487
+ if (path) {
2488
+ tokens.push(path);
2489
+ path = '';
2490
+ pathEscaped = false;
2491
+ }
2492
+ const repeat = modifier === '+' || modifier === '*';
2493
+ const optional = modifier === '?' || modifier === '*';
2494
+ const pattern = capture || group;
2495
+ const delimiter = prev || defaultDelimiter;
2496
+ tokens.push({
2497
+ name: name || key++,
2498
+ prefix: prev,
2499
+ delimiter: delimiter,
2500
+ optional: optional,
2501
+ repeat: repeat,
2502
+ pattern: pattern
2503
+ ? this.escapeGroup(pattern)
2504
+ : `[^${this.escapeString(delimiter === defaultDelimiter ? delimiter : delimiter + defaultDelimiter)}]+?`
2505
+ });
2506
+ }
2507
+ // Push any remaining characters.
2508
+ if (path || index < str.length) {
2509
+ tokens.push(path + str.substr(index));
2510
+ }
2511
+ return tokens;
2512
+ }
2513
+ compile(str, options) {
2514
+ return this.tokensToFunction(this.parse(str, options), options);
2515
+ }
2516
+ tokensToFunction(tokens, options) {
2517
+ const matches = new Array(tokens.length);
2518
+ for (let i = 0; i < tokens.length; i++) {
2519
+ if (typeof tokens[i] === 'object') {
2520
+ matches[i] = new RegExp(`^(?:${tokens[i].pattern})$`, this.flags(options));
2521
+ }
2522
+ }
2523
+ return function (data, options) {
2524
+ let path = '';
2525
+ const encode = (options && options.encode) || encodeURIComponent;
2526
+ const validate = options ? options.validate !== false : true;
2527
+ for (let i = 0; i < tokens.length; i++) {
2528
+ const token = tokens[i];
2529
+ if (typeof token === 'string') {
2530
+ path += token;
2531
+ continue;
2532
+ }
2533
+ const value = data ? data[token.name] : undefined;
2534
+ let segment;
2535
+ if (Array.isArray(value)) {
2536
+ if (!token.repeat) {
2537
+ throw new TypeError(`Expected "${token.name}" to not repeat, but got array`);
2538
+ }
2539
+ if (value.length === 0) {
2540
+ if (token.optional) {
2541
+ continue;
2542
+ }
2543
+ throw new TypeError(`Expected "${token.name}" to not be empty`);
2544
+ }
2545
+ for (let j = 0; j < value.length; j++) {
2546
+ segment = encode(value[j], token);
2547
+ if (validate && !matches[i].test(segment)) {
2548
+ throw new TypeError(`Expected all "${token.name}" to match "${token.pattern}"`);
2549
+ }
2550
+ path += (j === 0 ? token.prefix : token.delimiter) + segment;
2551
+ }
2552
+ continue;
2553
+ }
2554
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
2555
+ segment = encode(String(value), token);
2556
+ if (validate && !matches[i].test(segment)) {
2557
+ throw new TypeError(`Expected "${token.name}" to match "${token.pattern}", but got "${segment}"`);
2558
+ }
2559
+ path += token.prefix + segment;
2560
+ continue;
2561
+ }
2562
+ if (token.optional) {
2563
+ continue;
2564
+ }
2565
+ throw new TypeError(`Expected "${token.name}" to be ${token.repeat ? 'an array' : 'a string'}`);
2566
+ }
2567
+ return path;
2568
+ };
2569
+ }
2570
+ escapeString(str) {
2571
+ return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1');
2572
+ }
2573
+ escapeGroup(group) {
2574
+ return group.replace(/([=!:$/()])/g, '\\$1');
2575
+ }
2576
+ flags(options) {
2577
+ return options && options.sensitive ? '' : 'i';
2578
+ }
2579
+ regexpToRegexp(path, keys) {
2580
+ if (!keys) {
2581
+ return path;
2582
+ }
2583
+ const groups = path.source.match(/\((?!\?)/g);
2584
+ if (groups) {
2585
+ for (let i = 0; i < groups.length; i++) {
2586
+ keys.push({
2587
+ name: i,
2588
+ prefix: null,
2589
+ delimiter: null,
2590
+ optional: false,
2591
+ repeat: false,
2592
+ pattern: null
2593
+ });
2594
+ }
2595
+ }
2596
+ return path;
2597
+ }
2598
+ arrayToRegexp(path, keys, options) {
2599
+ const parts = [];
2600
+ for (let i = 0; i < path.length; i++) {
2601
+ parts.push(this.pathToRegexp(path[i], keys, options).source);
2602
+ }
2603
+ return new RegExp(`(?:${parts.join('|')})`, this.flags(options));
2604
+ }
2605
+ stringToRegexp(path, keys, options) {
2606
+ return this.tokensToRegExp(this.parse(path, options), keys, options);
2607
+ }
2608
+ tokensToRegExp(tokens, keys, options) {
2609
+ options = options || {};
2610
+ const strict = options.strict;
2611
+ const start = options.start !== false;
2612
+ const end = options.end !== false;
2613
+ const delimiter = options.delimiter || this.DEFAULT_DELIMITER;
2614
+ const endsWith = []
2615
+ .concat(options.endsWith || [])
2616
+ .map(this.escapeString)
2617
+ .concat('$')
2618
+ .join('|');
2619
+ let route = start ? '^' : '';
2620
+ for (let i = 0; i < tokens.length; i++) {
2621
+ const token = tokens[i];
2622
+ if (typeof token === 'string') {
2623
+ route += this.escapeString(token);
2624
+ }
2625
+ else {
2626
+ const capture = token.repeat
2627
+ ? `(?:${token.pattern})(?:${this.escapeString(token.delimiter)}(?:${token.pattern}))*`
2628
+ : token.pattern;
2629
+ if (keys) {
2630
+ keys.push(token);
2631
+ }
2632
+ if (token.optional) {
2633
+ if (!token.prefix) {
2634
+ route += `(${capture})?`;
2635
+ }
2636
+ else {
2637
+ route += `(?:${this.escapeString(token.prefix)}(${capture}))?`;
2638
+ }
2639
+ }
2640
+ else {
2641
+ route += `${this.escapeString(token.prefix)}(${capture})`;
2642
+ }
2643
+ }
2644
+ }
2645
+ if (end) {
2646
+ if (!strict) {
2647
+ route += `(?:${this.escapeString(delimiter)})?`;
2648
+ }
2649
+ route += endsWith === '$' ? '$' : `(?=${endsWith})`;
2650
+ }
2651
+ else {
2652
+ const endToken = tokens[tokens.length - 1];
2653
+ const isEndDelimited = typeof endToken === 'string' ? endToken[endToken.length - 1] === delimiter : endToken === undefined;
2654
+ if (!strict) {
2655
+ route += `(?:${this.escapeString(delimiter)}(?=${endsWith}))?`;
2656
+ }
2657
+ if (!isEndDelimited) {
2658
+ route += `(?=${this.escapeString(delimiter)}|${endsWith})`;
2659
+ }
2660
+ }
2661
+ return new RegExp(route, this.flags(options));
2662
+ }
2663
+ pathToRegexp(path, keys, options) {
2664
+ if (path instanceof RegExp) {
2665
+ return this.regexpToRegexp(path, keys);
2666
+ }
2667
+ if (Array.isArray(path)) {
2668
+ return this.arrayToRegexp(/** @type {!Array} */ path, keys, options);
2669
+ }
2670
+ return this.stringToRegexp(/** @type {string} */ path, keys, options);
2671
+ }
2672
+ }
2673
+ PathToRegexpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PathToRegexpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2674
+ PathToRegexpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PathToRegexpService, providedIn: 'root' });
2675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PathToRegexpService, decorators: [{
2676
+ type: Injectable,
2677
+ args: [{
2678
+ providedIn: 'root'
2679
+ }]
2680
+ }], ctorParameters: function () { return []; } });
2681
+
2682
+ class ActGuard {
2683
+ constructor(configService, cacheService, pathToRegexp, router) {
2684
+ this.configService = configService;
2685
+ this.cacheService = cacheService;
2686
+ this.pathToRegexp = pathToRegexp;
2687
+ this.router = router;
2688
+ this.bis = BUSINESS_DEFAULT_CONFIG;
2689
+ this.menus = [];
2690
+ this.links = [];
2691
+ log$1('act: ');
2692
+ this.bis = mergeBisConfig(this.configService);
2693
+ log$1('act: config ', this.bis);
2694
+ const user = this.cacheService.get('_yz_user', { mode: 'none' });
2695
+ log$1('act: user ', user);
2696
+ this.menus = deepCopy(user.menu).filter((m) => m.systemCode && m.systemCode === this.bis.systemCode);
2697
+ log$1('act: menus ', this.menus);
2698
+ this.getAllLinks(this.menus, this.links);
2699
+ log$1('act: links ', this.links);
2700
+ }
2701
+ canActivate(_, state) {
2702
+ log$1('act: can activate ', state);
2703
+ if (this.preHandle(state)) {
2704
+ return true;
2705
+ }
2706
+ log$1('act: can activate child prehandle success');
2707
+ let canactivate = false;
2708
+ this.links.forEach((link) => {
2709
+ const regexp = this.pathToRegexp.stringToRegexp(link, null, null);
2710
+ log$1(`act: ${link} test ${state.url.split('?')[0]}`);
2711
+ if (regexp.test(state.url.split('?')[0])) {
2712
+ canactivate = true;
2713
+ log$1(`act: test value ${canactivate}`);
2714
+ return;
2715
+ }
2716
+ });
2717
+ if (canactivate) {
2718
+ log$1(`act: test sucess`);
2719
+ return true;
2720
+ }
2721
+ else {
2722
+ log$1(`act: test error`);
2723
+ this.router.navigate(['displayIndex']);
2724
+ return false;
2725
+ }
2726
+ }
2727
+ canActivateChild(_, state) {
2728
+ log$1('act: can activate child ', state);
2729
+ if (this.preHandle(state)) {
2730
+ return true;
2731
+ }
2732
+ log$1('act: can activate child prehandle success');
2733
+ let canactivate = false;
2734
+ this.links.forEach((link) => {
2735
+ const regexp = this.pathToRegexp.stringToRegexp(link, null, null);
2736
+ if (regexp.test(state.url.split('?')[0])) {
2737
+ log$1(`act: ${link} test ${state.url.split('?')[0]}`);
2738
+ canactivate = true;
2739
+ log$1(`act: test value ${canactivate}`);
2740
+ return;
2741
+ }
2742
+ });
2743
+ if (canactivate) {
2744
+ log$1(`act: test sucess`);
2745
+ return true;
2746
+ }
2747
+ else {
2748
+ log$1(`act: test error`);
2749
+ this.router.navigate(['displayIndex']);
2750
+ return false;
2751
+ }
2752
+ }
2753
+ preHandle(state) {
2754
+ return (state.url.includes('error') ||
2755
+ state.url.includes('exception') ||
2756
+ state.url.includes('displayIndex') ||
2757
+ state.url === '' ||
2758
+ state.url === null ||
2759
+ state.url === '/' ||
2760
+ state.url.includes('iframePage'));
2761
+ }
2762
+ getAllLinks(menu, links) {
2763
+ menu.forEach((sider) => {
2764
+ if (sider.link) {
2765
+ links.push(sider.link);
2766
+ }
2767
+ if (sider.children && sider.children.length > 0) {
2768
+ this.getAllLinks(sider.children, links);
2769
+ }
2770
+ });
2771
+ }
2772
+ }
2773
+ ActGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ActGuard, deps: [{ token: i1$2.YunzaiConfigService }, { token: i2$1.CacheService }, { token: PathToRegexpService }, { token: i17.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2774
+ ActGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ActGuard, providedIn: 'root' });
2775
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ActGuard, decorators: [{
2776
+ type: Injectable,
2777
+ args: [{
2778
+ providedIn: 'root'
2779
+ }]
2780
+ }], ctorParameters: function () { return [{ type: i1$2.YunzaiConfigService }, { type: i2$1.CacheService }, { type: PathToRegexpService }, { type: i17.Router }]; } });
2781
+
2782
+ /**
2783
+ * Generated bundle index. Do not edit.
2784
+ */
2785
+
2786
+ export { ActGuard, BUSINESS_DEFAULT_CONFIG, ContactComponent, ContactService, PathToRegexpService, STOMP_DEFAULT_CONFIG, TOPIC, YZ_APPINIT_PROVIDES, YunzaiLayoutModule, YzAuthService, YzDefaultInterceptor, YzHeaderApplicationComponent, YzHeaderClearStorageComponent, YzHeaderFullScreenComponent, YzHeaderI18NComponent, YzHeaderNotifyComponent, YzHeaderThemBtnComponent, YzHeaderUserComponent, YzI18NService, YzLayoutBasicComponent, YzStartupService, YzStartupServiceFactory, YzStompService, generateAbility, mapYzSideToYelonMenu, mergeBisConfig, mergeStompConfig };
2787
+ //# sourceMappingURL=layout.mjs.map