render-core 1.3.38 → 1.3.39

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 (118) hide show
  1. package/class/component/component.d.ts +41 -41
  2. package/class/component/component.js +108 -108
  3. package/class/controller/appController.d.ts +44 -44
  4. package/class/controller/appController.js +132 -132
  5. package/class/controller/componentController.d.ts +15 -15
  6. package/class/controller/componentController.js +22 -22
  7. package/class/controller/contextController.d.ts +18 -18
  8. package/class/controller/contextController.js +79 -79
  9. package/class/controller/pageController.d.ts +23 -23
  10. package/class/controller/pageController.js +40 -40
  11. package/class/tips/appTip.d.ts +2 -2
  12. package/class/tips/appTip.js +1 -1
  13. package/class/tips/componentTip.d.ts +13 -13
  14. package/class/tips/componentTip.js +1 -1
  15. package/class/tips/renderTip.d.ts +5 -5
  16. package/class/tips/renderTip.js +1 -1
  17. package/core/cmd/data/v-el.d.ts +8 -8
  18. package/core/cmd/data/v-el.js +28 -28
  19. package/core/cmd/data/v-html.d.ts +8 -8
  20. package/core/cmd/data/v-html.js +26 -26
  21. package/core/cmd/data/v-txt.d.ts +8 -8
  22. package/core/cmd/data/v-txt.js +29 -29
  23. package/core/cmd/justify/v-if.d.ts +6 -6
  24. package/core/cmd/justify/v-if.js +43 -43
  25. package/core/cmd/justify/v-render.d.ts +6 -6
  26. package/core/cmd/justify/v-render.js +26 -26
  27. package/core/cmd/justify/v-show.d.ts +6 -6
  28. package/core/cmd/justify/v-show.js +26 -26
  29. package/core/cmd/justify/v-switch.d.ts +6 -6
  30. package/core/cmd/justify/v-switch.js +35 -35
  31. package/core/cmd/loop/v-for.d.ts +12 -12
  32. package/core/cmd/loop/v-for.js +63 -63
  33. package/core/cmd/loop/v-index.d.ts +14 -14
  34. package/core/cmd/loop/v-index.js +80 -79
  35. package/core/cmd/loop/v-key.d.ts +12 -12
  36. package/core/cmd/loop/v-key.js +70 -70
  37. package/core/cmd/method/v-on.d.ts +8 -8
  38. package/core/cmd/method/v-on.js +40 -40
  39. package/core/cmd/property/v-bind.d.ts +6 -6
  40. package/core/cmd/property/v-bind.js +33 -33
  41. package/core/cmd/react/v-model.d.ts +6 -6
  42. package/core/cmd/react/v-model.js +22 -22
  43. package/core/cmd/ref/v-ref.d.ts +6 -6
  44. package/core/cmd/ref/v-ref.js +16 -16
  45. package/core/cmd/solt/v-solt.d.ts +14 -14
  46. package/core/cmd/solt/v-solt.js +46 -46
  47. package/core/inject/inject.d.ts +30 -35
  48. package/core/inject/inject.js +63 -70
  49. package/core/lifecycle/afterMethods.d.ts +16 -16
  50. package/core/lifecycle/afterMethods.js +22 -22
  51. package/core/lifecycle/controllerCycle.d.ts +13 -13
  52. package/core/lifecycle/controllerCycle.js +42 -42
  53. package/core/lifecycle/mount.d.ts +16 -17
  54. package/core/lifecycle/mount.js +31 -34
  55. package/core/loader/loader.d.ts +7 -7
  56. package/core/loader/loader.js +18 -18
  57. package/core/proxy/getProxy.d.ts +13 -13
  58. package/core/proxy/getProxy.js +42 -42
  59. package/core/render/PostRender.d.ts +12 -12
  60. package/core/render/PostRender.js +42 -45
  61. package/core/render/delivery.d.ts +5 -5
  62. package/core/render/delivery.js +42 -42
  63. package/core/render/initRender.d.ts +12 -12
  64. package/core/render/initRender.js +39 -41
  65. package/core/render/partRender.d.ts +15 -15
  66. package/core/render/partRender.js +31 -31
  67. package/core/render/rawRender.d.ts +12 -12
  68. package/core/render/rawRender.js +43 -45
  69. package/core/render/updateRender.d.ts +6 -6
  70. package/core/render/updateRender.js +29 -32
  71. package/core/resolver/props.d.ts +18 -18
  72. package/core/resolver/props.js +60 -60
  73. package/core/resolver/query.d.ts +4 -4
  74. package/core/resolver/query.js +15 -15
  75. package/core/utility/checkUtility.d.ts +1 -1
  76. package/core/utility/checkUtility.js +4 -4
  77. package/core/utility/cmdUtility.d.ts +16 -16
  78. package/core/utility/cmdUtility.js +57 -57
  79. package/core/utility/dataUtility.d.ts +1 -1
  80. package/core/utility/dataUtility.js +8 -8
  81. package/core/utility/errorUtility.d.ts +3 -3
  82. package/core/utility/errorUtility.js +9 -9
  83. package/core/utility/injectUtility.d.ts +13 -13
  84. package/core/utility/injectUtility.js +58 -58
  85. package/core/utility/inputType.d.ts +5 -5
  86. package/core/utility/inputType.js +20 -20
  87. package/core/utility/inputUtility.d.ts +4 -4
  88. package/core/utility/inputUtility.js +100 -100
  89. package/core/utility/miscUtility.d.ts +6 -6
  90. package/core/utility/miscUtility.js +12 -12
  91. package/core/utility/modelUtility.d.ts +15 -15
  92. package/core/utility/modelUtility.js +66 -66
  93. package/core/utility/sectionUtility.d.ts +6 -6
  94. package/core/utility/sectionUtility.js +104 -104
  95. package/core/utility/styleUtility.d.ts +29 -29
  96. package/core/utility/styleUtility.js +114 -114
  97. package/core/utility/templateUtility.d.ts +6 -6
  98. package/core/utility/templateUtility.js +13 -13
  99. package/core/utility/vForUtility.d.ts +15 -15
  100. package/core/utility/vForUtility.js +20 -20
  101. package/func/Theme.d.ts +16 -16
  102. package/func/Theme.js +27 -27
  103. package/http/redirect/redirect.d.ts +11 -11
  104. package/http/redirect/redirect.js +36 -36
  105. package/index.d.ts +71 -71
  106. package/index.js +130 -130
  107. package/package.json +3 -8
  108. package/runtime/metaTagLib.d.ts +2 -2
  109. package/runtime/metaTagLib.js +27 -27
  110. package/runtime/runtime.d.ts +7 -7
  111. package/runtime/runtime.js +26 -26
  112. package/runtime/tools.d.ts +14 -14
  113. package/runtime/tools.js +49 -49
  114. package/status/read/read.d.ts +10 -10
  115. package/status/read/read.js +26 -26
  116. package/status/write/write.d.ts +12 -12
  117. package/status/write/write.js +92 -92
  118. package/README.md +0 -2
