cnhis-design-vue 3.1.7 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.mjs +18 -0
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.mjs +7 -0
- package/es/node_modules/date-fns/esm/compareAsc/index.mjs +56 -0
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.mjs +53 -0
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.mjs +39 -0
- package/es/node_modules/date-fns/esm/differenceInDays/index.mjs +90 -0
- package/es/node_modules/date-fns/esm/differenceInMonths/index.mjs +63 -0
- package/es/node_modules/date-fns/esm/endOfDay/index.mjs +34 -0
- package/es/node_modules/date-fns/esm/endOfMonth/index.mjs +36 -0
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.mjs +34 -0
- package/es/node_modules/date-fns/esm/startOfDay/index.mjs +34 -0
- package/es/node_modules/date-fns/esm/toDate/index.mjs +55 -0
- package/es/packages/big-table/index2.mjs +5 -3
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.mjs +10 -11
- package/es/packages/big-table/src/components/NoData.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/big-table/src/components/edit-form/edit-select-table.d.ts +1 -1
- package/es/packages/bpmn-workflow/index2.mjs +2 -2
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/button-print/index2.mjs +2 -2
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.mjs +6 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +54 -107
- package/es/packages/button-print/src/components/IdentityVerification.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/chunk-upload/index2.mjs +4 -2
- package/es/packages/chunk-upload/src/chunk-upload-new.vue_vue_type_script_setup_true_lang.mjs +2 -3
- package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue_vue_type_script_setup_true_lang.mjs +11 -12
- package/es/packages/drag-layout/index.d.ts +294 -430
- package/es/packages/drag-layout/index2.mjs +4 -2
- package/es/packages/drag-layout/src/DragFormLeftItem.vue.d.ts +92 -119
- package/es/packages/drag-layout/src/DragFormLeftItem.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/drag-layout/src/DragFormRightItem.vue.d.ts +77 -98
- package/es/packages/drag-layout/src/DragFormRightItem.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/drag-layout/src/DragLayout.vue.d.ts +297 -430
- package/es/packages/drag-layout/src/DragLayout.vue_vue_type_script_setup_true_lang.mjs +44 -45
- package/es/packages/editor/index2.mjs +2 -2
- package/es/packages/field-set/index2.mjs +2 -2
- package/es/packages/field-set/src/FieldSet.vue_vue_type_script_setup_true_lang.mjs +4 -5
- package/es/packages/field-set/src/NewFieldSet.vue_vue_type_script_setup_true_lang.mjs +5 -8
- package/es/packages/form-render/index.mjs +10 -0
- package/es/packages/form-render/index2.mjs +15 -0
- package/es/packages/form-render/src/FormRender.mjs +2 -0
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.mjs +91 -0
- package/es/packages/form-render/src/FormRender2.mjs +4 -0
- package/es/packages/form-render/src/components/cascader.d.ts +40 -0
- package/es/packages/form-render/src/components/cascader.mjs +1 -0
- package/es/packages/form-render/src/components/cascader2.mjs +108 -0
- package/es/packages/form-render/src/components/checkbox.d.ts +24 -0
- package/es/packages/form-render/src/components/checkbox.mjs +1 -0
- package/es/packages/form-render/src/components/checkbox2.mjs +42 -0
- package/es/packages/form-render/src/components/collapse.d.ts +31 -0
- package/es/packages/form-render/src/components/collapse.mjs +1 -0
- package/es/packages/form-render/src/components/collapse2.mjs +54 -0
- package/es/packages/form-render/src/components/combination.d.ts +142 -0
- package/es/packages/form-render/src/components/combination.mjs +1 -0
- package/es/packages/form-render/src/components/combination2.mjs +116 -0
- package/es/packages/form-render/src/components/date.d.ts +5033 -0
- package/es/packages/form-render/src/components/date.mjs +1 -0
- package/es/packages/form-render/src/components/date2.mjs +34 -0
- package/es/packages/form-render/src/components/formItem.d.ts +292 -0
- package/es/packages/form-render/src/components/formItem.mjs +1 -0
- package/es/packages/form-render/src/components/formItem2.mjs +22 -0
- package/es/packages/form-render/src/components/index.d.ts +15 -0
- package/es/packages/form-render/src/components/index.mjs +15 -0
- package/es/packages/form-render/src/components/index2.mjs +15 -0
- package/es/packages/form-render/src/components/input.d.ts +15 -0
- package/es/packages/form-render/src/components/input.mjs +1 -0
- package/es/packages/form-render/src/components/input2.mjs +40 -0
- package/es/packages/form-render/src/components/inputGroup.d.ts +11 -0
- package/es/packages/form-render/src/components/inputGroup.mjs +1 -0
- package/es/packages/form-render/src/components/inputGroup2.mjs +8 -0
- package/es/packages/{map/src/Map.vue.d.ts → form-render/src/components/inputNumber.d.ts} +1002 -1150
- package/es/packages/form-render/src/components/inputNumber.mjs +1 -0
- package/es/packages/form-render/src/components/inputNumber2.mjs +7 -0
- package/es/packages/form-render/src/components/labelSelect.d.ts +1 -0
- package/es/packages/form-render/src/components/labelSelect.mjs +1 -0
- package/es/packages/form-render/src/components/labelSelect2.mjs +18 -0
- package/es/packages/form-render/src/components/radio.d.ts +24 -0
- package/es/packages/form-render/src/components/radio.mjs +1 -0
- package/es/packages/form-render/src/components/radio2.mjs +44 -0
- package/es/packages/form-render/src/components/select.d.ts +29 -0
- package/es/packages/form-render/src/components/select.mjs +1 -0
- package/es/packages/form-render/src/components/select2.mjs +97 -0
- package/es/packages/form-render/src/components/slider.d.ts +347 -0
- package/es/packages/form-render/src/components/slider.mjs +1 -0
- package/es/packages/form-render/src/components/slider2.mjs +16 -0
- package/es/packages/form-render/src/components/switch.d.ts +21 -0
- package/es/packages/form-render/src/components/switch.mjs +1 -0
- package/es/packages/form-render/src/components/switch2.mjs +48 -0
- package/es/packages/form-render/src/components/textarea.d.ts +845 -0
- package/es/packages/form-render/src/components/textarea.mjs +1 -0
- package/es/packages/form-render/src/components/textarea2.mjs +11 -0
- package/es/packages/form-render/src/constants/index.d.ts +23 -0
- package/es/packages/form-render/src/constants/index.mjs +1 -0
- package/es/packages/form-render/src/constants/index2.mjs +24 -0
- package/es/packages/form-render/src/hooks/index.d.ts +9 -0
- package/es/packages/form-render/src/hooks/index.mjs +9 -0
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +60 -0
- package/es/packages/form-render/src/hooks/useAsyncQueue.mjs +1 -0
- package/es/packages/form-render/src/hooks/useAsyncQueue2.mjs +138 -0
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useBusinessBinding.mjs +1 -0
- package/es/packages/form-render/src/hooks/useBusinessBinding2.mjs +48 -0
- package/es/packages/form-render/src/hooks/useCommonLog.d.ts +3 -0
- package/es/packages/form-render/src/hooks/useCommonLog.mjs +1 -0
- package/es/packages/form-render/src/hooks/useCommonLog2.mjs +10 -0
- package/es/packages/form-render/src/hooks/useFieldList2Schema.d.ts +64 -0
- package/es/packages/form-render/src/hooks/useFieldList2Schema.mjs +1 -0
- package/es/packages/form-render/src/hooks/useFieldList2Schema2.mjs +184 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor.d.ts +4 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor.mjs +1 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor2.mjs +38 -0
- package/es/packages/form-render/src/hooks/useFormField.d.ts +4 -0
- package/es/packages/form-render/src/hooks/useFormField.mjs +1 -0
- package/es/packages/form-render/src/hooks/useFormField2.mjs +9 -0
- package/es/packages/form-render/src/hooks/useFormRequest.d.ts +6 -0
- package/es/packages/form-render/src/hooks/useFormRequest.mjs +1 -0
- package/es/packages/form-render/src/hooks/useFormRequest2.mjs +12 -0
- package/es/packages/form-render/src/hooks/useFormValidator.d.ts +5 -0
- package/es/packages/form-render/src/hooks/useFormValidator.mjs +1 -0
- package/es/packages/form-render/src/hooks/useFormValidator2.mjs +48 -0
- package/es/packages/form-render/src/hooks/useTypeNormalize.d.ts +4 -0
- package/es/packages/form-render/src/hooks/useTypeNormalize.mjs +1 -0
- package/es/packages/form-render/src/hooks/useTypeNormalize2.mjs +37 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +44 -0
- package/es/packages/form-render/src/types/fieldItem.mjs +1 -0
- package/es/packages/form-render/src/types/index.d.ts +26 -0
- package/es/packages/form-render/src/types/index.mjs +1 -0
- package/es/packages/form-render/src/utils/index.d.ts +10 -0
- package/es/packages/form-render/src/utils/index.mjs +1 -0
- package/es/packages/form-render/src/utils/index2.mjs +59 -0
- package/es/packages/form-render/style/index.css +80 -0
- package/es/packages/form-render/style/index.less +116 -0
- package/es/packages/form-table/index2.mjs +2 -2
- package/es/packages/form-table/src/FormTable.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-age.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-date-picker.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-digital.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-input-password.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-input.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-month-picker.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-search-more.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-search.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-select-multiple.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-select.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-textarea.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-time-picker.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/table-tree-select.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/form-table/src/components/text-over-tooltip.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/grid/index2.mjs +4 -2
- package/es/packages/index.css +81 -1
- package/es/packages/index.d.ts +5 -2
- package/es/packages/index.less +118 -1
- package/es/packages/index.mjs +10 -0
- package/es/packages/index2.mjs +7 -7
- package/es/packages/info-header/index2.mjs +2 -2
- package/es/packages/info-header/src/HiddenContent.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/info-header/style/index.css +1 -1
- package/es/packages/info-header/style/index.less +1 -1
- package/es/packages/map/index2.mjs +2 -2
- package/es/packages/map/src/Map.vue_vue_type_script_setup_true_lang.mjs +5 -6
- package/es/packages/scale-view/index2.mjs +8 -6
- package/es/packages/scale-view/src/ScaleView.vue_vue_type_script_setup_true_lang.mjs +16 -14
- package/es/packages/scale-view/src/components/AnswerParse.vue_vue_type_script_setup_true_lang.mjs +2 -3
- package/es/packages/scale-view/src/components/EvaluateCountdown.vue_vue_type_script_setup_true_lang.mjs +1 -2
- package/es/packages/scale-view/src/components/EvaluatePage.vue_vue_type_script_setup_true_lang.mjs +3 -4
- package/es/packages/scale-view/src/components/NoData.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/scale-view/src/components/ScaleScore2.mjs +1 -1
- package/es/packages/scale-view/src/components/composables/choose-common.d.ts +1 -1
- package/es/packages/scale-view/src/components/formitem/r-checkbox2.mjs +3 -3
- package/es/packages/scale-view/src/components/formitem/r-collection2.mjs +1 -1
- package/es/packages/scale-view/src/components/formitem/r-radio2.mjs +4 -4
- package/es/packages/scale-view/src/components/formitem/r-select2.mjs +3 -3
- package/es/packages/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +2 -6
- package/es/packages/select-label/index2.mjs +3 -3
- package/es/packages/select-label/src/LabelFormContent.vue.d.ts +96 -303
- package/es/packages/select-label/src/LabelFormContent.vue_vue_type_script_setup_true_lang.mjs +4 -5
- package/es/packages/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.mjs +19 -17
- package/es/packages/select-label/src/components/label-classify.vue.d.ts +68 -236
- package/es/packages/select-label/src/components/label-classify.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/packages/select-person/index2.mjs +2 -2
- package/es/packages/select-person/src/SearchTree.vue_vue_type_script_setup_true_lang.mjs +2 -3
- package/es/packages/select-person/src/SelectPerson.vue_vue_type_script_setup_true_lang.mjs +23 -24
- package/es/packages/time-line/index.d.ts +28 -47
- package/es/packages/time-line/index2.mjs +2 -2
- package/es/packages/time-line/src/TimeLine.vue.d.ts +28 -47
- package/es/packages/time-line/src/TimeLine.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/src/components/SelectPage/SelectPage.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/src/components/SvgIcon/SvgIcon.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/src/components/TextOverTooltip/TextOverTooltip.vue.d.ts +2 -6
- package/es/src/components/TextOverTooltip/TextOverTooltip.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/src/components/player-vod/index.vue_vue_type_script_setup_true_lang.mjs +0 -1
- package/es/src/utils/anime.d.ts +35 -0
- package/es/src/utils/anime.mjs +1 -0
- package/es/src/utils/anime2.mjs +126 -0
- package/es/src/utils/utilExpand.d.ts +1 -0
- package/es/src/utils/utilExpand.mjs +1 -0
- package/es/src/utils/utilExpand2.mjs +714 -0
- package/es/src/utils/vexutils2.mjs +2 -708
- package/md-plugin.ts +201 -0
- package/package.json +125 -119
- package/uno.config.ts +22 -0
- package/es/packages/big-table/index.d.ts +0 -2047
- package/es/packages/big-table/src/BigTable.vue.d.ts +0 -2046
- package/es/packages/big-table/src/components/NoData.vue.d.ts +0 -51
- package/es/packages/bpmn-workflow/index.d.ts +0 -74
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.vue.d.ts +0 -77
- package/es/packages/button-print/index.d.ts +0 -7378
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +0 -7377
- package/es/packages/chunk-upload/index.d.ts +0 -1748
- package/es/packages/chunk-upload/src/chunk-upload-new.vue.d.ts +0 -1905
- package/es/packages/chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +0 -1749
- package/es/packages/field-set/index.d.ts +0 -5284
- package/es/packages/field-set/src/FieldSet.vue.d.ts +0 -2602
- package/es/packages/field-set/src/NewFieldSet.vue.d.ts +0 -2599
- package/es/packages/form-table/index.d.ts +0 -35928
- package/es/packages/form-table/src/FormTable.vue.d.ts +0 -35928
- package/es/packages/form-table/src/components/index.d.ts +0 -35687
- package/es/packages/form-table/src/components/table-age.vue.d.ts +0 -4308
- package/es/packages/form-table/src/components/table-date-picker.vue.d.ts +0 -5287
- package/es/packages/form-table/src/components/table-digital.vue.d.ts +0 -2919
- package/es/packages/form-table/src/components/table-input-password.vue.d.ts +0 -1627
- package/es/packages/form-table/src/components/table-input.vue.d.ts +0 -1584
- package/es/packages/form-table/src/components/table-month-picker.vue.d.ts +0 -5230
- package/es/packages/form-table/src/components/table-search-more.vue.d.ts +0 -1785
- package/es/packages/form-table/src/components/table-search.vue.d.ts +0 -3111
- package/es/packages/form-table/src/components/table-select-multiple.vue.d.ts +0 -1567
- package/es/packages/form-table/src/components/table-select.vue.d.ts +0 -1566
- package/es/packages/form-table/src/components/table-textarea.vue.d.ts +0 -1643
- package/es/packages/form-table/src/components/table-time-picker.vue.d.ts +0 -2674
- package/es/packages/form-table/src/components/table-tree-select.vue.d.ts +0 -1881
- package/es/packages/form-table/src/components/text-over-tooltip.vue.d.ts +0 -546
- package/es/packages/info-header/index.d.ts +0 -1846
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +0 -363
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +0 -1847
- package/es/packages/map/index.d.ts +0 -2315
- package/es/packages/scale-view/index.d.ts +0 -4297
- package/es/packages/scale-view/src/ScaleView.vue.d.ts +0 -4141
- package/es/packages/scale-view/src/components/AnswerParse.vue.d.ts +0 -72
- package/es/packages/scale-view/src/components/EvaluateCountdown.vue.d.ts +0 -150
- package/es/packages/scale-view/src/components/EvaluatePage.vue.d.ts +0 -1503
- package/es/packages/scale-view/src/components/NoData.vue.d.ts +0 -51
- package/es/packages/scale-view/src/hooks/use-component.d.ts +0 -2673
- package/es/packages/select-label/index.d.ts +0 -12120
- package/es/packages/select-label/src/SelectLabel.vue.d.ts +0 -7546
- package/es/packages/select-person/index.d.ts +0 -3502
- package/es/packages/select-person/src/SearchTree.vue.d.ts +0 -344
- package/es/packages/select-person/src/SelectPerson.vue.d.ts +0 -3505
- package/es/src/components/SelectPage/SelectPage.vue.d.ts +0 -1446
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TEXTAREA } from './textarea2.mjs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { assignUpdateValue } from '../utils/index2.mjs';
|
|
2
|
+
import { connect, mapProps } from '@formily/vue';
|
|
3
|
+
import { NInput } from 'naive-ui';
|
|
4
|
+
|
|
5
|
+
const TEXTAREA = connect(NInput, mapProps((props, field) => {
|
|
6
|
+
const _props = assignUpdateValue(props, field);
|
|
7
|
+
_props.type = "textarea";
|
|
8
|
+
return _props;
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
export { TEXTAREA };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BusinessCollector } from "../hooks";
|
|
2
|
+
import { FormAsyncQueue } from "../types";
|
|
3
|
+
import { Component, InjectionKey } from "vue";
|
|
4
|
+
export declare const InjectAsyncQueue: InjectionKey<FormAsyncQueue>;
|
|
5
|
+
export declare const InjectionSchemaField: InjectionKey<Component>;
|
|
6
|
+
export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>;
|
|
7
|
+
export declare enum FIELD_BUSINESS_TYPE {
|
|
8
|
+
PASSWORD = "password",
|
|
9
|
+
ID_CARD = "id_card",
|
|
10
|
+
AGE = "age",
|
|
11
|
+
MOBILE = "mobile",
|
|
12
|
+
TELEPHONE = "telephone",
|
|
13
|
+
EMAIL = "email",
|
|
14
|
+
BANK_CARD = "bank_card",
|
|
15
|
+
WEBSITE = "website",
|
|
16
|
+
GESTATIONAL_WEEKS = "gestational_weeks",
|
|
17
|
+
GESTATIONAL_STAGE = "gestational_stage",
|
|
18
|
+
CUSTOMER_NAME = "customer_name"
|
|
19
|
+
}
|
|
20
|
+
export declare enum FIELD_SEX_VALUE {
|
|
21
|
+
MALE = "1",
|
|
22
|
+
FEMALE = "2"
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionSchemaField } from './index2.mjs';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const InjectAsyncQueue = Symbol("InjectAsyncQueue");
|
|
2
|
+
const InjectionSchemaField = Symbol("InjectionSchemaField");
|
|
3
|
+
const InjectionBusinessCollector = Symbol("InjectionBusinessCollector");
|
|
4
|
+
var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
|
|
5
|
+
FIELD_BUSINESS_TYPE2["PASSWORD"] = "password";
|
|
6
|
+
FIELD_BUSINESS_TYPE2["ID_CARD"] = "id_card";
|
|
7
|
+
FIELD_BUSINESS_TYPE2["AGE"] = "age";
|
|
8
|
+
FIELD_BUSINESS_TYPE2["MOBILE"] = "mobile";
|
|
9
|
+
FIELD_BUSINESS_TYPE2["TELEPHONE"] = "telephone";
|
|
10
|
+
FIELD_BUSINESS_TYPE2["EMAIL"] = "email";
|
|
11
|
+
FIELD_BUSINESS_TYPE2["BANK_CARD"] = "bank_card";
|
|
12
|
+
FIELD_BUSINESS_TYPE2["WEBSITE"] = "website";
|
|
13
|
+
FIELD_BUSINESS_TYPE2["GESTATIONAL_WEEKS"] = "gestational_weeks";
|
|
14
|
+
FIELD_BUSINESS_TYPE2["GESTATIONAL_STAGE"] = "gestational_stage";
|
|
15
|
+
FIELD_BUSINESS_TYPE2["CUSTOMER_NAME"] = "customer_name";
|
|
16
|
+
return FIELD_BUSINESS_TYPE2;
|
|
17
|
+
})(FIELD_BUSINESS_TYPE || {});
|
|
18
|
+
var FIELD_SEX_VALUE = /* @__PURE__ */ ((FIELD_SEX_VALUE2) => {
|
|
19
|
+
FIELD_SEX_VALUE2["MALE"] = "1";
|
|
20
|
+
FIELD_SEX_VALUE2["FEMALE"] = "2";
|
|
21
|
+
return FIELD_SEX_VALUE2;
|
|
22
|
+
})(FIELD_SEX_VALUE || {});
|
|
23
|
+
|
|
24
|
+
export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, InjectAsyncQueue, InjectionBusinessCollector, InjectionSchemaField };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./useFieldList2Schema";
|
|
2
|
+
export * from "./useFormRequest";
|
|
3
|
+
export * from "./useCommonLog";
|
|
4
|
+
export * from "./useFormField";
|
|
5
|
+
export * from "./useAsyncQueue";
|
|
6
|
+
export * from "./useFieldVisitor";
|
|
7
|
+
export * from "./useTypeNormalize";
|
|
8
|
+
export * from "./useFormValidator";
|
|
9
|
+
export * from "./useBusinessBinding";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { useFieldList2Schema } from './useFieldList2Schema2.mjs';
|
|
2
|
+
export { useFormRequest } from './useFormRequest2.mjs';
|
|
3
|
+
export { useCommonLog } from './useCommonLog2.mjs';
|
|
4
|
+
export { useFormField } from './useFormField2.mjs';
|
|
5
|
+
export { AsyncQueue, useAsyncQueue } from './useAsyncQueue2.mjs';
|
|
6
|
+
export { useFieldVisitor } from './useFieldVisitor2.mjs';
|
|
7
|
+
export { useTypeNormalize } from './useTypeNormalize2.mjs';
|
|
8
|
+
export { useFormValidator } from './useFormValidator2.mjs';
|
|
9
|
+
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding2.mjs';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FormAsyncQueueItem } from "../types";
|
|
2
|
+
declare enum ENTRY_STATE {
|
|
3
|
+
PENDING = 0,
|
|
4
|
+
DONE = 1
|
|
5
|
+
}
|
|
6
|
+
interface EntryCallback {
|
|
7
|
+
(err?: any, result?: any): void;
|
|
8
|
+
}
|
|
9
|
+
declare class AsyncQueueEntry<K = any> {
|
|
10
|
+
key: K;
|
|
11
|
+
item: any;
|
|
12
|
+
state: ENTRY_STATE;
|
|
13
|
+
callback?: EntryCallback;
|
|
14
|
+
callbacks?: EntryCallback[];
|
|
15
|
+
result?: any;
|
|
16
|
+
error?: any;
|
|
17
|
+
constructor(item: any, key: K, callback: EntryCallback);
|
|
18
|
+
}
|
|
19
|
+
declare class ArrayQueue<K = any> {
|
|
20
|
+
_list: AsyncQueueEntry<K>[];
|
|
21
|
+
constructor(items?: AsyncQueueEntry<K>[]);
|
|
22
|
+
enqueue(item: AsyncQueueEntry<K>): void;
|
|
23
|
+
dequeue(): AsyncQueueEntry<K> | undefined;
|
|
24
|
+
}
|
|
25
|
+
interface Processor<T, R = any> {
|
|
26
|
+
(item: T, cb: (err?: any, result?: R) => void, removeCache: () => void): void;
|
|
27
|
+
}
|
|
28
|
+
interface AsyncQueueOptions<T = any, K = any> {
|
|
29
|
+
name: string;
|
|
30
|
+
processor: Processor<T>;
|
|
31
|
+
parallelism: number;
|
|
32
|
+
getKey: (item: T) => K;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @constructor 并发控制器
|
|
36
|
+
*/
|
|
37
|
+
export declare class AsyncQueue<T = any, K = any, R = any> {
|
|
38
|
+
name: string;
|
|
39
|
+
processor: Processor<T, R>;
|
|
40
|
+
getKey: AsyncQueueOptions<T, K>["getKey"];
|
|
41
|
+
parallelism: number;
|
|
42
|
+
_queued: ArrayQueue<K>;
|
|
43
|
+
_entries: Map<K, AsyncQueueEntry<K>>;
|
|
44
|
+
_activeTasks: number;
|
|
45
|
+
_processingLock: boolean;
|
|
46
|
+
_stopped: boolean;
|
|
47
|
+
constructor({ name, processor, getKey, parallelism }: AsyncQueueOptions<T>);
|
|
48
|
+
add(item: T, callback: EntryCallback): void;
|
|
49
|
+
addAsync(item: T): Promise<R>;
|
|
50
|
+
_ensureProcessing(): void;
|
|
51
|
+
_startProcess(entry: AsyncQueueEntry): void;
|
|
52
|
+
_handlerResult(entry: AsyncQueueEntry, e?: any, r?: any): void;
|
|
53
|
+
}
|
|
54
|
+
export declare function useAsyncQueue(): {
|
|
55
|
+
create: (parallelism?: number) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
56
|
+
label: string;
|
|
57
|
+
value: any;
|
|
58
|
+
}[]>;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AsyncQueue, useAsyncQueue } from './useAsyncQueue2.mjs';
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { useCommonLog } from './useCommonLog2.mjs';
|
|
2
|
+
import { useFormRequest } from './useFormRequest2.mjs';
|
|
3
|
+
|
|
4
|
+
class AsyncQueueEntry {
|
|
5
|
+
constructor(item, key, callback) {
|
|
6
|
+
this.item = item;
|
|
7
|
+
this.key = key;
|
|
8
|
+
this.state = 0 /* PENDING */;
|
|
9
|
+
this.callback = callback;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class ArrayQueue {
|
|
13
|
+
constructor(items) {
|
|
14
|
+
this._list = items ? Array.from(items) : [];
|
|
15
|
+
}
|
|
16
|
+
enqueue(item) {
|
|
17
|
+
this._list.push(item);
|
|
18
|
+
}
|
|
19
|
+
dequeue() {
|
|
20
|
+
return this._list.shift();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
class AsyncQueue {
|
|
24
|
+
constructor({ name, processor, getKey, parallelism }) {
|
|
25
|
+
this._queued = new ArrayQueue();
|
|
26
|
+
this._entries = /* @__PURE__ */ new Map();
|
|
27
|
+
this._activeTasks = 0;
|
|
28
|
+
this._processingLock = false;
|
|
29
|
+
this._stopped = false;
|
|
30
|
+
this.name = name;
|
|
31
|
+
this.processor = processor;
|
|
32
|
+
this.getKey = getKey;
|
|
33
|
+
this.parallelism = parallelism || 100;
|
|
34
|
+
}
|
|
35
|
+
add(item, callback) {
|
|
36
|
+
if (this._stopped)
|
|
37
|
+
return callback(new Error("Queue was stopped"));
|
|
38
|
+
const key = this.getKey(item);
|
|
39
|
+
if (this._entries.has(key)) {
|
|
40
|
+
const entry = this._entries.get(key);
|
|
41
|
+
if (entry.state === 1 /* DONE */) {
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
callback && callback(entry.error, entry.result);
|
|
44
|
+
});
|
|
45
|
+
} else if (!entry.callbacks) {
|
|
46
|
+
entry.callbacks = [callback];
|
|
47
|
+
} else {
|
|
48
|
+
entry.callbacks.push(callback);
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const newEntry = new AsyncQueueEntry(item, key, callback);
|
|
53
|
+
this._entries.set(key, newEntry);
|
|
54
|
+
this._queued.enqueue(newEntry);
|
|
55
|
+
if (!this._processingLock) {
|
|
56
|
+
this._processingLock = true;
|
|
57
|
+
Promise.resolve().then(this._ensureProcessing.bind(this));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
addAsync(item) {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
this.add(item, (err, result) => {
|
|
63
|
+
err && reject(err);
|
|
64
|
+
resolve(result);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
_ensureProcessing() {
|
|
69
|
+
while (this._activeTasks < this.parallelism) {
|
|
70
|
+
const entry = this._queued.dequeue();
|
|
71
|
+
if (!entry)
|
|
72
|
+
break;
|
|
73
|
+
this._activeTasks++;
|
|
74
|
+
entry.state = 0 /* PENDING */;
|
|
75
|
+
this._startProcess(entry);
|
|
76
|
+
}
|
|
77
|
+
this._processingLock = false;
|
|
78
|
+
}
|
|
79
|
+
_startProcess(entry) {
|
|
80
|
+
this.processor(entry.item, (e, r) => {
|
|
81
|
+
if (e) {
|
|
82
|
+
this._handlerResult(entry, e);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this._handlerResult(entry, e, r);
|
|
86
|
+
}, () => this._entries.delete(entry.key));
|
|
87
|
+
}
|
|
88
|
+
_handlerResult(entry, e, r) {
|
|
89
|
+
const callback = entry.callback;
|
|
90
|
+
entry.state = 1 /* DONE */;
|
|
91
|
+
entry.callback = void 0;
|
|
92
|
+
entry.result = r;
|
|
93
|
+
entry.error = e;
|
|
94
|
+
this._activeTasks--;
|
|
95
|
+
callback && callback(e, r);
|
|
96
|
+
if (entry.callbacks) {
|
|
97
|
+
entry.callbacks.forEach((cb) => cb(e, r));
|
|
98
|
+
}
|
|
99
|
+
if (!this._processingLock) {
|
|
100
|
+
this._processingLock = true;
|
|
101
|
+
Promise.resolve().then(this._ensureProcessing.bind(this));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function useAsyncQueue() {
|
|
106
|
+
const { getHttpInstance } = useFormRequest();
|
|
107
|
+
function create(parallelism = 3) {
|
|
108
|
+
return new AsyncQueue({
|
|
109
|
+
name: "FormRenderAsyncQueue",
|
|
110
|
+
parallelism,
|
|
111
|
+
async processor({ method = "post", params, url }, cb, removeCache) {
|
|
112
|
+
const http = getHttpInstance();
|
|
113
|
+
if (!http) {
|
|
114
|
+
useCommonLog().invalidHttpInstanceLog();
|
|
115
|
+
cb();
|
|
116
|
+
removeCache();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
const res = await http[method](url, params);
|
|
121
|
+
const { data, success } = res;
|
|
122
|
+
if (!success)
|
|
123
|
+
throw new Error(`Request error => ${res}`);
|
|
124
|
+
cb(void 0, data);
|
|
125
|
+
} catch (e) {
|
|
126
|
+
cb(new Error(`Request error => ${e}`));
|
|
127
|
+
removeCache();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
getKey(item) {
|
|
131
|
+
return item.url + JSON.stringify(item.params || {});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return { create };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export { AsyncQueue, useAsyncQueue };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Form } from "@formily/core";
|
|
2
|
+
import { FIELD_BUSINESS_TYPE } from "../constants";
|
|
3
|
+
export declare class BusinessCollector {
|
|
4
|
+
typeCollector: Map<FIELD_BUSINESS_TYPE, Set<string>>;
|
|
5
|
+
fieldNameCollector: Map<string, FIELD_BUSINESS_TYPE>;
|
|
6
|
+
collect(type: FIELD_BUSINESS_TYPE, fieldName: string): void;
|
|
7
|
+
getField(type: FIELD_BUSINESS_TYPE): string[];
|
|
8
|
+
getType(fieldName: string): FIELD_BUSINESS_TYPE | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function useBusinessBinding(): {
|
|
11
|
+
create: () => BusinessCollector;
|
|
12
|
+
trigger: (collector: BusinessCollector, formModel: Form, fieldName: string, value: unknown) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding2.mjs';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isString } from '@vueuse/core';
|
|
2
|
+
import { FIELD_BUSINESS_TYPE } from '../constants/index2.mjs';
|
|
3
|
+
import { isIdCard, parseIdCard } from '../utils/index2.mjs';
|
|
4
|
+
|
|
5
|
+
class BusinessCollector {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.typeCollector = /* @__PURE__ */ new Map();
|
|
8
|
+
this.fieldNameCollector = /* @__PURE__ */ new Map();
|
|
9
|
+
}
|
|
10
|
+
collect(type, fieldName) {
|
|
11
|
+
const set = this.typeCollector.get(type) || /* @__PURE__ */ new Set();
|
|
12
|
+
set.add(fieldName);
|
|
13
|
+
this.typeCollector.set(type, set);
|
|
14
|
+
this.fieldNameCollector.set(fieldName, type);
|
|
15
|
+
}
|
|
16
|
+
getField(type) {
|
|
17
|
+
return [...this.typeCollector.get(type) || /* @__PURE__ */ new Set()];
|
|
18
|
+
}
|
|
19
|
+
getType(fieldName) {
|
|
20
|
+
return this.fieldNameCollector.get(fieldName);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function useBusinessBinding() {
|
|
24
|
+
function create() {
|
|
25
|
+
return new BusinessCollector();
|
|
26
|
+
}
|
|
27
|
+
function handlerIdCardType(formModel, collector, value) {
|
|
28
|
+
if (!value || !isString(value) || !isIdCard(value))
|
|
29
|
+
return;
|
|
30
|
+
const info = parseIdCard(value);
|
|
31
|
+
const ageFields = collector.getField(FIELD_BUSINESS_TYPE.AGE);
|
|
32
|
+
ageFields.forEach((field) => {
|
|
33
|
+
formModel.setFieldState(field, (state) => {
|
|
34
|
+
state.value = info.age;
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const handlerMap = /* @__PURE__ */ new Map([[FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType]]);
|
|
39
|
+
function trigger(collector, formModel, fieldName, value) {
|
|
40
|
+
const type = collector.fieldNameCollector.get(fieldName);
|
|
41
|
+
if (!type || !handlerMap.has(type))
|
|
42
|
+
return;
|
|
43
|
+
handlerMap.get(type)(formModel, collector, value);
|
|
44
|
+
}
|
|
45
|
+
return { create, trigger };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { BusinessCollector, useBusinessBinding };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCommonLog } from './useCommonLog2.mjs';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { formRenderLog } from '../utils/index2.mjs';
|
|
2
|
+
|
|
3
|
+
function useCommonLog() {
|
|
4
|
+
function invalidHttpInstanceLog() {
|
|
5
|
+
formRenderLog(`before use http feature, you should regist http instance by useFormilyRequest.registGlobHttpInstance()`, "warn");
|
|
6
|
+
}
|
|
7
|
+
return { invalidHttpInstanceLog };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { useCommonLog };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FieldItem } from '../types';
|
|
2
|
+
import { BusinessCollector } from './useBusinessBinding';
|
|
3
|
+
/**
|
|
4
|
+
* @description 胶水层, 将低代码平台中的fieldList转换为JSONSchema
|
|
5
|
+
*/
|
|
6
|
+
export declare function useFieldList2Schema(collector: BusinessCollector): {
|
|
7
|
+
transform: (fieldList: FieldItem[]) => Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
8
|
+
[key: symbol]: any;
|
|
9
|
+
[key: `x-${string}`]: any;
|
|
10
|
+
[key: `x-${number}`]: any;
|
|
11
|
+
version?: string | undefined;
|
|
12
|
+
name?: import("@formily/json-schema/esm/types").SchemaKey | undefined;
|
|
13
|
+
title?: any;
|
|
14
|
+
description?: any;
|
|
15
|
+
default?: any;
|
|
16
|
+
readOnly?: boolean | undefined;
|
|
17
|
+
writeOnly?: boolean | undefined;
|
|
18
|
+
type?: import("@formily/json-schema/esm/types").SchemaTypes | undefined;
|
|
19
|
+
enum?: import("@formily/json-schema/esm/types").SchemaEnum<any> | undefined;
|
|
20
|
+
const?: any;
|
|
21
|
+
multipleOf?: number | undefined;
|
|
22
|
+
maximum?: number | undefined;
|
|
23
|
+
exclusiveMaximum?: number | undefined;
|
|
24
|
+
minimum?: number | undefined;
|
|
25
|
+
exclusiveMinimum?: number | undefined;
|
|
26
|
+
maxLength?: number | undefined;
|
|
27
|
+
minLength?: number | undefined;
|
|
28
|
+
pattern?: string | RegExp | undefined;
|
|
29
|
+
maxItems?: number | undefined;
|
|
30
|
+
minItems?: number | undefined;
|
|
31
|
+
uniqueItems?: boolean | undefined;
|
|
32
|
+
maxProperties?: number | undefined;
|
|
33
|
+
minProperties?: number | undefined;
|
|
34
|
+
required?: string | boolean | string[] | undefined;
|
|
35
|
+
format?: string | undefined;
|
|
36
|
+
$ref?: string | undefined;
|
|
37
|
+
$namespace?: string | undefined;
|
|
38
|
+
definitions?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
39
|
+
properties?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
40
|
+
items?: import("@formily/json-schema/esm/types").SchemaItems<any, any, any, any, any, any, any, any> | undefined;
|
|
41
|
+
additionalItems?: import("@formily/json-schema/esm/types").Stringify<any> | undefined;
|
|
42
|
+
patternProperties?: import("@formily/json-schema/esm/types").SchemaProperties<any, any, any, any, any, any, any, any> | undefined;
|
|
43
|
+
additionalProperties?: import("@formily/json-schema/esm/types").Stringify<any> | undefined;
|
|
44
|
+
"x-value"?: any;
|
|
45
|
+
"x-index"?: number | undefined;
|
|
46
|
+
"x-pattern"?: any;
|
|
47
|
+
"x-display"?: any;
|
|
48
|
+
"x-validator"?: any;
|
|
49
|
+
"x-decorator"?: any;
|
|
50
|
+
"x-decorator-props"?: any;
|
|
51
|
+
"x-component"?: any;
|
|
52
|
+
"x-component-props"?: any;
|
|
53
|
+
"x-reactions"?: import("@formily/json-schema/esm/types").SchemaReactions<any> | undefined;
|
|
54
|
+
"x-content"?: any;
|
|
55
|
+
"x-data"?: any;
|
|
56
|
+
"x-visible"?: boolean | undefined;
|
|
57
|
+
"x-hidden"?: boolean | undefined;
|
|
58
|
+
"x-disabled"?: boolean | undefined;
|
|
59
|
+
"x-editable"?: boolean | undefined;
|
|
60
|
+
"x-read-only"?: boolean | undefined;
|
|
61
|
+
"x-read-pretty"?: boolean | undefined;
|
|
62
|
+
"x-compile-omitted"?: string[] | undefined;
|
|
63
|
+
}>>;
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFieldList2Schema } from './useFieldList2Schema2.mjs';
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { arrayed, transformDateFormat } from '../utils/index2.mjs';
|
|
2
|
+
import { useFormValidator } from './useFormValidator2.mjs';
|
|
3
|
+
import { isObject } from '@vueuse/core';
|
|
4
|
+
import { useTypeNormalize } from './useTypeNormalize2.mjs';
|
|
5
|
+
|
|
6
|
+
function useFieldList2Schema(collector) {
|
|
7
|
+
const { createValidatorSchema } = useFormValidator();
|
|
8
|
+
const createStandardSchema = (item) => {
|
|
9
|
+
const result = {
|
|
10
|
+
name: item.val_key,
|
|
11
|
+
type: "string",
|
|
12
|
+
title: item.alias || item.name,
|
|
13
|
+
"x-decorator": "FORM_ITEM",
|
|
14
|
+
"x-decorator-props": { span: item.elem_width, showLabel: item.hide_title !== "1" },
|
|
15
|
+
"x-component": item.html_type,
|
|
16
|
+
"x-component-props": { placeholder: item.placeholder, clearable: item.is_empty === "1" },
|
|
17
|
+
"x-display": item.is_show === "0" ? "hidden" : "visible",
|
|
18
|
+
"x-pattern": item.is_edit === "0" ? "disabled" : "editable"
|
|
19
|
+
};
|
|
20
|
+
if (isObject(item.reactions)) {
|
|
21
|
+
result["x-reactions"] = item.reactions;
|
|
22
|
+
}
|
|
23
|
+
const rules = createValidatorSchema(item);
|
|
24
|
+
rules && (result["x-validator"] = rules);
|
|
25
|
+
item.is_null === "0" && (result.required = true);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
const createInputSchema = (item) => {
|
|
29
|
+
const schema = createStandardSchema(item);
|
|
30
|
+
Object.assign(schema["x-component-props"], {
|
|
31
|
+
prefix: item.prefix,
|
|
32
|
+
suffix: item.suffix
|
|
33
|
+
});
|
|
34
|
+
return schema;
|
|
35
|
+
};
|
|
36
|
+
const createSelectSchema = (item) => {
|
|
37
|
+
const schema = createStandardSchema(item);
|
|
38
|
+
Object.assign(schema["x-component-props"], {
|
|
39
|
+
urlConfig: item.urlConfig,
|
|
40
|
+
options: item.option,
|
|
41
|
+
multiple: item.multi_select === "0",
|
|
42
|
+
maxTagCount: +item.multi_select_value
|
|
43
|
+
});
|
|
44
|
+
return schema;
|
|
45
|
+
};
|
|
46
|
+
const createRadioSchema = (item) => {
|
|
47
|
+
const schema = createStandardSchema(item);
|
|
48
|
+
Object.assign(schema["x-component-props"], {
|
|
49
|
+
options: item.option,
|
|
50
|
+
vertical: item.__vertical
|
|
51
|
+
});
|
|
52
|
+
return schema;
|
|
53
|
+
};
|
|
54
|
+
const createDateSchema = (item) => {
|
|
55
|
+
const schema = createStandardSchema(item);
|
|
56
|
+
Object.assign(schema["x-component-props"], {
|
|
57
|
+
valueFormat: item.date_format,
|
|
58
|
+
type: transformDateFormat(item.date_format),
|
|
59
|
+
validate: item.validate
|
|
60
|
+
});
|
|
61
|
+
return schema;
|
|
62
|
+
};
|
|
63
|
+
const createCascaderSchema = (item) => {
|
|
64
|
+
var _a;
|
|
65
|
+
const schema = createStandardSchema(item);
|
|
66
|
+
Object.assign(schema["x-component-props"], {
|
|
67
|
+
urlConfig: item.urlConfig,
|
|
68
|
+
deep: (_a = item.wordbook) == null ? void 0 : _a.level_num,
|
|
69
|
+
options: item.option
|
|
70
|
+
});
|
|
71
|
+
return schema;
|
|
72
|
+
};
|
|
73
|
+
const createSwitchSchema = (item) => {
|
|
74
|
+
const schema = createStandardSchema(item);
|
|
75
|
+
Object.assign(schema["x-component-props"], {
|
|
76
|
+
openDescription: item.open,
|
|
77
|
+
closeDescription: item.close
|
|
78
|
+
});
|
|
79
|
+
return schema;
|
|
80
|
+
};
|
|
81
|
+
const createCombinationSchema = (item) => {
|
|
82
|
+
const schema = createStandardSchema(item);
|
|
83
|
+
schema["x-decorator-props"].showLabel = false;
|
|
84
|
+
Object.assign(schema["x-component-props"], {
|
|
85
|
+
title: item.alias || item.name,
|
|
86
|
+
properties: transform(item.children || [])
|
|
87
|
+
});
|
|
88
|
+
return schema;
|
|
89
|
+
};
|
|
90
|
+
const createInputNumberSchema = (item) => {
|
|
91
|
+
const schema = createStandardSchema(item);
|
|
92
|
+
const { decimal_length, validate } = item;
|
|
93
|
+
Object.assign(schema["x-component-props"], {
|
|
94
|
+
precision: decimal_length || (validate == null ? void 0 : validate.decimal_length),
|
|
95
|
+
max: validate == null ? void 0 : validate.max_value,
|
|
96
|
+
min: validate == null ? void 0 : validate.min_value
|
|
97
|
+
});
|
|
98
|
+
return schema;
|
|
99
|
+
};
|
|
100
|
+
const createSliderSchema = (item) => {
|
|
101
|
+
const schema = createStandardSchema(item);
|
|
102
|
+
Object.assign(schema["x-component-props"], {
|
|
103
|
+
step: item.step_length,
|
|
104
|
+
max: item.max_length,
|
|
105
|
+
min: item.min_length,
|
|
106
|
+
options: item.option
|
|
107
|
+
});
|
|
108
|
+
return schema;
|
|
109
|
+
};
|
|
110
|
+
const createCustomSchema = (item) => {
|
|
111
|
+
const schema = createStandardSchema(item);
|
|
112
|
+
Object.assign(schema["x-component-props"], {
|
|
113
|
+
fieldItem: item
|
|
114
|
+
});
|
|
115
|
+
return schema;
|
|
116
|
+
};
|
|
117
|
+
const createCollapseSchema = (item) => {
|
|
118
|
+
return {
|
|
119
|
+
name: item.val_key,
|
|
120
|
+
type: "void",
|
|
121
|
+
title: item.alias || item.name,
|
|
122
|
+
"x-component": "COLLAPSE",
|
|
123
|
+
"x-component-props": {
|
|
124
|
+
disabled: item.is_not_fold === "1",
|
|
125
|
+
show: !!item.is_show
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const creatorMap = /* @__PURE__ */ new Map([
|
|
130
|
+
["LINEBAR", createCollapseSchema],
|
|
131
|
+
["INPUT", createInputSchema],
|
|
132
|
+
["INPUT_NUMBER", createInputNumberSchema],
|
|
133
|
+
["SELECT", createSelectSchema],
|
|
134
|
+
["DATE", createDateSchema],
|
|
135
|
+
["SEARCH_CASCADE", createCascaderSchema],
|
|
136
|
+
["COMBINATION", createCombinationSchema],
|
|
137
|
+
["RADIO", createRadioSchema],
|
|
138
|
+
["CHECKBOX", createRadioSchema],
|
|
139
|
+
["SWITCH", createSwitchSchema],
|
|
140
|
+
["SLIDER", createSliderSchema]
|
|
141
|
+
]);
|
|
142
|
+
const createWidgetSchema = (item) => {
|
|
143
|
+
if (item.suffixConfig)
|
|
144
|
+
return createWidgetCombinationSchema(item);
|
|
145
|
+
const creator = creatorMap.get(item.html_type) || createCustomSchema;
|
|
146
|
+
return creator(item);
|
|
147
|
+
};
|
|
148
|
+
const createWidgetCombinationSchema = (item) => {
|
|
149
|
+
const suffixList = arrayed(item.suffixConfig);
|
|
150
|
+
const fieldList = [{ ...item, suffixConfig: void 0 }].concat(suffixList.map((suffix) => {
|
|
151
|
+
return { ...suffix, is_show: "1", hide_title: "1" };
|
|
152
|
+
}));
|
|
153
|
+
return {
|
|
154
|
+
type: "void",
|
|
155
|
+
title: item.alias || item.name,
|
|
156
|
+
"x-component": "INPUT_GROUP",
|
|
157
|
+
"x-component-props": { span: item.elem_width },
|
|
158
|
+
properties: transform(fieldList)
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
const { normalize } = useTypeNormalize();
|
|
162
|
+
function transform(fieldList) {
|
|
163
|
+
let prevCollapse = null;
|
|
164
|
+
return fieldList.reduce((fin, cur) => {
|
|
165
|
+
var _a;
|
|
166
|
+
normalize(cur);
|
|
167
|
+
const obj_type = (_a = cur.validate) == null ? void 0 : _a.obj_type;
|
|
168
|
+
obj_type && collector.collect(obj_type, cur.val_key);
|
|
169
|
+
if (cur.html_type === "LINEBAR") {
|
|
170
|
+
fin[cur.val_key] = createCollapseSchema(cur);
|
|
171
|
+
prevCollapse = fin[cur.val_key].properties = {};
|
|
172
|
+
} else if (prevCollapse) {
|
|
173
|
+
prevCollapse[cur.val_key] = createWidgetSchema(cur);
|
|
174
|
+
} else {
|
|
175
|
+
prevCollapse = null;
|
|
176
|
+
fin[cur.val_key] = createWidgetSchema(cur);
|
|
177
|
+
}
|
|
178
|
+
return fin;
|
|
179
|
+
}, {});
|
|
180
|
+
}
|
|
181
|
+
return { transform };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { useFieldList2Schema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFieldVisitor } from './useFieldVisitor2.mjs';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { arrayed } from '../utils/index2.mjs';
|
|
2
|
+
import { isFunction } from '@vueuse/core';
|
|
3
|
+
|
|
4
|
+
function useFieldVisitor() {
|
|
5
|
+
function traverse(fieldList, visitorMap, key = "val_key") {
|
|
6
|
+
if (!visitorMap)
|
|
7
|
+
return fieldList;
|
|
8
|
+
return fieldList.reduce((fin, field) => {
|
|
9
|
+
if (Array.isArray(field.children)) {
|
|
10
|
+
field.children = traverse(field.children, visitorMap, key);
|
|
11
|
+
}
|
|
12
|
+
if (field.suffixConfig) {
|
|
13
|
+
field.suffixConfig = traverse(arrayed(field.suffixConfig), visitorMap, key);
|
|
14
|
+
}
|
|
15
|
+
const visitor = visitorMap[field[key]];
|
|
16
|
+
let current = field;
|
|
17
|
+
const before = [];
|
|
18
|
+
const after = [];
|
|
19
|
+
isFunction(visitor) && visitor({
|
|
20
|
+
field,
|
|
21
|
+
replace(field2) {
|
|
22
|
+
current = field2;
|
|
23
|
+
},
|
|
24
|
+
insertBefore(field2) {
|
|
25
|
+
before.push(...arrayed(field2));
|
|
26
|
+
},
|
|
27
|
+
insertAfter(field2) {
|
|
28
|
+
after.push(...arrayed(field2));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
fin.push(...before, current, ...after);
|
|
32
|
+
return fin;
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
return { traverse };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { useFieldVisitor };
|