@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.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/dist/index.esm.min.mjs +4456 -18521
- package/dist/index.min.cjs +14 -2
- package/dist/index.system.min.js +14 -2
- package/es/constants/core.mjs +0 -1
- package/es/constants/editor-register/editor-register.mjs +0 -1
- package/es/constants/editor-type/editor-type.d.ts +65 -1
- package/es/constants/editor-type/editor-type.mjs +14 -1
- package/es/constants/form-container-type/form-container-type.mjs +0 -1
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.mjs +2 -7
- package/es/controller/edit-form/edit-form.controller.mjs +0 -1
- package/es/controller/editor/color-editor.controller.mjs +0 -1
- package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
- package/es/controller/editor-item/editor-item.controller.mjs +0 -1
- package/es/controller/form/form.controller.mjs +5 -4
- package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
- package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
- package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
- package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
- package/es/controller/form-group/form-group.controller.mjs +4 -3
- package/es/controller/form-item/form-item.controller.d.ts +1 -0
- package/es/controller/form-item/form-item.controller.mjs +7 -3
- package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
- package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
- package/es/controller/form-tab/form-tab.controller.mjs +4 -3
- package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
- package/es/controller/gct-form/gct-form.controller.mjs +5 -4
- package/es/create-app-vue.mjs +4 -3
- package/es/enums/app-designer/index.d.ts +13 -1
- package/es/enums/app-designer/index.mjs +8 -2
- package/es/enums/appEnum.d.ts +17 -66
- package/es/enums/appEnum.mjs +18 -14
- package/es/enums/appStateEnum.mjs +0 -1
- package/es/enums/authActionEnum.mjs +0 -1
- package/es/enums/breakpointEnum.mjs +0 -1
- package/es/enums/cacheEnum.mjs +0 -1
- package/es/enums/designEnum.mjs +0 -1
- package/es/enums/exceptionEnum.mjs +0 -1
- package/es/enums/globalEnum.d.ts +38 -0
- package/es/enums/globalEnum.mjs +25 -0
- package/es/enums/httpEnum.mjs +0 -1
- package/es/enums/index.d.ts +13 -0
- package/es/enums/index.mjs +15 -16
- package/es/enums/menuEnum.mjs +0 -1
- package/es/enums/page-designer/designer.d.ts +17 -3
- package/es/enums/page-designer/designer.mjs +85 -6
- package/es/enums/page-designer/panel.mjs +0 -1
- package/es/enums/page-designer/toolkit.mjs +0 -1
- package/es/enums/page-designer/widget.d.ts +2 -1
- package/es/enums/page-designer/widget.mjs +3 -3
- package/es/enums/pageEnum.mjs +0 -1
- package/es/enums/plugin-enum.mjs +0 -1
- package/es/enums/processEnum.mjs +0 -1
- package/es/enums/roleEnum.mjs +0 -1
- package/es/enums/sizeEnum.mjs +0 -1
- package/es/global/gct/gct.d.ts +2 -15
- package/es/global/gct/gct.mjs +19 -17
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
- package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
- package/es/hooks/use-form/use-form.mjs +0 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
- package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
- package/es/hooks/use-modal/use-modal.mjs +0 -1
- package/es/hooks/use-namespace/use-namespace.mjs +11 -2
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
- package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
- package/es/hooks/useCopyToClipboard.mjs +0 -1
- package/es/index.d.ts +5 -1
- package/es/index.mjs +77 -58
- package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
- package/es/interface/controller/index.d.ts +0 -1
- package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
- package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
- package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
- package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
- package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
- package/es/interface/form/index.d.ts +1 -0
- package/es/interface/i-app-context/i-app-context.d.ts +34 -0
- package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
- package/es/interface/i-global-var/i-global-var.d.ts +15 -0
- package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
- package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
- package/es/interface/index.d.ts +5 -2
- package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
- package/es/interface/state/index.d.ts +0 -1
- package/es/locale/index.mjs +1 -2
- package/es/modules/env-manager/env-manager.const.mjs +0 -1
- package/es/modules/env-manager/env-manager.interface.mjs +0 -1
- package/es/modules/env-manager/env-manager.mjs +7 -8
- package/es/modules/error-handler/error-handler.const.mjs +1 -30
- package/es/modules/error-handler/error-strategy.mjs +0 -1
- package/es/modules/error-handler/index.mjs +0 -1
- package/es/modules/platform-config/constants/index.d.ts +7 -0
- package/es/modules/platform-config/constants/login.const.d.ts +15 -0
- package/es/modules/platform-config/constants/login.const.mjs +50 -0
- package/es/modules/platform-config/constants/org.const.d.ts +9 -0
- package/es/modules/platform-config/constants/org.const.mjs +54 -0
- package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
- package/es/modules/platform-config/constants/theme.const.mjs +5 -0
- package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
- package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
- package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
- package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
- package/es/modules/platform-config/enums/index.d.ts +6 -0
- package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
- package/es/modules/platform-config/enums/login.enum.mjs +16 -0
- package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
- package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
- package/es/modules/platform-config/index.d.ts +6 -17
- package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
- package/es/modules/platform-config/interfaces/index.d.ts +7 -0
- package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
- package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
- package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
- package/es/modules/platform-config/store.d.ts +221 -0
- package/es/modules/platform-config/store.mjs +78 -0
- package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
- package/es/modules/platform-config/useBasicSetting.mjs +39 -0
- package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
- package/es/modules/platform-config/useDeploySetting.mjs +27 -0
- package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
- package/es/modules/platform-config/useLoginSetting.mjs +177 -0
- package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
- package/es/modules/platform-config/useOrgSetting.mjs +66 -0
- package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
- package/es/modules/platform-config/useProjectSetting.mjs +11 -0
- package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
- package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
- package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
- package/es/modules/platform-config/useThemeSetting.mjs +64 -0
- package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
- package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
- package/es/modules/user-stores/index.d.ts +3 -0
- package/es/modules/user-stores/store/permission.store.d.ts +21 -0
- package/es/modules/user-stores/store/permission.store.mjs +38 -0
- package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
- package/es/modules/user-stores/store/tenant.store.mjs +24 -0
- package/es/modules/user-stores/store/user.store.d.ts +154 -0
- package/es/modules/user-stores/store/user.store.mjs +100 -0
- package/es/modules/user-stores/types/permission.d.ts +1 -0
- package/es/modules/user-stores/types/tenant.d.ts +1 -0
- package/es/modules/user-stores/types/user.d.ts +14 -0
- package/es/register/editor-register/editor-register.d.ts +5 -13
- package/es/register/editor-register/editor-register.mjs +8 -17
- package/es/register/form-item-register/form-item-register.d.ts +4 -15
- package/es/register/form-item-register/form-item-register.mjs +7 -17
- package/es/register/index.d.ts +18 -1
- package/es/register/render-register/render-register.mjs +0 -1
- package/es/router/index.mjs +0 -1
- package/es/state/form/form.state.mjs +0 -1
- package/es/state/form-collapse/form-collapse.state.mjs +0 -1
- package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
- package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
- package/es/state/form-group/form-group.state.mjs +0 -1
- package/es/state/form-item/form-item.state.mjs +0 -1
- package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
- package/es/state/form-tab/form-tab.state.mjs +0 -1
- package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
- package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
- package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
- package/es/store/global-store.d.ts +1 -0
- package/es/store/global-store.mjs +34 -37
- package/es/store/index.d.ts +2 -3
- package/es/store/index.mjs +0 -1
- package/es/types/index.d.ts +14 -1
- package/es/utils/axios/interceptors.mjs +3 -23
- package/es/utils/deviceFingerprint.d.ts +17 -0
- package/es/utils/deviceFingerprint.mjs +73 -0
- package/es/utils/dictionary/dictionary.mjs +0 -1
- package/es/utils/i18n/index.d.ts +2 -1
- package/es/utils/i18n/index.mjs +3 -4
- package/es/utils/index.d.ts +11 -2
- package/es/utils/linked-list/linked-list.d.ts +72 -0
- package/es/utils/linked-list/linked-list.mjs +119 -0
- package/es/utils/linked-node/linked-node.d.ts +31 -0
- package/es/utils/linked-node/linked-node.mjs +32 -0
- package/es/utils/mitt/mitt.d.ts +1 -0
- package/es/utils/mitt/mitt.mjs +5 -0
- package/es/utils/model-loader/model-loader.d.ts +118 -0
- package/es/utils/model-loader/model-loader.mjs +326 -0
- package/es/utils/namespace/namespace.mjs +0 -1
- package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
- package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
- package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
- package/es/utils/props/index.d.ts +1 -0
- package/es/utils/style/index.d.ts +16 -0
- package/es/utils/style/index.mjs +141 -0
- package/es/utils/tools/tools.d.ts +13 -10
- package/es/utils/tools/tools.mjs +19 -11
- package/es/utils/treeHelper/treeHelper.d.ts +117 -0
- package/es/utils/treeHelper/treeHelper.mjs +220 -0
- package/es/utils/util.d.ts +39 -0
- package/es/utils/util.mjs +40 -0
- package/es/utils/value-helper/value-helper.d.ts +49 -0
- package/es/utils/value-helper/value-helper.mjs +109 -0
- package/es/utils/width-install/width-install.mjs +0 -2
- package/package.json +12 -16
- package/es/controller/index.mjs +0 -17
- package/es/enums/page-designer/index.mjs +0 -6
- package/es/global/index.mjs +0 -3
- package/es/hooks/index.mjs +0 -7
- package/es/interface/controller/i-designer-controller.d.ts +0 -116
- package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
- package/es/interface/hooks/index.d.ts +0 -1
- package/es/interface/index.mjs +0 -1
- package/es/interface/low-code-types/index.d.ts +0 -4
- package/es/interface/low-code-types/modal-types.d.ts +0 -67
- package/es/interface/low-code-types/model/index.d.ts +0 -5338
- package/es/interface/low-code-types/schema/index.d.ts +0 -12
- package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
- package/es/interface/state/i-designer-state.d.ts +0 -27
- package/es/modules/env-manager/index.mjs +0 -5
- package/es/modules/platform-config/index.mjs +0 -17
- package/es/modules/platform-config/types.d.ts +0 -67
- package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
- package/es/provider/index.d.ts +0 -1
- package/es/provider/index.mjs +0 -1
- package/es/register/designer-register/designer-register.d.ts +0 -53
- package/es/register/designer-register/designer-register.mjs +0 -68
- package/es/register/index.mjs +0 -6
- package/es/state/index.mjs +0 -12
- package/es/utils/index.mjs +0 -10
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { reactive, ref } from 'vue';
|
|
2
|
+
import { RELATION_FIELDS } from './constants/org.const.mjs';
|
|
3
|
+
|
|
4
|
+
const orgSetting = reactive({
|
|
5
|
+
initialPassword: "123456",
|
|
6
|
+
initialSignPassword: "12345678",
|
|
7
|
+
enableIdentifier: 1,
|
|
8
|
+
enableDeleteAccount: 1,
|
|
9
|
+
enableDeleteUser: 0,
|
|
10
|
+
requiredFields: [],
|
|
11
|
+
// supportLoginFields: ['username_', 'emp_no_'],
|
|
12
|
+
supportLoginFields: ["username_"],
|
|
13
|
+
extFieldConfigs: [],
|
|
14
|
+
orgExtFieldConfigs: []
|
|
15
|
+
});
|
|
16
|
+
const relationFields = ref([...RELATION_FIELDS]);
|
|
17
|
+
const relationFiledsCopy = ref([]);
|
|
18
|
+
function useOrgSetting(isPlatform = true) {
|
|
19
|
+
const postOrgSetting = async () => {
|
|
20
|
+
const setting = JSON.parse(JSON.stringify(orgSetting));
|
|
21
|
+
if (isPlatform) {
|
|
22
|
+
await _api.platform.plat.postOrg(setting);
|
|
23
|
+
} else {
|
|
24
|
+
await _api.apaas.plat.postOrg(setting);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function setOrgSetting(data) {
|
|
28
|
+
const { value } = data;
|
|
29
|
+
if (!value) return;
|
|
30
|
+
try {
|
|
31
|
+
const setting = JSON.parse(value);
|
|
32
|
+
for (const key in setting) {
|
|
33
|
+
if (key == "supportLoginFields") {
|
|
34
|
+
setting["supportLoginFields"] = setting["supportLoginFields"].filter(
|
|
35
|
+
(i) => i !== "username_"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
Object.assign(orgSetting, setting);
|
|
40
|
+
if (orgSetting.extFieldConfigs && orgSetting.extFieldConfigs.length) {
|
|
41
|
+
orgSetting.extFieldConfigs.forEach((element) => {
|
|
42
|
+
relationFields.value = relationFields.value.filter((i) => {
|
|
43
|
+
if (i.value == element.relationField) {
|
|
44
|
+
relationFiledsCopy.value.push(i);
|
|
45
|
+
}
|
|
46
|
+
return i.value !== element.relationField;
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
orgSetting.extFieldConfigs = JSON.parse(
|
|
51
|
+
JSON.stringify(setting.extFieldConfigs)
|
|
52
|
+
);
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.warn(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
orgSetting,
|
|
59
|
+
setOrgSetting,
|
|
60
|
+
postOrgSetting,
|
|
61
|
+
relationFields,
|
|
62
|
+
relationFiledsCopy
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { useOrgSetting };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 部署设置 Composable
|
|
3
|
+
* 用于管理应用的部署模式配置
|
|
4
|
+
*/
|
|
5
|
+
/** 基础配置信息响应式对象 */
|
|
6
|
+
declare const projectSetting: {};
|
|
7
|
+
declare function setProjectConfig(config: typeof projectSetting): void;
|
|
8
|
+
export declare function useProjectSetting(): {
|
|
9
|
+
projectSetting: {};
|
|
10
|
+
setProjectConfig: typeof setProjectConfig;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
|
|
3
|
+
const projectSetting = reactive({});
|
|
4
|
+
function setProjectConfig(config) {
|
|
5
|
+
Object.assign(projectSetting, config);
|
|
6
|
+
}
|
|
7
|
+
function useProjectSetting() {
|
|
8
|
+
return { projectSetting, setProjectConfig };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useProjectSetting };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { SecurityConfig, SysConfigResponse } from '@gct-paas/api/platform';
|
|
2
|
+
/**
|
|
3
|
+
* 安全设置 Composable 函数
|
|
4
|
+
* @param isPlatform - 是否为平台模式,默认为 true
|
|
5
|
+
* @returns 返回安全设置相关的响应式数据和方法
|
|
6
|
+
*/
|
|
2
7
|
export declare function useSecuritySetting(isPlatform?: boolean): {
|
|
3
8
|
securitySetting: SecurityConfig;
|
|
4
9
|
postSecuritySetting: () => Promise<void>;
|
|
5
|
-
loadSecuritySetting: () => Promise<void>;
|
|
6
10
|
setSecuritySetting: (data: SysConfigResponse) => void;
|
|
7
11
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
|
|
3
|
+
const securitySetting = reactive({
|
|
4
|
+
durationHour: 2,
|
|
5
|
+
durationMinute: 0,
|
|
6
|
+
enableChangePassword: 1,
|
|
7
|
+
enableChangeSignPassword: 0,
|
|
8
|
+
enableSignPassword: 0,
|
|
9
|
+
enableKickOut: 1,
|
|
10
|
+
enablePassphrase: 1,
|
|
11
|
+
signEnablePassphrase: 1,
|
|
12
|
+
enableLockAccount: 1,
|
|
13
|
+
expiryDate: 30,
|
|
14
|
+
signExpiryDate: 30,
|
|
15
|
+
firstTimeChangePassword: 0,
|
|
16
|
+
signFirstTimeChangePassword: 0,
|
|
17
|
+
lockTimeout: 0,
|
|
18
|
+
loginKickOutMode: "SAME_END",
|
|
19
|
+
maxErrorTimes: 2,
|
|
20
|
+
passMinLength: 6,
|
|
21
|
+
signPassMinLength: 6,
|
|
22
|
+
passRule: ["NUMBER"],
|
|
23
|
+
signPassRule: ["NUMBER"],
|
|
24
|
+
signRepeatNum: 1,
|
|
25
|
+
repeatNum: 1,
|
|
26
|
+
timeUnit: "DAYS",
|
|
27
|
+
signTimeUnit: "DAYS",
|
|
28
|
+
noOpRetainHour: 8,
|
|
29
|
+
noOpRetainMinute: 0,
|
|
30
|
+
earlyAlarmMinute: 5,
|
|
31
|
+
earlyAlarmSecond: 0,
|
|
32
|
+
inapplicablePerson: [],
|
|
33
|
+
lockHourTimeout: 0,
|
|
34
|
+
lockMinTimeout: 5
|
|
35
|
+
});
|
|
36
|
+
function useSecuritySetting(isPlatform = true) {
|
|
37
|
+
const postSecuritySetting = async () => {
|
|
38
|
+
if (isPlatform) {
|
|
39
|
+
await _api.platform.plat.postSecurity(securitySetting);
|
|
40
|
+
} else {
|
|
41
|
+
await _api.apaas.plat.postSecurity(securitySetting);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function setSecuritySetting(data) {
|
|
45
|
+
const { value } = data;
|
|
46
|
+
if (!value) return;
|
|
47
|
+
try {
|
|
48
|
+
Object.assign(securitySetting, JSON.parse(value));
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.warn(err);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
securitySetting,
|
|
55
|
+
postSecuritySetting,
|
|
56
|
+
setSecuritySetting
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { useSecuritySetting };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IThemeSetting } from './interfaces/theme-setting.interface';
|
|
2
2
|
import { SysConfigResponse } from '@gct-paas/api/platform';
|
|
3
|
+
/**
|
|
4
|
+
* 主题设置 Composable 函数
|
|
5
|
+
* @returns 返回主题设置相关的响应式数据和方法
|
|
6
|
+
*/
|
|
3
7
|
export declare function useThemeSetting(): {
|
|
4
|
-
themeSetting:
|
|
5
|
-
loadThemeSetting: () => Promise<void>;
|
|
8
|
+
themeSetting: IThemeSetting;
|
|
6
9
|
setThemeSetting: (data: SysConfigResponse) => void;
|
|
7
10
|
postThemeSetting: () => Promise<void>;
|
|
8
11
|
menuCollapsed: import('vue').Ref<boolean, boolean>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { reactive, ref, watch } from 'vue';
|
|
2
|
+
import { THEME_COLORS, MENU_WIDTH_RANGE, MENU_COLLAPSED_WIDTH } from './constants/theme.const.mjs';
|
|
3
|
+
|
|
4
|
+
const themeSetting = reactive({
|
|
5
|
+
darkMode: "light",
|
|
6
|
+
themeColor: "#026AC8",
|
|
7
|
+
// menuMode: 'mix-sider',
|
|
8
|
+
menuMode: "classic",
|
|
9
|
+
menuWidth: 232,
|
|
10
|
+
menuCollapsible: true,
|
|
11
|
+
menuSearchable: true,
|
|
12
|
+
menuFilter: false,
|
|
13
|
+
showLogo: true,
|
|
14
|
+
showBreadcrumb: false,
|
|
15
|
+
showBreadcrumbIcon: false,
|
|
16
|
+
showTabs: true,
|
|
17
|
+
pageProgress: true,
|
|
18
|
+
pageLoading: true,
|
|
19
|
+
colorMode: "normal"
|
|
20
|
+
});
|
|
21
|
+
const menuCollapsed = ref(false);
|
|
22
|
+
const menuCollapsedWidth = MENU_COLLAPSED_WIDTH;
|
|
23
|
+
const menuWidthRange = MENU_WIDTH_RANGE;
|
|
24
|
+
const themeColors = THEME_COLORS;
|
|
25
|
+
const toggleColorMode = () => {
|
|
26
|
+
switch (themeSetting.colorMode) {
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
watch(
|
|
30
|
+
() => themeSetting.colorMode,
|
|
31
|
+
(value) => {
|
|
32
|
+
if (value) {
|
|
33
|
+
toggleColorMode();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
function useThemeSetting() {
|
|
38
|
+
const postThemeSetting = async () => {
|
|
39
|
+
};
|
|
40
|
+
function setThemeSetting(data) {
|
|
41
|
+
const { value } = data;
|
|
42
|
+
if (!value) return;
|
|
43
|
+
try {
|
|
44
|
+
Object.assign(themeSetting, JSON.parse(value));
|
|
45
|
+
} catch (err) {
|
|
46
|
+
console.warn(err);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function toggleMenuCollapsed() {
|
|
50
|
+
menuCollapsed.value = !menuCollapsed.value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
themeSetting,
|
|
54
|
+
setThemeSetting,
|
|
55
|
+
postThemeSetting,
|
|
56
|
+
menuCollapsed,
|
|
57
|
+
toggleMenuCollapsed,
|
|
58
|
+
menuCollapsedWidth,
|
|
59
|
+
menuWidthRange,
|
|
60
|
+
themeColors
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { useThemeSetting };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SysConfigResponse } from '@gct-paas/api/platform';
|
|
2
|
+
/**
|
|
3
|
+
* 水印设置 Composable 函数
|
|
4
|
+
* @returns 返回水印设置相关的响应式数据和方法
|
|
5
|
+
*/
|
|
2
6
|
export declare function useWatermarkSetting(): {
|
|
3
7
|
watermarkSetting: {
|
|
4
8
|
openWatermark: boolean;
|
|
@@ -12,7 +16,6 @@ export declare function useWatermarkSetting(): {
|
|
|
12
16
|
width: number;
|
|
13
17
|
height: number;
|
|
14
18
|
};
|
|
15
|
-
loadWatermarkSetting: () => Promise<void>;
|
|
16
19
|
postWatermarkSetting: () => Promise<void>;
|
|
17
20
|
setWatermarkSetting: (data: SysConfigResponse) => void;
|
|
18
21
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
import { WATERMARK_INIT_DATA } from './constants/watermark.const.mjs';
|
|
3
|
+
|
|
4
|
+
const watermarkSetting = reactive({ ...WATERMARK_INIT_DATA });
|
|
5
|
+
function useWatermarkSetting() {
|
|
6
|
+
const postWatermarkSetting = async () => {
|
|
7
|
+
const value = JSON.stringify(watermarkSetting);
|
|
8
|
+
await _api.platform.plat.postWatermark({ value });
|
|
9
|
+
};
|
|
10
|
+
function setWatermarkSetting(data) {
|
|
11
|
+
const { value } = data;
|
|
12
|
+
if (!value) return;
|
|
13
|
+
try {
|
|
14
|
+
Object.assign(watermarkSetting, JSON.parse(value));
|
|
15
|
+
} catch (err) {
|
|
16
|
+
console.warn(err);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
watermarkSetting,
|
|
21
|
+
postWatermarkSetting,
|
|
22
|
+
setWatermarkSetting
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useWatermarkSetting };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const usePermissionStore: import('pinia').StoreDefinition<"permission", {
|
|
2
|
+
userPermissions: {
|
|
3
|
+
appSuperAdmin: number;
|
|
4
|
+
permissions: IObject;
|
|
5
|
+
};
|
|
6
|
+
}, {
|
|
7
|
+
hasAllPermissions(state: {
|
|
8
|
+
userPermissions: {
|
|
9
|
+
appSuperAdmin: number;
|
|
10
|
+
permissions: IObject;
|
|
11
|
+
};
|
|
12
|
+
} & import('pinia').PiniaCustomStateProperties<{
|
|
13
|
+
userPermissions: {
|
|
14
|
+
appSuperAdmin: number;
|
|
15
|
+
permissions: IObject;
|
|
16
|
+
};
|
|
17
|
+
}>): boolean;
|
|
18
|
+
}, {
|
|
19
|
+
getPermissionByKey(pageId: string, key?: string): boolean;
|
|
20
|
+
initPermission(): Promise<void>;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const usePermissionStore = defineStore("permission", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
//当前应用中用户的权限
|
|
6
|
+
userPermissions: {
|
|
7
|
+
appSuperAdmin: 0,
|
|
8
|
+
permissions: {}
|
|
9
|
+
}
|
|
10
|
+
}),
|
|
11
|
+
getters: {
|
|
12
|
+
hasAllPermissions(state) {
|
|
13
|
+
return !!state.userPermissions.appSuperAdmin || !!state.userPermissions.permissions["POINT.*"];
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
actions: {
|
|
17
|
+
getPermissionByKey(pageId, key) {
|
|
18
|
+
if (this.hasAllPermissions) return true;
|
|
19
|
+
if (!key) {
|
|
20
|
+
return this.userPermissions.permissions[pageId];
|
|
21
|
+
}
|
|
22
|
+
const uKey = `${pageId}.${key}`;
|
|
23
|
+
const pageKey = `${pageId}.*`;
|
|
24
|
+
return this.userPermissions.permissions[uKey] || this.userPermissions.permissions[pageKey];
|
|
25
|
+
},
|
|
26
|
+
async initPermission() {
|
|
27
|
+
const res = await _api.apaas.designerCommon.getUserInfo();
|
|
28
|
+
Object.assign(this.userPermissions, {
|
|
29
|
+
...res,
|
|
30
|
+
permissions: Object.fromEntries(
|
|
31
|
+
(res?.permissions ?? []).map((key) => [key, true])
|
|
32
|
+
)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { usePermissionStore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UserOfTenantDTO } from '@gct-paas/api/platform';
|
|
2
|
+
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", {
|
|
3
|
+
tenantId: string;
|
|
4
|
+
tenantUserInfo: {};
|
|
5
|
+
tenantUserPermissions: {};
|
|
6
|
+
}, {}, {
|
|
7
|
+
setTenant(tenantId: string): void;
|
|
8
|
+
getTenantUserInfoAction(): Promise<UserOfTenantDTO | undefined>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const useTenantStore = defineStore("tenant", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
//selected tenant Id
|
|
6
|
+
tenantId: "",
|
|
7
|
+
// 当前租户中的用户信息
|
|
8
|
+
tenantUserInfo: {},
|
|
9
|
+
tenantUserPermissions: {}
|
|
10
|
+
}),
|
|
11
|
+
actions: {
|
|
12
|
+
setTenant(tenantId) {
|
|
13
|
+
this.tenantId = tenantId;
|
|
14
|
+
},
|
|
15
|
+
async getTenantUserInfoAction() {
|
|
16
|
+
if (!this.tenantId) return;
|
|
17
|
+
const info = await _api.platform.tenant.getUserInfo();
|
|
18
|
+
this.tenantUserInfo = info;
|
|
19
|
+
return info;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { useTenantStore };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { LoginParams, UserState } from '../types/user';
|
|
2
|
+
import { UserLoginResp } from '@gct-paas/api/platform';
|
|
3
|
+
export declare const useUserStore: import('pinia').StoreDefinition<"user", UserState, {
|
|
4
|
+
getUserInfo(state: {
|
|
5
|
+
userInfo: {
|
|
6
|
+
avatar?: string | undefined;
|
|
7
|
+
birthday?: string | undefined;
|
|
8
|
+
country?: string | undefined;
|
|
9
|
+
createTime?: string | undefined;
|
|
10
|
+
email?: string | undefined;
|
|
11
|
+
empNo?: string | undefined;
|
|
12
|
+
ext0?: string | undefined;
|
|
13
|
+
ext1?: string | undefined;
|
|
14
|
+
ext2?: string | undefined;
|
|
15
|
+
ext3?: string | undefined;
|
|
16
|
+
ext4?: string | undefined;
|
|
17
|
+
ext5?: number | undefined;
|
|
18
|
+
ext6?: number | undefined;
|
|
19
|
+
ext7?: number | undefined;
|
|
20
|
+
ext8?: number | undefined;
|
|
21
|
+
ext9?: number | undefined;
|
|
22
|
+
fullname?: string | undefined;
|
|
23
|
+
gender?: number | undefined;
|
|
24
|
+
globalSuperAdmin?: number | undefined;
|
|
25
|
+
ip?: string | undefined;
|
|
26
|
+
match?: boolean | undefined;
|
|
27
|
+
minioDomain?: string | undefined;
|
|
28
|
+
mobile?: string | undefined;
|
|
29
|
+
mqttProperties?: {
|
|
30
|
+
password?: string | undefined;
|
|
31
|
+
username?: string | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
orgIds?: string[] | undefined;
|
|
34
|
+
platTicket?: string | undefined;
|
|
35
|
+
platformManager?: number | undefined;
|
|
36
|
+
platformManagerPermissions?: string[] | undefined;
|
|
37
|
+
signType?: string | undefined;
|
|
38
|
+
signWay?: string | undefined;
|
|
39
|
+
signatureImage?: string | undefined;
|
|
40
|
+
signatureImageWrite?: string | undefined;
|
|
41
|
+
suiteTicket?: string | undefined;
|
|
42
|
+
telephone?: string | undefined;
|
|
43
|
+
tenantList?: {
|
|
44
|
+
duty?: string | undefined;
|
|
45
|
+
enabled?: number | undefined;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
managerId?: string | undefined;
|
|
48
|
+
managerName?: string | undefined;
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
orgNames?: string | undefined;
|
|
51
|
+
userId?: string | undefined;
|
|
52
|
+
userOrgList?: {
|
|
53
|
+
createTime?: string | undefined;
|
|
54
|
+
createUserId?: string | undefined;
|
|
55
|
+
createUserName?: string | undefined;
|
|
56
|
+
id?: string | undefined;
|
|
57
|
+
master?: number | undefined;
|
|
58
|
+
modifyTime?: string | undefined;
|
|
59
|
+
modifyUserId?: string | undefined;
|
|
60
|
+
modifyUserName?: string | undefined;
|
|
61
|
+
orgId?: string | undefined;
|
|
62
|
+
orgName?: string | undefined;
|
|
63
|
+
principal?: number | undefined;
|
|
64
|
+
tenantId?: string | undefined;
|
|
65
|
+
userId?: string | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
token?: string | undefined;
|
|
69
|
+
userId?: string | undefined;
|
|
70
|
+
username?: string | undefined;
|
|
71
|
+
} | null;
|
|
72
|
+
roleList: string[];
|
|
73
|
+
sessionTimeout: boolean;
|
|
74
|
+
lastUpdateTime: number;
|
|
75
|
+
} & import('pinia').PiniaCustomStateProperties<UserState>): {
|
|
76
|
+
avatar?: string | undefined;
|
|
77
|
+
birthday?: string | undefined;
|
|
78
|
+
country?: string | undefined;
|
|
79
|
+
createTime?: string | undefined;
|
|
80
|
+
email?: string | undefined;
|
|
81
|
+
empNo?: string | undefined;
|
|
82
|
+
ext0?: string | undefined;
|
|
83
|
+
ext1?: string | undefined;
|
|
84
|
+
ext2?: string | undefined;
|
|
85
|
+
ext3?: string | undefined;
|
|
86
|
+
ext4?: string | undefined;
|
|
87
|
+
ext5?: number | undefined;
|
|
88
|
+
ext6?: number | undefined;
|
|
89
|
+
ext7?: number | undefined;
|
|
90
|
+
ext8?: number | undefined;
|
|
91
|
+
ext9?: number | undefined;
|
|
92
|
+
fullname?: string | undefined;
|
|
93
|
+
gender?: number | undefined;
|
|
94
|
+
globalSuperAdmin?: number | undefined;
|
|
95
|
+
ip?: string | undefined;
|
|
96
|
+
match?: boolean | undefined;
|
|
97
|
+
minioDomain?: string | undefined;
|
|
98
|
+
mobile?: string | undefined;
|
|
99
|
+
mqttProperties?: {
|
|
100
|
+
password?: string | undefined;
|
|
101
|
+
username?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
orgIds?: string[] | undefined;
|
|
104
|
+
platTicket?: string | undefined;
|
|
105
|
+
platformManager?: number | undefined;
|
|
106
|
+
platformManagerPermissions?: string[] | undefined;
|
|
107
|
+
signType?: string | undefined;
|
|
108
|
+
signWay?: string | undefined;
|
|
109
|
+
signatureImage?: string | undefined;
|
|
110
|
+
signatureImageWrite?: string | undefined;
|
|
111
|
+
suiteTicket?: string | undefined;
|
|
112
|
+
telephone?: string | undefined;
|
|
113
|
+
tenantList?: {
|
|
114
|
+
duty?: string | undefined;
|
|
115
|
+
enabled?: number | undefined;
|
|
116
|
+
id?: string | undefined;
|
|
117
|
+
managerId?: string | undefined;
|
|
118
|
+
managerName?: string | undefined;
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
orgNames?: string | undefined;
|
|
121
|
+
userId?: string | undefined;
|
|
122
|
+
userOrgList?: {
|
|
123
|
+
createTime?: string | undefined;
|
|
124
|
+
createUserId?: string | undefined;
|
|
125
|
+
createUserName?: string | undefined;
|
|
126
|
+
id?: string | undefined;
|
|
127
|
+
master?: number | undefined;
|
|
128
|
+
modifyTime?: string | undefined;
|
|
129
|
+
modifyUserId?: string | undefined;
|
|
130
|
+
modifyUserName?: string | undefined;
|
|
131
|
+
orgId?: string | undefined;
|
|
132
|
+
orgName?: string | undefined;
|
|
133
|
+
principal?: number | undefined;
|
|
134
|
+
tenantId?: string | undefined;
|
|
135
|
+
userId?: string | undefined;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
token?: string | undefined;
|
|
139
|
+
userId?: string | undefined;
|
|
140
|
+
username?: string | undefined;
|
|
141
|
+
} | null;
|
|
142
|
+
}, {
|
|
143
|
+
login(config: LoginParams, { hasError }?: {
|
|
144
|
+
hasError: any;
|
|
145
|
+
}): Promise<null | undefined>;
|
|
146
|
+
getUserInfoAction(Token?: string): Promise<UserLoginResp | null>;
|
|
147
|
+
/**单应用登录 */
|
|
148
|
+
afterLoginSingleApp(): Promise<void>;
|
|
149
|
+
/**登录后逻辑 */
|
|
150
|
+
afterLoginAction(): Promise<null | undefined>;
|
|
151
|
+
logout(): Promise<void>;
|
|
152
|
+
setUserInfo(info: IObject): Promise<void>;
|
|
153
|
+
updateUserInfo(data: IObject): Promise<void>;
|
|
154
|
+
}>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import '../../../utils/mitt/mitt.mjs';
|
|
3
|
+
import 'lodash-es';
|
|
4
|
+
import '../../../enums/app-designer/index.mjs';
|
|
5
|
+
import '../../../enums/page-designer/designer.mjs';
|
|
6
|
+
import '../../../enums/breakpointEnum.mjs';
|
|
7
|
+
import 'path-browserify';
|
|
8
|
+
import { getToken, setToken } from '../../../utils/tools/tools.mjs';
|
|
9
|
+
import 'vue';
|
|
10
|
+
import 'axios';
|
|
11
|
+
import { getDeviceFingerprint, getPageIdentification } from '../../../utils/deviceFingerprint.mjs';
|
|
12
|
+
|
|
13
|
+
const useUserStore = defineStore("user", {
|
|
14
|
+
state: () => ({
|
|
15
|
+
userInfo: {},
|
|
16
|
+
// roleList
|
|
17
|
+
roleList: [],
|
|
18
|
+
// Whether the login expired
|
|
19
|
+
sessionTimeout: false,
|
|
20
|
+
// Last fetch time
|
|
21
|
+
lastUpdateTime: 0
|
|
22
|
+
}),
|
|
23
|
+
getters: {
|
|
24
|
+
getUserInfo(state) {
|
|
25
|
+
return state.userInfo;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
actions: {
|
|
29
|
+
async login(config, { hasError } = {}) {
|
|
30
|
+
try {
|
|
31
|
+
const data = await loginApi(config, hasError);
|
|
32
|
+
const { token, signWay } = data;
|
|
33
|
+
sessionStorage.setItem("signWay", signWay);
|
|
34
|
+
setToken(token);
|
|
35
|
+
return this.afterLoginAction();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return Promise.reject(error);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async getUserInfoAction(Token) {
|
|
41
|
+
if (!getToken && !Token) return null;
|
|
42
|
+
const info = await _api.platform.user.getInfo({
|
|
43
|
+
headers: { Token }
|
|
44
|
+
});
|
|
45
|
+
this.setUserInfo(info);
|
|
46
|
+
return info;
|
|
47
|
+
},
|
|
48
|
+
/**单应用登录 */
|
|
49
|
+
async afterLoginSingleApp() {
|
|
50
|
+
},
|
|
51
|
+
/**登录后逻辑 */
|
|
52
|
+
async afterLoginAction() {
|
|
53
|
+
if (!getToken) return null;
|
|
54
|
+
},
|
|
55
|
+
async logout() {
|
|
56
|
+
await doLogout();
|
|
57
|
+
},
|
|
58
|
+
async setUserInfo(info) {
|
|
59
|
+
this.userInfo = {
|
|
60
|
+
...info,
|
|
61
|
+
minioDomain: "/minio"
|
|
62
|
+
};
|
|
63
|
+
this.lastUpdateTime = (/* @__PURE__ */ new Date()).getTime();
|
|
64
|
+
},
|
|
65
|
+
async updateUserInfo(data) {
|
|
66
|
+
const info = { ...this.userInfo, ...data };
|
|
67
|
+
this.setUserInfo(info);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
async function loginApi(params, { hasError = true } = {}) {
|
|
72
|
+
const fingerprint = await getDeviceFingerprint();
|
|
73
|
+
const data = await _api.platform.login.postSign(params, {
|
|
74
|
+
headers: {
|
|
75
|
+
browser: fingerprint,
|
|
76
|
+
"Auth-Code": params.authCode,
|
|
77
|
+
hasError
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return data;
|
|
81
|
+
}
|
|
82
|
+
async function doLogout() {
|
|
83
|
+
const session = sessionStorage.getItem("currentPlatOrAppId");
|
|
84
|
+
const env = _gct.env.getEnv();
|
|
85
|
+
const fingerprint = await getDeviceFingerprint();
|
|
86
|
+
const params = {
|
|
87
|
+
appId: session && JSON.parse(session).appId,
|
|
88
|
+
platform: session && JSON.parse(session).type,
|
|
89
|
+
env
|
|
90
|
+
};
|
|
91
|
+
const pageIdentification = getPageIdentification();
|
|
92
|
+
await _api.platform.login.getSignOut(params, {
|
|
93
|
+
headers: {
|
|
94
|
+
browser: fingerprint,
|
|
95
|
+
pagetag: pageIdentification
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { useUserStore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserLoginResp } from '@gct-paas/api/platform';
|
|
2
|
+
export interface LoginParams {
|
|
3
|
+
code?: string;
|
|
4
|
+
country?: string;
|
|
5
|
+
password?: string;
|
|
6
|
+
username?: string;
|
|
7
|
+
authCode?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UserState {
|
|
10
|
+
userInfo: UserLoginResp | null;
|
|
11
|
+
roleList: string[];
|
|
12
|
+
sessionTimeout: boolean;
|
|
13
|
+
lastUpdateTime: number;
|
|
14
|
+
}
|