@@ -1,29 +1,29 @@
1
- import { Component } from "../../class/component/component";
2
- /**
3
- *
4
- * @param tag
5
- */
6
- export declare function checkStyleLabel(tag: string): boolean;
7
- /**
8
- *
9
- * @param component
10
- * @param styleLib
11
- */
12
- export declare function themeStyle(component: Component, styleLib: Map<string, object>): void;
13
- /**
14
- *
15
- * @param tag
16
- */
17
- export declare function styleResolve(tag: string): void;
18
- /**
19
- *
20
- * @param theme
21
- */
22
- export declare function reloadStyle(theme: string): void;
23
- /**
24
- *
25
- * @param tag
26
- * @param theme
27
- */
28
- export declare function changeStyle(tag: string, theme: string): void;
29
- export declare function changeTheme(theme: string): void;
1
+ import { Component } from "../../class/component/component";
2
+ /**
3
+ *
4
+ * @param tag
5
+ */
6
+ export declare function checkStyleLabel(tag: string): boolean;
7
+ /**
8
+ *
9
+ * @param component
10
+ * @param styleLib
11
+ */
12
+ export declare function themeStyle(component: Component, styleLib: Map<string, object>): void;
13
+ /**
14
+ *
15
+ * @param tag
16
+ */
17
+ export declare function styleResolve(tag: string): void;
18
+ /**
19
+ *
20
+ * @param theme
21
+ */
22
+ export declare function reloadStyle(theme: string): void;
23
+ /**
24
+ *
25
+ * @param tag
26
+ * @param theme
27
+ */
28
+ export declare function changeStyle(tag: string, theme: string): void;
29
+ export declare function changeTheme(theme: string): void;
@@ -1,114 +1,114 @@
1
- import { loadStyle } from "../loader/loader";
2
- /**
3
- *
4
- * @param tag
5
- */
6
- export function checkStyleLabel(tag) {
7
- //获取所有的style标签
8
- var styles = document.getElementsByTagName("style");
9
- //遍历标签,查看是否已经加载tag样式
10
- for (var i = 0; i < styles.length; i++) {
11
- if (styles[i].getAttribute("tag") === tag.toUpperCase())
12
- //样式已经加载
13
- return true;
14
- }
15
- //样式未加载
16
- return false;
17
- }
18
- /**
19
- *
20
- * @param component
21
- * @param styleLib
22
- */
23
- export function themeStyle(component, styleLib) {
24
- var template = component.getTemplate();
25
- var dom = document.createElement("div");
26
- dom.innerHTML = template;
27
- var styles = dom.getElementsByTagName("template")[0].content.querySelectorAll("style");
28
- var kk = new Map();
29
- for (var i = 0; i < styles.length; i++) {
30
- kk.set(styles[i].getAttribute("theme"), styles[i].innerText);
31
- }
32
- styleLib.set(component.getName().toUpperCase(), kk);
33
- }
34
- /**
35
- *
36
- * @param tag
37
- */
38
- export function styleResolve(tag) {
39
- // @ts-ignore
40
- var theme = window.context.getField("system_theme");
41
- if (Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme) === undefined) {
42
- console.log("tag:" + tag + " has no theme " + theme);
43
- if (Reflect.get(window, "styleLib").get(tag.toUpperCase()).get("default") === undefined) {
44
- console.log("tag:" + tag + " has no theme " + "default");
45
- }
46
- else {
47
- loadStyle(tag, "default", Reflect.get(window, "styleLib").get(tag.toUpperCase()).get("default"));
48
- }
49
- }
50
- else {
51
- loadStyle(tag, theme, Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme));
52
- }
53
- }
54
- /**
55
- *
56
- * @param theme
57
- */
58
- export function reloadStyle(theme) {
59
- Reflect.get(window, "styleLib").forEach(function (value, key) {
60
- var styles = document.getElementsByTagName("style");
61
- for (var i = 0; i < styles.length; i++) {
62
- if (styles[i].getAttribute("tag") === key) {
63
- var style = document.createElement('style');
64
- if (value.get(theme)) {
65
- var text = document.createTextNode(value.get(theme));
66
- style.appendChild(text);
67
- style.setAttribute("tag", key.toUpperCase());
68
- style.setAttribute("theme", theme);
69
- var head = document.getElementsByTagName('head')[0];
70
- head.replaceChild(style, styles[i]);
71
- }
72
- }
73
- }
74
- });
75
- }
76
- /**
77
- *
78
- * @param tag
79
- * @param theme
80
- */
81
- export function changeStyle(tag, theme) {
82
- var styleTxt = Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme);
83
- if (styleTxt === undefined) {
84
- console.log("Dont`t find this style!");
85
- }
86
- else {
87
- var style = document.createElement('style');
88
- var text = document.createTextNode(styleTxt);
89
- style.appendChild(text);
90
- style.setAttribute("tag", tag.toUpperCase());
91
- style.setAttribute("theme", theme);
92
- var head = document.getElementsByTagName('head')[0];
93
- var target = head.querySelector("style" + "[tag=" + tag.toUpperCase() + "]");
94
- head.replaceChild(style, target);
95
- }
96
- }
97
- export function changeTheme(theme) {
98
- Reflect.get(window, "styleLib").forEach(function (value, key) {
99
- var styles = document.getElementsByTagName("style");
100
- for (var i = 0; i < styles.length; i++) {
101
- if (styles[i].getAttribute("tag") === key) {
102
- var style = document.createElement('style');
103
- if (value.get(theme)) {
104
- var text = document.createTextNode(value.get(theme));
105
- style.appendChild(text);
106
- style.setAttribute("tag", key.toUpperCase());
107
- style.setAttribute("theme", theme);
108
- var head = document.getElementsByTagName('head')[0];
109
- head.replaceChild(style, styles[i]);
110
- }
111
- }
112
- }
113
- });
114
- }
1
+ import { loadStyle } from "../loader/loader";
2
+ /**
3
+ *
4
+ * @param tag
5
+ */
6
+ export function checkStyleLabel(tag) {
7
+ //获取所有的style标签
8
+ var styles = document.getElementsByTagName("style");
9
+ //遍历标签,查看是否已经加载tag样式
10
+ for (var i = 0; i < styles.length; i++) {
11
+ if (styles[i].getAttribute("tag") === tag.toUpperCase())
12
+ //样式已经加载
13
+ return true;
14
+ }
15
+ //样式未加载
16
+ return false;
17
+ }
18
+ /**
19
+ *
20
+ * @param component
21
+ * @param styleLib
22
+ */
23
+ export function themeStyle(component, styleLib) {
24
+ var template = component.getTemplate();
25
+ var dom = document.createElement("div");
26
+ dom.innerHTML = template;
27
+ var styles = dom.getElementsByTagName("template")[0].content.querySelectorAll("style");
28
+ var kk = new Map();
29
+ for (var i = 0; i < styles.length; i++) {
30
+ kk.set(styles[i].getAttribute("theme"), styles[i].innerText);
31
+ }
32
+ styleLib.set(component.getName().toUpperCase(), kk);
33
+ }
34
+ /**
35
+ *
36
+ * @param tag
37
+ */
38
+ export function styleResolve(tag) {
39
+ // @ts-ignore
40
+ var theme = window.context.getField("system_theme");
41
+ if (Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme) === undefined) {
42
+ console.log("tag:" + tag + " has no theme " + theme);
43
+ if (Reflect.get(window, "styleLib").get(tag.toUpperCase()).get("default") === undefined) {
44
+ console.log("tag:" + tag + " has no theme " + "default");
45
+ }
46
+ else {
47
+ loadStyle(tag, "default", Reflect.get(window, "styleLib").get(tag.toUpperCase()).get("default"));
48
+ }
49
+ }
50
+ else {
51
+ loadStyle(tag, theme, Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme));
52
+ }
53
+ }
54
+ /**
55
+ *
56
+ * @param theme
57
+ */
58
+ export function reloadStyle(theme) {
59
+ Reflect.get(window, "styleLib").forEach(function (value, key) {
60
+ var styles = document.getElementsByTagName("style");
61
+ for (var i = 0; i < styles.length; i++) {
62
+ if (styles[i].getAttribute("tag") === key) {
63
+ var style = document.createElement('style');
64
+ if (value.get(theme)) {
65
+ var text = document.createTextNode(value.get(theme));
66
+ style.appendChild(text);
67
+ style.setAttribute("tag", key.toUpperCase());
68
+ style.setAttribute("theme", theme);
69
+ var head = document.getElementsByTagName('head')[0];
70
+ head.replaceChild(style, styles[i]);
71
+ }
72
+ }
73
+ }
74
+ });
75
+ }
76
+ /**
77
+ *
78
+ * @param tag
79
+ * @param theme
80
+ */
81
+ export function changeStyle(tag, theme) {
82
+ var styleTxt = Reflect.get(window, "styleLib").get(tag.toUpperCase()).get(theme);
83
+ if (styleTxt === undefined) {
84
+ console.log("Dont`t find this style!");
85
+ }
86
+ else {
87
+ var style = document.createElement('style');
88
+ var text = document.createTextNode(styleTxt);
89
+ style.appendChild(text);
90
+ style.setAttribute("tag", tag.toUpperCase());
91
+ style.setAttribute("theme", theme);
92
+ var head = document.getElementsByTagName('head')[0];
93
+ var target = head.querySelector("style" + "[tag=" + tag.toUpperCase() + "]");
94
+ head.replaceChild(style, target);
95
+ }
96
+ }
97
+ export function changeTheme(theme) {
98
+ Reflect.get(window, "styleLib").forEach(function (value, key) {
99
+ var styles = document.getElementsByTagName("style");
100
+ for (var i = 0; i < styles.length; i++) {
101
+ if (styles[i].getAttribute("tag") === key) {
102
+ var style = document.createElement('style');
103
+ if (value.get(theme)) {
104
+ var text = document.createTextNode(value.get(theme));
105
+ style.appendChild(text);
106
+ style.setAttribute("tag", key.toUpperCase());
107
+ style.setAttribute("theme", theme);
108
+ var head = document.getElementsByTagName('head')[0];
109
+ head.replaceChild(style, styles[i]);
110
+ }
111
+ }
112
+ }
113
+ });
114
+ }
@@ -1,6 +1,6 @@
1
- import { Component } from "../../class/component/component";
2
- /**
3
- *
4
- * @param proto
5
- */
6
- export declare function getTemplate(proto: Component): Element;
1
+ import { Component } from "../../class/component/component";
2
+ /**
3
+ *
4
+ * @param proto
5
+ */
6
+ export declare function getTemplate(proto: Component): Element;
@@ -1,13 +1,13 @@
1
- /**
2
- *
3
- * @param proto
4
- */
5
- export function getTemplate(proto) {
6
- //生成DOM
7
- var temp = document.createElement("div");
8
- temp.innerHTML = proto.getTemplate();
9
- var template = temp.getElementsByTagName("template")[0];
10
- var content = template.content;
11
- //获得模板元素
12
- return content.querySelector("view");
13
- }
1
+ /**
2
+ *
3
+ * @param proto
4
+ */
5
+ export function getTemplate(proto) {
6
+ //生成DOM
7
+ var temp = document.createElement("div");
8
+ temp.innerHTML = proto.getTemplate();
9
+ var template = temp.getElementsByTagName("template")[0];
10
+ var content = template.content;
11
+ //获得模板元素
12
+ return content.querySelector("view");
13
+ }
@@ -1,15 +1,15 @@
1
- /**
2
- *
3
- * @param baseRoot
4
- * @param temp
5
- * @param index
6
- * @param data
7
- */
8
- export declare function extractForArray(baseRoot: ParentNode, temp: Node, index: number, data: any): void;
9
- /**
10
- *
11
- * @param baseRoot
12
- * @param temp
13
- * @param data
14
- */
15
- export declare function extractForMap(baseRoot: ParentNode, temp: Node, data: any): void;
1
+ /**
2
+ *
3
+ * @param baseRoot
4
+ * @param temp
5
+ * @param index
6
+ * @param data
7
+ */
8
+ export declare function extractForArray(baseRoot: ParentNode, temp: Node, index: number, data: any): void;
9
+ /**
10
+ *
11
+ * @param baseRoot
12
+ * @param temp
13
+ * @param data
14
+ */
15
+ export declare function extractForMap(baseRoot: ParentNode, temp: Node, data: any): void;
@@ -1,20 +1,20 @@
1
- import { part_render_array, part_render_map } from "../render/partRender";
2
- /**
3
- *
4
- * @param baseRoot
5
- * @param temp
6
- * @param index
7
- * @param data
8
- */
9
- export function extractForArray(baseRoot, temp, index, data) {
10
- part_render_array(baseRoot, temp, index, data);
11
- }
12
- /**
13
- *
14
- * @param baseRoot
15
- * @param temp
16
- * @param data
17
- */
18
- export function extractForMap(baseRoot, temp, data) {
19
- part_render_map(baseRoot, temp, data);
20
- }
1
+ import { part_render_array, part_render_map } from "../render/partRender";
2
+ /**
3
+ *
4
+ * @param baseRoot
5
+ * @param temp
6
+ * @param index
7
+ * @param data
8
+ */
9
+ export function extractForArray(baseRoot, temp, index, data) {
10
+ part_render_array(baseRoot, temp, index, data);
11
+ }
12
+ /**
13
+ *
14
+ * @param baseRoot
15
+ * @param temp
16
+ * @param data
17
+ */
18
+ export function extractForMap(baseRoot, temp, data) {
19
+ part_render_map(baseRoot, temp, data);
20
+ }
package/func/Theme.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- /**
2
- *
3
- * @param tag
4
- * @param theme
5
- */
6
- export declare function changeTagTheme(tag: string, theme: string): void;
7
- /**
8
- *
9
- * @param theme
10
- */
11
- export declare function changeSessionTheme(theme: string): void;
12
- /**
13
- *
14
- * @param theme
15
- */
16
- export declare function changeApplicationTheme(theme: string): void;
1
+ /**
2
+ *
3
+ * @param tag
4
+ * @param theme
5
+ */
6
+ export declare function changeTagTheme(tag: string, theme: string): void;
7
+ /**
8
+ *
9
+ * @param theme
10
+ */
11
+ export declare function changeSessionTheme(theme: string): void;
12
+ /**
13
+ *
14
+ * @param theme
15
+ */
16
+ export declare function changeApplicationTheme(theme: string): void;
package/func/Theme.js CHANGED
@@ -1,27 +1,27 @@
1
- import { changeStyle, changeTheme } from "../core/utility/styleUtility";
2
- /**
3
- *
4
- * @param tag
5
- * @param theme
6
- */
7
- export function changeTagTheme(tag, theme) {
8
- changeStyle(tag, theme);
9
- }
10
- /**
11
- *
12
- * @param theme
13
- */
14
- export function changeSessionTheme(theme) {
15
- var application = Reflect.get(window, "context");
16
- application.setField("system_theme", theme);
17
- changeTheme(application.getField("system_theme"));
18
- }
19
- /**
20
- *
21
- * @param theme
22
- */
23
- export function changeApplicationTheme(theme) {
24
- var application = Reflect.get(window, "appSite");
25
- application.setField("system_theme", theme);
26
- changeTheme(application.getField("system_theme"));
27
- }
1
+ import { changeStyle, changeTheme } from "../core/utility/styleUtility";
2
+ /**
3
+ *
4
+ * @param tag
5
+ * @param theme
6
+ */
7
+ export function changeTagTheme(tag, theme) {
8
+ changeStyle(tag, theme);
9
+ }
10
+ /**
11
+ *
12
+ * @param theme
13
+ */
14
+ export function changeSessionTheme(theme) {
15
+ var application = Reflect.get(window, "context");
16
+ application.setField("system_theme", theme);
17
+ changeTheme(application.getField("system_theme"));
18
+ }
19
+ /**
20
+ *
21
+ * @param theme
22
+ */
23
+ export function changeApplicationTheme(theme) {
24
+ var application = Reflect.get(window, "appSite");
25
+ application.setField("system_theme", theme);
26
+ changeTheme(application.getField("system_theme"));
27
+ }
@@ -1,11 +1,11 @@
1
- /**
2
- * 资源定向
3
- * @param url
4
- * @param parameters
5
- */
6
- export declare function redirect(url: string, parameters: {}): void;
7
- /**
8
- * locate the position
9
- * @param position
10
- */
11
- export declare function locate(position: string): void;
1
+ /**
2
+ * 资源定向
3
+ * @param url
4
+ * @param parameters
5
+ */
6
+ export declare function redirect(url: string, parameters: {}): void;
7
+ /**
8
+ * locate the position
9
+ * @param position
10
+ */
11
+ export declare function locate(position: string): void;
@@ -1,36 +1,36 @@
1
- /**
2
- * 资源定向
3
- * @param url
4
- * @param parameters
5
- */
6
- export function redirect(url, parameters) {
7
- if (parameters !== null) {
8
- var params = Object.getOwnPropertyNames(parameters);
9
- if (params.length !== 0) {
10
- var queries_1 = "";
11
- params.forEach(function (value) {
12
- if (queries_1 === "") {
13
- queries_1 = queries_1 + value + "=" + parameters[value].toString();
14
- }
15
- else {
16
- queries_1 = queries_1 + "&" + value + "=" + parameters[value].toString();
17
- }
18
- });
19
- queries_1 = encodeURI(queries_1);
20
- location.href = url + "?" + queries_1;
21
- }
22
- else {
23
- location.href = url;
24
- }
25
- }
26
- else {
27
- location.href = url;
28
- }
29
- }
30
- /**
31
- * locate the position
32
- * @param position
33
- */
34
- export function locate(position) {
35
- location.hash = position;
36
- }
1
+ /**
2
+ * 资源定向
3
+ * @param url
4
+ * @param parameters
5
+ */
6
+ export function redirect(url, parameters) {
7
+ if (parameters !== null) {
8
+ var params = Object.getOwnPropertyNames(parameters);
9
+ if (params.length !== 0) {
10
+ var queries_1 = "";
11
+ params.forEach(function (value) {
12
+ if (queries_1 === "") {
13
+ queries_1 = queries_1 + value + "=" + parameters[value].toString();
14
+ }
15
+ else {
16
+ queries_1 = queries_1 + "&" + value + "=" + parameters[value].toString();
17
+ }
18
+ });
19
+ queries_1 = encodeURI(queries_1);
20
+ location.href = url + "?" + queries_1;
21
+ }
22
+ else {
23
+ location.href = url;
24
+ }
25
+ }
26
+ else {
27
+ location.href = url;
28
+ }
29
+ }
30
+ /**
31
+ * locate the position
32
+ * @param position
33
+ */
34
+ export function locate(position) {
35
+ location.hash = position;
36
+ }