@oinone/kunlun-vue-admin-base 6.2.10 → 6.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/oinone-kunlun-vue-admin-base.css +1 -1
  2. package/dist/oinone-kunlun-vue-admin-base.esm.js +9602 -9235
  3. package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
  4. package/dist/types/src/action/component/action/ActionWidget.d.ts +10 -1
  5. package/dist/types/src/action/server-actions/ServerActionWidget.d.ts +1 -5
  6. package/dist/types/src/action/url-actions/UrlActionWidget.d.ts +1 -3
  7. package/dist/types/src/basic/field/complex/select/FormSelectComplexFieldWidget.d.ts +8 -2
  8. package/dist/types/src/basic/table-column/BaseTableColumnWidget.d.ts +3 -0
  9. package/dist/types/src/components/upload/File.vue.d.ts +0 -9
  10. package/dist/types/src/field/detail/enum/multi/DetailEnumMultiFieldWidget.d.ts +2 -1
  11. package/dist/types/src/field/detail/enum/single/DetailEnumFieldWidget.d.ts +2 -1
  12. package/dist/types/src/field/detail/index.d.ts +0 -1
  13. package/dist/types/src/field/detail/m2m/select/DetailM2MSelectFieldWidget.d.ts +1 -1
  14. package/dist/types/src/field/detail/o2m/index.d.ts +1 -0
  15. package/dist/types/src/field/detail/o2m/{DetailO2MSelectFieldWidget.d.ts → select/DetailO2MSelectFieldWidget.d.ts} +1 -1
  16. package/dist/types/src/field/form/abstract/FormInputAbstractFieldWidget.d.ts +22 -18
  17. package/dist/types/src/field/form/abstract/checkbox/FormCheckboxWidget.d.ts +1 -1
  18. package/dist/types/src/field/form/{enum/radio → boolean}/FormBooleanRadioFieldWidget.d.ts +4 -2
  19. package/dist/types/src/field/form/{enum/select/bool → boolean}/FormBooleanSelectFieldWidget.d.ts +2 -2
  20. package/dist/types/src/field/form/boolean/index.d.ts +2 -0
  21. package/dist/types/src/field/form/enum/FormEnumFieldAbstractWidget.d.ts +17 -5
  22. package/dist/types/src/field/form/enum/checkbox/FormEnumMultiCheckboxFieldWidget.d.ts +1 -0
  23. package/dist/types/src/field/form/enum/index.d.ts +1 -0
  24. package/dist/types/src/field/form/enum/radio/FormEnumRadioWidget.d.ts +4 -1
  25. package/dist/types/src/field/form/enum/radio/index.d.ts +0 -1
  26. package/dist/types/src/field/form/enum/select/index.d.ts +0 -1
  27. package/dist/types/src/field/form/enum/select/multi/FormEnumMultiSelectFieldWidget.d.ts +2 -1
  28. package/dist/types/src/field/form/enum/select/single/FormEnumFieldWidget.d.ts +2 -1
  29. package/dist/types/src/field/form/float/Plat.vue.d.ts +2 -2
  30. package/dist/types/src/field/form/index.d.ts +1 -2
  31. package/dist/types/src/field/form/integer/FormIntegerFieldWidget.d.ts +0 -1
  32. package/dist/types/src/field/form/m2o/upload/FormM2OUploadFieldWidget.d.ts +0 -1
  33. package/dist/types/src/field/form/o2o/index.d.ts +1 -0
  34. package/dist/types/src/field/form/o2o/upload/AbstractFormO2OUploadFieldWidget.d.ts +5 -0
  35. package/dist/types/src/field/form/o2o/upload/FormO2OUploadDraggableFieldWidget.d.ts +8 -0
  36. package/dist/types/src/field/form/o2o/upload/FormO2OUploadFieldWidget.d.ts +7 -0
  37. package/dist/types/src/field/form/o2o/upload/FormO2OUploadImgFieldWidget.d.ts +8 -0
  38. package/dist/types/src/field/form/o2o/upload/index.d.ts +4 -0
  39. package/dist/types/src/field/form/string/FormStringFieldWidget.d.ts +12 -3
  40. package/dist/types/src/field/form/string/iframe/FormStringIframeFieldWidget.d.ts +1 -0
  41. package/dist/types/src/field/form/string/media/FormStringMediaPlayerFieldWidget.d.ts +1 -0
  42. package/dist/types/src/field/form/string/tag/Tag.vue.d.ts +6 -6
  43. package/dist/types/src/field/form/string/upload/FormStringUploadFieldWidget.d.ts +11 -2
  44. package/dist/types/src/field/form/text/DefaultTextarea.vue.d.ts +4 -6
  45. package/dist/types/src/field/form/text/FormTextFieldWidget.d.ts +3 -1
  46. package/dist/types/src/field/form/text/index.d.ts +1 -0
  47. package/dist/types/src/field/form/text/typing.d.ts +4 -0
  48. package/dist/types/src/field/table/boolean/TableBooleanRadioFieldWidget.d.ts +3 -0
  49. package/dist/types/src/field/table/boolean/index.d.ts +1 -0
  50. package/dist/types/src/field/table/string/upload/TableStringMultiUploadWidget.d.ts +1 -1
  51. package/dist/types/src/provider/RootWidget.d.ts +2 -2
  52. package/dist/types/src/spi/LayoutManager.d.ts +20 -17
  53. package/dist/types/src/spi/MaskManager.d.ts +33 -5
  54. package/dist/types/src/tags/context/runtime-context-helper.d.ts +1 -0
  55. package/dist/types/src/typing/widget-names.d.ts +1 -0
  56. package/package.json +8 -8
  57. package/src/action/component/action/ActionWidget.ts +203 -28
  58. package/src/action/server-actions/ServerActionWidget.ts +6 -104
  59. package/src/action/url-actions/UrlActionWidget.ts +2 -37
  60. package/src/basic/element/BaseElementViewWidget.ts +11 -2
  61. package/src/basic/field/complex/select/FormSelectComplexFieldWidget.ts +24 -32
  62. package/src/basic/form-item/BaseFormItemWidget.ts +4 -0
  63. package/src/basic/gallery-item/DefaultGalleryItem.vue +6 -1
  64. package/src/basic/table-column/BaseTableColumnWidget.ts +5 -2
  65. package/src/components/upload/File.vue +0 -45
  66. package/src/field/detail/boolean/Boolean.vue +2 -3
  67. package/src/field/detail/boolean/DetailBooleanFieldWidget.ts +1 -1
  68. package/src/field/detail/boolean/DetailBooleanSelectFieldWidget.ts +1 -1
  69. package/src/field/detail/enum/multi/DetailEnumMultiFieldWidget.ts +9 -5
  70. package/src/field/detail/enum/single/DetailEnumFieldWidget.ts +8 -2
  71. package/src/field/detail/html/DetailHtmlFieldWidget.ts +1 -1
  72. package/src/field/detail/index.ts +0 -1
  73. package/src/field/detail/m2m/select/DetailM2MSelectFieldWidget.ts +3 -5
  74. package/src/field/detail/m2m/table/DetailM2MTableFieldWidget.ts +3 -1
  75. package/src/field/detail/m2o/DetailM2OSelectFieldWidget.ts +1 -1
  76. package/src/field/detail/m2o/upload/DetailM2OUploadWidget.ts +2 -3
  77. package/src/field/detail/number/DetailNumberWidget.ts +1 -1
  78. package/src/field/detail/o2m/index.ts +1 -0
  79. package/src/field/detail/o2m/{DetailO2MSelectFieldWidget.ts → select/DetailO2MSelectFieldWidget.ts} +4 -5
  80. package/src/field/detail/o2m/{Select.vue → select/Select.vue} +1 -1
  81. package/src/field/detail/o2m/table/DetailO2MTableFieldWidget.ts +3 -1
  82. package/src/field/detail/o2o/DetailO2OSelectFieldWidget.ts +1 -1
  83. package/src/field/detail/string/hyperlinks/DetailStringHyperlinksFieldWidget.ts +1 -1
  84. package/src/field/detail/string/iframe/DetailStringIframeFieldWidget.ts +2 -2
  85. package/src/field/detail/string/media/DetailStringMediaPlayerFieldWidget.ts +1 -1
  86. package/src/field/detail/string/string-with-copy/DetailStringWithCopyFieldWidget.ts +1 -1
  87. package/src/field/detail/string/tag/DetailStringTagFieldWidget.ts +1 -1
  88. package/src/field/detail/string/upload/DetailStringUploadFieldWidget.ts +1 -1
  89. package/src/field/detail/string/upload/DetailStringUploadImgFieldWidget.ts +1 -1
  90. package/src/field/form/abstract/FormInputAbstractFieldWidget.ts +54 -50
  91. package/src/field/form/abstract/checkbox/FormCheckboxWidget.ts +1 -3
  92. package/src/field/form/{enum/radio → boolean}/FormBooleanRadioFieldWidget.ts +22 -4
  93. package/src/field/form/{enum/select/bool → boolean}/FormBooleanSelectFieldWidget.ts +4 -5
  94. package/src/field/form/boolean/index.ts +2 -0
  95. package/src/field/form/enum/FormEnumFieldAbstractWidget.ts +42 -33
  96. package/src/field/form/enum/checkbox/FormEnumMultiCheckboxFieldWidget.ts +9 -1
  97. package/src/field/form/enum/index.ts +2 -1
  98. package/src/field/form/enum/radio/FormEnumRadioWidget.ts +21 -8
  99. package/src/field/form/enum/radio/index.ts +0 -1
  100. package/src/field/form/enum/select/index.ts +0 -1
  101. package/src/field/form/enum/select/multi/FormEnumMultiSelectFieldWidget.ts +2 -1
  102. package/src/field/form/enum/select/single/FormEnumFieldWidget.ts +2 -1
  103. package/src/field/form/index.ts +1 -3
  104. package/src/field/form/integer/FormIntegerFieldWidget.ts +0 -5
  105. package/src/field/form/integer/FormIntegerSliderFieldWidget.ts +1 -1
  106. package/src/field/form/integer/FormIntegerTagFieldWidget.ts +1 -0
  107. package/src/field/form/m2m/select/FormM2MFieldSelectWidget.ts +2 -2
  108. package/src/field/form/m2m/table/FormM2MTableFieldWidget.ts +2 -0
  109. package/src/field/form/m2m/upload/FormM2MUploadFieldWidget.ts +3 -3
  110. package/src/field/form/m2m/upload/FormM2MUploadImgFieldWidget.ts +1 -1
  111. package/src/field/form/m2o/form/FormM2OFormFieldWidget.ts +1 -1
  112. package/src/field/form/m2o/upload/FormM2OUploadFieldWidget.ts +2 -9
  113. package/src/field/form/m2o/upload/FormM2OUploadImgFieldWidget.ts +1 -1
  114. package/src/field/form/o2m/table/FormO2MTableFieldWidget.ts +2 -0
  115. package/src/field/form/o2m/upload/FormO2MUploadImgFieldWidget.ts +1 -1
  116. package/src/field/form/o2o/index.ts +1 -0
  117. package/src/field/form/o2o/upload/AbstractFormO2OUploadFieldWidget.ts +18 -0
  118. package/src/field/form/o2o/upload/FormO2OUploadDraggableFieldWidget.ts +47 -0
  119. package/src/field/form/o2o/upload/FormO2OUploadFieldWidget.ts +42 -0
  120. package/src/field/form/o2o/upload/FormO2OUploadImgFieldWidget.ts +62 -0
  121. package/src/field/form/o2o/upload/index.ts +4 -0
  122. package/src/field/form/string/DefaultString.vue +2 -2
  123. package/src/field/form/string/FormStringFieldWidget.ts +36 -27
  124. package/src/field/form/string/download/DefaultDownload.vue +1 -0
  125. package/src/field/form/string/iframe/FormStringIframeFieldWidget.ts +8 -1
  126. package/src/field/form/string/input/FormStringInputFieldWidget.ts +0 -4
  127. package/src/field/form/string/media/FormStringMediaPlayerFieldWidget.ts +7 -2
  128. package/src/field/form/string/media/FormStringMultiMediaPlayerFieldWidget.ts +1 -1
  129. package/src/field/form/string/tag/Tag.vue +0 -3
  130. package/src/field/form/string/upload/FormStringUploadFieldWidget.ts +24 -17
  131. package/src/field/form/string/upload/FormStringUploadImgFieldWidget.ts +1 -1
  132. package/src/field/form/text/DefaultTextarea.vue +11 -5
  133. package/src/field/form/text/FormTextFieldWidget.ts +32 -5
  134. package/src/field/form/text/index.ts +1 -0
  135. package/src/field/form/text/typing.ts +1 -0
  136. package/src/field/gallery/boolean/GalleryBooleanFieldWidget.ts +7 -3
  137. package/src/field/gallery/boolean/GalleryBooleanSelectFieldWidget.ts +1 -1
  138. package/src/field/gallery/common/GalleryCommonField.vue +7 -1
  139. package/src/field/gallery/common/GalleryCommonFieldWidget.ts +2 -8
  140. package/src/field/gallery/enum/single/GalleryEnumTagFieldWidget.ts +1 -1
  141. package/src/field/gallery/html/GalleryHtmlFieldWidget.ts +2 -2
  142. package/src/field/gallery/m2m/GalleryM2MSelectFieldWidget.ts +1 -1
  143. package/src/field/gallery/m2o/GalleryM2OSelectFieldWidget.ts +1 -1
  144. package/src/field/gallery/o2m/GalleryO2MSelectFieldWidget.ts +1 -1
  145. package/src/field/gallery/o2o/GalleryO2OSelectFieldWidget.ts +1 -1
  146. package/src/field/gallery/string/default/GalleryStringFieldWidget.ts +1 -2
  147. package/src/field/gallery/string/hyperlinks/GalleryStringHyperlinksFieldWidget.ts +1 -1
  148. package/src/field/gallery/string/iframe/GalleryStringIframeFieldWidget.ts +2 -2
  149. package/src/field/gallery/string/media-player/GalleryStringMediaPlayerWidget.ts +1 -1
  150. package/src/field/gallery/string/string-tag/GalleryStringTagStringFieldWidget.ts +1 -1
  151. package/src/field/gallery/string/tag/GalleryStringTagFieldWidget.ts +1 -1
  152. package/src/field/gallery/text-content/number/GalleryNumberTextContentWidget.ts +1 -1
  153. package/src/field/gallery/text-content/string/GalleryStringTextContentWidget.ts +1 -1
  154. package/src/field/table/boolean/TableBooleanFieldWidget.ts +7 -2
  155. package/src/field/table/boolean/TableBooleanRadioFieldWidget.ts +13 -0
  156. package/src/field/table/boolean/TableBooleanSelectFieldWidget.ts +1 -1
  157. package/src/field/table/boolean/index.ts +1 -0
  158. package/src/field/table/string/upload/TableStringMultiUploadWidget.ts +3 -3
  159. package/src/main-view/DefaultMetadataMainViewWidget.ts +7 -24
  160. package/src/spi/LayoutManager.ts +20 -17
  161. package/src/spi/MaskManager.ts +36 -6
  162. package/src/tags/context/runtime-context-helper.ts +11 -9
  163. package/src/typing/widget-names.ts +2 -0
  164. package/src/util/utils.ts +2 -1
  165. package/src/view/application-screen/gallery/AppsGalleryWidget.ts +2 -2
  166. package/src/view/card/CardWidget.ts +4 -4
  167. package/src/view/gallery/GalleryWidget.ts +9 -3
  168. package/src/view/popup/drawer/style/index.scss +3 -1
  169. package/dist/types/src/field/form/enum/select/bool/index.d.ts +0 -1
  170. package/src/field/form/enum/select/bool/index.ts +0 -1
  171. /package/dist/types/src/field/detail/o2m/{Select.vue.d.ts → select/Select.vue.d.ts} +0 -0
