@gct-paas/core 0.1.4-dev.6 → 0.1.4-dev.7

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.
Files changed (132) hide show
  1. package/dist/index.esm.min.mjs +20168 -0
  2. package/dist/index.min.cjs +2 -15
  3. package/dist/index.system.min.js +2 -15
  4. package/es/create-app-vue.mjs +1 -2
  5. package/es/enums/index.mjs +0 -4
  6. package/es/global/gct/gct.d.ts +3 -1
  7. package/es/global/gct/gct.mjs +2 -0
  8. package/es/hooks/useCopyToClipboard.d.ts +3 -3
  9. package/es/index.mjs +49 -49
  10. package/es/modules/error-handler/error-strategy.mjs +4 -1
  11. package/es/modules/platform-config/useLoginSetting.d.ts +12 -4
  12. package/es/modules/platform-config/useOrgSetting.d.ts +14 -0
  13. package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
  14. package/es/store/global-store.mjs +7 -2
  15. package/es/types/index.d.ts +0 -2
  16. package/package.json +28 -26
  17. package/es/interface/controller/edit-form/edit-form.controller.mjs +0 -1
  18. package/es/interface/controller/editor/i-color-editor.controller.mjs +0 -1
  19. package/es/interface/controller/editor/i-length-unit-editor.controller.mjs +0 -1
  20. package/es/interface/controller/editor-item/editor-item.controller.mjs +0 -1
  21. package/es/interface/controller/form/form.controller.mjs +0 -3
  22. package/es/interface/controller/form-collapse/form-collapse.controller.mjs +0 -1
  23. package/es/interface/controller/form-collapse-pane/form-collapse-pane.controller.mjs +0 -1
  24. package/es/interface/controller/form-edit-item/form-edit-item.controller.mjs +0 -1
  25. package/es/interface/controller/form-group/form-group.controller.mjs +0 -1
  26. package/es/interface/controller/form-hidden-item/form-hidden-item.controller.mjs +0 -1
  27. package/es/interface/controller/form-item/form-item.controller.mjs +0 -1
  28. package/es/interface/controller/form-item-basic/form-item-basic.controller.mjs +0 -1
  29. package/es/interface/controller/form-tab/form-tab.controller.mjs +0 -1
  30. package/es/interface/controller/form-tab-pane/form-tab-pane.controller.mjs +0 -1
  31. package/es/interface/controller/i-designer-controller.mjs +0 -1
  32. package/es/interface/controller/index.mjs +0 -1
  33. package/es/interface/events/form/i-form.event.mjs +0 -1
  34. package/es/interface/events/index.mjs +0 -1
  35. package/es/interface/form/i-editor/i-check-switch.mjs +0 -3
  36. package/es/interface/form/i-editor/i-checkbox-editor.mjs +0 -3
  37. package/es/interface/form/i-editor/i-color-editor.mjs +0 -3
  38. package/es/interface/form/i-editor/i-editor-basic.mjs +0 -1
  39. package/es/interface/form/i-editor/i-icon-select-editor.mjs +0 -3
  40. package/es/interface/form/i-editor/i-info-editor.mjs +0 -3
  41. package/es/interface/form/i-editor/i-length-unit-editor.mjs +0 -3
  42. package/es/interface/form/i-editor/i-number-editor.mjs +0 -3
  43. package/es/interface/form/i-editor/i-picker-editor.mjs +0 -3
  44. package/es/interface/form/i-editor/i-radio-editor.mjs +0 -3
  45. package/es/interface/form/i-editor/i-select-editor.mjs +0 -3
  46. package/es/interface/form/i-editor/i-span-editor.mjs +0 -3
  47. package/es/interface/form/i-editor/i-switch-editor.mjs +0 -3
  48. package/es/interface/form/i-editor/i-text-editor.mjs +0 -3
  49. package/es/interface/form/i-editor/i-textarea-editor.mjs +0 -3
  50. package/es/interface/form/i-form/i-edit-form.mjs +0 -1
  51. package/es/interface/form/i-form/i-form-collapse-pane.mjs +0 -1
  52. package/es/interface/form/i-form/i-form-collapse.mjs +0 -1
  53. package/es/interface/form/i-form/i-form-container.mjs +0 -1
  54. package/es/interface/form/i-form/i-form-edit-item.mjs +0 -1
  55. package/es/interface/form/i-form/i-form-group-container.mjs +0 -1
  56. package/es/interface/form/i-form/i-form-group.mjs +0 -1
  57. package/es/interface/form/i-form/i-form-hidden-item.mjs +0 -1
  58. package/es/interface/form/i-form/i-form-item-basic.mjs +0 -1
  59. package/es/interface/form/i-form/i-form-item.mjs +0 -1
  60. package/es/interface/form/i-form/i-form-tab-pane.mjs +0 -1
  61. package/es/interface/form/i-form/i-form-tab.mjs +0 -1
  62. package/es/interface/form/i-form/i-form.mjs +0 -1
  63. package/es/interface/form/index.mjs +0 -1
  64. package/es/interface/hooks/i-designer-hooks.mjs +0 -3
  65. package/es/interface/hooks/index.mjs +0 -1
  66. package/es/interface/i-dictionary/i-dictionary-item.mjs +0 -1
  67. package/es/interface/i-dictionary/i-dictionary.mjs +0 -1
  68. package/es/interface/i-import-style-map/i-import-style-map.mjs +0 -1
  69. package/es/interface/i-message-util/i-message-util.mjs +0 -1
  70. package/es/interface/i-modal/i-modal.mjs +0 -3
  71. package/es/interface/i-modal-data/i-modal-data.mjs +0 -1
  72. package/es/interface/i-pinia-action/i-global-actions.mjs +0 -1
  73. package/es/interface/i-pinia-getter/i-global-getters.mjs +0 -1
  74. package/es/interface/i-pinia-state/i-global-state.mjs +0 -1
  75. package/es/interface/layout/i-flex-layout/i-flex-container.mjs +0 -1
  76. package/es/interface/layout/i-flex-layout/i-flex-item.mjs +0 -1
  77. package/es/interface/layout/i-grid-layout/i-grid-container.mjs +0 -1
  78. package/es/interface/layout/i-grid-layout/i-grid-item-span.mjs +0 -1
  79. package/es/interface/layout/i-grid-layout/i-grid-item.mjs +0 -1
  80. package/es/interface/layout/i-layout-basis/i-layout-container-basis.mjs +0 -1
  81. package/es/interface/layout/index.mjs +0 -1
  82. package/es/interface/low-code-types/index.mjs +0 -5
  83. package/es/interface/low-code-types/modal-types.mjs +0 -3
  84. package/es/interface/low-code-types/model/index.mjs +0 -1
  85. package/es/interface/low-code-types/schema/index.mjs +0 -1
  86. package/es/interface/low-code-types/widget-basic-types.mjs +0 -3
  87. package/es/interface/provider/i-editor-provider/i-editor-provider.mjs +0 -1
  88. package/es/interface/provider/i-form-item-provider/i-form-item-provider.mjs +0 -1
  89. package/es/interface/provider/i-provider-basic/i-provider-basic.mjs +0 -1
  90. package/es/interface/provider/index.mjs +0 -1
  91. package/es/interface/state/form/form.state.mjs +0 -1
  92. package/es/interface/state/form-collapse/form-collapse.state.mjs +0 -1
  93. package/es/interface/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
  94. package/es/interface/state/form-edit-item/form-edit-item.state.mjs +0 -1
  95. package/es/interface/state/form-group/form-group.state.mjs +0 -1
  96. package/es/interface/state/form-hidden-item/form-hidden-item.state.mjs +0 -1
  97. package/es/interface/state/form-item/form-item.state.mjs +0 -1
  98. package/es/interface/state/form-item-basic/form-item-basic.state.mjs +0 -1
  99. package/es/interface/state/form-tab/form-tab.state.mjs +0 -1
  100. package/es/interface/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
  101. package/es/interface/state/i-designer-state.mjs +0 -1
  102. package/es/interface/state/index.mjs +0 -1
  103. package/es/interface/style/i-border.mjs +0 -1
  104. package/es/interface/style/i-font.mjs +0 -1
  105. package/es/interface/style/i-margin.mjs +0 -1
  106. package/es/interface/style/i-padding.mjs +0 -1
  107. package/es/interface/style/i-position.mjs +0 -1
  108. package/es/interface/style/i-spacing.mjs +0 -1
  109. package/es/interface/style/index.mjs +0 -1
  110. package/es/modules/api-service/api-manage.d.ts +0 -26
  111. package/es/modules/api-service/api-manage.mjs +0 -33
  112. package/es/modules/api-service/api-service.d.ts +0 -96
  113. package/es/modules/api-service/api-service.interface.d.ts +0 -159
  114. package/es/modules/api-service/api-service.interface.mjs +0 -4
  115. package/es/modules/api-service/api-service.mjs +0 -173
  116. package/es/modules/api-service/http.enum.d.ts +0 -76
  117. package/es/modules/api-service/http.enum.mjs +0 -63
  118. package/es/modules/api-service/http.util.d.ts +0 -113
  119. package/es/modules/api-service/http.util.mjs +0 -160
  120. package/es/modules/api-service/index.d.ts +0 -8
  121. package/es/modules/api-service/index.mjs +0 -13
  122. package/es/modules/error-handler/error-handler.interface.mjs +0 -1
  123. package/es/modules/platform-config/constants.mjs +0 -63
  124. package/es/modules/platform-config/types.mjs +0 -27
  125. package/es/modules/platform-config/useBasicSetting.mjs +0 -50
  126. package/es/modules/platform-config/useDeploySetting.mjs +0 -32
  127. package/es/modules/platform-config/useLoginSetting.mjs +0 -183
  128. package/es/modules/platform-config/useOrgSetting.mjs +0 -121
  129. package/es/modules/platform-config/useSecuritySetting.mjs +0 -71
  130. package/es/modules/platform-config/useThemeSetting.mjs +0 -73
  131. package/es/modules/platform-config/useWatermarkSetting.mjs +0 -48
  132. package/es/provider/i-designer-provider/i-designer-provider.mjs +0 -1
