@yelon/bis 12.0.8 → 12.0.12

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 (35) hide show
  1. package/bundles/bis.umd.js +3 -3
  2. package/bundles/layout.umd.js +176 -41
  3. package/bundles/layout.umd.js.map +1 -1
  4. package/bundles/shared.umd.js +4 -17
  5. package/bundles/shared.umd.js.map +1 -1
  6. package/esm2015/{shared → layout}/bis.config.js +2 -2
  7. package/esm2015/layout/public_api.js +4 -1
  8. package/esm2015/layout/stomp.config.js +20 -0
  9. package/esm2015/layout/widgets/yz.application.component.js +5 -5
  10. package/esm2015/layout/widgets/yz.notify.component.js +3 -3
  11. package/esm2015/layout/widgets/yz.them-btn.component.js +32 -12
  12. package/esm2015/layout/widgets/yz.user.component.js +3 -3
  13. package/esm2015/layout/yz.auth.service.js +2 -2
  14. package/esm2015/layout/yz.basic.component.js +11 -4
  15. package/esm2015/layout/yz.default.interceptor.js +7 -4
  16. package/esm2015/layout/yz.startup.service.js +4 -3
  17. package/esm2015/layout/yz.stomp.service.js +91 -0
  18. package/esm2015/shared/public_api.js +1 -2
  19. package/fesm2015/layout.js +170 -30
  20. package/fesm2015/layout.js.map +1 -1
  21. package/fesm2015/shared.js +1 -12
  22. package/fesm2015/shared.js.map +1 -1
  23. package/{shared → layout}/bis.config.d.ts +1 -1
  24. package/layout/layout.metadata.json +1 -1
  25. package/layout/public_api.d.ts +3 -0
  26. package/layout/stomp.config.d.ts +3 -0
  27. package/layout/style/index.less +10 -2
  28. package/layout/yz.basic.component.d.ts +6 -3
  29. package/layout/yz.default.interceptor.d.ts +1 -0
  30. package/layout/yz.stomp.service.d.ts +39 -0
  31. package/package.json +10 -10
  32. package/shared/public_api.d.ts +0 -1
  33. package/shared/shared.metadata.json +1 -1
  34. package/theme-dark.less +15 -19
  35. package/theme-default.less +7 -8
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license ng-yunzai(devcui@outlook.com) v12.0.8
2
+ * @license ng-yunzai(devcui@outlook.com) v12.0.12
3
3
  * (c) 2020 devcui https://github.com/hbyunzai/yelon/
4
4
  * License: MIT
5
5
  */
6
6
  (function (factory) {
7
7
  typeof define === 'function' && define.amd ? define('@yelon/bis', factory) :
8
8
  factory();
9
- }((function () { 'use strict';
9
+ })((function () { 'use strict';
10
10
 
11
11
  var public_api = void 0;
12
12
 
@@ -14,5 +14,5 @@
14
14
  * Generated bundle index. Do not edit.
15
15
  */
16
16
 
17
- })));
17
+ }));
18
18
  //# sourceMappingURL=bis.umd.js.map
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license ng-yunzai(devcui@outlook.com) v12.0.8
2
+ * @license ng-yunzai(devcui@outlook.com) v12.0.12
3
3
  * (c) 2020 devcui https://github.com/hbyunzai/yelon/
