@pisell/core 1.0.33 → 1.0.35
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/es/app/app.d.ts +7 -7
- package/es/app/index.d.ts +1 -1
- package/es/applicationManager/application.d.ts +2 -2
- package/es/cmd/const.d.ts +5 -5
- package/es/hooks/useStore/index.d.ts +1 -1
- package/es/indexDB/index.d.ts +2 -2
- package/es/indexDB/index.js +633 -572
- package/es/locales/type.d.ts +3 -3
- package/es/logger/index.d.ts +1 -1
- package/es/models/index.d.ts +4 -4
- package/es/pubsub/index.d.ts +1 -1
- package/es/request/cache.d.ts +1 -1
- package/es/request/pisell2Request.d.ts +1 -1
- package/es/request/type.d.ts +1 -1
- package/es/routes/index.d.ts +2 -2
- package/es/socket/monitor.js +2 -0
- package/es/socket/types.d.ts +4 -3
- package/es/tasks/index.d.ts +0 -1
- package/es/tasks/index.js +0 -1
- package/es/tasks/type.d.ts +4 -4
- package/es/variables/index.d.ts +3 -3
- package/lib/app/app.d.ts +7 -7
- package/lib/app/app.js +21 -51
- package/lib/app/index.d.ts +1 -1
- package/lib/applicationManager/application.d.ts +2 -2
- package/lib/applicationManager/application.js +6 -12
- package/lib/applicationManager/index.js +4 -2
- package/lib/aws/index.js +0 -3
- package/lib/cmd/const.d.ts +5 -5
- package/lib/cmd/const.js +5 -5
- package/lib/cmd/index.js +0 -2
- package/lib/cookie/index.js +4 -2
- package/lib/data/index.js +0 -3
- package/lib/history/index.js +22 -24
- package/lib/hooks/useStore/index.d.ts +1 -1
- package/lib/indexDB/index.d.ts +2 -2
- package/lib/indexDB/index.js +233 -327
- package/lib/locales/index.js +94 -95
- package/lib/locales/type.d.ts +3 -3
- package/lib/logger/index.d.ts +1 -1
- package/lib/logger/index.js +8 -18
- package/lib/menuManager/index.js +12 -9
- package/lib/models/index.d.ts +4 -4
- package/lib/pubsub/index.d.ts +1 -1
- package/lib/pubsub/index.js +3 -1
- package/lib/request/cache.d.ts +1 -1
- package/lib/request/pisell2Request.d.ts +1 -1
- package/lib/request/type.d.ts +1 -1
- package/lib/routes/index.d.ts +2 -2
- package/lib/routes/index.js +1 -3
- package/lib/socket/components/SocketMonitorPage.js +12 -6
- package/lib/socket/heartbeat.js +5 -10
- package/lib/socket/index.js +3 -1
- package/lib/socket/monitor.js +26 -26
- package/lib/socket/reconnect.js +3 -10
- package/lib/socket/socket.js +10 -12
- package/lib/socket/types.d.ts +4 -3
- package/lib/storage/index.js +24 -25
- package/lib/tasks/index.d.ts +0 -1
- package/lib/tasks/index.js +329 -334
- package/lib/tasks/type.d.ts +4 -4
- package/lib/variables/index.d.ts +3 -3
- package/package.json +3 -2
package/es/locales/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Locale = 'original' | 'en' | 'zh-CN' | 'zh-HK' | string;
|
|
2
|
+
export type MultiLanguage = {
|
|
3
3
|
[key in Locale]: string;
|
|
4
4
|
};
|
|
5
5
|
export interface LibraryItem {
|
|
@@ -16,4 +16,4 @@ export interface LocaleConfig {
|
|
|
16
16
|
[key in Locale]: LibraryItem;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type LoadLibraryByUrlParams = (string | Promise<LibraryItem> | (() => Promise<LibraryItem>) | LibraryItem)[];
|
package/es/logger/index.d.ts
CHANGED
package/es/models/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import hooks from '../hooks';
|
|
2
2
|
import { Provider as StoreProvider } from "react-redux";
|
|
3
3
|
declare const models: import("./global").GlobalModal[];
|
|
4
|
-
|
|
4
|
+
type ModalsType = (typeof models[number]);
|
|
5
5
|
export interface Store {
|
|
6
6
|
getDataByModel: typeof getDataByModel;
|
|
7
7
|
useStore: typeof hooks.useStore;
|
|
@@ -10,8 +10,8 @@ export interface Store {
|
|
|
10
10
|
dispatch: any;
|
|
11
11
|
getState: any;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type ModelsNames = ModalsType['namespace'];
|
|
14
|
+
export type ModelsState = {
|
|
15
15
|
[K in (ModalsType['namespace'])]: Extract<ModalsType, {
|
|
16
16
|
namespace: K;
|
|
17
17
|
}>['state'];
|
|
@@ -25,7 +25,7 @@ export declare type ModelsState = {
|
|
|
25
25
|
* @Author: zhiwei.Wang
|
|
26
26
|
* @Date: 2024-09-03 11:07
|
|
27
27
|
*/
|
|
28
|
-
declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D
|
|
28
|
+
declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
29
29
|
/**
|
|
30
30
|
* @title: 设置数据到store
|
|
31
31
|
* @description:
|
package/es/pubsub/index.d.ts
CHANGED
package/es/request/cache.d.ts
CHANGED
package/es/request/type.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare enum RequestModeENUM {
|
|
|
26
26
|
REMOTE_LOCAL = "remote_local",
|
|
27
27
|
OS_SERVER = "os_server"
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
|
|
30
30
|
export interface CacheProps {
|
|
31
31
|
key?: string;
|
|
32
32
|
type?: CacheType;
|
package/es/routes/index.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export declare class RouterManager {
|
|
|
20
20
|
get(name: string): RouteType;
|
|
21
21
|
has(name: string): boolean;
|
|
22
22
|
remove(name: string): void;
|
|
23
|
-
renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | React.
|
|
23
|
+
renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
24
24
|
getPageByRoute(route: string): ApplicationInterface | undefined;
|
|
25
25
|
getRouterComponent({ fallback }: {
|
|
26
26
|
fallback?: React.ReactNode;
|
|
27
|
-
}): JSX.Element[];
|
|
27
|
+
}): React.JSX.Element[];
|
|
28
28
|
}
|
package/es/socket/monitor.js
CHANGED
|
@@ -332,6 +332,7 @@ export var SocketMonitor = /*#__PURE__*/function () {
|
|
|
332
332
|
id: message.id || "out_".concat(Date.now()),
|
|
333
333
|
timestamp: Date.now(),
|
|
334
334
|
direction: 'out',
|
|
335
|
+
//@ts-ignore
|
|
335
336
|
message: this.options.recordMessageContent ? message : {
|
|
336
337
|
event: message.event
|
|
337
338
|
},
|
|
@@ -363,6 +364,7 @@ export var SocketMonitor = /*#__PURE__*/function () {
|
|
|
363
364
|
id: message.id || "in_".concat(Date.now()),
|
|
364
365
|
timestamp: Date.now(),
|
|
365
366
|
direction: 'in',
|
|
367
|
+
//@ts-ignore
|
|
366
368
|
message: this.options.recordMessageContent ? message : {
|
|
367
369
|
event: message.event
|
|
368
370
|
},
|
package/es/socket/types.d.ts
CHANGED
|
@@ -38,13 +38,14 @@ export declare enum SocketStatus {
|
|
|
38
38
|
/**
|
|
39
39
|
* Socket消息格式
|
|
40
40
|
*/
|
|
41
|
-
export interface SocketMessage
|
|
41
|
+
export interface SocketMessage {
|
|
42
42
|
/** 事件类型 */
|
|
43
43
|
type: string;
|
|
44
44
|
/** 消息数据 */
|
|
45
|
-
data?:
|
|
45
|
+
data?: any;
|
|
46
46
|
/** 消息ID */
|
|
47
47
|
id?: string;
|
|
48
|
+
event?: any;
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* 心跳配置选项
|
|
@@ -75,7 +76,7 @@ export interface ReconnectOptions {
|
|
|
75
76
|
/**
|
|
76
77
|
* 事件处理函数类型
|
|
77
78
|
*/
|
|
78
|
-
export
|
|
79
|
+
export type EventHandler = (...args: any[]) => void;
|
|
79
80
|
/**
|
|
80
81
|
* 事件处理函数映射
|
|
81
82
|
*/
|
package/es/tasks/index.d.ts
CHANGED
package/es/tasks/index.js
CHANGED
package/es/tasks/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
2
|
export interface Task {
|
|
3
3
|
id?: string;
|
|
4
4
|
type?: "local" | "cloud";
|
|
@@ -37,9 +37,9 @@ export interface Task {
|
|
|
37
37
|
export interface TaskConfig {
|
|
38
38
|
tasks: Task[];
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
type TaskModuleName = string;
|
|
41
|
+
type TaskQueueName = string;
|
|
42
|
+
type TaskStatus = "uncompleted" | "completed";
|
|
43
43
|
export interface TaskQueue {
|
|
44
44
|
status: TaskStatus;
|
|
45
45
|
tasks: Task[];
|
package/es/variables/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type VariableMap = Record<string, string>;
|
|
2
2
|
declare const _default: {
|
|
3
|
-
setConfig: (newConfig: Partial<import("
|
|
4
|
-
getConfig: () => import("
|
|
3
|
+
setConfig: (newConfig: Partial<import("@").VariablesConfig>) => void;
|
|
4
|
+
getConfig: () => import("@").VariablesConfig;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
package/lib/app/app.d.ts
CHANGED
|
@@ -42,13 +42,13 @@ declare class App {
|
|
|
42
42
|
setConfig: (models: any[]) => void;
|
|
43
43
|
};
|
|
44
44
|
request: {
|
|
45
|
-
get: (url: string, data: any, config: import("
|
|
46
|
-
post: (url: string, data: any, config: import("
|
|
47
|
-
put: (url: string, data: any, config: import("
|
|
48
|
-
remove: (url: string, data: any, config: import("
|
|
49
|
-
custom: (url: string, config: import("
|
|
50
|
-
setConfig: (newConfig: Partial<import("
|
|
51
|
-
getConfig: () => import("
|
|
45
|
+
get: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
46
|
+
post: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
47
|
+
put: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
48
|
+
remove: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
49
|
+
custom: (url: string, config: import("@").RequestSetting | undefined) => any;
|
|
50
|
+
setConfig: (newConfig: Partial<import("@").RequestConfig>) => void;
|
|
51
|
+
getConfig: () => import("@").RequestConfig;
|
|
52
52
|
};
|
|
53
53
|
storage: Storage;
|
|
54
54
|
menuManager: MenuManager;
|
package/lib/app/app.js
CHANGED
|
@@ -51,54 +51,24 @@ var import_pubsub = __toESM(require("../pubsub"));
|
|
|
51
51
|
var import_const = require("./const");
|
|
52
52
|
var import_cmd = __toESM(require("../cmd"));
|
|
53
53
|
var import_aws = __toESM(require("../aws"));
|
|
54
|
-
var App = class
|
|
55
|
-
// 实例
|
|
56
|
-
static instance;
|
|
57
|
-
// 插件管理
|
|
58
|
-
plugins;
|
|
59
|
-
// 全局数据
|
|
60
|
-
globalData;
|
|
61
|
-
// 路由管理
|
|
62
|
-
router;
|
|
63
|
-
// 应用管理
|
|
64
|
-
applicationManager;
|
|
65
|
-
// History
|
|
66
|
-
history;
|
|
67
|
-
// 数据存储
|
|
68
|
-
data;
|
|
69
|
-
// hooks
|
|
70
|
-
hooks = import_hooks.default;
|
|
71
|
-
// 多语言
|
|
72
|
-
locales;
|
|
73
|
-
// dva
|
|
74
|
-
models = import_models.default;
|
|
75
|
-
// 请求
|
|
76
|
-
request = import_request.default;
|
|
77
|
-
// 存储
|
|
78
|
-
storage;
|
|
79
|
-
// 菜单管理
|
|
80
|
-
menuManager;
|
|
81
|
-
// cookie
|
|
82
|
-
cookie = import_cookie.default;
|
|
83
|
-
// 网站信息
|
|
84
|
-
website = import_website.default;
|
|
85
|
-
// 日志
|
|
86
|
-
logger;
|
|
87
|
-
// 发布订阅
|
|
88
|
-
pubsub = import_pubsub.default;
|
|
89
|
-
// cmd
|
|
90
|
-
cmd;
|
|
91
|
-
// aws
|
|
92
|
-
aws;
|
|
93
|
-
// 任务管理
|
|
94
|
-
tasksManager;
|
|
95
|
-
// getPisellos
|
|
96
|
-
getPisellos;
|
|
97
|
-
dbManager = null;
|
|
98
|
-
constants = {
|
|
99
|
-
channel: ""
|
|
100
|
-
};
|
|
54
|
+
var App = class {
|
|
101
55
|
constructor(options) {
|
|
56
|
+
// hooks
|
|
57
|
+
this.hooks = import_hooks.default;
|
|
58
|
+
// dva
|
|
59
|
+
this.models = import_models.default;
|
|
60
|
+
// 请求
|
|
61
|
+
this.request = import_request.default;
|
|
62
|
+
// cookie
|
|
63
|
+
this.cookie = import_cookie.default;
|
|
64
|
+
// 网站信息
|
|
65
|
+
this.website = import_website.default;
|
|
66
|
+
// 发布订阅
|
|
67
|
+
this.pubsub = import_pubsub.default;
|
|
68
|
+
this.dbManager = null;
|
|
69
|
+
this.constants = {
|
|
70
|
+
channel: ""
|
|
71
|
+
};
|
|
102
72
|
this.plugins = /* @__PURE__ */ new Map();
|
|
103
73
|
this.globalData = {};
|
|
104
74
|
this.router = new import_routes.RouterManager({}, this);
|
|
@@ -122,11 +92,11 @@ var App = class _App {
|
|
|
122
92
|
}
|
|
123
93
|
// 单例模式
|
|
124
94
|
static getInstance(options) {
|
|
125
|
-
if (!
|
|
126
|
-
|
|
127
|
-
window.app =
|
|
95
|
+
if (!App.instance) {
|
|
96
|
+
App.instance = new App(options);
|
|
97
|
+
window.app = App.instance;
|
|
128
98
|
}
|
|
129
|
-
return
|
|
99
|
+
return App.instance;
|
|
130
100
|
}
|
|
131
101
|
// 初始化配置
|
|
132
102
|
setGlobalData(globalData) {
|
package/lib/app/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { MenuItem } from '../menuManager/index';
|
|
|
5
5
|
* 应用接口类型定义
|
|
6
6
|
* @description 描述应用中单个页面、组件或功能的接口结构
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type ApplicationInterface = {
|
|
9
9
|
/** 页面类型:低代码或普通代码 */
|
|
10
10
|
page_type: 'low_code' | 'code';
|
|
11
11
|
/** 页面唯一标识 */
|
|
@@ -34,7 +34,7 @@ export declare type ApplicationInterface = {
|
|
|
34
34
|
* 应用数据类型定义
|
|
35
35
|
* @description 描述完整应用的数据结构,包含应用的基本信息、接口、功能等
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export type ApplicationData = {
|
|
38
38
|
/** 应用唯一标识 */
|
|
39
39
|
app_id: number;
|
|
40
40
|
/** 应用名称 */
|
|
@@ -34,18 +34,6 @@ __export(application_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(application_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var Application = class {
|
|
37
|
-
/** 应用配置数据 */
|
|
38
|
-
options;
|
|
39
|
-
/** 应用名称 */
|
|
40
|
-
name;
|
|
41
|
-
/** 应用内的页面接口映射表,以页面名称为键 */
|
|
42
|
-
interfaces = /* @__PURE__ */ new Map();
|
|
43
|
-
/** 应用内的组件映射表,以组件编码为键 */
|
|
44
|
-
components = /* @__PURE__ */ new Map();
|
|
45
|
-
/** 应用内的功能函数映射表,比如跳转登录页面的方法等 */
|
|
46
|
-
functions = /* @__PURE__ */ new Map();
|
|
47
|
-
/** 应用实例引用 */
|
|
48
|
-
app;
|
|
49
37
|
/**
|
|
50
38
|
* 构造函数
|
|
51
39
|
* @description 初始化应用实例,设置基本属性并初始化接口和功能
|
|
@@ -53,6 +41,12 @@ var Application = class {
|
|
|
53
41
|
* @param {App} app - 应用实例引用
|
|
54
42
|
*/
|
|
55
43
|
constructor(options, app) {
|
|
44
|
+
/** 应用内的页面接口映射表,以页面名称为键 */
|
|
45
|
+
this.interfaces = /* @__PURE__ */ new Map();
|
|
46
|
+
/** 应用内的组件映射表,以组件编码为键 */
|
|
47
|
+
this.components = /* @__PURE__ */ new Map();
|
|
48
|
+
/** 应用内的功能函数映射表,比如跳转登录页面的方法等 */
|
|
49
|
+
this.functions = /* @__PURE__ */ new Map();
|
|
56
50
|
this.options = options;
|
|
57
51
|
this.name = options.app_name;
|
|
58
52
|
this.app = app;
|
|
@@ -27,12 +27,12 @@ var ApplicationManager = class {
|
|
|
27
27
|
constructor(applicationList = [], app) {
|
|
28
28
|
this.applicationList = applicationList;
|
|
29
29
|
this.app = app;
|
|
30
|
+
this.applications = /* @__PURE__ */ new Map();
|
|
30
31
|
this.app = app;
|
|
31
32
|
if (applicationList == null ? void 0 : applicationList.length) {
|
|
32
33
|
this.init(applicationList);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
applications = /* @__PURE__ */ new Map();
|
|
36
36
|
async init(applicationList) {
|
|
37
37
|
return new Promise(async (res, req) => {
|
|
38
38
|
applicationList.forEach(
|
|
@@ -74,7 +74,9 @@ var ApplicationManager = class {
|
|
|
74
74
|
* @returns
|
|
75
75
|
*/
|
|
76
76
|
getAllComponents() {
|
|
77
|
-
return Array.from(this.applications.values()).flatMap(
|
|
77
|
+
return Array.from(this.applications.values()).flatMap(
|
|
78
|
+
(application) => Array.from(application.components.values())
|
|
79
|
+
).filter((component) => component.autoRender).map((component) => component.Component);
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
82
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/aws/index.js
CHANGED
package/lib/cmd/const.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare enum CMDCoreEnum {
|
|
2
|
-
CMD_CONNECT,
|
|
3
|
-
CMD_DISCONNECT,
|
|
4
|
-
CMD_RECONNECT,
|
|
5
|
-
CMD_MESSAGE,
|
|
6
|
-
CMD_ERROR
|
|
2
|
+
CMD_CONNECT = "cmd.connect",
|
|
3
|
+
CMD_DISCONNECT = "cmd.disconnect",
|
|
4
|
+
CMD_RECONNECT = "cmd.reconnect",
|
|
5
|
+
CMD_MESSAGE = "cmd.message",
|
|
6
|
+
CMD_ERROR = "cmd.error"
|
|
7
7
|
}
|
|
8
8
|
declare const _default: {
|
|
9
9
|
CMDCoreEnum: typeof CMDCoreEnum;
|
package/lib/cmd/const.js
CHANGED
|
@@ -25,11 +25,11 @@ __export(const_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(const_exports);
|
|
26
26
|
var prefix = "cmd";
|
|
27
27
|
var CMDCoreEnum = ((CMDCoreEnum2) => {
|
|
28
|
-
CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect
|
|
29
|
-
CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect
|
|
30
|
-
CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect
|
|
31
|
-
CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message
|
|
32
|
-
CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error
|
|
28
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect`] = "CMD_CONNECT";
|
|
29
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect`] = "CMD_DISCONNECT";
|
|
30
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect`] = "CMD_RECONNECT";
|
|
31
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message`] = "CMD_MESSAGE";
|
|
32
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error`] = "CMD_ERROR";
|
|
33
33
|
return CMDCoreEnum2;
|
|
34
34
|
})(CMDCoreEnum || {});
|
|
35
35
|
var const_default = { CMDCoreEnum };
|
package/lib/cmd/index.js
CHANGED
package/lib/cookie/index.js
CHANGED
|
@@ -35,8 +35,10 @@ function getCookie(name) {
|
|
|
35
35
|
const ca = document.cookie.split(";");
|
|
36
36
|
for (let i = 0; i < ca.length; i++) {
|
|
37
37
|
let c = ca[i];
|
|
38
|
-
while (c.charAt(0) === " ")
|
|
39
|
-
|
|
38
|
+
while (c.charAt(0) === " ")
|
|
39
|
+
c = c.substring(1, c.length);
|
|
40
|
+
if (c.indexOf(nameEQ) === 0)
|
|
41
|
+
return c.substring(nameEQ.length, c.length);
|
|
40
42
|
}
|
|
41
43
|
return null;
|
|
42
44
|
}
|
package/lib/data/index.js
CHANGED
package/lib/history/index.js
CHANGED
|
@@ -25,34 +25,32 @@ module.exports = __toCommonJS(history_exports);
|
|
|
25
25
|
var import_history = require("history");
|
|
26
26
|
var import_react_router_dom = require("react-router-dom");
|
|
27
27
|
var History = class {
|
|
28
|
-
instance;
|
|
29
|
-
useHistory = import_react_router_dom.useHistory;
|
|
30
|
-
useLocation = import_react_router_dom.useLocation;
|
|
31
|
-
useParams = import_react_router_dom.useParams;
|
|
32
|
-
app;
|
|
33
28
|
constructor(app, options) {
|
|
29
|
+
this.useHistory = import_react_router_dom.useHistory;
|
|
30
|
+
this.useLocation = import_react_router_dom.useLocation;
|
|
31
|
+
this.useParams = import_react_router_dom.useParams;
|
|
32
|
+
this.push = (path, state) => {
|
|
33
|
+
this.instance.push(path, state);
|
|
34
|
+
};
|
|
35
|
+
this.replace = (path, state) => {
|
|
36
|
+
this.instance.replace(path, state);
|
|
37
|
+
};
|
|
38
|
+
this.reload = () => {
|
|
39
|
+
window.location.reload();
|
|
40
|
+
};
|
|
41
|
+
this.reloadTo = (path) => {
|
|
42
|
+
window.location.href = path;
|
|
43
|
+
};
|
|
44
|
+
this.externalPage = (path) => {
|
|
45
|
+
window.open(path);
|
|
46
|
+
};
|
|
47
|
+
this.goLogin = () => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return (_b = (_a = this.app.applicationManager.get("login")) == null ? void 0 : _a.runFunction) == null ? void 0 : _b.call(_a, "goLogin");
|
|
50
|
+
};
|
|
34
51
|
this.app = app;
|
|
35
52
|
this.instance = (0, import_history.createBrowserHistory)({ basename: (options == null ? void 0 : options.basename) || "/" });
|
|
36
53
|
}
|
|
37
|
-
push = (path, state) => {
|
|
38
|
-
this.instance.push(path, state);
|
|
39
|
-
};
|
|
40
|
-
replace = (path, state) => {
|
|
41
|
-
this.instance.replace(path, state);
|
|
42
|
-
};
|
|
43
|
-
reload = () => {
|
|
44
|
-
window.location.reload();
|
|
45
|
-
};
|
|
46
|
-
reloadTo = (path) => {
|
|
47
|
-
window.location.href = path;
|
|
48
|
-
};
|
|
49
|
-
externalPage = (path) => {
|
|
50
|
-
window.open(path);
|
|
51
|
-
};
|
|
52
|
-
goLogin = () => {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
return (_b = (_a = this.app.applicationManager.get("login")) == null ? void 0 : _a.runFunction) == null ? void 0 : _b.call(_a, "goLogin");
|
|
55
|
-
};
|
|
56
54
|
};
|
|
57
55
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
56
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelsState } from "../../models";
|
|
2
2
|
declare const useStore: <T extends "global", D extends keyof ModelsState[T]>(props: {
|
|
3
3
|
models: T;
|
|
4
|
-
key?: D
|
|
4
|
+
key?: D;
|
|
5
5
|
}) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
6
6
|
export default useStore;
|
package/lib/indexDB/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import App from "../app";
|
|
|
2
2
|
/**
|
|
3
3
|
* IndexDB 管理器模块
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* 这个模块使用 Dexie.js 提供了对浏览器 IndexedDB 的简单封装,并在不支持 IndexedDB 的环境中
|
|
6
6
|
* 自动降级使用内存存储作为备选存储方案。
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -34,7 +34,7 @@ export interface DBOptions {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* IndexDB 管理器类
|
|
37
|
-
* 提供对 IndexedDB
|
|
37
|
+
* 使用 Dexie.js 提供对 IndexedDB 的封装,支持自动降级到内存存储
|
|
38
38
|
* @class IndexDBManager
|
|
39
39
|
*/
|
|
40
40
|
declare class IndexDBManager {
|