cnhis-design-vue 3.1.23-beta.1 → 3.1.23-beta.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 (131) hide show
  1. package/README.md +123 -123
  2. package/es/components/big-table/index.d.ts +0 -3
  3. package/es/components/big-table/src/BigTable.vue.d.ts +0 -3
  4. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -20
  5. package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
  6. package/es/components/big-table/src/utils.d.ts +1 -1
  7. package/es/components/big-table/src/utils2.js +11 -37
  8. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  9. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  10. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  11. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  12. package/es/components/fabric-chart/src/components/PopupMenu.js +7 -2
  13. package/es/components/fabric-chart/src/hooks/useCenter2.js +9 -5
  14. package/es/components/fabric-chart/src/hooks/useEvent2.js +40 -8
  15. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  16. package/es/components/field-set/index.d.ts +1 -0
  17. package/es/components/field-set/src/FieldSet.js +16 -10
  18. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
  19. package/es/components/form-config/index.d.ts +7 -0
  20. package/es/components/form-config/src/FormConfig.vue.d.ts +7 -0
  21. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +7 -0
  22. package/es/components/form-render/index2.js +2 -1
  23. package/es/components/form-render/src/components/renderer/index.d.ts +2 -1
  24. package/es/components/form-render/src/components/renderer/index.js +2 -1
  25. package/es/components/form-render/src/components/renderer/index2.js +2 -1
  26. package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +88 -0
  27. package/es/components/form-render/src/components/renderer/levelSearchCascade.js +237 -0
  28. package/es/components/form-render/src/components/renderer/search.d.ts +15 -1
  29. package/es/components/form-render/src/components/renderer/search.js +3 -1
  30. package/es/components/form-render/src/components/renderer/{cascader.d.ts → searchCascade.d.ts} +0 -0
  31. package/es/components/form-render/src/components/renderer/{cascader.js → searchCascade.js} +2 -0
  32. package/es/components/form-render/src/components/renderer/select.js +3 -1
  33. package/es/components/form-render/src/hooks/useAsyncQueue2.js +4 -4
  34. package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +11 -4
  35. package/es/components/form-render/src/hooks/useFormRequest.d.ts +2 -0
  36. package/es/components/form-render/src/hooks/useFormRequest2.js +1 -1
  37. package/es/components/form-render/src/types/fieldItem.d.ts +7 -0
  38. package/es/components/form-render/src/utils/schema2.js +1 -4
  39. package/es/components/iho-table/index.d.ts +100 -271
  40. package/es/components/iho-table/src/IhoTable.vue.d.ts +100 -271
  41. package/es/components/iho-table/src/components/IhoTableColumn.js +1 -1
  42. package/es/components/iho-table/src/constants/index.d.ts +5 -3
  43. package/es/components/iho-table/src/constants/index.js +1 -1
  44. package/es/components/iho-table/src/constants/index2.js +9 -7
  45. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
  46. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +1 -1
  47. package/es/components/iho-table/src/plugins/index.d.ts +1 -0
  48. package/es/components/iho-table/src/plugins/index.js +5 -1
  49. package/es/components/iho-table/src/plugins/index2.js +5 -1
  50. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +11 -8
  51. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.d.ts +31 -0
  52. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.js +205 -0
  53. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.d.ts +1 -0
  54. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +39 -0
  55. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.d.ts +4 -0
  56. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.js +1 -0
  57. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon2.js +17 -0
  58. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +4 -1
  59. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +4 -1
  60. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts +1 -0
  61. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{inputRendererPlugins.js → inputRendererPlugin.js} +4 -4
  62. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +31 -0
  63. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +60 -0
  64. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.d.ts +1 -0
  65. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +40 -0
  66. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -0
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -0
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils2.js +20 -0
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.js → editSeparate.js} +20 -22
  70. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.vue.d.ts → editSeparate.vue.d.ts} +1 -17
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +13 -9
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.d.ts → separateUtils.d.ts} +0 -0
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.js → separateUtils.js} +1 -1
  74. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils2.js → separateUtils2.js} +4 -4
  75. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.d.ts +31 -0
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.js +60 -0
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.d.ts +1 -0
  78. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +39 -0
  79. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +4 -1
  80. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +2 -0
  81. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/labelRendererPlugin.js +2 -0
  82. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +3 -1
  83. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +16 -26
  84. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +1 -46
  85. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.d.ts +11 -0
  86. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -0
  87. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils2.js +50 -0
  88. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.d.ts +1 -0
  89. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +1 -0
  90. package/es/components/iho-table/src/plugins/virtualTreePlugin/index2.js +84 -0
  91. package/es/components/iho-table/src/types/index.d.ts +1 -3
  92. package/es/components/index.css +1 -1
  93. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -0
  94. package/es/components/search-cascader/index.d.ts +196 -0
  95. package/es/components/search-cascader/index.js +1 -0
  96. package/es/components/search-cascader/index2.js +10 -0
  97. package/es/components/search-cascader/src/SearchCascader.js +168 -0
  98. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +198 -0
  99. package/es/components/search-cascader/src/components/SearchMenu.d.ts +45 -0
  100. package/es/components/search-cascader/src/components/SearchMenu.js +134 -0
  101. package/es/components/search-cascader/src/components/index.d.ts +1 -0
  102. package/es/components/search-cascader/src/components/index.js +1 -0
  103. package/es/components/search-cascader/src/constants/index.d.ts +3 -0
  104. package/es/components/search-cascader/src/constants/index.js +1 -0
  105. package/es/components/search-cascader/src/constants/index2.js +3 -0
  106. package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
  107. package/es/components/search-cascader/src/hooks/index.js +1 -0
  108. package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
  109. package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
  110. package/es/components/search-cascader/src/hooks/useCssVariable2.js +7 -0
  111. package/es/components/search-cascader/src/utils/index.d.ts +2 -0
  112. package/es/components/search-cascader/src/utils/index.js +1 -0
  113. package/es/components/search-cascader/src/utils/index2.js +11 -0
  114. package/es/components/search-cascader/style/index.css +1 -0
  115. package/es/components/select-label/index.d.ts +1 -0
  116. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -0
  117. package/es/components/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +16 -4
  118. package/es/components/shortcut-provider/src/ShortcutProvider.js +2 -1
  119. package/es/components/shortcut-setter/index.d.ts +7 -0
  120. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +7 -0
  121. package/es/shared/components/no-data/NoData.js +74 -0
  122. package/es/shared/components/no-data/NoData.vue.d.ts +51 -0
  123. package/es/shared/components/no-data/index.d.ts +2 -0
  124. package/es/shared/components/no-data/index.js +1 -0
  125. package/es/shared/components/no-data/index2.js +2 -0
  126. package/es/shared/utils/index.d.ts +2 -1
  127. package/es/shared/utils/index.js +1 -1
  128. package/es/shared/utils/index2.js +17 -7
  129. package/es/shared/utils/tapable/index.d.ts +139 -0
  130. package/package.json +2 -2
  131. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugins.d.ts +0 -1