4
4
  * License: MIT
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@yelon/cache'), require('@yelon/theme'), require('@yelon/util'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/common/locales/en'), require('@angular/common/locales/zh'), require('@angular/common/locales/zh-Hant'), require('date-fns/locale'), require('ng-zorro-antd/i18n'), require('@yelon/util/config'), require('@yelon/util/decorator'), require('rxjs'), require('rxjs/operators'), require('date-fns'), require('ng-zorro-antd/message'), require('@yelon/util/other'), require('@angular/cdk/bidi'), require('@yelon/theme/theme-btn'), require('@yelon/auth'), require('@yelon/bis/shared'), require('ng-zorro-antd/modal'), require('screenfull'), require('@angular/common/http'), require('@angular/forms'), require('@angular/router'), require('ng-zorro-antd/notification'), require('ng-zorro-antd/icon'), require('@yelon/acl')) :
8
- typeof define === 'function' && define.amd ? define('@yelon/bis/layout', ['exports', '@angular/core', '@yelon/cache', '@yelon/theme', '@yelon/util', '@angular/cdk/platform', '@angular/common', '@angular/common/locales/en', '@angular/common/locales/zh', '@angular/common/locales/zh-Hant', 'date-fns/locale', 'ng-zorro-antd/i18n', '@yelon/util/config', '@yelon/util/decorator', 'rxjs', 'rxjs/operators', 'date-fns', 'ng-zorro-antd/message', '@yelon/util/other', '@angular/cdk/bidi', '@yelon/theme/theme-btn', '@yelon/auth', '@yelon/bis/shared', 'ng-zorro-antd/modal', 'screenfull', '@angular/common/http', '@angular/forms', '@angular/router', 'ng-zorro-antd/notification', 'ng-zorro-antd/icon', '@yelon/acl'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.yelon = global.yelon || {}, global.yelon.bis = global.yelon.bis || {}, global.yelon.bis.layout = {}), global.ng.core, global.yelon.cache, global.yelon.theme, global.yelon.util, global.ng.cdk.platform, global.ng.common, global.ng.common.locales.en, global.ng.common.locales.zh, global.ng.common.locales.zhHant, global.locale, global['ng-zorro-antd/i18n'], global.yelon.util.config, global.decorator, global.rxjs, global.rxjs.operators, global.DateFns, global.message, global.yelon.util.other, global.ng.cdk.bidi, global.themeBtn, global.yelon.auth, global.yelon.bis.shared, global['ng-zorro-antd/modal'], global.screenfull, global.ng.common.http, global.ng.forms, global.ng.router, global.notification, global['ng-zorro-antd/icon'], global.yelon.acl));
10
- }(this, (function (exports, i0, cache, i1, util, i3, common, ngEn, ngZh, ngZhTw, locale, i2, i4, decorator, rxjs, operators, dateFns, message, other, bidi, themeBtn, auth, shared, modal, screenfull, http, forms, router, notification, icon, acl) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@yelon/cache'), require('@yelon/theme'), require('@yelon/util'), require('@angular/cdk/platform'), require('@angular/common'), require('@angular/common/locales/en'), require('@angular/common/locales/zh'), require('@angular/common/locales/zh-Hant'), require('date-fns/locale'), require('ng-zorro-antd/i18n'), require('@yelon/util/config'), require('@yelon/util/decorator'), require('rxjs'), require('rxjs/operators'), require('date-fns'), require('ng-zorro-antd/message'), require('@yelon/util/other'), require('@angular/cdk/bidi'), require('@yelon/theme/theme-btn'), require('@yelon/auth'), require('ng-zorro-antd/modal'), require('screenfull'), require('@angular/common/http'), require('@angular/forms'), require('@angular/router'), require('@yelon/bis/shared'), require('@stomp/rx-stomp'), require('ng-zorro-antd/notification'), require('ng-zorro-antd/icon'), require('@yelon/acl')) :
8
+ typeof define === 'function' && define.amd ? define('@yelon/bis/layout', ['exports', '@angular/core', '@yelon/cache', '@yelon/theme', '@yelon/util', '@angular/cdk/platform', '@angular/common', '@angular/common/locales/en', '@angular/common/locales/zh', '@angular/common/locales/zh-Hant', 'date-fns/locale', 'ng-zorro-antd/i18n', '@yelon/util/config', '@yelon/util/decorator', 'rxjs', 'rxjs/operators', 'date-fns', 'ng-zorro-antd/message', '@yelon/util/other', '@angular/cdk/bidi', '@yelon/theme/theme-btn', '@yelon/auth', 'ng-zorro-antd/modal', 'screenfull', '@angular/common/http', '@angular/forms', '@angular/router', '@yelon/bis/shared', '@stomp/rx-stomp', 'ng-zorro-antd/notification', 'ng-zorro-antd/icon', '@yelon/acl'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.yelon = global.yelon || {}, global.yelon.bis = global.yelon.bis || {}, global.yelon.bis.layout = {}), global.ng.core, global.yelon.cache, global.yelon.theme, global.yelon.util, global.ng.cdk.platform, global.ng.common, global.ng.common.locales.en, global.ng.common.locales.zh, global.ng.common.locales.zhHant, global.locale, global["ng-zorro-antd/i18n"], global.yelon.util.config, global.decorator, global.rxjs, global.rxjs.operators, global.DateFns, global.message, global.yelon.util.other, global.ng.cdk.bidi, global.themeBtn, global.yelon.auth, global["ng-zorro-antd/modal"], global.screenfull, global.ng.common.http, global.ng.forms, global.ng.router, global.yelon.bis.shared, global.rxStomp, global.i3$1, global["ng-zorro-antd/icon"], global.yelon.acl));
10
+ })(this, (function (exports, i0, i2$1, i1, util, i3, common, ngEn, ngZh, ngZhTw, locale, i2, i4, decorator, rxjs, operators, dateFns, message, other, bidi, themeBtn, auth, modal, screenfull, http, forms, router, shared, rxStomp, i3$1, icon, acl) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
@@ -20,18 +20,17 @@
20
20
  var d = Object.getOwnPropertyDescriptor(e, k);
21
21
  Object.defineProperty(n, k, d.get ? d : {
22
22
  enumerable: true,
23
- get: function () {
24
- return e[k];
25
- }
23
+ get: function () { return e[k]; }
26
24
  });
27
25
  }
28
26
  });
29
27
  }
30
- n['default'] = e;
28
+ n["default"] = e;
31
29
  return Object.freeze(n);
32
30
  }
33
31
 
34
32
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
33
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
35
34
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
36
35
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
37
36
  var ngEn__default = /*#__PURE__*/_interopDefaultLegacy(ngEn);
@@ -40,6 +39,7 @@
40
39
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
41
40
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
42
41
  var screenfull__namespace = /*#__PURE__*/_interopNamespace(screenfull);
42
+ var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
43
43
 