@@ -1,183 +0,0 @@
1
- import { ref, reactive } from 'vue';
2
- import { PlatformSettingEnum } from './types.mjs';
3
- import { LoginTypeEnum, getLoginTypeOptions, SystemLoginKeys, OtherLoginKeys, LoginSortTypeEnum } from './constants.mjs';
4
-
5
- "use strict";
6
- const loginModeAuthTypes = ref([LoginTypeEnum.ACCOUNT]);
7
- const openIDOAuthAuthTypes = ref([]);
8
- const sysLoginSort = ref(getLoginTypeOptions(SystemLoginKeys));
9
- const openIDOAuthAuthSort = ref(getLoginTypeOptions(OtherLoginKeys));
10
- const loginSetting = reactive({
11
- theme: "full",
12
- title: "\u6B22\u8FCE\u767B\u5F55\u51A0\u9A8B\u4E91PaaS\u5E73\u53F0",
13
- subtitle: "\u8BA9\u6570\u5B57\u5316\u8D4B\u80FD\u5BA2\u6237\u6210\u529F\uFF01",
14
- logo: "",
15
- banner: "",
16
- loginModeConfigs: [],
17
- openIDOAuthConfigs: [],
18
- sortJson: "",
19
- defaultAuthType: LoginTypeEnum.ACCOUNT
20
- });
21
- const loginModeConfig = reactive(
22
- /* @__PURE__ */ new Map([
23
- [
24
- LoginTypeEnum.ACCOUNT,
25
- {
26
- address: "",
27
- authType: LoginTypeEnum.ACCOUNT,
28
- relationField: "",
29
- enabled: 0
30
- }
31
- ],
32
- [
33
- LoginTypeEnum.DOMAIN_ACCOUNT,
34
- {
35
- address: "",
36
- authType: LoginTypeEnum.DOMAIN_ACCOUNT,
37
- relationField: "",
38
- domainSuffix: "",
39
- relationFieldName: "",
40
- enabled: 0
41
- }
42
- ],
43
- [
44
- LoginTypeEnum.MOBILE,
45
- {
46
- smsServiceProvider: "",
47
- // 短信服务商
48
- smsKey: "",
49
- // 授权key
50
- smsKeySecret: "",
51
- // 授权secret
52
- smsTemplateCode: "",
53
- // 模板代码
54
- smsSignName: "",
55
- // 短信签名
56
- phoneNumb: "",
57
- smsSdkAppId: "",
58
- authType: LoginTypeEnum.MOBILE,
59
- enabled: 0
60
- }
61
- ],
62
- [
63
- LoginTypeEnum.DINGDING,
64
- {
65
- appId: "",
66
- authType: LoginTypeEnum.DINGDING,
67
- secret: "",
68
- redirectURL: "",
69
- enabled: 0
70
- }
71
- ],
72
- [
73
- LoginTypeEnum.FEISHU,
74
- {
75
- appId: "",
76
- authType: LoginTypeEnum.FEISHU,
77
- secret: "",
78
- redirectURL: "",
79
- enabled: 0
80
- }
81
- ],
82
- [
83
- LoginTypeEnum.QIYEWEIXIN,
84
- {
85
- appId: "",
86
- agentId: "",
87
- authType: LoginTypeEnum.QIYEWEIXIN,
88
- secret: "",
89
- redirectURL: "",
90
- enabled: 0,
91
- certFileName: ""
92
- }
93
- ]
94
- ])
95
- );
96
- const theme = ref([
97
- {
98
- imgUrl: "login-password.png",
99
- value: "full",
100
- label: "\u5168\u5C4F\u6A21\u5F0F"
101
- },
102
- {
103
- imgUrl: "login.png",
104
- value: "class",
105
- label: "\u7ECF\u5178\u6A21\u5F0F"
106
- }
107
- ]);
108
- function useLoginSetting() {
109
- const loadLoginSetting = async () => {
110
- const res = await _api.platform.plat.getInfo({
111
- configEnum: PlatformSettingEnum.LOGIN
112
- });
113
- setLoginSetting(res.data);
114
- };
115
- const postLoginSetting = async () => {
116
- const enableTypes = [
117
- ...loginModeAuthTypes.value,
118
- ...openIDOAuthAuthTypes.value
119
- ];
120
- enableTypes.forEach((item) => {
121
- const config = loginModeConfig.get(item);
122
- if (config) {
123
- config.enabled = 1;
124
- }
125
- });
126
- loginSetting.loginModeConfigs = SystemLoginKeys.map((item) => {
127
- return loginModeConfig.get(item);
128
- }).filter((config) => config !== void 0);
129
- loginSetting.openIDOAuthConfigs = OtherLoginKeys.map((item) => {
130
- return loginModeConfig.get(item);
131
- }).filter((config) => config !== void 0);
132
- loginSetting.sortJson = JSON.stringify({
133
- [LoginSortTypeEnum.SYSTEM]: sysLoginSort.value.map((item) => item.id),
134
- [LoginSortTypeEnum.THIRD_PARTY]: openIDOAuthAuthSort.value.map(
135
- (item) => item.id
136
- )
137
- });
138
- await _api.platform.plat.postLogin(loginSetting);
139
- };
140
- const setLoginSetting = (config) => {
141
- console.log("config", config);
142
- if (config && config.value) {
143
- const value = JSON.parse(config.value);
144
- for (const k in value) {
145
- if (k in loginSetting) {
146
- loginSetting[k] = value[k];
147
- }
148
- }
149
- loginSetting.loginModeConfigs?.forEach((item) => {
150
- loginModeConfig.set(item.authType, { ...item, enabled: 0 });
151
- });
152
- const loginModeConfigs = loginSetting.loginModeConfigs?.filter((item) => {
153
- return item.enabled;
154
- }).map((i) => {
155
- return i.authType;
156
- }) || [];
157
- loginModeConfigs.push(LoginTypeEnum.ACCOUNT);
158
- loginModeAuthTypes.value = [...new Set(loginModeConfigs)];
159
- loginSetting.openIDOAuthConfigs?.forEach((item) => {
160
- loginModeConfig.set(item.authType, { ...item, enabled: 0 });
161
- });
162
- openIDOAuthAuthTypes.value = loginSetting.openIDOAuthConfigs?.filter((item) => {
163
- return item.enabled;
164
- }).map((i) => {
165
- return i.authType;
166
- }) || [];
167
- }
168
- };
169
- return {
170
- loginSetting,
171
- loadLoginSetting,
172
- postLoginSetting,
173
- setLoginSetting,
174
- theme,
175
- loginModeAuthTypes,
176
- openIDOAuthAuthTypes,
177
- sysLoginSort,
178
- openIDOAuthAuthSort,
179
- loginModeConfig
180
- };
181
- }
182
-
183
- export { useLoginSetting };
@@ -1,121 +0,0 @@
1
- import { reactive, ref } from 'vue';
2
- import { PlatformSettingEnum } from './types.mjs';
3
-
4
- "use strict";
5
- const orgSetting = reactive({
6
- initialPassword: "123456",
7
- initialSignPassword: "12345678",
8
- enableIdentifier: 1,
9
- enableDeleteAccount: 1,
10
- enableDeleteUser: 0,
11
- requiredFields: [],
12
- // supportLoginFields: ['username_', 'emp_no_'],
13
- supportLoginFields: ["username_"],
14
- extFieldConfigs: [],
15
- orgExtFieldConfigs: []
16
- });
17
- const relationFields = ref([
18
- {
19
- label: "extString0_",
20
- value: "ext0",
21
- type: 1
22
- },
23
- {
24
- label: "extString1_",
25
- value: "ext1",
26
- type: 1
27
- },
28
- {
29
- label: "extString2_",
30
- value: "ext2",
31
- type: 1
32
- },
33
- {
34
- label: "extString3_",
35
- value: "ext3",
36
- type: 1
37
- },
38
- {
39
- label: "extString4_",
40
- value: "ext4",
41
- type: 1
42
- },
43
- {
44
- label: "extInt5_",
45
- value: "ext5",
46
- type: 0
47
- },
48
- {
49
- label: "extInt6_",
50
- value: "ext6",
51
- type: 0
52
- },
53
- {
54
- label: "extInt7_",
55
- value: "ext7",
56
- type: 0
57
- },
58
- {
59
- label: "extInt8_",
60
- value: "ext8",
61
- type: 0
62
- },
63
- {
64
- label: "extInt9_",
65
- value: "ext9",
66
- type: 0
67
- }
68
- ]);
69
- const relationFiledsCopy = ref([]);
70
- function useOrgSetting(isPlatform = true) {
71
- const postOrgSetting = async () => {
72
- const setting = JSON.parse(JSON.stringify(orgSetting));
73
- if (isPlatform) {
74
- await _api.platform.plat.postOrg(setting);
75
- } else {
76
- await _api.apaas.plat.postOrg(setting);
77
- }
78
- await loadOrgSetting();
79
- };
80
- async function loadOrgSetting() {
81
- const res = await _api.platform.plat.getInfo({
82
- configEnum: PlatformSettingEnum.ORGANIZATION
83
- });
84
- if (res) {
85
- setOrgSetting(res.data);
86
- }
87
- }
88
- function setOrgSetting(data) {
89
- const { value } = data;
90
- if (!value) return;
91
- try {
92
- const setting = JSON.parse(value);
93
- Object.assign(orgSetting, setting);
94
- if (orgSetting.extFieldConfigs && orgSetting.extFieldConfigs.length) {
95
- orgSetting.extFieldConfigs.forEach((element) => {
96
- relationFields.value = relationFields.value.filter((i) => {
97
- if (i.value == element.relationField) {
98
- relationFiledsCopy.value.push(i);
99
- }
100
- return i.value !== element.relationField;
101
- });
102
- });
103
- }
104
- orgSetting.extFieldConfigs = JSON.parse(
105
- JSON.stringify(setting.extFieldConfigs)
106
- );
107
- } catch (err) {
108
- console.warn(err);
109
- }
110
- }
111
- return {
112
- orgSetting,
113
- loadOrgSetting,
114
- setOrgSetting,
115
- postOrgSetting,
116
- relationFields,
117
- relationFiledsCopy
118
- };
119
- }
120
-
121
- export { useOrgSetting };
@@ -1,71 +0,0 @@
1
- import { reactive } from 'vue';
2
- import { PlatformSettingEnum } from './types.mjs';
3
-
4
- "use strict";
5
- const securitySetting = reactive({
6
- durationHour: 2,
7
- durationMinute: 0,
8
- enableChangePassword: 1,
9
- enableChangeSignPassword: 0,
10
- enableSignPassword: 0,
11
- enableKickOut: 1,
12
- enablePassphrase: 1,
13
- signEnablePassphrase: 1,
14
- enableLockAccount: 1,
15
- expiryDate: 30,
16
- signExpiryDate: 30,
17
- firstTimeChangePassword: 0,
18
- signFirstTimeChangePassword: 0,
19
- lockTimeout: 0,
20
- loginKickOutMode: "SAME_END",
21
- maxErrorTimes: 2,
22
- passMinLength: 6,
23
- signPassMinLength: 6,
24
- passRule: ["NUMBER"],
25
- signPassRule: ["NUMBER"],
26
- signRepeatNum: 1,
27
- repeatNum: 1,
28
- timeUnit: "DAYS",
29
- signTimeUnit: "DAYS",
30
- noOpRetainHour: 8,
31
- noOpRetainMinute: 0,
32
- earlyAlarmMinute: 5,
33
- earlyAlarmSecond: 0,
34
- inapplicablePerson: [],
35
- lockHourTimeout: 0,
36
- lockMinTimeout: 5
37
- });
38
- function useSecuritySetting(isPlatform = true) {
39
- const postSecuritySetting = async () => {
40
- if (isPlatform) {
41
- await _api.platform.plat.postSecurity(securitySetting);
42
- } else {
43
- await _api.apaas.plat.postSecurity(securitySetting);
44
- }
45
- };
46
- async function loadSecuritySetting() {
47
- const res = await _api.platform.plat.getInfo({
48
- configEnum: PlatformSettingEnum.SECURITY
49
- });
50
- if (res) {
51
- setSecuritySetting(res.data);
52
- }
53
- }
54
- function setSecuritySetting(data) {
55
- const { value } = data;
56
- if (!value) return;
57
- try {
58
- Object.assign(securitySetting, JSON.parse(value));
59
- } catch (err) {
60
- console.warn(err);
61
- }
62
- }
63
- return {
64
- securitySetting,
65
- postSecuritySetting,
66
- loadSecuritySetting,
67
- setSecuritySetting
68
- };
69
- }
70
-
71
- export { useSecuritySetting };
@@ -1,73 +0,0 @@
1
- import { reactive, ref, watch } from 'vue';
2
- import './types.mjs';
3
-
4
- "use strict";
5
- const themeSetting = reactive({
6
- darkMode: "light",
7
- themeColor: "#026AC8",
8
- // menuMode: 'mix-sider',
9
- menuMode: "classic",
10
- menuWidth: 232,
11
- menuCollapsible: true,
12
- menuSearchable: true,
13
- menuFilter: false,
14
- showLogo: true,
15
- showBreadcrumb: false,
16
- showBreadcrumbIcon: false,
17
- showTabs: true,
18
- pageProgress: true,
19
- pageLoading: true,
20
- colorMode: "normal"
21
- });
22
- const menuCollapsed = ref(false);
23
- const menuCollapsedWidth = 46;
24
- const menuWidthRange = [100, 1e3];
25
- const themeColors = ["#026AC8", "#0DAA9C"];
26
- const toggleColorMode = () => {
27
- switch (themeSetting.colorMode) {
28
- case "colorWeak":
29
- break;
30
- case "gray":
31
- break;
32
- default:
33
- }
34
- };
35
- watch(
36
- () => themeSetting.colorMode,
37
- (value) => {
38
- if (value) {
39
- toggleColorMode();
40
- }
41
- }
42
- );
43
- function useThemeSetting() {
44
- const postThemeSetting = async () => {
45
- };
46
- async function loadThemeSetting() {
47
- }
48
- function setThemeSetting(data) {
49
- const { value } = data;
50
- if (!value) return;
51
- try {
52
- Object.assign(themeSetting, JSON.parse(value));
53
- } catch (err) {
54
- console.warn(err);
55
- }
56
- }
57
- function toggleMenuCollapsed() {
58
- menuCollapsed.value = !menuCollapsed.value;
59
- }
60
- return {
61
- themeSetting,
62
- loadThemeSetting,
63
- setThemeSetting,
64
- postThemeSetting,
65
- menuCollapsed,
66
- toggleMenuCollapsed,
67
- menuCollapsedWidth,
68
- menuWidthRange,
69
- themeColors
70
- };
71
- }
72
-
73
- export { useThemeSetting };
@@ -1,48 +0,0 @@
1
- import { reactive } from 'vue';
2
- import { PlatformSettingEnum } from './types.mjs';
3
-
4
- "use strict";
5
- const initData = {
6
- openWatermark: false,
7
- watermarkContent: "custom",
8
- fontSize: 16,
9
- color: "#000000",
10
- verticalAlign: "middle",
11
- textAlign: "center",
12
- text: "${username}",
13
- transparent: 15,
14
- width: 1600,
15
- height: 1080
16
- };
17
- const watermarkSetting = reactive({ ...initData });
18
- function useWatermarkSetting() {
19
- const postWatermarkSetting = async () => {
20
- const value = JSON.stringify(watermarkSetting);
21
- await _api.platform.plat.postWatermark({ value });
22
- };
23
- const loadWatermarkSetting = async () => {
24
- const res = await _api.platform.plat.getInfo({
25
- configEnum: PlatformSettingEnum.WATERMARK
26
- });
27
- if (res) {
28
- setWatermarkSetting(res.data);
29
- }
30
- };
31
- function setWatermarkSetting(data) {
32
- const { value } = data;
33
- if (!value) return;
34
- try {
35
- Object.assign(watermarkSetting, JSON.parse(value));
36
- } catch (err) {
37
- console.warn(err);
38
- }
39
- }
40
- return {
41
- watermarkSetting,
42
- loadWatermarkSetting,
43
- postWatermarkSetting,
44
- setWatermarkSetting
45
- };
46
- }
47
-
48
- export { useWatermarkSetting };
@@ -1 +0,0 @@
1
- "use strict";