@gct-paas/render 0.1.4-dev.11 → 0.1.4-dev.12
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/dist/index.esm.min.js +6118 -0
- package/es/Event/Dependency/controller.mjs +81 -94
- package/es/Event/Dependency/displayRule.mjs +65 -67
- package/es/Event/Dependency/useDependency.mjs +117 -0
- package/es/Event/Dependency/useDependencyToShow.mjs +100 -96
- package/es/Event/baseEvent.d.ts +6 -5
- package/es/Event/baseEvent.mjs +382 -423
- package/es/Event/bizServiceRequest.mjs +28 -40
- package/es/Event/index.d.ts +2 -1
- package/es/Event/index.mjs +4 -0
- package/es/Event/utils/appRedis.mjs +39 -49
- package/es/Event/utils/globalLoading.mjs +95 -94
- package/es/Event/utils/processRovedInfo.mjs +228 -294
- package/es/Event/utils/runGlobalByPage.mjs +296 -300
- package/es/Event/utils/verificationVar.mjs +32 -38
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/enums/index.mjs +17 -5
- package/es/hooks/useStorageRef.mjs +35 -31
- package/es/index.mjs +18 -21
- package/es/register/render-register/render-register.mjs +63 -58
- package/es/utils/cacheAdapter.mjs +62 -54
- package/es/utils/expression/index.mjs +105 -122
- package/es/utils/expression/regularExpression/methods.mjs +426 -567
- package/es/utils/field-attrs/basicAttrs.mjs +56 -80
- package/es/utils/field-attrs/index.mjs +16 -13
- package/es/utils/get-ref-data.mjs +41 -59
- package/es/utils/getFieldSchema.mjs +66 -80
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.mjs +6 -0
- package/es/utils/model-transformer.mjs +74 -64
- package/es/utils/useStyle.mjs +12 -15
- package/package.json +7 -7
- package/dist/index.esm.min.mjs +0 -7042
- package/dist/index.min.cjs +0 -17
- package/dist/index.system.min.js +0 -17
|
@@ -1,47 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
query,
|
|
11
|
-
data,
|
|
12
|
-
config
|
|
13
|
-
);
|
|
1
|
+
import { BizServiceEnum, EntityModelCategoryEnum } from "@gct-paas/core";
|
|
2
|
+
//#region src/Event/bizServiceRequest.ts
|
|
3
|
+
var bizServiceRequestHook = (api) => (path, query = {}, data = {}, config = {}) => {
|
|
4
|
+
return api({
|
|
5
|
+
modelKey: path.key,
|
|
6
|
+
bsKey: path.action,
|
|
7
|
+
modelCategory: path.modelCategory ?? EntityModelCategoryEnum.ENTITY
|
|
8
|
+
}, query, data, config);
|
|
14
9
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_gct.api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey
|
|
21
|
-
),
|
|
22
|
-
put: bizServiceRequestHook(
|
|
23
|
-
_gct.api.apaas.modelComprehensive.putBizServiceModelCategoryModelKeyBsKey
|
|
24
|
-
),
|
|
25
|
-
delete: bizServiceRequestHook(
|
|
26
|
-
_gct.api.apaas.modelComprehensive.deleteBizServiceModelCategoryModelKeyBsKey
|
|
27
|
-
)
|
|
10
|
+
var BizService = {
|
|
11
|
+
post: bizServiceRequestHook(_gct.api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey),
|
|
12
|
+
get: bizServiceRequestHook(_gct.api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey),
|
|
13
|
+
put: bizServiceRequestHook(_gct.api.apaas.modelComprehensive.putBizServiceModelCategoryModelKeyBsKey),
|
|
14
|
+
delete: bizServiceRequestHook(_gct.api.apaas.modelComprehensive.deleteBizServiceModelCategoryModelKeyBsKey)
|
|
28
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* 系统内置业务服务请求
|
|
18
|
+
* @param path
|
|
19
|
+
* @param params
|
|
20
|
+
* @param config
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
29
23
|
async function $httpBizService(path, params, config = {}) {
|
|
30
|
-
|
|
31
|
-
return BizService[method](path, params, config);
|
|
24
|
+
return BizService[BizServiceEnum[path.action]](path, params, config);
|
|
32
25
|
}
|
|
26
|
+
/**post 业务服务请求 */
|
|
33
27
|
async function $request(modelKey, action, { body = {}, query = {} } = {}, config = {}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
query,
|
|
41
|
-
body,
|
|
42
|
-
config
|
|
43
|
-
);
|
|
44
|
-
return res;
|
|
28
|
+
return await _gct.api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey({
|
|
29
|
+
bsKey: action,
|
|
30
|
+
modelKey,
|
|
31
|
+
modelCategory: EntityModelCategoryEnum.ENTITY
|
|
32
|
+
}, query, body, config);
|
|
45
33
|
}
|
|
46
|
-
|
|
34
|
+
//#endregion
|
|
47
35
|
export { $httpBizService, $request, BizService };
|
package/es/Event/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Globals, pageGlobaVariables, globalVarCaches, formMap, setFormData, pageDataforJson, getPageTitle, getPremission, } from './utils/runGlobalByPage';
|
|
2
|
-
export { Events, Context, GctComponent } from './baseEvent';
|
|
2
|
+
export { Events, Context, GctComponent, type ModalInstance } from './baseEvent';
|
|
3
3
|
export { type EventsConstructor } from './eventType';
|
|
4
4
|
export * from './Dependency/useDependencyToShow';
|
|
5
|
+
export * from './Dependency/useDependency';
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import { useGctSelect } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const useCreateAppredis = ({
|
|
18
|
-
value: defaultValue,
|
|
19
|
-
appredis,
|
|
20
|
-
key: varKey,
|
|
21
|
-
type
|
|
22
|
-
}) => {
|
|
23
|
-
const isredis = GlobaAppInfo.ENV !== "dev" ? appredis : false;
|
|
24
|
-
const key = `${GlobaAppInfo.AID}_${GlobaAppInfo.userInfo?.userId}`;
|
|
25
|
-
const { cacheMap } = useGctSelect(key);
|
|
26
|
-
const globalVar = new Proxy(
|
|
27
|
-
{ value: defaultValue, type },
|
|
28
|
-
{
|
|
29
|
-
get(target, name) {
|
|
30
|
-
if (isredis && name === "value") {
|
|
31
|
-
return cacheMap.value[varKey];
|
|
32
|
-
}
|
|
33
|
-
return Reflect.get(target, name);
|
|
34
|
-
},
|
|
35
|
-
set(target, name, value, receiver) {
|
|
36
|
-
if (isredis && name === "value") {
|
|
37
|
-
if (cacheMap.value[varKey]) {
|
|
38
|
-
cacheMap.value[varKey] = value;
|
|
39
|
-
} else {
|
|
40
|
-
cacheMap.value = { ...cacheMap.value, [varKey]: value };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return Reflect.set(target, name, value, receiver);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
return globalVar;
|
|
1
|
+
import { useGctSelect } from "../../hooks/useStorageRef.mjs";
|
|
2
|
+
//#region src/Event/utils/appRedis.ts
|
|
3
|
+
var GlobaAppInfo = class {
|
|
4
|
+
/**环境变量 */
|
|
5
|
+
static ENV;
|
|
6
|
+
/**应用标识 */
|
|
7
|
+
static AID;
|
|
8
|
+
/**用户信息 */
|
|
9
|
+
static userInfo;
|
|
10
|
+
/**app初始化变量 */
|
|
11
|
+
static runApp({ userInfo, env, aid }) {
|
|
12
|
+
this.ENV = env;
|
|
13
|
+
this.AID = aid;
|
|
14
|
+
this.userInfo = userInfo;
|
|
15
|
+
}
|
|
48
16
|
};
|
|
49
|
-
|
|
50
|
-
|
|
17
|
+
/**获取缓存变量 */
|
|
18
|
+
var useCreateAppredis = ({ value: defaultValue, appredis, key: varKey, type }) => {
|
|
19
|
+
const isredis = GlobaAppInfo.ENV !== "dev" ? appredis : false;
|
|
20
|
+
const { cacheMap } = useGctSelect(`${GlobaAppInfo.AID}_${GlobaAppInfo.userInfo?.userId}`);
|
|
21
|
+
return new Proxy({
|
|
22
|
+
value: defaultValue,
|
|
23
|
+
type
|
|
24
|
+
}, {
|
|
25
|
+
get(target, name) {
|
|
26
|
+
if (isredis && name === "value") return cacheMap.value[varKey];
|
|
27
|
+
return Reflect.get(target, name);
|
|
28
|
+
},
|
|
29
|
+
set(target, name, value, receiver) {
|
|
30
|
+
if (isredis && name === "value") if (cacheMap.value[varKey]) cacheMap.value[varKey] = value;
|
|
31
|
+
else cacheMap.value = {
|
|
32
|
+
...cacheMap.value,
|
|
33
|
+
[varKey]: value
|
|
34
|
+
};
|
|
35
|
+
return Reflect.set(target, name, value, receiver);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { useCreateAppredis };
|
|
@@ -1,82 +1,86 @@
|
|
|
1
|
-
class GlobalLoading {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
var globalLoading = new class GlobalLoading {
|
|
2
|
+
static instance;
|
|
3
|
+
mask;
|
|
4
|
+
container;
|
|
5
|
+
spinner;
|
|
6
|
+
constructor() {
|
|
7
|
+
if (GlobalLoading.instance) return GlobalLoading.instance;
|
|
8
|
+
GlobalLoading.instance = this;
|
|
9
|
+
this.createLoadingElement();
|
|
10
|
+
this.initStyle();
|
|
11
|
+
}
|
|
12
|
+
createLoadingElement() {
|
|
13
|
+
this.mask = document.createElement("div");
|
|
14
|
+
this.mask.id = "gct-global-loading-mask";
|
|
15
|
+
this.container = document.createElement("div");
|
|
16
|
+
this.container.id = "gct-global-loading-container";
|
|
17
|
+
this.spinner = document.createElement("div");
|
|
18
|
+
this.spinner.id = "gct-global-loading-spinner";
|
|
19
|
+
this.container.appendChild(this.spinner);
|
|
20
|
+
this.mask.appendChild(this.container);
|
|
21
|
+
document.body.appendChild(this.mask);
|
|
22
|
+
}
|
|
23
|
+
initStyle() {
|
|
24
|
+
Object.assign(this.mask.style, {
|
|
25
|
+
position: "fixed",
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
width: "100vw",
|
|
29
|
+
height: "100vh",
|
|
30
|
+
backgroundColor: "rgba(255, 255, 255, 0.5)",
|
|
31
|
+
zIndex: 9999,
|
|
32
|
+
display: "none",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
alignItems: "center"
|
|
35
|
+
});
|
|
36
|
+
Object.assign(this.container.style, {
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
width: "43px",
|
|
41
|
+
height: "43px",
|
|
42
|
+
backgroundColor: "transparent",
|
|
43
|
+
boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)"
|
|
44
|
+
});
|
|
45
|
+
Object.assign(this.spinner.style, {
|
|
46
|
+
display: "grid",
|
|
47
|
+
width: "43px",
|
|
48
|
+
height: "43px",
|
|
49
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
50
|
+
gridTemplateRows: "repeat(2, 1fr)",
|
|
51
|
+
gap: "3px"
|
|
52
|
+
});
|
|
53
|
+
const elPrimary = getComputedStyle(document.documentElement).getPropertyValue("--gct-color-primary").trim();
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
id: "gct-global-loading-item_1",
|
|
57
|
+
delay: "0s"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "gct-global-loading-item_2",
|
|
61
|
+
delay: "0.25s"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "gct-global-loading-item_3",
|
|
65
|
+
delay: "0.75s"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "gct-global-loading-item_4",
|
|
69
|
+
delay: "0.5s"
|
|
70
|
+
}
|
|
71
|
+
].forEach((config) => {
|
|
72
|
+
const block = document.createElement("div");
|
|
73
|
+
block.id = config.id;
|
|
74
|
+
Object.assign(block.style, {
|
|
75
|
+
backgroundColor: elPrimary,
|
|
76
|
+
opacity: .2,
|
|
77
|
+
animation: "globalLoading 1s infinite",
|
|
78
|
+
animationDelay: config.delay
|
|
79
|
+
});
|
|
80
|
+
this.spinner.appendChild(block);
|
|
81
|
+
});
|
|
82
|
+
const styleTag = document.createElement("style");
|
|
83
|
+
styleTag.textContent = `
|
|
80
84
|
@keyframes globalLoading {
|
|
81
85
|
0% {
|
|
82
86
|
opacity: 1;
|
|
@@ -85,19 +89,16 @@ class GlobalLoading {
|
|
|
85
89
|
opacity: 0.2;
|
|
86
90
|
}
|
|
87
91
|
}`;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
const globalLoading = new GlobalLoading();
|
|
102
|
-
|
|
92
|
+
document.head.appendChild(styleTag);
|
|
93
|
+
}
|
|
94
|
+
show() {
|
|
95
|
+
this.mask.style.display = "flex";
|
|
96
|
+
document.body.style.overflow = "hidden";
|
|
97
|
+
}
|
|
98
|
+
hide() {
|
|
99
|
+
this.mask.style.display = "none";
|
|
100
|
+
document.body.style.overflow = "";
|
|
101
|
+
}
|
|
102
|
+
}();
|
|
103
|
+
//#endregion
|
|
103
104
|
export { globalLoading };
|