@@ -1,28 +1,21 @@
1
1
  import {
2
- ActiveRecords,
3
2
  Dialog,
4
3
  Drawer,
5
4
  executeViewAction,
6
5
  FunctionCache,
7
6
  FunctionService,
8
- GetRequestModelFieldsOptions,
9
- ModelCache,
10
7
  MultiTabsManager,
11
8
  RelationUpdateType,
12
9
  RequestModelField,
13
10
  ROOT_HANDLE,
14
11
  RuntimeContext,
15
- RuntimeContextManager,
16
- RuntimeFunctionDefinition,
17
12
  RuntimeServerAction,
18
13
  RuntimeViewAction,
19
- StaticMetadata,
20
- SubmitRelationValue,
21
14
  SubmitValue,
22
15
  translateValueByKey,
23
16
  UpdateOneWithRelationsService
24
17
  } from '@oinone/kunlun-engine';
25
- import { ActionContextType, ActionType, ModelFieldType, ViewType } from '@oinone/kunlun-meta';
18
+ import { ActionType, ViewType } from '@oinone/kunlun-meta';
26
19
  import { HttpClientError, MessageHub, RequestErrorInterceptor, SystemErrorCode } from '@oinone/kunlun-request';
27
20
  import { SPI } from '@oinone/kunlun-spi';