@@ -139,6 +139,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
139
139
  NInputNumber: any;
140
140
  NSpin: any;
141
141
  NTooltip: any;
142
+ NPopconfirm: any;
142
143
  draggable: import("vue").DefineComponent<{
143
144
  list: {
144
145
  type: ArrayConstructor;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, reactive, watch, onMounted, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock, toDisplayString, withDirectives, vShow, renderSlot, createTextVNode } from 'vue';
2
- import { NSpin, NCheckbox, NTooltip, NSelect, NInput, NInputNumber, NButton } from 'naive-ui';
2
+ import { NSpin, NCheckbox, NTooltip, NSelect, NInput, NInputNumber, NPopconfirm, NButton } from 'naive-ui';
3
3
  import Draggable from 'vuedraggable';
4
4
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
5
5
 
@@ -54,8 +54,9 @@ const _hoisted_28 = {
54
54
  };
55
55
  const _hoisted_29 = { class: "btn-operate" };
56
56
  const _hoisted_30 = /* @__PURE__ */ createTextVNode("\u6062\u590D\u9ED8\u8BA4\u8BBE\u7F6E");
57
- const _hoisted_31 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
58
- const _hoisted_32 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
57
+ const _hoisted_31 = /* @__PURE__ */ createTextVNode(" \u786E\u8BA4\u8981\u6062\u590D\u7CFB\u7EDF\u9ED8\u8BA4\u8BBE\u7F6E\u5417\uFF1F ");
58
+ const _hoisted_32 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
59
+ const _hoisted_33 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
59
60
  const _sfc_main = /* @__PURE__ */ defineComponent({
60
61
  __name: "FieldSet",
61
62
  props: {
@@ -403,12 +404,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
403
404
  props.footerFlag ? (openBlock(), createElementBlock("div", _hoisted_28, [
404
405
  createElementVNode("div", _hoisted_29, [
405
406
  renderSlot(_ctx.$slots, "footer", {}, () => [
406
- createVNode(unref(NButton), {
407
- style: { "margin-right": "8px" },
408
- onClick: reset
409
- }, {
407
+ createVNode(unref(NPopconfirm), { onPositiveClick: reset }, {
408
+ trigger: withCtx(() => [
409
+ createVNode(unref(NButton), { style: { "margin-right": "8px" } }, {
410
+ default: withCtx(() => [
411
+ _hoisted_30
412
+ ]),
413
+ _: 1
414
+ })
415
+ ]),
410
416
  default: withCtx(() => [
411
- _hoisted_30
417
+ _hoisted_31
412
418
  ]),
413
419
  _: 1
414
420
  }),
@@ -417,7 +423,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
417
423
  onClick: onCancle
418
424
  }, {
419
425
  default: withCtx(() => [
420
- _hoisted_31
426
+ _hoisted_32
421
427
  ]),
422
428
  _: 1
423
429
  }),
@@ -426,7 +432,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
426
432
  onClick: handleFieldSave
427
433
  }, {
428
434
  default: withCtx(() => [
429
- _hoisted_32
435
+ _hoisted_33
430
436
  ]),
431
437
  _: 1
432
438
  })
@@ -93,6 +93,7 @@ declare const _default: import("vue").DefineComponent<{
93
93
  NInputNumber: any;
94
94
  NSpin: any;
95
95
  NTooltip: any;
96
+ NPopconfirm: any;
96
97
  draggable: import("vue").DefineComponent<{
97
98
  list: {
98
99
  type: ArrayConstructor;
@@ -938,8 +938,15 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
938
938
  name?: string | undefined;
939
939
  render_key?: string[] | undefined;
940
940
  search_key?: string[] | undefined;
941
+ primary_key?: string | undefined;
941
942
  type?: string | undefined;
942
943
  value_key?: string | undefined;
944
+ level_key?: string | undefined;
945
+ link_key?: string | undefined;
946
+ link_key_split?: string | undefined;
947
+ show_key?: string[] | undefined;
948
+ conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
949
+ conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
943
950
  } | undefined;
944
951
  open?: {
945
952
  value?: any;
@@ -940,8 +940,15 @@ declare const _default: import("vue").DefineComponent<{
940
940
  name?: string | undefined;
941
941
  render_key?: string[] | undefined;
942
942
  search_key?: string[] | undefined;
943
+ primary_key?: string | undefined;
943
944
  type?: string | undefined;
944
945
  value_key?: string | undefined;
946
+ level_key?: string | undefined;
947
+ link_key?: string | undefined;
948
+ link_key_split?: string | undefined;
949
+ show_key?: string[] | undefined;
950
+ conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
951
+ conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
945
952
  } | undefined;
946
953
  open?: {
947
954
  value?: any;
@@ -67,8 +67,15 @@ declare const _default: import("vue").DefineComponent<{}, {
67
67
  name?: string | undefined;
68
68
  render_key?: string[] | undefined;
69
69
  search_key?: string[] | undefined;
70
+ primary_key?: string | undefined;
70
71
  type?: string | undefined;
71
72
  value_key?: string | undefined;
73
+ level_key?: string | undefined;
74
+ link_key?: string | undefined;
75
+ link_key_split?: string | undefined;
76
+ show_key?: string[] | undefined;
77
+ conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
78
+ conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
72
79
  } | undefined;
73
80
  open?: {
74
81
  value?: any;
@@ -26,7 +26,7 @@ import './src/components/renderer/inputNumber.js';
26
26
  import './src/components/renderer/linebar.js';
27
27
  import './src/components/renderer/inputGroup2.js';
28
28
  import './src/components/renderer/date.js';
29
- import './src/components/renderer/cascader.js';
29
+ import './src/components/renderer/levelSearchCascade.js';
30
30
  import './src/components/renderer/jsonCombination/index.js';
31
31
  import './src/components/renderer/combination.js';
32
32
  import './src/components/renderer/checkbox.js';
@@ -37,6 +37,7 @@ import './src/components/renderer/slider.js';
37
37
  import './src/components/renderer/complex.js';
38
38
  import './src/components/renderer/simpleComponent.js';
39
39
  import './src/components/renderer/search.js';
40
+ import './src/components/renderer/searchCascade.js';
40
41
 
41
42
  const FormRender = script;
42
43
  FormRender.install = function(app) {
@@ -6,7 +6,7 @@ export * from './inputNumber';
6
6
  export * from './linebar';
7
7
  export * from './inputGroup';
8
8
  export * from './date';
9
- export * from './cascader';
9
+ export * from './levelSearchCascade';
10
10
  export * from './jsonCombination';
11
11
  export * from './combination';
12
12
  export * from './checkbox';
@@ -17,3 +17,4 @@ export * from './slider';
17
17
  export * from './complex';
18
18
  export * from './simpleComponent';
19
19
  export * from './search';
20
+ export * from './searchCascade';
@@ -6,7 +6,7 @@ export { INPUT_NUMBER } from './inputNumber.js';
6
6
  export { LINEBAR } from './linebar.js';
7
7
  export { INPUT_GROUP } from './inputGroup2.js';
8
8
  export { DATE } from './date.js';
9
- export { SEARCH_CASCADE } from './cascader.js';
9
+ export { LEVEL_SEARCH_CASCADE } from './levelSearchCascade.js';
10
10
  export { JSON_COMBINATION } from './jsonCombination/index.js';
11
11
  export { COMBINATION } from './combination.js';
12
12
  export { CHECKBOX } from './checkbox.js';
@@ -17,3 +17,4 @@ export { SLIDER } from './slider.js';
17
17
  export { COMPLEX } from './complex.js';
18
18
  export { BUTTON, LINE_BREAKS, TEXT } from './simpleComponent.js';
19
19
  export { SEARCH } from './search.js';
20
+ export { SEARCH_CASCADE } from './searchCascade.js';
@@ -6,7 +6,7 @@ export { INPUT_NUMBER } from './inputNumber.js';
6
6
  export { LINEBAR } from './linebar.js';
7
7
  export { INPUT_GROUP } from './inputGroup2.js';
8
8
  export { DATE } from './date.js';
9
- export { SEARCH_CASCADE } from './cascader.js';
9
+ export { LEVEL_SEARCH_CASCADE } from './levelSearchCascade.js';
10
10
  export { JSON_COMBINATION } from './jsonCombination/index.js';
11
11
  export { COMBINATION } from './combination.js';
12
12
  export { CHECKBOX } from './checkbox.js';
@@ -17,3 +17,4 @@ export { SLIDER } from './slider.js';
17
17
  export { COMPLEX } from './complex.js';
18
18
  export { BUTTON, LINE_BREAKS, TEXT } from './simpleComponent.js';
19
19
  export { SEARCH } from './search.js';
20
+ export { SEARCH_CASCADE } from './searchCascade.js';
@@ -0,0 +1,88 @@
1
+ import { AnyObject, Func } from '../../../../../../es/shared/types';
2
+ import { PropType } from 'vue';
3
+ declare type ValueType = string | AnyObject[];
4
+ export declare const LEVEL_SEARCH_CASCADE: import("vue").DefineComponent<{
5
+ options: {
6
+ type: PropType<AnyObject[]>;
7
+ default: () => never[];
8
+ };
9
+ onFocus: {
10
+ type: PropType<Func<any[], any>>;
11
+ };
12
+ autograph: {
13
+ type: StringConstructor;
14
+ required: true;
15
+ };
16
+ lazyRequest: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ wordbook: {
21
+ type: PropType<Partial<{
22
+ level_num: number;
23
+ id: string;
24
+ name: string;
25
+ render_key: string[];
26
+ search_key: string[];
27
+ primary_key: string;
28
+ type: string;
29
+ value_key: string;
30
+ level_key: string;
31
+ link_key: string;
32
+ link_key_split: string;
33
+ show_key: string[];
34
+ conObj: AnyObject[];
35
+ conObjFirstLevel: AnyObject[];
36
+ }>>;
37
+ required: true;
38
+ };
39
+ onChange: {};
40
+ value: {
41
+ type: PropType<ValueType>;
42
+ };
43
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
44
+ options: {
45
+ type: PropType<AnyObject[]>;
46
+ default: () => never[];
47
+ };
48
+ onFocus: {
49
+ type: PropType<Func<any[], any>>;
50
+ };
51
+ autograph: {
52
+ type: StringConstructor;
53
+ required: true;
54
+ };
55
+ lazyRequest: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ wordbook: {
60
+ type: PropType<Partial<{
61
+ level_num: number;
62
+ id: string;
63
+ name: string;
64
+ render_key: string[];
65
+ search_key: string[];
66
+ primary_key: string;
67
+ type: string;
68
+ value_key: string;
69
+ level_key: string;
70
+ link_key: string;
71
+ link_key_split: string;
72
+ show_key: string[];
73
+ conObj: AnyObject[];
74
+ conObjFirstLevel: AnyObject[];
75
+ }>>;
76
+ required: true;
77
+ };
78
+ onChange: {};
79
+ value: {
80
+ type: PropType<ValueType>;
81
+ };
82
+ }>> & {
83
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
84
+ }, {
85
+ options: AnyObject[];
86
+ lazyRequest: boolean;
87
+ }>;
88
+ export {};
@@ -0,0 +1,237 @@
1
+ import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
2
+ import { isEqual, isString, isEmpty } from 'lodash-es';
3
+ import '../../../index2.js';
4
+ import { InjectAsyncQueue } from '../../constants/index2.js';
5
+ import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
6
+ import { formRenderLog } from '../../utils/index.js';
7
+ import { connect, mapProps } from '@formily/vue';
8
+ import SearchCascader from '../../../../search-cascader/index2.js';
9
+ import script$1 from '../../../../../shared/components/no-data/NoData.js';
10
+ import { useFormField } from '../../hooks/useFormField2.js';
11
+ import { visitedDecorator, assignUpdateValue } from '../../utils/schema2.js';
12
+ import { useFormRequest } from '../../hooks/useFormRequest2.js';
13
+
14
+ const script = defineComponent({
15
+ name: "FormSearchCascade",
16
+ props: {
17
+ options: {
18
+ type: Array,
19
+ default: () => []
20
+ },
21
+ onFocus: {
22
+ type: Function
23
+ },
24
+ autograph: {
25
+ type: String,
26
+ required: true
27
+ },
28
+ lazyRequest: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ wordbook: {
33
+ type: Object,
34
+ required: true
35
+ },
36
+ onChange: {},
37
+ value: {
38
+ type: [String, Array]
39
+ }
40
+ },
41
+ emits: ["update:value"],
42
+ setup(props, {
43
+ emit
44
+ }) {
45
+ const valueRef = computed({
46
+ get: () => props.value,
47
+ set: (v) => emit("update:value", v)
48
+ });
49
+ const optionsRef = ref([]);
50
+ const {
51
+ field,
52
+ fieldKey
53
+ } = useFormField();
54
+ const labelKey = computed(() => {
55
+ var _a, _b, _c;
56
+ return (_c = (_b = (_a = props.wordbook) == null ? void 0 : _a.render_key) == null ? void 0 : _b[0]) != null ? _c : "text";
57
+ });
58
+ const valueKey = computed(() => {
59
+ var _a, _b;
60
+ return (_b = (_a = props.wordbook) == null ? void 0 : _a.value_key) != null ? _b : "value";
61
+ });
62
+ computed(() => {
63
+ var _a;
64
+ return ((_a = props.wordbook) == null ? void 0 : _a.level_num) || Infinity;
65
+ });
66
+ const asyncQueue = inject(InjectAsyncQueue);
67
+ const {
68
+ getSearchRequestInfo
69
+ } = useFormRequest();
70
+ async function fetchData(node, keyword) {
71
+ try {
72
+ if (node && !node.__keyword && node.isLeaf) {
73
+ valueRef.value = createOptionValue(node);
74
+ return;
75
+ }
76
+ const result = await asyncQueue.addAsync(createParams(props.wordbook, props.autograph, field.value, node, fieldKey.value));
77
+ if (!node) {
78
+ optionsRef.value = result.map((option) => {
79
+ option.__keyword = !!keyword;
80
+ option.isLeaf = !!keyword;
81
+ return option;
82
+ });
83
+ return;
84
+ }
85
+ if (node == null ? void 0 : node.__keyword) {
86
+ if (!isString(node.id_link))
87
+ return;
88
+ const linkList = parseLinkFromString2List(node.id_link);
89
+ const primaryKeyOptions = await fetchPrimaryKeyValue(linkList);
90
+ if (!primaryKeyOptions)
91
+ return;
92
+ const {
93
+ lastOption,
94
+ options
95
+ } = generateOptionWithIdList(primaryKeyOptions, linkList);
96
+ await fetchData(lastOption);
97
+ if (isEmpty(lastOption.children)) {
98
+ valueRef.value = sortOptionWithIdList(primaryKeyOptions, linkList);
99
+ } else {
100
+ optionsRef.value = options;
101
+ }
102
+ } else {
103
+ node.children = result.map((option) => {
104
+ return {
105
+ ...option,
106
+ parent: node
107
+ };
108
+ });
109
+ }
110
+ } catch (e) {
111
+ isString(e) && formRenderLog(e);
112
+ }
113
+ function sortOptionWithIdList(options, idList) {
114
+ return idList.map((id) => {
115
+ return options.find((option) => option[valueKey.value] === id);
116
+ });
117
+ }
118
+ function generateOptionWithIdList(options, idList) {
119
+ let lastOption = options[0];
120
+ const resultOption = idList.reduce((res, id, index) => {
121
+ const option = getTargetOption(options, id);
122
+ if (index === 0)
123
+ return [option];
124
+ lastOption = option;
125
+ res[0].children = [option];
126
+ return res;
127
+ }, []);
128
+ return {
129
+ options: resultOption,
130
+ lastOption
131
+ };
132
+ function getTargetOption(options2, value) {
133
+ return options2.find((o) => o[valueKey.value] === value);
134
+ }
135
+ }
136
+ function parseLinkFromString2List(linkString) {
137
+ return linkString.split("_").filter((s) => s);
138
+ }
139
+ function createParams(wordbook, autograph, field2, node2, key2) {
140
+ const params = {
141
+ autograph,
142
+ wordbookId: wordbook.id,
143
+ wordbookType: wordbook.type,
144
+ fieldKeys: wordbook.search_key ? JSON.stringify(wordbook.search_key) : void 0,
145
+ conObj: JSON.stringify(createConfigObject(wordbook), node2),
146
+ primaryKey: wordbook.primary_key,
147
+ levelKey: wordbook.level_key,
148
+ keyword,
149
+ page: 1
150
+ };
151
+ return {
152
+ ...getSearchRequestInfo(),
153
+ params,
154
+ key: key2
155
+ };
156
+ }
157
+ function createConfigObject(wordbook, node2) {
158
+ if (!node2)
159
+ return wordbook.conObjFirstLevel || [];
160
+ return [{
161
+ con: "EQ",
162
+ is_compare_field: false,
163
+ field_key: wordbook.level_key,
164
+ value: node2[valueKey.value]
165
+ }];
166
+ }
167
+ }
168
+ async function fetchPrimaryKeyValue(primaryKeys) {
169
+ if (!getSearchRequestInfo().primaryKeyUrl)
170
+ return [];
171
+ try {
172
+ const params = createParams(props.wordbook, props.autograph, primaryKeys, fieldKey.value);
173
+ return await asyncQueue.addAsync(params);
174
+ } catch (e) {
175
+ isString(e) && formRenderLog(e);
176
+ }
177
+ function createParams(wordbook, autograph, primaryKeys2, key2) {
178
+ const requestInfo = getSearchRequestInfo();
179
+ return {
180
+ key: key2,
181
+ params: {
182
+ autograph,
183
+ tableId: wordbook.id,
184
+ primaryKeyValue: primaryKeys2.join(","),
185
+ page: 1
186
+ },
187
+ ...requestInfo,
188
+ url: requestInfo.primaryKeyUrl
189
+ };
190
+ }
191
+ }
192
+ function createOptionValue(node) {
193
+ const result = [];
194
+ let current = node;
195
+ while (current) {
196
+ result.unshift(node);
197
+ current = node.parent;
198
+ }
199
+ return result;
200
+ }
201
+ watch(() => props.wordbook, (wordbook, oldWordbook) => {
202
+ if (isEqual(wordbook, oldWordbook))
203
+ return;
204
+ optionsRef.value = [];
205
+ if (!wordbook)
206
+ return;
207
+ (valueRef.value || !props.lazyRequest) && fetchData();
208
+ }, {
209
+ immediate: true
210
+ });
211
+ const {
212
+ injectValueValidate,
213
+ injectValueWatchFromEmpty,
214
+ injectValueBindKey
215
+ } = useCommonInjection();
216
+ injectValueWatchFromEmpty(valueRef, fetchData);
217
+ injectValueValidate(valueRef);
218
+ const key = injectValueBindKey(valueRef);
219
+ return () => createVNode(SearchCascader, {
220
+ "value": valueRef.value,
221
+ "onUpdate:value": ($event) => valueRef.value = $event,
222
+ "options": optionsRef.value,
223
+ "key": key.value,
224
+ "labelKey": labelKey.value,
225
+ "valueKey": valueKey.value,
226
+ "search": fetchData,
227
+ "onFocus": visitedDecorator(field, props.onFocus)
228
+ }, {
229
+ empty: () => createVNode(script$1, null, null)
230
+ });
231
+ }
232
+ });
233
+ const LEVEL_SEARCH_CASCADE = connect(script, mapProps({
234
+ dataSource: "options"
235
+ }, assignUpdateValue));
236
+
237
+ export { LEVEL_SEARCH_CASCADE };
@@ -1,4 +1,4 @@
1
- import { Func } from '../../../../../../es/shared/types';
1
+ import { AnyObject, Func } from '../../../../../../es/shared/types';
2
2
  import { PropType } from 'vue';
3
3
  export declare const SEARCH: import("vue").DefineComponent<{
4
4
  value: {
@@ -19,8 +19,15 @@ export declare const SEARCH: import("vue").DefineComponent<{
19
19
  name: string;
20
20
  render_key: string[];
21
21
  search_key: string[];
22
+ primary_key: string;
22
23
  type: string;
23
24
  value_key: string;
25
+ level_key: string;
26
+ link_key: string;
27
+ link_key_split: string;
28
+ show_key: string[];
29
+ conObj: AnyObject[];
30
+ conObjFirstLevel: AnyObject[];
24
31
  }>>;
25
32
  required: true;
26
33
  };
@@ -47,8 +54,15 @@ export declare const SEARCH: import("vue").DefineComponent<{
47
54
  name: string;
48
55
  render_key: string[];
49
56
  search_key: string[];
57
+ primary_key: string;
50
58
  type: string;
51
59
  value_key: string;
60
+ level_key: string;
61
+ link_key: string;
62
+ link_key_split: string;
63
+ show_key: string[];
64
+ conObj: AnyObject[];
65
+ conObjFirstLevel: AnyObject[];
52
66
  }>>;
53
67
  required: true;
54
68
  };
@@ -3,6 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
3
3
  import { isString, cloneDeep, isEqual } from 'lodash-es';
4
4
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
5
5
  import { InjectAsyncQueue, InjectionChangeContextCollector } from '../../constants/index2.js';
6
+ import '../../../../../shared/utils/index2.js';
6
7
  import '../../../index2.js';
7
8
  import { formRenderLog, optionMatcher } from '../../utils/index.js';
8
9
  import { useFormRequest } from '../../hooks/useFormRequest2.js';
@@ -28,7 +29,7 @@ import './inputNumber.js';
28
29
  import './linebar.js';
29
30
  import './inputGroup2.js';
30
31
  import './date.js';
31
- import './cascader.js';
32
+ import './levelSearchCascade.js';
32
33
  import './jsonCombination/index.js';
33
34
  import './combination.js';
34
35
  import './checkbox.js';
@@ -38,6 +39,7 @@ import './labelSelect.js';
38
39
  import './slider.js';
39
40
  import './complex.js';
40
41
  import './simpleComponent.js';
42
+ import './searchCascade.js';
41
43
  import { NSelect } from 'naive-ui';
42
44
  import { visitedDecorator, assignUpdateValue, assignClearBindVisited } from '../../utils/schema2.js';
43
45
 
@@ -3,6 +3,7 @@ import { isField } from '@formily/core';
3
3
  import { isEqual, isArray } from 'lodash-es';
4
4
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
5
5
  import { InjectAsyncQueue } from '../../constants/index2.js';
6
+ import '../../../../../shared/utils/index2.js';
6
7
  import '@vueuse/core';
7
8
  import '../../../index2.js';
8
9
  import '../../utils/index.js';
@@ -27,6 +28,7 @@ import './inputNumber.js';
27
28
  import './linebar.js';
28
29
  import './inputGroup2.js';
29
30
  import './date.js';
31
+ import './levelSearchCascade.js';
30
32
  import './jsonCombination/index.js';
31
33
  import './combination.js';
32
34
  import './checkbox.js';
@@ -4,6 +4,7 @@ import { useDebounceFn } from '@vueuse/core';
4
4
  import { isString, cloneDeep, isEqual } from 'lodash-es';
5
5
  import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
6
6
  import { InjectAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index2.js';
7
+ import '../../../../../shared/utils/index2.js';
7
8
  import '../../../index2.js';
8
9
  import { formRenderLog, optionMatcher } from '../../utils/index.js';
9
10
  import { useFormField } from '../../hooks/useFormField2.js';
@@ -26,7 +27,7 @@ import './inputNumber.js';
26
27
  import './linebar.js';
27
28
  import './inputGroup2.js';
28
29
  import './date.js';
29
- import './cascader.js';
30
+ import './levelSearchCascade.js';
30
31
  import './jsonCombination/index.js';
31
32
  import './combination.js';
32
33
  import './checkbox.js';
@@ -37,6 +38,7 @@ import './slider.js';
37
38
  import './complex.js';
38
39
  import './simpleComponent.js';
39
40
  import './search.js';
41
+ import './searchCascade.js';
40
42
  import { NSelect } from 'naive-ui';
41
43
  import { traverseDependKey, visitedDecorator, assignUpdateValue, assignClearBindVisited } from '../../utils/schema2.js';
42
44
 
@@ -1,4 +1,4 @@
1
- import { isFunction } from 'lodash-es';
1
+ import { cloneDeep, isFunction } from 'lodash-es';
2
2
  import '../../index2.js';
3
3
  import { useCommonLog } from './useCommonLog2.js';
4
4
  import { useFormRequest } from './useFormRequest2.js';
@@ -42,7 +42,7 @@ class AsyncQueue {
42
42
  const entry = this._entries.get(key);
43
43
  if (entry.state === 1 /* DONE */) {
44
44
  setTimeout(() => {
45
- callback && callback(entry.error, entry.result);
45
+ callback && callback(cloneDeep(entry.error), cloneDeep(entry.result));
46
46
  });
47
47
  } else if (!entry.callbacks) {
48
48
  entry.callbacks = [callback];
@@ -91,8 +91,8 @@ class AsyncQueue {
91
91
  const callback = entry.callback;
92
92
  entry.state = 1 /* DONE */;
93
93
  entry.callback = void 0;
94
- entry.result = r;
95
- entry.error = e;
94
+ entry.result = cloneDeep(r);
95
+ entry.error = cloneDeep(e);
96
96
  this._activeTasks--;
97
97
  callback && callback(e, r);
98
98
  if (entry.callbacks) {