@reskin/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/bundles/reskin-core-classes.umd.js +48 -0
- package/bundles/reskin-core-classes.umd.js.map +1 -0
- package/bundles/reskin-core-directives.umd.js +147 -0
- package/bundles/reskin-core-directives.umd.js.map +1 -0
- package/bundles/reskin-core-entity-dictionary.umd.js +11 -0
- package/bundles/reskin-core-entity-dictionary.umd.js.map +1 -0
- package/bundles/reskin-core-entity-field.umd.js +49 -0
- package/bundles/reskin-core-entity-field.umd.js.map +1 -0
- package/bundles/reskin-core-entity-file.umd.js +11 -0
- package/bundles/reskin-core-entity-file.umd.js.map +1 -0
- package/bundles/reskin-core-entity-menu.umd.js +40 -0
- package/bundles/reskin-core-entity-menu.umd.js.map +1 -0
- package/bundles/reskin-core-entity-org.umd.js +50 -0
- package/bundles/reskin-core-entity-org.umd.js.map +1 -0
- package/bundles/reskin-core-entity-scheme.umd.js +63 -0
- package/bundles/reskin-core-entity-scheme.umd.js.map +1 -0
- package/bundles/reskin-core-entity-user.umd.js +11 -0
- package/bundles/reskin-core-entity-user.umd.js.map +1 -0
- package/bundles/reskin-core-entity.umd.js +11 -0
- package/bundles/reskin-core-entity.umd.js.map +1 -0
- package/bundles/reskin-core-guards.umd.js +89 -0
- package/bundles/reskin-core-guards.umd.js.map +1 -0
- package/bundles/reskin-core-interceptors.umd.js +702 -0
- package/bundles/reskin-core-interceptors.umd.js.map +1 -0
- package/bundles/reskin-core-services.umd.js +1188 -0
- package/bundles/reskin-core-services.umd.js.map +1 -0
- package/bundles/reskin-core-utils.umd.js +130 -0
- package/bundles/reskin-core-utils.umd.js.map +1 -0
- package/bundles/reskin-core.umd.js +13 -0
- package/bundles/reskin-core.umd.js.map +1 -0
- package/classes/package.json +10 -0
- package/classes/public-api.d.ts +1 -0
- package/classes/reskin-core-classes.d.ts +5 -0
- package/classes/table.helper.d.ts +23 -0
- package/directives/auth.directive.d.ts +27 -0
- package/directives/directives.module.d.ts +7 -0
- package/directives/package.json +10 -0
- package/directives/public-api.d.ts +2 -0
- package/directives/reskin-core-directives.d.ts +5 -0
- package/entity/Env.d.ts +66 -0
- package/entity/IPage.d.ts +35 -0
- package/entity/R.d.ts +25 -0
- package/entity/WC.d.ts +51 -0
- package/entity/dictionary/IDictionaryBaseInfo.d.ts +29 -0
- package/entity/dictionary/IDictionaryItem.d.ts +50 -0
- package/entity/dictionary/package.json +10 -0
- package/entity/dictionary/public-api.d.ts +2 -0
- package/entity/dictionary/reskin-core-entity-dictionary.d.ts +5 -0
- package/entity/field/ColumnTypeEnum.d.ts +33 -0
- package/entity/field/ITableField.d.ts +27 -0
- package/entity/field/package.json +10 -0
- package/entity/field/public-api.d.ts +2 -0
- package/entity/field/reskin-core-entity-field.d.ts +5 -0
- package/entity/file/IUploadFileData.d.ts +25 -0
- package/entity/file/package.json +10 -0
- package/entity/file/public-api.d.ts +1 -0
- package/entity/file/reskin-core-entity-file.d.ts +5 -0
- package/entity/menu/IMenu.d.ts +57 -0
- package/entity/menu/MenuTypeEnum.d.ts +24 -0
- package/entity/menu/package.json +10 -0
- package/entity/menu/public-api.d.ts +2 -0
- package/entity/menu/reskin-core-entity-menu.d.ts +5 -0
- package/entity/org/IOrgTreeNode.d.ts +58 -0
- package/entity/org/OrgTypeEnum.d.ts +31 -0
- package/entity/org/package.json +10 -0
- package/entity/org/public-api.d.ts +2 -0
- package/entity/org/reskin-core-entity-org.d.ts +5 -0
- package/entity/package.json +10 -0
- package/entity/public-api.d.ts +4 -0
- package/entity/reskin-core-entity.d.ts +5 -0
- package/entity/scheme/IFieldScheme.d.ts +97 -0
- package/entity/scheme/IScheme.d.ts +200 -0
- package/entity/scheme/SchemeEditTypeEnum.d.ts +25 -0
- package/entity/scheme/package.json +10 -0
- package/entity/scheme/public-api.d.ts +3 -0
- package/entity/scheme/reskin-core-entity-scheme.d.ts +5 -0
- package/entity/user/IAuth.d.ts +13 -0
- package/entity/user/IAuthAccount.d.ts +126 -0
- package/entity/user/package.json +10 -0
- package/entity/user/public-api.d.ts +2 -0
- package/entity/user/reskin-core-entity-user.d.ts +5 -0
- package/esm2015/classes/public-api.js +2 -0
- package/esm2015/classes/reskin-core-classes.js +5 -0
- package/esm2015/classes/table.helper.js +32 -0
- package/esm2015/directives/auth.directive.js +83 -0
- package/esm2015/directives/directives.module.js +16 -0
- package/esm2015/directives/public-api.js +3 -0
- package/esm2015/directives/reskin-core-directives.js +5 -0
- package/esm2015/entity/Env.js +2 -0
- package/esm2015/entity/IPage.js +2 -0
- package/esm2015/entity/R.js +2 -0
- package/esm2015/entity/WC.js +2 -0
- package/esm2015/entity/dictionary/IDictionaryBaseInfo.js +2 -0
- package/esm2015/entity/dictionary/IDictionaryItem.js +2 -0
- package/esm2015/entity/dictionary/public-api.js +3 -0
- package/esm2015/entity/dictionary/reskin-core-entity-dictionary.js +5 -0
- package/esm2015/entity/field/ColumnTypeEnum.js +35 -0
- package/esm2015/entity/field/ITableField.js +2 -0
- package/esm2015/entity/field/public-api.js +3 -0
- package/esm2015/entity/field/reskin-core-entity-field.js +5 -0
- package/esm2015/entity/file/IUploadFileData.js +2 -0
- package/esm2015/entity/file/public-api.js +2 -0
- package/esm2015/entity/file/reskin-core-entity-file.js +5 -0
- package/esm2015/entity/menu/IMenu.js +2 -0
- package/esm2015/entity/menu/MenuTypeEnum.js +26 -0
- package/esm2015/entity/menu/public-api.js +3 -0
- package/esm2015/entity/menu/reskin-core-entity-menu.js +5 -0
- package/esm2015/entity/org/IOrgTreeNode.js +2 -0
- package/esm2015/entity/org/OrgTypeEnum.js +33 -0
- package/esm2015/entity/org/public-api.js +3 -0
- package/esm2015/entity/org/reskin-core-entity-org.js +5 -0
- package/esm2015/entity/public-api.js +5 -0
- package/esm2015/entity/reskin-core-entity.js +5 -0
- package/esm2015/entity/scheme/IFieldScheme.js +2 -0
- package/esm2015/entity/scheme/IScheme.js +22 -0
- package/esm2015/entity/scheme/SchemeEditTypeEnum.js +27 -0
- package/esm2015/entity/scheme/public-api.js +4 -0
- package/esm2015/entity/scheme/reskin-core-entity-scheme.js +5 -0
- package/esm2015/entity/user/IAuth.js +2 -0
- package/esm2015/entity/user/IAuthAccount.js +2 -0
- package/esm2015/entity/user/public-api.js +3 -0
- package/esm2015/entity/user/reskin-core-entity-user.js +5 -0
- package/esm2015/guards/auth.guard.js +53 -0
- package/esm2015/guards/public-api.js +2 -0
- package/esm2015/guards/reskin-core-guards.js +5 -0
- package/esm2015/interceptors/blob.interceptor.js +66 -0
- package/esm2015/interceptors/cache.interceptor.js +36 -0
- package/esm2015/interceptors/error.interceptor.js +35 -0
- package/esm2015/interceptors/public-api.js +5 -0
- package/esm2015/interceptors/reskin-core-interceptors.js +5 -0
- package/esm2015/interceptors/token.interceptor.js +48 -0
- package/esm2015/public-api.js +2 -0
- package/esm2015/reskin-core.js +5 -0
- package/esm2015/services/account.service.js +58 -0
- package/esm2015/services/app.config.js +60 -0
- package/esm2015/services/auth.service.js +56 -0
- package/esm2015/services/cache.http.service.js +58 -0
- package/esm2015/services/destroy.service.js +15 -0
- package/esm2015/services/dictionary.service.js +107 -0
- package/esm2015/services/down.file.service.js +79 -0
- package/esm2015/services/field.scheme.service.js +37 -0
- package/esm2015/services/file.service.js +57 -0
- package/esm2015/services/menu.service.js +36 -0
- package/esm2015/services/org.service.js +46 -0
- package/esm2015/services/public-api.js +13 -0
- package/esm2015/services/reskin-core-services.js +5 -0
- package/esm2015/services/scheme.service.js +37 -0
- package/esm2015/utils/array.js +29 -0
- package/esm2015/utils/dom.js +18 -0
- package/esm2015/utils/public-api.js +4 -0
- package/esm2015/utils/reskin-core-utils.js +5 -0
- package/esm2015/utils/store.js +64 -0
- package/fesm2015/reskin-core-classes.js +39 -0
- package/fesm2015/reskin-core-classes.js.map +1 -0
- package/fesm2015/reskin-core-directives.js +103 -0
- package/fesm2015/reskin-core-directives.js.map +1 -0
- package/fesm2015/reskin-core-entity-dictionary.js +4 -0
- package/fesm2015/reskin-core-entity-dictionary.js.map +1 -0
- package/fesm2015/reskin-core-entity-field.js +41 -0
- package/fesm2015/reskin-core-entity-field.js.map +1 -0
- package/fesm2015/reskin-core-entity-file.js +4 -0
- package/fesm2015/reskin-core-entity-file.js.map +1 -0
- package/fesm2015/reskin-core-entity-menu.js +32 -0
- package/fesm2015/reskin-core-entity-menu.js.map +1 -0
- package/fesm2015/reskin-core-entity-org.js +39 -0
- package/fesm2015/reskin-core-entity-org.js.map +1 -0
- package/fesm2015/reskin-core-entity-scheme.js +55 -0
- package/fesm2015/reskin-core-entity-scheme.js.map +1 -0
- package/fesm2015/reskin-core-entity-user.js +4 -0
- package/fesm2015/reskin-core-entity-user.js.map +1 -0
- package/fesm2015/reskin-core-entity.js +4 -0
- package/fesm2015/reskin-core-entity.js.map +1 -0
- package/fesm2015/reskin-core-guards.js +60 -0
- package/fesm2015/reskin-core-guards.js.map +1 -0
- package/fesm2015/reskin-core-interceptors.js +179 -0
- package/fesm2015/reskin-core-interceptors.js.map +1 -0
- package/fesm2015/reskin-core-services.js +605 -0
- package/fesm2015/reskin-core-services.js.map +1 -0
- package/fesm2015/reskin-core-utils.js +118 -0
- package/fesm2015/reskin-core-utils.js.map +1 -0
- package/fesm2015/reskin-core.js +6 -0
- package/fesm2015/reskin-core.js.map +1 -0
- package/guards/auth.guard.d.ts +15 -0
- package/guards/package.json +10 -0
- package/guards/public-api.d.ts +1 -0
- package/guards/reskin-core-guards.d.ts +5 -0
- package/interceptors/blob.interceptor.d.ts +20 -0
- package/interceptors/cache.interceptor.d.ts +19 -0
- package/interceptors/error.interceptor.d.ts +19 -0
- package/interceptors/package.json +10 -0
- package/interceptors/public-api.d.ts +4 -0
- package/interceptors/reskin-core-interceptors.d.ts +5 -0
- package/interceptors/token.interceptor.d.ts +28 -0
- package/package.json +22 -0
- package/public-api.d.ts +2 -0
- package/reskin-core.d.ts +5 -0
- package/services/account.service.d.ts +33 -0
- package/services/app.config.d.ts +40 -0
- package/services/auth.service.d.ts +26 -0
- package/services/cache.http.service.d.ts +37 -0
- package/services/destroy.service.d.ts +8 -0
- package/services/dictionary.service.d.ts +57 -0
- package/services/down.file.service.d.ts +29 -0
- package/services/field.scheme.service.d.ts +17 -0
- package/services/file.service.d.ts +33 -0
- package/services/menu.service.d.ts +16 -0
- package/services/org.service.d.ts +31 -0
- package/services/package.json +10 -0
- package/services/public-api.d.ts +12 -0
- package/services/reskin-core-services.d.ts +5 -0
- package/services/scheme.service.d.ts +17 -0
- package/utils/array.d.ts +5 -0
- package/utils/dom.d.ts +6 -0
- package/utils/package.json +10 -0
- package/utils/public-api.d.ts +3 -0
- package/utils/reskin-core-utils.d.ts +5 -0
- package/utils/store.d.ts +42 -0
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@angular/common/http'), require('rxjs/operators'), require('@reskin/core/utils'), require('rxjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@reskin/core/services', ['exports', '@angular/core', '@angular/platform-browser', '@angular/common/http', 'rxjs/operators', '@reskin/core/utils', 'rxjs'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.reskin = global.reskin || {}, global.reskin.core = global.reskin.core || {}, global.reskin.core.services = {}), global.ng.core, global.ng.platformBrowser, global.ng.common.http, global.rxjs.operators, global.reskin.core.utils, global.rxjs));
|
|
5
|
+
})(this, (function (exports, i0, i1, i1$1, operators, utils, rxjs) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
28
|
+
|
|
29
|
+
/******************************************************************************
|
|
30
|
+
Copyright (c) Microsoft Corporation.
|
|
31
|
+
|
|
32
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
33
|
+
purpose with or without fee is hereby granted.
|
|
34
|
+
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
36
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
37
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
38
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
39
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
40
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
41
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
42
|
+
***************************************************************************** */
|
|
43
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
44
|
+
var extendStatics = function (d, b) {
|
|
45
|
+
extendStatics = Object.setPrototypeOf ||
|
|
46
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
47
|
+
function (d, b) { for (var p in b)
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
49
|
+
d[p] = b[p]; };
|
|
50
|
+
return extendStatics(d, b);
|
|
51
|
+
};
|
|
52
|
+
function __extends(d, b) {
|
|
53
|
+
if (typeof b !== "function" && b !== null)
|
|
54
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
55
|
+
extendStatics(d, b);
|
|
56
|
+
function __() { this.constructor = d; }
|
|
57
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
58
|
+
}
|
|
59
|
+
var __assign = function () {
|
|
60
|
+
__assign = Object.assign || function __assign(t) {
|
|
61
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
62
|
+
s = arguments[i];
|
|
63
|
+
for (var p in s)
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
65
|
+
t[p] = s[p];
|
|
66
|
+
}
|
|
67
|
+
return t;
|
|
68
|
+
};
|
|
69
|
+
return __assign.apply(this, arguments);
|
|
70
|
+
};
|
|
71
|
+
function __rest(s, e) {
|
|
72
|
+
var t = {};
|
|
73
|
+
for (var p in s)
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
+
t[p[i]] = s[p[i]];
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
function __decorate(decorators, target, key, desc) {
|
|
84
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
85
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
86
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
87
|
+
else
|
|
88
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
89
|
+
if (d = decorators[i])
|
|
90
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
91
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
92
|
+
}
|
|
93
|
+
function __param(paramIndex, decorator) {
|
|
94
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
95
|
+
}
|
|
96
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
97
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
98
|
+
throw new TypeError("Function expected"); return f; }
|
|
99
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
100
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
101
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
102
|
+
var _, done = false;
|
|
103
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
104
|
+
var context = {};
|
|
105
|
+
for (var p in contextIn)
|
|
106
|
+
context[p] = p === "access" ? {} : contextIn[p];
|
|
107
|
+
for (var p in contextIn.access)
|
|
108
|
+
context.access[p] = contextIn.access[p];
|
|
109
|
+
context.addInitializer = function (f) { if (done)
|
|
110
|
+
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
111
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
112
|
+
if (kind === "accessor") {
|
|
113
|
+
if (result === void 0)
|
|
114
|
+
continue;
|
|
115
|
+
if (result === null || typeof result !== "object")
|
|
116
|
+
throw new TypeError("Object expected");
|
|
117
|
+
if (_ = accept(result.get))
|
|
118
|
+
descriptor.get = _;
|
|
119
|
+
if (_ = accept(result.set))
|
|
120
|
+
descriptor.set = _;
|
|
121
|
+
if (_ = accept(result.init))
|
|
122
|
+
initializers.unshift(_);
|
|
123
|
+
}
|
|
124
|
+
else if (_ = accept(result)) {
|
|
125
|
+
if (kind === "field")
|
|
126
|
+
initializers.unshift(_);
|
|
127
|
+
else
|
|
128
|
+
descriptor[key] = _;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (target)
|
|
132
|
+
Object.defineProperty(target, contextIn.name, descriptor);
|
|
133
|
+
done = true;
|
|
134
|
+
}
|
|
135
|
+
;
|
|
136
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
137
|
+
var useValue = arguments.length > 2;
|
|
138
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
139
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
140
|
+
}
|
|
141
|
+
return useValue ? value : void 0;
|
|
142
|
+
}
|
|
143
|
+
;
|
|
144
|
+
function __propKey(x) {
|
|
145
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
146
|
+
}
|
|
147
|
+
;
|
|
148
|
+
function __setFunctionName(f, name, prefix) {
|
|
149
|
+
if (typeof name === "symbol")
|
|
150
|
+
name = name.description ? "[".concat(name.description, "]") : "";
|
|
151
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
152
|
+
}
|
|
153
|
+
;
|
|
154
|
+
function __metadata(metadataKey, metadataValue) {
|
|
155
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
156
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
157
|
+
}
|
|
158
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
159
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
160
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
161
|
+
function fulfilled(value) { try {
|
|
162
|
+
step(generator.next(value));
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
reject(e);
|
|
166
|
+
} }
|
|
167
|
+
function rejected(value) { try {
|
|
168
|
+
step(generator["throw"](value));
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
reject(e);
|
|
172
|
+
} }
|
|
173
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
174
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function __generator(thisArg, body) {
|
|
178
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
179
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
180
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
181
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
182
|
+
function step(op) {
|
|
183
|
+
if (f)
|
|
184
|
+
throw new TypeError("Generator is already executing.");
|
|
185
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
186
|
+
try {
|
|
187
|
+
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)
|
|
188
|
+
return t;
|
|
189
|
+
if (y = 0, t)
|
|
190
|
+
op = [op[0] & 2, t.value];
|
|
191
|
+
switch (op[0]) {
|
|
192
|
+
case 0:
|
|
193
|
+
case 1:
|
|
194
|
+
t = op;
|
|
195
|
+
break;
|
|
196
|
+
case 4:
|
|
197
|
+
_.label++;
|
|
198
|
+
return { value: op[1], done: false };
|
|
199
|
+
case 5:
|
|
200
|
+
_.label++;
|
|
201
|
+
y = op[1];
|
|
202
|
+
op = [0];
|
|
203
|
+
continue;
|
|
204
|
+
case 7:
|
|
205
|
+
op = _.ops.pop();
|
|
206
|
+
_.trys.pop();
|
|
207
|
+
continue;
|
|
208
|
+
default:
|
|
209
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
210
|
+
_ = 0;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
214
|
+
_.label = op[1];
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
218
|
+
_.label = t[1];
|
|
219
|
+
t = op;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
if (t && _.label < t[2]) {
|
|
223
|
+
_.label = t[2];
|
|
224
|
+
_.ops.push(op);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
if (t[2])
|
|
228
|
+
_.ops.pop();
|
|
229
|
+
_.trys.pop();
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
op = body.call(thisArg, _);
|
|
233
|
+
}
|
|
234
|
+
catch (e) {
|
|
235
|
+
op = [6, e];
|
|
236
|
+
y = 0;
|
|
237
|
+
}
|
|
238
|
+
finally {
|
|
239
|
+
f = t = 0;
|
|
240
|
+
}
|
|
241
|
+
if (op[0] & 5)
|
|
242
|
+
throw op[1];
|
|
243
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
247
|
+
if (k2 === undefined)
|
|
248
|
+
k2 = k;
|
|
249
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
250
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
251
|
+
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
252
|
+
}
|
|
253
|
+
Object.defineProperty(o, k2, desc);
|
|
254
|
+
}) : (function (o, m, k, k2) {
|
|
255
|
+
if (k2 === undefined)
|
|
256
|
+
k2 = k;
|
|
257
|
+
o[k2] = m[k];
|
|
258
|
+
});
|
|
259
|
+
function __exportStar(m, o) {
|
|
260
|
+
for (var p in m)
|
|
261
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
262
|
+
__createBinding(o, m, p);
|
|
263
|
+
}
|
|
264
|
+
function __values(o) {
|
|
265
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
266
|
+
if (m)
|
|
267
|
+
return m.call(o);
|
|
268
|
+
if (o && typeof o.length === "number")
|
|
269
|
+
return {
|
|
270
|
+
next: function () {
|
|
271
|
+
if (o && i >= o.length)
|
|
272
|
+
o = void 0;
|
|
273
|
+
return { value: o && o[i++], done: !o };
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
277
|
+
}
|
|
278
|
+
function __read(o, n) {
|
|
279
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
280
|
+
if (!m)
|
|
281
|
+
return o;
|
|
282
|
+
var i = m.call(o), r, ar = [], e;
|
|
283
|
+
try {
|
|
284
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
285
|
+
ar.push(r.value);
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
e = { error: error };
|
|
289
|
+
}
|
|
290
|
+
finally {
|
|
291
|
+
try {
|
|
292
|
+
if (r && !r.done && (m = i["return"]))
|
|
293
|
+
m.call(i);
|
|
294
|
+
}
|
|
295
|
+
finally {
|
|
296
|
+
if (e)
|
|
297
|
+
throw e.error;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return ar;
|
|
301
|
+
}
|
|
302
|
+
/** @deprecated */
|
|
303
|
+
function __spread() {
|
|
304
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
305
|
+
ar = ar.concat(__read(arguments[i]));
|
|
306
|
+
return ar;
|
|
307
|
+
}
|
|
308
|
+
/** @deprecated */
|
|
309
|
+
function __spreadArrays() {
|
|
310
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
311
|
+
s += arguments[i].length;
|
|
312
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
313
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
314
|
+
r[k] = a[j];
|
|
315
|
+
return r;
|
|
316
|
+
}
|
|
317
|
+
function __spreadArray(to, from, pack) {
|
|
318
|
+
if (pack || arguments.length === 2)
|
|
319
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
320
|
+
if (ar || !(i in from)) {
|
|
321
|
+
if (!ar)
|
|
322
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
323
|
+
ar[i] = from[i];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
327
|
+
}
|
|
328
|
+
function __await(v) {
|
|
329
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
330
|
+
}
|
|
331
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
332
|
+
if (!Symbol.asyncIterator)
|
|
333
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
334
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
335
|
+
return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
336
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
337
|
+
function verb(n, f) { if (g[n]) {
|
|
338
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); };
|
|
339
|
+
if (f)
|
|
340
|
+
i[n] = f(i[n]);
|
|
341
|
+
} }
|
|
342
|
+
function resume(n, v) { try {
|
|
343
|
+
step(g[n](v));
|
|
344
|
+
}
|
|
345
|
+
catch (e) {
|
|
346
|
+
settle(q[0][3], e);
|
|
347
|
+
} }
|
|
348
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
349
|
+
function fulfill(value) { resume("next", value); }
|
|
350
|
+
function reject(value) { resume("throw", value); }
|
|
351
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
352
|
+
resume(q[0][0], q[0][1]); }
|
|
353
|
+
}
|
|
354
|
+
function __asyncDelegator(o) {
|
|
355
|
+
var i, p;
|
|
356
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
357
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
358
|
+
}
|
|
359
|
+
function __asyncValues(o) {
|
|
360
|
+
if (!Symbol.asyncIterator)
|
|
361
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
362
|
+
var m = o[Symbol.asyncIterator], i;
|
|
363
|
+
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);
|
|
364
|
+
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); }); }; }
|
|
365
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
366
|
+
}
|
|
367
|
+
function __makeTemplateObject(cooked, raw) {
|
|
368
|
+
if (Object.defineProperty) {
|
|
369
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
cooked.raw = raw;
|
|
373
|
+
}
|
|
374
|
+
return cooked;
|
|
375
|
+
}
|
|
376
|
+
;
|
|
377
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
378
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
379
|
+
}) : function (o, v) {
|
|
380
|
+
o["default"] = v;
|
|
381
|
+
};
|
|
382
|
+
function __importStar(mod) {
|
|
383
|
+
if (mod && mod.__esModule)
|
|
384
|
+
return mod;
|
|
385
|
+
var result = {};
|
|
386
|
+
if (mod != null)
|
|
387
|
+
for (var k in mod)
|
|
388
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
389
|
+
__createBinding(result, mod, k);
|
|
390
|
+
__setModuleDefault(result, mod);
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
function __importDefault(mod) {
|
|
394
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
395
|
+
}
|
|
396
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
397
|
+
if (kind === "a" && !f)
|
|
398
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
399
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
400
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
401
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
402
|
+
}
|
|
403
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
404
|
+
if (kind === "m")
|
|
405
|
+
throw new TypeError("Private method is not writable");
|
|
406
|
+
if (kind === "a" && !f)
|
|
407
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
408
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
409
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
410
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
411
|
+
}
|
|
412
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
413
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
414
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
415
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
416
|
+
}
|
|
417
|
+
function __addDisposableResource(env, value, async) {
|
|
418
|
+
if (value !== null && value !== void 0) {
|
|
419
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
420
|
+
throw new TypeError("Object expected.");
|
|
421
|
+
var dispose, inner;
|
|
422
|
+
if (async) {
|
|
423
|
+
if (!Symbol.asyncDispose)
|
|
424
|
+
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
425
|
+
dispose = value[Symbol.asyncDispose];
|
|
426
|
+
}
|
|
427
|
+
if (dispose === void 0) {
|
|
428
|
+
if (!Symbol.dispose)
|
|
429
|
+
throw new TypeError("Symbol.dispose is not defined.");
|
|
430
|
+
dispose = value[Symbol.dispose];
|
|
431
|
+
if (async)
|
|
432
|
+
inner = dispose;
|
|
433
|
+
}
|
|
434
|
+
if (typeof dispose !== "function")
|
|
435
|
+
throw new TypeError("Object not disposable.");
|
|
436
|
+
if (inner)
|
|
437
|
+
dispose = function () { try {
|
|
438
|
+
inner.call(this);
|
|
439
|
+
}
|
|
440
|
+
catch (e) {
|
|
441
|
+
return Promise.reject(e);
|
|
442
|
+
} };
|
|
443
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
444
|
+
}
|
|
445
|
+
else if (async) {
|
|
446
|
+
env.stack.push({ async: true });
|
|
447
|
+
}
|
|
448
|
+
return value;
|
|
449
|
+
}
|
|
450
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
451
|
+
var e = new Error(message);
|
|
452
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
453
|
+
};
|
|
454
|
+
function __disposeResources(env) {
|
|
455
|
+
function fail(e) {
|
|
456
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
457
|
+
env.hasError = true;
|
|
458
|
+
}
|
|
459
|
+
function next() {
|
|
460
|
+
while (env.stack.length) {
|
|
461
|
+
var rec = env.stack.pop();
|
|
462
|
+
try {
|
|
463
|
+
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
464
|
+
if (rec.async)
|
|
465
|
+
return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
|
|
466
|
+
}
|
|
467
|
+
catch (e) {
|
|
468
|
+
fail(e);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (env.hasError)
|
|
472
|
+
throw env.error;
|
|
473
|
+
}
|
|
474
|
+
return next();
|
|
475
|
+
}
|
|
476
|
+
var tslib_es6 = {
|
|
477
|
+
__extends: __extends,
|
|
478
|
+
__assign: __assign,
|
|
479
|
+
__rest: __rest,
|
|
480
|
+
__decorate: __decorate,
|
|
481
|
+
__param: __param,
|
|
482
|
+
__metadata: __metadata,
|
|
483
|
+
__awaiter: __awaiter,
|
|
484
|
+
__generator: __generator,
|
|
485
|
+
__createBinding: __createBinding,
|
|
486
|
+
__exportStar: __exportStar,
|
|
487
|
+
__values: __values,
|
|
488
|
+
__read: __read,
|
|
489
|
+
__spread: __spread,
|
|
490
|
+
__spreadArrays: __spreadArrays,
|
|
491
|
+
__spreadArray: __spreadArray,
|
|
492
|
+
__await: __await,
|
|
493
|
+
__asyncGenerator: __asyncGenerator,
|
|
494
|
+
__asyncDelegator: __asyncDelegator,
|
|
495
|
+
__asyncValues: __asyncValues,
|
|
496
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
497
|
+
__importStar: __importStar,
|
|
498
|
+
__importDefault: __importDefault,
|
|
499
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
500
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
501
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
502
|
+
__addDisposableResource: __addDisposableResource,
|
|
503
|
+
__disposeResources: __disposeResources,
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 项目环境变量配置 Token
|
|
508
|
+
*/
|
|
509
|
+
var RK_ENVIRONMENT = new i0.InjectionToken('environment');
|
|
510
|
+
var AppConfig = /** @class */ (function () {
|
|
511
|
+
function AppConfig(env, title) {
|
|
512
|
+
this.env = env;
|
|
513
|
+
this.title = title;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* 加载配置
|
|
517
|
+
*/
|
|
518
|
+
AppConfig.prototype.onLoad = function () {
|
|
519
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
520
|
+
var url, response, json, config;
|
|
521
|
+
return __generator(this, function (_a) {
|
|
522
|
+
switch (_a.label) {
|
|
523
|
+
case 0:
|
|
524
|
+
url = "api/gl-service-sys-core/v1/core/system/parameter/getOneByCode/" + this.env.config.PROJECT_CONFIG_KEY;
|
|
525
|
+
return [4 /*yield*/, fetch(url)];
|
|
526
|
+
case 1:
|
|
527
|
+
response = _a.sent();
|
|
528
|
+
return [4 /*yield*/, response.json()];
|
|
529
|
+
case 2:
|
|
530
|
+
json = _a.sent();
|
|
531
|
+
if (json.code !== 0) {
|
|
532
|
+
throw new Error(json.msg);
|
|
533
|
+
}
|
|
534
|
+
config = json.data.SYSTEM_PARAMETER_VALUE && JSON.parse(json.data.SYSTEM_PARAMETER_VALUE);
|
|
535
|
+
config.production = config.production === 'true';
|
|
536
|
+
AppConfig.settings = config;
|
|
537
|
+
this.title.setTitle(config.insights.PROJECT_NAME);
|
|
538
|
+
return [2 /*return*/, config];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
return AppConfig;
|
|
544
|
+
}());
|
|
545
|
+
AppConfig.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AppConfig, deps: [{ token: RK_ENVIRONMENT }, { token: i1__namespace.Title }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
546
|
+
AppConfig.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AppConfig, providedIn: 'root' });
|
|
547
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AppConfig, decorators: [{
|
|
548
|
+
type: i0.Injectable,
|
|
549
|
+
args: [{
|
|
550
|
+
providedIn: 'root',
|
|
551
|
+
}]
|
|
552
|
+
}], ctorParameters: function () {
|
|
553
|
+
return [{ type: undefined, decorators: [{
|
|
554
|
+
type: i0.Inject,
|
|
555
|
+
args: [RK_ENVIRONMENT]
|
|
556
|
+
}] }, { type: i1__namespace.Title }];
|
|
557
|
+
} });
|
|
558
|
+
/**
|
|
559
|
+
* 项目初始化配置
|
|
560
|
+
* @param environment
|
|
561
|
+
*/
|
|
562
|
+
function providerAppConfig(environment) {
|
|
563
|
+
return [
|
|
564
|
+
{ provide: RK_ENVIRONMENT, useValue: environment },
|
|
565
|
+
AppConfig,
|
|
566
|
+
{
|
|
567
|
+
provide: i0.APP_INITIALIZER,
|
|
568
|
+
useFactory: function (appConfig) { return function () { return appConfig.onLoad(); }; },
|
|
569
|
+
deps: [AppConfig],
|
|
570
|
+
multi: true,
|
|
571
|
+
},
|
|
572
|
+
];
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
var RkAuthService = /** @class */ (function () {
|
|
576
|
+
function RkAuthService(env, http) {
|
|
577
|
+
this.env = env;
|
|
578
|
+
this.http = http;
|
|
579
|
+
this.auth = new utils.Store('auth', {});
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* 系统登录
|
|
583
|
+
* @param data 验证信息
|
|
584
|
+
* @returns
|
|
585
|
+
*/
|
|
586
|
+
RkAuthService.prototype.onLogin = function (data) {
|
|
587
|
+
var _this = this;
|
|
588
|
+
var url = 'api/gl-service-sys-user/v1/user/system/auth/login';
|
|
589
|
+
var headers = new i1$1.HttpHeaders({
|
|
590
|
+
'ProjectNo': this.env.config.PROJECT_TYPE,
|
|
591
|
+
'Token-Control': 'no-token',
|
|
592
|
+
});
|
|
593
|
+
return this.http.post(url, { data: data }, { headers: headers }).pipe(operators.tap(function (json) {
|
|
594
|
+
if (json.code === 0) {
|
|
595
|
+
_this.auth.set(json.data);
|
|
596
|
+
}
|
|
597
|
+
}));
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* 注销系统
|
|
601
|
+
*/
|
|
602
|
+
RkAuthService.prototype.onLogout = function () {
|
|
603
|
+
var url = 'api/gl-service-sys-user/v1/user/system/auth/logoutByAuthId';
|
|
604
|
+
return this.http.post(url, { AUTH_ID: this.token.id });
|
|
605
|
+
};
|
|
606
|
+
Object.defineProperty(RkAuthService.prototype, "token", {
|
|
607
|
+
/**
|
|
608
|
+
* 获得 token
|
|
609
|
+
*/
|
|
610
|
+
get: function () {
|
|
611
|
+
return this.auth.get();
|
|
612
|
+
},
|
|
613
|
+
enumerable: false,
|
|
614
|
+
configurable: true
|
|
615
|
+
});
|
|
616
|
+
return RkAuthService;
|
|
617
|
+
}());
|
|
618
|
+
RkAuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAuthService, deps: [{ token: RK_ENVIRONMENT }, { token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
619
|
+
RkAuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAuthService, providedIn: 'root' });
|
|
620
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAuthService, decorators: [{
|
|
621
|
+
type: i0.Injectable,
|
|
622
|
+
args: [{
|
|
623
|
+
providedIn: 'root',
|
|
624
|
+
}]
|
|
625
|
+
}], ctorParameters: function () {
|
|
626
|
+
return [{ type: undefined, decorators: [{
|
|
627
|
+
type: i0.Inject,
|
|
628
|
+
args: [RK_ENVIRONMENT]
|
|
629
|
+
}] }, { type: i1__namespace$1.HttpClient }];
|
|
630
|
+
} });
|
|
631
|
+
|
|
632
|
+
var RkAccountService = /** @class */ (function () {
|
|
633
|
+
function RkAccountService(http, auth) {
|
|
634
|
+
this.http = http;
|
|
635
|
+
this.auth = auth;
|
|
636
|
+
this.account = new utils.Store('account', {});
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* 加载人员权限
|
|
640
|
+
*/
|
|
641
|
+
RkAccountService.prototype.onLoadAuth = function () {
|
|
642
|
+
var _this = this;
|
|
643
|
+
var _a;
|
|
644
|
+
var url = 'api/gl-service-sys-user/v1/user/system/user/loadAuthData';
|
|
645
|
+
return this.http.post(url, { SYSTEM_USER_ID: (_a = this.auth.token) === null || _a === void 0 ? void 0 : _a.id }).pipe(operators.tap(function (json) {
|
|
646
|
+
if (json.code === 0) {
|
|
647
|
+
_this.account.set(json.data);
|
|
648
|
+
}
|
|
649
|
+
}));
|
|
650
|
+
};
|
|
651
|
+
Object.defineProperty(RkAccountService.prototype, "userInfo", {
|
|
652
|
+
/**
|
|
653
|
+
* 获得账号基本信息
|
|
654
|
+
*/
|
|
655
|
+
get: function () {
|
|
656
|
+
return this.account.get().UserInfo;
|
|
657
|
+
},
|
|
658
|
+
enumerable: false,
|
|
659
|
+
configurable: true
|
|
660
|
+
});
|
|
661
|
+
Object.defineProperty(RkAccountService.prototype, "personnelPool", {
|
|
662
|
+
/**
|
|
663
|
+
* 获得账号人员库权限
|
|
664
|
+
*/
|
|
665
|
+
get: function () {
|
|
666
|
+
return this.account.get().AuthPersonnelPool;
|
|
667
|
+
},
|
|
668
|
+
enumerable: false,
|
|
669
|
+
configurable: true
|
|
670
|
+
});
|
|
671
|
+
Object.defineProperty(RkAccountService.prototype, "workflowAuth", {
|
|
672
|
+
/**
|
|
673
|
+
* 获得账号业务权限
|
|
674
|
+
*/
|
|
675
|
+
get: function () {
|
|
676
|
+
return this.account.get().AuthWfId;
|
|
677
|
+
},
|
|
678
|
+
enumerable: false,
|
|
679
|
+
configurable: true
|
|
680
|
+
});
|
|
681
|
+
Object.defineProperty(RkAccountService.prototype, "authOrgGroup", {
|
|
682
|
+
/**
|
|
683
|
+
* 获得账号机构分组权限
|
|
684
|
+
*/
|
|
685
|
+
get: function () {
|
|
686
|
+
return this.account.get().AuthOrgGroup;
|
|
687
|
+
},
|
|
688
|
+
enumerable: false,
|
|
689
|
+
configurable: true
|
|
690
|
+
});
|
|
691
|
+
return RkAccountService;
|
|
692
|
+
}());
|
|
693
|
+
RkAccountService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAccountService, deps: [{ token: i1__namespace$1.HttpClient }, { token: RkAuthService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
694
|
+
RkAccountService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAccountService, providedIn: 'root' });
|
|
695
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkAccountService, decorators: [{
|
|
696
|
+
type: i0.Injectable,
|
|
697
|
+
args: [{
|
|
698
|
+
providedIn: 'root',
|
|
699
|
+
}]
|
|
700
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }, { type: RkAuthService }]; } });
|
|
701
|
+
|
|
702
|
+
var RkCacheHttpService = /** @class */ (function () {
|
|
703
|
+
function RkCacheHttpService() {
|
|
704
|
+
this.cache = new Map();
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* 获得已缓存的请求
|
|
708
|
+
* @param url GET请求地址
|
|
709
|
+
*/
|
|
710
|
+
RkCacheHttpService.prototype.get = function (url) {
|
|
711
|
+
return this.cache.get(url);
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* 缓存请求
|
|
715
|
+
* @param url GET请求地址
|
|
716
|
+
* @param response 响应内容
|
|
717
|
+
*/
|
|
718
|
+
RkCacheHttpService.prototype.set = function (url, response) {
|
|
719
|
+
this.cache.set(url, response);
|
|
720
|
+
};
|
|
721
|
+
/**
|
|
722
|
+
* 删除指定已缓存的请求
|
|
723
|
+
* @param url GET请求地址
|
|
724
|
+
*/
|
|
725
|
+
RkCacheHttpService.prototype.delete = function (url) {
|
|
726
|
+
this.cache.delete(url);
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* 删除所有已缓存的请求
|
|
730
|
+
*/
|
|
731
|
+
RkCacheHttpService.prototype.clear = function () {
|
|
732
|
+
this.cache.clear();
|
|
733
|
+
};
|
|
734
|
+
return RkCacheHttpService;
|
|
735
|
+
}());
|
|
736
|
+
RkCacheHttpService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkCacheHttpService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
737
|
+
RkCacheHttpService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkCacheHttpService, providedIn: 'root' });
|
|
738
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkCacheHttpService, decorators: [{
|
|
739
|
+
type: i0.Injectable,
|
|
740
|
+
args: [{
|
|
741
|
+
providedIn: 'root',
|
|
742
|
+
}]
|
|
743
|
+
}] });
|
|
744
|
+
/**
|
|
745
|
+
* 设置为缓存请求
|
|
746
|
+
* 使用方法:http.get(...CacheHttpTemplate`api/response.json`)
|
|
747
|
+
* @param urls 请求地址
|
|
748
|
+
* @param params 模板参数
|
|
749
|
+
*/
|
|
750
|
+
function CacheHttpTemplate(urls) {
|
|
751
|
+
var params = [];
|
|
752
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
753
|
+
params[_i - 1] = arguments[_i];
|
|
754
|
+
}
|
|
755
|
+
var _a = __read(urls, 1), url = _a[0];
|
|
756
|
+
if (params.length > 0) {
|
|
757
|
+
url = String.raw.apply(String, __spreadArray([urls], __read(params)));
|
|
758
|
+
}
|
|
759
|
+
return [url, { headers: new i1$1.HttpHeaders({ 'Cache-Map': 'Storage' }) }];
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
var RkMenuService = /** @class */ (function () {
|
|
763
|
+
function RkMenuService(http) {
|
|
764
|
+
this.http = http;
|
|
765
|
+
this.appSettings = AppConfig.settings;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* 获得系统导航列表
|
|
769
|
+
*/
|
|
770
|
+
RkMenuService.prototype.requestData = function () {
|
|
771
|
+
var _a;
|
|
772
|
+
var url = 'api/gl-service-sys-core/v1/core/system/resource/tree/selectListNav';
|
|
773
|
+
return (_a = this.http).get.apply(_a, __spreadArray([], __read(CacheHttpTemplate(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["", "/", ""], ["", "/", ""])), url, this.appSettings.servers.RESOURCE_GROUP_ID)))).pipe(operators.tap(function (json) {
|
|
774
|
+
if (json.code !== 0) {
|
|
775
|
+
throw new Error("\u83B7\u5F97\u7CFB\u7EDF\u5BFC\u822A\u5217\u8868 " + url + " \u51FA\u73B0\u9519\u8BEF: " + json.msg);
|
|
776
|
+
}
|
|
777
|
+
var menus = json.data;
|
|
778
|
+
menus.forEach(function (menu) {
|
|
779
|
+
menu.children = menus.filter(function (v) { return menu.SYSTEM_RESOURCE_TREE_ID === v.SYS_PARENT; }) || [];
|
|
780
|
+
});
|
|
781
|
+
}));
|
|
782
|
+
};
|
|
783
|
+
return RkMenuService;
|
|
784
|
+
}());
|
|
785
|
+
RkMenuService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkMenuService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
786
|
+
RkMenuService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkMenuService, providedIn: 'root' });
|
|
787
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkMenuService, decorators: [{
|
|
788
|
+
type: i0.Injectable,
|
|
789
|
+
args: [{
|
|
790
|
+
providedIn: 'root',
|
|
791
|
+
}]
|
|
792
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
793
|
+
var templateObject_1$3;
|
|
794
|
+
|
|
795
|
+
var RkDownFileService = /** @class */ (function () {
|
|
796
|
+
function RkDownFileService(http) {
|
|
797
|
+
this.http = http;
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* 使用GET方法下载文件
|
|
801
|
+
* @param url 请求链接; url可以传递自定义文件名优先级最高;如:api/file/down?fileName=身份证.jpg
|
|
802
|
+
* @param params 请求参数
|
|
803
|
+
*/
|
|
804
|
+
RkDownFileService.prototype.get = function (url, params) {
|
|
805
|
+
var _this = this;
|
|
806
|
+
return this.http
|
|
807
|
+
.get(url, { params: params, responseType: 'blob', observe: 'response' })
|
|
808
|
+
.pipe(operators.tap(function (response) { return _this.handleResponse(response, url); }));
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* 使用POST方法下载文件
|
|
812
|
+
* @param url 请求链接; url可以传递自定义文件名优先级最高;如:api/file/down?fileName=身份证.jpg
|
|
813
|
+
* @param params 请求参数
|
|
814
|
+
*/
|
|
815
|
+
RkDownFileService.prototype.post = function (url, params) {
|
|
816
|
+
var _this = this;
|
|
817
|
+
return this.http
|
|
818
|
+
.post(url, params, { responseType: 'blob', observe: 'response' })
|
|
819
|
+
.pipe(operators.tap(function (response) { return _this.handleResponse(response, url); }));
|
|
820
|
+
};
|
|
821
|
+
RkDownFileService.prototype.handleResponse = function (response, url) {
|
|
822
|
+
var filename = this.getFileName(response.headers, url);
|
|
823
|
+
this.saveAs(response.body, filename);
|
|
824
|
+
};
|
|
825
|
+
RkDownFileService.prototype.getFileName = function (headers, url) {
|
|
826
|
+
var urlParams = new URLSearchParams(url.split('?')[1]);
|
|
827
|
+
var fileNameFromParams = urlParams.get('fileName');
|
|
828
|
+
if (fileNameFromParams) {
|
|
829
|
+
return decodeURIComponent(fileNameFromParams);
|
|
830
|
+
}
|
|
831
|
+
var disposition = headers.get('content-disposition');
|
|
832
|
+
if (disposition) {
|
|
833
|
+
var filenameMatch = disposition.match(/filename=([^;]+)/);
|
|
834
|
+
if (filenameMatch) {
|
|
835
|
+
return decodeURIComponent(filenameMatch[1]);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
var filenameFromHeaders = headers.get('filename');
|
|
839
|
+
if (filenameFromHeaders) {
|
|
840
|
+
return decodeURIComponent(filenameFromHeaders);
|
|
841
|
+
}
|
|
842
|
+
var urlSegments = url.split('/');
|
|
843
|
+
return decodeURIComponent(urlSegments[urlSegments.length - 1].split('?')[0]);
|
|
844
|
+
};
|
|
845
|
+
/**
|
|
846
|
+
* 文件另存为
|
|
847
|
+
* @param body 二进制内容
|
|
848
|
+
* @param filename 文件名
|
|
849
|
+
*/
|
|
850
|
+
RkDownFileService.prototype.saveAs = function (body, filename) {
|
|
851
|
+
var blob = new Blob([body], { type: 'application/x-msdownload' });
|
|
852
|
+
var blobURL = URL.createObjectURL(blob);
|
|
853
|
+
var link = document.createElement('a');
|
|
854
|
+
link.href = blobURL;
|
|
855
|
+
link.download = filename;
|
|
856
|
+
link.style.display = 'none';
|
|
857
|
+
document.body.appendChild(link);
|
|
858
|
+
link.click();
|
|
859
|
+
document.body.removeChild(link);
|
|
860
|
+
URL.revokeObjectURL(blobURL);
|
|
861
|
+
};
|
|
862
|
+
return RkDownFileService;
|
|
863
|
+
}());
|
|
864
|
+
RkDownFileService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDownFileService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
865
|
+
RkDownFileService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDownFileService, providedIn: 'root' });
|
|
866
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDownFileService, decorators: [{
|
|
867
|
+
type: i0.Injectable,
|
|
868
|
+
args: [{
|
|
869
|
+
providedIn: 'root',
|
|
870
|
+
}]
|
|
871
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
872
|
+
|
|
873
|
+
var RkFileService = /** @class */ (function () {
|
|
874
|
+
function RkFileService(http) {
|
|
875
|
+
this.http = http;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* 获得人员照片静态路径
|
|
879
|
+
* @param fileId 文件编码
|
|
880
|
+
* @param fileName 文件名称
|
|
881
|
+
*/
|
|
882
|
+
RkFileService.prototype.staticPhotoUrl = function (fileId, fileName) {
|
|
883
|
+
var url = "api/gl-file-service/static/photo/" + fileId;
|
|
884
|
+
if (fileName) {
|
|
885
|
+
url += "?fileName=" + encodeURI(fileName);
|
|
886
|
+
}
|
|
887
|
+
return url;
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* 上传人员照片
|
|
891
|
+
* @param data 文件
|
|
892
|
+
*/
|
|
893
|
+
RkFileService.prototype.photoUpload = function (data) {
|
|
894
|
+
var url = 'api/gl-file-service/photo/upload';
|
|
895
|
+
return this.http.post(url, data);
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* 获得附件静态路径
|
|
899
|
+
* @param fileId 文件编码
|
|
900
|
+
* @param fileName 文件名称
|
|
901
|
+
*/
|
|
902
|
+
RkFileService.prototype.staticFileUrl = function (fileId, fileName) {
|
|
903
|
+
var url = "api/gl-file-service/static/attachment/" + fileId;
|
|
904
|
+
if (fileName) {
|
|
905
|
+
url += "?fileName=" + encodeURI(fileName);
|
|
906
|
+
}
|
|
907
|
+
return url;
|
|
908
|
+
};
|
|
909
|
+
/**
|
|
910
|
+
* 上传附件
|
|
911
|
+
* @param data 文件
|
|
912
|
+
*/
|
|
913
|
+
RkFileService.prototype.fileUpload = function (data) {
|
|
914
|
+
var url = 'api/gl-file-service/attachment/upload';
|
|
915
|
+
return this.http.post(url, data);
|
|
916
|
+
};
|
|
917
|
+
return RkFileService;
|
|
918
|
+
}());
|
|
919
|
+
RkFileService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFileService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
920
|
+
RkFileService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFileService, providedIn: 'root' });
|
|
921
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFileService, decorators: [{
|
|
922
|
+
type: i0.Injectable,
|
|
923
|
+
args: [{
|
|
924
|
+
providedIn: 'root',
|
|
925
|
+
}]
|
|
926
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
927
|
+
|
|
928
|
+
var RkOrgService = /** @class */ (function () {
|
|
929
|
+
function RkOrgService(http) {
|
|
930
|
+
this.http = http;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* 通过父节点编码获得单位列表
|
|
934
|
+
* @param groupId 机构分组
|
|
935
|
+
* @param parentId 父节点编码;默认 -1
|
|
936
|
+
* @param isAll 是否显示全部单位(不受权限控制);默认 false
|
|
937
|
+
* @returns 单位列表
|
|
938
|
+
*/
|
|
939
|
+
RkOrgService.prototype.getChildren = function (groupId, parentId, isAll) {
|
|
940
|
+
if (parentId === void 0) { parentId = '-1'; }
|
|
941
|
+
if (isAll === void 0) { isAll = false; }
|
|
942
|
+
var url = 'api/gl-service-data/v1/data/unit/org/selectListByParent';
|
|
943
|
+
return this.http.post(url, { ORG_GROUP_ID: groupId, SYS_PARENT: parentId, IS_ALL: isAll });
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* 搜索机构
|
|
947
|
+
* @param groupId 机构分组
|
|
948
|
+
* @param keyName 搜索关键字
|
|
949
|
+
* @returns 返回匹配项节点列表
|
|
950
|
+
*/
|
|
951
|
+
RkOrgService.prototype.requestKeywordList = function (groupId, keyName) {
|
|
952
|
+
var url = 'api/gl-service-data/v1/data/unit/org/selectListByQuery';
|
|
953
|
+
return this.http.post(url, { ORG_GROUP_ID: groupId, ORG_NAME: keyName });
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* 通过单位编码获得所有父节点
|
|
957
|
+
* @param id
|
|
958
|
+
*/
|
|
959
|
+
RkOrgService.prototype.requestParentList = function (id) {
|
|
960
|
+
var url = 'api/gl-service-data/v1/data/unit/org/selectListAllParentById';
|
|
961
|
+
return this.http.post(url, { DATA_UNIT_ORG_ID: id });
|
|
962
|
+
};
|
|
963
|
+
return RkOrgService;
|
|
964
|
+
}());
|
|
965
|
+
RkOrgService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkOrgService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
966
|
+
RkOrgService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkOrgService, providedIn: 'root' });
|
|
967
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkOrgService, decorators: [{
|
|
968
|
+
type: i0.Injectable,
|
|
969
|
+
args: [{
|
|
970
|
+
providedIn: 'root',
|
|
971
|
+
}]
|
|
972
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
973
|
+
|
|
974
|
+
var RkDictionaryService = /** @class */ (function () {
|
|
975
|
+
function RkDictionaryService(http) {
|
|
976
|
+
this.http = http;
|
|
977
|
+
this.useItems = new utils.Store('dictionary_use_items', {}, { expires: 1000 * 60 * 60 * 24 * 7 });
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* 通过字典编码获得常用项
|
|
981
|
+
* @param code 字典编码
|
|
982
|
+
* @returns 常用项
|
|
983
|
+
*/
|
|
984
|
+
RkDictionaryService.prototype.getUseItems = function (code) {
|
|
985
|
+
return this.useItems.get()[code] || [];
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* 通过字典编码设置常用项
|
|
989
|
+
* @param code 字典编码
|
|
990
|
+
* @param item 常用项
|
|
991
|
+
*/
|
|
992
|
+
RkDictionaryService.prototype.setUseItems = function (code, item) {
|
|
993
|
+
var data = this.useItems.get();
|
|
994
|
+
if (!data[code]) {
|
|
995
|
+
data[code] = [item];
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
if (data[code].find(function (v) { return v.DICTIONARY_ITEM_CODE === item.DICTIONARY_ITEM_CODE; })) {
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
if (data[code].length > 9) {
|
|
1002
|
+
data[code].pop();
|
|
1003
|
+
}
|
|
1004
|
+
data[code].unshift(item);
|
|
1005
|
+
}
|
|
1006
|
+
this.useItems.set(data);
|
|
1007
|
+
};
|
|
1008
|
+
/**
|
|
1009
|
+
* 通过字典编码获得字典基本信息
|
|
1010
|
+
* @param code 字典编码
|
|
1011
|
+
* @returns 字典基本信息
|
|
1012
|
+
*/
|
|
1013
|
+
RkDictionaryService.prototype.getBaseInfo = function (code) {
|
|
1014
|
+
var _a;
|
|
1015
|
+
var url = "api/gl-service-sys-core/v1/core/system/dictionary/selectOneByDictionaryCode";
|
|
1016
|
+
return (_a = this.http).get.apply(_a, __spreadArray([], __read(CacheHttpTemplate(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["", "/", ""], ["", "/", ""])), url, this.codeReplace(code))))).pipe(operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1017
|
+
};
|
|
1018
|
+
/**
|
|
1019
|
+
* 通过字典编码获得获得字典项
|
|
1020
|
+
* @param code 字典编码
|
|
1021
|
+
* @returns 字典项列表
|
|
1022
|
+
*/
|
|
1023
|
+
RkDictionaryService.prototype.getData = function (code) {
|
|
1024
|
+
var _a;
|
|
1025
|
+
var url = "api/gl-service-sys-core/v1/core/system/dictionary/item/selectListByDictionaryCode";
|
|
1026
|
+
return (_a = this.http).get.apply(_a, __spreadArray([], __read(CacheHttpTemplate(templateObject_2 || (templateObject_2 = __makeTemplateObject(["", "/", ""], ["", "/", ""])), url, this.codeReplace(code))))).pipe(operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1027
|
+
};
|
|
1028
|
+
/**
|
|
1029
|
+
* 通过父节点获得字典项编码
|
|
1030
|
+
* @param code 字典编码
|
|
1031
|
+
* @param parentId 父节点编码
|
|
1032
|
+
* @returns 字典项列表
|
|
1033
|
+
*/
|
|
1034
|
+
RkDictionaryService.prototype.getChildData = function (code, parentId) {
|
|
1035
|
+
if (parentId === void 0) { parentId = '-1'; }
|
|
1036
|
+
var url = "api/gl-service-sys-core/v1/core/system/dictionary/item/selectListByDictionaryCode";
|
|
1037
|
+
return this.http.post(url, { DICTIONARY_CODE: code, SYS_PARENT: parentId }).pipe(operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1038
|
+
};
|
|
1039
|
+
RkDictionaryService.prototype.codeReplace = function (code) {
|
|
1040
|
+
return code.replace(/\//g, '_');
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* 通过字典编码获得获得字典项
|
|
1044
|
+
* @param code 字典编码
|
|
1045
|
+
* @param keyword 关键字
|
|
1046
|
+
* @returns 字典项列表
|
|
1047
|
+
*/
|
|
1048
|
+
RkDictionaryService.prototype.requestSearchData = function (code, keyword) {
|
|
1049
|
+
var url = 'api/gl-service-sys-core/v1/core/system/dictionary/item/selectListByQuery';
|
|
1050
|
+
return this.http.post(url, { DICTIONARY_CODE: code, DICTIONARY_ITEM_NAME: keyword }).pipe(operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data
|
|
1051
|
+
.filter(function (item, index) { return index < 10; })
|
|
1052
|
+
.map(function (item) { return ({
|
|
1053
|
+
label: item.DICTIONARY_ITEM_NAME,
|
|
1054
|
+
key: item.SYSTEM_DICTIONARY_ITEM_ID,
|
|
1055
|
+
value: item.DICTIONARY_ITEM_CODE,
|
|
1056
|
+
}); }); }));
|
|
1057
|
+
};
|
|
1058
|
+
/**
|
|
1059
|
+
* 获得字典项的所有父节点
|
|
1060
|
+
* @param code 字典编码
|
|
1061
|
+
* @param id 字典项编码
|
|
1062
|
+
* @returns 字典项列表
|
|
1063
|
+
*/
|
|
1064
|
+
RkDictionaryService.prototype.requestParentList = function (code, id) {
|
|
1065
|
+
var url = 'api/gl-service-sys-core/v1/core/system/dictionary/item/selectListInfoAllParentByCode';
|
|
1066
|
+
return this.http.post(url, { DICTIONARY_CODE: code, DICTIONARY_ITEM_CODE: id }).pipe(operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1067
|
+
};
|
|
1068
|
+
return RkDictionaryService;
|
|
1069
|
+
}());
|
|
1070
|
+
RkDictionaryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDictionaryService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1071
|
+
RkDictionaryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDictionaryService, providedIn: 'root' });
|
|
1072
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDictionaryService, decorators: [{
|
|
1073
|
+
type: i0.Injectable,
|
|
1074
|
+
args: [{
|
|
1075
|
+
providedIn: 'root',
|
|
1076
|
+
}]
|
|
1077
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
1078
|
+
var templateObject_1$2, templateObject_2;
|
|
1079
|
+
|
|
1080
|
+
var RkSchemeService = /** @class */ (function () {
|
|
1081
|
+
function RkSchemeService(http) {
|
|
1082
|
+
this.http = http;
|
|
1083
|
+
this.appSettings = AppConfig.settings;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* 通过界面方案标识符获得界面方案内容
|
|
1087
|
+
* @param permission 界面方案标识符
|
|
1088
|
+
* @returns 界面方案
|
|
1089
|
+
*/
|
|
1090
|
+
RkSchemeService.prototype.getData = function (permission) {
|
|
1091
|
+
var _a;
|
|
1092
|
+
if (this.appSettings && this.appSettings.servers.AREA_CODE) {
|
|
1093
|
+
permission = this.appSettings.servers.AREA_CODE + "_" + permission;
|
|
1094
|
+
}
|
|
1095
|
+
var url = "api/gl-service-sys-core/v1/core/system/scheme/selectSchemeByPermission";
|
|
1096
|
+
return (_a = this.http).get.apply(_a, __spreadArray([], __read(CacheHttpTemplate(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["", "/", ""], ["", "/", ""])), url, permission)))).pipe(operators.tap(function (json) {
|
|
1097
|
+
if (json.code !== 0) {
|
|
1098
|
+
throw new Error("\u901A\u8FC7\u754C\u9762\u65B9\u6848\u6807\u8BC6\u7B26\u83B7\u5F97\u754C\u9762\u65B9\u6848\u5185\u5BB9 " + url + " \u51FA\u73B0\u9519\u8BEF: " + json.msg);
|
|
1099
|
+
}
|
|
1100
|
+
}), operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1101
|
+
};
|
|
1102
|
+
return RkSchemeService;
|
|
1103
|
+
}());
|
|
1104
|
+
RkSchemeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkSchemeService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1105
|
+
RkSchemeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkSchemeService, providedIn: 'root' });
|
|
1106
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkSchemeService, decorators: [{
|
|
1107
|
+
type: i0.Injectable,
|
|
1108
|
+
args: [{
|
|
1109
|
+
providedIn: 'root',
|
|
1110
|
+
}]
|
|
1111
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
1112
|
+
var templateObject_1$1;
|
|
1113
|
+
|
|
1114
|
+
var RkFieldSchemeService = /** @class */ (function () {
|
|
1115
|
+
function RkFieldSchemeService(http) {
|
|
1116
|
+
this.http = http;
|
|
1117
|
+
this.appSettings = AppConfig.settings;
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* 通过字段方案标识符获得字段方案内容
|
|
1121
|
+
* @param permission 字段方案标识符
|
|
1122
|
+
* @returns 字段方案
|
|
1123
|
+
*/
|
|
1124
|
+
RkFieldSchemeService.prototype.getData = function (permission) {
|
|
1125
|
+
var _a;
|
|
1126
|
+
if (this.appSettings && this.appSettings.servers.AREA_CODE) {
|
|
1127
|
+
permission = this.appSettings.servers.AREA_CODE + "_" + permission;
|
|
1128
|
+
}
|
|
1129
|
+
var url = "api/gl-service-sys-core/v1/core/system/field/scheme/selectSchemeByIdentifier";
|
|
1130
|
+
return (_a = this.http).get.apply(_a, __spreadArray([], __read(CacheHttpTemplate(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", "/", ""], ["", "/", ""])), url, permission)))).pipe(operators.tap(function (json) {
|
|
1131
|
+
if (json.code !== 0) {
|
|
1132
|
+
throw new Error("\u901A\u8FC7\u5B57\u6BB5\u65B9\u6848\u6807\u8BC6\u7B26\u83B7\u5F97\u5B57\u6BB5\u65B9\u6848\u5185\u5BB9 " + url + " \u51FA\u73B0\u9519\u8BEF: " + json.msg);
|
|
1133
|
+
}
|
|
1134
|
+
}), operators.filter(function (json) { return json.code === 0; }), operators.map(function (json) { return json.data; }));
|
|
1135
|
+
};
|
|
1136
|
+
return RkFieldSchemeService;
|
|
1137
|
+
}());
|
|
1138
|
+
RkFieldSchemeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFieldSchemeService, deps: [{ token: i1__namespace$1.HttpClient }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1139
|
+
RkFieldSchemeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFieldSchemeService, providedIn: 'root' });
|
|
1140
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkFieldSchemeService, decorators: [{
|
|
1141
|
+
type: i0.Injectable,
|
|
1142
|
+
args: [{
|
|
1143
|
+
providedIn: 'root',
|
|
1144
|
+
}]
|
|
1145
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.HttpClient }]; } });
|
|
1146
|
+
var templateObject_1;
|
|
1147
|
+
|
|
1148
|
+
var RkDestroyService = /** @class */ (function (_super) {
|
|
1149
|
+
__extends(RkDestroyService, _super);
|
|
1150
|
+
function RkDestroyService() {
|
|
1151
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1152
|
+
}
|
|
1153
|
+
RkDestroyService.prototype.ngOnDestroy = function () {
|
|
1154
|
+
this.next();
|
|
1155
|
+
this.complete();
|
|
1156
|
+
};
|
|
1157
|
+
return RkDestroyService;
|
|
1158
|
+
}(rxjs.Subject));
|
|
1159
|
+
RkDestroyService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDestroyService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1160
|
+
RkDestroyService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDestroyService });
|
|
1161
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RkDestroyService, decorators: [{
|
|
1162
|
+
type: i0.Injectable
|
|
1163
|
+
}] });
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Generated bundle index. Do not edit.
|
|
1167
|
+
*/
|
|
1168
|
+
|
|
1169
|
+
exports.AppConfig = AppConfig;
|
|
1170
|
+
exports.CacheHttpTemplate = CacheHttpTemplate;
|
|
1171
|
+
exports.RK_ENVIRONMENT = RK_ENVIRONMENT;
|
|
1172
|
+
exports.RkAccountService = RkAccountService;
|
|
1173
|
+
exports.RkAuthService = RkAuthService;
|
|
1174
|
+
exports.RkCacheHttpService = RkCacheHttpService;
|
|
1175
|
+
exports.RkDestroyService = RkDestroyService;
|
|
1176
|
+
exports.RkDictionaryService = RkDictionaryService;
|
|
1177
|
+
exports.RkDownFileService = RkDownFileService;
|
|
1178
|
+
exports.RkFieldSchemeService = RkFieldSchemeService;
|
|
1179
|
+
exports.RkFileService = RkFileService;
|
|
1180
|
+
exports.RkMenuService = RkMenuService;
|
|
1181
|
+
exports.RkOrgService = RkOrgService;
|
|
1182
|
+
exports.RkSchemeService = RkSchemeService;
|
|
1183
|
+
exports.providerAppConfig = providerAppConfig;
|
|
1184
|
+
|
|
1185
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1186
|
+
|
|
1187
|
+
}));
|
|
1188
|
+
//# sourceMappingURL=reskin-core-services.umd.js.map
|