28
21
  import { BooleanHelper, CallChaining, debugConsole, OioNotification } from '@oinone/kunlun-vue-ui-antd';
@@ -157,48 +150,6 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
157
150
  }
158
151
  }
159
152
 
160
- protected async submit(action: RuntimeServerAction): Promise<SubmitValue> {
161
- let records: ActiveRecords | undefined;
162
- let relationRecords: SubmitRelationValue[] | undefined;
163
- if (!this.inline && this.submitCallChaining) {
164
- debugConsole.run(() => {
165
- if ([ViewType.Detail, ViewType.Form].includes(this.viewType!)) {
166
- debugConsole.log('formData in view:', this.activeRecords?.[0]);
167
- }
168
- });
169
- const callResult = await this.submitCallChaining?.syncCall();
170
- if (callResult != null) {
171
- records = callResult.records;
172
- relationRecords = callResult.relationRecords;
173
- }
174
- }
175
- if (records == null) {
176
- records = this.activeRecords || [];
177
- }
178
- if (action.contextType === ActionContextType.Batch || action.contextType === ActionContextType.SingleAndBatch) {
179
- // do nothing.
180
- } else if (action.contextType === ActionContextType.Single) {
181
- if (Array.isArray(records)) {
182
- [records] = records;
183
- }
184
- } else {
185
- const ttype = action.functionDefinition?.argumentList?.[0]?.ttype;
186
- if (ttype && [ModelFieldType.ManyToOne, ModelFieldType.OneToOne].includes(ttype as ModelFieldType)) {
187
- if (Array.isArray(records)) {
188
- [records] = records;
189
- }
190
- }
191
- }
192
- if (!records) {
193
- if (action.contextType !== ActionContextType.ContextFree) {
194
- const name = this.action?.displayName || this.action?.label;
195
- throw new Error(`${name} action not params`);
196
- }
197
- records = {};
198
- }
199
- return new SubmitValue(records, relationRecords);
200
- }
201
-
202
153
  protected async clickActionAfter(result: ClickResult): Promise<ClickResult> {
203
154
  let refreshParent = false;
204
155
  if (this.isDialog) {
@@ -207,8 +158,8 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
207
158
  await this.clickActionAfterRefreshData(result, refreshParent);
208
159
  this.closeAllDialog ? Dialog.disposeAll() : Dialog.dispose(this.action);
209
160
  return result;
210
- } else if (this.goBack) {
211
- // eslint-disable-next-line no-restricted-globals
161
+ }
162
+ if (this.goBack) {
212
163
  this.historyBack();
213
164
  return result;
214
165
  }
@@ -218,13 +169,12 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
218
169
  await this.clickActionAfterRefreshData(result, refreshParent);
219
170
  this.closeAllDrawer ? Drawer.disposeAll() : Drawer.dispose(this.action);
220
171
  return result;
221
- } else if (this.goBack) {
222
- // eslint-disable-next-line no-restricted-globals
172
+ }
173
+ if (this.goBack) {
223
174
  this.historyBack();
224
175
  return result;
225
176
  }
