cnhis-design-vue 3.2.14-release.1 → 3.2.15-beta.2
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/components/ai-chat/index.d.ts +1 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +1 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
- package/es/components/base-search/index.d.ts +8 -3
- package/es/components/base-search/src/index.vue.d.ts +8 -3
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/big-table/src/components/NoData.vue2.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/components/big-table/src/components/input-button.vue2.js +1 -1
- package/es/components/big-table/src/hooks/useNestTable.js +1 -1
- package/es/components/big-table/src/hooks/useTableParse.js +1 -1
- package/es/components/body-select/src/index.vue2.js +1 -1
- package/es/components/branch-notice/index.d.ts +63 -0
- package/es/components/branch-notice/index.js +1 -0
- package/es/components/branch-notice/src/BranchNotice.vue.d.ts +64 -0
- package/es/components/branch-notice/src/BranchNotice.vue.js +1 -0
- package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -0
- package/es/components/branch-notice/src/canstants.d.ts +7 -0
- package/es/components/branch-notice/src/canstants.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +151 -0
- package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +35 -0
- package/es/components/branch-notice/src/components/NoticeOperationList.vue.d.ts +49 -0
- package/es/components/branch-notice/src/drawLine.d.ts +2 -0
- package/es/components/branch-notice/src/drawLine.js +1 -0
- package/es/components/branch-notice/src/types.d.ts +14 -0
- package/es/components/branch-notice/src/types.js +1 -0
- package/es/components/branch-notice/style/index.css +1 -0
- package/es/components/button-print/index.d.ts +4 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/button-print/src/components/EditFormat.vue2.js +1 -1
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/Preview.vue2.js +1 -1
- package/es/components/button-print/src/utils/dialog.js +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +4 -4
- package/es/components/calendar/src/Calendar.vue.d.ts +4 -4
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
- package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
- package/es/components/classification/index.d.ts +1 -0
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +1 -0
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/classification/style/index.css +1 -1
- package/es/components/default-page/src/constants/index.js +1 -1
- package/es/components/default-page/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/expand-field/src/utils/constant.js +1 -1
- package/es/components/fabric-chart/index.d.ts +23 -4
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +23 -4
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
- package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/useStyle.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +1 -1
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +3 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +5 -4
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/constants/filter.d.ts +21 -12
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/form-config/index.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +108 -3
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/iho-chat/index.d.ts +635 -54
- package/es/components/iho-chat/src/Index.vue.d.ts +638 -61
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/api/index.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +221 -11
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +49 -10
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +69 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +12 -3
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -0
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
- package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +0 -6
- package/es/components/iho-chat/src/types/index.js +1 -1
- package/es/components/iho-chat/src/utils/chatSock.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +2 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
- package/es/components/quick-search/index.d.ts +3 -1
- package/es/components/quick-search/src/index.vue.d.ts +3 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/recommend-search/src/components/BaseSearch.js +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
- package/es/components/scale-view/index.d.ts +31 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/NoData.vue2.js +1 -1
- package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
- package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
- package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
- package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
- package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +1 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/slider-tree/src/index.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-export-field/src/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +3 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
- package/es/components/iho-chat/src/hooks/useSession.js +0 -1
- package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
- package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -130,6 +130,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
130
130
|
beforeMove: {
|
131
131
|
type: PropType<((payload: import("../../../components/form-config/src/types").FormConfigBeforeMovePayload) => boolean | void) | undefined>;
|
132
132
|
};
|
133
|
+
showLowCodeReactions: BooleanConstructor;
|
133
134
|
}, {
|
134
135
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
135
136
|
maxHeight: {
|
@@ -257,11 +258,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
257
258
|
beforeMove: {
|
258
259
|
type: PropType<((payload: import("../../../components/form-config/src/types").FormConfigBeforeMovePayload) => boolean | void) | undefined>;
|
259
260
|
};
|
261
|
+
showLowCodeReactions: BooleanConstructor;
|
260
262
|
}>> & {
|
261
263
|
onAddItem?: ((...args: any[]) => any) | undefined;
|
262
264
|
onRemoveItem?: ((...args: any[]) => any) | undefined;
|
265
|
+
onReactionsValidateFailure?: ((...args: any[]) => any) | undefined;
|
263
266
|
}>>;
|
264
|
-
emit: (event: "addItem" | "removeItem", ...args: any[]) => void;
|
267
|
+
emit: (event: "addItem" | "removeItem" | "reactionsValidateFailure", ...args: any[]) => void;
|
265
268
|
uuid: string;
|
266
269
|
cssVars: import("vue").ComputedRef<import("../../../shared/types").AnyObject>;
|
267
270
|
fieldListRef: Ref<FormConfigItem[]>;
|
@@ -3787,6 +3790,104 @@ declare const _default: import("vue").DefineComponent<{
|
|
3787
3790
|
}>>>;
|
3788
3791
|
};
|
3789
3792
|
}>>, {}>;
|
3793
|
+
FormConfigEventSetting: import("vue").DefineComponent<{
|
3794
|
+
modelValue: {
|
3795
|
+
type: ArrayConstructor;
|
3796
|
+
required: true;
|
3797
|
+
default: () => never[];
|
3798
|
+
};
|
3799
|
+
}, {
|
3800
|
+
props: {
|
3801
|
+
modelValue: LowCodeTypes.reactionConfig[];
|
3802
|
+
};
|
3803
|
+
emit: (event: "update:modelValue" | "validateFailure", ...args: any[]) => void;
|
3804
|
+
cssVars: import("vue").ComputedRef<import("../../../shared/types").AnyObject>;
|
3805
|
+
valueRef: Ref<{
|
3806
|
+
conObj: {
|
3807
|
+
con: LowCodeTypes.VALUE_RELATION;
|
3808
|
+
field_key: string;
|
3809
|
+
value: unknown;
|
3810
|
+
}[];
|
3811
|
+
compareMap?: {
|
3812
|
+
NULL?: ((v1: any, v2: any) => boolean) | undefined;
|
3813
|
+
EQ?: ((v1: any, v2: any) => boolean) | undefined;
|
3814
|
+
BIG?: ((v1: any, v2: any) => boolean) | undefined;
|
3815
|
+
LESS?: ((v1: any, v2: any) => boolean) | undefined;
|
3816
|
+
BIGEQ?: ((v1: any, v2: any) => boolean) | undefined;
|
3817
|
+
LESSEQ?: ((v1: any, v2: any) => boolean) | undefined;
|
3818
|
+
CL?: ((v1: any, v2: any) => boolean) | undefined;
|
3819
|
+
NC?: ((v1: any, v2: any) => boolean) | undefined;
|
3820
|
+
NEQ?: ((v1: any, v2: any) => boolean) | undefined;
|
3821
|
+
NOT_NULL?: ((v1: any, v2: any) => boolean) | undefined;
|
3822
|
+
} | undefined;
|
3823
|
+
isRestoreDefault?: boolean | undefined;
|
3824
|
+
sqlExpression?: string | undefined;
|
3825
|
+
showField?: string[] | undefined;
|
3826
|
+
hideField?: string[] | undefined;
|
3827
|
+
requiredField?: string[] | undefined;
|
3828
|
+
notRequiredField?: string[] | undefined;
|
3829
|
+
enabledField?: string[] | undefined;
|
3830
|
+
disabledField?: string[] | undefined;
|
3831
|
+
__oppositeBindField?: any | undefined;
|
3832
|
+
__oppositeTargetField?: any | undefined;
|
3833
|
+
}[]>;
|
3834
|
+
expandedName: Ref<string>;
|
3835
|
+
addConnection: () => void;
|
3836
|
+
removeConnection: (index: number) => void;
|
3837
|
+
getOppositeBtnText: (item: LowCodeTypes.reactionConfig) => string | undefined;
|
3838
|
+
unBindOpposite: (item: LowCodeTypes.reactionConfig) => void;
|
3839
|
+
addOppositeCondition: (item: LowCodeTypes.reactionConfig) => void;
|
3840
|
+
getOppositeSqlExpression: (expression?: string | undefined) => string | undefined;
|
3841
|
+
createOppositeCondition: (config: LowCodeTypes.reactionConfig) => LowCodeTypes.reactionConfig;
|
3842
|
+
isOppositeConfig: (c1: LowCodeTypes.reactionConfig, c2: LowCodeTypes.reactionConfig) => boolean;
|
3843
|
+
onUpdateExpandedNames: (value: string[]) => void;
|
3844
|
+
getBinderFieldDesc: (index: number) => string;
|
3845
|
+
addCondition: (config: LowCodeTypes.reactionConfig) => void;
|
3846
|
+
removeCondition: (config: LowCodeTypes.reactionConfig, index: number) => void;
|
3847
|
+
onUpdateConditionType: (condition: LowCodeTypes.reactionsConObj, type: LowCodeTypes.VALUE_RELATION) => void;
|
3848
|
+
showRef: Ref<boolean>;
|
3849
|
+
fieldListRef: Ref<FormConfigItem[]>;
|
3850
|
+
fieldOptions: import("vue").ComputedRef<FormConfigItem[]>;
|
3851
|
+
currentTypeList: string[];
|
3852
|
+
dialog: import("naive-ui").DialogApi;
|
3853
|
+
onNegativeClick: () => Promise<void>;
|
3854
|
+
onPositiveClick: () => Promise<void>;
|
3855
|
+
configValidate: () => Promise<void>;
|
3856
|
+
HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
3857
|
+
NButton: any;
|
3858
|
+
NModal: any;
|
3859
|
+
NSpace: any;
|
3860
|
+
NScrollbar: any;
|
3861
|
+
NThing: any;
|
3862
|
+
NInputGroup: any;
|
3863
|
+
NSelect: any;
|
3864
|
+
NInput: any;
|
3865
|
+
NCollapse: any;
|
3866
|
+
NCollapseItem: any;
|
3867
|
+
NEllipsis: any;
|
3868
|
+
NEmpty: any;
|
3869
|
+
NTooltip: any;
|
3870
|
+
NIcon: any;
|
3871
|
+
conditionTypeOptions: {
|
3872
|
+
value: LowCodeTypes.VALUE_RELATION;
|
3873
|
+
label: string;
|
3874
|
+
}[];
|
3875
|
+
connectionTypeOptions: {
|
3876
|
+
value: string;
|
3877
|
+
label: string;
|
3878
|
+
}[];
|
3879
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "validateFailure")[], "update:modelValue" | "validateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
3880
|
+
modelValue: {
|
3881
|
+
type: ArrayConstructor;
|
3882
|
+
required: true;
|
3883
|
+
default: () => never[];
|
3884
|
+
};
|
3885
|
+
}>> & {
|
3886
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
3887
|
+
onValidateFailure?: ((...args: any[]) => any) | undefined;
|
3888
|
+
}, {
|
3889
|
+
modelValue: unknown[];
|
3890
|
+
}>;
|
3790
3891
|
FormConfigMaterialItem: import("vue").DefineComponent<{
|
3791
3892
|
formConfigItem: {
|
3792
3893
|
type: PropType<FormConfigItem>;
|
@@ -3819,7 +3920,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
3819
3920
|
FORM_CONFIG_GROUP: string;
|
3820
3921
|
NSelect: any;
|
3821
3922
|
NSpace: any;
|
3822
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("addItem" | "removeItem")[], "addItem" | "removeItem", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
3923
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("addItem" | "removeItem" | "reactionsValidateFailure")[], "addItem" | "removeItem" | "reactionsValidateFailure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
3823
3924
|
maxHeight: {
|
3824
3925
|
type: StringConstructor;
|
3825
3926
|
};
|
@@ -3945,8 +4046,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
3945
4046
|
beforeMove: {
|
3946
4047
|
type: PropType<((payload: import("../../../components/form-config/src/types").FormConfigBeforeMovePayload) => boolean | void) | undefined>;
|
3947
4048
|
};
|
4049
|
+
showLowCodeReactions: BooleanConstructor;
|
3948
4050
|
}>> & {
|
3949
4051
|
onAddItem?: ((...args: any[]) => any) | undefined;
|
3950
4052
|
onRemoveItem?: ((...args: any[]) => any) | undefined;
|
3951
|
-
|
4053
|
+
onReactionsValidateFailure?: ((...args: any[]) => any) | undefined;
|
4054
|
+
}, {
|
4055
|
+
showLowCodeReactions: boolean;
|
4056
|
+
}>;
|
3952
4057
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,toDisplayString as
|
1
|
+
import{defineComponent as e,provide as o,ref as t,computed as r,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,toDisplayString as u,createVNode as f,isRef as d,withCtx as c,createBlock as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import"@vue/shared";import{uuidGenerator as j,traverse as k}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as L,NSpace as C}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{useFormConfigLocale as V}from"./hooks/useLocale.js";import b from"../../../shared/components/VueDraggable/src/vuedraggable.js";import M from"./components/FormConfigCreator.vue.js";import w from"./components/FormConfigDragDisplay.vue.js";import R from"./components/FormConfigEdit.vue.js";import D from"./components/FormConfigEventSetting.vue.js";import E from"./components/FormConfigMaterialItem.js";import{useDataNormalize as H}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as S,InjectionFormConfigEmit as A,InjectionFieldList as I,InjectionMaterialList as U,InjectionLowCodeReactions as O,InjectionActiveFieldItem as P,FORM_CONFIG_GROUP as T}from"./constants/index.js";import{fieldItemNormalize as z}from"./utils/index.js";import{useSortableConfig as B}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const N=["id"],W={class:"form-config__material"},q={class:"form-config__materialHeader"},G={class:"form-config__displayWrapper"},J={class:"form-config__displayHeader"},K={class:"form-config__config"},Q={class:"form-config__configHeader"},X={class:"form-config__configContent"};var Y=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},formProps:{type:Object},beforeMove:{type:Function},showLowCodeReactions:Boolean},emits:["addItem","removeItem","reactionsValidateFailure"],setup(e,{expose:Y,emit:Z}){const $=e;o(S,$),o(A,Z);const ee=j(),oe=h(),te=t([]);o(I,te);const re=t([]);o(U,re);const ae=t([]);function ie(e){te.value.some((o=>o.key===e.key))||te.value.push(e)}o(O,ae);const se=(e,o)=>x($.textFormatter)?$.textFormatter(e,o):o,le=t();o(P,le);const ne=t(),{transform:me,inverseTransform:ue}=H($),fe=r({get:()=>null,set(e){if(!e)return;const o=ce.value.find((o=>o.key===e));o&&(o.__extra=!0,z(o),re.value.push(o),Z("addItem",o))}}),de=t([]),ce=r((()=>{if(!_(de.value))return[];const e=[];return k([...re.value,...te.value],(o=>e.push(o.key))),de.value.filter((o=>!e.find((e=>e===o.key))))}));async function pe(){$.extraMaterialList&&!de.value.length&&(de.value=x($.extraMaterialList)?await $.extraMaterialList():$.extraMaterialList)}return Y({loadData({fieldList:e,lowCodeReactions:o=[]}){let t=[],r=[];e.forEach((e=>{return!1===(o=y(a(e))).show?r.push(o):t.push(o),void z(o);var o})),te.value=me(t),re.value=r,ae.value=o,le.value=void 0},validate(){var e;return null==(e=ne.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:ue(y(a(te.value)),e,{show:!0}),materialList:ue(y(a(re.value)),e,{show:!1}),lowCodeReactions:y(a(ae.value))}),clearExtraList(){de.value=[]}}),(o,t)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n(oe)},id:n(ee)},n(F)()),[m("section",W,[m("header",q,u(n(V)("materialArea")),1),f(n(b),l(B({fieldList:te,materialList:re,hooks:{beforeMove:$.beforeMove}}),{class:"form-config__materialContent",modelValue:n(re),"onUpdate:modelValue":t[0]||(t[0]=e=>d(re)?re.value=e:null)}),{item:c((({element:e})=>[f(n(E),{"form-config-item":e,"text-formatter":se,"material-List":n(re)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),p(n(L),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(fe),"onUpdate:value":t[1]||(t[1]=e=>d(fe)?fe.value=e:null),placeholder:n(V)("materialArea.createMaterialPlaceholder"),options:n(ce),"label-field":"name","value-field":"key",onFocus:pe},null,8,["value","placeholder","options"])):v("v-if",!0)]),m("section",G,[m("header",J,[g(u(n(V)("layoutArea"))+" ",1),f(n(C),null,{default:c((()=>[e.showLowCodeReactions?(i(),p(D,{key:0,modelValue:ae.value,"onUpdate:modelValue":t[2]||(t[2]=e=>ae.value=e),onValidateFailure:t[3]||(t[3]=e=>Z("reactionsValidateFailure",e))},null,8,["modelValue"])):v("v-if",!0),f(M,{onSubmit:ie})])),_:1})]),f(w,{class:"form-config__displayContent",group:n(T),"text-formatter":se,modelValue:n(te),"onUpdate:modelValue":t[4]||(t[4]=e=>d(te)?te.value=e:null)},null,8,["group","modelValue"])]),m("section",K,[m("header",Q,u(n(V)("configArea")),1),m("section",X,[f(R,{ref_key:"formConfigEditRef",ref:ne,uuid:n(ee),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,N))}});export{Y as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./FormConfigEventSetting.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","FormConfigEventSetting.vue"]]);export{r as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,ref as l,watchEffect as o,watch as n,inject as i,computed as a,reactive as t,openBlock as s,createElementBlock as d,createVNode as u,unref as r,withCtx as p,createTextVNode as c,normalizeStyle as v,createElementVNode as _,Fragment as f,renderList as m,createBlock as g,toDisplayString as h,withModifiers as y,createCommentVNode as b,normalizeClass as k}from"vue";import{useTheme as F}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{cloneDeep as w,isEmpty as x,isArray as C,union as O,omit as j}from"lodash-es";import"@vue/shared";import{traverse as B}from"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{HelpCircleSharp as T}from"@vicons/ionicons5";import{useDialog as L,NButton as E,NModal as N,NScrollbar as U,NCollapse as z,NCollapseItem as q,NEllipsis as P,NThing as R,NSpace as $,NInputGroup as I,NSelect as A,NInput as D,NTooltip as V,NIcon as H,NEmpty as M}from"naive-ui";import"../../../../shared/hooks/useScrollLoading.js";import{conditionOppositeMap as S,connectionTypeOptions as W,connectionTypeOppositeMap as X,InjectionFieldList as G,conditionTypeOptions as J}from"../constants/index.js";const K={class:"form-config__connectionOperation"},Q={class:"form-config__connectionConditionHeaderDesc"},Y={class:"form-config__connectionCondition"},Z={class:"form-config__connectionConditionItem"},ee={style:{"margin-right":"8px"}},le={class:"form-config__connectionFieldType"},oe=["onClick"],ne={style:{display:"inline-flex","align-items":"center",gap:"4px","margin-bottom":"4px"}};var ie=e({__name:"FormConfigEventSetting",props:{modelValue:{default:()=>[]}},emits:["update:modelValue","validateFailure"],setup(e,{emit:ie}){const ae=e,te=F(),se=l([]),de=l("");function ue(){se.value.push({conObj:[]}),de.value=se.value.length-1+""}function re(e){return e.__oppositeBindField?`已绑定互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeBindField))+1}`:e.__oppositeTargetField?`已关联互斥联动: 联动${se.value.findIndex((l=>l===e.__oppositeTargetField))+1}`:void 0}function pe(e){return null==e?void 0:e.replace(/(AND|OR)/g,(e=>"AND"===e?"OR":"AND"))}function ce(e){var l;const o=e.__oppositeTargetField||{conObj:[]};return o.conObj=w(e.conObj),null==(l=o.conObj)||l.forEach((e=>{e.con=S[e.con]})),o.sqlExpression=pe(e.sqlExpression),W.forEach((({value:l})=>{x(e[l])?Reflect.deleteProperty(o,X[l]):o[X[l]]=w(e[l])})),o.__oppositeBindField=e,o}function ve(e,l){var o,n,i,a;return(null==(o=e.conObj)?void 0:o.length)===(null==(n=l.conObj)?void 0:n.length)&&(!(e.conObj&&l.conObj&&e.conObj.some((e=>!l.conObj.find((l=>{return n=l,(o=e).field_key===n.field_key&&o.con&&S[o.con]===n.con&&o.value===n.value;var o,n})))))&&(i=e.sqlExpression,a=l.sqlExpression,(!i&&!a||pe(i)===a)&&!W.some((({value:o})=>{return n=e[o],i=l[X[o]],!(n&&i?n.length===i.length&&n.every((e=>i.some((l=>e===l)))):!n&&!i);var n,i}))))}function _e(e){de.value=e[0]}function fe(e){const l=se.value[e];if(!l)return"";const o=l.conObj||[],n=W.reduce(((e,{value:o})=>(C(l[o])&&l[o].length&&e.push(...l[o].map(a)),e)),[]),i=O([...o.map((({field_key:e})=>a(e))),...n]).filter((e=>!!e));return i.length?`( 相关字段: ${i} )`:"";function a(e){var l,o;return null!=(o=null==(l=he.value.find((l=>e===l.key)))?void 0:l.name)?o:e}}o((()=>{se.value.forEach((e=>{e.__oppositeTargetField&&(e.__oppositeTargetField=ce(e))}))}));const me=l(!1);n(me,(e=>{e&&(se.value=w(ae.modelValue),se.value.forEach(((e,l)=>{if(e.__oppositeBindField||e.__oppositeTargetField)return;const o=se.value.find(((o,n)=>n!==l&&!o.__oppositeBindField&&!o.__oppositeTargetField&&ve(o,e)));o&&(o.__oppositeBindField=e,e.__oppositeTargetField=o)})))}));const ge=i(G,l([])),he=a((()=>{const e=[];return B(ge.value,(l=>{!["NEWLINE","LINE_BAR","COMPLEX","COMBINATION"].includes(l.type)&&e.push(l)})),e})),ye=t([]),be=L();async function ke(){var e,l;be.warning({title:"提示",content:"直接关闭弹窗会丢失已编辑的配置, 确定要关闭吗?",positiveText:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定",negativeText:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.32"))||"取消",onPositiveClick:()=>{me.value=!1,se.value=[]}})}async function Fe(){try{await function(){var e;const l=[];return null==(e=se.value)||e.forEach(((e,o)=>{const n=[];e.conObj&&e.conObj.length?e.conObj.forEach(((e,l)=>{e.field_key||n.push(`条件${l+1}字段为空`),e.con||n.push(`条件${l+1}判断类型为空`),["NULL","NOT_NULL"].includes(e.con)||!e.con||e.value||n.push(`条件${l+1}值为空`)})):n.push("联动条件为空"),W.every((({value:l})=>!e[l]||!e[l].length))&&n.push("联动字段为空"),n.length&&l.push(`联动${o+1}: ${n}`)})),l.length?Promise.reject(l):Promise.resolve()}(),me.value=!1,ie("update:modelValue",se.value.map((e=>j(e,["__oppositeBindField","__oppositeTargetField"]))))}catch(e){ie("validateFailure",e)}}return(e,l)=>(s(),d("section",null,[u(r(E),{size:"small",onClick:l[0]||(l[0]=e=>me.value=!0)},{default:p((()=>[c("调整联动绑定")])),_:1}),u(r(N),{show:me.value,"onUpdate:show":l[1]||(l[1]=e=>me.value=e),closable:!1,bordered:!1,"show-icon":!1,title:"联动绑定设置",preset:"dialog","mask-closable":!1,"close-on-esc":!1,style:v({width:"1000px",...r(te)}),class:"form-config__connectionModal"},{action:p((()=>[u(r(E),{size:"small",onClick:ke},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.32"))||"取消")]})),_:1}),u(r(E),{size:"small",onClick:Fe,type:"primary"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.33"))||"确定")]})),_:1})])),default:p((()=>[_("header",K,[u(r(E),{onClick:ue,size:"small"},{default:p((()=>[c("新增联动")])),_:1})]),u(r(U),{style:{"max-height":"500px","min-height":"500px"}},{default:p((()=>[u(r(z),{accordion:"","expanded-names":de.value,"onUpdate:expandedNames":_e},{default:p((()=>[(s(!0),d(f,null,m(se.value,((e,l)=>(s(),g(r(q),{name:l+""},{header:p((()=>[c(" 联动"+h(l+1)+" ",1),u(r(P),{class:"form-config__connectionConditionHeaderDesc",style:{"max-width":"500px"}},{default:p((()=>[c(h(fe(l)),1)])),_:2},1024)])),"header-extra":p((()=>[e.__oppositeBindField||e.__oppositeTargetField?(s(),d(f,{key:1},[_("span",Q,"( "+h(re(e))+" )",1),u(r(E),{quaternary:"",type:"primary",size:"small",onClick:y((l=>function(e){const l=e.__oppositeTargetField||e.__oppositeBindField;l&&[l,e].forEach((e=>{Reflect.deleteProperty(e,"__oppositeBindField"),Reflect.deleteProperty(e,"__oppositeTargetField")}))}(e)),["stop"])},{default:p((()=>[c("解除互斥")])),_:2},1032,["onClick"])],64)):(s(),g(r(E),{key:0,onClick:y((l=>function(e){se.value.push(e.__oppositeTargetField=ce(e))}(e)),["stop"]),quaternary:"",type:"primary",size:"small"},{default:p((()=>[c(" 创建互斥条件 ")])),_:2},1032,["onClick"])),u(r(E),{onClick:y((e=>function(e){var l;const o=null==(l=se.value)?void 0:l.splice(e,1);null==o||o.forEach((e=>{const l=e.__oppositeTargetField||e.__oppositeBindField;l&&(Reflect.deleteProperty(l,"__oppositeTargetField"),Reflect.deleteProperty(l,"__oppositeBindField"))})),ye.splice(e,1),!de.value||+de.value<e||(de.value=de.value===e+""?"":+de.value-1+"")}(l)),["stop"]),quaternary:"",type:"error",size:"small"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["onClick"])])),default:p((()=>[u(r(R),{class:"form-config__connectionWrapper"},{default:p((()=>[u(r($),{justify:"space-between",wrap:!1},{default:p((()=>[_("section",Y,[_("header",null,[c(" 条件 "),e.__oppositeBindField?b("v-if",!0):(s(),g(r(E),{key:0,size:"small",quaternary:"",type:"primary",onClick:l=>{var o;C((o=e).conObj)?o.conObj.push({}):o.conObj=[{}]}},{default:p((()=>[c(" 添加条件 ")])),_:2},1032,["onClick"]))]),u(r(U),{style:{"max-height":"145px","min-height":"145px"},class:"form-config__connectionWrapper"},{default:p((()=>[(s(!0),d(f,null,m(e.conObj||[],((l,o)=>(s(),d("div",Z,[_("span",ee,h(o+1),1),u(r(I),{size:"small"},{default:p((()=>[u(r(A),{value:l.field_key,"onUpdate:value":e=>l.field_key=e,disabled:!!e.__oppositeBindField,placeholder:"请选择字段",options:r(he),"label-field":"name","value-field":"key",filterable:""},null,8,["value","onUpdate:value","disabled","options"]),u(r(A),{value:l.con,disabled:!!e.__oppositeBindField,"onUpdate:value":e=>function(e,l){e.con=l,["NOT_NULL","NULL"].includes(l)&&Reflect.deleteProperty(e,"value")}(l,e),placeholder:"请选择判断类型",options:r(J)},null,8,["value","disabled","onUpdate:value","options"]),l.con&&!["NULL","NOT_NULL"].includes(l.con)?(s(),g(r(D),{key:0,disabled:!!e.__oppositeBindField,value:l.value,"onUpdate:value":e=>l.value=e,placeholder:"请输入值",clearable:""},null,8,["disabled","value","onUpdate:value"])):b("v-if",!0)])),_:2},1024),u(r(E),{disabled:!!e.__oppositeBindField,quaternary:"",onClick:l=>function(e,l){C(e.conObj)&&e.conObj.splice(l,1)}(e,o),type:"error",size:"small"},{default:p((()=>{var e;return[c((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.88"))||"移除")]})),_:2},1032,["disabled","onClick"])])))),256))])),_:2},1024)]),_("section",le,[_("div",null,[(s(!0),d(f,null,m(r(W),(o=>{var n,i;return s(),d("div",{key:o.value,class:k({"is-active":ye[l]===o.value}),onClick:e=>ye[l]=o.value},h(o.label)+" ( "+h(null!=(i=null==(n=e[o.value])?void 0:n.length)?i:0)+" ) ",11,oe)})),128))]),_("div",null,[ye[l]?(s(),g(r(A),{key:0,value:e[ye[l]],"onUpdate:value":o=>e[ye[l]]=o,disabled:!!e.__oppositeBindField,multiple:"",placeholder:"请选择字段",options:r(he),"label-field":"name","value-field":"key",filterable:"","max-tag-count":10},null,8,["value","onUpdate:value","disabled","options"])):b("v-if",!0)])])])),_:2},1024),_("section",null,[_("label",null,[_("span",ne,[c(" 条件逻辑 "),u(r(V),null,{trigger:p((()=>[u(r(H),{size:"16",component:r(T)},null,8,["component"])])),default:p((()=>[c(" 非必填, 默认为需要全部满足. 示例: (1 AND 2) OR 3, 表示 条件1和2需要满足其一, 条件3必须满足 ")])),_:1})]),u(r(D),{value:e.sqlExpression,"onUpdate:value":l=>e.sqlExpression=l,disabled:!!e.__oppositeBindField,placeholder:"请输入条件逻辑"},null,8,["value","onUpdate:value","disabled"])])])])),_:2},1024)])),_:2},1032,["name"])))),256))])),_:1},8,["expanded-names"]),se.value.length?b("v-if",!0):(s(),g(r(M),{key:0,size:"huge",style:{"margin-top":"20px"},description:"无联动配置"}))])),_:1})])),_:1},8,["show","style"])]))}});export{ie as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{range as e}from"lodash-es";import{useFormConfigLocale as l}from"../hooks/useLocale.js";function
|
1
|
+
import{range as e}from"lodash-es";import{useFormConfigLocale as l}from"../hooks/useLocale.js";var a,o,n,i,d,u,t,E,L,v;function w(e){return new Map([["LINE_BAR",l("layoutArea.linebar")],["NEWLINE",l("layoutArea.linebreak")]]).get(e)||""}var r=(e=>(e.KEY="key",e.NAME="name",e.ALIAS="alias",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(r||{});function c(){return{option:[{text:l("configArea.fullLine"),value:"ALL_LINE"},{text:l("configArea.halfLine"),value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function g(){return{option:e(1,11).map((e=>({text:`${e}`,value:e})))}}function b(){return{open:{value:!0},close:{value:!1}}}function F(){return{open:{value:!0},close:{value:!1}}}function N(){return{open:{value:!0},close:{value:!1}}}function s(){return{open:{value:!0},close:{value:!1}}}function I(){return{open:{value:!0},close:{value:!1}}}const S={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},y=[{value:"EQ",label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.317"))||"等于"},{value:"NEQ",label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.318"))||"不等于"},{value:"CL",label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.340"))||"包含"},{value:"NC",label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.341"))||"不包含"},{value:"NULL",label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.338"))||"为空"},{value:"NOT_NULL",label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.339"))||"不为空"},{value:"BIG",label:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.319"))||"大于"},{value:"BIGEQ",label:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.321"))||"大于等于"},{value:"LESS",label:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.320"))||"小于"},{value:"LESSEQ",label:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.322"))||"小于等于"}],C={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},f=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],_="__display",B=Symbol("InjectionFieldList"),m=Symbol("InjectionMaterialList"),A=Symbol("InjectionLowCodeReactions"),p=Symbol("InjectionActiveFieldItem"),O=Symbol("InjectionFormConfigEmit"),T=Symbol("InjectionFormConfigProps");export{r as EditAbleField,_ as FORM_CONFIG_GROUP,p as InjectionActiveFieldItem,B as InjectionFieldList,O as InjectionFormConfigEmit,T as InjectionFormConfigProps,A as InjectionLowCodeReactions,m as InjectionMaterialList,S as conditionOppositeMap,y as conditionTypeOptions,C as connectionTypeOppositeMap,f as connectionTypeOptions,w as getWidgetText,N as isEditOptionConfig,F as isNotFoldOptionConfig,s as isNullOptionConfig,b as isShowOptionConfig,I as isVisibleOptionConfig,g as rowsOptionConfig,c as widgetWidthOptionConfig};
|
@@ -1 +1 @@
|
|
1
|
-
import{deepMerge as
|
1
|
+
import{deepMerge as o}from"../../../../shared/utils/index.js";import{property as e}from"lodash-es";import{reactive as n}from"vue";var l,i,a,d,w,g,t,u,r,c,y,v,L,B,C,s,m,f,p,h,N,b,x,O,T,A,S,k,E,j;const q=n({materialArea:{areaName:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.1"))||"物料区",createMaterialPlaceholder:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.2"))||"请选择额外物料",toString(){return this.areaName}},layoutArea:{areaName:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.3"))||"布局区",linebreak:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.4"))||"分行符",linebar:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.5"))||"分线栏",createLinebreak:(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.6"))||"新建分行符",createLinebar:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.7"))||"新建分线栏",toString(){return this.areaName}},configArea:{areaName:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.8"))||"配置区",field:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.9"))||"字段",name:(null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.10"))||"名称",alias:(null==(y=window.getLanguageByCode)?void 0:y.call(window,"10010.1.11"))||"别名",defaultValue:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.12"))||"默认值",width:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.13"))||"宽度",describeText:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.14"))||"说明文本",tips:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.15"))||"问号提示",isRequired:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.16"))||"是否必填",isEditable:(null==(m=window.getLanguageByCode)?void 0:m.call(window,"10010.1.17"))||"是否可编辑",isExpand:(null==(f=window.getLanguageByCode)?void 0:f.call(window,"10010.1.18"))||"是否默认展开",isFoldAble:(null==(p=window.getLanguageByCode)?void 0:p.call(window,"10010.1.19"))||"是否可折叠",isShow:(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.20"))||"是否显示",modifyOptionTitle:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.21"))||"修改选项文本",modifyOptionName:(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.22"))||"值",modifyOptionOriginText:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.23"))||"原文本",modifyOptionNewText:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.24"))||"调整后文本",rowsHeight:(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.25"))||"高度",rowsTips:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.26"))||"默认为3行高度,可调整为1-10行高度",positiveBtn:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.33"))||"确定",negativeBtn:(null==(k=window.getLanguageByCode)?void 0:k.call(window,"10010.1.32"))||"取消",fullLine:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.29"))||"整行",halfLine:(null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.30"))||"半行",toString(){return this.areaName}}});function F(e){o(q,e),console.log(q)}function H(o){const n=e(o)(q);return n?n+"":""}export{F as registFormConfigLocale,H as useFormConfigLocale};
|
package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,computed as o,watch as r,onBeforeUnmount as
|
1
|
+
import{ref as e,computed as o,watch as r,onBeforeUnmount as n,createVNode as t,mergeProps as a}from"vue";import{autorun as l}from"@formily/reactive";import{AddCircleOutline as i,RemoveCircle as m}from"@vicons/ionicons5";import{isNumber as u,isArray as d,isFunction as c}from"lodash-es";import{NButton as s,NIcon as v}from"naive-ui";import"../../../../../index.js";import{useFormField as p}from"../../../../hooks/useFormField.js";function f(f){var b;const{field:x}=p(),h=e(null!=(b=f.minGroupNum)?b:1),G=o((()=>u(f.maxGroupNum)?f.maxGroupNum<1?0:~~f.maxGroupNum:1/0));r((()=>f.value),(e=>{d(e)&&(h.value=Math.min(Math.max(e.length,f.minGroupNum),G.value))}),{immediate:!0});const N=e([]);return n(l((()=>{d(x.value.value)&&(N.value=x.value.value.map(((e,o)=>c(f.combinationItemDeletable)?f.combinationItemDeletable(e||{},o):f.combinationItemDeletable)))}))),{deletableList:N,currentGroupNum:h,maxGroupNum:G,renderHeader:function(e){return t("header",{class:"form-render__combinationHeader"},[f.showLabel?t("div",{class:"form-render__combinationHeaderText"},[f.title]):null,t(s,a(e,{text:!0,style:{"--n-text-color":"var(--c-primary-color)"},disabled:h.value>=G.value||f.disabled}),{icon:()=>t(v,{component:i},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.279"))||"新增"}})])},renderRemoveBtn:function(e,o){return t(s,a(e,{text:!0,disabled:!N.value[o],type:"error",size:"small"}),{icon:()=>t(v,{component:m},null)})}}}export{f as useCombination};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,computed as r,watch as n,onMounted as t,createVNode as i}from"vue";import{isField as l}from"@formily/core";import{Path as
|
1
|
+
import{defineComponent as e,ref as o,computed as r,watch as n,onMounted as t,createVNode as i}from"vue";import{isField as l}from"@formily/core";import{Path as a}from"@formily/path";import{AddCircleOutline as u,RemoveCircle as m}from"@vicons/ionicons5";import{range as s,isNumber as p,isArray as c,isEqual as f}from"lodash-es";import"../../../../index.js";import{useDeepValidate as v}from"./hooks/useDeepValidate.js";import{connect as d,mapProps as y}from"@formily/vue";import{useDebounceFn as h,isObject as N}from"@vueuse/core";import{NButton as g,NIcon as b}from"naive-ui";import x from"../../../FormRender.vue.js";import{formRenderLog as C,mergeDeepProperties as _}from"../../../utils/index.js";import{assignUpdateValue as j}from"../../../utils/schema.js";const G=d(e({name:"FormJsonCombination",props:{title:{type:String,default:""},value:{type:[String,Array]},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},properties:{type:Array,default:()=>[]},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:d}){C("当前COMBINATION控件为json模式,推荐使用非json模式,FieldItem.jsonCombination=false");const y=h((function(){d("update:value",JSON.stringify(j.value))}),300),j=o([]),G=r((()=>j.value.length));function I(o,r=!1){c(o)&&(o.length||o.push(...s(e.minGroupNum).map((()=>({})))),o=JSON.stringify(o));const n=function(e){try{if(!e)return null;const o=JSON.parse(e);return Array.isArray(o)?o:null}catch(e){return null}}(o);var t;(t=n)&&!f(t,j.value)&&(n.splice(F.value),n.forEach((function(o,n){if(!N(o))return;j.value[n]=o,r&&_(o,e.properties)})),j.value.splice(n.length),j.value.forEach(w))}n((()=>e.value),(e=>I(e))),t((()=>{const o=`[${s(e.minGroupNum).map((()=>"{}")).join(",")}]`;I(e.value||o,!0),y()}));const S=o([]);function w(e,o){var r;null==(r=S.value[o])||r.setFieldState("*",(o=>{l(o)&&(o.value=a.getIn(e,o.path))}))}function A(){j.value.push(_({},e.properties)),y()}v().bindDeepValidate(S);const F=r((()=>p(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));n(F,(e=>{G.value<=e||(j.value.splice(e),y(),S.value.splice(e))}),{immediate:!0});const J=x;return()=>i("section",{class:"form-render__combination"},[i("header",{class:"form-render__combinationHeader"},[i("div",{class:"form-render__combinationHeaderText"},[e.title]),i(g,{onClick:A,style:{"--n-text-color":"var(--c-primary-color)"},text:!0,disabled:G.value>=F.value},{icon:()=>i(b,{component:u},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.279"))||"新增"}})]),s(G.value).map(((o,r)=>i("section",{class:"form-render__combinationContentJson"},[i(J,{ref:e=>function(e,o){S.value[e]=o,w(j.value[e]||{},e)}(r,e),fieldList:e.properties,onFormChange:e=>function(e,{fieldKey:o,value:r}){!j.value[e]&&(j.value[e]={}),a.setIn(j.value[e],o,r),y()}(r,e)},null),i(g,{text:!0,class:"form-render__combinationClose",type:"error",onClick:()=>function(o){j.value.length>e.minGroupNum?(j.value.splice(o,1),S.value.splice(o,1)):j.value.splice(o,1,{}),y()}(r)},{icon:()=>i(b,{component:m},null)})])))])}}),y(j));export{G as JSON_COMBINATION};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as o,watch as a,onMounted as t,createVNode as l}from"vue";import{arrayed as u}from"../../../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{connect as i,mapProps as n}from"@formily/vue";import{isArray as m,range as s,property as p}from"lodash-es";import"../../../../index.js";import"../../../../../iho-table/index.js";import d from"../../../../../iho-table/src/IhoTable.vue.js";import{useCombination as v}from"./hooks/useCombination.js";import{assignUpdateValue as f}from"../../../utils/schema.js";import{useColumnConfigAdaptor as c}from"../../../../../iho-table/src/hooks/useColumnConfigAdaptor.js";import{useFormField as b}from"../../../hooks/useFormField.js";const h=i(e({name:"FormTableCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:i}){var n;const{field:f}=b(),{formConfigLikeAdaptor:h}=c(),{fieldList:y,editRules:N}=h({fieldList:e.properties}),{currentGroupNum:g,renderRemoveBtn:j,renderHeader:C}=v(e),w=o({editRules:N}),x=o(e.value);async function G(){g.value++,m(x.value)?x.value.push({}):(x.value=[{}],i("update:value",x.value))}a((()=>e.value),(e=>{x.value=e}));const k=y.concat({alias:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.241"))||"操作",columnName:"operation",width:60,isFixed:2,align:"center",slots:{default:({rowIndex:o})=>j({onClick:()=>async function(o){if(m(x.value))if(g.value>e.minGroupNum)g.value--,x.value.splice(o,1);else{const e=x.value[0];y.forEach((o=>{o.columnName&&(o.defaultValue?e[o.columnName]=o.defaultValue:Reflect.deleteProperty(e,o.columnName))}))}}(o)},o)}});t((()=>{if(!m(x.value))return x.value=s(e.minGroupNum).map((()=>({}))),void i("update:value",x.value);!x.value.length&&e.minGroupNum&&x.value.push(...s(e.minGroupNum).map((()=>({}))))}));const B=o();async function F(){if(!B.value)return;const e=await B.value.$table.validate(!0);return e?Object.values(e).map((e=>e.map(p("rule.message")))).join(","):""}return t((()=>{if(!r(f.value))return;const e=f.value.validator;f.value.validator=[{validator:F},...e?u(e):[]]})),()=>l("section",{class:"form-render__combination"},[C({onClick:G}),l(d,{ref:B,fieldList:k,tableConfig:w.value,tableData:x.value},null)])}}),n(f));export{h as TABLE_COMBINATION};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as t,inject as l,createVNode as a,mergeProps as o,isVNode as n}from"vue";import i from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as u}from"@formily/vue";import{cloneDeep as s,isArray as
|
1
|
+
import{defineComponent as e,computed as t,inject as l,createVNode as a,mergeProps as o,isVNode as n}from"vue";import i from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as u}from"@formily/vue";import{cloneDeep as s,isArray as d,xor as c,isNumber as p,isEmpty as v}from"lodash-es";import{NCheckboxGroup as m,NCheckbox as f,NRadioGroup as h}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as y}from"../../constants/index.js";import{useComplexOptions as g}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"../../utils/business.js";import{assignUpdateValue as j,createVisitedSetter as b}from"../../utils/schema.js";import{useUrlConfigOptions as x,useAutographOptions as C}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as F}from"../../hooks/useCommonInjection.js";import{useFormField as k}from"../../hooks/useFormField.js";function S(i,r,u){return e({name:i,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,selectAll:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:i,attrs:h}){const{field:j,fieldKey:S}=k();const w=t({get(){return t=e.value,p(t)?t+"":t;var t},set(e){i("update:value",e)}}),{renderComplexOption:O}=g(e,w),{labelKey:B,valueKey:_,fullOptions:K}=e.urlConfig?x(e,w):C(e,w);l(y).setContext(S.value,(e=>{return{currentOption:s((t=e,d(t)?function(e){const t=K.value.reduce(((e,t)=>(e[t[_.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(l=t,K.value.find((e=>e[_.value]===l))))),labelField:B.value,valueField:_.value};var t,l}));const{injectValueBindKey:W,injectValueValidate:R}=F();R(w);const A=W(w);function I(){w.value=null}const M=t({get:()=>d(w.value)&&w.value.length===K.value.length,set(e){const t=e?K.value.map((e=>e[_.value])):[];c(t,w.value).length&&(w.value=t)}}),V=t((()=>d(e.value)&&e.value.length&&e.value.length<K.value.length));function P(t){let l;const o={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;o.maxWidth=e,function(e,t){return!v(t.childrenFields)&&(d(e)?e.includes(t[_.value]):e===t[_.value])}(w.value,t)&&(o.width=e)}return a(u,{key:t[_.value],value:t[_.value],disabled:t.disabled,currentValue:w.value,cancelable:e.clearable,onCancel:I,style:o},"function"==typeof(i=l=O({value:w.value,option:t,valueKey:_.value,labelKey:B.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(i)&&!n(i)?l:{default:()=>[l]});var i}return()=>{const t=K.value.map((e=>{var t;const l=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(l||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:e.vertical?"flex-start":"center",width:"100%"},n=a(r,o({key:A.value,value:w.value,"onUpdate:value":e=>w.value=e,onClick:b(j),style:{width:"100%"}},h),{default:()=>[a("section",{style:l},[t.map(P)])]});return e.selectAll?a("section",null,[[r!==m?null:a(f,{checked:M.value,"onUpdate:checked":e=>M.value=e,indeterminate:V.value},{default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选"}}),n]]):n}}})}const w=r(S("FormRadio",h,i),u({dataSource:"options"},j)),O=r(S("FormCheckbox",m,f),u({dataSource:"options"},j));export{O as CHECKBOX,w as RADIO};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,watch as l,inject as a,computed as o,ref as t,createVNode as
|
1
|
+
import{defineComponent as e,watch as l,inject as a,computed as o,ref as t,createVNode as n}from"vue";import{connect as u,mapProps as r}from"@formily/vue";import{HelpCircleSharp as i}from"@vicons/ionicons5";import{useVModel as s,useDebounceFn as v}from"@vueuse/core";import{cloneDeep as p,isString as d}from"lodash-es";import{NSelect as m,NSpin as c,NEmpty as f,NTooltip as y,NIcon as g,NTag as h}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as C}from"../../constants/index.js";import{useCommonInjection as b,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as j,assignClearBindVisited as w,createVisitedSetter as B}from"../../utils/schema.js";import{useFormField as S}from"../../hooks/useFormField.js";import{useUrlConfigOptions as x,useAutographOptions as K}from"../../hooks/useFormRenderOptions.js";const k=u(e({name:"FormRemoteSearch",props:{value:{type:[String,Number,Array]},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0},lazyRequest:{type:Boolean,default:!0},multiple:Boolean,deletable:Boolean},emits:["update:value"],setup(e,{slots:u,emit:r}){const j=s(e,"value",r),{field:w,fieldKey:k}=S(),{injectValueValidate:O,injectValueBindKey:D}=b();O(j);const L=D(j),R={onRequestConfigChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value}),onDepsChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value})},{labelKey:q,valueKey:P,showKey:V,fetchData:A,searchContent:I,fullOptions:U,loading:z}=e.urlConfig?x(e,j,R):K(e,j,R),N=v(((e,l="label")=>A(e,{["value"===l?P.value:"keyword"]:e},{avoidSearchContent:!1})),300);l(j,(e=>{if(e&&!U.value.find((l=>l[P.value]===e)))return N(e,"value")}),{immediate:!0});a(C).setContext(k.value,(e=>{return{currentOption:p((l=e,U.value.find((e=>e[P.value]===l)))),labelField:q.value,valueField:P.value};var l}));const{menuProps:T,nodeProps:$}=F(),E=o((()=>U.value.length||!e.allowCreate?U.value:I.value?[{[q.value]:I.value,[P.value]:I.value},...U.value]:U.value));async function G(e){z.value=e,e&&N()}function H(e){const l=e.alias||e[q.value];if(!l||!d(l))return"";const a=l;return e.desc?n("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[a,e.desc?n(y,null,{trigger:()=>n(g,{component:i},null),default:()=>e.desc}):null]):a}function J({option:l,handleClose:a}){var o;const t=null!=(o=V.value&&l[V.value])?o:l[q.value];if(!e.multiple)return M.value=t,t;return M.value="",e.deletable?n(h,{closable:!0,onClose:function(e){e.stopPropagation(),a()}},{default:()=>t}):`${t};`}const M=t("");return()=>n(m,{title:M.value,remote:!0,filterable:!0,key:L.value,value:j.value,"onUpdate:value":e=>j.value=e,labelField:q.value,valueField:P.value,"menu-props":T,"node-props":$,onSearch:N,"onUpdate:show":G,options:E.value,onFocus:B(w),renderLabel:H,renderTag:J},{empty(){var l;return e.useLoading&&z.value?n(c,null,null):n(f,{description:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.380"))||"无数据"},null)},...u})}}),r(j,w));export{k as REMOTE_SEARCH};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as o,ref as
|
1
|
+
import{defineComponent as e,useAttrs as o,ref as i,computed as l,createVNode as t,mergeProps as u,createTextVNode as r}from"vue";import{NSwitch as n,NModal as a,NCheckbox as d}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../utils/business.js";import{assignUpdateValue as s,assignValueBindKey as v}from"../../utils/schema.js";import{connect as p,mapProps as c}from"@formily/vue";import"../../../index.js";import{useFormField as m}from"../../hooks/useFormField.js";const w=p(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:s}){const v=o(),p=i(!1),{field:c,fieldKey:w}=m(),h=l((()=>{var e,o;return null==(o=null==(e=c.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.requiredReminderContent})),f=l((()=>{var o,i;return null==(i=null==(o=e.openDescription)?void 0:o.value)||i})),g=l((()=>{var o,i;return null!=(i=null==(o=e.closeDescription)?void 0:o.value)&&i})),y=()=>{var o,i;return r(null!=(i=null==(o=e.openDescription)?void 0:o.describe)?i:"")},C=()=>{var o,i;return r(null!=(i=null==(o=e.closeDescription)?void 0:o.describe)?i:"")},j=l({get:()=>e.value===f.value,set(o){if(!h.value||"SWITCH"!==e.showMode||o)return s("update:value",o?f.value:g.value);p.value=!0}});function k(){s("update:value",g.value)}return()=>{return"SWITCH"===e.showMode?[t(n,u({value:j.value,"onUpdate:value":e=>j.value=e},v),{checked:y,unchecked:C}),h.value?t(a,{show:p.value,"onUpdate:show":e=>p.value=e,"display-directive":"show",preset:"dialog",title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.428"))||"确认","positive-text":(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.428"))||"确认","negative-text":(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.32"))||"取消",content:h.value,onPositiveClick:k},null):null]:t(d,{checked:j.value,"onUpdate:checked":e=>j.value=e},{default:y});var o,i,l}}}),c(s,v));export{w as SWITCH};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{isPositive as r,isNegative as s,parseNumberFromMaybeString as l,formRenderLog as a}from"../utils/index.js";import{useFieldNormalize as p}from"./useFieldNormalize.js";import{traverseSchema as c,fieldKeyEscape as d,createLinebarId as m}from"../utils/schema.js";import{useFormValidator as u}from"./useFormValidator.js";import{transformDateFormat as f}from"../utils/business.js";function x(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function _(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function h(n,h){const{createValidatorSchema:g}=u(),v=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:s(e.is_empty),...e.componentProps||{}},"x-content":e.slots,"x-display":s(e.is_show)?"hidden":"visible","x-pattern":s(e.is_edit)?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==h?void 0:h.beforeSetValue,span:2*(e.elem_width||3),showLabel:!r(e.hide_title),remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=g(e);return n&&(t["x-validator"]=n),s(e.is_null)&&(t.required=!0),t},y=e=>{var o,t,n,s,a,p,c,d,m,u,f,h,b,g;const y=v(e);e.urlConfig?_(y,e):e.autograph&&x(y,e);const w=!!e.__multiple,C=r(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=r(null!=(s=null==(n=e.componentProps)?void 0:n.selectAll)?s:e.selectAll),A=r(null!=(p=null==(a=e.componentProps)?void 0:a.shouldSave)?p:e.save_free_entry),
|
1
|
+
import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,castArray as n,pick as i}from"lodash-es";import"../../index.js";import{isPositive as r,isNegative as s,parseNumberFromMaybeString as l,formRenderLog as a}from"../utils/index.js";import{useFieldNormalize as p}from"./useFieldNormalize.js";import{traverseSchema as c,fieldKeyEscape as d,createLinebarId as m}from"../utils/schema.js";import{useFormValidator as u}from"./useFormValidator.js";import{transformDateFormat as f}from"../utils/business.js";function x(e,o){Object.assign(e["x-component-props"],{...i(o,["wordbook","autograph"])})}function _(e,o){Object.assign(e["x-component-props"],{...i(o,["urlConfig","wordbook"])})}function h(n,h){const{createValidatorSchema:g}=u(),v=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:s(e.is_empty),...e.componentProps||{}},"x-content":e.slots,"x-display":s(e.is_show)?"hidden":"visible","x-pattern":s(e.is_edit)?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,beforeSetValue:null==h?void 0:h.beforeSetValue,span:2*(e.elem_width||3),showLabel:!r(e.hide_title),remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=g(e);return n&&(t["x-validator"]=n),s(e.is_null)&&(t.required=!0),t},y=e=>{var o,t,n,s,a,p,c,d,m,u,f,h,b,g;const y=v(e);e.urlConfig?_(y,e):e.autograph&&x(y,e);const w=!!e.__multiple,C=r(null!=(t=null==(o=e.componentProps)?void 0:o.allowModify)?t:e.allowModify),O=r(null!=(s=null==(n=e.componentProps)?void 0:n.selectAll)?s:e.selectAll),A=r(null!=(p=null==(a=e.componentProps)?void 0:a.shouldSave)?p:e.save_free_entry),j=r(null!=(d=null==(c=e.componentProps)?void 0:c.allowCreate)?d:e.free_entry),E=null!=(u=null==(m=e.componentProps)?void 0:m.showField)?u:e.show_key,k=null!=(h=null==(f=e.componentProps)?void 0:f.options)?h:e.option,N=null!=(g=l(e.multi_select_value))?g:null==(b=e.componentProps)?void 0:b.maxTagCount;return Object.assign(y["x-component-props"],{multiple:w,options:k,allowModify:C,allowCreate:j||C,shouldSave:A,showField:E,maxTagCount:N,selectAll:O,...i(e,["lazyRequest","requestCache"])}),w&&(y.type="array"),y},w=e=>{var o,t;const n=v(e),i=null!=(t=null==(o=e.componentProps)?void 0:o.selectAll)?t:e.selectAll;return Object.assign(n["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode,vertical:e.__vertical,selectAll:r(i)}),e.urlConfig?_(n,e):e.autograph&&x(n,e),n},C=e=>{const t=v(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},O=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{linebarTextDirection:e.linebarTextDirection,linebarDirection:e.linebarDirection,linebarWidth:e.linebarWidth,disabled:r(e.is_not_fold),id:m(e.val_key),show:!s(e.is_show),remark:e.remark},"x-content":e.slots}),A=new Map([["LINEBAR",O],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-component-props":{border:e.lineBreaksBorder},"x-display":s(e.is_show)?"hidden":"visible"})],["INPUT",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=v(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=v(e),{decimal_length:t,validate:n,allowSlash:i}=e;return r(i)&&(o["x-component"]="INPUT_NUMBER_SLASH",o.type="string"),Object.assign(o["x-component-props"],{precision:l(null!=t?t:null==n?void 0:n.decimal_length),whiteList:e.whiteList,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",y],["REMOTE_SEARCH",y],["DATE",e=>{const o=v(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["TIME",e=>{const o=v(e);return Object.assign(o["x-component-props"],{format:e.date_format,type:f(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{...i(e,["wordbook","lazyRequest","autograph"])}),r(e.is_allow_check_mid)&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=v(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=v(e);return o.type="array","table"===e.displayMode?o["x-component"]="TABLE_COMBINATION":!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,minGroupNum:e.minGroupNum,showLabel:!r(e.hide_title),properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",w],["CHECKBOX",w],["SWITCH",e=>{const o=v(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close,showMode:e.show_mode}),o}],["SLIDER",e=>{const o=v(e);return Object.assign(o["x-component-props"],{step:l(e.step_length),max:l(e.max_length),min:l(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=v(e);Array.isArray(e.properties)&&a("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?I(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],i(e,["wrapperStyle","display"])),o}]]),j=e=>{if(e.suffixConfig||e.prefixConfig)return E(e);return(A.get(e.html_type)||C)(e)},E=o=>{if(!o.suffixConfig&&!o.prefixConfig)return j(o);const t=v(o),n=o.suffixConfig?e(o.suffixConfig):[],i=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show}))),{...o,hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...n.map((e=>({elem_width:o.elem_width,...e,hide_title:"1",is_show:s(e.is_show)?"0":o.is_show})))],r=i.reduce(((e,o)=>e+2*(o.elem_width||3)),0);return Object.assign(t,{type:"void",name:d(i),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:r},"x-decorator-props":{...t["x-decorator-props"],showFeedback:!1,suffixFields:i.map((e=>e.val_key))},properties:I(i)}),t},{FieldNormalizeWaterfallHook:k,FieldListNormalizeWaterfallHook:N}=p();function I(o,i={column:9999}){let r=null;const s=N.call(t(o),i).reduce(((e,o,s)=>{var p;const c=null==(p=(o=k.call(o,i)).validate)?void 0:p.obj_type;return c&&n&&n.collect(c,t(o)),"LINEBAR"===o.html_type?(e[a(o)]=l(O(o),s),r=e[a(o)].properties={}):r?r[a(o)]=l(j(o),s):(r=null,e[a(o)]=l(j(o),s)),e}),{});return i.linebarAutoHidden&&Object.values(s).forEach((e=>{"LINEBAR"===e["x-component"]&&b(e)})),c({properties:s,"x-root":!0},((e,o)=>{"INPUT_GROUP"===e["x-component"]&&b(e,!!o&&!o["x-root"])})),s;function l(e,o){return e["x-index"]=o,e["x-decorator-props"]={_index:o,...e["x-decorator-props"]},e}function a(o){if(o.suffixConfig||o.prefixConfig){const t=[...e(o.prefixConfig),o,...e(o.suffixConfig)].filter(Boolean);return d(t)}return o.val_key}}return{schemaAdaptor:I}}function b(e,o=!1){e["x-reactions"]?e["x-reactions"]=n(e["x-reactions"]):e["x-reactions"]=[];const t=Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#selfDisplay`)).concat(Object.keys(e.properties||{}).map((t=>`${o?"*.":"."}${e.name}.${t}#component`)));e["x-reactions"].push({dependencies:t,fulfill:{state:{visible:"{{hasVisible($deps)}}"}}})}export{h as useFieldListAdaptor};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,findAncestor as t,targetStringIncludes as r}from"../../../../shared/utils/index.js";import{isField as o}from"@formily/core";import{Path as
|
1
|
+
import{arrayed as e,findAncestor as t,targetStringIncludes as r}from"../../../../shared/utils/index.js";import{isField as o}from"@formily/core";import{Path as n}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as a}from"@vueuse/shared";import{isFunction as s,isArray as l,castArray as d,isString as u}from"lodash-es";import{nextTick as c}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as m}from"../constants/index.js";import{formValueFormatter as f}from"../utils/valueFormatter.js";import{queryDecoratorByAddress as p,queryInput as g,queryDecoratorByFieldKey as v,findNextWidget as y}from"../utils/dom.js";import{validateMessageParser as h,combineExtendKey as S,splitExtendKey as b,isEnter as x}from"../utils/index.js";import{getParentLinebar as F}from"../utils/schema.js";import{useSelectedSetting as C}from"./useSelectedSetting.js";function E({formModel:t,formRenderRef:r,formUUID:a,getFieldList:m,formItemDepsCollector:y,businessCollector:x,wordbookSettingHandler:E,operationalFormHandler:D,changeContextCollector:I,emitFormChange:j}){const{applySelectedSetting:w}=C();return{validate(n,{force:c}={}){if(null==n&&(n="*"),s(n)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(n(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();n=e.length?`*(${e.join(",")})`:"*"}const m=[];c&&t.setFieldState(n,(e=>{"visible"===e.display&&"editable"!==e.pattern&&o(e)&&(m.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const f=t.validate(n).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(v,[]):e)));return c&&m.forEach((({pattern:e,state:t})=>t.pattern=e)),f;function v(t,r){if(!i(r))return t;let o=!1;return l(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(y)),o=!0)})),!o&&t.push(y(r)),t}function y(e){if(e.decoratorElement)return e;const o=t.query(e.path),n=o.get("title"),s=d(e.messages).map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return h(r&&u(r)?r:e,t.fieldItem)}(e,o.get("decoratorProps")))),l=p(e.address,r.value,a);return{...e,messages:s,title:n,decoratorElement:l,...g(l)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=S(m(),r)),r},async setFormValues(e,r){r=Object.assign({avoidDependKeyConnection:!0,needSplitExtendKey:!0,avoidWordbookSettingConnection:!0,avoidOperationalFormConnection:!0,dependKeyKeepValue:!1,avoidBusinessConnection:!1,avoidFormChangeEvent:!1,overwrite:!0},r),x.triggerDisabled=r.avoidBusinessConnection,y.triggerDisabled=r.avoidDependKeyConnection,y.keepValue=r.dependKeyKeepValue,E.triggerDisabled=r.avoidWordbookSettingConnection,D.triggerDisabled=r.avoidOperationalFormConnection,r.needSplitExtendKey&&(e=b(m(),e)),r.avoidFormChangeEvent&&(j.value=!1),t.setFieldState("*",(t=>{o(t)&&(r.overwrite||n.existIn(e,t.path))&&(t.value=n.getIn(e,t.path))})),await c(),j.value=!0,x.triggerDisabled=!1,y.triggerDisabled=!1,E.triggerDisabled=!1,D.triggerDisabled=!1,y.keepValue=!1},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:e=>async function(e,t,o){if(!r.value)return l();const i=v(e,t,a);if(i)return l(i);const s=F(e,o);return s?(y.trigger(n.parse(s),!0),await c(),l(v(e,t,a))):l();function l(e){return{decoratorElement:e,...g(e)}}}(e,r.value,m()),applySelectedSetting(e){const r=t.getFormState().values;w(r,e,((e,r)=>{t.setFieldState(e,(e=>{o(e)&&e.setValue(r)}))}))},getTextFormValues:()=>f(t,I)}}function D({props:e,formRenderRef:o,formModel:n,formUUID:i}){return{onKeydown:async function l(d){var u,c;if(!d.isComposing)if(x(d)){if(e.enterToNextWidget&&d.target){if("TEXTAREA"===d.target.tagName&&!d.ctrlKey)return;null==(u=d.preventDefault)||u.call(d)}if(await a(0),Reflect.get(d,"stopCapture")||!e.enterToNextWidget||!o.value)return;const r=t(d.target,(e=>e.classList.contains("form-render__formItem")));if(!r)return;const i=`.form-render__formItem${m.map((e=>`:not([widget-type=${e}])`)).join("")}`,p=Array.from(o.value.querySelectorAll(i)),g=p.findIndex((e=>e.id===r.id));if(!~g)return;const{widget:v,field:h}=y(p,g,d.target);if(!v)return;if(s(e.enterToNextWidget)){const t=h&&n.query(h).take();!t||e.enterToNextWidget(null==(c=t.decoratorProps)?void 0:c.fieldItem)?f(v,e.autoExpand):l({target:v,code:"Enter"})}else f(v,e.autoExpand)}else if("Tab"===d.code){if(!e.autoExpand)return;await a(0);const t=document.querySelector(":focus");if(!t)return;f(t,!0)}async function f(e,o){if(await a(0),e.focus(),!o)return;if(!t(e,(e=>e.getAttribute("uuid")===i)))return;if(!r(["radio","checkbox"],e.className))if(e.click(),"INPUT"!==e.tagName){const t=e.querySelector("input");if(!t)return;t.focus(),n(t)}else n(e);function n(e){if("INPUT"!==e.tagName)return;const t=e.value;t&&t.match(/^\d{4}-\d{2}/)&&e.setSelectionRange(0,4)}}}}}export{D as useFormDomEvent,E as useFormExposeEvent};
|
@@ -1 +1 @@
|
|
1
|
-
import{isString as i,isEmpty as
|
1
|
+
import{isString as i,isEmpty as e}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as r,isMobile as s}from"../utils/business.js";function o(){return{isIdCard:e=>i(e)&&r(e),isMobile:e=>i(e)&&s(e),isEmail:e=>i(e)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e),isNumber:e=>i(e)&&/\d+/.test(e),hasVisible(i){if(e(i))return!1;const r=i.slice(0,i.length/2),s=i.slice(i.length/2).map((i=>null==i?void 0:i[0]));return r.some(((i,e)=>(!i||"visible"===i)&&"LINE_BREAKS"!==s[e]))}}}export{o as usePresetScope};
|