@ibiz-template/core 0.0.1-alpha.6 → 0.0.1-beta.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.
Files changed (165) hide show
  1. package/dist/system/index.system.js +1 -0
  2. package/out/command/command-register.d.ts +66 -0
  3. package/out/command/command-register.d.ts.map +1 -0
  4. package/out/command/command-register.js +113 -0
  5. package/out/command/command.d.ts +54 -0
  6. package/out/command/command.d.ts.map +1 -0
  7. package/out/command/command.js +71 -0
  8. package/out/command/index.d.ts +10 -0
  9. package/out/command/index.d.ts.map +1 -0
  10. package/out/command/index.js +9 -0
  11. package/out/command/interface/command/command-option.d.ts +23 -0
  12. package/out/command/interface/command/command-option.d.ts.map +1 -0
  13. package/out/command/interface/command/command-option.js +1 -0
  14. package/out/command/interface/command/command.d.ts +74 -0
  15. package/out/command/interface/command/command.d.ts.map +1 -0
  16. package/out/command/interface/command/command.js +1 -0
  17. package/out/command/interface/disposable/disposable.d.ts +4 -0
  18. package/out/command/interface/disposable/disposable.d.ts.map +1 -0
  19. package/out/command/interface/disposable/disposable.js +1 -0
  20. package/out/command/interface/index.d.ts +4 -0
  21. package/out/command/interface/index.d.ts.map +1 -0
  22. package/out/command/interface/index.js +1 -0
  23. package/out/command/utils/index.d.ts +3 -0
  24. package/out/command/utils/index.d.ts.map +1 -0
  25. package/out/command/utils/index.js +2 -0
  26. package/out/command/utils/linked-list.d.ts +16 -0
  27. package/out/command/utils/linked-list.d.ts.map +1 -0
  28. package/out/command/utils/linked-list.js +120 -0
  29. package/out/command/utils/util.d.ts +27 -0
  30. package/out/command/utils/util.d.ts.map +1 -0
  31. package/out/command/utils/util.js +77 -0
  32. package/out/constant/index.d.ts +3 -0
  33. package/out/constant/index.d.ts.map +1 -1
  34. package/out/constant/index.js +3 -0
  35. package/out/constant/login-mode/login-mode.d.ts +23 -0
  36. package/out/constant/login-mode/login-mode.d.ts.map +1 -0
  37. package/out/constant/login-mode/login-mode.js +24 -0
  38. package/out/constant/menu-permission-mode/menu-permission-mode.d.ts +23 -0
  39. package/out/constant/menu-permission-mode/menu-permission-mode.d.ts.map +1 -0
  40. package/out/constant/menu-permission-mode/menu-permission-mode.js +24 -0
  41. package/out/constant/util/util.d.ts +5 -0
  42. package/out/constant/util/util.d.ts.map +1 -0
  43. package/out/constant/util/util.js +5 -0
  44. package/out/context/index.d.ts +19 -32
  45. package/out/context/index.d.ts.map +1 -1
  46. package/out/context/index.js +52 -60
  47. package/out/environment/environment.d.ts.map +1 -1
  48. package/out/environment/environment.js +11 -2
  49. package/out/error/http-error/http-error.d.ts.map +1 -1
  50. package/out/error/http-error/http-error.js +0 -4
  51. package/out/factory-center.d.ts +11 -0
  52. package/out/factory-center.d.ts.map +1 -0
  53. package/out/factory-center.js +10 -0
  54. package/out/ibizsys.d.ts +17 -1
  55. package/out/ibizsys.d.ts.map +1 -1
  56. package/out/ibizsys.js +17 -1
  57. package/out/index.d.ts +3 -1
  58. package/out/index.d.ts.map +1 -1
  59. package/out/index.js +3 -1
  60. package/out/install.d.ts.map +1 -1
  61. package/out/install.js +4 -2
  62. package/out/interface/click-outside/click-outside.d.ts +70 -0
  63. package/out/interface/click-outside/click-outside.d.ts.map +1 -0
  64. package/out/interface/click-outside/click-outside.js +1 -0
  65. package/out/interface/i-environment/i-environment.d.ts +72 -4
  66. package/out/interface/i-environment/i-environment.d.ts.map +1 -1
  67. package/out/interface/index.d.ts +1 -0
  68. package/out/interface/index.d.ts.map +1 -1
  69. package/out/interface/index.js +1 -1
  70. package/out/types.d.ts +10 -0
  71. package/out/types.d.ts.map +1 -1
  72. package/out/utils/click-outside/click-outside.d.ts +14 -0
  73. package/out/utils/click-outside/click-outside.d.ts.map +1 -0
  74. package/out/utils/click-outside/click-outside.js +85 -0
  75. package/out/utils/color/color.d.ts +13 -0
  76. package/out/utils/color/color.d.ts.map +1 -0
  77. package/out/utils/color/color.js +76 -0
  78. package/out/utils/download-file/download-file.d.ts +31 -0
  79. package/out/utils/download-file/download-file.d.ts.map +1 -0
  80. package/out/utils/download-file/download-file.js +107 -0
  81. package/out/utils/event/event.d.ts +34 -0
  82. package/out/utils/event/event.d.ts.map +1 -0
  83. package/out/utils/event/event.js +60 -0
  84. package/out/utils/index.d.ts +10 -1
  85. package/out/utils/index.d.ts.map +1 -1
  86. package/out/utils/index.js +10 -1
  87. package/out/utils/interceptor/core-interceptor.d.ts +15 -0
  88. package/out/utils/interceptor/core-interceptor.d.ts.map +1 -0
  89. package/out/utils/interceptor/core-interceptor.js +30 -0
  90. package/out/utils/interceptor/index.d.ts +3 -0
  91. package/out/utils/interceptor/index.d.ts.map +1 -0
  92. package/out/utils/interceptor/index.js +2 -0
  93. package/out/utils/interceptor/interceptor.d.ts +74 -3
  94. package/out/utils/interceptor/interceptor.d.ts.map +1 -1
  95. package/out/utils/interceptor/interceptor.js +73 -22
  96. package/out/utils/logger/logger.d.ts +3 -0
  97. package/out/utils/logger/logger.d.ts.map +1 -0
  98. package/out/utils/logger/logger.js +2 -0
  99. package/out/utils/net/http-response.d.ts +4 -9
  100. package/out/utils/net/http-response.d.ts.map +1 -1
  101. package/out/utils/net/http-response.js +0 -7
  102. package/out/utils/net/net.d.ts +82 -31
  103. package/out/utils/net/net.d.ts.map +1 -1
  104. package/out/utils/net/net.js +109 -40
  105. package/out/utils/sync/count-latch.d.ts +60 -0
  106. package/out/utils/sync/count-latch.d.ts.map +1 -0
  107. package/out/utils/sync/count-latch.js +93 -0
  108. package/out/utils/sync/index.d.ts +2 -0
  109. package/out/utils/sync/index.d.ts.map +1 -0
  110. package/out/utils/sync/index.js +1 -0
  111. package/out/utils/upload/select-file.d.ts +53 -0
  112. package/out/utils/upload/select-file.d.ts.map +1 -0
  113. package/out/utils/upload/select-file.js +47 -0
  114. package/out/utils/upload/upload-file.d.ts +46 -0
  115. package/out/utils/upload/upload-file.d.ts.map +1 -0
  116. package/out/utils/upload/upload-file.js +150 -0
  117. package/out/utils/url-helper/url-helper.d.ts +51 -0
  118. package/out/utils/url-helper/url-helper.d.ts.map +1 -0
  119. package/out/utils/url-helper/url-helper.js +59 -0
  120. package/out/utils/util/util.d.ts +20 -4
  121. package/out/utils/util/util.d.ts.map +1 -1
  122. package/out/utils/util/util.js +59 -5
  123. package/package.json +19 -9
  124. package/src/command/command-register.ts +135 -0
  125. package/src/command/command.ts +79 -0
  126. package/src/command/index.ts +11 -0
  127. package/src/command/interface/command/command-option.ts +22 -0
  128. package/src/command/interface/command/command.ts +86 -0
  129. package/src/command/interface/disposable/disposable.ts +3 -0
  130. package/src/command/interface/index.ts +9 -0
  131. package/src/command/utils/index.ts +2 -0
  132. package/src/command/utils/linked-list.ts +136 -0
  133. package/src/command/utils/util.ts +95 -0
  134. package/src/constant/index.ts +3 -0
  135. package/src/constant/login-mode/login-mode.ts +23 -0
  136. package/src/constant/menu-permission-mode/menu-permission-mode.ts +23 -0
  137. package/src/constant/util/util.ts +5 -0
  138. package/src/context/index.ts +69 -59
  139. package/src/environment/environment.ts +11 -2
  140. package/src/error/http-error/http-error.ts +0 -4
  141. package/src/factory-center.ts +9 -0
  142. package/src/ibizsys.ts +19 -1
  143. package/src/index.ts +3 -1
  144. package/src/install.ts +4 -2
  145. package/src/interface/click-outside/click-outside.ts +71 -0
  146. package/src/interface/i-environment/i-environment.ts +81 -4
  147. package/src/interface/index.ts +1 -0
  148. package/src/types.ts +10 -0
  149. package/src/utils/click-outside/click-outside.ts +110 -0
  150. package/src/utils/color/color.ts +84 -0
  151. package/src/utils/download-file/download-file.ts +109 -0
  152. package/src/utils/event/event.ts +77 -0
  153. package/src/utils/index.ts +10 -1
  154. package/src/utils/interceptor/core-interceptor.ts +35 -0
  155. package/src/utils/interceptor/index.ts +2 -0
  156. package/src/utils/interceptor/interceptor.ts +109 -22
  157. package/src/utils/logger/logger.ts +3 -0
  158. package/src/utils/net/http-response.ts +6 -9
  159. package/src/utils/net/net.ts +144 -51
  160. package/src/utils/sync/count-latch.ts +99 -0
  161. package/src/utils/sync/index.ts +1 -0
  162. package/src/utils/upload/select-file.ts +86 -0
  163. package/src/utils/upload/upload-file.ts +206 -0
  164. package/src/utils/url-helper/url-helper.ts +62 -0
  165. package/src/utils/util/util.ts +72 -14
