@yelon/bis 15.1.0 → 15.1.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, ChangeDetectionStrategy, HostListener, Injectable, Inject, Input, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
3
- import { forkJoin, map, Subject, takeUntil, of, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap, catchError } from 'rxjs';
4
- import * as i1$3 from '@yelon/util';
5
- import { WINDOW, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
3
+ import { Subject, takeUntil, of, catchError, forkJoin, map, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
4
+ import * as i1$4 from '@yelon/util';
5
+ import { WINDOW, hasFavicon, setFavicon, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
6
6
  import * as i1$5 from '@yelon/theme/layout-default';
7
- import * as i1$4 from '@yelon/cache';
7
+ import * as i1$3 from '@yelon/cache';
8
8
  import { CacheService } from '@yelon/cache';
9
9
  import * as i3$3 from '@yelon/socket';
10
10
  import * as i4$1 from '@angular/common';
@@ -20,16 +20,25 @@ import * as i9 from 'ng-zorro-antd/avatar';
20
20
  import * as i1 from 'ng-zorro-antd/modal';
21
21
  import * as i1$1 from 'ng-zorro-antd/message';
22
22
  import * as i1$2 from '@yelon/theme';
23
- import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
23
+ import { zh_CN as zh_CN$1, zh_TW as zh_TW$1, en_US as en_US$1, el_GR as el_GR$1, es_ES as es_ES$1, fr_FR as fr_FR$1, hr_HR as hr_HR$1, it_IT as it_IT$1, ko_KR as ko_KR$1, pl_PL as pl_PL$1, sl_SI as sl_SI$1, tr_TR as tr_TR$1, YunzaiI18nBaseService, YUNZAI_I18N_TOKEN, _HttpClient } from '@yelon/theme';
24
24
  import screenfull from 'screenfull';
25
25
  import { __decorate } from 'tslib';
26
26
  import { InputBoolean } from '@yelon/util/decorator';
27
27
  import ngEn from '@angular/common/locales/en';
28
+ import { zhCN, zhTW, enUS, el, es, fr, hr, it, ko, pl, sl, tr } from 'date-fns/locale';
29
+ import * as i2 from 'ng-zorro-antd/i18n';
30
+ import { zh_CN, zh_TW, en_US, el_GR, es_ES, fr_FR, hr_HR, it_IT, ko_KR, pl_PL, sl_SI, tr_TR } from 'ng-zorro-antd/i18n';
31
+ import ngElGr from '@angular/common/locales/el';
32
+ import ngEsEs from '@angular/common/locales/es';
33
+ import ngFr from '@angular/common/locales/fr';
34
+ import ngHr from '@angular/common/locales/hr';
35
+ import ngIt from '@angular/common/locales/it';
36
+ import ngKo from '@angular/common/locales/ko';
37
+ import ngPl from '@angular/common/locales/pl';
38
+ import ngSl from '@angular/common/locales/sl';
39
+ import ngTr from '@angular/common/locales/tr';
28
40
  import ngZh from '@angular/common/locales/zh';
29
41
  import ngZhTw from '@angular/common/locales/zh-Hant';
30
- import { zhCN, zhTW, enUS } from 'date-fns/locale';
31
- import * as i2 from 'ng-zorro-antd/i18n';
32
- import { zh_CN, zh_TW, en_US } from 'ng-zorro-antd/i18n';
33
42
  import * as i3$1 from '@angular/cdk/platform';
34
43
  import * as i4 from '@yelon/util/config';
35
44
  import { YunzaiConfigService as YunzaiConfigService$1 } from '@yelon/util/config';
@@ -76,7 +85,7 @@ class YunzaiClearStorageComponent {
76
85
  YunzaiClearStorageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiClearStorageComponent, deps: [{ token: i1.NzModalService }, { token: i1$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
77
86
  YunzaiClearStorageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage", host: { listeners: { "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
78
87
  <i nz-icon nzType="tool"></i>
79
- {{ 'menu.clear.local.storage' | i18n }}
88
+ {{ 'storage.clear' | i18n }}
80
89
  `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
81
90
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiClearStorageComponent, decorators: [{
82
91
  type: Component,
@@ -84,7 +93,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
84
93
  selector: 'yunzai-clearstorage',
85
94
  template: `
86
95
  <i nz-icon nzType="tool"></i>
87
- {{ 'menu.clear.local.storage' | i18n }}
96
+ {{ 'storage.clear' | i18n }}
88
97
  `,
89
98
  host: {
90
99
  '[class.d-block]': 'true'
@@ -112,7 +121,7 @@ class YunzaiFullScreenComponent {
112
121
  YunzaiFullScreenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiFullScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
113
122
  YunzaiFullScreenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen", host: { listeners: { "window:resize": "_resize()", "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
114
123
  <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
115
- {{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
124
+ {{ (status ? 'exitFullscreen' : 'fullscreen') | i18n }}
116
125
  `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
117
126
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiFullScreenComponent, decorators: [{
118
127
  type: Component,
@@ -120,7 +129,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
120
129
  selector: 'yunzai-fullscreen',
121
130
  template: `
122
131
  <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
123
- {{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
132
+ {{ (status ? 'exitFullscreen' : 'fullscreen') | i18n }}
124
133
  `,
125
134
  host: {
126
135
  '[class.d-block]': 'true'
@@ -135,8 +144,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
135
144
  args: ['click']
136
145
  }] } });
137
146
 
138
- const DEFAULT = 'zh-CN';
139
- const LANGS = {
147
+ const BUSINESS_DEFAULT_CONFIG = {
148
+ baseUrl: '/backstage',
149
+ systemCode: 'portal',
150
+ loginForm: null,
151
+ refreshTokenEnabled: true,
152
+ refreshTokenType: 're-request'
153
+ };
154
+ function mergeBisConfig(srv) {
155
+ return srv.merge('bis', BUSINESS_DEFAULT_CONFIG);
156
+ }
157
+
158
+ const YUNZAI_LANGS = {
140
159
  'zh-CN': {
141
160
  text: '简体中文',
142
161
  ng: ngZh,
@@ -160,23 +179,100 @@ const LANGS = {
160
179
  date: enUS,
161
180
  yelon: en_US$1,
162
181
  abbr: '🇬🇧'
182
+ },
183
+ 'el-GR': {
184
+ text: 'Ελληνικά',
185
+ ng: ngElGr,
186
+ zorro: el_GR,
187
+ date: el,
188
+ yelon: el_GR$1,
189
+ abbr: '🇬🇷'
190
+ },
191
+ 'es-ES': {
192
+ text: 'Español',
193
+ ng: ngEsEs,
194
+ zorro: es_ES,
195
+ date: es,
196
+ yelon: es_ES$1,
197
+ abbr: '🇪🇸'
198
+ },
199
+ 'fr-FR': {
200
+ text: 'Français',
201
+ ng: ngFr,
202
+ zorro: fr_FR,
203
+ date: fr,
204
+ yelon: fr_FR$1,
205
+ abbr: '🇫🇷'
206
+ },
207
+ 'hr-HR': {
208
+ text: 'Hrvatski',
209
+ ng: ngHr,
210
+ zorro: hr_HR,
211
+ date: hr,
212
+ yelon: hr_HR$1,
213
+ abbr: '🇭🇷'
214
+ },
215
+ 'it-IT': {
216
+ text: 'Italiano',
217
+ ng: ngIt,
218
+ zorro: it_IT,
219
+ date: it,
220
+ yelon: it_IT$1,
221
+ abbr: '🇮🇹'
222
+ },
223
+ 'ko-KR': {
224
+ text: '한국어',
225
+ ng: ngKo,
226
+ zorro: ko_KR,
227
+ date: ko,
228
+ yelon: ko_KR$1,
229
+ abbr: '🇰🇷'
230
+ },
231
+ 'pl-PL': {
232
+ text: 'Polski',
233
+ ng: ngPl,
234
+ zorro: pl_PL,
235
+ date: pl,
236
+ yelon: pl_PL$1,
237
+ abbr: '🇵🇱'
238
+ },
239
+ 'sl-SI': {
240
+ text: 'Slovenščina',
241
+ ng: ngSl,
242
+ zorro: sl_SI,
243
+ date: sl,
244
+ yelon: sl_SI$1,
245
+ abbr: '🇸🇮'
246
+ },
247
+ 'tr-TR': {
248
+ text: 'Türkçe',
249
+ ng: ngTr,
250
+ zorro: tr_TR,
251
+ date: tr,
252
+ yelon: tr_TR$1,
253
+ abbr: '🇹🇷'
163
254
  }
164
255
  };
256
+
257
+ const DEFAULT = 'zh-CN';
165
258
  class YunzaiI18NService extends YunzaiI18nBaseService {
166
- constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv) {
259
+ constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv, cacheService) {
167
260
  super(cogSrv);
168
261
  this.http = http;
169
262
  this.settings = settings;
170
263
  this.nzI18nService = nzI18nService;
171
264
  this.yelonLocaleService = yelonLocaleService;
172
265
  this.platform = platform;
266
+ this.cacheService = cacheService;
173
267
  this._defaultLang = DEFAULT;
174
- this._langs = Object.keys(LANGS).map(code => {
175
- const item = LANGS[code];
176
- return { code, text: item.text, abbr: item.abbr };
177
- });
268
+ this.destroy$ = new Subject();
178
269
  const defaultLang = this.getDefaultLang();
179
- this._defaultLang = this._langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
270
+ this.bis = mergeBisConfig(cogSrv);
271
+ this.getLangs()
272
+ .pipe(takeUntil(this.destroy$))
273
+ .subscribe(langs => {
274
+ this._defaultLang = langs.findIndex(w => w.code === defaultLang) === -1 ? DEFAULT : defaultLang;
275
+ });
180
276
  }
181
277
  getDefaultLang() {
182
278
  if (!this.platform.isBrowser) {
@@ -190,35 +286,72 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
190
286
  return arr.length <= 1 ? res : `${arr[0]}-${arr[1].toUpperCase()}`;
191
287
  }
192
288
  loadLangData(lang) {
193
- return this.http.get(`assets/tmp/i18n/${lang}.json`);
289
+ const key = `_yz_lang_${lang}`;
290
+ if (this.cacheService.getNone(key)) {
291
+ return of(this.cacheService.get(key));
292
+ }
293
+ else {
294
+ if (ngDevMode) {
295
+ return this.http.get(`assets/tmp/i18n/${lang}.json`);
296
+ }
297
+ else {
298
+ return this.http
299
+ .get(`${this.bis.baseUrl}/i18n/api/v2/language/${lang}?_allow_anonymous`)
300
+ .pipe(catchError(() => this.http.get(`assets/tmp/i18n/${lang}.json`)));
301
+ }
302
+ }
194
303
  }
195
304
  use(lang, data) {
196
305
  if (this._currentLang === lang)
197
306
  return;
307
+ const key = `_yz_lang_${lang}`;
308
+ this.cacheService.set(key, data);
309
+ this.cacheService.set(this.cacheDefaultKey, lang);
198
310
  this._data = this.flatData(data, []);
199
- const item = LANGS[lang];
200
- registerLocaleData(item.ng);
201
- this.nzI18nService.setLocale(item.zorro);
202
- this.nzI18nService.setDateLocale(item.date);
203
- this.yelonLocaleService.setLocale(item.yelon);
204
- this._currentLang = lang;
205
- this._change$.next(lang);
311
+ const item = YUNZAI_LANGS[lang];
312
+ if (item) {
313
+ registerLocaleData(item.ng);
314
+ this.nzI18nService.setLocale(item.zorro);
315
+ this.nzI18nService.setDateLocale(item.date);
316
+ this.yelonLocaleService.setLocale(item.yelon);
317
+ this._currentLang = lang;
318
+ this._change$.next(lang);
319
+ }
320
+ else {
321
+ registerLocaleData(ngEn);
322
+ this.nzI18nService.setLocale(en_US);
323
+ this.nzI18nService.setDateLocale(enUS);
324
+ this.yelonLocaleService.setLocale(en_US$1);
325
+ this._currentLang = lang;
326
+ this._change$.next(lang);
327
+ }
206
328
  }
207
329
  getLangs() {
208
- return this._langs;
330
+ const langs = Object.keys(YUNZAI_LANGS).map(code => {
331
+ const item = YUNZAI_LANGS[code];
332
+ return { code, text: item.text, abbr: item.abbr, image: undefined };
333
+ });
334
+ if (ngDevMode) {
335
+ return of(langs);
336
+ }
337
+ else {
338
+ return this.http
339
+ .get(`${this.bis.baseUrl}/i18n/api/v2/language?_allow_anonymous`)
340
+ .pipe(catchError(() => of(langs)));
341
+ }
342
+ }
343
+ ngOnDestroy() {
344
+ this.destroy$.complete();
209
345
  }
210
346
  }
211
- YunzaiI18NService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
347
+ YunzaiI18NService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Injectable });
212
348
  YunzaiI18NService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NService, providedIn: 'root' });
213
349
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NService, decorators: [{
214
350
  type: Injectable,
215
351
  args: [{ providedIn: 'root' }]
216
- }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }]; } });
352
+ }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
217
353
 
