@fairys/taro-tools-react 1.0.6 → 1.0.8
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/esm/context/page.data.instance.d.ts +1 -1
- package/esm/context/page.data.instance.js +1 -0
- package/esm/context/page.info.data.instance.d.ts +1 -1
- package/esm/context/page.info.data.instance.js +2 -0
- package/lib/context/page.data.instance.d.ts +1 -1
- package/lib/context/page.data.instance.js +1 -0
- package/lib/context/page.info.data.instance.d.ts +1 -1
- package/lib/context/page.info.data.instance.js +2 -0
- package/package.json +1 -1
- package/src/context/page.data.instance.tsx +1 -0
- package/src/context/page.info.data.instance.tsx +2 -1
|
@@ -75,7 +75,7 @@ export declare class PageDataInstance<T extends PageDataInstanceState = PageData
|
|
|
75
75
|
/**默认值*/
|
|
76
76
|
defaultInital: T;
|
|
77
77
|
store: T;
|
|
78
|
-
ctor: (options?: PageDataOptions<T>) =>
|
|
78
|
+
ctor: (options?: PageDataOptions<T>) => this;
|
|
79
79
|
/**初始化状态值*/
|
|
80
80
|
main_page_store: (initalValues?: Partial<T>, file?: string[]) => this;
|
|
81
81
|
/**格式化请求参数*/
|
|
@@ -44,6 +44,7 @@ class page_data_instance_PageDataInstance extends ProxyInstanceObjectBase {
|
|
|
44
44
|
this.store.tabItems = external_valtio_ref(options.tabItems);
|
|
45
45
|
this.store.isTabs = Array.isArray(options.tabItems) && options.tabItems.length > 0;
|
|
46
46
|
}
|
|
47
|
+
return this;
|
|
47
48
|
};
|
|
48
49
|
main_page_store = (initalValues = {}, file)=>{
|
|
49
50
|
const newStore = {
|
|
@@ -48,7 +48,7 @@ export declare class PageInfoDataInstance<T extends PageInfoDataInstanceState =
|
|
|
48
48
|
/**是否显示成功提示*/
|
|
49
49
|
isShowSuccessMessage?: boolean;
|
|
50
50
|
};
|
|
51
|
-
ctor(options?: PageInfoDataOptions<T>):
|
|
51
|
+
ctor(options?: PageInfoDataOptions<T>): this;
|
|
52
52
|
store: T;
|
|
53
53
|
/**初始化状态值*/
|
|
54
54
|
main_page_store: (initalValues?: Partial<T>, file?: string[]) => this;
|
|
@@ -26,9 +26,11 @@ class page_info_data_instance_PageInfoDataInstance extends ProxyInstanceObjectBa
|
|
|
26
26
|
'editFormData',
|
|
27
27
|
'loading'
|
|
28
28
|
];
|
|
29
|
+
this.defaultInital.editFormData = {};
|
|
29
30
|
this.store.editFormData = {};
|
|
30
31
|
}
|
|
31
32
|
if (options?.initialValues) this.main_page_store(options.initialValues);
|
|
33
|
+
return this;
|
|
32
34
|
}
|
|
33
35
|
store = proxy({
|
|
34
36
|
...this.defaultInital
|
|
@@ -75,7 +75,7 @@ export declare class PageDataInstance<T extends PageDataInstanceState = PageData
|
|
|
75
75
|
/**默认值*/
|
|
76
76
|
defaultInital: T;
|
|
77
77
|
store: T;
|
|
78
|
-
ctor: (options?: PageDataOptions<T>) =>
|
|
78
|
+
ctor: (options?: PageDataOptions<T>) => this;
|
|
79
79
|
/**初始化状态值*/
|
|
80
80
|
main_page_store: (initalValues?: Partial<T>, file?: string[]) => this;
|
|
81
81
|
/**格式化请求参数*/
|
|
@@ -87,6 +87,7 @@ class page_data_instance_PageDataInstance extends instance_js_namespaceObject.Pr
|
|
|
87
87
|
this.store.tabItems = (0, external_valtio_namespaceObject.ref)(options.tabItems);
|
|
88
88
|
this.store.isTabs = Array.isArray(options.tabItems) && options.tabItems.length > 0;
|
|
89
89
|
}
|
|
90
|
+
return this;
|
|
90
91
|
};
|
|
91
92
|
main_page_store = (initalValues = {}, file)=>{
|
|
92
93
|
const newStore = {
|
|
@@ -48,7 +48,7 @@ export declare class PageInfoDataInstance<T extends PageInfoDataInstanceState =
|
|
|
48
48
|
/**是否显示成功提示*/
|
|
49
49
|
isShowSuccessMessage?: boolean;
|
|
50
50
|
};
|
|
51
|
-
ctor(options?: PageInfoDataOptions<T>):
|
|
51
|
+
ctor(options?: PageInfoDataOptions<T>): this;
|
|
52
52
|
store: T;
|
|
53
53
|
/**初始化状态值*/
|
|
54
54
|
main_page_store: (initalValues?: Partial<T>, file?: string[]) => this;
|
|
@@ -70,9 +70,11 @@ class page_info_data_instance_PageInfoDataInstance extends instance_js_namespace
|
|
|
70
70
|
'editFormData',
|
|
71
71
|
'loading'
|
|
72
72
|
];
|
|
73
|
+
this.defaultInital.editFormData = {};
|
|
73
74
|
this.store.editFormData = {};
|
|
74
75
|
}
|
|
75
76
|
if (options?.initialValues) this.main_page_store(options.initialValues);
|
|
77
|
+
return this;
|
|
76
78
|
}
|
|
77
79
|
store = (0, external_valtio_namespaceObject.proxy)({
|
|
78
80
|
...this.defaultInital
|
package/package.json
CHANGED
|
@@ -117,6 +117,7 @@ export class PageDataInstance<
|
|
|
117
117
|
this.store.tabItems = ref(options.tabItems);
|
|
118
118
|
this.store.isTabs = Array.isArray(options.tabItems) && options.tabItems.length > 0;
|
|
119
119
|
}
|
|
120
|
+
return this;
|
|
120
121
|
};
|
|
121
122
|
/**初始化状态值*/
|
|
122
123
|
main_page_store = (initalValues: Partial<T> = {}, file?: string[]) => {
|
|
@@ -4,7 +4,6 @@ import { createContext, useContext, useEffect, useMemo, useRef } from 'react';
|
|
|
4
4
|
import navigate from '../utils/navigate';
|
|
5
5
|
import { globalDataInstance } from './global.data.instance';
|
|
6
6
|
import { globalSettingDataInstance } from './global.setting.data.instance';
|
|
7
|
-
import { PageDataInstance } from './page.data.instance';
|
|
8
7
|
import { useDidShow } from '@tarojs/taro';
|
|
9
8
|
import Taro from '@tarojs/taro';
|
|
10
9
|
|
|
@@ -73,11 +72,13 @@ export class PageInfoDataInstance<
|
|
|
73
72
|
ctor(options?: PageInfoDataOptions<T>) {
|
|
74
73
|
if (options?.isProxy) {
|
|
75
74
|
this.notRefFields = ['editFormData', 'loading'];
|
|
75
|
+
this.defaultInital.editFormData = {};
|
|
76
76
|
this.store.editFormData = {};
|
|
77
77
|
}
|
|
78
78
|
if (options?.initialValues) {
|
|
79
79
|
this.main_page_store(options.initialValues);
|
|
80
80
|
}
|
|
81
|
+
return this;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
store = proxy<T>({ ...this.defaultInital } as T);
|