44
44
  /*! *****************************************************************************
45
45
  Copyright (c) Microsoft Corporation.
@@ -363,7 +363,7 @@
363
363
  var LANGS = {
364
364
  'zh-CN': {
365
365
  text: '简体中文',
366
- ng: ngZh__default['default'],
366
+ ng: ngZh__default["default"],
367
367
  zorro: i2.zh_CN,
368
368
  date: locale.zhCN,
369
369
  yelon: i1.zh_CN,
@@ -371,7 +371,7 @@
371
371
  },
372
372
  'zh-TW': {
373
373
  text: '繁体中文',
374
- ng: ngZhTw__default['default'],
374
+ ng: ngZhTw__default["default"],
375
375
  zorro: i2.zh_TW,
376
376
  date: locale.zhTW,
377
377
  yelon: i1.zh_TW,
@@ -379,7 +379,7 @@
379
379
  },
380
380
  'en-US': {
381
381
  text: 'English',
382
- ng: ngEn__default['default'],
382
+ ng: ngEn__default["default"],
383
383
  zorro: i2.en_US,
384
384
  date: locale.enUS,
385
385
  yelon: i1.en_US,
@@ -569,13 +569,13 @@
569
569
  YzHeaderApplicationComponent.decorators = [
570
570
  { type: i0.Component, args: [{
571
571
  selector: 'yz-header-application',
572
- template: "\n <!-- template start-->\n <ng-template #search>\n <div nz-row class=\"yz-application-list-search\">\n <nz-input-group [nzPrefix]=\"prefixTemplate\">\n <input\n type=\"text\"\n nz-input\n [placeholder]=\"'\u8BF7\u8F93\u5165\u8981\u641C\u7D22\u7684\u5E94\u7528\u540D\u79F0!'\"\n [(ngModel)]=\"searchValue\"\n (ngModelChange)=\"onSearch()\"\n />\n <ng-template #prefixTemplate>\n <i nz-icon nzType=\"search\" nzTheme=\"outline\"></i>\n </ng-template>\n </nz-input-group>\n </div>\n </ng-template>\n <ng-template #ld>\n <div class=\"yz-application-list\">\n <ul>\n <li *ngFor=\"let d of listData\">\n <h5>{{ d.name }}</h5>\n <a href=\"javascript:;\" *ngFor=\"let cd of d.children\" (click)=\"open(cd)\">{{ cd.name }}</a>\n </li>\n </ul>\n </div>\n </ng-template>\n <!-- template end-->\n\n <!-- button start-->\n <div class=\"yunzai-default__nav-item\" (click)=\"diffChange()\"> \u5E94\u7528\u4E0E\u670D\u52A1</div>\n <!-- button end-->\n\n <!-- header start-->\n <div class=\"yz-application\" nz-row *ngIf=\"active\">\n <div nz-col [nzSpan]=\"3\" class=\"yz-application-topic\">\n <div class=\"yz-application-text\" (click)=\"full()\">\u5168\u90E8\u5E94\u7528</div>\n <div class=\"yz-application-text\" (click)=\"own()\">\u6211\u7684\u5E94\u7528</div>\n <div class=\"yz-application-text\" *ngFor=\"let d of topicData\" (click)=\"every(d)\">\n {{ d.name }}\n </div>\n </div>\n <div nz-col [nzSpan]=\"21\" [ngSwitch]=\"topic\" class=\"yz-application-container\">\n <div *ngSwitchCase=\"T.FULL\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"ld\"></ng-template>\n </div>\n <div *ngSwitchCase=\"T.OWN\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"ld\"></ng-template>\n </div>\n <div *ngSwitchCase=\"T.EVERY\" class=\"yz-application-list\">\n <div class=\"yz-application-list-item\">\n <ul>\n <li *ngFor=\"let d of listData\" (click)=\"open(d)\">\n <a href=\"javascript:;\">\n <h4>{{ d.name }}</h4>\n <p>{{ d.intro }}</p>\n </a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n <!-- header end-->\n ",
572
+ template: "\n <!-- template start-->\n <ng-template #search>\n <div nz-row class=\"yz-application-list-search\">\n <nz-input-group [nzPrefix]=\"prefixTemplate\">\n <input\n type=\"text\"\n nz-input\n placeholder=\"{{ 'application.search' | i18n }}\"\n [(ngModel)]=\"searchValue\"\n (ngModelChange)=\"onSearch()\"\n />\n <ng-template #prefixTemplate>\n <i nz-icon nzType=\"search\" nzTheme=\"outline\"></i>\n </ng-template>\n </nz-input-group>\n </div>\n </ng-template>\n <ng-template #ld>\n <div class=\"yz-application-list\">\n <ul>\n <li *ngFor=\"let d of listData\">\n <h5>{{ d.name }}</h5>\n <a href=\"javascript:;\" *ngFor=\"let cd of d.children\" (click)=\"open(cd)\">{{ cd.name }}</a>\n </li>\n </ul>\n </div>\n </ng-template>\n <!-- template end-->\n\n <!-- button start-->\n <div class=\"yunzai-default__nav-item\" (click)=\"diffChange()\"> {{ 'application.button' | i18n }}</div>\n <!-- button end-->\n\n <!-- header start-->\n <div class=\"yz-application\" nz-row *ngIf=\"active\">\n <div nz-col [nzSpan]=\"3\" class=\"yz-application-topic\">\n <div class=\"yz-application-text\" (click)=\"full()\">{{ 'application.all' | i18n }}</div>\n <div class=\"yz-application-text\" (click)=\"own()\">{{ 'application.mine' | i18n }}</div>\n <div class=\"yz-application-text\" *ngFor=\"let d of topicData\" (click)=\"every(d)\">\n {{ d.name }}\n </div>\n </div>\n <div nz-col [nzSpan]=\"21\" [ngSwitch]=\"topic\" class=\"yz-application-container\">\n <div *ngSwitchCase=\"T.FULL\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"ld\"></ng-template>\n </div>\n <div *ngSwitchCase=\"T.OWN\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n <ng-template [ngTemplateOutlet]=\"ld\"></ng-template>\n </div>\n <div *ngSwitchCase=\"T.EVERY\" class=\"yz-application-list\">\n <div class=\"yz-application-list-item\">\n <ul>\n <li *ngFor=\"let d of listData\" (click)=\"open(d)\">\n <a href=\"javascript:;\">\n <h4>{{ d.name }}</h4>\n <p>{{ d.intro }}</p>\n </a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n <!-- header end-->\n ",
573
573
  changeDetection: i0.ChangeDetectionStrategy.OnPush
574
574
  },] }
575
575
  ];
576
576
  YzHeaderApplicationComponent.ctorParameters = function () { return [
577
577
  { type: i0.Injector },
578
- { type: cache.CacheService },
578
+ { type: i2$1.CacheService },
579
579
  { type: YzI18NService },
580
580
  { type: i1._HttpClient }
581
581
  ]; };
@@ -706,7 +706,7 @@
706
706
  .pipe(operators.map(function (response) {
707
707
  var viewMessage = _this.data.filter(function (d) { return d.key === 'msg'; })[0];
708
708
  viewMessage.list = response.data.list.map(function (m) {
709
- return Object.assign(Object.assign({}, m), { avatar: './assets/tmp/img/message.png', title: m.systemName, description: m.content, extra: formatMessageStatus(m.status).extra, color: formatMessageStatus(m.status).color, datetime: dateFns.formatDistanceToNow(new Date(m.date), { locale: _this.nzI18n.getDateLocale() }) });
709
+ 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: dateFns.formatDistanceToNow(new Date(m.date), { locale: _this.nzI18n.getDateLocale() }) });
710
710
  });
711
711
  _this.count += viewMessage.list.length;
712
712
  }));
@@ -733,7 +733,7 @@
733
733
  .pipe(operators.map(function (response) {
734
734
  var viewTodo = _this.data.filter(function (d) { return d.key === 'todo'; })[0];
735
735
  viewTodo.list = response.data.list.map(function (t) {
736
- return Object.assign(Object.assign({}, t), { avatar: './assets/tmp/img/todo.png', title: t.systemName, description: t.content, datetime: dateFns.formatDistanceToNow(new Date(t.date), { locale: _this.nzI18n.getDateLocale() }), extra: formatTodoStatus(t.status).extra, color: formatTodoStatus(t.status).color });
736
+ 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: dateFns.formatDistanceToNow(new Date(t.date), { locale: _this.nzI18n.getDateLocale() }), extra: formatTodoStatus(t.status).extra, color: formatTodoStatus(t.status).color });
737
737
  });
738
738
  _this.count += viewTodo.list.length;
739
739
  }));
@@ -785,9 +785,18 @@
785
785
  this.KEYS = KEYS;
786
786
  this.theme = 'default';
787
787
  this.types = [
788
- { key: 'default', text: 'Default Theme', color: '#2163ff' },
789
- { key: 'compact', text: 'Compact Theme', color: '#2163ff' },
790
- { key: 'dark', text: 'Dark Theme', color: '#020202' }
788
+ { key: 'default', text: 'theme.default', color: '#2163ff' },
789
+ { key: 'compact', text: 'theme.compact', color: '#2163ff' },
790
+ { key: 'dark', text: 'theme.dark', color: '#020202' },
791
+ { key: 'yuhong', text: 'theme.yuhong', color: '#C04851' },
792
+ { key: 'danjuhuang', text: 'theme.danjuhuang', color: '#FBA414' },
793
+ { key: 'xinghuang', text: 'theme.xinghuang', color: '#F28E16' },
794
+ { key: 'shilv', text: 'theme.shilv', color: '#57C3C2' },
795
+ { key: 'zhulv', text: 'theme.zhulv', color: '#1BA784' },
796
+ { key: 'youlan', text: 'theme.youlan', color: '#1781B5' },
797
+ { key: 'dianqing', text: 'theme.dianqing', color: '#1661AB' },
798
+ { key: 'shangengzi', text: 'theme.shangengzi', color: '#61649F' },
799
+ { key: 'shuiniuhui', text: 'theme.shuiniuhui', color: '#2F2F35' }
791
800
  ];
792
801
  this.devTips = "When the dark.css file can't be found, you need to run it once: npm run theme";
793
802
  this.deployUrl = '';
@@ -849,7 +858,7 @@
849
858
  YzHeaderThemBtnComponent.decorators = [
850
859
  { type: i0.Component, args: [{
851
860
  selector: 'yz-header-theme-btn',
852
- template: "\n <div\n class=\"yunzai-default__nav-item\"\n nz-dropdown\n [nzDropdownMenu]=\"iconMenu\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n >\n <svg nz-tooltip class=\"anticon\" role=\"img\" width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"currentColor\">\n <g fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\">\n <path\n 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\"\n ></path>\n </g>\n </g>\n </svg>\n </div>\n <nz-dropdown-menu #iconMenu=\"nzDropdownMenu\">\n <div nz-menu class=\"wd-xl animated jello\">\n <div nz-row [nzJustify]=\"'space-between'\" [nzAlign]=\"'middle'\" class=\"app-icons\">\n <div nz-col [nzSpan]=\"6\" *ngFor=\"let theme of types\" (click)=\"onThemeChange(theme.key)\">\n <i nz-icon nzType=\"bg-colors\" class=\"text-white\" [style]=\"{ backgroundColor: theme.color }\"></i>\n <span [ngStyle]=\"{ color: theme.color }\">{{ theme.key }}</span>\n </div>\n </div>\n </div>\n </nz-dropdown-menu>\n ",
861
+ template: "\n <div\n class=\"yunzai-default__nav-item\"\n nz-dropdown\n [nzDropdownMenu]=\"iconMenu\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n >\n <svg nz-tooltip class=\"anticon\" role=\"img\" width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"currentColor\">\n <g fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\">\n <path\n 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\"\n ></path>\n </g>\n </g>\n </svg>\n </div>\n <nz-dropdown-menu #iconMenu=\"nzDropdownMenu\">\n <ul nz-menu>\n <li\n nz-menu-item\n *ngFor=\"let theme of types\"\n (click)=\"onThemeChange(theme.key)\"\n [style]=\"{ color: theme.color }\"\n >\n <i nz-icon nzType=\"bg-colors\"></i>\n {{ theme.text | i18n }}\n </li>\n </ul>\n <!-- <div nz-menu class=\"wd-xl animated jello\">-->\n <!-- <div nz-row [nzJustify]=\"'space-between'\" [nzAlign]=\"'middle'\" class=\"app-icons\">-->\n <!-- <div nz-col [nzSpan]=\"4\" *ngFor=\"let theme of types\" (click)=\"onThemeChange(theme.key)\">-->\n <!-- <i nz-icon nzType=\"bg-colors\" class=\"text-white\" [style]=\"{ backgroundColor: theme.color }\"></i>-->\n <!-- <span [ngStyle]=\"{ color: theme.color }\">{{ theme.text | i18n }}</span>-->\n <!-- </div>-->\n <!-- </div>-->\n <!-- </div>-->\n </nz-dropdown-menu>\n ",
853
862
  changeDetection: i0.ChangeDetectionStrategy.OnPush
854
863
  },] }
855
864
  ];
@@ -867,6 +876,17 @@
867
876
  deployUrl: [{ type: i0.Input }]
868
877
  };
869
878
 
879
+ var BUSINESS_DEFAULT_CONFIG = {
880
+ baseUrl: '/backstage',
881
+ systemCode: 'portal',
882
+ loginForm: null,
883
+ refreshTokenEnabled: true,
884
+ refreshTokenType: 're-request'
885
+ };
886
+ function mergeBisConfig(srv) {
887
+ return srv.merge('bis', BUSINESS_DEFAULT_CONFIG);
888
+ }
889
+
870
890
  var YzHeaderUserComponent = /** @class */ (function () {
871
891
  function YzHeaderUserComponent(injector, msg, tokenService,
872
892
  // @ts-ignore
@@ -879,7 +899,7 @@
879
899
  this.icon = '';
880
900
  this.username = '';
881
901
  this.menus = [];
882
- this.config = shared.mergeConfig(configService);
902
+ this.config = mergeBisConfig(configService);
883
903
  }
884
904
  YzHeaderUserComponent.prototype.ngOnInit = function () {
885
905
  var projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
@@ -917,7 +937,7 @@
917
937
  { type: message.NzMessageService },
918
938
  { type: undefined, decorators: [{ type: i0.Inject, args: [auth.YA_SERVICE_TOKEN,] }] },
919
939
  { type: util.YunzaiConfigService },
920
- { type: cache.CacheService }
940
+ { type: i2$1.CacheService }
921
941
  ]; };
922
942
 
923
943
  var YzHeaderClearStorageComponent = /** @class */ (function () {
@@ -991,9 +1011,110 @@
991
1011
  _click: [{ type: i0.HostListener, args: ['click',] }]
992
1012
  };
993
1013
 
1014
+ var ɵ0 = function (msg) {
1015
+ util.log(msg);
1016
+ };
1017
+ var STOMP_DEFAULT_CONFIG = {
1018
+ connectHeaders: {
1019
+ login: 'guest',
1020
+ passcode: 'guest'
1021
+ },
1022
+ brokerURL: '/websocket/ws/',
1023
+ heartbeatIncoming: 1000 * 60,
1024
+ heartbeatOutgoing: 1000 * 60,
1025
+ reconnectDelay: 30000000,
1026
+ debug: ɵ0
1027
+ };
1028
+ function mergeStompConfig(srv) {
1029
+ return srv.merge('stomp', STOMP_DEFAULT_CONFIG);
1030
+ }
1031
+
1032
+ var YzStompService = /** @class */ (function () {
1033
+ function YzStompService(csr, cache, injector, notification) {
1034
+ this.csr = csr;
1035
+ this.cache = cache;
1036
+ this.injector = injector;
1037
+ this.notification = notification;
1038
+ this.subs = [];
1039
+ if (!this.user) {
1040
+ this.user = this.cache.get('_yz_user', { mode: 'none' });
1041
+ }
1042
+ if (!this.config) {
1043
+ this.config = mergeStompConfig(this.csr);
1044
+ }
1045
+ if (!this.bisConfig) {
1046
+ this.bisConfig = mergeBisConfig(csr);
1047
+ }
1048
+ if (!this.rxStomp) {
1049
+ this.rxStomp = new rxStomp.RxStomp();
1050
+ if (i0.isDevMode()) {
1051
+ util.log('yz.stomp.service: is dev mode');
1052
+ util.log('yz.stomp.service: ', "config is " + JSON.stringify(this.config));
1053
+ this.rxStomp.configure(this.config);
1054
+ return;
1055
+ }
1056
+ var location = this.injector.get(common.DOCUMENT).location;
1057
+ var protocol = location.protocol, host = location.host;
1058
+ util.log('yz.stomp.service: ', "protocol is " + protocol + ",host is " + host);
1059
+ if (protocol.includes('http') && !protocol.includes('https')) {
1060
+ this.config.brokerURL = "ws://" + host + this.config.brokerURL;
1061
+ }
1062
+ if (protocol.includes('https')) {
1063
+ this.config.brokerURL = "wss://" + host + this.config.brokerURL;
1064
+ }
1065
+ util.log('yz.stomp.service: ', "config is " + this.config);
1066
+ this.rxStomp.configure(this.config);
1067
+ }
1068
+ }
1069
+ YzStompService.prototype.listen = function () {
1070
+ var _this = this;
1071
+ this.subs.push(this.rxStomp.watch("/topic/layout_" + this.user.username).subscribe(function (message) {
1072
+ _this.createNotification(JSON.parse(message.body));
1073
+ }));
1074
+ this.subs.push(this.rxStomp.watch("/topic/layout_xx_" + this.user.username).subscribe(function (message) {
1075
+ _this.logoutNotification(JSON.parse(message.body));
1076
+ }));
1077
+ this.rxStomp.activate();
1078
+ };
1079
+ YzStompService.prototype.createNotification = function (message) {
1080
+ this.notification.create(message.type, message.title, "<a href=" + message.href + ">" + message.content + "</a>");
1081
+ };
1082
+ YzStompService.prototype.logoutNotification = function (message) {
1083
+ var _this = this;
1084
+ this.notification.create(message.type, message.title, message.content + ",\u5269\u4F59\u65F6\u95F45\u79D2");
1085
+ setTimeout(function () {
1086
+ _this.cache.clear();
1087
+ localStorage.clear();
1088
+ _this.injector.get(util.WINDOW).location.href = _this.bisConfig.baseUrl + "/cas-proxy/app/logout";
1089
+ }, 5000);
1090
+ };
1091
+ YzStompService.prototype.unListen = function () {
1092
+ this.subs.forEach(function (s) { return s.unsubscribe(); });
1093
+ this.rxStomp.deactivate().then();
1094
+ };
1095
+ YzStompService.prototype.publish = function (parameters) {
1096
+ this.rxStomp.publish(parameters);
1097
+ };
1098
+ YzStompService.prototype.watch = function (destination, headers) {
1099
+ return this.rxStomp.watch(destination, headers);
1100
+ };
1101
+ return YzStompService;
1102
+ }());
1103
+ YzStompService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function YzStompService_Factory() { return new YzStompService(i0__namespace.ɵɵinject(i4__namespace.YunzaiConfigService), i0__namespace.ɵɵinject(i2__namespace$1.CacheService), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(i3__namespace$1.NzNotificationService)); }, token: YzStompService, providedIn: "root" });
1104
+ YzStompService.decorators = [
1105
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1106
+ ];
1107
+ YzStompService.ctorParameters = function () { return [
1108
+ { type: util.YunzaiConfigService },
1109
+ { type: i2$1.CacheService },
1110
+ { type: i0.Injector },
1111
+ { type: i3$1.NzNotificationService }
1112
+ ]; };
1113
+
994
1114
  var YzLayoutBasicComponent = /** @class */ (function () {
995
- function YzLayoutBasicComponent(cacheService) {
1115
+ function YzLayoutBasicComponent(cacheService, yzStompService) {
996
1116
  this.cacheService = cacheService;
1117
+ this.yzStompService = yzStompService;
997
1118
  this.options = {
998
1119
  logoExpanded: "./assets/logo-full.svg",
999
1120
  logoCollapsed: "./assets/logo.svg"
@@ -1010,18 +1131,23 @@
1010
1131
  this.icon = current.icon ? current.icon : "./assets/tmp/img/avatar.jpg";
1011
1132
  this.options.logoExpanded = project.maxLogoUrl ? project.maxLogoUrl : "./assets/logo-full.svg";
1012
1133
  this.options.logoCollapsed = project.miniLogoUrl ? project.miniLogoUrl : "./assets/logo.svg";
1134
+ this.yzStompService.listen();
1135
+ };
1136
+ YzLayoutBasicComponent.prototype.ngOnDestroy = function () {
1137
+ this.yzStompService.unListen();
1013
1138
  };
1014
1139
  return YzLayoutBasicComponent;
1015
1140
  }());
1016
1141
  YzLayoutBasicComponent.decorators = [
1017
1142
  { type: i0.Component, args: [{
1018
1143
  selector: 'yz-layout-basic',
1019
- template: "\n <layout-default [options]=\"options\" [asideUser]=\"asideUserTpl\" [content]=\"contentTpl\">\n <layout-default-header-item direction=\"left\">\n <yz-header-application></yz-header-application>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <yz-header-notify></yz-header-notify>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <yz-header-theme-btn></yz-header-theme-btn>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <div\n layout-default-header-item-trigger\n nz-dropdown\n [nzDropdownMenu]=\"settingsMenu\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n >\n <i nz-icon nzType=\"setting\"></i>\n </div>\n <nz-dropdown-menu #settingsMenu=\"nzDropdownMenu\">\n <div nz-menu style=\"width: 200px;\">\n <div nz-menu-item>\n <yz-header-fullscreen></yz-header-fullscreen>\n </div>\n <div nz-menu-item>\n <yz-header-clear-storage></yz-header-clear-storage>\n </div>\n <div nz-menu-item>\n <yz-header-i18n></yz-header-i18n>\n </div>\n </div>\n </nz-dropdown-menu>\n </layout-default-header-item>\n <layout-default-header-item direction=\"right\">\n <yz-header-user></yz-header-user>\n </layout-default-header-item>\n <ng-template #asideUserTpl>\n <div nz-dropdown nzTrigger=\"click\" [nzDropdownMenu]=\"userMenu\" class=\"yunzai-default__aside-user\">\n <nz-avatar class=\"yunzai-default__aside-user-avatar\" [nzSrc]=\"icon\"></nz-avatar>\n <div class=\"yunzai-default__aside-user-info\">\n <strong>{{ text }}</strong>\n <p class=\"mb0\">{{ intro }}</p>\n </div>\n </div>\n <nz-dropdown-menu #userMenu=\"nzDropdownMenu\">\n <ul nz-menu>\n <li nz-menu-item routerLink=\"/\">\u56DE\u5230\u9996\u9875</li>\n </ul>\n </nz-dropdown-menu>\n </ng-template>\n <ng-template #contentTpl>\n <reuse-tab #reuseTab></reuse-tab>\n <router-outlet (activate)=\"reuseTab.activate($event)\"></router-outlet>\n </ng-template>\n </layout-default>\n ",
1144
+ template: "\n <layout-default [options]=\"options\" [asideUser]=\"asideUserTpl\" [content]=\"contentTpl\">\n <layout-default-header-item direction=\"left\">\n <yz-header-application></yz-header-application>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <yz-header-notify></yz-header-notify>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <yz-header-theme-btn></yz-header-theme-btn>\n </layout-default-header-item>\n\n <layout-default-header-item direction=\"right\" hidden=\"mobile\">\n <div\n layout-default-header-item-trigger\n nz-dropdown\n [nzDropdownMenu]=\"settingsMenu\"\n nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n >\n <i nz-icon nzType=\"setting\"></i>\n </div>\n <nz-dropdown-menu #settingsMenu=\"nzDropdownMenu\">\n <div nz-menu style=\"width: 200px;\">\n <div nz-menu-item>\n <yz-header-fullscreen></yz-header-fullscreen>\n </div>\n <div nz-menu-item>\n <yz-header-clear-storage></yz-header-clear-storage>\n </div>\n <div nz-menu-item>\n <yz-header-i18n></yz-header-i18n>\n </div>\n </div>\n </nz-dropdown-menu>\n </layout-default-header-item>\n <layout-default-header-item direction=\"right\">\n <yz-header-user></yz-header-user>\n </layout-default-header-item>\n <ng-template #asideUserTpl>\n <div nz-dropdown nzTrigger=\"click\" [nzDropdownMenu]=\"userMenu\" class=\"yunzai-default__aside-user\">\n <nz-avatar class=\"yunzai-default__aside-user-avatar\" [nzSrc]=\"icon\"></nz-avatar>\n <div class=\"yunzai-default__aside-user-info\">\n <strong>{{ text }}</strong>\n <p class=\"mb0\">{{ intro }}</p>\n </div>\n </div>\n <nz-dropdown-menu #userMenu=\"nzDropdownMenu\">\n <ul nz-menu>\n <li nz-menu-item routerLink=\"/\">{{ 'menu.backtohome' | i18n }}</li>\n </ul>\n </nz-dropdown-menu>\n </ng-template>\n <ng-template #contentTpl>\n <reuse-tab #reuseTab></reuse-tab>\n <router-outlet (activate)=\"reuseTab.activate($event)\"></router-outlet>\n </ng-template>\n </layout-default>\n ",
1020
1145
  changeDetection: i0.ChangeDetectionStrategy.OnPush
1021
1146
  },] }
1022
1147
  ];
1023
1148
  YzLayoutBasicComponent.ctorParameters = function () { return [
1024
- { type: cache.CacheService }
1149
+ { type: i2$1.CacheService },
1150
+ { type: YzStompService }
1025
1151
  ]; };
1026
1152
 
1027
1153
  var COMPONENTS = [
@@ -1057,7 +1183,7 @@
1057
1183
  function YzAuthService(injector) {
1058
1184
  this.injector = injector;
1059
1185
  this.option = auth.mergeConfig(this.csr);
1060
- this.bis = shared.mergeConfig(this.csr);
1186
+ this.bis = mergeBisConfig(this.csr);
1061
1187
  }
1062
1188
  Object.defineProperty(YzAuthService.prototype, "csr", {
1063
1189
  get: function () {
@@ -1082,7 +1208,7 @@
1082
1208
  });
1083
1209
  Object.defineProperty(YzAuthService.prototype, "cacheService", {
1084
1210
  get: function () {
1085
- return this.injector.get(cache.CacheService);
1211
+ return this.injector.get(i2$1.CacheService);
1086
1212
  },
1087
1213
  enumerable: false,
1088
1214
  configurable: true
@@ -1244,6 +1370,7 @@
1244
1370
  var YzDefaultInterceptor = /** @class */ (function () {
1245
1371
  function YzDefaultInterceptor(injector) {
1246
1372
  this.injector = injector;
1373
+ this.jump = false;
1247
1374
  this.refreshToking = false;
1248
1375
  this.refreshToken$ = new rxjs.BehaviorSubject(null);
1249
1376
  if (this.config.refreshTokenType === 'auth-refresh') {
@@ -1252,7 +1379,7 @@
1252
1379
  }
1253
1380
  Object.defineProperty(YzDefaultInterceptor.prototype, "notification", {
1254
1381
  get: function () {
1255
- return this.injector.get(notification.NzNotificationService);
1382
+ return this.injector.get(i3$1.NzNotificationService);
1256
1383
  },
1257
1384
  enumerable: false,
1258
1385
  configurable: true
@@ -1273,7 +1400,7 @@
1273
1400
  });
1274
1401
  Object.defineProperty(YzDefaultInterceptor.prototype, "config", {
1275
1402
  get: function () {
1276
- return shared.mergeConfig(this.injector.get(i4.YunzaiConfigService));
1403
+ return mergeBisConfig(this.injector.get(i4.YunzaiConfigService));
1277
1404
  },
1278
1405
  enumerable: false,
1279
1406
  configurable: true
@@ -1376,7 +1503,9 @@
1376
1503
  case 403:
1377
1504
  case 404:
1378
1505
  case 500:
1379
- this.goTo("/exception/" + ev.status);
1506
+ if (this.jump) {
1507
+ this.goTo("/exception/" + ev.status);
1508
+ }
1380
1509
  break;
1381
1510
  default:
1382
1511
  if (ev instanceof http.HttpErrorResponse) {
@@ -1462,8 +1591,8 @@
1462
1591
  this.yzAuthService = yzAuthService;
1463
1592
  this.cacheService = cacheService;
1464
1593
  this.configService = configService;
1465
- this.bis = shared.BUSINESS_DEFAULT_CONFIG;
1466
- this.bis = shared.mergeConfig(this.configService);
1594
+ this.bis = BUSINESS_DEFAULT_CONFIG;
1595
+ this.bis = mergeBisConfig(this.configService);
1467
1596
  iconSrv.addIcon.apply(iconSrv, __spreadArray([], __read(shared.ICONS)));
1468
1597
  }
1469
1598
  YzStartupService.prototype.load = function () {
@@ -1534,7 +1663,7 @@
1534
1663
  { type: acl.ACLService },
1535
1664
  { type: i1.TitleService },
1536
1665
  { type: YzAuthService },
1537
- { type: cache.CacheService },
1666
+ { type: i2$1.CacheService },
1538
1667
  { type: util.YunzaiConfigService }
1539
1668
  ]; };
1540
1669
  function YzStartupServiceFactory(startupService) {
@@ -1555,6 +1684,8 @@
1555
1684
  * Generated bundle index. Do not edit.
1556
1685
  */
1557
1686
 
1687
+ exports.BUSINESS_DEFAULT_CONFIG = BUSINESS_DEFAULT_CONFIG;
1688
+ exports.STOMP_DEFAULT_CONFIG = STOMP_DEFAULT_CONFIG;
1558
1689
  exports.YZ_APPINIT_PROVIDES = YZ_APPINIT_PROVIDES;
1559
1690
  exports.YunzaiLayoutModule = YunzaiLayoutModule;
1560
1691
  exports.YzAuthService = YzAuthService;
@@ -1570,17 +1701,21 @@
1570
1701
  exports.YzLayoutBasicComponent = YzLayoutBasicComponent;
1571
1702
  exports.YzStartupService = YzStartupService;
1572
1703
  exports.YzStartupServiceFactory = YzStartupServiceFactory;
1704
+ exports.YzStompService = YzStompService;
1573
1705
  exports.generateAbility = generateAbility;
1574
1706
  exports.mapYzSideToYelonMenu = mapYzSideToYelonMenu;
1575
- exports.ɵa = YzHeaderApplicationComponent;
1576
- exports.ɵb = YzHeaderNotifyComponent;
1577
- exports.ɵc = YzHeaderThemBtnComponent;
1578
- exports.ɵd = YzHeaderUserComponent;
1579
- exports.ɵe = YzHeaderFullScreenComponent;
1580
- exports.ɵf = YzHeaderClearStorageComponent;
1581
- exports.ɵg = YzHeaderI18NComponent;
1707
+ exports.mergeBisConfig = mergeBisConfig;
1708
+ exports.mergeStompConfig = mergeStompConfig;
1709
+ exports["ɵ0"] = ɵ0;
1710
+ exports["ɵa"] = YzHeaderApplicationComponent;
1711
+ exports["ɵb"] = YzHeaderNotifyComponent;
1712
+ exports["ɵc"] = YzHeaderThemBtnComponent;
1713
+ exports["ɵd"] = YzHeaderUserComponent;
1714
+ exports["ɵe"] = YzHeaderFullScreenComponent;
1715
+ exports["ɵf"] = YzHeaderClearStorageComponent;
1716
+ exports["ɵg"] = YzHeaderI18NComponent;
1582
1717
 
1583
1718
  Object.defineProperty(exports, '__esModule', { value: true });
1584
1719
 
1585
- })));
1720
+ }));
1586
1721
  //# sourceMappingURL=layout.umd.js.map