218
354
  class YunzaiI18NComponent {
219
- get langs() {
220
- return this.i18n.getLangs();
221
- }
222
355
  get curLangCode() {
223
356
  return this.settings.layout.lang;
224
357
  }
@@ -226,8 +359,16 @@ class YunzaiI18NComponent {
226
359
  this.settings = settings;
227
360
  this.i18n = i18n;
228
361
  this.doc = doc;
362
+ this.destroy$ = new Subject();
229
363
  /** Whether to display language text */
230
364
  this.showLangText = true;
365
+ this.langs = [];
366
+ this.i18n
367
+ .getLangs()
368
+ .pipe(takeUntil(this.destroy$))
369
+ .subscribe(langs => {
370
+ this.langs = langs;
371
+ });
231
372
  }
232
373
  change(lang) {
233
374
  const spinEl = this.doc.createElement('div');
@@ -240,12 +381,15 @@ class YunzaiI18NComponent {
240
381
  setTimeout(() => this.doc.location.reload());
241
382
  });
242
383
  }
384
+ ngOnDestroy() {
385
+ this.destroy$.complete();
386
+ }
243
387
  }
244
388
  YunzaiI18NComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
245
389
  YunzaiI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
246
390
  <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
247
391
  <i nz-icon nzType="global"></i>