@@ -0,0 +1,120 @@
1
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
+ /* eslint-disable no-underscore-dangle */
3
+ /* eslint-disable max-classes-per-file */
4
+ class Node {
5
+ constructor(element) {
6
+ this.element = element;
7
+ this.next = Node.Undefined;
8
+ this.prev = Node.Undefined;
9
+ }
10
+ }
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ Node.Undefined = new Node(undefined);
13
+ export class LinkedList {
14
+ constructor() {
15
+ this._first = Node.Undefined;
16
+ this._last = Node.Undefined;
17
+ this._size = 0;
18
+ }
19
+ get size() {
20
+ return this._size;
21
+ }
22
+ isEmpty() {
23
+ return this._first === Node.Undefined;
24
+ }
25
+ clear() {
26
+ let node = this._first;
27
+ while (node !== Node.Undefined) {
28
+ const { next } = node;
29
+ node.prev = Node.Undefined;
30
+ node.next = Node.Undefined;
31
+ node = next;
32
+ }
33
+ this._first = Node.Undefined;
34
+ this._last = Node.Undefined;
35
+ this._size = 0;
36
+ }
37
+ unshift(element) {
38
+ return this._insert(element, false);
39
+ }
40
+ push(element) {
41
+ return this._insert(element, true);
42
+ }
43
+ _insert(element, atTheEnd) {
44
+ const newNode = new Node(element);
45
+ if (this._first === Node.Undefined) {
46
+ this._first = newNode;
47
+ this._last = newNode;
48
+ }
49
+ else if (atTheEnd) {
50
+ // push
51
+ const oldLast = this._last;
52
+ this._last = newNode;
53
+ newNode.prev = oldLast;
54
+ oldLast.next = newNode;
55
+ }
56
+ else {
57
+ // unshift
58
+ const oldFirst = this._first;
59
+ this._first = newNode;
60
+ newNode.next = oldFirst;
61
+ oldFirst.prev = newNode;
62
+ }
63
+ this._size += 1;
64
+ let didRemove = false;
65
+ return () => {
66
+ if (!didRemove) {
67
+ didRemove = true;
68
+ this._remove(newNode);
69
+ }
70
+ };
71
+ }
72
+ shift() {
73
+ if (this._first === Node.Undefined) {
74
+ return undefined;
75
+ }
76
+ const res = this._first.element;
77
+ this._remove(this._first);
78
+ return res;
79
+ }
80
+ pop() {
81
+ if (this._last === Node.Undefined) {
82
+ return undefined;
83
+ }
84
+ const res = this._last.element;
85
+ this._remove(this._last);
86
+ return res;
87
+ }
88
+ _remove(node) {
89
+ if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
90
+ // middle
91
+ const anchor = node.prev;
92
+ anchor.next = node.next;
93
+ node.next.prev = anchor;
94
+ }
95
+ else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
96
+ // only node
97
+ this._first = Node.Undefined;
98
+ this._last = Node.Undefined;
99
+ }
100
+ else if (node.next === Node.Undefined) {
101
+ // last
102
+ this._last = this._last.prev;
103
+ this._last.next = Node.Undefined;
104
+ }
105
+ else if (node.prev === Node.Undefined) {
106
+ // first
107
+ this._first = this._first.next;
108
+ this._first.prev = Node.Undefined;
109
+ }
110
+ // done
111
+ this._size -= 1;
112
+ }
113
+ *[Symbol.iterator]() {
114
+ let node = this._first;
115
+ while (node !== Node.Undefined) {
116
+ yield node.element;
117
+ node = node.next;
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,27 @@
1
+ import { IDisposable } from '../interface';
2
+ export declare function once<T extends Function>(this: unknown, fn: T): T;
3
+ export declare function toDisposable(fn: () => void): IDisposable;
4
+ /**
5
+ * 函数防抖---“立即执行版本” 和 “非立即执行版本” 的组合版本
6
+ *
7
+ * @author chitanda
8
+ * @date 2022-06-29 19:06:15
9
+ * @export
10
+ * @param {((...args: unknown[]) => void | Promise<void>)} func 处理函数
11
+ * @param {number} wait 延迟执行时间(毫秒)
12
+ * @param {boolean} [immediate] 是否立即执行
13
+ * @return {*} {(...args: unknown[]) => void}
14
+ */
15
+ export declare function debounce(func: (...args: unknown[]) => void | Promise<void>, wait: number, immediate?: boolean): (...args: unknown[]) => void;
16
+ /**
17
+ * 节流函数
18
+ *
19
+ * @author chitanda
20
+ * @date 2022-06-29 20:06:38
21
+ * @export
22
+ * @param {((...args: unknown[]) => void | Promise<void>)} fn
23
+ * @param {number} wait
24
+ * @return {*} {(...args: unknown[]) => void}
25
+ */
26
+ export declare function throttle(fn: (...args: unknown[]) => void | Promise<void>, wait: number): (...args: unknown[]) => void;
27
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/command/utils/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,wBAAgB,IAAI,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAgBhE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAOxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAClD,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAqB9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAChD,IAAI,EAAE,MAAM,GACX,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAU9B"}
@@ -0,0 +1,77 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-types
2
+ export function once(fn) {
3
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4
+ const _this = this;
5
+ let didCall = false;
6
+ let result;
7
+ return function () {
8
+ if (didCall) {
9
+ return result;
10
+ }
11
+ didCall = true;
12
+ result = fn.apply(_this, arguments);
13
+ return result;
14
+ };
15
+ }
16
+ export function toDisposable(fn) {
17
+ const self = {
18
+ dispose: once(() => {
19
+ fn();
20
+ }),
21
+ };
22
+ return self;
23
+ }
24
+ /**
25
+ * 函数防抖---“立即执行版本” 和 “非立即执行版本” 的组合版本
26
+ *
27
+ * @author chitanda
28
+ * @date 2022-06-29 19:06:15
29
+ * @export
30
+ * @param {((...args: unknown[]) => void | Promise<void>)} func 处理函数
31
+ * @param {number} wait 延迟执行时间(毫秒)
32
+ * @param {boolean} [immediate] 是否立即执行
33
+ * @return {*} {(...args: unknown[]) => void}
34
+ */
35
+ export function debounce(func, wait, immediate) {
36
+ let timer;
37
+ return function (...args) {
38
+ if (timer) {
39
+ clearTimeout(timer);
40
+ }
41
+ if (immediate) {
42
+ const callNow = !timer;
43
+ timer = setTimeout(() => {
44
+ timer = null;
45
+ }, wait);
46
+ if (callNow) {
47
+ func.apply(this, args);
48
+ }
49
+ }
50
+ else {
51
+ timer = setTimeout(() => {
52
+ func.apply(this, args);
53
+ }, wait);
54
+ }
55
+ };
56
+ }
57
+ /**
58
+ * 节流函数
59
+ *
60
+ * @author chitanda
61
+ * @date 2022-06-29 20:06:38
62
+ * @export
63
+ * @param {((...args: unknown[]) => void | Promise<void>)} fn
64
+ * @param {number} wait
65
+ * @return {*} {(...args: unknown[]) => void}
66
+ */
67
+ export function throttle(fn, wait) {
68
+ let timer = null;
69
+ return function (...args) {
70
+ if (!timer) {
71
+ timer = setTimeout(() => {
72
+ fn.apply(this, args);
73
+ timer = null;
74
+ }, wait);
75
+ }
76
+ };
77
+ }
@@ -1,3 +1,6 @@
1
1
  export { CoreConst } from './core/core';
2
+ export * from './util/util';
2
3
  export { HttpStatusMessageConst } from './http-status-message/http-status-message';
4
+ export { LoginMode } from './login-mode/login-mode';
5
+ export { MenuPermissionMode } from './menu-permission-mode/menu-permission-mode';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC"}
@@ -1,2 +1,5 @@
1
1
  export { CoreConst } from './core/core';
2
+ export * from './util/util';
2
3
  export { HttpStatusMessageConst } from './http-status-message/http-status-message';
4
+ export { LoginMode } from './login-mode/login-mode';
5
+ export { MenuPermissionMode } from './menu-permission-mode/menu-permission-mode';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 登录模式
3
+ *
4
+ * @author lxm
5
+ * @date 2022-10-12 14:10:56
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum LoginMode {
10
+ /**
11
+ * 默认标准登录
12
+ */
13
+ DEFAULT = "DEFAULT",
14
+ /**
15
+ * 自定义登录
16
+ */
17
+ CUSTOM = "CUSTOM",
18
+ /**
19
+ * 中央认证登录
20
+ */
21
+ CAS = "CAS"
22
+ }
23
+ //# sourceMappingURL=login-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-mode.d.ts","sourceRoot":"","sources":["../../../src/constant/login-mode/login-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,SAAS;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,GAAG,QAAQ;CACZ"}
@@ -0,0 +1,24 @@
1
+ /* eslint-disable no-shadow */
2
+ /**
3
+ * 登录模式
4
+ *
5
+ * @author lxm
6
+ * @date 2022-10-12 14:10:56
7
+ * @export
8
+ * @enum {number}
9
+ */
10
+ export var LoginMode;
11
+ (function (LoginMode) {
12
+ /**
13
+ * 默认标准登录
14
+ */
15
+ LoginMode["DEFAULT"] = "DEFAULT";
16
+ /**
17
+ * 自定义登录
18
+ */
19
+ LoginMode["CUSTOM"] = "CUSTOM";
20
+ /**
21
+ * 中央认证登录
22
+ */
23
+ LoginMode["CAS"] = "CAS";
24
+ })(LoginMode || (LoginMode = {}));
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 菜单权限校验模式
3
+ *
4
+ * @author lxm
5
+ * @date 2022-10-12 14:10:56
6
+ * @export
7
+ * @enum {number}
8
+ */
9
+ export declare enum MenuPermissionMode {
10
+ /**
11
+ * 混合模式(默认)
12
+ */
13
+ MIXIN = "MIXIN",
14
+ /**
15
+ * 统一资源模式
16
+ */
17
+ RESOURCE = "RESOURCE",
18
+ /**
19
+ * RT模式
20
+ */
21
+ RT = "RT"
22
+ }
23
+ //# sourceMappingURL=menu-permission-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-permission-mode.d.ts","sourceRoot":"","sources":["../../../src/constant/menu-permission-mode/menu-permission-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,EAAE,OAAO;CACV"}
@@ -0,0 +1,24 @@
1
+ /* eslint-disable no-shadow */
2
+ /**
3
+ * 菜单权限校验模式
4
+ *
5
+ * @author lxm
6
+ * @date 2022-10-12 14:10:56
7
+ * @export
8
+ * @enum {number}
9
+ */
10
+ export var MenuPermissionMode;
11
+ (function (MenuPermissionMode) {
12
+ /**
13
+ * 混合模式(默认)
14
+ */
15
+ MenuPermissionMode["MIXIN"] = "MIXIN";
16
+ /**
17
+ * 统一资源模式
18
+ */
19
+ MenuPermissionMode["RESOURCE"] = "RESOURCE";
20
+ /**
21
+ * RT模式
22
+ */
23
+ MenuPermissionMode["RT"] = "RT";
24
+ })(MenuPermissionMode || (MenuPermissionMode = {}));
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 无操作函数
3
+ */
4
+ export declare const NOOP: () => void;
5
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/constant/util/util.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,IAAI,YAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ /**
3
+ * 无操作函数
4
+ */
5
+ export const NOOP = () => { };
@@ -1,15 +1,3 @@
1
- /**
2
- * 上下文代理处理
3
- *
4
- * @author chitanda
5
- * @date 2022-07-14 10:07:45
6
- * @class IBizContextProxyHandle
7
- * @implements {ProxyHandler<IBizContext>}
8
- */
9
- export declare class IBizContextProxyHandle implements ProxyHandler<IBizContext> {
10
- set(target: IBizContext, p: string | symbol, value: unknown): boolean;
11
- get(target: IBizContext, p: string | symbol, _receiver: unknown): unknown;
12
- }
13
1
  /**
14
2
  * 上下文处理类
15
3
  *
@@ -19,17 +7,24 @@ export declare class IBizContextProxyHandle implements ProxyHandler<IBizContext>
19
7
  * @class IBizContext
20
8
  */
21
9
  export declare class IBizContext implements IContext {
22
- context: IContext;
23
10
  [key: string | symbol]: any;
24
11
  /**
25
- * 父上下文
12
+ * 修改的父上下文
26
13
  *
27
- * @author chitanda
28
- * @date 2022-07-14 10:07:06
14
+ * @author lxm
15
+ * @date 2022-12-08 18:12:16
29
16
  * @protected
30
- * @type {(IBizContext | null)}
17
+ * @type {IContext}
31
18
  */
32
- protected _parent: IContext | null;
19
+ protected _context: IContext;
20
+ /**
21
+ * 父的上下文源对象
22
+ *
23
+ * @author lxm
24
+ * @date 2022-12-08 18:12:31
25
+ * @type {IBizContext}
26
+ */
27
+ _parent?: IBizContext;
33
28
  /**
34
29
  * Creates an instance of IBizContext.
35
30
  *
@@ -38,22 +33,14 @@ export declare class IBizContext implements IContext {
38
33
  * @param {IContext} [context={}] 自身的上下文
39
34
  * @param {IBizContext} [parent]
40
35
  */
41
- constructor(context?: IContext, parent?: IContext);
36
+ constructor(context?: IContext, parent?: IBizContext);
42
37
  /**
43
- * 创建代理
38
+ * 返回自身的上下文,独有的和与父有差异的。
44
39
  *
45
- * @author chitanda
46
- * @date 2022-07-14 11:07:37
47
- * @protected
48
- * @return {*} {IBizContext}
49
- */
50
- protected createProxy(): IBizContext;
51
- /**
52
- * 销毁上下文,避免内存泄漏
53
- *
54
- * @author chitanda
55
- * @date 2022-07-14 11:07:45
40
+ * @author lxm
41
+ * @date 2022-12-08 17:12:26
42
+ * @returns {*} {IContext}
56
43
  */
57
- destroy(): void;
44
+ getOwnContext(): IContext;
58
45
  }
59
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,YAAY,CAAC,WAAW,CAAC;IACtE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO;IAKrE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;CAa1E;AAED;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAsBvB,OAAO,EAAE,QAAQ;IApBpC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE1C;;;;;;;OAOG;gBACgB,OAAO,GAAE,QAAa,EAAE,MAAM,CAAC,EAAE,QAAQ;IAO5D;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,IAAI,WAAW;IAIpC;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAIhB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAE1C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE9B;;;;;;OAMG;IACK,OAAO,CAAC,EAAE,WAAW,CAAC;IAE9B;;;;;;;OAOG;gBAES,OAAO,GAAE,QAAa,EAAE,MAAM,CAAC,EAAE,WAAW;IA0CxD;;;;;;OAMG;IACH,aAAa,IAAI,QAAQ;CAa1B"}
@@ -1,34 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
- /* eslint-disable no-constructor-return */
3
- /* eslint-disable no-underscore-dangle */
4
- /* eslint-disable max-classes-per-file */
5
- /**
6
- * 上下文代理处理
7
- *
8
- * @author chitanda
9
- * @date 2022-07-14 10:07:45
10
- * @class IBizContextProxyHandle
11
- * @implements {ProxyHandler<IBizContext>}
12
- */
13
- export class IBizContextProxyHandle {
14
- set(target, p, value) {
15
- target.context[p] = value;
16
- return true;
17
- }
18
- get(target, p, _receiver) {
19
- if (target[p] !== undefined) {
20
- return target[p];
21
- }
22
- if (target.context[p] !== undefined) {
23
- return target.context[p];
24
- }
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- if (target._parent && target._parent[p] !== undefined) {
27
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
- return target._parent[p];
29
- }
30
- }
31
- }
32
1
  /**
33
2
  * 上下文处理类
34
3
  *
@@ -46,41 +15,64 @@ export class IBizContext {
46
15
  * @param {IContext} [context={}] 自身的上下文
47
16
  * @param {IBizContext} [parent]
48
17
  */
18
+ // eslint-disable-next-line default-param-last
49
19
  constructor(context = {}, parent) {
50
- this.context = context;
51
- /**
52
- * 父上下文
53
- *
54
- * @author chitanda
55
- * @date 2022-07-14 10:07:06
56
- * @protected
57
- * @type {(IBizContext | null)}
58
- */
59
- this._parent = null;
60
20
  if (parent) {
61
- this._parent = parent;
21
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
22
+ const self = this;
23
+ // 定义私有变量,存放父上下文源对象
24
+ Object.defineProperty(this, '_parent', {
25
+ enumerable: false,
26
+ value: parent,
27
+ });
28
+ // 定义私有变量,用于存储对父已有上下文的修改。
29
+ Object.defineProperty(this, '_context', {
30
+ enumerable: false,
31
+ value: {},
32
+ });
33
+ // 监控父上下文参数,自身不存在时从父取
34
+ const properties = {};
35
+ const keys = Object.keys(parent);
36
+ keys.forEach(key => {
37
+ properties[key] = {
38
+ enumerable: true,
39
+ set(val) {
40
+ if (val == null) {
41
+ self._context[key] = null;
42
+ }
43
+ else {
44
+ self._context[key] = val;
45
+ }
46
+ },
47
+ get() {
48
+ if (self._context[key] !== undefined) {
49
+ return self._context[key];
50
+ }
51
+ return parent[key];
52
+ },
53
+ };
54
+ });
55
+ Object.defineProperties(this, properties);
62
56
  }
63
- return this.createProxy();
64
- }
65
- /**
66
- * 创建代理
67
- *
68
- * @author chitanda
69
- * @date 2022-07-14 11:07:37
70
- * @protected
71
- * @return {*} {IBizContext}
72
- */
73
- createProxy() {
74
- return new Proxy(this, new IBizContextProxyHandle());
57
+ // 合并给入上下文
58
+ Object.assign(this, context);
75
59
  }
76
60
  /**
77
- * 销毁上下文,避免内存泄漏
61
+ * 返回自身的上下文,独有的和与父有差异的。
78
62
  *
79
- * @author chitanda
80
- * @date 2022-07-14 11:07:45
63
+ * @author lxm
64
+ * @date 2022-12-08 17:12:26
65
+ * @returns {*} {IContext}
81
66
  */
82
- destroy() {
83
- this.context = {};
84
- this._parent = null;
67
+ getOwnContext() {
68
+ const result = {};
69
+ Object.keys(this).forEach(key => {
70
+ // 父没有的,或者修改了父的上下文
71
+ if (!Object.prototype.hasOwnProperty.call(this._parent, key) ||
72
+ Object.prototype.hasOwnProperty.call(this._context, key)) {
73
+ result[key] = this[key];
74
+ }
75
+ });
76
+ return result;
85
77
  }
86
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC"}
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAezB,CAAC"}
@@ -1,11 +1,20 @@
1
+ import { LoginMode, MenuPermissionMode } from '../constant';
1
2
  /**
2
3
  * 环境变量
3
4
  */
4
5
  export const Environment = {
6
+ dev: false,
7
+ logLevel: 'ERROR',
8
+ jsCdn: 'https://cdn.jsdelivr.net',
5
9
  baseUrl: '',
10
+ pluginBaseUrl: './plugins',
6
11
  remoteModelUrl: '/remotemodel',
7
12
  assetsUrl: './assets',
8
13
  dcSystem: '',
9
- ExportFile: '/ibizutil/download',
10
- UploadFile: '/ibizutil/upload',
14
+ downloadFileUrl: '/ibizutil/download',
15
+ uploadFileUrl: '/ibizutil/upload',
16
+ casLoginUrl: '',
17
+ loginMode: LoginMode.DEFAULT,
18
+ menuPermissionMode: MenuPermissionMode.MIXIN,
19
+ enablePermission: true,
11
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlD;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,KAAK;IACrC,IAAI,EAAE,MAAM,CAAe;IAE3B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAEb,GAAG,EAAE,UAAU;CAqB5B"}
1
+ {"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,KAAK;IACrC,IAAI,EAAE,MAAM,CAAe;IAE3B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAEb,GAAG,EAAE,UAAU;CAkB5B"}
@@ -1,4 +1,3 @@
1
- import { HttpStatusMessageConst } from '../../constant';
2
1
  /**
3
2
  * 请求异常
4
3
  *
@@ -20,9 +19,6 @@ export class HttpError {
20
19
  else {
21
20
  this.message = res.statusText;
22
21
  }
23
- if (!this.message) {
24
- this.message = HttpStatusMessageConst[res.status];
25
- }
26
22
  if (!this.message) {
27
23
  this.message = '网络异常,请稍后重试!';
28
24
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 工厂类挂载中心,挂载各种解耦用创建工厂
3
+ *
4
+ * @author lxm
5
+ * @date 2022-10-17 15:10:04
6
+ * @export
7
+ * @class FactoryCenter
8
+ */
9
+ export declare class FactoryCenter {
10
+ }
11
+ //# sourceMappingURL=factory-center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-center.d.ts","sourceRoot":"","sources":["../src/factory-center.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,aAAa;CAAG"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 工厂类挂载中心,挂载各种解耦用创建工厂
3
+ *
4
+ * @author lxm
5
+ * @date 2022-10-17 15:10:04
6
+ * @export
7
+ * @class FactoryCenter
8
+ */
9
+ export class FactoryCenter {
10
+ }