226
177
  } else if (this.goBack) {
227
- // eslint-disable-next-line no-restricted-globals
228
178
  this.historyBack();
229
179
  return result;
230
180
  }
@@ -355,36 +305,6 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
355
305
  return !!parameters.relationRecords.length;
356
306
  }
357
307
 
358
- protected seekPopupMainRuntimeContext(): RuntimeContext {
359
- if (this.metadataHandle === this.rootHandle) {
360
- const modelModel = this.model.model;
361
- if (modelModel) {
362
- const popupMainRuntimeContext = RuntimeContextManager.getOthers(this.rootHandle)?.find(
363
- (v) => v.model.model === modelModel
364
- );
365
- if (popupMainRuntimeContext) {
366
- return popupMainRuntimeContext;
367
- }
368
- }
369
- }
370
- return this.rootRuntimeContext;
371
- }
372
-
373
- protected async getRequestModelFields(options?: GetRequestModelFieldsOptions): Promise<RequestModelField[]> {
374
- const { viewType } = this;
375
- if (viewType === ViewType.Tree) {
376
- const runtimeModel = await ModelCache.get(this.model.model);
377
- if (runtimeModel) {
378
- return runtimeModel.modelFields.map((field) => ({ field }));
379
- }
380
- return [];
381
- }
382
- if (this.popupScene) {
383
- return this.seekPopupMainRuntimeContext().getRequestModelFields(options);
384
- }
385
- return this.rootRuntimeContext.getRequestModelFields(options);
386
- }
387
-
388
308
  protected async executeAction(action: RuntimeServerAction, submitValue: SubmitValue): Promise<ClickResult> {
389
309
  if (
390
310
  (this.updateOneWithRelationName === action.fun || this.updateActionName === action.name) &&
@@ -407,27 +327,9 @@ export class ServerActionWidget extends ActionWidget<RuntimeServerAction> {
407
327
  return this.executeFunction(functionDefinition, requestFields, submitValue.records);
408
328
  }
409
329
 
410
- protected executeFunction<T>(
411
- functionDefinition: RuntimeFunctionDefinition,
412
- requestFields: RequestModelField[],
413
- activeRecords: ActiveRecords | undefined
414
- ): Promise<T> {
415
- activeRecords = this.mergeContext(activeRecords);
416
- return FunctionService.INSTANCE.simpleExecute(
417
- this.model,
418
- functionDefinition,
419
- {
420
- requestModels: [StaticMetadata.ResourceAddress],
421
- requestFields,
422
- variables: this.rootRuntimeContext.generatorVariables({ path: this.action.sessionPath })
423
- },
424
- activeRecords
425
- );
426
- }
427
-
428
330
  protected executeRelationUpdate<T>(requestFields: RequestModelField[], submitValue: SubmitValue): Promise<T> {
429
331
  return UpdateOneWithRelationsService.execute(this.model, submitValue, {
430
- requestModels: [StaticMetadata.ResourceAddress],
332
+ requestModels: FunctionService.usingStaticModels(),
431
333
  requestFields,
432
334
  variables: this.rootRuntimeContext.generatorVariables({ path: this.action.sessionPath })
433
335
  });
@@ -2,19 +2,14 @@ import {
2
2
  ActiveRecord,
3
3
  FunctionCache,
4
4
  FunctionService,
5
- GetRequestModelFieldsOptions,
6
- ModelCache,
7
5
  RedirectTargetEnum,
8
6
  RequestModelField,
9
- RuntimeContext,
10
- RuntimeContextManager,
11
7
  RuntimeFunctionDefinition,
12
8
  RuntimeUrlAction,
13
- StaticMetadata,
14
9
  translateValueByKey
15
10
  } from '@oinone/kunlun-engine';
16
11
  import { Expression } from '@oinone/kunlun-expression';
17
- import { ActionType, ViewActionTarget, ViewType } from '@oinone/kunlun-meta';
12
+ import { ActionType, ViewActionTarget } from '@oinone/kunlun-meta';
18
13
  import { ReturnPromise } from '@oinone/kunlun-shared';
19
14
  import { SPI } from '@oinone/kunlun-spi';
20
15
  import { OioMessage, OioNotification } from '@oinone/kunlun-vue-ui-antd';
@@ -67,36 +62,6 @@ export class UrlActionWidget extends ActionWidget<RuntimeUrlAction> {
67
62
  return res;
68
63
  }
69
64
 
70
- protected seekPopupMainRuntimeContext(): RuntimeContext {
71
- if (this.metadataHandle === this.rootHandle) {
72
- const modelModel = this.model.model;
73
- if (modelModel) {
74
- const popupMainRuntimeContext = RuntimeContextManager.getOthers(this.rootHandle)?.find(
75
- (v) => v.model.model === modelModel
76
- );
77
- if (popupMainRuntimeContext) {
78
- return popupMainRuntimeContext;
79
- }
80
- }
81
- }
82
- return this.rootRuntimeContext;
83
- }
84
-
85
- protected async getRequestModelFields(options?: GetRequestModelFieldsOptions): Promise<RequestModelField[]> {
86
- const { viewType } = this;
87
- if (viewType === ViewType.Tree) {
88
- const runtimeModel = await ModelCache.get(this.model.model);
89
- if (runtimeModel) {
90
- return runtimeModel.modelFields.map((field) => ({ field }));
91
- }
92
- return [];
93
- }
94
- if (this.popupScene) {
95
- return this.seekPopupMainRuntimeContext().getRequestModelFields(options);
96
- }
97
- return this.rootRuntimeContext.getRequestModelFields(options);
98
- }
99
-
100
65
  protected executeFunction<T>(
101
66
  functionDefinition: RuntimeFunctionDefinition,
102
67
  requestFields: RequestModelField[],
@@ -109,7 +74,7 @@ export class UrlActionWidget extends ActionWidget<RuntimeUrlAction> {
109
74
  this.model,
110
75
  functionDefinition,
111
76
  {
112
- requestModels: [StaticMetadata.ResourceAddress],
77
+ requestModels: FunctionService.usingStaticModels(),
113
78
  requestFields,
114
79
  variables: { path: this.action.sessionPath }
115
80
  },
@@ -1,4 +1,11 @@
1
- import { parseConfigs, RelationUpdateType, ROOT_HANDLE, SubmitType, SubmitValue } from '@oinone/kunlun-engine';
1
+ import {
2
+ ExperimentalConfigManager,
3
+ parseConfigs,
4
+ RelationUpdateType,
5
+ ROOT_HANDLE,
6
+ SubmitType,
7
+ SubmitValue
8
+ } from '@oinone/kunlun-engine';
2
9
  import { LifeCycleHeart, LifeCycleTypes } from '@oinone/kunlun-event';
3
10
  import { ViewMode } from '@oinone/kunlun-meta';
4
11
  import { Router } from '@oinone/kunlun-router';
@@ -228,7 +235,9 @@ export abstract class BaseElementViewWidget<
228
235
  mainViewFilter
229
236
  );
230
237
  this.setViewFilter?.(internalFilter);
231
- this.internalDomain = RSQLHelper.concatByAnd(this.viewAction?.domain, this.getDsl().domain as string | undefined);
238
+ if (!ExperimentalConfigManager.baseElementViewWidgetNext()) {
239
+ this.internalDomain = RSQLHelper.concatByAnd(this.viewAction?.domain, this.getDsl().domain as string | undefined);
240
+ }
232
241
  }
233
242
 
234
243
  protected refreshConditionContext(): Record<string, unknown> | undefined {
@@ -214,38 +214,6 @@ export abstract class FormSelectComplexFieldWidget<
214
214
  }
215
215
  this.dataList = dataList;
216
216
  this.options = this.handleSelectOption(this.dataList, this.referencesModel);
217
-
218
- // if (!insetDefaultValue && !isEmptyValue(this.value)) {
219
- // this.selectedOption = {
220
- // value: this.value?.[this.relationFieldKey]
221
- // };
222
- // }
223
-
224
- // let existInOptions = false;
225
- // if (this.selectedOption && this.selectedOption.value) {
226
- // existInOptions = !!this.options.find((option) => option.value === this.selectedOption.value);
227
- // if (!existInOptions && !isEmpty(this.options) && !this.clearBackFillSelected) {
228
- // this.options.unshift(this.selectedOption);
229
- // }
230
- // }
231
- }
232
-
233
- @Widget.Reactive()
234
- protected get renderOnParent() {
235
- const _renderOnParent = this.getDsl().renderOnParent;
236
- if (isNil(_renderOnParent)) {
237
- return false;
238
- }
239
- return _renderOnParent;
240
- }
241
-
242
- @Widget.Reactive()
243
- protected get clearBackFillSelected() {
244
- const _clearBackFillSelected = this.getDsl().clearBackFillSelected;
245
- if (isNil(_clearBackFillSelected)) {
246
- return false;
247
- }
248
- return _clearBackFillSelected;
249
217
  }
250
218
 
251
219
  @Widget.Reactive()
@@ -692,4 +660,28 @@ export abstract class FormSelectComplexFieldWidget<
692
660
  context
693
661
  }) as unknown as IQueryPageResult<T>;