248
- {{ 'menu.lang' | i18n }}
392
+ {{ 'lang.nav' | i18n }}
249
393
  <i nz-icon nzType="down"></i>
250
394
  </div>
251
395
  <i
@@ -264,7 +408,12 @@ YunzaiI18NComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
264
408
  [nzSelected]="item.code === curLangCode"
265
409
  (click)="change(item.code)"
266
410
  >
267
- <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
411
+ <template *ngIf="!item.icon">
412
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
413
+ </template>
414
+ <template *ngIf="item.icon">
415
+ <img [src]="'data:image/png;base64,' + item.icon" [alt]="item.abbr" class="pr-xs" />
416
+ </template>
268
417
  {{ item.text }}
269
418
  </li>
270
419
  </ul>
@@ -280,7 +429,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
280
429
  template: `
281
430
  <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
282
431
  <i nz-icon nzType="global"></i>
283
- {{ 'menu.lang' | i18n }}
432
+ {{ 'lang.nav' | i18n }}
284
433
  <i nz-icon nzType="down"></i>
285
434
  </div>
286
435
  <i
@@ -299,7 +448,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
299
448
  [nzSelected]="item.code === curLangCode"
300
449
  (click)="change(item.code)"
301
450
  >
302
- <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
451
+ <template *ngIf="!item.icon">
452
+ <span role="img" [attr.aria-label]="item.text" class="pr-xs">{{ item.abbr }}</span>
453
+ </template>
454
+ <template *ngIf="item.icon">
455
+ <img [src]="'data:image/png;base64,' + item.icon" [alt]="item.abbr" class="pr-xs" />
456
+ </template>
303
457
  {{ item.text }}
304
458
  </li>
305
459
  </ul>
@@ -330,25 +484,25 @@ class YunzaiNotifyComponent {
330
484
  key: 'msg',
331
485
  title: this.y18n.fanyi('notify.message'),
332
486
  list: [],
333
- emptyText: this.y18n.fanyi('notify.message.emptyText'),
487
+ emptyText: this.y18n.fanyi('notify.message.empty'),
334
488
  emptyImage: './assets/tmp/img/message.svg',
335
- clearText: this.y18n.fanyi('notify.message.clearText')
489
+ clearText: this.y18n.fanyi('notify.message.clear')
336
490
  },
337
491
  {
338
492
  key: 'todo',
339
493
  title: this.y18n.fanyi('notify.todo'),
340
494
  list: [],
341
- emptyText: this.y18n.fanyi('notify.todo.emptyText'),
495
+ emptyText: this.y18n.fanyi('notify.todo.empty'),
342
496
  emptyImage: './assets/tmp/img/todo.svg',
343
- clearText: this.y18n.fanyi('notify.todo.clearText')
497
+ clearText: this.y18n.fanyi('notify.todo.clear')
344
498
  },
345
499
  {
346
500
  key: 'notice',
347
501
  title: this.y18n.fanyi('notify.notice'),
348
502
  list: [],
349
- emptyText: this.y18n.fanyi('notify.notice.emptyText'),
503
+ emptyText: this.y18n.fanyi('notify.notice.empty'),
350
504
  emptyImage: './assets/tmp/img/notice.svg',
351
- clearText: this.y18n.fanyi('notify.notice.clearText')
505
+ clearText: this.y18n.fanyi('notify.notice.clear')
352
506
  }
353
507
  ];
354
508
  this.loading = false;
@@ -668,17 +822,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
668
822
  type: Input
669
823
  }] } });
670
824
 
671
- const BUSINESS_DEFAULT_CONFIG = {
672
- baseUrl: '/backstage',
673
- systemCode: 'portal',
674
- loginForm: null,
675
- refreshTokenEnabled: true,
676
- refreshTokenType: 're-request'
677
- };
678
- function mergeBisConfig(srv) {
679
- return srv.merge('bis', BUSINESS_DEFAULT_CONFIG);
680
- }
681
-
682
825
  class YunzaiUserComponent {
683
826
  constructor(injector, msg, tokenService,
684
827
  // @ts-ignore
@@ -716,7 +859,7 @@ class YunzaiUserComponent {
716
859
  }
717
860
  }
718
861
  }
719
- YunzaiUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$3.YunzaiConfigService }, { token: i1$4.CacheService }], target: i0.ɵɵFactoryTarget.Component });
862
+ YunzaiUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Component });
720
863
  YunzaiUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiUserComponent, selector: "yunzai-user", ngImport: i0, template: `
