render-core 1.3.37 → 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.
- package/class/component/component.d.ts +41 -41
- package/class/component/component.js +108 -108
- package/class/controller/appController.d.ts +44 -44
- package/class/controller/appController.js +132 -132
- package/class/controller/componentController.d.ts +15 -15
- package/class/controller/componentController.js +22 -22
- package/class/controller/contextController.d.ts +18 -18
- package/class/controller/contextController.js +79 -79
- package/class/controller/pageController.d.ts +23 -23
- package/class/controller/pageController.js +40 -40
- package/class/tips/appTip.d.ts +2 -2
- package/class/tips/appTip.js +1 -1
- package/class/tips/componentTip.d.ts +13 -13
- package/class/tips/componentTip.js +1 -1
- package/class/tips/renderTip.d.ts +5 -5
- package/class/tips/renderTip.js +1 -1
- package/core/cmd/data/v-el.d.ts +8 -8
- package/core/cmd/data/v-el.js +28 -28
- package/core/cmd/data/v-html.d.ts +8 -8
- package/core/cmd/data/v-html.js +26 -26
- package/core/cmd/data/v-txt.d.ts +8 -8
- package/core/cmd/data/v-txt.js +29 -29
- package/core/cmd/justify/v-if.d.ts +6 -6
- package/core/cmd/justify/v-if.js +43 -43
- package/core/cmd/justify/v-render.d.ts +6 -6
- package/core/cmd/justify/v-render.js +26 -26
- package/core/cmd/justify/v-show.d.ts +6 -6
- package/core/cmd/justify/v-show.js +26 -26
- package/core/cmd/justify/v-switch.d.ts +6 -6
- package/core/cmd/justify/v-switch.js +35 -35
- package/core/cmd/loop/v-for.d.ts +12 -12
- package/core/cmd/loop/v-for.js +63 -63
- package/core/cmd/loop/v-index.d.ts +14 -14
- package/core/cmd/loop/v-index.js +80 -78
- package/core/cmd/loop/v-key.d.ts +12 -12
- package/core/cmd/loop/v-key.js +70 -70
- package/core/cmd/method/v-on.d.ts +8 -8
- package/core/cmd/method/v-on.js +40 -40
- package/core/cmd/property/v-bind.d.ts +6 -6
- package/core/cmd/property/v-bind.js +33 -33
- package/core/cmd/react/v-model.d.ts +6 -6
- package/core/cmd/react/v-model.js +22 -22
- package/core/cmd/ref/v-ref.d.ts +6 -6
- package/core/cmd/ref/v-ref.js +16 -16
- package/core/cmd/solt/v-solt.d.ts +14 -14
- package/core/cmd/solt/v-solt.js +46 -46
- package/core/inject/inject.d.ts +30 -35
- package/core/inject/inject.js +63 -70
- package/core/lifecycle/afterMethods.d.ts +16 -16
- package/core/lifecycle/afterMethods.js +22 -22
- package/core/lifecycle/controllerCycle.d.ts +13 -13
- package/core/lifecycle/controllerCycle.js +42 -42
- package/core/lifecycle/mount.d.ts +16 -17
- package/core/lifecycle/mount.js +31 -34
- package/core/loader/loader.d.ts +7 -7
- package/core/loader/loader.js +18 -18
- package/core/proxy/getProxy.d.ts +13 -13
- package/core/proxy/getProxy.js +42 -42
- package/core/render/PostRender.d.ts +12 -12
- package/core/render/PostRender.js +42 -45
- package/core/render/delivery.d.ts +5 -5
- package/core/render/delivery.js +42 -42
- package/core/render/initRender.d.ts +12 -12
- package/core/render/initRender.js +39 -41
- package/core/render/partRender.d.ts +15 -15
- package/core/render/partRender.js +31 -31
- package/core/render/rawRender.d.ts +12 -12
- package/core/render/rawRender.js +43 -45
- package/core/render/updateRender.d.ts +6 -6
- package/core/render/updateRender.js +29 -32
- package/core/resolver/props.d.ts +18 -18
- package/core/resolver/props.js +60 -60
- package/core/resolver/query.d.ts +4 -4
- package/core/resolver/query.js +15 -15
- package/core/utility/checkUtility.d.ts +1 -1
- package/core/utility/checkUtility.js +4 -4
- package/core/utility/cmdUtility.d.ts +16 -16
- package/core/utility/cmdUtility.js +57 -57
- package/core/utility/dataUtility.d.ts +1 -1
- package/core/utility/dataUtility.js +8 -8
- package/core/utility/errorUtility.d.ts +3 -3
- package/core/utility/errorUtility.js +9 -9
- package/core/utility/injectUtility.d.ts +13 -13
- package/core/utility/injectUtility.js +58 -58
- package/core/utility/inputType.d.ts +5 -5
- package/core/utility/inputType.js +20 -20
- package/core/utility/inputUtility.d.ts +4 -4
- package/core/utility/inputUtility.js +100 -100
- package/core/utility/miscUtility.d.ts +6 -6
- package/core/utility/miscUtility.js +12 -12
- package/core/utility/modelUtility.d.ts +15 -15
- package/core/utility/modelUtility.js +66 -66
- package/core/utility/sectionUtility.d.ts +6 -6
- package/core/utility/sectionUtility.js +104 -104
- package/core/utility/styleUtility.d.ts +29 -29
- package/core/utility/styleUtility.js +114 -114
- package/core/utility/templateUtility.d.ts +6 -6
- package/core/utility/templateUtility.js +13 -13
- package/core/utility/vForUtility.d.ts +15 -15
- package/core/utility/vForUtility.js +20 -20
- package/func/Theme.d.ts +16 -16
- package/func/Theme.js +27 -27
- package/http/redirect/redirect.d.ts +11 -11
- package/http/redirect/redirect.js +36 -36
- package/index.d.ts +71 -71
- package/index.js +130 -130
- package/package.json +3 -8
- package/runtime/metaTagLib.d.ts +2 -2
- package/runtime/metaTagLib.js +27 -27
- package/runtime/runtime.d.ts +7 -7
- package/runtime/runtime.js +26 -26
- package/runtime/tools.d.ts +14 -14
- package/runtime/tools.js +49 -49
- package/status/read/read.d.ts +10 -10
- package/status/read/read.js +26 -26
- package/status/write/write.d.ts +12 -12
- package/status/write/write.js +92 -92
- package/README.md +0 -2
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { RenderBase } from "../tips/componentTip";
|
|
2
|
-
/**
|
|
3
|
-
* This is the component class.
|
|
4
|
-
*/
|
|
5
|
-
export declare class Component implements RenderBase {
|
|
6
|
-
private readonly name;
|
|
7
|
-
private readonly template;
|
|
8
|
-
private readonly mode;
|
|
9
|
-
private readonly boxStyle?;
|
|
10
|
-
private readonly props?;
|
|
11
|
-
private readonly data?;
|
|
12
|
-
private readonly methods?;
|
|
13
|
-
private readonly computed?;
|
|
14
|
-
private readonly watcher?;
|
|
15
|
-
private readonly beforeRender?;
|
|
16
|
-
private readonly afterRender?;
|
|
17
|
-
constructor(config: {
|
|
18
|
-
name: string;
|
|
19
|
-
template: string;
|
|
20
|
-
mode?: string;
|
|
21
|
-
boxStyle?: string;
|
|
22
|
-
props?: {} | string[];
|
|
23
|
-
data?: {};
|
|
24
|
-
computed?: {};
|
|
25
|
-
methods?: {};
|
|
26
|
-
watcher?: {};
|
|
27
|
-
beforeRender?: () => void;
|
|
28
|
-
afterRender?: () => void;
|
|
29
|
-
});
|
|
30
|
-
getName(): string;
|
|
31
|
-
getTemplate(): string;
|
|
32
|
-
getMode(): string;
|
|
33
|
-
getBoxStyle(): string;
|
|
34
|
-
getProps(): {};
|
|
35
|
-
getData(): {};
|
|
36
|
-
getMethods(): {};
|
|
37
|
-
getComputed(): {};
|
|
38
|
-
getWatcher(): {};
|
|
39
|
-
getBeforeRender(): () => void;
|
|
40
|
-
getAfterRender(): () => void;
|
|
41
|
-
}
|
|
1
|
+
import { RenderBase } from "../tips/componentTip";
|
|
2
|
+
/**
|
|
3
|
+
* This is the component class.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Component implements RenderBase {
|
|
6
|
+
private readonly name;
|
|
7
|
+
private readonly template;
|
|
8
|
+
private readonly mode;
|
|
9
|
+
private readonly boxStyle?;
|
|
10
|
+
private readonly props?;
|
|
11
|
+
private readonly data?;
|
|
12
|
+
private readonly methods?;
|
|
13
|
+
private readonly computed?;
|
|
14
|
+
private readonly watcher?;
|
|
15
|
+
private readonly beforeRender?;
|
|
16
|
+
private readonly afterRender?;
|
|
17
|
+
constructor(config: {
|
|
18
|
+
name: string;
|
|
19
|
+
template: string;
|
|
20
|
+
mode?: string;
|
|
21
|
+
boxStyle?: string;
|
|
22
|
+
props?: {} | string[];
|
|
23
|
+
data?: {};
|
|
24
|
+
computed?: {};
|
|
25
|
+
methods?: {};
|
|
26
|
+
watcher?: {};
|
|
27
|
+
beforeRender?: () => void;
|
|
28
|
+
afterRender?: () => void;
|
|
29
|
+
});
|
|
30
|
+
getName(): string;
|
|
31
|
+
getTemplate(): string;
|
|
32
|
+
getMode(): string;
|
|
33
|
+
getBoxStyle(): string;
|
|
34
|
+
getProps(): {};
|
|
35
|
+
getData(): {};
|
|
36
|
+
getMethods(): {};
|
|
37
|
+
getComputed(): {};
|
|
38
|
+
getWatcher(): {};
|
|
39
|
+
getBeforeRender(): () => void;
|
|
40
|
+
getAfterRender(): () => void;
|
|
41
|
+
}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is the component class.
|
|
3
|
-
*/
|
|
4
|
-
var Component = /** @class */ (function () {
|
|
5
|
-
function Component(config) {
|
|
6
|
-
//标签名称
|
|
7
|
-
this.name = config.name;
|
|
8
|
-
//标签模板样式
|
|
9
|
-
this.template = config.template;
|
|
10
|
-
//添加box样式
|
|
11
|
-
if (typeof config.mode === "undefined") {
|
|
12
|
-
this.mode = "box";
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
this.mode = config.mode;
|
|
16
|
-
}
|
|
17
|
-
//添加box样式
|
|
18
|
-
if (typeof config.boxStyle === "undefined") {
|
|
19
|
-
this.boxStyle = "";
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
this.boxStyle = config.boxStyle;
|
|
23
|
-
}
|
|
24
|
-
//添加数据
|
|
25
|
-
if (typeof config.props === "undefined") {
|
|
26
|
-
this.props = [];
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.props = config.props;
|
|
30
|
-
}
|
|
31
|
-
//添加数据
|
|
32
|
-
if (typeof config.data === "undefined") {
|
|
33
|
-
this.data = {};
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.data = config.data;
|
|
37
|
-
}
|
|
38
|
-
//添加计算属性
|
|
39
|
-
if (typeof config.computed === "undefined") {
|
|
40
|
-
this.computed = {};
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.computed = config.computed;
|
|
44
|
-
}
|
|
45
|
-
//添加方法属性
|
|
46
|
-
if (typeof config.methods === "undefined") {
|
|
47
|
-
this.methods = {};
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.methods = config.methods;
|
|
51
|
-
}
|
|
52
|
-
//添加监控属性
|
|
53
|
-
if (typeof config.watcher === "undefined") {
|
|
54
|
-
this.watcher = {};
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.watcher = config.watcher;
|
|
58
|
-
}
|
|
59
|
-
//生命周期函数
|
|
60
|
-
if (typeof config.beforeRender === "undefined") {
|
|
61
|
-
this.beforeRender = function () { };
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.beforeRender = config.beforeRender;
|
|
65
|
-
}
|
|
66
|
-
if (typeof config.afterRender === "undefined") {
|
|
67
|
-
this.afterRender = function () { };
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.afterRender = config.afterRender;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
Component.prototype.getName = function () {
|
|
74
|
-
return this.name;
|
|
75
|
-
};
|
|
76
|
-
Component.prototype.getTemplate = function () {
|
|
77
|
-
return this.template;
|
|
78
|
-
};
|
|
79
|
-
Component.prototype.getMode = function () {
|
|
80
|
-
return this.mode;
|
|
81
|
-
};
|
|
82
|
-
Component.prototype.getBoxStyle = function () {
|
|
83
|
-
return this.boxStyle;
|
|
84
|
-
};
|
|
85
|
-
Component.prototype.getProps = function () {
|
|
86
|
-
return this.props;
|
|
87
|
-
};
|
|
88
|
-
Component.prototype.getData = function () {
|
|
89
|
-
return this.data;
|
|
90
|
-
};
|
|
91
|
-
Component.prototype.getMethods = function () {
|
|
92
|
-
return this.methods;
|
|
93
|
-
};
|
|
94
|
-
Component.prototype.getComputed = function () {
|
|
95
|
-
return this.computed;
|
|
96
|
-
};
|
|
97
|
-
Component.prototype.getWatcher = function () {
|
|
98
|
-
return this.watcher;
|
|
99
|
-
};
|
|
100
|
-
Component.prototype.getBeforeRender = function () {
|
|
101
|
-
return this.beforeRender;
|
|
102
|
-
};
|
|
103
|
-
Component.prototype.getAfterRender = function () {
|
|
104
|
-
return this.afterRender;
|
|
105
|
-
};
|
|
106
|
-
return Component;
|
|
107
|
-
}());
|
|
108
|
-
export { Component };
|
|
1
|
+
/**
|
|
2
|
+
* This is the component class.
|
|
3
|
+
*/
|
|
4
|
+
var Component = /** @class */ (function () {
|
|
5
|
+
function Component(config) {
|
|
6
|
+
//标签名称
|
|
7
|
+
this.name = config.name;
|
|
8
|
+
//标签模板样式
|
|
9
|
+
this.template = config.template;
|
|
10
|
+
//添加box样式
|
|
11
|
+
if (typeof config.mode === "undefined") {
|
|
12
|
+
this.mode = "box";
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.mode = config.mode;
|
|
16
|
+
}
|
|
17
|
+
//添加box样式
|
|
18
|
+
if (typeof config.boxStyle === "undefined") {
|
|
19
|
+
this.boxStyle = "";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.boxStyle = config.boxStyle;
|
|
23
|
+
}
|
|
24
|
+
//添加数据
|
|
25
|
+
if (typeof config.props === "undefined") {
|
|
26
|
+
this.props = [];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.props = config.props;
|
|
30
|
+
}
|
|
31
|
+
//添加数据
|
|
32
|
+
if (typeof config.data === "undefined") {
|
|
33
|
+
this.data = {};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.data = config.data;
|
|
37
|
+
}
|
|
38
|
+
//添加计算属性
|
|
39
|
+
if (typeof config.computed === "undefined") {
|
|
40
|
+
this.computed = {};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.computed = config.computed;
|
|
44
|
+
}
|
|
45
|
+
//添加方法属性
|
|
46
|
+
if (typeof config.methods === "undefined") {
|
|
47
|
+
this.methods = {};
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.methods = config.methods;
|
|
51
|
+
}
|
|
52
|
+
//添加监控属性
|
|
53
|
+
if (typeof config.watcher === "undefined") {
|
|
54
|
+
this.watcher = {};
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.watcher = config.watcher;
|
|
58
|
+
}
|
|
59
|
+
//生命周期函数
|
|
60
|
+
if (typeof config.beforeRender === "undefined") {
|
|
61
|
+
this.beforeRender = function () { };
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.beforeRender = config.beforeRender;
|
|
65
|
+
}
|
|
66
|
+
if (typeof config.afterRender === "undefined") {
|
|
67
|
+
this.afterRender = function () { };
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.afterRender = config.afterRender;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
Component.prototype.getName = function () {
|
|
74
|
+
return this.name;
|
|
75
|
+
};
|
|
76
|
+
Component.prototype.getTemplate = function () {
|
|
77
|
+
return this.template;
|
|
78
|
+
};
|
|
79
|
+
Component.prototype.getMode = function () {
|
|
80
|
+
return this.mode;
|
|
81
|
+
};
|
|
82
|
+
Component.prototype.getBoxStyle = function () {
|
|
83
|
+
return this.boxStyle;
|
|
84
|
+
};
|
|
85
|
+
Component.prototype.getProps = function () {
|
|
86
|
+
return this.props;
|
|
87
|
+
};
|
|
88
|
+
Component.prototype.getData = function () {
|
|
89
|
+
return this.data;
|
|
90
|
+
};
|
|
91
|
+
Component.prototype.getMethods = function () {
|
|
92
|
+
return this.methods;
|
|
93
|
+
};
|
|
94
|
+
Component.prototype.getComputed = function () {
|
|
95
|
+
return this.computed;
|
|
96
|
+
};
|
|
97
|
+
Component.prototype.getWatcher = function () {
|
|
98
|
+
return this.watcher;
|
|
99
|
+
};
|
|
100
|
+
Component.prototype.getBeforeRender = function () {
|
|
101
|
+
return this.beforeRender;
|
|
102
|
+
};
|
|
103
|
+
Component.prototype.getAfterRender = function () {
|
|
104
|
+
return this.afterRender;
|
|
105
|
+
};
|
|
106
|
+
return Component;
|
|
107
|
+
}());
|
|
108
|
+
export { Component };
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { AppTip } from "../tips/appTip";
|
|
2
|
-
/**
|
|
3
|
-
* This class is associated with localStorage.
|
|
4
|
-
*/
|
|
5
|
-
export declare class AppController implements AppTip {
|
|
6
|
-
private readonly fields;
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* This method is used to add custom data.
|
|
10
|
-
* @param fields
|
|
11
|
-
*/
|
|
12
|
-
saveFields(fields: {}): void;
|
|
13
|
-
/**
|
|
14
|
-
* 更新数据
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
loadFields(): void;
|
|
18
|
-
/**
|
|
19
|
-
* store fields
|
|
20
|
-
*/
|
|
21
|
-
storeFields(): void;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param field
|
|
25
|
-
* @param value
|
|
26
|
-
*/
|
|
27
|
-
setField(field: string, value: any): void;
|
|
28
|
-
/**
|
|
29
|
-
* 获取数据
|
|
30
|
-
* @param field
|
|
31
|
-
*/
|
|
32
|
-
getField(field: string): any;
|
|
33
|
-
/**
|
|
34
|
-
* 资源定向
|
|
35
|
-
* @param url
|
|
36
|
-
* @param parameters
|
|
37
|
-
*/
|
|
38
|
-
redirect(url: string, parameters: {}): void;
|
|
39
|
-
/**
|
|
40
|
-
* 位置定位
|
|
41
|
-
* @param position
|
|
42
|
-
*/
|
|
43
|
-
locate(position: string): void;
|
|
44
|
-
}
|
|
1
|
+
import { AppTip } from "../tips/appTip";
|
|
2
|
+
/**
|
|
3
|
+
* This class is associated with localStorage.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AppController implements AppTip {
|
|
6
|
+
private readonly fields;
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* This method is used to add custom data.
|
|
10
|
+
* @param fields
|
|
11
|
+
*/
|
|
12
|
+
saveFields(fields: {}): void;
|
|
13
|
+
/**
|
|
14
|
+
* 更新数据
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
loadFields(): void;
|
|
18
|
+
/**
|
|
19
|
+
* store fields
|
|
20
|
+
*/
|
|
21
|
+
storeFields(): void;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param field
|
|
25
|
+
* @param value
|
|
26
|
+
*/
|
|
27
|
+
setField(field: string, value: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* 获取数据
|
|
30
|
+
* @param field
|
|
31
|
+
*/
|
|
32
|
+
getField(field: string): any;
|
|
33
|
+
/**
|
|
34
|
+
* 资源定向
|
|
35
|
+
* @param url
|
|
36
|
+
* @param parameters
|
|
37
|
+
*/
|
|
38
|
+
redirect(url: string, parameters: {}): void;
|
|
39
|
+
/**
|
|
40
|
+
* 位置定位
|
|
41
|
+
* @param position
|
|
42
|
+
*/
|
|
43
|
+
locate(position: string): void;
|
|
44
|
+
}
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
import { locate, redirect } from "../../http/redirect/redirect";
|
|
2
|
-
import { status_read, status_write } from "../../index";
|
|
3
|
-
/**
|
|
4
|
-
* This class is associated with localStorage.
|
|
5
|
-
*/
|
|
6
|
-
var AppController = /** @class */ (function () {
|
|
7
|
-
//系统变量
|
|
8
|
-
function AppController() {
|
|
9
|
-
this.fields = {
|
|
10
|
-
system_theme: {
|
|
11
|
-
data: "default",
|
|
12
|
-
react: true,
|
|
13
|
-
push: true,
|
|
14
|
-
callback: function (value, context) {
|
|
15
|
-
context.saveFields({
|
|
16
|
-
"system_theme": {
|
|
17
|
-
data: value,
|
|
18
|
-
react: true,
|
|
19
|
-
down: false
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
context.storeFields();
|
|
23
|
-
context.loadFields();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This method is used to add custom data.
|
|
30
|
-
* @param fields
|
|
31
|
-
*/
|
|
32
|
-
AppController.prototype.saveFields = function (fields) {
|
|
33
|
-
for (var fieldsKey in fields) {
|
|
34
|
-
if (Reflect.has(this.fields, fieldsKey)) {
|
|
35
|
-
console.log("This filed is a system filed, please have a new name for the filed:" + fieldsKey);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
Reflect.set(this.fields, fieldsKey, fields[fieldsKey]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 更新数据
|
|
44
|
-
* @private
|
|
45
|
-
*/
|
|
46
|
-
AppController.prototype.loadFields = function () {
|
|
47
|
-
for (var fieldsKey in this.fields) {
|
|
48
|
-
if (this.fields[fieldsKey].react) {
|
|
49
|
-
if (status_read({
|
|
50
|
-
type: "local",
|
|
51
|
-
fields: [fieldsKey]
|
|
52
|
-
})[fieldsKey]) {
|
|
53
|
-
this.fields[fieldsKey].data = status_read({
|
|
54
|
-
type: "local",
|
|
55
|
-
fields: [fieldsKey]
|
|
56
|
-
})[fieldsKey]["data"];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (this.fields[fieldsKey].push) {
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
this.fields[fieldsKey].callback(this.fields[fieldsKey]["data"], window.context);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* store fields
|
|
67
|
-
*/
|
|
68
|
-
AppController.prototype.storeFields = function () {
|
|
69
|
-
for (var fieldsKey in this.fields) {
|
|
70
|
-
if (!status_read({
|
|
71
|
-
type: "local",
|
|
72
|
-
fields: [fieldsKey]
|
|
73
|
-
})[fieldsKey]) {
|
|
74
|
-
var data = {};
|
|
75
|
-
Reflect.set(data, fieldsKey, {
|
|
76
|
-
data: this.fields[fieldsKey]["data"]
|
|
77
|
-
});
|
|
78
|
-
status_write({
|
|
79
|
-
type: "local",
|
|
80
|
-
fields: data
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @param field
|
|
88
|
-
* @param value
|
|
89
|
-
*/
|
|
90
|
-
AppController.prototype.setField = function (field, value) {
|
|
91
|
-
var data = {};
|
|
92
|
-
Reflect.set(data, field, {
|
|
93
|
-
data: value
|
|
94
|
-
});
|
|
95
|
-
//写入数
|
|
96
|
-
status_write({
|
|
97
|
-
type: "local",
|
|
98
|
-
fields: data
|
|
99
|
-
});
|
|
100
|
-
//更新数据
|
|
101
|
-
this.loadFields();
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* 获取数据
|
|
105
|
-
* @param field
|
|
106
|
-
*/
|
|
107
|
-
AppController.prototype.getField = function (field) {
|
|
108
|
-
if (this.fields[field]) {
|
|
109
|
-
return this.fields[field].data;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* 资源定向
|
|
117
|
-
* @param url
|
|
118
|
-
* @param parameters
|
|
119
|
-
*/
|
|
120
|
-
AppController.prototype.redirect = function (url, parameters) {
|
|
121
|
-
redirect(url, parameters);
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* 位置定位
|
|
125
|
-
* @param position
|
|
126
|
-
*/
|
|
127
|
-
AppController.prototype.locate = function (position) {
|
|
128
|
-
locate(position);
|
|
129
|
-
};
|
|
130
|
-
return AppController;
|
|
131
|
-
}());
|
|
132
|
-
export { AppController };
|
|
1
|
+
import { locate, redirect } from "../../http/redirect/redirect";
|
|
2
|
+
import { status_read, status_write } from "../../index";
|
|
3
|
+
/**
|
|
4
|
+
* This class is associated with localStorage.
|
|
5
|
+
*/
|
|
6
|
+
var AppController = /** @class */ (function () {
|
|
7
|
+
//系统变量
|
|
8
|
+
function AppController() {
|
|
9
|
+
this.fields = {
|
|
10
|
+
system_theme: {
|
|
11
|
+
data: "default",
|
|
12
|
+
react: true,
|
|
13
|
+
push: true,
|
|
14
|
+
callback: function (value, context) {
|
|
15
|
+
context.saveFields({
|
|
16
|
+
"system_theme": {
|
|
17
|
+
data: value,
|
|
18
|
+
react: true,
|
|
19
|
+
down: false
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
context.storeFields();
|
|
23
|
+
context.loadFields();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This method is used to add custom data.
|
|
30
|
+
* @param fields
|
|
31
|
+
*/
|
|
32
|
+
AppController.prototype.saveFields = function (fields) {
|
|
33
|
+
for (var fieldsKey in fields) {
|
|
34
|
+
if (Reflect.has(this.fields, fieldsKey)) {
|
|
35
|
+
console.log("This filed is a system filed, please have a new name for the filed:" + fieldsKey);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
Reflect.set(this.fields, fieldsKey, fields[fieldsKey]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 更新数据
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
AppController.prototype.loadFields = function () {
|
|
47
|
+
for (var fieldsKey in this.fields) {
|
|
48
|
+
if (this.fields[fieldsKey].react) {
|
|
49
|
+
if (status_read({
|
|
50
|
+
type: "local",
|
|
51
|
+
fields: [fieldsKey]
|
|
52
|
+
})[fieldsKey]) {
|
|
53
|
+
this.fields[fieldsKey].data = status_read({
|
|
54
|
+
type: "local",
|
|
55
|
+
fields: [fieldsKey]
|
|
56
|
+
})[fieldsKey]["data"];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (this.fields[fieldsKey].push) {
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
this.fields[fieldsKey].callback(this.fields[fieldsKey]["data"], window.context);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* store fields
|
|
67
|
+
*/
|
|
68
|
+
AppController.prototype.storeFields = function () {
|
|
69
|
+
for (var fieldsKey in this.fields) {
|
|
70
|
+
if (!status_read({
|
|
71
|
+
type: "local",
|
|
72
|
+
fields: [fieldsKey]
|
|
73
|
+
})[fieldsKey]) {
|
|
74
|
+
var data = {};
|
|
75
|
+
Reflect.set(data, fieldsKey, {
|
|
76
|
+
data: this.fields[fieldsKey]["data"]
|
|
77
|
+
});
|
|
78
|
+
status_write({
|
|
79
|
+
type: "local",
|
|
80
|
+
fields: data
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param field
|
|
88
|
+
* @param value
|
|
89
|
+
*/
|
|
90
|
+
AppController.prototype.setField = function (field, value) {
|
|
91
|
+
var data = {};
|
|
92
|
+
Reflect.set(data, field, {
|
|
93
|
+
data: value
|
|
94
|
+
});
|
|
95
|
+
//写入数
|
|
96
|
+
status_write({
|
|
97
|
+
type: "local",
|
|
98
|
+
fields: data
|
|
99
|
+
});
|
|
100
|
+
//更新数据
|
|
101
|
+
this.loadFields();
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 获取数据
|
|
105
|
+
* @param field
|
|
106
|
+
*/
|
|
107
|
+
AppController.prototype.getField = function (field) {
|
|
108
|
+
if (this.fields[field]) {
|
|
109
|
+
return this.fields[field].data;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* 资源定向
|
|
117
|
+
* @param url
|
|
118
|
+
* @param parameters
|
|
119
|
+
*/
|
|
120
|
+
AppController.prototype.redirect = function (url, parameters) {
|
|
121
|
+
redirect(url, parameters);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* 位置定位
|
|
125
|
+
* @param position
|
|
126
|
+
*/
|
|
127
|
+
AppController.prototype.locate = function (position) {
|
|
128
|
+
locate(position);
|
|
129
|
+
};
|
|
130
|
+
return AppController;
|
|
131
|
+
}());
|
|
132
|
+
export { AppController };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Component } from "../component/component";
|
|
2
|
-
export declare class ComponentController {
|
|
3
|
-
root: ParentNode;
|
|
4
|
-
proto: Component;
|
|
5
|
-
mode: string;
|
|
6
|
-
solt: Map<string, any>;
|
|
7
|
-
link: Map<string, {}>;
|
|
8
|
-
to: ComponentController[];
|
|
9
|
-
raw_data: {};
|
|
10
|
-
proxyForMethods: {};
|
|
11
|
-
computed: {};
|
|
12
|
-
watcher: {};
|
|
13
|
-
constructor();
|
|
14
|
-
receiver(method: string, ...args: any[]): any;
|
|
15
|
-
}
|
|
1
|
+
import { Component } from "../component/component";
|
|
2
|
+
export declare class ComponentController {
|
|
3
|
+
root: ParentNode;
|
|
4
|
+
proto: Component;
|
|
5
|
+
mode: string;
|
|
6
|
+
solt: Map<string, any>;
|
|
7
|
+
link: Map<string, {}>;
|
|
8
|
+
to: ComponentController[];
|
|
9
|
+
raw_data: {};
|
|
10
|
+
proxyForMethods: {};
|
|
11
|
+
computed: {};
|
|
12
|
+
watcher: {};
|
|
13
|
+
constructor();
|
|
14
|
+
receiver(method: string, ...args: any[]): any;
|
|
15
|
+
}
|