@gct-paas/core 6.0.0-dev.5 → 6.0.0-dev.51
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 +2 -2
- package/dist/{redirect-index-qf1j4GVJ.js → redirect-index-CmrmDDmH.js} +1 -1
- package/es/constants/expression-type/FunctionKeys.mjs +7 -0
- package/es/constants/expression-type/function.mjs +64 -1
- package/es/constants/expression-type/index.mjs +5 -0
- package/es/constants/expression-type/modeCfg.mjs +8 -2
- package/es/enums/designEnum.mjs +2 -1
- package/es/enums/page-designer/layout.d.ts +6 -0
- package/es/enums/page-designer/layout.mjs +8 -1
- package/es/enums/page-designer/panel.d.ts +4 -2
- package/es/enums/page-designer/panel.mjs +3 -1
- package/es/global/gct/gct.d.ts +4 -1
- package/es/index.mjs +6 -3
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -1
- package/es/modules/mqtt/mqtt-manager.d.ts +1 -1
- package/es/modules/mqtt/mqtt-manager.mjs +3 -2
- package/es/modules/mqtt/utils/mqtt-broker-url.util.d.ts +6 -0
- package/es/modules/mqtt/utils/mqtt-broker-url.util.mjs +11 -0
- package/es/modules/platform-config/enums/platform.enum.d.ts +4 -0
- package/es/modules/platform-config/enums/platform.enum.mjs +6 -1
- package/es/modules/platform-config/index.d.ts +3 -0
- package/es/modules/platform-config/index.mjs +3 -0
- package/es/modules/platform-config/store.d.ts +4 -1
- package/es/modules/platform-config/useSecuritySetting.d.ts +1 -0
- package/es/modules/platform-config/useSecuritySetting.mjs +11 -0
- package/es/modules/system-mqtt/system-mqtt.service.d.ts +1 -1
- package/es/modules/user-stores/store/user.store.d.ts +4 -0
- package/es/setup-app.mjs +6 -0
- package/es/types/index.d.ts +4 -17
- package/es/utils/axios/interceptors.mjs +33 -3
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +1 -1
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +2 -1
- package/es/utils/tools/tools.d.ts +2 -0
- package/es/utils/tools/tools.mjs +8 -4
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @gct-paas/core v6.0.0-dev.
|
|
1
|
+
/*! @gct-paas/core v6.0.0-dev.50 */
|
|
2
2
|
import{createElementBlock as e,defineComponent as r,openBlock as t,unref as a}from"vue";import{useRouter as p}from"vue-router";var o=/* @__PURE__ */r({__name:"redirect-index",setup(r){const{currentRoute:o,replace:i}=p(),{params:s,query:u}=a(o),{path:m,_redirect_type:n="path"}=s;Reflect.deleteProperty(s,"_redirect_type"),Reflect.deleteProperty(s,"path");const c=Array.isArray(m)?m.join("/"):m;return i("name"===n?{name:c,query:u,params:JSON.parse(s._origin_params??"{}")}:{path:c.startsWith("/")?c:"/"+c,query:u}),(r,a)=>(t(),e("div"))}});export{o as default};
|
|
@@ -43,8 +43,13 @@ var FUNC_KEYS = [
|
|
|
43
43
|
"MOD",
|
|
44
44
|
"POWER",
|
|
45
45
|
"SQRT",
|
|
46
|
+
"EXP",
|
|
47
|
+
"LN",
|
|
46
48
|
"SUMSQ",
|
|
47
49
|
"STDEV",
|
|
50
|
+
"RSQ",
|
|
51
|
+
"MAXABS",
|
|
52
|
+
"BANKROUND",
|
|
48
53
|
"TUPLE",
|
|
49
54
|
"SEQMAP",
|
|
50
55
|
"GET",
|
|
@@ -55,6 +60,8 @@ var FUNC_KEYS = [
|
|
|
55
60
|
"TIMESTAMP2DATE",
|
|
56
61
|
"DATE2TIMESTAMP",
|
|
57
62
|
"DATEFORMAT",
|
|
63
|
+
"DateAdd",
|
|
64
|
+
"DateSubtract",
|
|
58
65
|
"NOW",
|
|
59
66
|
"TODAY",
|
|
60
67
|
"YEAR",
|
|
@@ -364,6 +364,24 @@ POWER(4, 2) 返回 16`,
|
|
|
364
364
|
SQRT(4) 返回 2`,
|
|
365
365
|
definition: "declare function SQRT(v: number): Promise<number>;"
|
|
366
366
|
},
|
|
367
|
+
{
|
|
368
|
+
desc: `EXP(value)
|
|
369
|
+
获取以自然常数e为底、数值value为指数的幂,返回数值
|
|
370
|
+
参数必须为Number类型
|
|
371
|
+
示例
|
|
372
|
+
EXP(1) 返回 2.718281828459045
|
|
373
|
+
EXP(2) 返回 7.38905609893065`,
|
|
374
|
+
definition: "declare function EXP(v: number): Promise<number>;"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
desc: `LN(value)
|
|
378
|
+
获取数值value的自然对数(以自然常数 e 为底),返回数值
|
|
379
|
+
参数必须为Number类型,且value需大于0
|
|
380
|
+
示例
|
|
381
|
+
LN(2.718281828459045) 返回 1
|
|
382
|
+
LN(1) 返回 0`,
|
|
383
|
+
definition: "declare function LN(v: number): Promise<number>;"
|
|
384
|
+
},
|
|
367
385
|
{
|
|
368
386
|
desc: `SUMSQ
|
|
369
387
|
SUMSQ(数字1, 数字2, ...) 计算一组数值的平方和。
|
|
@@ -377,6 +395,33 @@ SQRT(4) 返回 2`,
|
|
|
377
395
|
示例
|
|
378
396
|
STDEV([10, 12, 23, 23, 16, 23, 21, 16])=5.237229365663817`,
|
|
379
397
|
definition: "declare function STDEV(...args: number[]): Promise<number>;"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
desc: `RSQ(array1, array2)
|
|
401
|
+
返回 Pearson 乘积矩相关系数平方值(决定系数 R²),用于评估两个变量之间线性关系的拟合程度。返回值介于 0~1 之间。
|
|
402
|
+
值接近 1:强线性关系,自变量 x 能较好解释因变量 y 的变化;值接近 0:几乎无线性关系;值为 1:完美线性关系;值为 0:无线性关系。
|
|
403
|
+
参数 array1 为因变量 y,array2 为自变量 x;两者均须为数字数组,元素个数大于 1 且长度相同;参数不合规时返回空。
|
|
404
|
+
示例
|
|
405
|
+
RSQ([1, 2, 3, 4, 5], [2, 4, 6, 8, 10]) 返回 1
|
|
406
|
+
RSQ([2, 4, 5, 4, 5], [1, 3, 4, 3, 5]) 返回 0.93
|
|
407
|
+
RSQ([10, 12, 23, 23, 16], [21, 16, 23, 21, 16]) 返回 0.27
|
|
408
|
+
RSQ([1, 2, 3], [2, 5, 1]) 返回 0.06
|
|
409
|
+
RSQ([1], [2]) 返回 空`,
|
|
410
|
+
definition: "declare function RSQ(y: number[], x: number[]): Promise<number>;"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
desc: `MAXABS
|
|
414
|
+
MAXABS(数字1, 数字2, ...) 获取一组数值中绝对值最大的原始数值,保留数字正负符号。
|
|
415
|
+
示例
|
|
416
|
+
MAXABS(-2, -6, -4)=-6`,
|
|
417
|
+
definition: "declare function MAXABS(...args: number[]): Promise<number>;"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
desc: `BANKROUND
|
|
421
|
+
BANKROUND(数值,保留小数位数)按四舍六入五成双规则修约,5 遇奇进、遇偶舍。
|
|
422
|
+
示例
|
|
423
|
+
BANKROUND(2.345, 2) = 2.34`,
|
|
424
|
+
definition: "declare function BANKROUND(v: number, n: number): Promise<number>;"
|
|
380
425
|
}
|
|
381
426
|
]
|
|
382
427
|
},
|
|
@@ -567,12 +612,30 @@ ISDATERANGE(NOW(), WEEKRANGE()) 返回 true`,
|
|
|
567
612
|
ISTIMERANGE(DATEFORMAT(NOW(), HH:mm), ['06:00', '12:00']) 返回 true
|
|
568
613
|
ISTIMERANGE(DATEFORMAT(NOW(), HH:mm), ['13:00', '07:00']) 返回 true `,
|
|
569
614
|
definition: "declare function ISTIMERANGE(v: string, r: [string, string]): Promise<boolean>;"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
desc: `DateAdd(date, num, unit, format?)
|
|
618
|
+
给初始日期增加一个给定的时间量,比如可以推算某天后3个月的日期
|
|
619
|
+
参数 date: 原始日期,num: 数量,unit: 单位(year/month/week/day/hour/minute/second),format: 输出格式(可选,默认 YYYY-MM-DD HH:mm:ss)
|
|
620
|
+
示例
|
|
621
|
+
DateAdd('2024-01-01', 3, 'month') 返回 2024-04-01 00:00:00
|
|
622
|
+
DateAdd('2024-01-01', 3, 'month', 'YYYY-MM-DD') 返回 2024-04-01`,
|
|
623
|
+
definition: "declare function DateAdd(v: string, num: number, unit: string, format?: string): Promise<string>;"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
desc: `DateSubtract(date, num, unit, format?)
|
|
627
|
+
给初始日期减少一个给定的时间量,比如可以推算某天前3个月的日期
|
|
628
|
+
参数 date: 原始日期,num: 数量,unit: 单位(year/month/week/day/hour/minute/second),format: 输出格式(可选,默认 YYYY-MM-DD HH:mm:ss)
|
|
629
|
+
示例
|
|
630
|
+
DateSubtract('2024-04-01', 3, 'month') 返回 2024-01-01 00:00:00
|
|
631
|
+
DateSubtract('2024-04-01', 3, 'month', 'YYYY-MM-DD') 返回 2024-01-01`,
|
|
632
|
+
definition: "declare function DateSubtract(v: string, num: number, unit: string, format?: string): Promise<string>;"
|
|
570
633
|
}
|
|
571
634
|
]
|
|
572
635
|
}
|
|
573
636
|
].map((group) => {
|
|
574
637
|
group.children = (group.children ?? []).map((item) => {
|
|
575
|
-
const id = item.definition.match(/(?<=declare function )([A-
|
|
638
|
+
const id = item.definition.match(/(?<=declare function )([A-Za-z][A-Za-z0-9]*)/g)?.[0] ?? "UNKNOWN";
|
|
576
639
|
const args = (item.definition.match(/([a-z]:)+/g) || []).length;
|
|
577
640
|
Object.assign(item, {
|
|
578
641
|
id,
|
|
@@ -92,7 +92,10 @@ var ModeFnMap = {
|
|
|
92
92
|
"MINUTE",
|
|
93
93
|
"TUPLE",
|
|
94
94
|
"SEQMAP",
|
|
95
|
-
"SUMSQ"
|
|
95
|
+
"SUMSQ",
|
|
96
|
+
"RSQ",
|
|
97
|
+
"MAXABS",
|
|
98
|
+
"BANKROUND"
|
|
96
99
|
],
|
|
97
100
|
[ExpressionModeEnum.LABEL_PRINT]: [
|
|
98
101
|
"IF",
|
|
@@ -133,7 +136,10 @@ var ModeFnMap = {
|
|
|
133
136
|
"MINUTE",
|
|
134
137
|
"TUPLE",
|
|
135
138
|
"SEQMAP",
|
|
136
|
-
"SUMSQ"
|
|
139
|
+
"SUMSQ",
|
|
140
|
+
"RSQ",
|
|
141
|
+
"MAXABS",
|
|
142
|
+
"BANKROUND"
|
|
137
143
|
]
|
|
138
144
|
};
|
|
139
145
|
/**
|
package/es/enums/designEnum.mjs
CHANGED
|
@@ -67,7 +67,8 @@ var notSingleArr = [
|
|
|
67
67
|
SEARCH_SERVICE.NOTIN,
|
|
68
68
|
SEARCH_SERVICE.CONTAINANY,
|
|
69
69
|
SEARCH_SERVICE.CONTAINALL,
|
|
70
|
-
SEARCH_SERVICE.VERSIONIN
|
|
70
|
+
SEARCH_SERVICE.VERSIONIN,
|
|
71
|
+
SEARCH_SERVICE.VERSIONNOTIN
|
|
71
72
|
];
|
|
72
73
|
/**设计页面对齐方式 */
|
|
73
74
|
var AGLINE_ENUMS = /* @__PURE__ */ function(AGLINE_ENUMS) {
|
|
@@ -20,5 +20,12 @@ var ContextSceneEnum = /* @__PURE__ */ function(ContextSceneEnum) {
|
|
|
20
20
|
ContextSceneEnum["DETAIL"] = "detail";
|
|
21
21
|
return ContextSceneEnum;
|
|
22
22
|
}({});
|
|
23
|
+
var ContextTxnPageModeEnum = /* @__PURE__ */ function(ContextTxnPageModeEnum) {
|
|
24
|
+
/** 创建 */
|
|
25
|
+
ContextTxnPageModeEnum["CREATE"] = "create";
|
|
26
|
+
/** 详情 */
|
|
27
|
+
ContextTxnPageModeEnum["DETAIL"] = "detail";
|
|
28
|
+
return ContextTxnPageModeEnum;
|
|
29
|
+
}({});
|
|
23
30
|
//#endregion
|
|
24
|
-
export { ContextSceneEnum, FormDesignEnum, PrintTypeEnum };
|
|
31
|
+
export { ContextSceneEnum, ContextTxnPageModeEnum, FormDesignEnum, PrintTypeEnum };
|
|
@@ -297,8 +297,10 @@ export declare enum VERIFICATIONCONDITIONS_TYPE {
|
|
|
297
297
|
export declare enum ASSIGNMENTSTRATEGY_ENUM {
|
|
298
298
|
/**始终覆盖 */
|
|
299
299
|
alwaysCover = "alwaysCover",
|
|
300
|
-
|
|
301
|
-
notCovered = "notCovered"
|
|
300
|
+
/**不覆盖已修改(本次编辑有效) */
|
|
301
|
+
notCovered = "notCovered",
|
|
302
|
+
/**不覆盖已修改(永久有效) */
|
|
303
|
+
notCoveredForever = "notCoveredForever"
|
|
302
304
|
}
|
|
303
305
|
/**组件依赖枚举 */
|
|
304
306
|
export declare enum Dependency_ENUM {
|
|
@@ -319,8 +319,10 @@ var VERIFICATIONCONDITIONS_TYPE = /* @__PURE__ */ function(VERIFICATIONCONDITION
|
|
|
319
319
|
var ASSIGNMENTSTRATEGY_ENUM = /* @__PURE__ */ function(ASSIGNMENTSTRATEGY_ENUM) {
|
|
320
320
|
/**始终覆盖 */
|
|
321
321
|
ASSIGNMENTSTRATEGY_ENUM["alwaysCover"] = "alwaysCover";
|
|
322
|
-
|
|
322
|
+
/**不覆盖已修改(本次编辑有效) */
|
|
323
323
|
ASSIGNMENTSTRATEGY_ENUM["notCovered"] = "notCovered";
|
|
324
|
+
/**不覆盖已修改(永久有效) */
|
|
325
|
+
ASSIGNMENTSTRATEGY_ENUM["notCoveredForever"] = "notCoveredForever";
|
|
324
326
|
return ASSIGNMENTSTRATEGY_ENUM;
|
|
325
327
|
}({});
|
|
326
328
|
/**组件依赖枚举 */
|
package/es/global/gct/gct.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export declare class GctGlobal {
|
|
|
86
86
|
value: string;
|
|
87
87
|
}[]>;
|
|
88
88
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
89
|
+
isSupportCardSign: () => boolean | undefined;
|
|
89
90
|
postSecuritySetting: () => Promise<void>;
|
|
90
91
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
91
92
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -159,6 +160,7 @@ export declare class GctGlobal {
|
|
|
159
160
|
value: string;
|
|
160
161
|
}[]>;
|
|
161
162
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
163
|
+
isSupportCardSign: () => boolean | undefined;
|
|
162
164
|
postSecuritySetting: () => Promise<void>;
|
|
163
165
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
164
166
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -232,6 +234,7 @@ export declare class GctGlobal {
|
|
|
232
234
|
value: string;
|
|
233
235
|
}[]>;
|
|
234
236
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
237
|
+
isSupportCardSign: () => boolean | undefined;
|
|
235
238
|
postSecuritySetting: () => Promise<void>;
|
|
236
239
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
237
240
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -261,7 +264,7 @@ export declare class GctGlobal {
|
|
|
261
264
|
setProjectConfig: (config: {}) => void;
|
|
262
265
|
init: () => Promise<void>;
|
|
263
266
|
renderInit: () => Promise<void>;
|
|
264
|
-
}, "getSignWay" | "init" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
|
|
267
|
+
}, "getSignWay" | "init" | "isSupportCardSign" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
|
|
265
268
|
/**
|
|
266
269
|
* 全局 router 工具类
|
|
267
270
|
*/
|
package/es/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { ASSIGNMENTSTRATEGY_ENUM, BorderStyle, COLUMNS_TYPE, Dependency_ENUM, Di
|
|
|
4
4
|
import { ToolkitEnum } from "./enums/page-designer/toolkit.mjs";
|
|
5
5
|
import { BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonSize, ButtonStyle, ButtonType, ButtonTypeGroup, ButtonType_vant, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CategoryTypeEnum, DatasourceTypeEnum, DateRangeEnums, DisplayEnums, KeyMode, ListTreeSearchTypeEnum, Platform, PrintModeEnums, ResetRuleType, RowSelectionTypeEnums, SelectPickerEnums, SignatureStyleEnum, SignatureTypeEnum, StatisticalMethodEnums, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TransactionMode, WidgetInScopeEnum, openWindowEnums, operateSysEnums } from "./enums/page-designer/widget.mjs";
|
|
6
6
|
import { BindCmpStyleEnum, BindCmpStyleTypeEnum, Ch_BindCmpStyleEnum, FormComponents, SCOPE, SCOPEINFO, SearchComponents, bindCmpStyleMap, buttonShowType, controlConfigEnum, fixedAlignENUM, mobileSearchListByFieldType, padSearchListByFieldType, searchListByFieldType, sortTypeEnum, statisticalMethodEnum, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, transformBindCmp2CmpType } from "./enums/page-designer/designer.mjs";
|
|
7
|
-
import { ContextSceneEnum, FormDesignEnum, PrintTypeEnum } from "./enums/page-designer/layout.mjs";
|
|
7
|
+
import { ContextSceneEnum, ContextTxnPageModeEnum, FormDesignEnum, PrintTypeEnum } from "./enums/page-designer/layout.mjs";
|
|
8
8
|
import { PrintFormatEnum, PrintResourceEnum } from "./enums/developer-center/integration.mjs";
|
|
9
9
|
import { AppPublishStateEnum } from "./enums/appStateEnum.mjs";
|
|
10
10
|
import { BasicAction, CustomAction, DefaultActions, PlatformSettingActions } from "./enums/authActionEnum.mjs";
|
|
@@ -85,12 +85,15 @@ import "./utils/index.mjs";
|
|
|
85
85
|
import { EnvironmentType } from "./modules/env-manager/env-manager.interface.mjs";
|
|
86
86
|
import { normalizeEnv } from "./modules/env-manager/env-manager.util.mjs";
|
|
87
87
|
import { LoginSortTypeEnum, LoginTypeEnum } from "./modules/platform-config/enums/login.enum.mjs";
|
|
88
|
-
import { KickRuleEnum, PassRule } from "./modules/platform-config/enums/platform.enum.mjs";
|
|
88
|
+
import { KickRuleEnum, PassRule, SecuritySignMethodEnum } from "./modules/platform-config/enums/platform.enum.mjs";
|
|
89
89
|
import { DeployModeEnum } from "./modules/platform-config/enums/deploy.enum.mjs";
|
|
90
90
|
import { OTHER_LOGIN_KEYS, SYSTEM_LOGIN_KEYS, getLoginTypeOptions } from "./modules/platform-config/constants/login.const.mjs";
|
|
91
91
|
import { RELATION_FIELDS } from "./modules/platform-config/constants/org.const.mjs";
|
|
92
92
|
import { MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, THEME_COLORS, THEME_COLOR_BLUE, THEME_COLOR_CLASS, THEME_COLOR_CLASS_MAP, THEME_COLOR_TEAL } from "./modules/platform-config/constants/theme.const.mjs";
|
|
93
93
|
import { WATERMARK_INIT_DATA } from "./modules/platform-config/constants/watermark.const.mjs";
|
|
94
|
+
import { useBasicSetting } from "./modules/platform-config/useBasicSetting.mjs";
|
|
95
|
+
import { useOrgSetting } from "./modules/platform-config/useOrgSetting.mjs";
|
|
96
|
+
import { useSecuritySetting } from "./modules/platform-config/useSecuritySetting.mjs";
|
|
94
97
|
import { usePlatformConfigStore } from "./modules/platform-config/store.mjs";
|
|
95
98
|
import "./modules/platform-config/index.mjs";
|
|
96
99
|
import { globalRefStorage } from "./store/storage-store.mjs";
|
|
@@ -159,4 +162,4 @@ function onInit() {
|
|
|
159
162
|
}
|
|
160
163
|
onInit();
|
|
161
164
|
//#endregion
|
|
162
|
-
export { AGLINE_ENUMS, APP_DARK_MODE_KEY_, APP_INST, APP_LOCAL_CACHE_KEY, APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, APP_SESSION_CACHE_KEY, ARRAY_TYPE, ASSIGNMENTSTRATEGY_ENUM, AggTypes, AppPublishStateEnum, AuthUtil, BOOLEAN_TYPE, BasicAction, BindCmpStyleEnum, BindCmpStyleTypeEnum, BizServiceEnum, BorderStyle, BpmnNodeTypeEnum, BuiltOperators, BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonOpeEnum, ButtonSize, ButtonStyle, ButtonType, ButtonTypeEnum, ButtonTypeGroup, ButtonType_vant, CARD_TRIGGER_ENUM, COLUMNS_TYPE, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CUSTOM_LANGUAGE, CUSTOM_THEME, CacheTypeEnum, CategoryModuleEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, ContextSceneEnum, CoreConst, CreateType, CustomAction, DEFAULT_MQTT_INSTANCE_ID, DESIGNER_SESSION_CACHE_KEY, DEV_SINGLE_PATH_REG, DYN_FORMAT_TYPE_ENUM, DataSetReturnTypeEnum, DatasourceTypeEnum, DateRangeEnums, DefaultActions, DefaultDateTypeConst, Dependency_ENUM, DeployModeEnum, DeviceParamsTypeEnum, DictionaryUtil, DisplayEnums, DisplayTagTypeEnum, DisplayType, DynFormatTypes, ENV, EditorRegisterConst, EntityFormulaReturnTypeEnum, EntityModelCategoryEnum, EntityModelTypeEnum, EnvironmentManager, EnvironmentType, ErrorHandler, ErrorStrategyFactory, ErrorTypeEnum, EventCategory, EventsTypeEnum, ExamineAndApproveStateEnum, ExceptionEnum, ExpressionModeEnum, ExpressionTabEnum, FIELD_TYPE, FIELD_TYPE_BASIC, FIELD_TYPE_CATEGORY, FIELD_TYPE_LOGIC, FIELD_TYPE_TRACE, FUNC_KEYS, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TYPE, FUN_STR_TYPE, FieldDefaultValueTypeEnum, FieldIconMap, FieldSysVarDefaultValueEnum, FieldTypeToJs, FormComponents, FormContainerType, FormDesignEnum, GENDER_TYPE, GLOBAL_TYPE, GLOBAL_VAR_TYPE, GctGlobal, GctMqttTopsEnum, GlobalParamEnum, GlobalStoreUtil, HOST_REG, INNER_EVENT, IP_REG, IdentifierAddon, KeyMode, KickRuleEnum, KitPkgUtil, LOCALE_KEY, LOCALE_LIST_KEY, LOCAL_I18N_TRANSLATE, LOCK_INFO_KEY, LinkedList, LinkedNode, ListTreeSearchTypeEnum, LocaleUtil, LoginSortTypeEnum, LoginTypeEnum, LogoTypeEnum, MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS, MULTIPLE_TABS_KEY, MaterialEnum, MenuModeEnum, MenuSplitTyeEnum, MenuType, MenuTypeEnum, MessageType, MixSidebarTriggerEnum, Modal, ModeFnMap, ModeTabDict, ModeTabMap, ModelFieldEnum, ModelTypeEnum, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, OverlayPopoverContainer, PLUGIN_BASE_URL, PROJ_CFG_KEY, PageEnum, PageTypeEnum, PanelEnum, PassRule, PatternEnum, PermissionModeEnum, PersonalCenterType, Platform, PlatformSettingActions, PlatformSettingEnum, PlatformType, PluginModeEnum, PluginPgkUtil, PluginStaticResource, Postion, PrintFormatEnum, PrintModeEnums, PrintResourceEnum, PrintTypeEnum, ProcessStatusEnum, ProcessTypeEnum, ProgressTypeEnum, ProjectName, ProjectNameType, PropGroup, QuickSearchEnum, REDIRECT_NAME, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetConditionEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SANDBOX_PATH_REG, SCOPE, SCOPEINFO, SEARCH_SERVICE, SHOW_FIELDTYPES, SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH, SINGLE_PATH_REG, STRING_TYPE, STYLE_NAMESPACE_TAG, SUB_TABLE_EDIT_MODE, SUB_TABLE_OPE_EVENT_TYPE, SUB_TABLE_OPE_EVENT_TYPE_INLINE, SYSTEM_FIELD_KEY, SYSTEM_LOGIN_KEYS, SYSTEM_VAR_PREFIX, ScriptTypeEnum, SearchComponents, SelectPickerEnums, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, SignatureStyleEnum, SignatureTypeEnum, SizeEnum, StatisticalMethodEnums, StyleGroup, SystemMqttService, TABLE_CELL_HEIGHT_MODE, TENANT_KEY, TEST_SINGLE_PATH_REG, THEME_COLORS, THEME_COLOR_BLUE, THEME_COLOR_CLASS, THEME_COLOR_CLASS_MAP, THEME_COLOR_TEAL, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, TextMeasureUtil, ThemeEnum, TimezoneOptions, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserRoleReqEnum, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_GLOB_DEFAULT_AVATAR, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkBenchTabEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, approvalObserver, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, calcStylePX, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, createWhiteImageWithText, cssLoader, dataURLtoBlob, deepMerge, deleteAndInsertArr, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, dynamicData, emitFieldSet, fileUrlParser, filterDynFormatTypes, filterTree, findUniqueNode, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getBrowserFingerprint, getDeviceFingerprint, getInterfaceApi, getLoginTypeOptions, getMaxTextWidth, getMinTextWidth, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getSeriesList, getTenant, getToken, getTotalTextWidth, getVueComponentByCode, globalRefSession, globalRefStorage, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, highlightName, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isRdoUniqueField, isSortFiled, list2Tree, measureText, measureTexts, mitt, mobileSearchListByFieldType, modelLoader, normalizeEnv, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parentObserver, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptLoader, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, showDynamicTitle, signLogRegister, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, statusEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, tenantRef, timeReg, transformBindCmp2CmpType, transformUrl, truncateText, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useCopyToClipboard, useDebouncePromise, useIFrameProps, useModal, useNamespace, usePermissionStore, usePlatformConfigStore, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
|
165
|
+
export { AGLINE_ENUMS, APP_DARK_MODE_KEY_, APP_INST, APP_LOCAL_CACHE_KEY, APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, APP_SESSION_CACHE_KEY, ARRAY_TYPE, ASSIGNMENTSTRATEGY_ENUM, AggTypes, AppPublishStateEnum, AuthUtil, BOOLEAN_TYPE, BasicAction, BindCmpStyleEnum, BindCmpStyleTypeEnum, BizServiceEnum, BorderStyle, BpmnNodeTypeEnum, BuiltOperators, BuiltinType, ButtonColorTheme, ButtonColorType, ButtonGroupType, ButtonOpeEnum, ButtonSize, ButtonStyle, ButtonType, ButtonTypeEnum, ButtonTypeGroup, ButtonType_vant, CARD_TRIGGER_ENUM, COLUMNS_TYPE, CURRENCY_ENUM, CURRENCY_LANG_ENUM, CUSTOM_LANGUAGE, CUSTOM_THEME, CacheTypeEnum, CategoryModuleEnum, CategoryTypeEnum, Ch_BindCmpStyleEnum, ContentEnum, ContentTypeEnum, ContextSceneEnum, ContextTxnPageModeEnum, CoreConst, CreateType, CustomAction, DEFAULT_MQTT_INSTANCE_ID, DESIGNER_SESSION_CACHE_KEY, DEV_SINGLE_PATH_REG, DYN_FORMAT_TYPE_ENUM, DataSetReturnTypeEnum, DatasourceTypeEnum, DateRangeEnums, DefaultActions, DefaultDateTypeConst, Dependency_ENUM, DeployModeEnum, DeviceParamsTypeEnum, DictionaryUtil, DisplayEnums, DisplayTagTypeEnum, DisplayType, DynFormatTypes, ENV, EditorRegisterConst, EntityFormulaReturnTypeEnum, EntityModelCategoryEnum, EntityModelTypeEnum, EnvironmentManager, EnvironmentType, ErrorHandler, ErrorStrategyFactory, ErrorTypeEnum, EventCategory, EventsTypeEnum, ExamineAndApproveStateEnum, ExceptionEnum, ExpressionModeEnum, ExpressionTabEnum, FIELD_TYPE, FIELD_TYPE_BASIC, FIELD_TYPE_CATEGORY, FIELD_TYPE_LOGIC, FIELD_TYPE_TRACE, FUNC_KEYS, FUN_BOL_TYPE, FUN_NUM_TYPE, FUN_OBJ_OR_ARR_TYPE, FUN_STR_TYPE, FieldDefaultValueTypeEnum, FieldIconMap, FieldSysVarDefaultValueEnum, FieldTypeToJs, FormComponents, FormContainerType, FormDesignEnum, GENDER_TYPE, GLOBAL_TYPE, GLOBAL_VAR_TYPE, GctGlobal, GctMqttTopsEnum, GlobalParamEnum, GlobalStoreUtil, HOST_REG, INNER_EVENT, IP_REG, IdentifierAddon, KeyMode, KickRuleEnum, KitPkgUtil, LOCALE_KEY, LOCALE_LIST_KEY, LOCAL_I18N_TRANSLATE, LOCK_INFO_KEY, LinkedList, LinkedNode, ListTreeSearchTypeEnum, LocaleUtil, LoginSortTypeEnum, LoginTypeEnum, LogoTypeEnum, MENU_COLLAPSED_WIDTH, MENU_WIDTH_RANGE, MQTT_CLIENT_EVENT, MQTT_DEFAULT_CONNECT_OPTIONS, MULTIPLE_TABS_KEY, MaterialEnum, MenuModeEnum, MenuSplitTyeEnum, MenuType, MenuTypeEnum, MessageType, MixSidebarTriggerEnum, Modal, ModeFnMap, ModeTabDict, ModeTabMap, ModelFieldEnum, ModelTypeEnum, ModelTypeOptions, MqttClient, MqttConnectionStatus, MqttManager, NUMBER_TYPE, Namespace, NodesConfigTypeEnum, OBJECT_TYPE, OTHER_LOGIN_KEYS, OpenMode, OperatorTypeEnum, OpinionTypeEnum, OverlayContainer, OverlayPopoverContainer, PLUGIN_BASE_URL, PROJ_CFG_KEY, PageEnum, PageTypeEnum, PanelEnum, PassRule, PatternEnum, PermissionModeEnum, PersonalCenterType, Platform, PlatformSettingActions, PlatformSettingEnum, PlatformType, PluginModeEnum, PluginPgkUtil, PluginStaticResource, Postion, PrintFormatEnum, PrintModeEnums, PrintResourceEnum, PrintTypeEnum, ProcessStatusEnum, ProcessTypeEnum, ProgressTypeEnum, ProjectName, ProjectNameType, PropGroup, QuickSearchEnum, REDIRECT_NAME, RELATION_FIELDS, RETURN_TYPE_MAP, ROLES_KEY, RdoButtonOpeEnum, RequestEnum, ResetConditionEnum, ResetRuleType, ResultEnum, ReturnTypeEnum, ReturnTypeMaps, RoleEnum, RouterTransitionEnum, RowSelectionTypeEnums, SANDBOX_PATH_REG, SCOPE, SCOPEINFO, SEARCH_SERVICE, SHOW_FIELDTYPES, SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH, SINGLE_PATH_REG, STRING_TYPE, STYLE_NAMESPACE_TAG, SUB_TABLE_EDIT_MODE, SUB_TABLE_OPE_EVENT_TYPE, SUB_TABLE_OPE_EVENT_TYPE_INLINE, SYSTEM_FIELD_KEY, SYSTEM_LOGIN_KEYS, SYSTEM_VAR_PREFIX, ScriptTypeEnum, SearchComponents, SecuritySignMethodEnum, SelectPickerEnums, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, SignatureStyleEnum, SignatureTypeEnum, SizeEnum, StatisticalMethodEnums, StyleGroup, SystemMqttService, TABLE_CELL_HEIGHT_MODE, TENANT_KEY, TEST_SINGLE_PATH_REG, THEME_COLORS, THEME_COLOR_BLUE, THEME_COLOR_CLASS, THEME_COLOR_CLASS_MAP, THEME_COLOR_TEAL, TIMETYPE_ENUM, TIMETYPE_LANG_ENUM, TODO_TYPE, TOKEN_KEY, TableEditingMethodEnum, TableSearchTypeEnum, TableTypeEnum, TagTypeEnum, TextAlign, TextDecoration, TextMeasureUtil, ThemeEnum, TimezoneOptions, ToolkitEnum, TopMenuAlignEnum, TransactionMode, TreeHelper, TriggerEnum, TypeEnum, USER_INFO_KEY, UniqueConstraintType, UploadTypeEnum, Uploader, UserRoleReqEnum, UserServiceType, VERIFICATIONCONDITIONS_TYPE, VITE_GLOB_DEFAULT_AVATAR, VITE_MINIO_PATH, VarTypeEnum, WATERMARK_INIT_DATA, WidgetInScopeEnum, WinMsgTypeEnum, WorkBenchTabEnum, WorkbenchType, afterFieldSet, afterValueSet, allOperator, approvalObserver, biBackFunctionGroup, biBackFunctionMap, bindCmpStyleMap, booleanOperator, booleanTypes, buildItemRules, buildShortUUID, buildUUID, buttonShowType, cacheFnReturn, calcFontStyle, calcStyle, calcStylePX, ch_ProcessStatusMap, computedEx, controlConfigEnum, copyTextToClipboard, createAppVue, createWhiteImageWithText, cssLoader, dataURLtoBlob, deepMerge, deleteAndInsertArr, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, dynamicData, emitFieldSet, fileUrlParser, filterDynFormatTypes, filterTree, findUniqueNode, fixedAlignENUM, functionGroup, functionMap, gctMemoizeAsync, genUrl, getBrowserFingerprint, getDeviceFingerprint, getInterfaceApi, getLoginTypeOptions, getMaxTextWidth, getMinTextWidth, getMobileBrowserFingerprint, getOperatorList, getPageIdentification, getSeriesList, getTenant, getToken, getTotalTextWidth, getVueComponentByCode, globalRefSession, globalRefStorage, hasEmojiAndSpecStr, hasEmojiAndSpecStr1, highlightName, innerVarIds, innerVarList, insertCustomCssToHead, interceptors, ipaasBackFunctionGroup, ipaasBackFunctionMap, isDef, isMobile, isMultipleOperator, isRdoUniqueField, isSortFiled, list2Tree, measureText, measureTexts, mitt, mobileSearchListByFieldType, modelLoader, normalizeEnv, notSingleArr, nullDisplayEnum, numberOperator, numberTypes, openWindow, openWindowEnums, operateSysEnums, operator2FuncMap, padSearchListByFieldType, pageLayoutModeEnum, parentObserver, parseMatrixParams, parseValueUnit, permission, presetColor, randomUUID, returnBolOperator, screenEnum, screenMap, scriptLoader, scriptTypeEnum, searchListByFieldType, selectionTypeEnums, setTenant, setToken, setupApp, setupErrorHandler, setupI18n, sha256, showDynamicTitle, signLogRegister, sizeEnum, sizeParser, sortTypeEnum, statisticalMethodEnum, statusEnum, stringifyMatrixParams, t, tableColumnTypeEnum, tableColumnWidthEnum, tabsTypeENUM, tagEnum, tenantRef, timeReg, transformBindCmp2CmpType, transformUrl, truncateText, typeParser, uploaderFiles, urlReg, urlToBase64, useAppInst, useBasicSetting, useCopyToClipboard, useDebouncePromise, useIFrameProps, useModal, useNamespace, useOrgSetting, usePermissionStore, usePlatformConfigStore, useSecuritySetting, useTenantStore, useUUid, useUserStore, useWuJieBus, useWuJieProps, uuid2, validateEmoji, validateIsModelName, validateModelName, zeroWidthSpace };
|
|
@@ -12,10 +12,10 @@ import { IMqttClient, IMqttConnectOptions, IMqttManager } from './interfaces/i-m
|
|
|
12
12
|
*
|
|
13
13
|
* // 创建一个 MQTT 客户端实例
|
|
14
14
|
* const client = manager.create('device-001', {
|
|
15
|
-
* brokerUrl: 'ws://localhost:8083/mqtt',
|
|
16
15
|
* username: 'admin',
|
|
17
16
|
* password: 'password',
|
|
18
17
|
* });
|
|
18
|
+
* // 默认连接地址随页面协议自动切换:HTTP 使用 ws,HTTPS 使用 wss。
|
|
19
19
|
*
|
|
20
20
|
* // 连接
|
|
21
21
|
* client.connect();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_MQTT_INSTANCE_ID } from "./enums/mqtt-status.enum.mjs";
|
|
2
2
|
import { MqttClient } from "./mqtt-client.mjs";
|
|
3
|
+
import { getMqttBrokerUrl } from "./utils/mqtt-broker-url.util.mjs";
|
|
3
4
|
import { createUUID } from "qx-util";
|
|
4
5
|
//#region src/modules/mqtt/mqtt-manager.ts
|
|
5
6
|
/**
|
|
@@ -15,10 +16,10 @@ import { createUUID } from "qx-util";
|
|
|
15
16
|
*
|
|
16
17
|
* // 创建一个 MQTT 客户端实例
|
|
17
18
|
* const client = manager.create('device-001', {
|
|
18
|
-
* brokerUrl: 'ws://localhost:8083/mqtt',
|
|
19
19
|
* username: 'admin',
|
|
20
20
|
* password: 'password',
|
|
21
21
|
* });
|
|
22
|
+
* // 默认连接地址随页面协议自动切换:HTTP 使用 ws,HTTPS 使用 wss。
|
|
22
23
|
*
|
|
23
24
|
* // 连接
|
|
24
25
|
* client.connect();
|
|
@@ -64,7 +65,7 @@ var MqttManager = class {
|
|
|
64
65
|
console.warn(`MqttManager: 实例 ${instanceId} 已存在,返回已注册的实例`);
|
|
65
66
|
return this._clients.get(instanceId);
|
|
66
67
|
}
|
|
67
|
-
const client = new MqttClient(instanceId,
|
|
68
|
+
const client = new MqttClient(instanceId, getMqttBrokerUrl(location.protocol, location.host), {
|
|
68
69
|
clientId: `gct_mqtt_${_gct.store.userInfo.userId}_${instanceId}_${this.uuid}`,
|
|
69
70
|
...options
|
|
70
71
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/modules/mqtt/utils/mqtt-broker-url.util.ts
|
|
2
|
+
/**
|
|
3
|
+
* 根据页面地址生成 MQTT WebSocket 连接地址。
|
|
4
|
+
*
|
|
5
|
+
* HTTPS 页面必须使用 WSS,避免浏览器因 Mixed Content 拦截 MQTT 连接。
|
|
6
|
+
*/
|
|
7
|
+
function getMqttBrokerUrl(protocol, host) {
|
|
8
|
+
return `${protocol === "https:" ? "wss:" : "ws:"}//${host}/mqtt`;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getMqttBrokerUrl };
|
|
@@ -13,5 +13,10 @@ var KickRuleEnum = /* @__PURE__ */ function(KickRuleEnum) {
|
|
|
13
13
|
KickRuleEnum["DIFFERENT_END"] = "DIFFERENT_END";
|
|
14
14
|
return KickRuleEnum;
|
|
15
15
|
}({});
|
|
16
|
+
var SecuritySignMethodEnum = /* @__PURE__ */ function(SecuritySignMethodEnum) {
|
|
17
|
+
SecuritySignMethodEnum["PASSWORD"] = "PASSWORD";
|
|
18
|
+
SecuritySignMethodEnum["CARD"] = "CARD";
|
|
19
|
+
return SecuritySignMethodEnum;
|
|
20
|
+
}({});
|
|
16
21
|
//#endregion
|
|
17
|
-
export { KickRuleEnum, PassRule };
|
|
22
|
+
export { KickRuleEnum, PassRule, SecuritySignMethodEnum };
|
|
@@ -6,3 +6,6 @@ export * from './enums/index';
|
|
|
6
6
|
export * from './interfaces/index';
|
|
7
7
|
export * from './constants/index';
|
|
8
8
|
export { usePlatformConfigStore, type IPlatformConfigStore } from './store';
|
|
9
|
+
export { useBasicSetting } from './useBasicSetting';
|
|
10
|
+
export { useOrgSetting } from './useOrgSetting';
|
|
11
|
+
export { useSecuritySetting } from './useSecuritySetting';
|
|
@@ -6,4 +6,7 @@ import "./constants/org.const.mjs";
|
|
|
6
6
|
import "./constants/theme.const.mjs";
|
|
7
7
|
import "./constants/watermark.const.mjs";
|
|
8
8
|
import "./constants/index.mjs";
|
|
9
|
+
import "./useBasicSetting.mjs";
|
|
10
|
+
import "./useOrgSetting.mjs";
|
|
11
|
+
import "./useSecuritySetting.mjs";
|
|
9
12
|
import "./store.mjs";
|
|
@@ -46,6 +46,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
46
46
|
value: string;
|
|
47
47
|
}[]>;
|
|
48
48
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
49
|
+
isSupportCardSign: () => boolean | undefined;
|
|
49
50
|
postSecuritySetting: () => Promise<void>;
|
|
50
51
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
51
52
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -119,6 +120,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
119
120
|
value: string;
|
|
120
121
|
}[]>;
|
|
121
122
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
123
|
+
isSupportCardSign: () => boolean | undefined;
|
|
122
124
|
postSecuritySetting: () => Promise<void>;
|
|
123
125
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
124
126
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -192,6 +194,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
192
194
|
value: string;
|
|
193
195
|
}[]>;
|
|
194
196
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
197
|
+
isSupportCardSign: () => boolean | undefined;
|
|
195
198
|
postSecuritySetting: () => Promise<void>;
|
|
196
199
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
197
200
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -221,5 +224,5 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
221
224
|
setProjectConfig: (config: {}) => void;
|
|
222
225
|
init: () => Promise<void>;
|
|
223
226
|
renderInit: () => Promise<void>;
|
|
224
|
-
}, "getSignWay" | "init" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
|
|
227
|
+
}, "getSignWay" | "init" | "isSupportCardSign" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
|
|
225
228
|
export type IPlatformConfigStore = ReturnType<typeof usePlatformConfigStore>;
|
|
@@ -6,6 +6,7 @@ import { SecurityConfig } from '@gct-paas/api/platform';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function useSecuritySetting(isPlatform?: boolean): {
|
|
8
8
|
securitySetting: SecurityConfig;
|
|
9
|
+
isSupportCardSign: () => boolean | undefined;
|
|
9
10
|
postSecuritySetting: () => Promise<void>;
|
|
10
11
|
setSecuritySetting: (data: IObject | undefined) => void;
|
|
11
12
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SecuritySignMethodEnum } from "./enums/platform.enum.mjs";
|
|
1
2
|
import { reactive } from "vue";
|
|
2
3
|
//#region src/modules/platform-config/useSecuritySetting.ts
|
|
3
4
|
/**
|
|
@@ -30,6 +31,7 @@ var securitySetting = reactive({
|
|
|
30
31
|
repeatNum: 1,
|
|
31
32
|
timeUnit: "DAYS",
|
|
32
33
|
signTimeUnit: "DAYS",
|
|
34
|
+
signMethod: SecuritySignMethodEnum.PASSWORD,
|
|
33
35
|
noOpRetainHour: 8,
|
|
34
36
|
noOpRetainMinute: 0,
|
|
35
37
|
earlyAlarmMinute: 5,
|
|
@@ -73,8 +75,17 @@ function useSecuritySetting(isPlatform = true) {
|
|
|
73
75
|
default: return "LOGIN";
|
|
74
76
|
}
|
|
75
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* 是否支持刷卡签名
|
|
80
|
+
* @returns boolean
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
function isSupportCardSign() {
|
|
84
|
+
return securitySetting.signMethod?.includes(SecuritySignMethodEnum.CARD);
|
|
85
|
+
}
|
|
76
86
|
return {
|
|
77
87
|
securitySetting,
|
|
88
|
+
isSupportCardSign,
|
|
78
89
|
postSecuritySetting,
|
|
79
90
|
setSecuritySetting,
|
|
80
91
|
getSignWay
|
|
@@ -62,7 +62,7 @@ export declare class SystemMqttService {
|
|
|
62
62
|
* @static
|
|
63
63
|
* @param {string} topic
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
static subscribe<T = IObject>(topic: string, callback: MqttSubCallback<T>): MqttCancelSub;
|
|
66
66
|
/**
|
|
67
67
|
* 订阅用户被踢出消息
|
|
68
68
|
*
|
|
@@ -23,6 +23,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
23
23
|
gender?: number | undefined;
|
|
24
24
|
globalSuperAdmin?: number | undefined;
|
|
25
25
|
ip?: string | undefined;
|
|
26
|
+
kickOut?: boolean | undefined;
|
|
26
27
|
match?: boolean | undefined;
|
|
27
28
|
minioDomain?: string | undefined;
|
|
28
29
|
mobile?: string | undefined;
|
|
@@ -95,6 +96,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
95
96
|
gender?: number | undefined;
|
|
96
97
|
globalSuperAdmin?: number | undefined;
|
|
97
98
|
ip?: string | undefined;
|
|
99
|
+
kickOut?: boolean | undefined;
|
|
98
100
|
match?: boolean | undefined;
|
|
99
101
|
minioDomain?: string | undefined;
|
|
100
102
|
mobile?: string | undefined;
|
|
@@ -164,6 +166,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
164
166
|
gender?: number | undefined;
|
|
165
167
|
globalSuperAdmin?: number | undefined;
|
|
166
168
|
ip?: string | undefined;
|
|
169
|
+
kickOut?: boolean | undefined;
|
|
167
170
|
match?: boolean | undefined;
|
|
168
171
|
minioDomain?: string | undefined;
|
|
169
172
|
mobile?: string | undefined;
|
|
@@ -239,6 +242,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
239
242
|
gender?: number | undefined;
|
|
240
243
|
globalSuperAdmin?: number | undefined;
|
|
241
244
|
ip?: string | undefined;
|
|
245
|
+
kickOut?: boolean | undefined;
|
|
242
246
|
match?: boolean | undefined;
|
|
243
247
|
minioDomain?: string | undefined;
|
|
244
248
|
mobile?: string | undefined;
|
package/es/setup-app.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import "./modules/platform-config/index.mjs";
|
|
|
5
5
|
import { registerCoreLocale } from "./locale/auto-register.mjs";
|
|
6
6
|
import { HttpUtil } from "@gct-paas/api";
|
|
7
7
|
//#region src/setup-app.ts
|
|
8
|
+
var setupAppKey = Symbol.for("@gct-paas/core/setupApp");
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
10
11
|
*
|
|
@@ -12,6 +13,11 @@ import { HttpUtil } from "@gct-paas/api";
|
|
|
12
13
|
* @param {App} app
|
|
13
14
|
*/
|
|
14
15
|
async function setupApp(_app) {
|
|
16
|
+
if (Reflect.get(window, setupAppKey)) {
|
|
17
|
+
console.error("@gct-paas/core setupApp 已执行,请勿重复调用。");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
Reflect.set(window, setupAppKey, true);
|
|
15
21
|
HttpUtil.use(interceptors);
|
|
16
22
|
await _gct.init();
|
|
17
23
|
registerCoreLocale();
|
package/es/types/index.d.ts
CHANGED
|
@@ -4,23 +4,10 @@ import 'systemjs';
|
|
|
4
4
|
import 'vite/types/importMeta.d.ts';
|
|
5
5
|
import type { Composer } from 'vue-i18n';
|
|
6
6
|
import type { GctGlobal } from '../global';
|
|
7
|
-
import type {
|
|
8
|
-
import type { ApiManage as PlatformApiManage } from '@gct-paas/api/platform';
|
|
7
|
+
import type { ApiMap } from '@gct-paas/api';
|
|
9
8
|
import type { bus } from 'wujie';
|
|
10
9
|
// import type { ModuleFederation } from '@module-federation/runtime';
|
|
11
10
|
|
|
12
|
-
/**
|
|
13
|
-
* 全局 api 对象
|
|
14
|
-
*
|
|
15
|
-
* @author chitanda
|
|
16
|
-
* @date 2025-08-21 11:08:40
|
|
17
|
-
* @interface GlobalApi
|
|
18
|
-
*/
|
|
19
|
-
interface GlobalApi {
|
|
20
|
-
apaas: APaasApiManage;
|
|
21
|
-
platform: PlatformApiManage;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
11
|
declare global {
|
|
25
12
|
/**
|
|
26
13
|
* paas 平台全局对象
|
|
@@ -29,7 +16,7 @@ declare global {
|
|
|
29
16
|
/**
|
|
30
17
|
* paas 平台 API 管理
|
|
31
18
|
*/
|
|
32
|
-
const _api:
|
|
19
|
+
const _api: ApiMap;
|
|
33
20
|
/**
|
|
34
21
|
* 模块联邦运行时对象
|
|
35
22
|
*/
|
|
@@ -47,9 +34,9 @@ declare global {
|
|
|
47
34
|
*
|
|
48
35
|
* @author chitanda
|
|
49
36
|
* @date 2025-08-21 11:08:30
|
|
50
|
-
* @type {
|
|
37
|
+
* @type {ApiMap}
|
|
51
38
|
*/
|
|
52
|
-
_api:
|
|
39
|
+
_api: ApiMap;
|
|
53
40
|
/**
|
|
54
41
|
* 多语言转换函数
|
|
55
42
|
*
|