721
864
  <div
722
865
  class="yunzai-default__nav-item d-flex align-items-center px-sm"
@@ -738,7 +881,7 @@ YunzaiUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
738
881
  <li nz-menu-divider></li>
739
882
  <div nz-menu-item (click)="logout()">
740
883
  <i nz-icon nzType="logout" class="mr-sm"></i>
741
- {{ 'menu.account.logout' | i18n }}
884
+ {{ 'logout' | i18n }}
742
885
  </div>
743
886
  </div>
744
887
  </nz-dropdown-menu>
@@ -768,7 +911,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
768
911
  <li nz-menu-divider></li>
769
912
  <div nz-menu-item (click)="logout()">
770
913
  <i nz-icon nzType="logout" class="mr-sm"></i>
771
- {{ 'menu.account.logout' | i18n }}
914
+ {{ 'logout' | i18n }}
772
915
  </div>
773
916
  </div>
774
917
  </nz-dropdown-menu>
@@ -778,14 +921,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
778
921
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: undefined, decorators: [{
779
922
  type: Inject,
780
923
  args: [YA_SERVICE_TOKEN]
781
- }] }, { type: i1$3.YunzaiConfigService }, { type: i1$4.CacheService }]; } });
782
-
783
- var TopicType;
784
- (function (TopicType) {
785
- TopicType[TopicType["FULL"] = 0] = "FULL";
786
- TopicType[TopicType["OWN"] = 1] = "OWN";
787
- TopicType[TopicType["EVERY"] = 2] = "EVERY";
788
- })(TopicType || (TopicType = {}));
924
+ }] }, { type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
789
925
 
790
926
  class LayoutNavApplicationComponent {
791
927
  constructor(cacheService, i18n, http, inject) {
@@ -793,10 +929,9 @@ class LayoutNavApplicationComponent {
793
929
  this.i18n = i18n;
794
930
  this.http = http;
795
931
  this.inject = inject;
796
- this.TopicType = TopicType;
797
932
  this.state = {
798
933
  active: false,
799
- type: TopicType.FULL,
934
+ type: 'all',
800
935
  topic: undefined,
801
936
  topics: [],
802
937
  list: [],
@@ -805,18 +940,32 @@ class LayoutNavApplicationComponent {
805
940
  };
806
941
  }
807
942
  ngOnInit() {
808
- this.state.list = this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
943
+ this.fetchAllTopic();
944
+ this.attachNav('all');
809
945
  }
810
- initTopic(type) {
811
- this.state.search = null;
812
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
946
+ fetchAllTopic() {
947
+ this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
948
+ }
949
+ attachNav(type, topic) {
813
950
  this.state.type = type;
951
+ this.clearSearch();
952
+ if (type === 'all') {
953
+ this.displayAllNav();
954
+ }
955
+ if (type === 'mine') {
956
+ this.displayMineNav();
957
+ }
958
+ if (type === 'other' && topic) {
959
+ this.displayOtherNav(topic);
960
+ }
814
961
  }
815
- full() {
816
- this.initTopic(TopicType.FULL);
962
+ clearSearch() {
963
+ this.state.search = null;
964
+ }
965
+ displayAllNav() {
966
+ this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
817
967
  }
818
- own() {
819
- this.initTopic(TopicType.OWN);
968
+ displayMineNav() {
820
969
  const temp = this.cacheService.get('_yz_header', { mode: 'none' });
821
970
  this.state.list = temp
822
971
  .filter((topic) => {
@@ -829,11 +978,10 @@ class LayoutNavApplicationComponent {
829
978
  return topic.children.length > 0;
830
979
  });
831
980
  }
832
- every(e) {
833
- this.initTopic(TopicType.EVERY);
834
- this.state.topic = e;
981
+ displayOtherNav(topic) {
982
+ this.state.topic = topic;
835
983
  const temp = this.cacheService.get('_yz_header', { mode: 'none' });
836
- this.state.list = [...temp.filter(t => t.key === e.key)[0].children];
984
+ this.state.list = temp.filter(t => t.key === topic.key)[0].children;
837
985
  }
838
986
  diffChange(flag) {
839
987
  if (flag) {
@@ -895,9 +1043,9 @@ class LayoutNavApplicationComponent {
895
1043
  this.state.destroy$.complete();
896
1044
  }
897
1045
  }
898
- LayoutNavApplicationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: i1$4.CacheService }, { token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1046
+ LayoutNavApplicationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: i1$3.CacheService }, { token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
899
1047
  LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
900
- <!-- template start-->
1048
+ <!-- search start-->
901
1049
  <ng-template #search>
902
1050
  <div nz-row class="yz-application-list-search">
903
1051
  <nz-input-group [nzPrefix]="prefixTemplate">
@@ -914,45 +1062,50 @@ LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
914
1062
  </nz-input-group>
915
1063
  </div>
916
1064
  </ng-template>
1065
+ <!-- search end -->
1066
+
1067
+ <!-- right menu start -->
917
1068
  <ng-template #ld>
918
1069
  <div class="yz-application-list">
919
1070
  <ul>
920
- <li *ngFor="let d of state.list">
921
- <h5>{{ d.name }}</h5>
922
- <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
1071
+ <li *ngFor="let topic of state.list">
1072
+ <h5>{{ topic.name | i18n }}</h5>
1073
+ <a href="javascript:;" *ngFor="let nav of topic.children" (click)="open(nav)">{{ nav.name | i18n }}</a>
923
1074
  </li>
924
1075
  </ul>
925
1076
  </div>
926
1077
  </ng-template>
927
- <!-- template end-->
1078
+ <!-- right menu end -->
928
1079
 
929
1080
  <!-- button start-->
930
- <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'application.button' | i18n }}</div>
1081
+ <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
931
1082
  <!-- button end-->
932
1083
 
933
1084
  <!-- header start-->
934
1085
  <div class="yz-application" nz-row *ngIf="state.active">
935
1086
  <div nz-col [nzSpan]="3" class="yz-application-topic">
936
- <div class="yz-application-text" (click)="full()">{{ 'application.all' | i18n }}</div>
937
- <div class="yz-application-text" (click)="own()">{{ 'application.mine' | i18n }}</div>
938
- <div class="yz-application-text" *ngFor="let d of state.topics" (click)="every(d)">{{ d.name }}</div>
1087
+ <div class="yz-application-text" (click)="attachNav('all')">{{ 'mode.nav.all' | i18n }}</div>
1088
+ <div class="yz-application-text" (click)="attachNav('mine')">{{ 'mode.nav.mine' | i18n }}</div>
1089
+ <div class="yz-application-text" *ngFor="let nav of state.topics" (click)="attachNav('other', nav)">{{
1090
+ nav.name | i18n
1091
+ }}</div>
939
1092
  </div>
940
1093
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
941
- <div *ngSwitchCase="TopicType.FULL">
1094
+ <div *ngIf="state.type === 'all'">
942
1095
  <ng-template [ngTemplateOutlet]="search"></ng-template>
943
1096
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
944
1097
  </div>
945
- <div *ngSwitchCase="TopicType.OWN">
1098
+ <div *ngIf="state.type === 'mine'">
946
1099
  <ng-template [ngTemplateOutlet]="search"></ng-template>
947
1100
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
948
1101
  </div>
949
- <div *ngSwitchCase="TopicType.EVERY" class="yz-application-list">
1102
+ <div *ngIf="state.type === 'other'" class="yz-application-list">
950
1103
  <div class="yz-application-list-item">
951
1104
  <ul>
952
- <li *ngFor="let d of state.list" (click)="open(d)">
1105
+ <li *ngFor="let nav of state.list" (click)="open(nav)">
953
1106
  <a href="javascript:;">
954
- <h4>{{ d.name }}</h4>
955
- <p>{{ d.intro }}</p>
1107
+ <h4>{{ nav.name | i18n }}</h4>
1108
+ <p>{{ nav.intro | i18n }}</p>
956
1109
  </a>
957
1110
  </li>
958
1111
  </ul>
@@ -961,13 +1114,13 @@ LayoutNavApplicationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
961
1114
  </div>
962
1115
  </div>
963
1116
  <!-- header end-->
964
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
1117
+ `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] });
965
1118
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavApplicationComponent, decorators: [{
966
1119
  type: Component,
967
1120
  args: [{
968
1121
  selector: `layout-nav-application`,
969
1122
  template: `
970
- <!-- template start-->
1123
+ <!-- search start-->
971
1124
  <ng-template #search>
972
1125
  <div nz-row class="yz-application-list-search">
973
1126
  <nz-input-group [nzPrefix]="prefixTemplate">
@@ -984,45 +1137,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
984
1137
  </nz-input-group>
985
1138
  </div>
986
1139
  </ng-template>
1140
+ <!-- search end -->
1141
+
1142
+ <!-- right menu start -->
987
1143
  <ng-template #ld>
988
1144
  <div class="yz-application-list">
989
1145
  <ul>
990
- <li *ngFor="let d of state.list">
991
- <h5>{{ d.name }}</h5>
992
- <a href="javascript:;" *ngFor="let cd of d.children" (click)="open(cd)">{{ cd.name }}</a>
1146
+ <li *ngFor="let topic of state.list">
1147
+ <h5>{{ topic.name | i18n }}</h5>
1148
+ <a href="javascript:;" *ngFor="let nav of topic.children" (click)="open(nav)">{{ nav.name | i18n }}</a>
993
1149
  </li>
994
1150
  </ul>
995
1151
  </div>
996
1152
  </ng-template>
997
- <!-- template end-->
1153
+ <!-- right menu end -->
998
1154
 
999
1155
  <!-- button start-->
1000
- <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'application.button' | i18n }}</div>
1156
+ <div class="yunzai-default__nav-item" (click)="diffChange()"> {{ 'mode.nav' | i18n }}</div>
1001
1157
  <!-- button end-->
1002
1158
 
1003
1159
  <!-- header start-->
1004
1160
  <div class="yz-application" nz-row *ngIf="state.active">
1005
1161
  <div nz-col [nzSpan]="3" class="yz-application-topic">
1006
- <div class="yz-application-text" (click)="full()">{{ 'application.all' | i18n }}</div>
1007
- <div class="yz-application-text" (click)="own()">{{ 'application.mine' | i18n }}</div>
1008
- <div class="yz-application-text" *ngFor="let d of state.topics" (click)="every(d)">{{ d.name }}</div>
1162
+ <div class="yz-application-text" (click)="attachNav('all')">{{ 'mode.nav.all' | i18n }}</div>
1163
+ <div class="yz-application-text" (click)="attachNav('mine')">{{ 'mode.nav.mine' | i18n }}</div>
1164
+ <div class="yz-application-text" *ngFor="let nav of state.topics" (click)="attachNav('other', nav)">{{
1165
+ nav.name | i18n
1166
+ }}</div>
1009
1167
  </div>
1010
1168
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
1011
- <div *ngSwitchCase="TopicType.FULL">
1169
+ <div *ngIf="state.type === 'all'">
1012
1170
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1013
1171
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1014
1172
  </div>
1015
- <div *ngSwitchCase="TopicType.OWN">
1173
+ <div *ngIf="state.type === 'mine'">
1016
1174
  <ng-template [ngTemplateOutlet]="search"></ng-template>
1017
1175
  <ng-template [ngTemplateOutlet]="ld"></ng-template>
1018
1176
  </div>
1019
- <div *ngSwitchCase="TopicType.EVERY" class="yz-application-list">
1177
+ <div *ngIf="state.type === 'other'" class="yz-application-list">
1020
1178
  <div class="yz-application-list-item">
1021
1179
  <ul>
1022
- <li *ngFor="let d of state.list" (click)="open(d)">
1180
+ <li *ngFor="let nav of state.list" (click)="open(nav)">
1023
1181
  <a href="javascript:;">
1024
- <h4>{{ d.name }}</h4>
1025
- <p>{{ d.intro }}</p>
1182
+ <h4>{{ nav.name | i18n }}</h4>
1183
+ <p>{{ nav.intro | i18n }}</p>
1026
1184
  </a>
1027
1185
  </li>
1028
1186
  </ul>
@@ -1033,7 +1191,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1033
1191
  <!-- header end-->
1034
1192
  `
1035
1193
  }]
1036
- }], ctorParameters: function () { return [{ type: i1$4.CacheService }, { type: YunzaiI18NService }, { type: i1$2._HttpClient }, { type: i0.Injector }]; } });
1194
+ }], ctorParameters: function () { return [{ type: i1$3.CacheService }, { type: YunzaiI18NService }, { type: i1$2._HttpClient }, { type: i0.Injector }]; } });
1037
1195
 
1038
1196
  class LayoutNavGroupComponent {
1039
1197
  constructor(inject, cacheService, http) {
@@ -1077,7 +1235,7 @@ class LayoutNavGroupComponent {
1077
1235
  this.state.destroy$.complete();
1078
1236
  }
1079
1237
  }
1080
- LayoutNavGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$4.CacheService }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
1238
+ LayoutNavGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$3.CacheService }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component });
1081
1239
  LayoutNavGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: LayoutNavGroupComponent, selector: "layout-nav-group", ngImport: i0, template: `
1082
1240
  <div class="yz-application-group">
1083
1241
  <nz-tabset>
@@ -1141,7 +1299,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1141
1299
  </div>
1142
1300
  `
1143
1301
  }]
1144
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$4.CacheService }, { type: i1$2._HttpClient }]; } });
1302
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$3.CacheService }, { type: i1$2._HttpClient }]; } });
1145
1303
 
1146
1304
  class LayoutNavTileComponent {
1147
1305
  constructor() { }
@@ -1212,12 +1370,27 @@ class YunzaiLayoutBasicComponent {
1212
1370
  }
1213
1371
  ngOnInit() {
1214
1372
  this.initLogo();
1373
+ this.initFavicon();
1215
1374
  this.initNavType();
1216
1375
  this.initAside();
1217
1376
  this.addLayoutDisplayListener();
1218
1377
  this.stompService.listen();
1219
1378
  this.toIndex();
1220
1379
  }
1380
+ initFavicon() {
1381
+ console.log('init favicon');
1382
+ const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1383
+ if (projectInfo.faviconUrl) {
1384
+ hasFavicon(projectInfo.faviconUrl).then((has) => {
1385
+ if (has) {
1386
+ setFavicon(projectInfo.faviconUrl);
1387
+ }
1388
+ else {
1389
+ setFavicon('./assets/favicon.ico');
1390
+ }
1391
+ });
1392
+ }
1393
+ }
1221
1394
  initAside() {
1222
1395
  const aside = this.cacheService.get('_yz_current', { mode: 'none' });
1223
1396
  this.state.aside = { ...aside };
@@ -1268,7 +1441,7 @@ class YunzaiLayoutBasicComponent {
1268
1441
  this.state.destroy$.complete();
1269
1442
  }
1270
1443
  }
1271
- YunzaiLayoutBasicComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiLayoutBasicComponent, deps: [{ token: i1$5.LayoutDisplayService }, { token: i1$4.CacheService }, { token: i3$3.StompService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component });
1444
+ YunzaiLayoutBasicComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiLayoutBasicComponent, deps: [{ token: i1$5.LayoutDisplayService }, { token: i1$3.CacheService }, { token: i3$3.StompService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component });
1272
1445
  YunzaiLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: YunzaiLayoutBasicComponent, selector: "yz-layout-basic", ngImport: i0, template: `<layout-default
1273
1446
  [options]="options"
1274
1447
  [asideUser]="asideUserTpl"
@@ -1306,20 +1479,20 @@ YunzaiLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0
1306
1479
  <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1307
1480
  <div nz-menu style="width: 200px;">
1308
1481
  <div nz-menu-item>
1309
- {{ 'menu.application.mode' | i18n }}
1482
+ {{ 'mode.nav' | i18n }}
1310
1483
  </div>
1311
1484
 
1312
1485
  <div nz-menu-item (click)="onNavTypeChange(NavType.APPLICATION)">
1313
1486
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1314
- {{ 'menu.application.application' | i18n }}
1487
+ {{ 'mode.nav.application' | i18n }}
1315
1488
  </div>
1316
1489
  <div nz-menu-item (click)="onNavTypeChange(NavType.GROUP)">
1317
1490
  <i nz-icon nzType="group" class="mr-sm"></i>
1318
- {{ 'menu.application.group' | i18n }}
1491
+ {{ 'mode.nav.group' | i18n }}
1319
1492
  </div>
1320
1493
  <div nz-menu-item (click)="onNavTypeChange(NavType.TILE)">
1321
1494
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1322
- {{ 'menu.application.tile' | i18n }}
1495
+ {{ 'mode.nav.tile' | i18n }}
1323
1496
  </div>
1324
1497
  <div nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1325
1498
  <div nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
@@ -1336,13 +1509,13 @@ YunzaiLayoutBasicComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0
1336
1509
  <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1337
1510
  <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1338
1511
  <div class="yunzai-default__aside-user-info">
1339
- <strong>{{ aside.name }}</strong>
1340
- <p class="mb0">{{ aside.intro }}</p>
1512
+ <strong>{{ aside.name | i18n }}</strong>
1513
+ <p class="mb0">{{ aside.intro | i18n }}</p>
1341
1514
  </div>
1342
1515
  </div>
1343
1516
  <nz-dropdown-menu #userMenu="nzDropdownMenu">
1344
1517
  <ul nz-menu>
1345
- <li nz-menu-item routerLink="/">{{ 'menu.backtohome' | i18n }}</li>
1518
+ <li nz-menu-item routerLink="/">{{ 'back.home' | i18n }}</li>
1346
1519
  </ul>
1347
1520
  </nz-dropdown-menu>
1348
1521
  </ng-template>
@@ -1394,20 +1567,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1394
1567
  <nz-dropdown-menu #settingsMenu="nzDropdownMenu">
1395
1568
  <div nz-menu style="width: 200px;">
1396
1569
  <div nz-menu-item>
1397
- {{ 'menu.application.mode' | i18n }}
1570
+ {{ 'mode.nav' | i18n }}
1398
1571
  </div>
1399
1572
 
1400
1573
  <div nz-menu-item (click)="onNavTypeChange(NavType.APPLICATION)">
1401
1574
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1402
- {{ 'menu.application.application' | i18n }}
1575
+ {{ 'mode.nav.application' | i18n }}
1403
1576
  </div>
1404
1577
  <div nz-menu-item (click)="onNavTypeChange(NavType.GROUP)">
1405
1578
  <i nz-icon nzType="group" class="mr-sm"></i>
1406
- {{ 'menu.application.group' | i18n }}
1579
+ {{ 'mode.nav.group' | i18n }}
1407
1580
  </div>
1408
1581
  <div nz-menu-item (click)="onNavTypeChange(NavType.TILE)">
1409
1582
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1410
- {{ 'menu.application.tile' | i18n }}
1583
+ {{ 'mode.nav.tile' | i18n }}
1411
1584
  </div>
1412
1585
  <div nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1413
1586
  <div nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
@@ -1424,13 +1597,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1424
1597
  <div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="yunzai-default__aside-user">
1425
1598
  <nz-avatar class="yunzai-default__aside-user-avatar" [nzSrc]="aside.icon"></nz-avatar>
1426
1599
  <div class="yunzai-default__aside-user-info">
1427
- <strong>{{ aside.name }}</strong>
1428
- <p class="mb0">{{ aside.intro }}</p>
1600
+ <strong>{{ aside.name | i18n }}</strong>
1601
+ <p class="mb0">{{ aside.intro | i18n }}</p>
1429
1602
  </div>
1430
1603
  </div>
1431
1604
  <nz-dropdown-menu #userMenu="nzDropdownMenu">
1432
1605
  <ul nz-menu>
1433
- <li nz-menu-item routerLink="/">{{ 'menu.backtohome' | i18n }}</li>
1606
+ <li nz-menu-item routerLink="/">{{ 'back.home' | i18n }}</li>
1434
1607
  </ul>
1435
1608
  </nz-dropdown-menu>
1436
1609
  </ng-template>
@@ -1442,7 +1615,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1442
1615
  <router-outlet></router-outlet>
1443
1616
  </ng-template> `
1444
1617
  }]
1445
- }], ctorParameters: function () { return [{ type: i1$5.LayoutDisplayService }, { type: i1$4.CacheService }, { type: i3$3.StompService }, { type: undefined, decorators: [{
1618
+ }], ctorParameters: function () { return [{ type: i1$5.LayoutDisplayService }, { type: i1$3.CacheService }, { type: i3$3.StompService }, { type: undefined, decorators: [{
1446
1619
  type: Inject,
1447
1620
  args: [WINDOW]
1448
1621
  }] }]; } });
@@ -1538,14 +1711,14 @@ class ActGuard {
1538
1711
  });
1539
1712
  }
1540
1713
  }
1541
- ActGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ActGuard, deps: [{ token: i1$3.YunzaiConfigService }, { token: i1$4.CacheService }, { token: i1$3.PathToRegexpService }, { token: i5$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1714
+ ActGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ActGuard, deps: [{ token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }, { token: i1$4.PathToRegexpService }, { token: i5$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1542
1715
  ActGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ActGuard, providedIn: 'root' });
1543
1716
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ActGuard, decorators: [{
1544
1717
  type: Injectable,
1545
1718
  args: [{
1546
1719
  providedIn: 'root'
1547
1720
  }]
1548
- }], ctorParameters: function () { return [{ type: i1$3.YunzaiConfigService }, { type: i1$4.CacheService }, { type: i1$3.PathToRegexpService }, { type: i5$1.Router }]; } });
1721
+ }], ctorParameters: function () { return [{ type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }, { type: i1$4.PathToRegexpService }, { type: i5$1.Router }]; } });
1549
1722
 
1550
1723
  class YunzaiAuthService {
1551
1724
  constructor(injector) {
@@ -1867,6 +2040,8 @@ class YunzaiDefaultInterceptor {
1867
2040
  if (url.includes('.json') && url.includes('assets')) {
1868
2041
  url = req.url;
1869
2042
  }
2043
+ if (url.includes('i18n'))
2044
+ return next.handle(req);
1870
2045
  // 加入语言头
1871
2046
  const newReq = req.clone({ url, setHeaders: this.getAdditionalHeaders(req.headers) });
1872
2047
  return next.handle(newReq).pipe(mergeMap(ev => {
@@ -2762,7 +2937,9 @@ class YunzaiStartupService {
2762
2937
  }
2763
2938
  load() {
2764
2939
  log$1('startup.service: ', 'load');
2765
- const defaultLang = this.i18n.defaultLang;
2940
+ let defaultLang = this.cacheService.getNone(this.i18n.cacheDefaultKey);
2941
+ if (!defaultLang)
2942
+ defaultLang = this.i18n.defaultLang;
2766
2943
  return this.i18n.loadLangData(defaultLang).pipe(mergeMap(langData => {
2767
2944
  log$1('startup.service: ', 'set i18n, defaultLang->', defaultLang, ' langData->', langData);
2768
2945
  this.i18n.use(defaultLang, langData);
@@ -2832,7 +3009,7 @@ class YunzaiStartupService {
2832
3009
  }
2833
3010
  }
2834
3011
  }
2835
- YunzaiStartupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiStartupService, deps: [{ token: i8.NzIconService }, { token: i1$2.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: WINDOW }, { token: i1$2.SettingsService }, { token: i3$4.ACLService }, { token: i1$2.TitleService }, { token: YunzaiAuthService }, { token: i1$4.CacheService }, { token: i1$3.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
3012
+ YunzaiStartupService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiStartupService, deps: [{ token: i8.NzIconService }, { token: i1$2.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: WINDOW }, { token: i1$2.SettingsService }, { token: i3$4.ACLService }, { token: i1$2.TitleService }, { token: YunzaiAuthService }, { token: i1$3.CacheService }, { token: i1$4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2836
3013
  YunzaiStartupService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiStartupService });
2837
3014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: YunzaiStartupService, decorators: [{
2838
3015
  type: Injectable
@@ -2842,7 +3019,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2842
3019
  }] }, { type: undefined, decorators: [{
2843
3020
  type: Inject,
2844
3021
  args: [WINDOW]
2845
- }] }, { type: i1$2.SettingsService }, { type: i3$4.ACLService }, { type: i1$2.TitleService }, { type: YunzaiAuthService }, { type: i1$4.CacheService }, { type: i1$3.YunzaiConfigService }]; } });
3022
+ }] }, { type: i1$2.SettingsService }, { type: i3$4.ACLService }, { type: i1$2.TitleService }, { type: YunzaiAuthService }, { type: i1$3.CacheService }, { type: i1$4.YunzaiConfigService }]; } });
2846
3023
  function mapYzSideToYelonMenu(menus) {
2847
3024
  menus.forEach(menu => {
2848
3025
  menu.badgeDot = menu.badge_dot || null;
@@ -2891,5 +3068,5 @@ const YUNZAI_APPINIT_PROVIDES = [
2891
3068
  * Generated bundle index. Do not edit.
2892
3069
  */
2893
3070
 
2894
- export { ActGuard, BUSINESS_DEFAULT_CONFIG, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, TopicType, YUNZAI_APPINIT_PROVIDES, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
3071
+ export { ActGuard, BUSINESS_DEFAULT_CONFIG, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, YUNZAI_APPINIT_PROVIDES, YUNZAI_LANGS, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
2895
3072
  //# sourceMappingURL=layout.mjs.map