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