694
662
  }
663
+
664
+ /**
665
+ * @deprecated invalid prop
666
+ */
667
+ @Widget.Reactive()
668
+ protected get renderOnParent() {
669
+ const _renderOnParent = this.getDsl().renderOnParent;
670
+ if (isNil(_renderOnParent)) {
671
+ return false;
672
+ }
673
+ return _renderOnParent;
674
+ }
675
+
676
+ /**
677
+ * @deprecated invalid prop
678
+ */
679
+ @Widget.Reactive()
680
+ protected get clearBackFillSelected() {
681
+ const _clearBackFillSelected = this.getDsl().clearBackFillSelected;
682
+ if (isNil(_clearBackFillSelected)) {
683
+ return false;
684
+ }
685
+ return _clearBackFillSelected;
686
+ }
695
687
  }
@@ -505,6 +505,10 @@ export class BaseFormItemWidget<
505
505
  protected formValidateCallChaining: CallChaining<FormValidateResult[] | undefined> | undefined;
506
506
 
507
507
  protected get isSkipValidator(): boolean {
508
+ const isSkipValidator = BooleanHelper.toBoolean(this.getDsl().isSkipValidator);
509
+ if (isSkipValidator != null) {
510
+ return isSkipValidator;
511
+ }
508
512
  return this.invisible || this.parentInvisible || false;
509
513
  }
