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