@geelato/gl-runtime-core 0.0.1

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 (117) hide show
  1. package/dist/gl-runtime-core.css +1 -0
  2. package/dist/gl-runtime-core.css.gz +0 -0
  3. package/dist/gl-runtime-core.js +169768 -0
  4. package/dist/gl-runtime-core.js.gz +0 -0
  5. package/dist/gl-runtime-core.umd.cjs +35 -0
  6. package/dist/iconfont-BJ2VOOKJ.js +35 -0
  7. package/dist/iconfont-BJ2VOOKJ.js.gz +0 -0
  8. package/dist/types/actions/JsScriptExecutor.d.ts +291 -0
  9. package/dist/types/actions/fns/datetime.d.ts +22 -0
  10. package/dist/types/actions/fns/device.d.ts +23 -0
  11. package/dist/types/actions/fns/math.d.ts +27 -0
  12. package/dist/types/api/EntityApi.d.ts +143 -0
  13. package/dist/types/api/EntityDataSource.d.ts +272 -0
  14. package/dist/types/api/EntityDeleteService.d.ts +47 -0
  15. package/dist/types/api/EntityQueryCache.d.ts +62 -0
  16. package/dist/types/api/EntityQueryService.d.ts +71 -0
  17. package/dist/types/api/EntityResultMapping.d.ts +11 -0
  18. package/dist/types/api/EntitySaveService.d.ts +46 -0
  19. package/dist/types/api/EntityTypes.d.ts +135 -0
  20. package/dist/types/api/EntityUtilService.d.ts +42 -0
  21. package/dist/types/assets/globalConfig.d.ts +5 -0
  22. package/dist/types/components/AppProvideProxy.d.ts +21 -0
  23. package/dist/types/components/ComponentTreeParser.d.ts +17 -0
  24. package/dist/types/components/FormProvideProxy.d.ts +35 -0
  25. package/dist/types/components/Hooks.d.ts +7 -0
  26. package/dist/types/components/PageDataSourceManager.d.ts +28 -0
  27. package/dist/types/components/PageLoader.d.ts +6 -0
  28. package/dist/types/components/PageProvideProxy.d.ts +413 -0
  29. package/dist/types/components/UiEventNames.d.ts +15 -0
  30. package/dist/types/components/gl-chart/GlChart.vue.d.ts +135 -0
  31. package/dist/types/components/gl-component/GlComponent.vue.d.ts +191 -0
  32. package/dist/types/components/gl-component/GlComponentSupport.d.ts +49 -0
  33. package/dist/types/components/gl-component/GlInsts.vue.d.ts +19 -0
  34. package/dist/types/components/gl-div/GlDiv.vue.d.ts +107 -0
  35. package/dist/types/components/gl-dnd-placeholder/Index.vue.d.ts +112 -0
  36. package/dist/types/components/gl-html/Index.vue.d.ts +7 -0
  37. package/dist/types/components/gl-iconfont/IconsJson.d.ts +15 -0
  38. package/dist/types/components/gl-iconfont/Index.vue.d.ts +19 -0
  39. package/dist/types/components/gl-loader/GlLoader.vue.d.ts +3 -0
  40. package/dist/types/components/gl-login/FloatingActionButton.vue.d.ts +9 -0
  41. package/dist/types/components/gl-login/LoginDialog.vue.d.ts +9 -0
  42. package/dist/types/components/gl-loop/GlLoop.vue.d.ts +230 -0
  43. package/dist/types/components/gl-page-viewer/GlPageViewer.vue.d.ts +221 -0
  44. package/dist/types/components/gl-scanner/GlScanner.vue.d.ts +44 -0
  45. package/dist/types/components/gl-template/GlTemplate.vue.d.ts +154 -0
  46. package/dist/types/components/gl-template/Typs.d.ts +4 -0
  47. package/dist/types/components/gl-virtual/Index.vue.d.ts +3 -0
  48. package/dist/types/components/mixins.d.ts +86 -0
  49. package/dist/types/components/ui-mixins.d.ts +16 -0
  50. package/dist/types/composables/useApiUrl.d.ts +30 -0
  51. package/dist/types/composables/useGlobal.d.ts +21 -0
  52. package/dist/types/composables/useLoading.d.ts +6 -0
  53. package/dist/types/composables/useLogger.d.ts +32 -0
  54. package/dist/types/composables/useMessages.d.ts +15 -0
  55. package/dist/types/composables/useRole.d.ts +5 -0
  56. package/dist/types/locales/index.d.ts +21 -0
  57. package/dist/types/locales/lang/en-US.d.ts +4 -0
  58. package/dist/types/locales/lang/zh-CN.d.ts +4 -0
  59. package/dist/types/m/datasource/ApplicationApi.d.ts +163 -0
  60. package/dist/types/m/datasource/ArcoApi.d.ts +76 -0
  61. package/dist/types/m/datasource/Base.d.ts +99 -0
  62. package/dist/types/m/datasource/BranchApi.d.ts +2 -0
  63. package/dist/types/m/datasource/CompanyApi.d.ts +49 -0
  64. package/dist/types/m/datasource/DictApi.d.ts +127 -0
  65. package/dist/types/m/datasource/DictionaryApi.d.ts +16 -0
  66. package/dist/types/m/datasource/EncodingApi.d.ts +59 -0
  67. package/dist/types/m/datasource/Entry.d.ts +5 -0
  68. package/dist/types/m/datasource/FieldMeta.d.ts +6 -0
  69. package/dist/types/m/datasource/FileApi.d.ts +273 -0
  70. package/dist/types/m/datasource/FileTemplateApi.d.ts +114 -0
  71. package/dist/types/m/datasource/InterApi.d.ts +104 -0
  72. package/dist/types/m/datasource/MarketApi.d.ts +191 -0
  73. package/dist/types/m/datasource/MessageApi.d.ts +27 -0
  74. package/dist/types/m/datasource/ModelApi.d.ts +327 -0
  75. package/dist/types/m/datasource/NoticeApi.d.ts +37 -0
  76. package/dist/types/m/datasource/OcrPdfApi.d.ts +145 -0
  77. package/dist/types/m/datasource/PluginApi.d.ts +35 -0
  78. package/dist/types/m/datasource/ScheduleApi.d.ts +67 -0
  79. package/dist/types/m/datasource/SecurityApi.d.ts +253 -0
  80. package/dist/types/m/datasource/SiteApi.d.ts +38 -0
  81. package/dist/types/m/datasource/SqlApi.d.ts +45 -0
  82. package/dist/types/m/datasource/SysConfigApi.d.ts +52 -0
  83. package/dist/types/m/datasource/TenantApi.d.ts +107 -0
  84. package/dist/types/m/datasource/UserApi.d.ts +173 -0
  85. package/dist/types/m/datasource/VersionApi.d.ts +59 -0
  86. package/dist/types/m/datasource/WeChatApi.d.ts +34 -0
  87. package/dist/types/m/datasource/WorkflowApi.d.ts +317 -0
  88. package/dist/types/m/datasource/ZxingApi.d.ts +38 -0
  89. package/dist/types/main.d.ts +114 -0
  90. package/dist/types/store/index.d.ts +2 -0
  91. package/dist/types/store/modules/user/index.d.ts +16 -0
  92. package/dist/types/types/Operators.d.ts +19 -0
  93. package/dist/types/types/global.d.ts +198 -0
  94. package/dist/types/types/options.d.ts +35 -0
  95. package/dist/types/utils/Auth.d.ts +37 -0
  96. package/dist/types/utils/CacheManager.d.ts +110 -0
  97. package/dist/types/utils/CheckUtil.d.ts +5 -0
  98. package/dist/types/utils/ClipboardUtil.d.ts +24 -0
  99. package/dist/types/utils/ConvertUtil.d.ts +81 -0
  100. package/dist/types/utils/Event.d.ts +2 -0
  101. package/dist/types/utils/FileUtil.d.ts +7 -0
  102. package/dist/types/utils/GenerateUtil.d.ts +14 -0
  103. package/dist/types/utils/IsUtil.d.ts +126 -0
  104. package/dist/types/utils/MixUtil.d.ts +49 -0
  105. package/dist/types/utils/Monitor.d.ts +2 -0
  106. package/dist/types/utils/PageUtil.d.ts +14 -0
  107. package/dist/types/utils/PluginUtil.d.ts +9 -0
  108. package/dist/types/utils/RecordsUtil.d.ts +3 -0
  109. package/dist/types/utils/SseClient.d.ts +34 -0
  110. package/dist/types/utils/StoreUtil.d.ts +8 -0
  111. package/dist/types/utils/StringUtil.d.ts +29 -0
  112. package/dist/types/utils/Utils.d.ts +217 -0
  113. package/dist/types/utils/emitter.d.ts +3 -0
  114. package/dist/types/utils/renderTemplate.d.ts +6 -0
  115. package/dist/types/utils/toChineseCurrency.d.ts +5 -0
  116. package/package.json +76 -0
  117. package/src/main.ts +498 -0
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@geelato/gl-runtime-core",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "src/main.ts",
6
+ "publishConfig": {
7
+ "registry": "https://registry.npmjs.org/",
8
+ "access": "public"
9
+ },
10
+ "types": "./dist/types/main.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "dependencies": {
15
+ "@floating-ui/dom": "^1.7.4",
16
+ "@vueuse/core": "^9.3.0",
17
+ "@zxing/library": "^0.21.3",
18
+ "axios": "1.8.3",
19
+ "b-validate": "^1.4.6",
20
+ "big.js": "^6.2.1",
21
+ "cron-parser": "4.9.0",
22
+ "dayjs": "^1.11.5",
23
+ "echarts": "5.6.0",
24
+ "mitt": "^3.0.0",
25
+ "moment": "^2.30.1",
26
+ "store": "^2.0.12",
27
+ "vue": "3.5.13",
28
+ "vue-i18n": "11.0.0",
29
+ "vue-router": "4.5.0",
30
+ "xlsx": "^0.18.5",
31
+ "xlsx-js-style": "^1.2.0",
32
+ "@geelato/gl-ui-schema": "1.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@playwright/test": "1.51.0",
36
+ "@tsconfig/node22": "22.0.0",
37
+ "@types/big.js": "6.2.2",
38
+ "@types/jsdom": "21.1.7",
39
+ "@types/lodash": "4.17.16",
40
+ "@types/node": "22.13.9",
41
+ "@vitejs/plugin-vue": "5.2.1",
42
+ "@vitejs/plugin-vue-jsx": "4.1.1",
43
+ "@vitest/eslint-plugin": "1.1.36",
44
+ "@vue/eslint-config-prettier": "10.2.0",
45
+ "@vue/eslint-config-typescript": "14.5.0",
46
+ "@vue/test-utils": "2.4.6",
47
+ "@vue/tsconfig": "0.7.0",
48
+ "eslint": "9.21.0",
49
+ "eslint-plugin-playwright": "2.2.0",
50
+ "eslint-plugin-vue": "10.0.0",
51
+ "jiti": "2.4.2",
52
+ "jsdom": "26.0.0",
53
+ "npm-run-all2": "7.0.2",
54
+ "prettier": "3.5.3",
55
+ "typescript": "5.8.2",
56
+ "vite": "6.3.5",
57
+ "vite-plugin-compression2": "^1.3.3",
58
+ "vite-plugin-dts": "4.5.3",
59
+ "vite-plugin-vue-devtools": "7.7.2",
60
+ "vitest": "3.2.4",
61
+ "vue-tsc": "2.2.8",
62
+ "@geelato/gl-types": "1.0.0"
63
+ },
64
+ "scripts": {
65
+ "dev": "vite",
66
+ "build": "run-p type-check \"build-only {@}\" --",
67
+ "preview": "vite preview",
68
+ "test:unit": "vitest",
69
+ "test:e2e": "playwright test",
70
+ "build-only": "vite build",
71
+ "type-check": "vue-tsc --build",
72
+ "lint": "eslint . --fix",
73
+ "format": "prettier --write src/",
74
+ "custom-script": "echo 'This is a custom script'"
75
+ }
76
+ }
package/src/main.ts ADDED
@@ -0,0 +1,498 @@
1
+ import {type App, reactive} from 'vue'
2
+ import Big from 'big.js'
3
+ import emitter from './utils/emitter.ts'
4
+ import * as authUtil from './utils/Auth'
5
+ import {isLogin} from './utils/Auth'
6
+ import * as eventUtil from './utils/Event'
7
+ import PageProvideProxy, {
8
+ addInnerComponentPosition,
9
+ PageParamsKey,
10
+ PageProvideKey,
11
+ paramStringify
12
+ } from './components/PageProvideProxy'
13
+ import GlHtml from './components/gl-html/Index.vue'
14
+ import GlIconfont from './components/gl-iconfont/Index.vue'
15
+ import GlVirtual from './components/gl-virtual/Index.vue'
16
+ import GlDiv from './components/gl-div/GlDiv.vue'
17
+ import GlDndPlaceholder from './components/gl-dnd-placeholder/Index.vue'
18
+ import GlComponent from './components/gl-component/GlComponent.vue'
19
+ import GlPageViewer from './components/gl-page-viewer/GlPageViewer.vue'
20
+ import {IconsJson} from './components/gl-iconfont/IconsJson'
21
+ import {EntityApi, entityApi} from './api/EntityApi.ts'
22
+ import utils from './utils/Utils'
23
+ import mixins from './components/mixins'
24
+ import PluginUtil from './utils/PluginUtil'
25
+ import useGlobal from './composables/useGlobal.ts'
26
+ import useApiUrl from './composables/useApiUrl.ts'
27
+ import useMessages from './composables/useMessages.ts'
28
+ import jsScriptExecutor from './actions/JsScriptExecutor.ts'
29
+ import AppProvideProxy, {AppProvideKey} from './components/AppProvideProxy'
30
+ import FormProvideProxy, {FormProvideKey, SubmitFormResult} from './components/FormProvideProxy'
31
+ import {Schema} from 'b-validate'
32
+ import type {Geelato, GeelatoPlugin, GeelatoPluginOptions} from './types/global.ts'
33
+ import {
34
+ executeArrayExpressions,
35
+ executeObjectPropsExpressions,
36
+ createValidator
37
+ } from './components/gl-component/GlComponentSupport'
38
+ import GlLoginDialog from './components/gl-login/LoginDialog.vue'
39
+ import GlFloatingActionButton from './components/gl-login/FloatingActionButton.vue'
40
+ /* 接口 */
41
+ import type {AppState, QueryAppForm, QueryMenuForm,QueryMultiLangForm} from './m/datasource/ApplicationApi'
42
+ import * as applicationApi from './m/datasource/ApplicationApi'
43
+ import type {
44
+ FormParams,
45
+ FormState,
46
+ HttpResponse,
47
+ ListParams,
48
+ ModelParams,
49
+ PageQueryFilter,
50
+ PageQueryRequest,
51
+ PageQueryResponse,
52
+ Pagination,
53
+ QueryResult,
54
+ SelectOption
55
+ } from './m/datasource/Base'
56
+ import type {QueryCompanyForm} from './m/datasource/CompanyApi'
57
+ import * as companyApi from './m/datasource/CompanyApi'
58
+ import type {QueryDictForm, QueryDictItemForm} from './m/datasource/DictApi'
59
+ import * as dictApi from './m/datasource/DictApi'
60
+ import * as dictionaryApi from './m/datasource/DictionaryApi'
61
+ import type {EncodingItem, QueryEncodingForm} from './m/datasource/EncodingApi'
62
+ import * as encodingApi from './m/datasource/EncodingApi'
63
+ import type {AttachmentForm, Base64FileParams, UploadFileParams} from './m/datasource/FileApi'
64
+ import * as fileApi from './m/datasource/FileApi'
65
+ import type {
66
+ BusinessMetaData,
67
+ BusinessRuleData,
68
+ BusinessTypeData,
69
+ QueryFileTemplateForm
70
+ } from './m/datasource/FileTemplateApi'
71
+ import * as fileTemplateApi from './m/datasource/FileTemplateApi'
72
+ import {ApiDataType, ApiParamType, ResponseFormat} from './m/datasource/InterApi'
73
+ import type {QueryApiForm, QueryApiParamForm} from './m/datasource/InterApi'
74
+ import * as interApi from './m/datasource/InterApi'
75
+ import type {ChatRecord, MessageListType, MessageRecord} from './m/datasource/MessageApi'
76
+ import * as messageApi from './m/datasource/MessageApi'
77
+ import type {NoticeListType, NoticeRecord} from './m/datasource/NoticeApi'
78
+ import * as noticeApi from './m/datasource/NoticeApi'
79
+ import type {
80
+ ColumnSelectType,
81
+ DataTypeRadius,
82
+ QueryAppTableForm,
83
+ QueryAppViewForm,
84
+ QueryConnectForm,
85
+ QueryMultiComponentForm,
86
+ QueryTableCheckForm,
87
+ QueryTableColumnForm,
88
+ QueryTableForeignForm,
89
+ QueryTableForm,
90
+ QueryViewForm
91
+ } from './m/datasource/ModelApi'
92
+ import * as modelApi from './m/datasource/ModelApi'
93
+ import type {
94
+ OcrPdfContentForm,
95
+ PDFAnnotationDiscernRuleForm,
96
+ PDFAnnotationMetaForm,
97
+ PDFAnnotationPickContentForm,
98
+ QueryOcrPdfForm,
99
+ QueryOcrPdfMetaForm
100
+ } from './m/datasource/OcrPdfApi'
101
+ import * as ocrPdfApi from './m/datasource/OcrPdfApi'
102
+ import * as pluginApi from './m/datasource/PluginApi'
103
+ import type {QueryScheduleForm, QueryScheduleLogForm} from './m/datasource/ScheduleApi'
104
+ import * as scheduleApi from './m/datasource/ScheduleApi'
105
+ import type {QueryAppSqlForm, QuerySqlForm} from './m/datasource/SqlApi'
106
+ import * as sqlApi from './m/datasource/SqlApi'
107
+ import type {
108
+ QueryColumnRolePermissionForm,
109
+ QueryOrgForm,
110
+ QueryOrgUserForm,
111
+ QueryPermissionClassifyForm,
112
+ QueryPermissionForm,
113
+ QueryRoleAppForm,
114
+ QueryRoleForm,
115
+ QueryRolePermissionForm,
116
+ QueryRoleTreeNodeForm,
117
+ QueryRoleUserForm,
118
+ QueryTableRolePermissionClassifyForm,
119
+ QueryTableRolePermissionForm,
120
+ QueryTreeNodeForm,
121
+ QueryUserForm
122
+ } from './m/datasource/SecurityApi'
123
+ import * as securityApi from './m/datasource/SecurityApi'
124
+ import type {QuerySysConfigForm} from './m/datasource/SysConfigApi'
125
+ import * as sysConfigApi from './m/datasource/SysConfigApi'
126
+ import type {TenantBaseForm, TenantIndexForm, TenantState} from './m/datasource/TenantApi'
127
+ import * as tenantApi from './m/datasource/TenantApi'
128
+ import type {
129
+ AccountUserInfo,
130
+ AuthCodeForm,
131
+ BindAccountData,
132
+ LoginData,
133
+ LoginRes,
134
+ ResetPasswordForm,
135
+ UserState
136
+ } from './m/datasource/UserApi'
137
+ import * as userApi from './m/datasource/UserApi'
138
+ import type {QueryAppVersionForm} from './m/datasource/VersionApi'
139
+ import * as versionApi from './m/datasource/VersionApi'
140
+ import * as weChatApi from './m/datasource/WeChatApi'
141
+ import type {QueryBarcodeForm} from './m/datasource/ZxingApi'
142
+ import * as zxingApi from './m/datasource/ZxingApi'
143
+ import type {QueryFileInfoForm, QueryStaticSiteForm} from './m/datasource/SiteApi'
144
+ import * as siteApi from './m/datasource/SiteApi'
145
+ import * as arcoApi from './m/datasource/ArcoApi'
146
+ import {SelectOptionType} from './m/datasource/ArcoApi'
147
+ import {marketApi, applyApp} from './m/datasource/MarketApi'
148
+ import {useUserStore} from "./store/index";
149
+ import * as branchApi from './m/datasource/BranchApi'
150
+ /* 接口 */
151
+ import Operators from './types/Operators.ts'
152
+ import GlInsts from './components/gl-component/GlInsts.vue'
153
+ import UiEventNames from './components/UiEventNames'
154
+ import GlLoop from './components/gl-loop/GlLoop.vue'
155
+ import GlTemplate from './components/gl-template/GlTemplate.vue'
156
+ import GlChart from './components/gl-chart/GlChart.vue'
157
+ import GlLoader from './components/gl-loader/GlLoader.vue'
158
+ import useLogger from './composables/useLogger.ts'
159
+ import useLoading from './composables/useLoading.ts'
160
+ import {loadPageContent} from './components/PageLoader'
161
+ import {CacheManager, CacheStorageType, defaultCacheManager, memoryCacheManager} from './utils/CacheManager'
162
+ import './assets/style.css'
163
+ // 使用 require 语法导入 JSON 文件
164
+ // @ts-ignore
165
+ import * as iconsJsonModule from './assets/iconfont.json'
166
+ // @ts-ignore
167
+ const iconsJson = iconsJsonModule.default || iconsJsonModule
168
+ export { sseClient, initRuntimeSse, UPGRADE_DICTIONARY_TOPIC } from './utils/SseClient'
169
+ // 只导出原index.ts中的两个API
170
+ export * from './m/datasource/NoticeApi'
171
+ export * from './m/datasource/PluginApi'
172
+ export * from './m/datasource/WorkflowApi'
173
+
174
+ // 补充缺失的导出(修复深度引用问题)
175
+ export { EntityQueryService } from './api/EntityQueryService'
176
+ export { executeInstPropsExpressions } from './components/gl-component/GlComponentSupport'
177
+ export { innerComponents } from './components/PageProvideProxy'
178
+ export { getBearerToken } from './utils/Auth'
179
+
180
+ export type {
181
+ PdfAnnotationArea,
182
+ ApiPagedResult,
183
+ ApiResult,
184
+ CellMeta,
185
+ I18nMessages,
186
+ BasePlugin,
187
+ PageConfig,
188
+ Param,
189
+ ParamMeta
190
+ } from './types/global.ts'
191
+ export {
192
+ PageStatus,
193
+ PageType,
194
+ CellValueTypeOptions,
195
+ ApiResultStatus,
196
+ CellValueType
197
+ } from './types/options.ts'
198
+
199
+ export * from './components/ComponentTreeParser'
200
+ export type {
201
+ PageCustomType,
202
+ PageParamConfigType,
203
+ PagePermission,
204
+ IPageTemplate
205
+ } from './components/PageProvideProxy'
206
+ export {
207
+ PageTemplate,
208
+ StateWorkflowTransfer,
209
+ WorkflowPageTemplate
210
+ } from './components/PageProvideProxy'
211
+
212
+ // 显式导出 EntityDataSource.ts 中的内容,替代 export * from './api/EntityDataSource.ts'
213
+ export {
214
+ compareMeta,
215
+ EntityDataSource,
216
+ fetchEvents,
217
+ FieldMeta,
218
+ EntityLiteMeta,
219
+ EntityMeta,
220
+ EntitySaverField,
221
+ EntityReaderParam,
222
+ EntityReaderParamGroup,
223
+ TriggerMode,
224
+ TriggerConstraint,
225
+ EntityReaderOrderEnum,
226
+ EntityReaderOrder,
227
+ EntityReader,
228
+ EntityRecordStatus,
229
+ EntityDeleter,
230
+ EntitySaver,
231
+ GetEntitySaversResult,
232
+ isStopLoadDataByValue,
233
+ isStopLoadDataByParams,
234
+ isEntityQueryAble
235
+ } from './api/EntityDataSource.ts'
236
+
237
+ // 直接导出
238
+ export * from './components/Hooks'
239
+ export { default as runtimeI18n, setI18nLanguage, loadLanguageAsync, i18nRender, mergeLocaleMessages, mergeMessages, useLocaleRef, tLabel, ensureI18nKeys } from './locales'
240
+
241
+ const RuleExpression: string = '_RuleExpression'
242
+
243
+ const vuePlugin = {
244
+ install: function (app: App, options?: GeelatoPluginOptions): any {
245
+ if (PluginUtil.markInstalledPlugin(app, 'gl-runtime-core')) {
246
+ return
247
+ }
248
+
249
+ // 设置entityApi的依赖库
250
+ if (options?.axios) {
251
+ entityApi.setup(options.axios)
252
+ }
253
+
254
+ jsScriptExecutor.setApp(app)
255
+
256
+ // 注册组件
257
+ app.component(GlInsts.name!, GlInsts)
258
+ app.component(GlDiv.name!, GlDiv)
259
+ app.component(GlVirtual.name!, GlVirtual)
260
+ app.component(GlIconfont.name!, GlIconfont)
261
+ app.component(GlHtml.name!, GlHtml)
262
+ app.component(GlDndPlaceholder.name!, GlDndPlaceholder)
263
+ app.component(GlComponent.name!, GlComponent)
264
+ app.component(GlPageViewer.name!, GlPageViewer)
265
+ app.component(GlLoop.name!, GlLoop)
266
+ app.component(GlTemplate.name!, GlTemplate)
267
+ app.component(GlChart.name!, GlChart)
268
+ app.component(GlLoader.name!, GlLoader)
269
+ app.component(GlLoginDialog.name!, GlLoginDialog)
270
+ app.component(GlFloatingActionButton.name!, GlFloatingActionButton)
271
+
272
+ if (!app.config.globalProperties.$gl) {
273
+ app.config.globalProperties.$gl = reactive({
274
+ alias: {},
275
+ utils: utils
276
+ })
277
+ }
278
+
279
+ // 别名,用于生成组件id时,作为前缀
280
+ app.config.globalProperties.$gl.alias['GlIconfont'] = 'icon'
281
+ app.config.globalProperties.$gl.alias[GlHtml.name!] = 'html'
282
+ app.config.globalProperties.$gl.alias['GlComponent'] = 'c'
283
+ app.config.globalProperties.$gl.alias[GlDndPlaceholder.name!] = 'dndph'
284
+ },
285
+ }
286
+
287
+ /**
288
+ * 选择组件,用于设计时,点击组件的内置组件时,触发选中组件事件
289
+ * @param event
290
+ * @param inst
291
+ * @param isRuntime
292
+ * @param item 可能是一个表格的列column,也可能是一个查询条件queryItem
293
+ * @param ctx 需要在脚本编排面板的ctx上下文展示的内容,便于设计时选择
294
+ */
295
+ const selectComponent = (
296
+ event: any,
297
+ inst: any,
298
+ isRuntime: boolean,
299
+ item?: any,
300
+ ctx?: { record: any }
301
+ ) => {
302
+ if (item) {
303
+ console.log('selectComponent', inst.props?.bindField, item)
304
+ }
305
+
306
+ // 在设计时
307
+ if (!isRuntime) {
308
+ const targetEl = event?.target as HTMLElement | null
309
+ const inRefPage = !!targetEl?.closest?.('.gl-ref-page')
310
+ const inRefPageDragHandler = !!targetEl?.closest?.('.gl-ref-page-drag-handler')
311
+ if (inRefPage && !inRefPageDragHandler) {
312
+ return
313
+ }
314
+ // 不触发事件默认事件,触发选中组件事件
315
+ event.stopPropagation()
316
+ event.preventDefault()
317
+ emitter.emit(UiEventNames.Base.SelectComponent, inst)
318
+ // 同时将上下文元数据信息,写到本地缓存中,方便在脚本编排面板中选择
319
+ localStorage.setItem(
320
+ 'gl-select-component@designTime',
321
+ JSON.stringify({
322
+ id: inst.id,
323
+ componentName: inst.componentName,
324
+ ctx
325
+ })
326
+ )
327
+ }
328
+ }
329
+ export {
330
+ Geelato,
331
+ GeelatoPlugin,
332
+ GeelatoPluginOptions,
333
+ RuleExpression,
334
+ isLogin,
335
+ selectComponent,
336
+ Big,
337
+ AppProvideKey,
338
+ AppProvideProxy,
339
+ PageParamsKey,
340
+ PageProvideKey,
341
+ PageProvideProxy,
342
+ addInnerComponentPosition,
343
+ loadPageContent,
344
+ paramStringify,
345
+ FormProvideKey,
346
+ FormProvideProxy,
347
+ Schema,
348
+ GlIconfont,
349
+ GlPageViewer,
350
+ EntityApi,
351
+ entityApi,
352
+ utils,
353
+ authUtil,
354
+ eventUtil,
355
+ mixins,
356
+ emitter,
357
+ iconsJson,
358
+ IconsJson,
359
+ PluginUtil,
360
+ useGlobal,
361
+ useApiUrl,
362
+ useMessages,
363
+ useLogger,
364
+ useLoading,
365
+ jsScriptExecutor,
366
+ /* 接口 */
367
+ applicationApi,
368
+ AppState,
369
+ QueryAppForm,
370
+ QueryMenuForm,
371
+ QueryMultiLangForm,
372
+ HttpResponse,
373
+ PageQueryRequest,
374
+ PageQueryResponse,
375
+ Pagination,
376
+ QueryResult,
377
+ SelectOption,
378
+ ListParams,
379
+ FormState,
380
+ PageQueryFilter,
381
+ FormParams,
382
+ ModelParams,
383
+ companyApi,
384
+ QueryCompanyForm,
385
+ dictApi,
386
+ dictionaryApi,
387
+ QueryDictForm,
388
+ QueryDictItemForm,
389
+ encodingApi,
390
+ EncodingItem,
391
+ QueryEncodingForm,
392
+ fileApi,
393
+ AttachmentForm,
394
+ Base64FileParams,
395
+ UploadFileParams,
396
+ fileTemplateApi,
397
+ BusinessTypeData,
398
+ BusinessRuleData,
399
+ BusinessMetaData,
400
+ QueryFileTemplateForm,
401
+ interApi,
402
+ QueryApiParamForm,
403
+ QueryApiForm,
404
+ ApiParamType,
405
+ ApiDataType,
406
+ ResponseFormat,
407
+ messageApi,
408
+ ChatRecord,
409
+ MessageListType,
410
+ MessageRecord,
411
+ noticeApi,
412
+ NoticeListType,
413
+ NoticeRecord,
414
+ modelApi,
415
+ QueryOcrPdfForm,
416
+ QueryOcrPdfMetaForm,
417
+ PDFAnnotationMetaForm,
418
+ OcrPdfContentForm,
419
+ PDFAnnotationPickContentForm,
420
+ PDFAnnotationDiscernRuleForm,
421
+ ocrPdfApi,
422
+ DataTypeRadius,
423
+ ColumnSelectType,
424
+ QueryAppTableForm,
425
+ QueryAppViewForm,
426
+ QueryConnectForm,
427
+ QueryMultiComponentForm,
428
+ QueryTableColumnForm,
429
+ QueryTableForeignForm,
430
+ QueryTableForm,
431
+ QueryViewForm,
432
+ QueryTableCheckForm,
433
+ scheduleApi,
434
+ QueryScheduleForm,
435
+ QueryScheduleLogForm,
436
+ sqlApi,
437
+ QueryAppSqlForm,
438
+ QuerySqlForm,
439
+ securityApi,
440
+ QueryOrgForm,
441
+ QueryUserForm,
442
+ QueryOrgUserForm,
443
+ QueryPermissionForm,
444
+ QueryPermissionClassifyForm,
445
+ QueryTableRolePermissionClassifyForm,
446
+ QueryTreeNodeForm,
447
+ QueryRoleForm,
448
+ QueryRoleAppForm,
449
+ QueryRoleUserForm,
450
+ QueryRoleTreeNodeForm,
451
+ QueryRolePermissionForm,
452
+ QueryTableRolePermissionForm,
453
+ QueryColumnRolePermissionForm,
454
+ sysConfigApi,
455
+ QuerySysConfigForm,
456
+ tenantApi,
457
+ TenantState,
458
+ TenantBaseForm,
459
+ TenantIndexForm,
460
+ userApi,
461
+ AccountUserInfo,
462
+ AuthCodeForm,
463
+ BindAccountData,
464
+ LoginData,
465
+ LoginRes,
466
+ ResetPasswordForm,
467
+ UserState,
468
+ versionApi,
469
+ QueryAppVersionForm,
470
+ weChatApi,
471
+ zxingApi,
472
+ QueryBarcodeForm,
473
+ siteApi,
474
+ QueryStaticSiteForm,
475
+ QueryFileInfoForm,
476
+ arcoApi,
477
+ SelectOptionType,
478
+ marketApi,
479
+ applyApp,
480
+ branchApi,
481
+ pluginApi,
482
+ /* 接口 */
483
+ useUserStore,
484
+ createValidator,
485
+ executeObjectPropsExpressions,
486
+ executeArrayExpressions,
487
+ SubmitFormResult,
488
+ UiEventNames,
489
+ Operators,
490
+ CacheManager,
491
+ CacheStorageType,
492
+ defaultCacheManager,
493
+ memoryCacheManager,
494
+ GlTemplate
495
+ }
496
+ export { hasRole, hasAnyRole, hasAllRoles, withoutRole, checkRolePermission } from './composables/useRole'
497
+ // 默认导出组件
498
+ export default vuePlugin