510
514
 
@@ -18,7 +18,12 @@ export default defineComponent({
18
18
  ...BaseGalleryItemProps
19
19
  },
20
20
  setup(props) {
21
- const showLabel = computed(() => !!props.label);
21
+ const showLabel = computed(() => {
22
+ if (props.labelInvisible) {
23
+ return false;
24
+ }
25
+ return !!props.label;
26
+ });
22
27
 
23
28
  return {
24
29
  showLabel
@@ -12,12 +12,12 @@ import {
12
12
  import { ConfirmType, PopconfirmPlacement } from '@oinone/kunlun-vue-ui-antd';
13
13
  import { ActiveRecordsWidgetProps, Widget } from '@oinone/kunlun-vue-widget';
14
14
  import { isNil, isString, toString } from 'lodash-es';
15
- import { VNode, toRaw } from 'vue';
15
+ import { toRaw, VNode } from 'vue';
16
16
  import { fetchPopconfirmPlacement } from '../../typing';
17
17
  import { executeConfirm } from '../../util';
18
18
  import { BaseDataWidget } from '../common';
19
- import DefaultTableColumn from './DefaultTableColumn.vue';
20
19
  import { FieldWidgetComponentFunction } from '../types';
20
+ import DefaultTableColumn from './DefaultTableColumn.vue';
21
21
 
22
22
  export abstract class BaseTableColumnWidget<
23
23
  Value = unknown,
@@ -156,6 +156,9 @@ export abstract class BaseTableColumnWidget<
156
156
  return this.clientInvisible || BooleanHelper.toBoolean(this.getDsl().invisible) || false;
157
157
  }
158
158
 
159
+ /**
160
+ * @deprecated invalid prop in the table column
161
+ */
159
162
  @Widget.Reactive()
160
163
  public get readonly() {
161
164
  return BooleanHelper.toBoolean(this.getDsl().readonly) || false;
@@ -41,11 +41,6 @@ export default defineComponent({
41
41
  value: {
42
42
  type: Object
43
43
  },
44
- // 上传总文件大小限制
45
- allLimitSize: {
46
- type: String,
47
- default: '' // 1B、1KB、1MB、1GB、1TG
48
- },
49
44
  cdnKey: {
50
45
  type: String
51
46
  },
@@ -110,46 +105,6 @@ export default defineComponent({
110
105
  context.emit('change', fileList.value);
111
106
  };
112
107
 
113
- function pow1024(number: number) {
114
- return Math.pow(1024, number);
115
- }
116
-
117
- function toUpCase(str: string) {
118
- return str.toLocaleUpperCase();
119
- }
120
-
121
- const sizeUnit = {
122
- // kb -> b
123
- KB(size: number) {
124
- const [s] = toUpCase(props.allLimitSize).split('KB');
125
- return Number(s) * pow1024(1) > size;
126
- },
127
-
128
- // MB -> b
129
- MB(size: number) {
130
- const [s] = toUpCase(props.allLimitSize).split('MB');
131
-
132
- return Number(s) * pow1024(2) > size;
133
- },
134
-
135
- // GB -> b
136
- GB(size: number) {
137
- const [s] = toUpCase(props.allLimitSize).split('GB');
138
- return Number(s) * pow1024(3) > size;
139
- },
140
-
141
- // TB -> b
142
- TG(size: number) {
143
- const [s] = toUpCase(props.allLimitSize).split('TB');
144
- return Number(s) * pow1024(4) > size;
145
- },
146
-
147
- B(size: number) {
148
- const [s] = toUpCase(props.allLimitSize).split('B');
149
- return Number(s) > size;
150
- }
151
- };
152
-
153
108
  /**
154
109
  * 上传之前现判断 当前文件大小 + 原先上线的文件大小 是否 大于 限制的大小
155
110
  */
@@ -2,10 +2,9 @@
2
2
  <detail-common-field :value="realLabel" />
3
3
  </template>
4
4
  <script lang="ts">
5
- import { translateValueByKey } from '@oinone/kunlun-engine';
6
- import { computed, defineComponent } from 'vue';
7
- import DetailCommonField from '../common/DetailCommonField.vue';
5
+ import { defineComponent } from 'vue';
8
6
  import { useBoolean } from '../../../basic/field/boolean';
7
+ import DetailCommonField from '../common/DetailCommonField.vue';
9
8
 
10
9
  export default defineComponent({
11
10
  components: { DetailCommonField },
@@ -5,7 +5,7 @@ import Boolean from './Boolean.vue';
5
5
 
6
6
  @SPI.ClassFactory(
7
7
  FormFieldWidget.Token({
8
- viewType: [ViewType.Detail],
8
+ viewType: ViewType.Detail,
9
9
  ttype: ModelFieldType.Boolean
10
10
  })
11
11
  )
@@ -10,7 +10,7 @@ import Enum from '../enum/Enum.vue';
10
10
 
11
11
  @SPI.ClassFactory(
12
12
  FormFieldWidget.Token({
13
- viewType: [ViewType.Detail],
13
+ viewType: ViewType.Detail,
14
14
  ttype: [ModelFieldType.Boolean],
15
15
  widget: ['Select', 'Radio']
16
16
  })
@@ -1,15 +1,19 @@
1
1
  import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
2
+ import { EnumerationValue } from '@oinone/kunlun-shared';
2
3
  import { SPI } from '@oinone/kunlun-spi';
3
-
4
4
  import { Widget } from '@oinone/kunlun-vue-widget';
5
-
6
5
  import { FormFieldWidget } from '../../../../basic';
7
- import { EnumerationValue, FormEnumFieldAbstractWidget } from '../../../form/enum/FormEnumFieldAbstractWidget';
6
+ import { FormEnumFieldAbstractWidget } from '../../../form';
8
7
  import { multiEnumFetchOptionByValue } from '../../../util';
9
-
10
8
  import Enum from '../Enum.vue';
11
9
 
12
- @SPI.ClassFactory(FormFieldWidget.Token({ viewType: [ViewType.Detail], ttype: ModelFieldType.Enum, multi: true }))
10
+ @SPI.ClassFactory(
11
+ FormFieldWidget.Token({
12
+ viewType: ViewType.Detail,
13
+ ttype: ModelFieldType.Enum,
14
+ multi: true
15
+ })
16
+ )
13
17
  export class DetailEnumMultiFieldWidget extends FormEnumFieldAbstractWidget<EnumerationValue[]> {
14
18
  public initialize(props) {
15
19
  super.initialize(props);
@@ -1,12 +1,18 @@
1
1
  import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
2
+ import { EnumerationValue } from '@oinone/kunlun-shared';
2
3
  import { SPI } from '@oinone/kunlun-spi';
3
4
  import { Widget } from '@oinone/kunlun-vue-widget';
4
5
  import { FormFieldWidget } from '../../../../basic';
5
- import { EnumerationValue, FormEnumFieldAbstractWidget } from '../../../form/enum/FormEnumFieldAbstractWidget';
6
+ import { FormEnumFieldAbstractWidget } from '../../../form';
6
7
  import { enumFetchOptionByValue } from '../../../util';
7
8
  import Enum from '../Enum.vue';
8
9
 
9
- @SPI.ClassFactory(FormFieldWidget.Token({ viewType: [ViewType.Detail], ttype: ModelFieldType.Enum }))
10
+ @SPI.ClassFactory(
11
+ FormFieldWidget.Token({
12
+ viewType: ViewType.Detail,
13
+ ttype: ModelFieldType.Enum
14
+ })
15
+ )
10
16
  export class DetailEnumFieldWidget extends FormEnumFieldAbstractWidget<EnumerationValue> {
11
17
  public initialize(props) {
12
18
  super.initialize(props);
@@ -7,7 +7,7 @@ import Html from './Html.vue';
7
7
 
8
8
  @SPI.ClassFactory(
9
9
  FormFieldWidget.Token({
10
- viewType: [ViewType.Detail],
10
+ viewType: ViewType.Detail,
11
11
  ttype: ModelFieldType.HTML
12
12
  })
13
13
  )
@@ -11,7 +11,6 @@ export * from './enum/multi/DetailEnumMultiFieldWidget';
11
11
  export * from './boolean/DetailBooleanFieldWidget';
12
12
  export * from './boolean/DetailBooleanSelectFieldWidget';
13
13
  export * from './html/DetailHtmlFieldWidget';
14
- export * from './o2m/DetailO2MSelectFieldWidget';
15
14
  export * from './m2o/DetailM2OSelectFieldWidget';
16
15
  export * from './m2o/upload/DetailM2OUploadWidget';
17
16
  export * from './o2o/DetailO2OSelectFieldWidget';
@@ -1,14 +1,12 @@
1
1
  import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
2
2
  import { SPI } from '@oinone/kunlun-spi';
3
-
4
3
  import { FormFieldWidget } from '../../../../basic';
5
- import { DetailO2MSelectFieldWidget } from '../../o2m/DetailO2MSelectFieldWidget';
4
+ import { DetailO2MSelectFieldWidget } from '../../o2m';
6
5
 
7
6
  @SPI.ClassFactory(
8
7
  FormFieldWidget.Token({
9
- viewType: [ViewType.Detail],
10
- ttype: ModelFieldType.ManyToMany,
11
- widget: 'Select'
8
+ viewType: ViewType.Detail,
9
+ ttype: ModelFieldType.ManyToMany
12
10
  })
13
11
  )
14
12
  export class DetailM2MSelectFieldWidget extends DetailO2MSelectFieldWidget {}
@@ -3,11 +3,13 @@ import { ModelFieldType, ViewMode, ViewType } from '@oinone/kunlun-meta';
3
3
  import { ReturnPromise } from '@oinone/kunlun-shared';
4
4
  import { SPI } from '@oinone/kunlun-spi';
5
5
  import { BaseFieldWidget, FormSubviewListFieldWidget, RelationQueryHelper } from '../../../../basic';
6
+ import { TABLE_WIDGET } from '../../../../typing';
6
7
 
7
8
  @SPI.ClassFactory(
8
9
  BaseFieldWidget.Token({
9
10
  viewType: ViewType.Detail,
10
- ttype: ModelFieldType.ManyToMany
11
+ ttype: ModelFieldType.ManyToMany,
12
+ widget: ['table', TABLE_WIDGET]
11
13
  })
12
14
  )
13
15
  export class DetailM2MTableFieldWidget extends FormSubviewListFieldWidget<RuntimeM2MField> {
@@ -6,7 +6,7 @@ import Select from './Select.vue';
6
6
 
7
7
  @SPI.ClassFactory(
8
8
  FormFieldWidget.Token({
9
- viewType: [ViewType.Detail],
9
+ viewType: ViewType.Detail,
10
10
  ttype: ModelFieldType.ManyToOne
11
11
  })
12
12
  )
@@ -1,15 +1,14 @@
1
1
  import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
2
+ import { BooleanHelper } from '@oinone/kunlun-shared';
2
3
  import { SPI } from '@oinone/kunlun-spi';
3
4
  import { Widget } from '@oinone/kunlun-vue-widget';
4
- import { BooleanHelper } from '@oinone/kunlun-shared';
5
-
6
5
  import { FormFieldWidget } from '../../../../basic/field';
7
6
  import { DetailRelationSelectFieldWidget } from '../../abstract/DetailRelationSelectFieldWidget';
8
7
  import DetailUpload from './DetailUpload.vue';
9
8
 
10
9
  @SPI.ClassFactory(
11
10
  FormFieldWidget.Token({
12
- viewType: [ViewType.Detail],
11
+ viewType: ViewType.Detail,
13
12
  ttype: ModelFieldType.ManyToOne,
14
13
  widget: 'Upload'
15
14
  })
@@ -9,7 +9,7 @@ import DetailString from '../string/default/DetailString.vue';
9
9
 
10
10
  @SPI.ClassFactory(
11
11
  FormFieldWidget.Token({
12
- viewType: [ViewType.Detail],
12
+ viewType: ViewType.Detail,
13
13
  ttype: [ModelFieldType.Integer, ModelFieldType.Long, ModelFieldType.Float, ModelFieldType.Currency]
14
14
  })
15
15
  )
@@ -1 +1,2 @@
1
+ export * from './select/DetailO2MSelectFieldWidget';
1
2
  export * from './table/DetailO2MTableFieldWidget';
@@ -2,15 +2,14 @@ import { ActiveRecord, getLabelFieldList4query, RuntimeO2MField } from '@oinone/
2
2
  import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
3
3
  import { SPI } from '@oinone/kunlun-spi';
4
4
  import { Widget } from '@oinone/kunlun-vue-widget';
5
- import { FormFieldWidget } from '../../../basic/field';
6
- import { DetailRelationSelectFieldWidget } from '../abstract/DetailRelationSelectFieldWidget';
5
+ import { FormFieldWidget } from '../../../../basic/field';
6
+ import { DetailRelationSelectFieldWidget } from '../../abstract/DetailRelationSelectFieldWidget';
7
7
  import Select from './Select.vue';
8
8
 
9
9
  @SPI.ClassFactory(
10
10
  FormFieldWidget.Token({
11
- viewType: [ViewType.Detail],
12
- ttype: ModelFieldType.OneToMany,
13
- widget: 'Select'
11
+ viewType: ViewType.Detail,
12
+ ttype: ModelFieldType.OneToMany
14
13
  })
15
14
  )
16
15
  export class DetailO2MSelectFieldWidget extends DetailRelationSelectFieldWidget<ActiveRecord[], RuntimeO2MField> {
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
  <script lang="ts">
14
14
  import { defineComponent, PropType } from 'vue';
15
- import DetailCommonField from '../common/DetailCommonField.vue';
15
+ import DetailCommonField from '../../common/DetailCommonField.vue';
16
16
 
17
17
  export default defineComponent({
18
18
  props: {
@@ -4,11 +4,13 @@ import { Condition } from '@oinone/kunlun-request';
4
4
  import { ReturnPromise } from '@oinone/kunlun-shared';
5
5
  import { SPI } from '@oinone/kunlun-spi';
6
6
  import { BaseFieldWidget, FormSubviewListFieldWidget, RelationQueryHelper } from '../../../../basic';
7
+ import { TABLE_WIDGET } from '../../../../typing';
7
8
 
8
9
  @SPI.ClassFactory(
9
10
  BaseFieldWidget.Token({
10
11
  viewType: ViewType.Detail,
11
- ttype: ModelFieldType.OneToMany
12
+ ttype: ModelFieldType.OneToMany,
13
+ widget: ['table', TABLE_WIDGET]
12
14
  })
13
15
  )
14
16
  export class DetailO2MTableFieldWidget extends FormSubviewListFieldWidget<RuntimeO2MField> {