@kayak-sj/design 1.0.0 → 1.0.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/dist/assets/components-DK7g2-zP.css +1 -0
- package/dist/assets/icon-base-2-CcPa4bmO.png +0 -0
- package/dist/assets/icon-base-pYrXWQZO.png +0 -0
- package/dist/assets/icon-notice-2-JVyxpYo9.png +0 -0
- package/dist/assets/icon-notice-DNvEYor3.png +0 -0
- package/dist/assets/icon-price-2-DMmEoFbh.png +0 -0
- package/dist/assets/icon-price-4iIa0b5D.png +0 -0
- package/dist/assets/icon-restrict-2-BjWtoOXX.png +0 -0
- package/dist/assets/icon-restrict-BWJ7LA9s.png +0 -0
- package/dist/assets/icon-setup-2-BO6uKRX4.png +0 -0
- package/dist/assets/icon-setup-DXpIP63L.png +0 -0
- package/dist/{components/k-form/formComponent/Editor.vue_vue_type_script_setup_true_lang.js → chunks/Editor-CNxCYFmc.js} +4 -3
- package/dist/chunks/ImageCutter-B4uKMA_8.js +41 -0
- package/dist/chunks/KEditor-C882CuWG.js +331 -0
- package/dist/{_virtual/_plugin-vue_export-helper.js → chunks/_plugin-vue_export-helper-B3ysoDQm.js} +1 -1
- package/dist/chunks/components-CYgOyNT1.js +4975 -0
- package/dist/chunks/editorValue-DSKvW8ty.js +65 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +3 -91
- package/dist/components/k-button/KButton.d.ts +0 -1
- package/dist/components/k-card/KCard.d.ts +0 -1
- package/dist/components/k-card/index.d.ts +0 -1
- package/dist/components/k-dialog/KDialog.d.ts +6 -7
- package/dist/components/k-dialog/KDialogHeader.d.ts +0 -1
- package/dist/components/k-dialog/index.d.ts +0 -1
- package/dist/components/k-dialog/types.d.ts +0 -1
- package/dist/components/k-echarts/KEcharts.d.ts +2 -3
- package/dist/components/k-echarts/composables/useKEcharts.d.ts +0 -1
- package/dist/components/k-echarts/constants/echartEvents.d.ts +0 -1
- package/dist/components/k-echarts/index.d.ts +0 -1
- package/dist/components/k-echarts/index.js +479 -2
- package/dist/components/k-echarts/map/registerMaps.d.ts +0 -1
- package/dist/components/k-echarts/themes/customed.d.ts +0 -1
- package/dist/components/k-echarts/themes/registerThemes.d.ts +0 -1
- package/dist/components/k-echarts/types.d.ts +0 -1
- package/dist/components/k-echarts/utils/buildChartOptions.d.ts +0 -1
- package/dist/components/k-echarts/utils/createToggleFeature.d.ts +0 -1
- package/dist/components/k-editor/KEditor.d.ts +4 -5
- package/dist/components/k-editor/composables/useEditorImageUpload.d.ts +0 -1
- package/dist/components/k-editor/composables/useKEditor.d.ts +0 -1
- package/dist/components/k-editor/composables/useKEditorConfig.d.ts +0 -1
- package/dist/components/k-editor/index.d.ts +0 -1
- package/dist/components/k-editor/index.js +3 -3
- package/dist/components/k-editor/types.d.ts +0 -1
- package/dist/components/k-editor/utils/editorValue.d.ts +0 -1
- package/dist/components/k-editor/utils/registerPreviewMenu.d.ts +0 -1
- package/dist/components/k-editor/utils/sanitizePasteHtml.d.ts +0 -1
- package/dist/components/k-form/KForm.d.ts +3 -4
- package/dist/components/k-form/KFormField.d.ts +0 -1
- package/dist/components/k-form/composables/useFormSchema.d.ts +0 -1
- package/dist/components/k-form/composables/useKFormFields.d.ts +0 -1
- package/dist/components/k-form/composables/useKFormModel.d.ts +0 -1
- package/dist/components/k-form/composables/useKFormTemplateRef.d.ts +0 -1
- package/dist/components/k-form/constants.d.ts +0 -1
- package/dist/components/k-form/formComponent/Cascader.d.ts +0 -1
- package/dist/components/k-form/formComponent/CheckBox.d.ts +0 -1
- package/dist/components/k-form/formComponent/Complex.d.ts +0 -1
- package/dist/components/k-form/formComponent/DatePicker.d.ts +1 -2
- package/dist/components/k-form/formComponent/Editor.d.ts +0 -1
- package/dist/components/k-form/formComponent/Fallback.d.ts +0 -1
- package/dist/components/k-form/formComponent/Input.d.ts +2 -3
- package/dist/components/k-form/formComponent/InputMixInput.d.ts +0 -1
- package/dist/components/k-form/formComponent/InputMixSelect.d.ts +0 -1
- package/dist/components/k-form/formComponent/InputNumber.d.ts +0 -1
- package/dist/components/k-form/formComponent/Radio.d.ts +0 -1
- package/dist/components/k-form/formComponent/RadioInput.d.ts +0 -1
- package/dist/components/k-form/formComponent/ScrollSelect.d.ts +0 -1
- package/dist/components/k-form/formComponent/Select.d.ts +0 -1
- package/dist/components/k-form/formComponent/SelectMultiple.d.ts +0 -1
- package/dist/components/k-form/formComponent/Tag.d.ts +0 -1
- package/dist/components/k-form/formComponent/Text.d.ts +0 -1
- package/dist/components/k-form/formComponent/TimePicker.d.ts +1 -2
- package/dist/components/k-form/formComponent/TreeSelect.d.ts +1 -2
- package/dist/components/k-form/formComponent/Upload.d.ts +0 -1
- package/dist/components/k-form/formComponent/componentRegistry.d.ts +0 -1
- package/dist/components/k-form/formComponent/index.d.ts +0 -1
- package/dist/components/k-form/formComponent/types.d.ts +0 -1
- package/dist/components/k-form/index.d.ts +0 -1
- package/dist/components/k-form/types.d.ts +0 -1
- package/dist/components/k-form/utils/fieldValue.d.ts +0 -1
- package/dist/components/k-form/utils/formRules.d.ts +0 -1
- package/dist/components/k-form/utils/resolveFormFieldComponent.d.ts +0 -1
- package/dist/components/k-handle-page/KHandlePage.d.ts +0 -1
- package/dist/components/k-handle-page/index.d.ts +0 -1
- package/dist/components/k-handle-page/useHandlePageInit.d.ts +0 -1
- package/dist/components/k-icon/KIcon.d.ts +0 -1
- package/dist/components/k-icon/index.d.ts +0 -1
- package/dist/components/k-icon/resolveLucideIcon.d.ts +0 -1
- package/dist/components/k-link-button/KLinkButton.d.ts +1 -2
- package/dist/components/k-link-button/index.d.ts +0 -1
- package/dist/components/k-link-button/types.d.ts +0 -1
- package/dist/components/k-long-page/KLongPage.d.ts +0 -1
- package/dist/components/k-long-page/KLongPagePanel.d.ts +0 -1
- package/dist/components/k-long-page/composables/useLongPageNavDrag.d.ts +0 -1
- package/dist/components/k-long-page/index.d.ts +0 -1
- package/dist/components/k-long-page/navConfigs.d.ts +0 -1
- package/dist/components/k-long-page/types.d.ts +0 -1
- package/dist/components/k-pagination/KPagination.d.ts +0 -1
- package/dist/components/k-pagination/index.d.ts +0 -1
- package/dist/components/k-panel/KPanel.d.ts +0 -1
- package/dist/components/k-panel/index.d.ts +0 -1
- package/dist/components/k-panel-query/KPanelQuery.d.ts +0 -1
- package/dist/components/k-panel-query/KPanelQueryActions.d.ts +0 -1
- package/dist/components/k-panel-query/KPanelQueryForm.d.ts +0 -1
- package/dist/components/k-panel-query/KPanelQueryItem.d.ts +0 -1
- package/dist/components/k-panel-query/index.d.ts +0 -1
- package/dist/components/k-panel-query/types.d.ts +0 -1
- package/dist/components/k-table/KTable.d.ts +2 -2
- package/dist/components/k-table/KTableColumn.d.ts +0 -1
- package/dist/components/k-table/KTableColumnSelector.d.ts +0 -1
- package/dist/components/k-table/KTableToolbar.d.ts +0 -1
- package/dist/components/k-table/composables/useColumnDisplay.d.ts +0 -1
- package/dist/components/k-table/composables/useKTable.d.ts +18 -2
- package/dist/components/k-table/composables/useKTableCrossPageSelection.d.ts +0 -1
- package/dist/components/k-table/composables/useKTableTemplateRef.d.ts +0 -1
- package/dist/components/k-table/composables/useTableColumns.d.ts +0 -1
- package/dist/components/k-table/composables/useTableData.d.ts +2 -3
- package/dist/components/k-table/composables/useTablePagination.d.ts +0 -1
- package/dist/components/k-table/composables/useTableRadio.d.ts +0 -1
- package/dist/components/k-table/composables/useTableRowSort.d.ts +0 -1
- package/dist/components/k-table/composables/useTableTreeLoad.d.ts +0 -1
- package/dist/components/k-table/dictOptions.d.ts +0 -1
- package/dist/components/k-table/index.d.ts +1 -2
- package/dist/components/k-table/kTableProps.d.ts +2 -3
- package/dist/components/k-table/report/convertDownloadCol.d.ts +0 -1
- package/dist/components/k-table/report/exportKTableReport.d.ts +0 -1
- package/dist/components/k-table/report/index.d.ts +0 -1
- package/dist/components/k-table/report/mergeQueryConfig.d.ts +0 -1
- package/dist/components/k-table/report/pickExportColumns.d.ts +0 -1
- package/dist/components/k-table/report/types.d.ts +0 -1
- package/dist/components/k-table/report/useExportKTableReport.d.ts +0 -1
- package/dist/components/k-table/types.d.ts +2 -3
- package/dist/components/k-table/utils/columnIdentity.d.ts +0 -1
- package/dist/components/k-table/utils/formatCellValue.d.ts +0 -1
- package/dist/components/k-table/utils/rowKey.d.ts +0 -1
- package/dist/components/k-upload/KUpload.d.ts +5 -6
- package/dist/components/k-upload/components/ImageCutter.d.ts +0 -1
- package/dist/components/k-upload/components/UploadFileItem.d.ts +0 -1
- package/dist/components/k-upload/components/UploadInlineActions.d.ts +0 -1
- package/dist/components/k-upload/components/UploadMediaDialog.d.ts +0 -1
- package/dist/components/k-upload/components/UploadTipArea.d.ts +0 -1
- package/dist/components/k-upload/composables/useImagePreview.d.ts +0 -1
- package/dist/components/k-upload/composables/useMediaPreview.d.ts +0 -1
- package/dist/components/k-upload/composables/useUploadFileList.d.ts +0 -1
- package/dist/components/k-upload/composables/useUploadRequest.d.ts +0 -1
- package/dist/components/k-upload/composables/useUploadValidation.d.ts +0 -1
- package/dist/components/k-upload/resolveUploadAction.d.ts +0 -1
- package/dist/components/k-upload/types.d.ts +0 -1
- package/dist/components/k-upload/utils/uploadFileValue.d.ts +0 -1
- package/dist/config/uploadConfig.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +212 -41
- package/dist/theme/index.d.ts +0 -1
- package/dist/utils/createStubComponent.d.ts +0 -1
- package/dist/utils/validators.d.ts +0 -1
- package/package.json +3 -3
- package/dist/_virtual/_rolldown/runtime.js +0 -11
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/k-button/KButton.d.ts.map +0 -1
- package/dist/components/k-button/KButton.js +0 -5
- package/dist/components/k-button/KButton.vue_vue_type_script_setup_true_lang.js +0 -15
- package/dist/components/k-card/KCard.d.ts.map +0 -1
- package/dist/components/k-card/KCard.js +0 -5
- package/dist/components/k-card/KCard.vue_vue_type_script_setup_true_lang.js +0 -23
- package/dist/components/k-card/index.d.ts.map +0 -1
- package/dist/components/k-dialog/KDialog.d.ts.map +0 -1
- package/dist/components/k-dialog/KDialog.js +0 -5
- package/dist/components/k-dialog/KDialog.vue_vue_type_script_setup_true_lang.js +0 -129
- package/dist/components/k-dialog/KDialogHeader.d.ts.map +0 -1
- package/dist/components/k-dialog/KDialogHeader.js +0 -5
- package/dist/components/k-dialog/KDialogHeader.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/components/k-dialog/index.d.ts.map +0 -1
- package/dist/components/k-dialog/types.d.ts.map +0 -1
- package/dist/components/k-echarts/KEcharts.d.ts.map +0 -1
- package/dist/components/k-echarts/KEcharts.js +0 -7
- package/dist/components/k-echarts/KEcharts.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/components/k-echarts/composables/useKEcharts.d.ts.map +0 -1
- package/dist/components/k-echarts/composables/useKEcharts.js +0 -117
- package/dist/components/k-echarts/constants/echartEvents.d.ts.map +0 -1
- package/dist/components/k-echarts/constants/echartEvents.js +0 -4
- package/dist/components/k-echarts/index.d.ts.map +0 -1
- package/dist/components/k-echarts/map/registerMaps.d.ts.map +0 -1
- package/dist/components/k-echarts/themes/customed.d.ts.map +0 -1
- package/dist/components/k-echarts/themes/customed.js +0 -285
- package/dist/components/k-echarts/themes/registerThemes.d.ts.map +0 -1
- package/dist/components/k-echarts/themes/registerThemes.js +0 -7
- package/dist/components/k-echarts/types.d.ts.map +0 -1
- package/dist/components/k-echarts/utils/buildChartOptions.d.ts.map +0 -1
- package/dist/components/k-echarts/utils/buildChartOptions.js +0 -23
- package/dist/components/k-echarts/utils/createToggleFeature.d.ts.map +0 -1
- package/dist/components/k-echarts/utils/createToggleFeature.js +0 -12
- package/dist/components/k-editor/KEditor.d.ts.map +0 -1
- package/dist/components/k-editor/KEditor.js +0 -7
- package/dist/components/k-editor/KEditor.vue_vue_type_script_setup_true_lang.js +0 -96
- package/dist/components/k-editor/composables/useEditorImageUpload.d.ts.map +0 -1
- package/dist/components/k-editor/composables/useEditorImageUpload.js +0 -60
- package/dist/components/k-editor/composables/useKEditor.d.ts.map +0 -1
- package/dist/components/k-editor/composables/useKEditor.js +0 -98
- package/dist/components/k-editor/composables/useKEditorConfig.d.ts.map +0 -1
- package/dist/components/k-editor/composables/useKEditorConfig.js +0 -46
- package/dist/components/k-editor/index.d.ts.map +0 -1
- package/dist/components/k-editor/types.d.ts.map +0 -1
- package/dist/components/k-editor/utils/editorValue.d.ts.map +0 -1
- package/dist/components/k-editor/utils/editorValue.js +0 -37
- package/dist/components/k-editor/utils/registerPreviewMenu.d.ts.map +0 -1
- package/dist/components/k-editor/utils/registerPreviewMenu.js +0 -38
- package/dist/components/k-editor/utils/sanitizePasteHtml.d.ts.map +0 -1
- package/dist/components/k-editor/utils/sanitizePasteHtml.js +0 -8
- package/dist/components/k-form/KForm.d.ts.map +0 -1
- package/dist/components/k-form/KForm.js +0 -5
- package/dist/components/k-form/KForm.vue_vue_type_script_setup_true_lang.js +0 -248
- package/dist/components/k-form/KFormField.d.ts.map +0 -1
- package/dist/components/k-form/KFormField.js +0 -5
- package/dist/components/k-form/KFormField.vue_vue_type_script_setup_true_lang.js +0 -50
- package/dist/components/k-form/composables/useFormSchema.d.ts.map +0 -1
- package/dist/components/k-form/composables/useFormSchema.js +0 -36
- package/dist/components/k-form/composables/useKFormFields.d.ts.map +0 -1
- package/dist/components/k-form/composables/useKFormFields.js +0 -50
- package/dist/components/k-form/composables/useKFormModel.d.ts.map +0 -1
- package/dist/components/k-form/composables/useKFormModel.js +0 -194
- package/dist/components/k-form/composables/useKFormTemplateRef.d.ts.map +0 -1
- package/dist/components/k-form/composables/useKFormTemplateRef.js +0 -7
- package/dist/components/k-form/constants.d.ts.map +0 -1
- package/dist/components/k-form/constants.js +0 -4
- package/dist/components/k-form/formComponent/Cascader.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Cascader.js +0 -7
- package/dist/components/k-form/formComponent/Cascader.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/components/k-form/formComponent/Cascader.vue_vue_type_style_index_0_scoped_ed0da536_lang.css +0 -1
- package/dist/components/k-form/formComponent/CheckBox.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/CheckBox.js +0 -7
- package/dist/components/k-form/formComponent/CheckBox.vue_vue_type_script_setup_true_lang.js +0 -86
- package/dist/components/k-form/formComponent/CheckBox.vue_vue_type_style_index_0_scoped_fca64c11_lang.css +0 -1
- package/dist/components/k-form/formComponent/Complex.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/DatePicker.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/DatePicker.js +0 -7
- package/dist/components/k-form/formComponent/DatePicker.vue_vue_type_script_setup_true_lang.js +0 -144
- package/dist/components/k-form/formComponent/DatePicker.vue_vue_type_style_index_0_scoped_578e2613_lang.css +0 -1
- package/dist/components/k-form/formComponent/Editor.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Editor.js +0 -5
- package/dist/components/k-form/formComponent/Fallback.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Fallback.js +0 -5
- package/dist/components/k-form/formComponent/Fallback.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/components/k-form/formComponent/Input.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Input.js +0 -5
- package/dist/components/k-form/formComponent/Input.vue_vue_type_script_setup_true_lang.js +0 -93
- package/dist/components/k-form/formComponent/InputMixInput.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/InputMixInput.js +0 -7
- package/dist/components/k-form/formComponent/InputMixInput.vue_vue_type_script_setup_true_lang.js +0 -108
- package/dist/components/k-form/formComponent/InputMixInput.vue_vue_type_style_index_0_scoped_6fdf6265_lang.css +0 -1
- package/dist/components/k-form/formComponent/InputMixSelect.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/InputMixSelect.js +0 -7
- package/dist/components/k-form/formComponent/InputMixSelect.vue_vue_type_script_setup_true_lang.js +0 -185
- package/dist/components/k-form/formComponent/InputMixSelect.vue_vue_type_style_index_0_scoped_1f46ef39_lang.css +0 -1
- package/dist/components/k-form/formComponent/InputNumber.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/InputNumber.js +0 -7
- package/dist/components/k-form/formComponent/InputNumber.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/components/k-form/formComponent/InputNumber.vue_vue_type_style_index_0_scoped_acdc4199_lang.css +0 -1
- package/dist/components/k-form/formComponent/Radio.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Radio.js +0 -7
- package/dist/components/k-form/formComponent/Radio.vue_vue_type_script_setup_true_lang.js +0 -50
- package/dist/components/k-form/formComponent/Radio.vue_vue_type_style_index_0_scoped_e0ff32b0_lang.css +0 -1
- package/dist/components/k-form/formComponent/RadioInput.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/RadioInput.js +0 -7
- package/dist/components/k-form/formComponent/RadioInput.vue_vue_type_script_setup_true_lang.js +0 -130
- package/dist/components/k-form/formComponent/RadioInput.vue_vue_type_style_index_0_scoped_1543c319_lang.css +0 -1
- package/dist/components/k-form/formComponent/ScrollSelect.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/ScrollSelect.js +0 -7
- package/dist/components/k-form/formComponent/ScrollSelect.vue_vue_type_script_setup_true_lang.js +0 -132
- package/dist/components/k-form/formComponent/ScrollSelect.vue_vue_type_style_index_0_scoped_dc0bba37_lang.css +0 -1
- package/dist/components/k-form/formComponent/Select.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Select.js +0 -7
- package/dist/components/k-form/formComponent/Select.vue_vue_type_script_setup_true_lang.js +0 -81
- package/dist/components/k-form/formComponent/Select.vue_vue_type_style_index_0_scoped_20fc23b7_lang.css +0 -1
- package/dist/components/k-form/formComponent/SelectMultiple.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/SelectMultiple.js +0 -7
- package/dist/components/k-form/formComponent/SelectMultiple.vue_vue_type_script_setup_true_lang.js +0 -84
- package/dist/components/k-form/formComponent/SelectMultiple.vue_vue_type_style_index_0_scoped_e6ca06e1_lang.css +0 -1
- package/dist/components/k-form/formComponent/Tag.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Tag.js +0 -7
- package/dist/components/k-form/formComponent/Tag.vue_vue_type_script_setup_true_lang.js +0 -86
- package/dist/components/k-form/formComponent/Tag.vue_vue_type_style_index_0_scoped_9961a98a_lang.css +0 -1
- package/dist/components/k-form/formComponent/Text.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Text.js +0 -7
- package/dist/components/k-form/formComponent/Text.vue_vue_type_script_setup_true_lang.js +0 -19
- package/dist/components/k-form/formComponent/Text.vue_vue_type_style_index_0_scoped_9dc35114_lang.css +0 -1
- package/dist/components/k-form/formComponent/TimePicker.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/TimePicker.js +0 -7
- package/dist/components/k-form/formComponent/TimePicker.vue_vue_type_script_setup_true_lang.js +0 -116
- package/dist/components/k-form/formComponent/TimePicker.vue_vue_type_style_index_0_scoped_8680ec2d_lang.css +0 -1
- package/dist/components/k-form/formComponent/TreeSelect.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/TreeSelect.js +0 -5
- package/dist/components/k-form/formComponent/TreeSelect.vue_vue_type_script_setup_true_lang.js +0 -57
- package/dist/components/k-form/formComponent/Upload.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/Upload.js +0 -5
- package/dist/components/k-form/formComponent/Upload.vue_vue_type_script_setup_true_lang.js +0 -64
- package/dist/components/k-form/formComponent/componentRegistry.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/componentRegistry.js +0 -49
- package/dist/components/k-form/formComponent/index.d.ts.map +0 -1
- package/dist/components/k-form/formComponent/types.d.ts.map +0 -1
- package/dist/components/k-form/index.d.ts.map +0 -1
- package/dist/components/k-form/types.d.ts.map +0 -1
- package/dist/components/k-form/utils/fieldValue.d.ts.map +0 -1
- package/dist/components/k-form/utils/fieldValue.js +0 -83
- package/dist/components/k-form/utils/formRules.d.ts.map +0 -1
- package/dist/components/k-form/utils/formRules.js +0 -44
- package/dist/components/k-form/utils/resolveFormFieldComponent.d.ts.map +0 -1
- package/dist/components/k-form/utils/resolveFormFieldComponent.js +0 -13
- package/dist/components/k-handle-page/KHandlePage.d.ts.map +0 -1
- package/dist/components/k-handle-page/KHandlePage.js +0 -5
- package/dist/components/k-handle-page/KHandlePage.vue_vue_type_script_setup_true_lang.js +0 -105
- package/dist/components/k-handle-page/index.d.ts.map +0 -1
- package/dist/components/k-handle-page/useHandlePageInit.d.ts.map +0 -1
- package/dist/components/k-handle-page/useHandlePageInit.js +0 -21
- package/dist/components/k-icon/KIcon.d.ts.map +0 -1
- package/dist/components/k-icon/KIcon.js +0 -7
- package/dist/components/k-icon/KIcon.vue_vue_type_script_setup_true_lang.js +0 -23
- package/dist/components/k-icon/KIcon.vue_vue_type_style_index_0_scoped_6fd081ab_lang.css +0 -1
- package/dist/components/k-icon/index.d.ts.map +0 -1
- package/dist/components/k-icon/resolveLucideIcon.d.ts.map +0 -1
- package/dist/components/k-icon/resolveLucideIcon.js +0 -26
- package/dist/components/k-link-button/KLinkButton.d.ts.map +0 -1
- package/dist/components/k-link-button/KLinkButton.js +0 -5
- package/dist/components/k-link-button/KLinkButton.vue_vue_type_script_setup_true_lang.js +0 -58
- package/dist/components/k-link-button/index.d.ts.map +0 -1
- package/dist/components/k-link-button/types.d.ts.map +0 -1
- package/dist/components/k-long-page/KLongPage.d.ts.map +0 -1
- package/dist/components/k-long-page/KLongPage.js +0 -7
- package/dist/components/k-long-page/KLongPage.vue_vue_type_script_setup_true_lang.js +0 -72
- package/dist/components/k-long-page/KLongPage.vue_vue_type_style_index_0_scoped_ac934c5d_lang.css +0 -1
- package/dist/components/k-long-page/KLongPagePanel.d.ts.map +0 -1
- package/dist/components/k-long-page/KLongPagePanel.js +0 -7
- package/dist/components/k-long-page/KLongPagePanel.vue_vue_type_script_setup_true_lang.js +0 -18
- package/dist/components/k-long-page/KLongPagePanel.vue_vue_type_style_index_0_scoped_9d6e7832_lang.css +0 -1
- package/dist/components/k-long-page/composables/useLongPageNavDrag.d.ts.map +0 -1
- package/dist/components/k-long-page/composables/useLongPageNavDrag.js +0 -32
- package/dist/components/k-long-page/icons/icon-base-2.js +0 -4
- package/dist/components/k-long-page/icons/icon-base.js +0 -4
- package/dist/components/k-long-page/icons/icon-notice-2.js +0 -4
- package/dist/components/k-long-page/icons/icon-notice.js +0 -4
- package/dist/components/k-long-page/icons/icon-price-2.js +0 -4
- package/dist/components/k-long-page/icons/icon-price.js +0 -4
- package/dist/components/k-long-page/icons/icon-restrict-2.js +0 -4
- package/dist/components/k-long-page/icons/icon-restrict.js +0 -4
- package/dist/components/k-long-page/icons/icon-setup-2.js +0 -4
- package/dist/components/k-long-page/icons/icon-setup.js +0 -4
- package/dist/components/k-long-page/index.d.ts.map +0 -1
- package/dist/components/k-long-page/navConfigs.d.ts.map +0 -1
- package/dist/components/k-long-page/navConfigs.js +0 -23
- package/dist/components/k-long-page/types.d.ts.map +0 -1
- package/dist/components/k-pagination/KPagination.d.ts.map +0 -1
- package/dist/components/k-pagination/KPagination.js +0 -5
- package/dist/components/k-pagination/KPagination.vue_vue_type_script_setup_true_lang.js +0 -36
- package/dist/components/k-pagination/index.d.ts.map +0 -1
- package/dist/components/k-panel/KPanel.d.ts.map +0 -1
- package/dist/components/k-panel/KPanel.js +0 -5
- package/dist/components/k-panel/KPanel.vue_vue_type_script_setup_true_lang.js +0 -47
- package/dist/components/k-panel/index.d.ts.map +0 -1
- package/dist/components/k-panel-query/KPanelQuery.d.ts.map +0 -1
- package/dist/components/k-panel-query/KPanelQuery.js +0 -5
- package/dist/components/k-panel-query/KPanelQuery.vue_vue_type_script_setup_true_lang.js +0 -151
- package/dist/components/k-panel-query/KPanelQueryActions.d.ts.map +0 -1
- package/dist/components/k-panel-query/KPanelQueryActions.js +0 -5
- package/dist/components/k-panel-query/KPanelQueryActions.vue_vue_type_script_setup_true_lang.js +0 -45
- package/dist/components/k-panel-query/KPanelQueryForm.d.ts.map +0 -1
- package/dist/components/k-panel-query/KPanelQueryForm.js +0 -5
- package/dist/components/k-panel-query/KPanelQueryForm.vue_vue_type_script_setup_true_lang.js +0 -55
- package/dist/components/k-panel-query/KPanelQueryItem.d.ts.map +0 -1
- package/dist/components/k-panel-query/KPanelQueryItem.js +0 -5
- package/dist/components/k-panel-query/KPanelQueryItem.vue_vue_type_script_setup_true_lang.js +0 -63
- package/dist/components/k-panel-query/index.d.ts.map +0 -1
- package/dist/components/k-panel-query/types.d.ts.map +0 -1
- package/dist/components/k-table/KTable.d.ts.map +0 -1
- package/dist/components/k-table/KTable.js +0 -7
- package/dist/components/k-table/KTable.vue_vue_type_script_setup_true_lang.js +0 -190
- package/dist/components/k-table/KTable.vue_vue_type_style_index_0_scoped_9ecd6487_lang.css +0 -1
- package/dist/components/k-table/KTableColumn.d.ts.map +0 -1
- package/dist/components/k-table/KTableColumn.js +0 -7
- package/dist/components/k-table/KTableColumn.vue_vue_type_script_setup_true_lang.js +0 -154
- package/dist/components/k-table/KTableColumn.vue_vue_type_style_index_0_scoped_578909bc_lang.css +0 -1
- package/dist/components/k-table/KTableColumnSelector.d.ts.map +0 -1
- package/dist/components/k-table/KTableColumnSelector.js +0 -7
- package/dist/components/k-table/KTableColumnSelector.vue_vue_type_script_setup_true_lang.js +0 -59
- package/dist/components/k-table/KTableColumnSelector.vue_vue_type_style_index_0_scoped_e0b3cf31_lang.css +0 -1
- package/dist/components/k-table/KTableToolbar.d.ts.map +0 -1
- package/dist/components/k-table/KTableToolbar.js +0 -7
- package/dist/components/k-table/KTableToolbar.vue_vue_type_script_setup_true_lang.js +0 -60
- package/dist/components/k-table/KTableToolbar.vue_vue_type_style_index_0_scoped_bff19ed1_lang.css +0 -1
- package/dist/components/k-table/composables/useColumnDisplay.d.ts.map +0 -1
- package/dist/components/k-table/composables/useColumnDisplay.js +0 -103
- package/dist/components/k-table/composables/useKTable.d.ts.map +0 -1
- package/dist/components/k-table/composables/useKTable.js +0 -179
- package/dist/components/k-table/composables/useKTableCrossPageSelection.d.ts.map +0 -1
- package/dist/components/k-table/composables/useKTableCrossPageSelection.js +0 -58
- package/dist/components/k-table/composables/useKTableTemplateRef.d.ts.map +0 -1
- package/dist/components/k-table/composables/useKTableTemplateRef.js +0 -7
- package/dist/components/k-table/composables/useTableColumns.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTableColumns.js +0 -61
- package/dist/components/k-table/composables/useTableData.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTableData.js +0 -47
- package/dist/components/k-table/composables/useTablePagination.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTablePagination.js +0 -52
- package/dist/components/k-table/composables/useTableRadio.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTableRadio.js +0 -28
- package/dist/components/k-table/composables/useTableRowSort.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTableRowSort.js +0 -35
- package/dist/components/k-table/composables/useTableTreeLoad.d.ts.map +0 -1
- package/dist/components/k-table/composables/useTableTreeLoad.js +0 -32
- package/dist/components/k-table/dictOptions.d.ts.map +0 -1
- package/dist/components/k-table/dictOptions.js +0 -9
- package/dist/components/k-table/index.d.ts.map +0 -1
- package/dist/components/k-table/kTableProps.d.ts.map +0 -1
- package/dist/components/k-table/kTableProps.js +0 -17
- package/dist/components/k-table/report/convertDownloadCol.d.ts.map +0 -1
- package/dist/components/k-table/report/convertDownloadCol.js +0 -11
- package/dist/components/k-table/report/exportKTableReport.d.ts.map +0 -1
- package/dist/components/k-table/report/exportKTableReport.js +0 -19
- package/dist/components/k-table/report/index.d.ts.map +0 -1
- package/dist/components/k-table/report/mergeQueryConfig.d.ts.map +0 -1
- package/dist/components/k-table/report/mergeQueryConfig.js +0 -31
- package/dist/components/k-table/report/pickExportColumns.d.ts.map +0 -1
- package/dist/components/k-table/report/pickExportColumns.js +0 -7
- package/dist/components/k-table/report/types.d.ts.map +0 -1
- package/dist/components/k-table/report/useExportKTableReport.d.ts.map +0 -1
- package/dist/components/k-table/report/useExportKTableReport.js +0 -29
- package/dist/components/k-table/types.d.ts.map +0 -1
- package/dist/components/k-table/types.js +0 -20
- package/dist/components/k-table/utils/columnIdentity.d.ts.map +0 -1
- package/dist/components/k-table/utils/columnIdentity.js +0 -6
- package/dist/components/k-table/utils/formatCellValue.d.ts.map +0 -1
- package/dist/components/k-table/utils/formatCellValue.js +0 -30
- package/dist/components/k-table/utils/rowKey.d.ts.map +0 -1
- package/dist/components/k-table/utils/rowKey.js +0 -10
- package/dist/components/k-upload/KUpload.d.ts.map +0 -1
- package/dist/components/k-upload/KUpload.js +0 -7
- package/dist/components/k-upload/KUpload.vue_vue_type_script_setup_true_lang.js +0 -355
- package/dist/components/k-upload/KUpload.vue_vue_type_style_index_0_scoped_6050c2c6_lang.css +0 -1
- package/dist/components/k-upload/components/ImageCutter.d.ts.map +0 -1
- package/dist/components/k-upload/components/ImageCutter.js +0 -7
- package/dist/components/k-upload/components/ImageCutter.vue_vue_type_script_setup_true_lang.js +0 -40
- package/dist/components/k-upload/components/UploadFileItem.d.ts.map +0 -1
- package/dist/components/k-upload/components/UploadFileItem.js +0 -7
- package/dist/components/k-upload/components/UploadFileItem.vue_vue_type_script_setup_true_lang.js +0 -73
- package/dist/components/k-upload/components/UploadFileItem.vue_vue_type_style_index_0_scoped_01959ada_lang.css +0 -1
- package/dist/components/k-upload/components/UploadInlineActions.d.ts.map +0 -1
- package/dist/components/k-upload/components/UploadInlineActions.js +0 -7
- package/dist/components/k-upload/components/UploadInlineActions.vue_vue_type_script_setup_true_lang.js +0 -39
- package/dist/components/k-upload/components/UploadInlineActions.vue_vue_type_style_index_0_scoped_55d9c320_lang.css +0 -1
- package/dist/components/k-upload/components/UploadMediaDialog.d.ts.map +0 -1
- package/dist/components/k-upload/components/UploadMediaDialog.js +0 -7
- package/dist/components/k-upload/components/UploadMediaDialog.vue_vue_type_script_setup_true_lang.js +0 -44
- package/dist/components/k-upload/components/UploadMediaDialog.vue_vue_type_style_index_0_scoped_b9720661_lang.css +0 -1
- package/dist/components/k-upload/components/UploadTipArea.d.ts.map +0 -1
- package/dist/components/k-upload/components/UploadTipArea.js +0 -7
- package/dist/components/k-upload/components/UploadTipArea.vue_vue_type_script_setup_true_lang.js +0 -26
- package/dist/components/k-upload/components/UploadTipArea.vue_vue_type_style_index_0_scoped_f2b7df65_lang.css +0 -1
- package/dist/components/k-upload/composables/useImagePreview.d.ts.map +0 -1
- package/dist/components/k-upload/composables/useImagePreview.js +0 -23
- package/dist/components/k-upload/composables/useMediaPreview.d.ts.map +0 -1
- package/dist/components/k-upload/composables/useMediaPreview.js +0 -20
- package/dist/components/k-upload/composables/useUploadFileList.d.ts.map +0 -1
- package/dist/components/k-upload/composables/useUploadFileList.js +0 -46
- package/dist/components/k-upload/composables/useUploadRequest.d.ts.map +0 -1
- package/dist/components/k-upload/composables/useUploadRequest.js +0 -43
- package/dist/components/k-upload/composables/useUploadValidation.d.ts.map +0 -1
- package/dist/components/k-upload/composables/useUploadValidation.js +0 -22
- package/dist/components/k-upload/resolveUploadAction.d.ts.map +0 -1
- package/dist/components/k-upload/resolveUploadAction.js +0 -13
- package/dist/components/k-upload/types.d.ts.map +0 -1
- package/dist/components/k-upload/utils/uploadFileValue.d.ts.map +0 -1
- package/dist/components/k-upload/utils/uploadFileValue.js +0 -44
- package/dist/config/uploadConfig.d.ts.map +0 -1
- package/dist/config/uploadConfig.js +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -22
- package/dist/utils/createStubComponent.d.ts.map +0 -1
- package/dist/utils/createStubComponent.js +0 -43
- package/dist/utils/validators.d.ts.map +0 -1
- package/dist/utils/validators.js +0 -152
- /package/dist/{components/k-upload/components/ImageCutter.vue_vue_type_style_index_0_scoped_900b5e3b_lang.css → assets/ImageCutter-B771uShK.css} +0 -0
- /package/dist/{components/k-editor/KEditor.vue_vue_type_style_index_0_scoped_b9ef08e0_lang.css → assets/KEditor-LzsE5URl.css} +0 -0
- /package/dist/{components/k-echarts/KEcharts.vue_vue_type_style_index_0_scoped_d6da558a_lang.css → assets/index-DMxcQQBQ.css} +0 -0
|
@@ -0,0 +1,4975 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { a as t, d as n, i as r, l as i, n as a, r as o, u as s } from "./editorValue-DSKvW8ty.js";
|
|
3
|
+
import { Fragment as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, defineAsyncComponent as v, defineComponent as y, guardReactiveProps as b, h as x, inject as S, isRef as ee, mergeDefaults as C, mergeModels as w, mergeProps as T, nextTick as E, normalizeClass as D, normalizeProps as te, normalizeStyle as O, onBeforeUnmount as k, onMounted as A, openBlock as j, provide as ne, reactive as M, ref as N, renderList as P, renderSlot as F, resolveComponent as re, resolveDirective as ie, resolveDynamicComponent as ae, shallowRef as oe, toDisplayString as I, toRef as L, toValue as R, unref as z, useAttrs as B, useModel as se, useSlots as V, useTemplateRef as H, vShow as ce, watch as U, withCtx as W, withDirectives as le, withModifiers as ue } from "vue";
|
|
4
|
+
import { ElButton as de, ElCard as fe, ElCascader as pe, ElCheckbox as me, ElCheckboxGroup as he, ElCollapse as ge, ElCollapseItem as _e, ElDatePicker as ve, ElDialog as ye, ElDivider as G, ElForm as be, ElFormItem as xe, ElIcon as Se, ElImageViewer as Ce, ElInput as we, ElInputNumber as Te, ElMessage as Ee, ElOption as De, ElPagination as Oe, ElPopover as ke, ElProgress as Ae, ElRadio as je, ElRadioButton as Me, ElRadioGroup as Ne, ElSelect as Pe, ElTable as Fe, ElTableColumn as K, ElTag as Ie, ElTimePicker as Le, ElTooltip as Re, ElTreeSelect as ze, ElUpload as Be } from "element-plus";
|
|
5
|
+
import q from "dayjs";
|
|
6
|
+
import { cloneDeep as J } from "lodash-es";
|
|
7
|
+
import { useDebounceFn as Ve, useEventListener as He, useLocalStorage as Ue } from "@vueuse/core";
|
|
8
|
+
import { Delete as We, Download as Ge, Loading as Ke, Plus as qe, VideoPlay as Je, ZoomIn as Ye } from "@element-plus/icons-vue";
|
|
9
|
+
import * as Xe from "lucide-vue-next";
|
|
10
|
+
import Ze from "sortablejs";
|
|
11
|
+
import '../assets/components-DK7g2-zP.css';//#region \0rolldown/runtime.js
|
|
12
|
+
var Qe = Object.defineProperty, $e = (e, t) => {
|
|
13
|
+
let n = {};
|
|
14
|
+
for (var r in e) Qe(n, r, {
|
|
15
|
+
get: e[r],
|
|
16
|
+
enumerable: !0
|
|
17
|
+
});
|
|
18
|
+
return t || Qe(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/utils/createStubComponent.ts
|
|
22
|
+
function et(e) {
|
|
23
|
+
return y({
|
|
24
|
+
name: e,
|
|
25
|
+
inheritAttrs: !0,
|
|
26
|
+
setup(t, { attrs: n, slots: r }) {
|
|
27
|
+
return () => x("div", {
|
|
28
|
+
class: "k-design-stub",
|
|
29
|
+
"data-component": e,
|
|
30
|
+
...n
|
|
31
|
+
}, r.default?.() ?? `[${e}] 待迁移`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function tt(e) {
|
|
36
|
+
return y({
|
|
37
|
+
name: `LucideStub_${e}`,
|
|
38
|
+
inheritAttrs: !0,
|
|
39
|
+
setup(t, { attrs: n }) {
|
|
40
|
+
return () => x("span", {
|
|
41
|
+
class: "k-icon k-icon--stub",
|
|
42
|
+
style: {
|
|
43
|
+
display: "inline-flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
width: `${n.size ?? 18}px`,
|
|
47
|
+
height: `${n.size ?? 18}px`,
|
|
48
|
+
fontSize: "10px",
|
|
49
|
+
color: "var(--el-text-color-placeholder, #a8abb2)",
|
|
50
|
+
border: "1px dashed currentColor",
|
|
51
|
+
borderRadius: "2px",
|
|
52
|
+
verticalAlign: "middle",
|
|
53
|
+
flexShrink: "0"
|
|
54
|
+
},
|
|
55
|
+
title: e,
|
|
56
|
+
"data-icon": e
|
|
57
|
+
}, e?.charAt(0).toUpperCase());
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/k-button/KButton.vue
|
|
63
|
+
var Y = /* @__PURE__ */ y({
|
|
64
|
+
name: "KButton",
|
|
65
|
+
__name: "KButton",
|
|
66
|
+
setup(e) {
|
|
67
|
+
return (e, t) => (j(), d(z(de), te(b(e.$attrs)), {
|
|
68
|
+
default: W(() => [F(e.$slots, "default")]),
|
|
69
|
+
_: 3
|
|
70
|
+
}, 16));
|
|
71
|
+
}
|
|
72
|
+
}), nt = { class: "k-dialog-header" }, rt = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "k-dialog-header__badge",
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}, it = { class: "k-dialog-header__text" }, at = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "k-dialog-header__title"
|
|
79
|
+
}, ot = {
|
|
80
|
+
key: 1,
|
|
81
|
+
class: "k-dialog-header__desc"
|
|
82
|
+
}, st = {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: "k-dialog-header__extra"
|
|
85
|
+
}, ct = /* @__PURE__ */ y({
|
|
86
|
+
name: "KDialogHeader",
|
|
87
|
+
__name: "KDialogHeader",
|
|
88
|
+
props: {
|
|
89
|
+
title: { default: "" },
|
|
90
|
+
description: { default: "" },
|
|
91
|
+
icon: {},
|
|
92
|
+
iconSize: { default: 22 }
|
|
93
|
+
},
|
|
94
|
+
setup(e) {
|
|
95
|
+
return (t, n) => (j(), p("div", nt, [
|
|
96
|
+
e.icon || t.$slots.icon ? (j(), p("div", rt, [F(t.$slots, "icon", {}, () => [(j(), d(ae(e.icon), {
|
|
97
|
+
class: "k-dialog-header__icon",
|
|
98
|
+
size: e.iconSize,
|
|
99
|
+
"stroke-width": 2.2
|
|
100
|
+
}, null, 8, ["size"]))])])) : f("", !0),
|
|
101
|
+
m("div", it, [
|
|
102
|
+
e.title || t.$slots.title ? (j(), p("p", at, [F(t.$slots, "title", {}, () => [g(I(e.title), 1)])])) : f("", !0),
|
|
103
|
+
e.description || t.$slots.description ? (j(), p("p", ot, [F(t.$slots, "description", {}, () => [g(I(e.description), 1)])])) : f("", !0),
|
|
104
|
+
F(t.$slots, "default")
|
|
105
|
+
]),
|
|
106
|
+
t.$slots.extra ? (j(), p("div", st, [F(t.$slots, "extra")])) : f("", !0)
|
|
107
|
+
]));
|
|
108
|
+
}
|
|
109
|
+
}), lt = { class: "k-dialog__body" }, ut = /* @__PURE__ */ y({
|
|
110
|
+
name: "KDialog",
|
|
111
|
+
inheritAttrs: !1,
|
|
112
|
+
__name: "KDialog",
|
|
113
|
+
props: /*@__PURE__*/ w({
|
|
114
|
+
title: { default: "" },
|
|
115
|
+
description: { default: "" },
|
|
116
|
+
icon: { default: void 0 },
|
|
117
|
+
variant: { default: "default" },
|
|
118
|
+
showConfirm: {
|
|
119
|
+
type: [Boolean, String],
|
|
120
|
+
default: !0
|
|
121
|
+
},
|
|
122
|
+
showCancel: {
|
|
123
|
+
type: [Boolean, String],
|
|
124
|
+
default: !0
|
|
125
|
+
},
|
|
126
|
+
confirmLoading: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: !1
|
|
129
|
+
},
|
|
130
|
+
appendToBody: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: !0
|
|
133
|
+
},
|
|
134
|
+
showClose: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: !0
|
|
137
|
+
},
|
|
138
|
+
destroyOnClose: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: !0
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
visible: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: !1
|
|
146
|
+
},
|
|
147
|
+
visibleModifiers: {}
|
|
148
|
+
}),
|
|
149
|
+
emits: /*@__PURE__*/ w([
|
|
150
|
+
"confirm",
|
|
151
|
+
"cancel",
|
|
152
|
+
"closed"
|
|
153
|
+
], ["update:visible"]),
|
|
154
|
+
setup(e, { emit: t }) {
|
|
155
|
+
let n = se(e, "visible"), r = e, i = t, a = B(), o = V(), s = u(() => r.variant === "hero"), c = u(() => s.value ? void 0 : r.title), l = u(() => [
|
|
156
|
+
"k-dialog",
|
|
157
|
+
s.value ? "k-dialog--hero" : void 0,
|
|
158
|
+
a.class
|
|
159
|
+
]), p = u(() => {
|
|
160
|
+
let { class: e, ...t } = a;
|
|
161
|
+
return {
|
|
162
|
+
closeOnClickModal: !1,
|
|
163
|
+
appendToBody: r.appendToBody,
|
|
164
|
+
showClose: r.showClose,
|
|
165
|
+
destroyOnClose: r.destroyOnClose,
|
|
166
|
+
...t
|
|
167
|
+
};
|
|
168
|
+
}), v = u(() => r.showConfirm === !0 ? "确定" : String(r.showConfirm)), y = u(() => r.showCancel === !0 ? "取消" : String(r.showCancel)), b = u(() => s.value && (!!o.header || !!r.title || !!r.description || !!r.icon || !!o.icon));
|
|
169
|
+
function x() {
|
|
170
|
+
n.value = !1;
|
|
171
|
+
}
|
|
172
|
+
function S() {
|
|
173
|
+
x(), i("cancel");
|
|
174
|
+
}
|
|
175
|
+
function ee() {
|
|
176
|
+
i("confirm");
|
|
177
|
+
}
|
|
178
|
+
return (t, r) => (j(), d(z(ye), T({
|
|
179
|
+
modelValue: n.value,
|
|
180
|
+
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
181
|
+
class: l.value,
|
|
182
|
+
title: c.value
|
|
183
|
+
}, p.value, { onClosed: r[1] ||= (e) => i("closed") }), h({
|
|
184
|
+
default: W(() => [m("div", lt, [F(t.$slots, "default")])]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, [b.value ? {
|
|
187
|
+
name: "header",
|
|
188
|
+
fn: W(() => [F(t.$slots, "header", {}, () => [_(ct, {
|
|
189
|
+
title: e.title,
|
|
190
|
+
description: e.description,
|
|
191
|
+
icon: e.icon
|
|
192
|
+
}, h({ _: 2 }, [z(o).icon ? {
|
|
193
|
+
name: "icon",
|
|
194
|
+
fn: W(() => [F(t.$slots, "icon")]),
|
|
195
|
+
key: "0"
|
|
196
|
+
} : void 0]), 1032, [
|
|
197
|
+
"title",
|
|
198
|
+
"description",
|
|
199
|
+
"icon"
|
|
200
|
+
])])]),
|
|
201
|
+
key: "0"
|
|
202
|
+
} : void 0, z(o).footer ? {
|
|
203
|
+
name: "footer",
|
|
204
|
+
fn: W(() => [F(t.$slots, "footer")]),
|
|
205
|
+
key: "1"
|
|
206
|
+
} : !z(o).footer && (e.showConfirm !== !1 || e.showCancel !== !1) ? {
|
|
207
|
+
name: "footer",
|
|
208
|
+
fn: W(() => [e.showCancel === !1 ? f("", !0) : (j(), d(Y, {
|
|
209
|
+
key: 0,
|
|
210
|
+
onClick: S
|
|
211
|
+
}, {
|
|
212
|
+
default: W(() => [g(I(y.value), 1)]),
|
|
213
|
+
_: 1
|
|
214
|
+
})), e.showConfirm === !1 ? f("", !0) : (j(), d(Y, {
|
|
215
|
+
key: 1,
|
|
216
|
+
type: "primary",
|
|
217
|
+
loading: e.confirmLoading,
|
|
218
|
+
onClick: ee
|
|
219
|
+
}, {
|
|
220
|
+
default: W(() => [g(I(v.value), 1)]),
|
|
221
|
+
_: 1
|
|
222
|
+
}, 8, ["loading"]))]),
|
|
223
|
+
key: "2"
|
|
224
|
+
} : void 0]), 1040, [
|
|
225
|
+
"modelValue",
|
|
226
|
+
"class",
|
|
227
|
+
"title"
|
|
228
|
+
]));
|
|
229
|
+
}
|
|
230
|
+
}), dt = Symbol("kayak-dict"), ft = {
|
|
231
|
+
list: "rows",
|
|
232
|
+
page: "page_no",
|
|
233
|
+
limit: "page_size",
|
|
234
|
+
total: "total"
|
|
235
|
+
}, pt = {
|
|
236
|
+
total: 0,
|
|
237
|
+
currentPage: 1,
|
|
238
|
+
pageSize: 10,
|
|
239
|
+
pageSizes: [
|
|
240
|
+
10,
|
|
241
|
+
20,
|
|
242
|
+
30,
|
|
243
|
+
100
|
|
244
|
+
],
|
|
245
|
+
layout: "total, sizes, prev, pager, next, jumper"
|
|
246
|
+
}, mt = {
|
|
247
|
+
number: /^\d+$/,
|
|
248
|
+
phone: /^1\d{10}$/,
|
|
249
|
+
money: /^(0|[1-9]\d*)(\.\d{1,2})?$/,
|
|
250
|
+
percentage: /^(?!0(?:\.00?)?$)(?:100(?:\.00?)?|\d{0,2}(?:\.\d{1,2})?)$/
|
|
251
|
+
};
|
|
252
|
+
function ht(e, t) {
|
|
253
|
+
return {
|
|
254
|
+
validator: (n, r, i) => {
|
|
255
|
+
if (r === "" || r == null) {
|
|
256
|
+
i();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
i(e.test(String(r)) ? void 0 : Error(t));
|
|
260
|
+
},
|
|
261
|
+
trigger: "blur"
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function gt(e) {
|
|
265
|
+
return {
|
|
266
|
+
validator: (t, n, r) => {
|
|
267
|
+
let i = Array.isArray(n) ? n : [], a = String(i[0] ?? "").trim(), o = String(i[1] ?? "").trim();
|
|
268
|
+
if (!a || !o) {
|
|
269
|
+
r(Error(e));
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
r();
|
|
273
|
+
},
|
|
274
|
+
trigger: ["change", "blur"]
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function _t(e) {
|
|
278
|
+
let t = [...e.rules ?? []];
|
|
279
|
+
if (typeof e.component != "string") return t;
|
|
280
|
+
let n = e.componentProps?.type;
|
|
281
|
+
if (e.component === "Input" && n === "number" && t.push(ht(mt.number, "请输入合法的正整数")), e.component === "Input" && n === "phone" && t.push(ht(mt.phone, "请输入正常的手机号")), e.component === "Input" && n === "money" && t.push(ht(mt.money, "请输入正确金额数值")), e.component === "Input" && n === "percentage" && t.push(ht(mt.percentage, "请输入正确的数据范围:0.01 ~ 100")), e.component === "InputMixInput") {
|
|
282
|
+
let e = t.find((e) => e.required);
|
|
283
|
+
e && t.push(gt(String(e.message || "请完整填写")));
|
|
284
|
+
}
|
|
285
|
+
return t;
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/components/k-form/composables/useKFormFields.ts
|
|
289
|
+
function vt(e) {
|
|
290
|
+
let t = S(dt, null), n = u(() => e.formConfigs.value.filter((e) => e.display === void 0 || e.display)), r = u(() => e.layout.value.hideLabel ? n.value.map((e) => {
|
|
291
|
+
let t = J(e);
|
|
292
|
+
return t.componentProps ||= {}, typeof t.component == "string" && [
|
|
293
|
+
"Input",
|
|
294
|
+
"Select",
|
|
295
|
+
"TreeSelect",
|
|
296
|
+
"Cascader"
|
|
297
|
+
].includes(t.component) ? (t.componentProps.placeholder = t.componentProps.placeholder || t.label, t.label = "") : t.component === "DatePicker" && (t.label = ""), t;
|
|
298
|
+
}) : n.value);
|
|
299
|
+
function i(e) {
|
|
300
|
+
let { dict: n, componentProps: r = {} } = e, i = r.options ?? [];
|
|
301
|
+
return n && t?.getGroupOptions ? t.getGroupOptions(n) : i.map((e) => ({
|
|
302
|
+
label: String(e.label ?? ""),
|
|
303
|
+
value: e.value,
|
|
304
|
+
disabled: !!e.disabled
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
function a(t) {
|
|
308
|
+
return t.display === !1 || t.readonly === !0 || e.formReadonly?.value ? [] : _t(t);
|
|
309
|
+
}
|
|
310
|
+
function o(e) {
|
|
311
|
+
return e.componentProps?.style;
|
|
312
|
+
}
|
|
313
|
+
function s(e) {
|
|
314
|
+
if (e.display === !1) return "none";
|
|
315
|
+
}
|
|
316
|
+
function c(t) {
|
|
317
|
+
return t.readonly === !0 || e.formReadonly?.value ? !0 : (t.componentProps ?? {}).readonly === !0;
|
|
318
|
+
}
|
|
319
|
+
function l(e) {
|
|
320
|
+
return e.disabled === !0 || (e.componentProps ?? {}).disabled === !0;
|
|
321
|
+
}
|
|
322
|
+
return {
|
|
323
|
+
normalizedConfigs: r,
|
|
324
|
+
getFieldOptions: i,
|
|
325
|
+
resolveItemRules: a,
|
|
326
|
+
itemStyle: o,
|
|
327
|
+
itemDisplay: s,
|
|
328
|
+
isItemReadonly: c,
|
|
329
|
+
isItemDisabled: l
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/components/k-form/composables/useKFormModel.ts
|
|
334
|
+
function yt(e) {
|
|
335
|
+
let { componentProps: t = {}, component: n } = e, r = t.value, i = t.type ?? "";
|
|
336
|
+
if (r !== void 0) return J(r);
|
|
337
|
+
if (t.multiple === !0 || n === "Checkbox" || n === "SelectMultiple" || n === "InputMixInput") return [];
|
|
338
|
+
if (n === "InputMixSelect") return {};
|
|
339
|
+
if (n === "DatePicker" && [
|
|
340
|
+
"datetimerange",
|
|
341
|
+
"daterange",
|
|
342
|
+
"monthrange"
|
|
343
|
+
].includes(i)) return [];
|
|
344
|
+
if (n !== "DatePicker") return n === "Upload" || n === "TimePicker" && i === "timerange" ? [] : "";
|
|
345
|
+
}
|
|
346
|
+
function bt(e, t, n) {
|
|
347
|
+
return X(t);
|
|
348
|
+
}
|
|
349
|
+
function xt(e) {
|
|
350
|
+
return e.controlled?.value === !0;
|
|
351
|
+
}
|
|
352
|
+
function X(e) {
|
|
353
|
+
if (typeof e != "object" || !e) return e;
|
|
354
|
+
if (e instanceof Date) return new Date(e.getTime());
|
|
355
|
+
if (Array.isArray(e)) return e.map(X);
|
|
356
|
+
let t = e, n = {};
|
|
357
|
+
for (let e of Object.keys(t)) n[e] = X(t[e]);
|
|
358
|
+
return n;
|
|
359
|
+
}
|
|
360
|
+
function St(e) {
|
|
361
|
+
let t = {};
|
|
362
|
+
return Object.keys(e).forEach((n) => {
|
|
363
|
+
t[n] = X(e[n]);
|
|
364
|
+
}), t;
|
|
365
|
+
}
|
|
366
|
+
function Ct(e, t) {
|
|
367
|
+
let n = t[e.id];
|
|
368
|
+
return n == null ? yt(e) : bt(e, n, t);
|
|
369
|
+
}
|
|
370
|
+
function wt(e) {
|
|
371
|
+
let t = M({}), n = {}, r = null, i = u(() => {
|
|
372
|
+
let t = /* @__PURE__ */ new Map();
|
|
373
|
+
return e.formConfigs.value.forEach((e) => t.set(e.id, e)), t;
|
|
374
|
+
});
|
|
375
|
+
function a(e) {
|
|
376
|
+
return i.value.get(e) ?? {
|
|
377
|
+
id: e,
|
|
378
|
+
component: "Input"
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
let o = u(() => {
|
|
382
|
+
let t = "", n = "";
|
|
383
|
+
return e.formConfigs.value.forEach((e) => {
|
|
384
|
+
t += `${e.id}\0`, n += `${e.id}:${e.display === !1 ? 0 : 1}\0`;
|
|
385
|
+
}), {
|
|
386
|
+
fieldSignature: t,
|
|
387
|
+
displaySignature: n
|
|
388
|
+
};
|
|
389
|
+
});
|
|
390
|
+
function s() {
|
|
391
|
+
return e.modelValue?.value ?? e.data?.value ?? {};
|
|
392
|
+
}
|
|
393
|
+
function c() {
|
|
394
|
+
return {
|
|
395
|
+
...s(),
|
|
396
|
+
...St(t)
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function l() {
|
|
400
|
+
let n = xt(e) ? c() : St(t);
|
|
401
|
+
return r = n, e.onChange?.(n), n;
|
|
402
|
+
}
|
|
403
|
+
function d(r) {
|
|
404
|
+
let i = s(), a = xt(e), o = {};
|
|
405
|
+
r.forEach((e) => {
|
|
406
|
+
if (e.display !== !1) {
|
|
407
|
+
o[e.id] = Ct(e, i);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (a) {
|
|
411
|
+
let t = i[e.id];
|
|
412
|
+
t != null && (o[e.id] = X(t));
|
|
413
|
+
}
|
|
414
|
+
}), Object.keys(t).forEach((e) => {
|
|
415
|
+
e in o || delete t[e];
|
|
416
|
+
}), Object.assign(t, o), n = J(t);
|
|
417
|
+
}
|
|
418
|
+
function f(e, n) {
|
|
419
|
+
let r = n?.preserveFieldIds, o = r?.length ? new Set(r) : null;
|
|
420
|
+
i.value.forEach((n, r) => {
|
|
421
|
+
if (o?.has(r) || !(r in e)) return;
|
|
422
|
+
let i = e[r];
|
|
423
|
+
if (i == null) {
|
|
424
|
+
t[r] = yt(a(r));
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
t[r] = bt(n, i, e);
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
function p(n) {
|
|
431
|
+
let i = s(), a = [];
|
|
432
|
+
if (n.forEach((e) => {
|
|
433
|
+
e.display !== !1 && t[e.id] === void 0 && (t[e.id] = Ct(e, i), a.push(e.id));
|
|
434
|
+
}), a.length) {
|
|
435
|
+
if (xt(e)) {
|
|
436
|
+
let n = {};
|
|
437
|
+
if (a.forEach((e) => {
|
|
438
|
+
e in i || (n[e] = X(t[e]));
|
|
439
|
+
}), Object.keys(n).length) {
|
|
440
|
+
let t = {
|
|
441
|
+
...i,
|
|
442
|
+
...n
|
|
443
|
+
};
|
|
444
|
+
r = t, e.onChange?.(t);
|
|
445
|
+
}
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
l();
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function m(e) {
|
|
452
|
+
let n = {}, r = s();
|
|
453
|
+
Object.keys(e).forEach((t) => {
|
|
454
|
+
if (!i.value.has(t)) return;
|
|
455
|
+
let o = a(t), s = e[t];
|
|
456
|
+
if (s == null) {
|
|
457
|
+
n[t] = yt(o);
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
n[t] = bt(o, s, {
|
|
461
|
+
...r,
|
|
462
|
+
...e
|
|
463
|
+
});
|
|
464
|
+
}), Object.assign(t, n), l();
|
|
465
|
+
}
|
|
466
|
+
function h(n, r) {
|
|
467
|
+
if (Object.is(t[n.id], r)) return;
|
|
468
|
+
t[n.id] = r;
|
|
469
|
+
let i = l();
|
|
470
|
+
(n.onChange ?? n.componentProps?.onChange)?.(r, n), xt(e) && f({
|
|
471
|
+
...i,
|
|
472
|
+
[n.id]: t[n.id]
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
function g(e) {
|
|
476
|
+
return (e?.length ? e : Object.keys(t)).reduce((e, n) => (n in t && (e[n] = X(t[n])), e), {});
|
|
477
|
+
}
|
|
478
|
+
function _() {
|
|
479
|
+
let n = {};
|
|
480
|
+
return e.formConfigs.value.forEach((e) => {
|
|
481
|
+
e.display !== !1 && t[e.id] !== void 0 && (n[e.id] = X(t[e.id]));
|
|
482
|
+
}), n;
|
|
483
|
+
}
|
|
484
|
+
function v() {
|
|
485
|
+
Object.keys(t).forEach((e) => {
|
|
486
|
+
e in n || delete t[e];
|
|
487
|
+
}), Object.assign(t, J(n)), l();
|
|
488
|
+
}
|
|
489
|
+
function y() {
|
|
490
|
+
n = J(t);
|
|
491
|
+
}
|
|
492
|
+
function b(r) {
|
|
493
|
+
r.forEach((r) => {
|
|
494
|
+
let i = xt(e) ? yt(a(r)) : n[r] ?? "";
|
|
495
|
+
t[r] = X(i);
|
|
496
|
+
}), l();
|
|
497
|
+
}
|
|
498
|
+
return U(o, (t, n) => {
|
|
499
|
+
if (!n || t.fieldSignature !== n.fieldSignature) {
|
|
500
|
+
d(e.formConfigs.value);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
t.displaySignature !== n.displaySignature && p(e.formConfigs.value);
|
|
504
|
+
}, { immediate: !0 }), U(() => e.data?.value, (t) => {
|
|
505
|
+
xt(e) || t && Object.keys(t).length && m(t);
|
|
506
|
+
}, { deep: !0 }), U(() => e.modelValue?.value, (t) => {
|
|
507
|
+
!xt(e) || !t || t !== r && f(t);
|
|
508
|
+
}, {
|
|
509
|
+
deep: !0,
|
|
510
|
+
immediate: !0
|
|
511
|
+
}), {
|
|
512
|
+
formModel: t,
|
|
513
|
+
initFormModel: d,
|
|
514
|
+
setFieldsValue: m,
|
|
515
|
+
updateFieldValue: h,
|
|
516
|
+
getFieldsValue: g,
|
|
517
|
+
getVisibleFieldsValue: _,
|
|
518
|
+
resetFormModel: v,
|
|
519
|
+
resetFieldsValue: b,
|
|
520
|
+
rebuildFirsthandModel: y
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/components/k-form/constants.ts
|
|
525
|
+
var Tt = Symbol("k-form-date-picker-values"), Et = [
|
|
526
|
+
"year",
|
|
527
|
+
"month",
|
|
528
|
+
"date",
|
|
529
|
+
"dates",
|
|
530
|
+
"datetime",
|
|
531
|
+
"week",
|
|
532
|
+
"datetimerange",
|
|
533
|
+
"daterange",
|
|
534
|
+
"monthrange",
|
|
535
|
+
"yearrange"
|
|
536
|
+
];
|
|
537
|
+
function Dt(e) {
|
|
538
|
+
return typeof e == "string" || typeof e == "number" ? e : String(e);
|
|
539
|
+
}
|
|
540
|
+
function Z(e) {
|
|
541
|
+
if (e != null) return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
|
|
542
|
+
}
|
|
543
|
+
function Ot(e) {
|
|
544
|
+
return e == null ? "" : String(e);
|
|
545
|
+
}
|
|
546
|
+
function kt(e) {
|
|
547
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : [];
|
|
548
|
+
}
|
|
549
|
+
function At(e) {
|
|
550
|
+
if (typeof e == "number" && !Number.isNaN(e)) return e;
|
|
551
|
+
if (e == null || e === "") return;
|
|
552
|
+
let t = Number(e);
|
|
553
|
+
return Number.isNaN(t) ? void 0 : t;
|
|
554
|
+
}
|
|
555
|
+
function jt(e) {
|
|
556
|
+
if (e != null) return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
|
|
557
|
+
}
|
|
558
|
+
function Mt(e) {
|
|
559
|
+
return e && Et.includes(e) ? e : "date";
|
|
560
|
+
}
|
|
561
|
+
function Nt(e) {
|
|
562
|
+
if (e != null && e !== "") return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
|
|
563
|
+
}
|
|
564
|
+
function Pt(e) {
|
|
565
|
+
return e === "timerange" ? "timerange" : "time";
|
|
566
|
+
}
|
|
567
|
+
function Ft(e) {
|
|
568
|
+
return e == null || typeof e == "string" || typeof e == "number" ? e : Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : typeof e == "object" ? e : String(e);
|
|
569
|
+
}
|
|
570
|
+
function It(e) {
|
|
571
|
+
return Array.isArray(e) ? e : [];
|
|
572
|
+
}
|
|
573
|
+
function Lt(e, t) {
|
|
574
|
+
let n = Z(t);
|
|
575
|
+
if (n !== void 0) for (let t of e) {
|
|
576
|
+
let e = t.value ?? t.id;
|
|
577
|
+
if (e != null && String(e) === String(n)) {
|
|
578
|
+
let e = t.label;
|
|
579
|
+
return e == null ? void 0 : String(e);
|
|
580
|
+
}
|
|
581
|
+
let r = t.children;
|
|
582
|
+
if (Array.isArray(r)) {
|
|
583
|
+
let e = Lt(r, n);
|
|
584
|
+
if (e) return e;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function Rt(e, t, n, r = " / ") {
|
|
589
|
+
let i = Ft(t);
|
|
590
|
+
if (i == null || i === "") return Q(t);
|
|
591
|
+
let a = n?.value ?? "value", o = n?.label ?? "label", s = n?.children ?? "children", c = Array.isArray(i) ? i : [i], l = [], u = Array.isArray(e) ? e : [];
|
|
592
|
+
for (let e of c) {
|
|
593
|
+
let t = u.find((t) => t != null && String(t[a]) === String(e));
|
|
594
|
+
if (!t) return l.length ? [...l, ...c.slice(l.length).map(String)].join(r) : Q(Array.isArray(i) ? c.join(r) : i);
|
|
595
|
+
let n = t[o];
|
|
596
|
+
l.push(String(n != null && n !== "" ? n : e));
|
|
597
|
+
let d = t[s];
|
|
598
|
+
u = Array.isArray(d) ? d : [];
|
|
599
|
+
}
|
|
600
|
+
return l.length ? l.join(r) : Q(t);
|
|
601
|
+
}
|
|
602
|
+
function Q(e, t = "--") {
|
|
603
|
+
return e == null || e === "" ? t : String(e);
|
|
604
|
+
}
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region src/components/k-form/formComponent/Cascader.vue?vue&type=script&setup=true&lang.ts
|
|
607
|
+
var zt = {
|
|
608
|
+
key: 0,
|
|
609
|
+
class: "k-form-cascader__readonly"
|
|
610
|
+
}, Bt = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
611
|
+
name: "KFormCascader",
|
|
612
|
+
__name: "Cascader",
|
|
613
|
+
props: {
|
|
614
|
+
modelValue: {},
|
|
615
|
+
options: {},
|
|
616
|
+
readonly: { type: Boolean },
|
|
617
|
+
disabled: { type: Boolean },
|
|
618
|
+
props: {},
|
|
619
|
+
cascaderProps: {},
|
|
620
|
+
placeholder: {},
|
|
621
|
+
clearable: { type: Boolean },
|
|
622
|
+
separator: {}
|
|
623
|
+
},
|
|
624
|
+
emits: ["update:modelValue"],
|
|
625
|
+
setup(e, { emit: t }) {
|
|
626
|
+
let n = e, r = t, i = u(() => Ft(n.modelValue)), a = u(() => n.cascaderProps ?? n.props), o = u(() => Rt(n.options, n.modelValue, a.value, n.separator ?? " / "));
|
|
627
|
+
return (t, n) => e.readonly ? (j(), p("span", zt, I(o.value), 1)) : (j(), d(z(pe), {
|
|
628
|
+
key: 1,
|
|
629
|
+
"model-value": i.value,
|
|
630
|
+
options: e.options ?? [],
|
|
631
|
+
props: a.value,
|
|
632
|
+
placeholder: e.placeholder,
|
|
633
|
+
clearable: e.clearable ?? !0,
|
|
634
|
+
disabled: e.disabled,
|
|
635
|
+
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
636
|
+
}, null, 8, [
|
|
637
|
+
"model-value",
|
|
638
|
+
"options",
|
|
639
|
+
"props",
|
|
640
|
+
"placeholder",
|
|
641
|
+
"clearable",
|
|
642
|
+
"disabled"
|
|
643
|
+
]));
|
|
644
|
+
}
|
|
645
|
+
}), [["__scopeId", "data-v-ed0da536"]]), Vt = { class: "k-form-checkbox" }, Ht = {
|
|
646
|
+
key: 0,
|
|
647
|
+
class: "k-form-checkbox__readonly"
|
|
648
|
+
}, Ut = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
649
|
+
name: "KFormCheckbox",
|
|
650
|
+
__name: "CheckBox",
|
|
651
|
+
props: {
|
|
652
|
+
modelValue: {},
|
|
653
|
+
options: {},
|
|
654
|
+
readonly: { type: Boolean },
|
|
655
|
+
disabled: { type: Boolean },
|
|
656
|
+
showSelectAll: {
|
|
657
|
+
type: Boolean,
|
|
658
|
+
default: !1
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
emits: ["update:modelValue"],
|
|
662
|
+
setup(e, { emit: t }) {
|
|
663
|
+
function n(e) {
|
|
664
|
+
return e.tooltip ?? "";
|
|
665
|
+
}
|
|
666
|
+
function r(e) {
|
|
667
|
+
return n(e) === "";
|
|
668
|
+
}
|
|
669
|
+
let i = e, a = t, o = N([]), s = N(!1), l = N(!1), m = u(() => (i.options ?? []).map((e) => e.value)), h = u(() => {
|
|
670
|
+
let e = (i.options ?? []).filter((e) => o.value.includes(e.value)).map((e) => e.label);
|
|
671
|
+
return e.length ? e.join(", ") : "--";
|
|
672
|
+
});
|
|
673
|
+
U(() => i.modelValue, (e) => {
|
|
674
|
+
o.value = kt(e), v(o.value);
|
|
675
|
+
}, { immediate: !0 });
|
|
676
|
+
function v(e) {
|
|
677
|
+
let t = m.value.length, n = e.length;
|
|
678
|
+
s.value = t > 0 && n === t, l.value = n > 0 && n < t;
|
|
679
|
+
}
|
|
680
|
+
function y(e) {
|
|
681
|
+
let t = e === !0 ? [...m.value] : [];
|
|
682
|
+
o.value = t, l.value = !1, a("update:modelValue", t);
|
|
683
|
+
}
|
|
684
|
+
function b(e) {
|
|
685
|
+
o.value = e, v(e), a("update:modelValue", e);
|
|
686
|
+
}
|
|
687
|
+
return (t, i) => (j(), p("div", Vt, [e.readonly ? (j(), p("span", Ht, I(h.value), 1)) : (j(), p(c, { key: 1 }, [e.showSelectAll ? (j(), d(z(me), {
|
|
688
|
+
key: 0,
|
|
689
|
+
modelValue: s.value,
|
|
690
|
+
"onUpdate:modelValue": i[0] ||= (e) => s.value = e,
|
|
691
|
+
indeterminate: l.value,
|
|
692
|
+
disabled: e.disabled,
|
|
693
|
+
onChange: y
|
|
694
|
+
}, {
|
|
695
|
+
default: W(() => [...i[1] ||= [g(" 全选 ", -1)]]),
|
|
696
|
+
_: 1
|
|
697
|
+
}, 8, [
|
|
698
|
+
"modelValue",
|
|
699
|
+
"indeterminate",
|
|
700
|
+
"disabled"
|
|
701
|
+
])) : f("", !0), _(z(he), {
|
|
702
|
+
"model-value": o.value,
|
|
703
|
+
disabled: e.disabled,
|
|
704
|
+
"onUpdate:modelValue": b
|
|
705
|
+
}, {
|
|
706
|
+
default: W(() => [(j(!0), p(c, null, P(e.options, (e) => (j(), d(z(Re), {
|
|
707
|
+
key: String(e.value),
|
|
708
|
+
content: n(e),
|
|
709
|
+
disabled: r(e),
|
|
710
|
+
placement: "top-start"
|
|
711
|
+
}, {
|
|
712
|
+
default: W(() => [_(z(me), {
|
|
713
|
+
value: z(Z)(e.value),
|
|
714
|
+
disabled: e.disabled
|
|
715
|
+
}, {
|
|
716
|
+
default: W(() => [g(I(e.label), 1)]),
|
|
717
|
+
_: 2
|
|
718
|
+
}, 1032, ["value", "disabled"])]),
|
|
719
|
+
_: 2
|
|
720
|
+
}, 1032, ["content", "disabled"]))), 128))]),
|
|
721
|
+
_: 1
|
|
722
|
+
}, 8, ["model-value", "disabled"])], 64))]));
|
|
723
|
+
}
|
|
724
|
+
}), [["__scopeId", "data-v-fca64c11"]]), Wt = ["innerHTML"], Gt = {
|
|
725
|
+
key: 2,
|
|
726
|
+
class: "k-form-date-picker__readonly"
|
|
727
|
+
}, Kt = ["innerHTML"], qt = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
728
|
+
name: "KFormDatePicker",
|
|
729
|
+
inheritAttrs: !1,
|
|
730
|
+
__name: "DatePicker",
|
|
731
|
+
props: {
|
|
732
|
+
modelValue: {},
|
|
733
|
+
options: {},
|
|
734
|
+
readonly: { type: Boolean },
|
|
735
|
+
disabled: { type: Boolean },
|
|
736
|
+
type: { default: "date" },
|
|
737
|
+
prepend: { default: "" },
|
|
738
|
+
append: { default: "" },
|
|
739
|
+
limitTime: {
|
|
740
|
+
type: Boolean,
|
|
741
|
+
default: !1
|
|
742
|
+
},
|
|
743
|
+
datePickerValues: { default: void 0 },
|
|
744
|
+
dateDisabled: {
|
|
745
|
+
type: [Array, Function],
|
|
746
|
+
default: void 0
|
|
747
|
+
},
|
|
748
|
+
minDate: {
|
|
749
|
+
type: [
|
|
750
|
+
String,
|
|
751
|
+
Date,
|
|
752
|
+
Function
|
|
753
|
+
],
|
|
754
|
+
default: void 0
|
|
755
|
+
},
|
|
756
|
+
maxDate: {
|
|
757
|
+
type: [
|
|
758
|
+
String,
|
|
759
|
+
Date,
|
|
760
|
+
Function
|
|
761
|
+
],
|
|
762
|
+
default: void 0
|
|
763
|
+
},
|
|
764
|
+
placeholder: { default: void 0 },
|
|
765
|
+
startPlaceholder: { default: void 0 },
|
|
766
|
+
endPlaceholder: { default: void 0 },
|
|
767
|
+
valueFormat: { default: void 0 }
|
|
768
|
+
},
|
|
769
|
+
emits: ["update:modelValue"],
|
|
770
|
+
setup(e, { emit: t }) {
|
|
771
|
+
let n = e, r = t, i = S(Tt, null), a = u(() => n.datePickerValues ?? i?.value ?? {}), o = u(() => jt(n.modelValue)), s = u(() => Mt(n.type)), c = u(() => s.value === "datetimerange" ? "k-form-date-picker--datetimerange" : ""), l = (e, t) => q(e instanceof Date ? e : String(e)).format(t), m = u(() => {
|
|
772
|
+
if (!n.modelValue) return Q(n.modelValue);
|
|
773
|
+
let e = s.value.includes("datetime") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
774
|
+
if (Array.isArray(n.modelValue)) return n.modelValue.map((t) => l(t, e)).join(" - ");
|
|
775
|
+
let t = q(n.modelValue instanceof Date ? n.modelValue : String(n.modelValue));
|
|
776
|
+
return t.isValid() ? t.format(e) : Q(n.modelValue);
|
|
777
|
+
}), h = u(() => {
|
|
778
|
+
if (!n.limitTime) return;
|
|
779
|
+
let e = q().hour();
|
|
780
|
+
return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
|
|
781
|
+
});
|
|
782
|
+
function g(e) {
|
|
783
|
+
let t = new Date(e.getTime());
|
|
784
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
785
|
+
}
|
|
786
|
+
function _(e) {
|
|
787
|
+
if (e == null) return null;
|
|
788
|
+
if (e === "today") return g(/* @__PURE__ */ new Date());
|
|
789
|
+
if (typeof e == "function") {
|
|
790
|
+
let t = e();
|
|
791
|
+
return t instanceof Date && !Number.isNaN(t.getTime()) ? g(t) : null;
|
|
792
|
+
}
|
|
793
|
+
return e instanceof Date && !Number.isNaN(e.getTime()) ? g(e) : null;
|
|
794
|
+
}
|
|
795
|
+
function v(e) {
|
|
796
|
+
if (e.date !== void 0) return _(e.date);
|
|
797
|
+
if (e.id) {
|
|
798
|
+
let t = a.value[`kitDate-${e.id}`];
|
|
799
|
+
if (!t) return null;
|
|
800
|
+
if (t instanceof Date) return g(t);
|
|
801
|
+
let n = q(t);
|
|
802
|
+
return n.isValid() ? g(n.toDate()) : null;
|
|
803
|
+
}
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
function y(e, t, n) {
|
|
807
|
+
return n === ">=" ? e >= t : n === ">" ? e > t : n === "<=" ? e <= t : n === "<" ? e < t : n === "==" && e === t;
|
|
808
|
+
}
|
|
809
|
+
function b(e) {
|
|
810
|
+
let t = g(e).getTime(), r = _(n.minDate);
|
|
811
|
+
if (r && t < r.getTime()) return !0;
|
|
812
|
+
let i = _(n.maxDate);
|
|
813
|
+
if (i && t > i.getTime()) return !0;
|
|
814
|
+
let a = n.dateDisabled;
|
|
815
|
+
return !a || (typeof a == "function" && (a = a()), !a.length) ? !1 : a.some((e) => {
|
|
816
|
+
let n = v(e);
|
|
817
|
+
return n ? y(t, n.getTime(), e.condition) : !1;
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
function x(e) {
|
|
821
|
+
r("update:modelValue", e);
|
|
822
|
+
}
|
|
823
|
+
return (t, n) => (j(), p("div", { class: D(["k-form-date-picker", c.value]) }, [
|
|
824
|
+
e.prepend ? (j(), p("span", {
|
|
825
|
+
key: 0,
|
|
826
|
+
class: "k-form-date-picker__text",
|
|
827
|
+
innerHTML: e.prepend
|
|
828
|
+
}, null, 8, Wt)) : f("", !0),
|
|
829
|
+
e.readonly ? (j(), p("span", Gt, I(m.value), 1)) : (j(), d(z(ve), {
|
|
830
|
+
key: 1,
|
|
831
|
+
"model-value": o.value,
|
|
832
|
+
type: s.value,
|
|
833
|
+
"unlink-panels": "",
|
|
834
|
+
placeholder: e.placeholder,
|
|
835
|
+
"start-placeholder": e.startPlaceholder,
|
|
836
|
+
"end-placeholder": e.endPlaceholder,
|
|
837
|
+
"value-format": e.valueFormat,
|
|
838
|
+
disabled: e.disabled,
|
|
839
|
+
"disabled-date": b,
|
|
840
|
+
"disabled-hours": h.value,
|
|
841
|
+
"onUpdate:modelValue": x
|
|
842
|
+
}, null, 8, [
|
|
843
|
+
"model-value",
|
|
844
|
+
"type",
|
|
845
|
+
"placeholder",
|
|
846
|
+
"start-placeholder",
|
|
847
|
+
"end-placeholder",
|
|
848
|
+
"value-format",
|
|
849
|
+
"disabled",
|
|
850
|
+
"disabled-hours"
|
|
851
|
+
])),
|
|
852
|
+
e.append ? (j(), p("span", {
|
|
853
|
+
key: 3,
|
|
854
|
+
class: "k-form-date-picker__text",
|
|
855
|
+
innerHTML: e.append
|
|
856
|
+
}, null, 8, Kt)) : f("", !0)
|
|
857
|
+
], 2));
|
|
858
|
+
}
|
|
859
|
+
}), [["__scopeId", "data-v-578e2613"]]), Jt = /* @__PURE__ */ y({
|
|
860
|
+
name: "KFormFallback",
|
|
861
|
+
__name: "Fallback",
|
|
862
|
+
props: {
|
|
863
|
+
modelValue: {},
|
|
864
|
+
componentType: {}
|
|
865
|
+
},
|
|
866
|
+
setup(e) {
|
|
867
|
+
let t = e, n = u(() => `[${t.componentType ?? "Unknown"}] 待迁移`), r = u(() => Ot(t.modelValue));
|
|
868
|
+
return (e, t) => (j(), d(z(we), {
|
|
869
|
+
"model-value": r.value,
|
|
870
|
+
disabled: "",
|
|
871
|
+
placeholder: n.value
|
|
872
|
+
}, null, 8, ["model-value", "placeholder"]));
|
|
873
|
+
}
|
|
874
|
+
}), Yt = ["type"], Xt = {
|
|
875
|
+
key: 1,
|
|
876
|
+
class: "k-form-input__readonly"
|
|
877
|
+
}, Zt = /* @__PURE__ */ y({
|
|
878
|
+
name: "KFormInput",
|
|
879
|
+
inheritAttrs: !1,
|
|
880
|
+
__name: "Input",
|
|
881
|
+
props: {
|
|
882
|
+
modelValue: {},
|
|
883
|
+
options: {},
|
|
884
|
+
readonly: { type: Boolean },
|
|
885
|
+
disabled: { type: Boolean },
|
|
886
|
+
placeholder: { default: "请输入" },
|
|
887
|
+
maxlength: { default: void 0 },
|
|
888
|
+
maxLength: { default: void 0 },
|
|
889
|
+
type: { default: "text" },
|
|
890
|
+
leftText: { default: "" },
|
|
891
|
+
rightText: { default: "" },
|
|
892
|
+
prepend: { default: "" },
|
|
893
|
+
append: { default: "" },
|
|
894
|
+
leftClass: { default: "" },
|
|
895
|
+
rightClass: { default: "" },
|
|
896
|
+
leftClick: {
|
|
897
|
+
type: Function,
|
|
898
|
+
default: () => void 0
|
|
899
|
+
},
|
|
900
|
+
rightClick: {
|
|
901
|
+
type: Function,
|
|
902
|
+
default: () => void 0
|
|
903
|
+
},
|
|
904
|
+
componentType: { default: void 0 },
|
|
905
|
+
clearable: {
|
|
906
|
+
type: Boolean,
|
|
907
|
+
default: !0
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
emits: ["update:modelValue"],
|
|
911
|
+
setup(e, { emit: t }) {
|
|
912
|
+
let n = e, r = t, i = u(() => Ot(n.modelValue)), a = u(() => n.maxlength ?? n.maxLength), o = u(() => n.type === "textarea"), s = u(() => n.clearable && !o.value), c = u(() => {
|
|
913
|
+
let e = Q(i.value);
|
|
914
|
+
return e === "--" ? e : `${n.prepend || ""}${e}${n.append || ""}`;
|
|
915
|
+
});
|
|
916
|
+
function l(e) {
|
|
917
|
+
r("update:modelValue", e);
|
|
918
|
+
}
|
|
919
|
+
return (t, n) => (j(), p("div", {
|
|
920
|
+
class: "k-form-input",
|
|
921
|
+
type: o.value ? "textarea" : void 0
|
|
922
|
+
}, [
|
|
923
|
+
e.leftText ? (j(), p("div", {
|
|
924
|
+
key: 0,
|
|
925
|
+
class: D(["k-form-input__side k-form-input__side--left", e.leftClass]),
|
|
926
|
+
onClick: n[0] ||= (...t) => e.leftClick && e.leftClick(...t)
|
|
927
|
+
}, I(e.leftText), 3)) : f("", !0),
|
|
928
|
+
e.readonly ? (j(), p("div", Xt, I(c.value), 1)) : (j(), d(z(we), T({ key: 2 }, t.$attrs, {
|
|
929
|
+
"model-value": i.value,
|
|
930
|
+
autocomplete: "off",
|
|
931
|
+
clearable: s.value,
|
|
932
|
+
disabled: e.disabled,
|
|
933
|
+
placeholder: e.placeholder,
|
|
934
|
+
maxlength: a.value,
|
|
935
|
+
type: e.type,
|
|
936
|
+
"onUpdate:modelValue": l
|
|
937
|
+
}), h({ _: 2 }, [e.prepend ? {
|
|
938
|
+
name: "prepend",
|
|
939
|
+
fn: W(() => [g(I(e.prepend), 1)]),
|
|
940
|
+
key: "0"
|
|
941
|
+
} : void 0, e.append ? {
|
|
942
|
+
name: "append",
|
|
943
|
+
fn: W(() => [g(I(e.append), 1)]),
|
|
944
|
+
key: "1"
|
|
945
|
+
} : void 0]), 1040, [
|
|
946
|
+
"model-value",
|
|
947
|
+
"clearable",
|
|
948
|
+
"disabled",
|
|
949
|
+
"placeholder",
|
|
950
|
+
"maxlength",
|
|
951
|
+
"type"
|
|
952
|
+
])),
|
|
953
|
+
e.rightText ? (j(), p("div", {
|
|
954
|
+
key: 3,
|
|
955
|
+
class: D(["k-form-input__side k-form-input__side--right", e.rightClass]),
|
|
956
|
+
onClick: n[1] ||= (...t) => e.rightClick && e.rightClick(...t)
|
|
957
|
+
}, I(e.rightText), 3)) : f("", !0)
|
|
958
|
+
], 8, Yt));
|
|
959
|
+
}
|
|
960
|
+
}), Qt = ["innerHTML"], $t = ["innerHTML"], en = ["innerHTML"], tn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
961
|
+
name: "KFormInputMixInput",
|
|
962
|
+
__name: "InputMixInput",
|
|
963
|
+
props: {
|
|
964
|
+
modelValue: {},
|
|
965
|
+
options: {},
|
|
966
|
+
readonly: { type: Boolean },
|
|
967
|
+
disabled: { type: Boolean },
|
|
968
|
+
leftText: { default: "" },
|
|
969
|
+
rightText: { default: "" },
|
|
970
|
+
centerText: { default: "" },
|
|
971
|
+
leftPlaceholder: { default: "" },
|
|
972
|
+
rightPlaceholder: { default: "" },
|
|
973
|
+
leftProps: { default: () => ({}) },
|
|
974
|
+
rightProps: { default: () => ({}) },
|
|
975
|
+
inputWidth: { default: 120 },
|
|
976
|
+
leftWidth: { default: void 0 },
|
|
977
|
+
rightWidth: { default: void 0 },
|
|
978
|
+
clearable: {
|
|
979
|
+
type: Boolean,
|
|
980
|
+
default: !0
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
emits: ["update:modelValue"],
|
|
984
|
+
setup(e, { emit: t }) {
|
|
985
|
+
let n = e, r = t, i = N(["", ""]);
|
|
986
|
+
function a(e, t) {
|
|
987
|
+
let n = e ?? t;
|
|
988
|
+
return typeof n == "number" ? `${n}px` : n;
|
|
989
|
+
}
|
|
990
|
+
function o(e) {
|
|
991
|
+
return !!(e?.prepend || e?.append);
|
|
992
|
+
}
|
|
993
|
+
function s(e, t) {
|
|
994
|
+
let r = a(e, n.inputWidth);
|
|
995
|
+
return o(t) ? {
|
|
996
|
+
"--k-mix-input-field-width": r,
|
|
997
|
+
flex: "0 0 auto"
|
|
998
|
+
} : {
|
|
999
|
+
width: r,
|
|
1000
|
+
maxWidth: r,
|
|
1001
|
+
minWidth: r,
|
|
1002
|
+
flex: "0 0 auto"
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
let c = u(() => o(n.leftProps)), l = u(() => o(n.rightProps)), d = u(() => s(n.leftWidth, n.leftProps)), h = u(() => s(n.rightWidth, n.rightProps));
|
|
1006
|
+
U(() => n.modelValue, (e) => {
|
|
1007
|
+
Array.isArray(e) && (i.value = [String(e[0] ?? ""), String(e[1] ?? "")]);
|
|
1008
|
+
}, { immediate: !0 });
|
|
1009
|
+
function g(e, t) {
|
|
1010
|
+
i.value[e] = t, r("update:modelValue", [...i.value]);
|
|
1011
|
+
}
|
|
1012
|
+
return (t, n) => (j(), p("div", { class: D(["k-form-input-mix-input", { "k-form-input-mix-input--readonly": e.readonly }]) }, [
|
|
1013
|
+
e.leftText ? (j(), p("div", {
|
|
1014
|
+
key: 0,
|
|
1015
|
+
class: "k-form-input-mix-input__text",
|
|
1016
|
+
innerHTML: e.leftText
|
|
1017
|
+
}, null, 8, Qt)) : f("", !0),
|
|
1018
|
+
m("div", {
|
|
1019
|
+
class: D(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": c.value }]),
|
|
1020
|
+
style: O(e.readonly ? void 0 : d.value)
|
|
1021
|
+
}, [_(Zt, T({
|
|
1022
|
+
clearable: e.clearable,
|
|
1023
|
+
"model-value": i.value[0],
|
|
1024
|
+
readonly: e.readonly,
|
|
1025
|
+
disabled: e.disabled,
|
|
1026
|
+
placeholder: e.leftPlaceholder
|
|
1027
|
+
}, e.leftProps, { "onUpdate:modelValue": n[0] ||= (e) => g(0, e) }), null, 16, [
|
|
1028
|
+
"clearable",
|
|
1029
|
+
"model-value",
|
|
1030
|
+
"readonly",
|
|
1031
|
+
"disabled",
|
|
1032
|
+
"placeholder"
|
|
1033
|
+
])], 6),
|
|
1034
|
+
e.centerText ? (j(), p("div", {
|
|
1035
|
+
key: 1,
|
|
1036
|
+
class: "k-form-input-mix-input__text",
|
|
1037
|
+
innerHTML: e.centerText
|
|
1038
|
+
}, null, 8, $t)) : f("", !0),
|
|
1039
|
+
m("div", {
|
|
1040
|
+
class: D(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": l.value }]),
|
|
1041
|
+
style: O(e.readonly ? void 0 : h.value)
|
|
1042
|
+
}, [_(Zt, T({
|
|
1043
|
+
"model-value": i.value[1],
|
|
1044
|
+
clearable: e.clearable,
|
|
1045
|
+
readonly: e.readonly,
|
|
1046
|
+
disabled: e.disabled,
|
|
1047
|
+
placeholder: e.rightPlaceholder
|
|
1048
|
+
}, e.rightProps, { "onUpdate:modelValue": n[1] ||= (e) => g(1, e) }), null, 16, [
|
|
1049
|
+
"model-value",
|
|
1050
|
+
"clearable",
|
|
1051
|
+
"readonly",
|
|
1052
|
+
"disabled",
|
|
1053
|
+
"placeholder"
|
|
1054
|
+
])], 6),
|
|
1055
|
+
e.rightText ? (j(), p("div", {
|
|
1056
|
+
key: 2,
|
|
1057
|
+
class: "k-form-input-mix-input__text",
|
|
1058
|
+
innerHTML: e.rightText
|
|
1059
|
+
}, null, 8, en)) : f("", !0)
|
|
1060
|
+
], 2));
|
|
1061
|
+
}
|
|
1062
|
+
}), [["__scopeId", "data-v-6fdf6265"]]), nn = {
|
|
1063
|
+
key: 0,
|
|
1064
|
+
class: "k-form-select__readonly"
|
|
1065
|
+
}, rn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1066
|
+
name: "KFormSelect",
|
|
1067
|
+
inheritAttrs: !1,
|
|
1068
|
+
__name: "Select",
|
|
1069
|
+
props: {
|
|
1070
|
+
modelValue: {},
|
|
1071
|
+
options: {},
|
|
1072
|
+
readonly: { type: Boolean },
|
|
1073
|
+
disabled: { type: Boolean },
|
|
1074
|
+
placeholder: { default: "请选择" },
|
|
1075
|
+
multiple: {
|
|
1076
|
+
type: Boolean,
|
|
1077
|
+
default: !1
|
|
1078
|
+
},
|
|
1079
|
+
filterable: {
|
|
1080
|
+
type: Boolean,
|
|
1081
|
+
default: !0
|
|
1082
|
+
},
|
|
1083
|
+
clearable: {
|
|
1084
|
+
type: Boolean,
|
|
1085
|
+
default: !0
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
emits: ["update:modelValue"],
|
|
1089
|
+
setup(e, { emit: t }) {
|
|
1090
|
+
let n = e, r = t, i = u(() => Z(n.modelValue)), a = u(() => kt(n.modelValue)), o = u(() => (n.options ?? []).map((e) => ({
|
|
1091
|
+
label: e.label,
|
|
1092
|
+
value: Dt(e.value),
|
|
1093
|
+
disabled: e.disabled,
|
|
1094
|
+
key: String(e.value)
|
|
1095
|
+
}))), s = u(() => {
|
|
1096
|
+
let e = o.value;
|
|
1097
|
+
if (n.multiple) {
|
|
1098
|
+
let t = a.value, n = e.filter((e) => t.includes(e.value)).map((e) => e.label);
|
|
1099
|
+
return n.length ? n.join(",") : "--";
|
|
1100
|
+
}
|
|
1101
|
+
return e.find((e) => e.value === i.value)?.label ?? Q(i.value);
|
|
1102
|
+
});
|
|
1103
|
+
function l(e) {
|
|
1104
|
+
r("update:modelValue", e);
|
|
1105
|
+
}
|
|
1106
|
+
return (t, n) => (j(), p("div", T({ class: ["k-form-select", { "k-form-select--readonly": e.readonly }] }, t.$attrs), [e.readonly ? (j(), p("span", nn, I(s.value), 1)) : (j(), d(z(Pe), {
|
|
1107
|
+
key: 1,
|
|
1108
|
+
"model-value": e.multiple ? a.value : i.value,
|
|
1109
|
+
placeholder: e.placeholder,
|
|
1110
|
+
multiple: e.multiple,
|
|
1111
|
+
filterable: e.filterable,
|
|
1112
|
+
clearable: e.clearable,
|
|
1113
|
+
disabled: e.disabled,
|
|
1114
|
+
"onUpdate:modelValue": l
|
|
1115
|
+
}, {
|
|
1116
|
+
default: W(() => [(j(!0), p(c, null, P(o.value, (e) => (j(), d(z(De), {
|
|
1117
|
+
key: e.key,
|
|
1118
|
+
label: e.label,
|
|
1119
|
+
value: e.value,
|
|
1120
|
+
disabled: e.disabled
|
|
1121
|
+
}, null, 8, [
|
|
1122
|
+
"label",
|
|
1123
|
+
"value",
|
|
1124
|
+
"disabled"
|
|
1125
|
+
]))), 128))]),
|
|
1126
|
+
_: 1
|
|
1127
|
+
}, 8, [
|
|
1128
|
+
"model-value",
|
|
1129
|
+
"placeholder",
|
|
1130
|
+
"multiple",
|
|
1131
|
+
"filterable",
|
|
1132
|
+
"clearable",
|
|
1133
|
+
"disabled"
|
|
1134
|
+
]))], 16));
|
|
1135
|
+
}
|
|
1136
|
+
}), [["__scopeId", "data-v-20fc23b7"]]), an = {
|
|
1137
|
+
key: 0,
|
|
1138
|
+
class: "k-form-input-mix-select__text"
|
|
1139
|
+
}, on = {
|
|
1140
|
+
key: 1,
|
|
1141
|
+
class: "k-form-input-mix-select__text"
|
|
1142
|
+
}, sn = {
|
|
1143
|
+
key: 0,
|
|
1144
|
+
class: "k-form-input-mix-select__text"
|
|
1145
|
+
}, cn = {
|
|
1146
|
+
key: 3,
|
|
1147
|
+
class: "k-form-input-mix-select__text"
|
|
1148
|
+
}, ln = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1149
|
+
name: "KFormInputMixSelect",
|
|
1150
|
+
__name: "InputMixSelect",
|
|
1151
|
+
props: {
|
|
1152
|
+
modelValue: {},
|
|
1153
|
+
options: {},
|
|
1154
|
+
readonly: { type: Boolean },
|
|
1155
|
+
disabled: {
|
|
1156
|
+
type: Boolean,
|
|
1157
|
+
default: void 0
|
|
1158
|
+
},
|
|
1159
|
+
inputBefore: {
|
|
1160
|
+
type: Boolean,
|
|
1161
|
+
default: !0
|
|
1162
|
+
},
|
|
1163
|
+
leftText: { default: "" },
|
|
1164
|
+
rightText: { default: "" },
|
|
1165
|
+
centerText: { default: "" },
|
|
1166
|
+
selectWidth: { default: 150 },
|
|
1167
|
+
inputWidth: { default: 140 },
|
|
1168
|
+
itemGap: { default: 8 },
|
|
1169
|
+
inputProps: { default: () => ({}) },
|
|
1170
|
+
selectProps: { default: () => ({}) },
|
|
1171
|
+
inputPlaceholder: { default: "" },
|
|
1172
|
+
selectPlaceholder: { default: "请选择" },
|
|
1173
|
+
inputHide: {
|
|
1174
|
+
type: Boolean,
|
|
1175
|
+
default: !1
|
|
1176
|
+
},
|
|
1177
|
+
integrityCheck: {
|
|
1178
|
+
type: Boolean,
|
|
1179
|
+
default: !1
|
|
1180
|
+
}
|
|
1181
|
+
},
|
|
1182
|
+
emits: ["update:modelValue"],
|
|
1183
|
+
setup(e, { emit: t }) {
|
|
1184
|
+
let n = S(dt, null), r = e, i = t, a = N({}), o = N(""), s = N(""), l = u(() => r.inputProps.id ?? "input"), d = u(() => r.selectProps.id ?? "select"), h = u(() => {
|
|
1185
|
+
let e = J(r.inputProps);
|
|
1186
|
+
return delete e.id, e;
|
|
1187
|
+
}), g = u(() => {
|
|
1188
|
+
let e = J(r.selectProps);
|
|
1189
|
+
return delete e.id, e;
|
|
1190
|
+
});
|
|
1191
|
+
function v(e, t) {
|
|
1192
|
+
return e == null || e === "" ? t : typeof e == "number" ? `${e}px` : e;
|
|
1193
|
+
}
|
|
1194
|
+
function y(e) {
|
|
1195
|
+
return !!(e?.prepend || e?.append);
|
|
1196
|
+
}
|
|
1197
|
+
let b = u(() => ({ gap: v(r.itemGap, "8px") }));
|
|
1198
|
+
function x(e, t, n) {
|
|
1199
|
+
if (r.readonly) return;
|
|
1200
|
+
let i = v(e, t);
|
|
1201
|
+
return y(n) ? {
|
|
1202
|
+
"--k-mix-select-field-width": i,
|
|
1203
|
+
flex: "0 0 auto"
|
|
1204
|
+
} : {
|
|
1205
|
+
width: i,
|
|
1206
|
+
maxWidth: i,
|
|
1207
|
+
minWidth: i,
|
|
1208
|
+
flex: "0 0 auto"
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
let ee = u(() => y(r.inputProps)), C = u(() => y(r.selectProps)), w = u(() => x(r.selectWidth, "150px", r.selectProps)), E = u(() => x(r.inputWidth, "140px", r.inputProps));
|
|
1212
|
+
function te(e) {
|
|
1213
|
+
let { dict: t, options: r = [] } = e;
|
|
1214
|
+
return t && n?.getGroupOptions ? n.getGroupOptions(t) : r.map((e) => ({
|
|
1215
|
+
label: String(e.label ?? ""),
|
|
1216
|
+
value: e.value,
|
|
1217
|
+
disabled: e.disabled
|
|
1218
|
+
}));
|
|
1219
|
+
}
|
|
1220
|
+
let k = u(() => te(r.selectProps));
|
|
1221
|
+
function A() {
|
|
1222
|
+
let e = a.value[l.value], t = a.value[d.value];
|
|
1223
|
+
if (r.integrityCheck) {
|
|
1224
|
+
e && t || r.inputHide ? i("update:modelValue", { ...a.value }) : i("update:modelValue", "");
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
i("update:modelValue", { ...a.value });
|
|
1228
|
+
}
|
|
1229
|
+
function ne(e, t) {
|
|
1230
|
+
a.value[t] = e, o.value = String(a.value[l.value] ?? ""), s.value = a.value[d.value], A();
|
|
1231
|
+
}
|
|
1232
|
+
return U(() => r.modelValue, (e) => {
|
|
1233
|
+
e && typeof e == "object" && !Array.isArray(e) && (a.value = J(e), o.value = String(a.value[l.value] ?? ""), s.value = a.value[d.value]);
|
|
1234
|
+
}, {
|
|
1235
|
+
immediate: !0,
|
|
1236
|
+
deep: !0
|
|
1237
|
+
}), (t, n) => (j(), p("div", { class: D(["k-form-input-mix-select", { "k-form-input-mix-select--readonly": e.readonly }]) }, [m("div", {
|
|
1238
|
+
class: "k-form-input-mix-select__row",
|
|
1239
|
+
style: O(b.value)
|
|
1240
|
+
}, [
|
|
1241
|
+
e.leftText ? (j(), p("div", an, I(e.leftText), 1)) : f("", !0),
|
|
1242
|
+
e.inputBefore ? (j(), p(c, { key: 1 }, [
|
|
1243
|
+
e.inputHide ? f("", !0) : (j(), p("div", {
|
|
1244
|
+
key: 0,
|
|
1245
|
+
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": ee.value }]),
|
|
1246
|
+
style: O(E.value)
|
|
1247
|
+
}, [_(Zt, T({
|
|
1248
|
+
"model-value": o.value,
|
|
1249
|
+
readonly: e.readonly,
|
|
1250
|
+
disabled: e.disabled,
|
|
1251
|
+
placeholder: e.inputPlaceholder
|
|
1252
|
+
}, h.value, { "onUpdate:modelValue": n[0] ||= (e) => ne(e, l.value) }), null, 16, [
|
|
1253
|
+
"model-value",
|
|
1254
|
+
"readonly",
|
|
1255
|
+
"disabled",
|
|
1256
|
+
"placeholder"
|
|
1257
|
+
])], 6)),
|
|
1258
|
+
e.centerText ? (j(), p("div", on, I(e.centerText), 1)) : f("", !0),
|
|
1259
|
+
m("div", {
|
|
1260
|
+
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": C.value }]),
|
|
1261
|
+
style: O(w.value)
|
|
1262
|
+
}, [_(rn, T({
|
|
1263
|
+
"model-value": s.value,
|
|
1264
|
+
readonly: e.readonly,
|
|
1265
|
+
disabled: e.disabled,
|
|
1266
|
+
options: k.value,
|
|
1267
|
+
placeholder: e.selectPlaceholder
|
|
1268
|
+
}, g.value, { "onUpdate:modelValue": n[1] ||= (e) => ne(e, d.value) }), null, 16, [
|
|
1269
|
+
"model-value",
|
|
1270
|
+
"readonly",
|
|
1271
|
+
"disabled",
|
|
1272
|
+
"options",
|
|
1273
|
+
"placeholder"
|
|
1274
|
+
])], 6)
|
|
1275
|
+
], 64)) : (j(), p(c, { key: 2 }, [
|
|
1276
|
+
m("div", {
|
|
1277
|
+
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": C.value }]),
|
|
1278
|
+
style: O(w.value)
|
|
1279
|
+
}, [_(rn, T({
|
|
1280
|
+
"model-value": s.value,
|
|
1281
|
+
readonly: e.readonly,
|
|
1282
|
+
disabled: e.disabled,
|
|
1283
|
+
options: k.value,
|
|
1284
|
+
placeholder: e.selectPlaceholder
|
|
1285
|
+
}, g.value, { "onUpdate:modelValue": n[2] ||= (e) => ne(e, d.value) }), null, 16, [
|
|
1286
|
+
"model-value",
|
|
1287
|
+
"readonly",
|
|
1288
|
+
"disabled",
|
|
1289
|
+
"options",
|
|
1290
|
+
"placeholder"
|
|
1291
|
+
])], 6),
|
|
1292
|
+
e.centerText ? (j(), p("div", sn, I(e.centerText), 1)) : f("", !0),
|
|
1293
|
+
e.inputHide ? f("", !0) : (j(), p("div", {
|
|
1294
|
+
key: 1,
|
|
1295
|
+
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": ee.value }]),
|
|
1296
|
+
style: O(E.value)
|
|
1297
|
+
}, [_(Zt, T({
|
|
1298
|
+
"model-value": o.value,
|
|
1299
|
+
readonly: e.readonly,
|
|
1300
|
+
disabled: e.disabled,
|
|
1301
|
+
placeholder: e.inputPlaceholder
|
|
1302
|
+
}, h.value, { "onUpdate:modelValue": n[3] ||= (e) => ne(e, l.value) }), null, 16, [
|
|
1303
|
+
"model-value",
|
|
1304
|
+
"readonly",
|
|
1305
|
+
"disabled",
|
|
1306
|
+
"placeholder"
|
|
1307
|
+
])], 6))
|
|
1308
|
+
], 64)),
|
|
1309
|
+
e.rightText && !e.inputHide ? (j(), p("div", cn, I(e.rightText), 1)) : f("", !0)
|
|
1310
|
+
], 4)], 2));
|
|
1311
|
+
}
|
|
1312
|
+
}), [["__scopeId", "data-v-1f46ef39"]]), un = { class: "k-form-input-number" }, dn = {
|
|
1313
|
+
key: 0,
|
|
1314
|
+
class: "k-form-input-number__side k-form-input-number__side--left"
|
|
1315
|
+
}, fn = {
|
|
1316
|
+
key: 1,
|
|
1317
|
+
class: "k-form-input-number__readonly"
|
|
1318
|
+
}, pn = {
|
|
1319
|
+
key: 3,
|
|
1320
|
+
class: "k-form-input-number__side k-form-input-number__side--right"
|
|
1321
|
+
}, mn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1322
|
+
name: "KFormInputNumber",
|
|
1323
|
+
__name: "InputNumber",
|
|
1324
|
+
props: {
|
|
1325
|
+
modelValue: {},
|
|
1326
|
+
options: {},
|
|
1327
|
+
readonly: { type: Boolean },
|
|
1328
|
+
disabled: { type: Boolean },
|
|
1329
|
+
leftText: { default: "" },
|
|
1330
|
+
rightText: { default: "" },
|
|
1331
|
+
min: { default: void 0 },
|
|
1332
|
+
max: { default: void 0 },
|
|
1333
|
+
maxlength: { default: 1e3 }
|
|
1334
|
+
},
|
|
1335
|
+
emits: ["update:modelValue"],
|
|
1336
|
+
setup(e, { emit: t }) {
|
|
1337
|
+
let n = e, r = t, i = u(() => At(n.modelValue));
|
|
1338
|
+
function a(e) {
|
|
1339
|
+
if (e === void 0) {
|
|
1340
|
+
r("update:modelValue", n.min ?? 0);
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
let t = String(e);
|
|
1344
|
+
if (t.length > n.maxlength) {
|
|
1345
|
+
r("update:modelValue", Number(t.slice(0, n.maxlength)));
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
r("update:modelValue", e);
|
|
1349
|
+
}
|
|
1350
|
+
return (t, n) => (j(), p("div", un, [
|
|
1351
|
+
e.leftText ? (j(), p("div", dn, I(e.leftText), 1)) : f("", !0),
|
|
1352
|
+
e.readonly ? (j(), p("span", fn, I(z(Q)(i.value)), 1)) : (j(), d(z(Te), {
|
|
1353
|
+
key: 2,
|
|
1354
|
+
"model-value": i.value,
|
|
1355
|
+
min: e.min,
|
|
1356
|
+
max: e.max,
|
|
1357
|
+
disabled: e.disabled,
|
|
1358
|
+
"onUpdate:modelValue": a
|
|
1359
|
+
}, null, 8, [
|
|
1360
|
+
"model-value",
|
|
1361
|
+
"min",
|
|
1362
|
+
"max",
|
|
1363
|
+
"disabled"
|
|
1364
|
+
])),
|
|
1365
|
+
e.rightText ? (j(), p("div", pn, I(e.rightText), 1)) : f("", !0)
|
|
1366
|
+
]));
|
|
1367
|
+
}
|
|
1368
|
+
}), [["__scopeId", "data-v-acdc4199"]]), hn = { class: "k-form-radio" }, gn = {
|
|
1369
|
+
key: 0,
|
|
1370
|
+
class: "k-form-radio__readonly"
|
|
1371
|
+
}, _n = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1372
|
+
name: "KFormRadio",
|
|
1373
|
+
__name: "Radio",
|
|
1374
|
+
props: {
|
|
1375
|
+
modelValue: {},
|
|
1376
|
+
options: {},
|
|
1377
|
+
readonly: { type: Boolean },
|
|
1378
|
+
disabled: { type: Boolean },
|
|
1379
|
+
type: { default: "default" }
|
|
1380
|
+
},
|
|
1381
|
+
emits: ["update:modelValue"],
|
|
1382
|
+
setup(e, { emit: t }) {
|
|
1383
|
+
let n = e, r = t, i = u(() => Z(n.modelValue)), a = u(() => (n.options ?? []).find((e) => e.value === i.value)?.label ?? Q(i.value));
|
|
1384
|
+
function o(e) {
|
|
1385
|
+
r("update:modelValue", e);
|
|
1386
|
+
}
|
|
1387
|
+
return (t, n) => (j(), p("div", hn, [e.readonly ? (j(), p("span", gn, I(a.value), 1)) : (j(), d(z(Ne), {
|
|
1388
|
+
key: 1,
|
|
1389
|
+
"model-value": i.value,
|
|
1390
|
+
disabled: e.disabled,
|
|
1391
|
+
"onUpdate:modelValue": o
|
|
1392
|
+
}, {
|
|
1393
|
+
default: W(() => [(j(!0), p(c, null, P(e.options, (t) => (j(), p(c, { key: String(t.value) }, [e.type === "button" ? (j(), d(z(Me), {
|
|
1394
|
+
key: 0,
|
|
1395
|
+
value: z(Z)(t.value),
|
|
1396
|
+
disabled: t.disabled
|
|
1397
|
+
}, {
|
|
1398
|
+
default: W(() => [g(I(t.label), 1)]),
|
|
1399
|
+
_: 2
|
|
1400
|
+
}, 1032, ["value", "disabled"])) : (j(), d(z(je), {
|
|
1401
|
+
key: 1,
|
|
1402
|
+
value: z(Z)(t.value),
|
|
1403
|
+
disabled: t.disabled
|
|
1404
|
+
}, {
|
|
1405
|
+
default: W(() => [g(I(t.label), 1)]),
|
|
1406
|
+
_: 2
|
|
1407
|
+
}, 1032, ["value", "disabled"]))], 64))), 128))]),
|
|
1408
|
+
_: 1
|
|
1409
|
+
}, 8, ["model-value", "disabled"]))]));
|
|
1410
|
+
}
|
|
1411
|
+
}), [["__scopeId", "data-v-e0ff32b0"]]), vn = {
|
|
1412
|
+
key: 0,
|
|
1413
|
+
class: "k-form-radio-input__label"
|
|
1414
|
+
}, yn = {
|
|
1415
|
+
key: 3,
|
|
1416
|
+
class: "k-form-radio-input__label"
|
|
1417
|
+
}, bn = {
|
|
1418
|
+
key: 1,
|
|
1419
|
+
class: "k-form-radio-input__readonly"
|
|
1420
|
+
}, xn = { key: 0 }, Sn = { key: 1 }, Cn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1421
|
+
name: "KFormRadioInput",
|
|
1422
|
+
__name: "RadioInput",
|
|
1423
|
+
props: {
|
|
1424
|
+
modelValue: {},
|
|
1425
|
+
options: {},
|
|
1426
|
+
readonly: { type: Boolean },
|
|
1427
|
+
disabled: { type: Boolean },
|
|
1428
|
+
showInput: { default: "1" },
|
|
1429
|
+
type: { default: "" },
|
|
1430
|
+
inputPlaceholder: { default: "" },
|
|
1431
|
+
leftText: { default: "" },
|
|
1432
|
+
rightText: { default: "" },
|
|
1433
|
+
inputProps: { default: () => ({}) }
|
|
1434
|
+
},
|
|
1435
|
+
emits: ["update:modelValue"],
|
|
1436
|
+
setup(e, { emit: t }) {
|
|
1437
|
+
let n = e, r = t, i = N(n.options?.[0]?.value ?? ""), a = N(""), o = u(() => i.value === n.showInput);
|
|
1438
|
+
function s() {
|
|
1439
|
+
let e = Number(n.inputProps?.min ?? 1);
|
|
1440
|
+
return Number.isFinite(e) ? e : 1;
|
|
1441
|
+
}
|
|
1442
|
+
function l(e) {
|
|
1443
|
+
return e === "" || e == null;
|
|
1444
|
+
}
|
|
1445
|
+
function m(e) {
|
|
1446
|
+
if (n.type !== "inputNumber" || l(e)) return e;
|
|
1447
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : "";
|
|
1448
|
+
let t = Number(e);
|
|
1449
|
+
return Number.isFinite(t) ? t : e;
|
|
1450
|
+
}
|
|
1451
|
+
let h = u(() => {
|
|
1452
|
+
if (l(a.value)) return null;
|
|
1453
|
+
let e = Number(a.value);
|
|
1454
|
+
return Number.isFinite(e) ? e : null;
|
|
1455
|
+
});
|
|
1456
|
+
U(() => n.modelValue, (e) => {
|
|
1457
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1458
|
+
let t = e;
|
|
1459
|
+
t.radio !== void 0 && (i.value = t.radio), t.input !== void 0 && (a.value = m(t.input));
|
|
1460
|
+
}
|
|
1461
|
+
}, {
|
|
1462
|
+
immediate: !0,
|
|
1463
|
+
deep: !0
|
|
1464
|
+
});
|
|
1465
|
+
function v() {
|
|
1466
|
+
if (i.value === n.showInput) {
|
|
1467
|
+
if (n.type === "inputNumber" && l(a.value)) {
|
|
1468
|
+
a.value = s();
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
r("update:modelValue", {
|
|
1472
|
+
radio: i.value,
|
|
1473
|
+
input: a.value
|
|
1474
|
+
});
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
if (i.value !== "" && i.value != null) {
|
|
1478
|
+
r("update:modelValue", { radio: i.value });
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
r("update:modelValue", {});
|
|
1482
|
+
}
|
|
1483
|
+
U([i, a], v, { immediate: !0 });
|
|
1484
|
+
function y(e) {
|
|
1485
|
+
e === n.showInput && n.type === "inputNumber" && l(a.value) && (a.value = s()), i.value = e;
|
|
1486
|
+
}
|
|
1487
|
+
return (t, n) => (j(), p("div", { class: D(["k-form-radio-input", { "k-form-radio-input--readonly": e.readonly }]) }, [
|
|
1488
|
+
_(_n, {
|
|
1489
|
+
"model-value": i.value,
|
|
1490
|
+
options: e.options,
|
|
1491
|
+
readonly: e.readonly,
|
|
1492
|
+
disabled: e.disabled,
|
|
1493
|
+
class: "k-form-radio-input__radio",
|
|
1494
|
+
"onUpdate:modelValue": y
|
|
1495
|
+
}, null, 8, [
|
|
1496
|
+
"model-value",
|
|
1497
|
+
"options",
|
|
1498
|
+
"readonly",
|
|
1499
|
+
"disabled"
|
|
1500
|
+
]),
|
|
1501
|
+
!e.readonly && o.value ? (j(), p(c, { key: 0 }, [
|
|
1502
|
+
e.leftText ? (j(), p("label", vn, I(e.leftText), 1)) : f("", !0),
|
|
1503
|
+
e.type === "inputNumber" ? (j(), d(z(Te), T({
|
|
1504
|
+
key: 1,
|
|
1505
|
+
"model-value": h.value,
|
|
1506
|
+
class: "k-form-radio-input__input",
|
|
1507
|
+
placeholder: e.inputPlaceholder,
|
|
1508
|
+
disabled: e.disabled
|
|
1509
|
+
}, e.inputProps, { "onUpdate:modelValue": n[0] ||= (e) => a.value = e ?? "" }), null, 16, [
|
|
1510
|
+
"model-value",
|
|
1511
|
+
"placeholder",
|
|
1512
|
+
"disabled"
|
|
1513
|
+
])) : (j(), d(z(we), T({
|
|
1514
|
+
key: 2,
|
|
1515
|
+
modelValue: a.value,
|
|
1516
|
+
"onUpdate:modelValue": n[1] ||= (e) => a.value = e,
|
|
1517
|
+
class: "k-form-radio-input__input",
|
|
1518
|
+
placeholder: e.inputPlaceholder,
|
|
1519
|
+
disabled: e.disabled
|
|
1520
|
+
}, e.inputProps), null, 16, [
|
|
1521
|
+
"modelValue",
|
|
1522
|
+
"placeholder",
|
|
1523
|
+
"disabled"
|
|
1524
|
+
])),
|
|
1525
|
+
e.rightText ? (j(), p("label", yn, I(e.rightText), 1)) : f("", !0)
|
|
1526
|
+
], 64)) : f("", !0),
|
|
1527
|
+
e.readonly && o.value ? (j(), p("div", bn, [
|
|
1528
|
+
e.leftText ? (j(), p("label", xn, I(e.leftText), 1)) : f("", !0),
|
|
1529
|
+
g(" " + I(a.value) + " ", 1),
|
|
1530
|
+
e.rightText ? (j(), p("label", Sn, I(e.rightText), 1)) : f("", !0)
|
|
1531
|
+
])) : f("", !0)
|
|
1532
|
+
], 2));
|
|
1533
|
+
}
|
|
1534
|
+
}), [["__scopeId", "data-v-1543c319"]]), wn = {
|
|
1535
|
+
key: 0,
|
|
1536
|
+
class: "k-form-scroll-select__readonly"
|
|
1537
|
+
}, Tn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1538
|
+
name: "KFormScrollSelect",
|
|
1539
|
+
__name: "ScrollSelect",
|
|
1540
|
+
props: {
|
|
1541
|
+
modelValue: {},
|
|
1542
|
+
options: {},
|
|
1543
|
+
readonly: { type: Boolean },
|
|
1544
|
+
disabled: { type: Boolean },
|
|
1545
|
+
multiple: {
|
|
1546
|
+
type: Boolean,
|
|
1547
|
+
default: !1
|
|
1548
|
+
},
|
|
1549
|
+
clearable: {
|
|
1550
|
+
type: Boolean,
|
|
1551
|
+
default: !1
|
|
1552
|
+
},
|
|
1553
|
+
defaultSelectedStr: { default: () => [] },
|
|
1554
|
+
searchKey: { default: "searchKey" },
|
|
1555
|
+
getListMethods: {
|
|
1556
|
+
type: Function,
|
|
1557
|
+
default: void 0
|
|
1558
|
+
},
|
|
1559
|
+
getListParams: { default: () => ({}) },
|
|
1560
|
+
getListFormat: {
|
|
1561
|
+
type: Function,
|
|
1562
|
+
default: (e) => Array.isArray(e) ? e : []
|
|
1563
|
+
},
|
|
1564
|
+
pageSize: { default: 10 }
|
|
1565
|
+
},
|
|
1566
|
+
emits: ["update:modelValue"],
|
|
1567
|
+
setup(e, { emit: t }) {
|
|
1568
|
+
let n = e, r = t, i = N([]), a = N(!1), o = N(!1), s = N(1), l = N(""), f = N(null), m = N(n.multiple ? [] : "");
|
|
1569
|
+
U(() => n.modelValue, (e) => {
|
|
1570
|
+
m.value = n.multiple ? kt(e) : Z(e);
|
|
1571
|
+
}, { immediate: !0 }), U(() => n.defaultSelectedStr, (e) => {
|
|
1572
|
+
e?.length && (i.value = [...i.value, ...e]);
|
|
1573
|
+
}, {
|
|
1574
|
+
immediate: !0,
|
|
1575
|
+
deep: !0
|
|
1576
|
+
}), U(() => n.getListParams, () => {
|
|
1577
|
+
m.value = n.multiple ? [] : "", i.value = [], s.value = 1, o.value = !1, h();
|
|
1578
|
+
}, { deep: !0 });
|
|
1579
|
+
async function h() {
|
|
1580
|
+
if (!(!n.getListMethods || o.value || a.value)) {
|
|
1581
|
+
a.value = !0;
|
|
1582
|
+
try {
|
|
1583
|
+
let e = {
|
|
1584
|
+
...n.getListParams,
|
|
1585
|
+
[n.searchKey]: l.value,
|
|
1586
|
+
page_no: s.value,
|
|
1587
|
+
page_size: n.pageSize
|
|
1588
|
+
}, t = await n.getListMethods(e), r = n.getListFormat(t, s.value);
|
|
1589
|
+
r.length < n.pageSize && (o.value = !0), i.value = i.value.concat(r);
|
|
1590
|
+
} finally {
|
|
1591
|
+
a.value = !1;
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
let g = Ve((e) => {
|
|
1596
|
+
i.value = [], s.value = 1, o.value = !1, l.value = e, h();
|
|
1597
|
+
}, 500), _ = Ve(() => {
|
|
1598
|
+
s.value += 1, h();
|
|
1599
|
+
}, 300);
|
|
1600
|
+
function v(e) {
|
|
1601
|
+
e !== l.value && g(e);
|
|
1602
|
+
}
|
|
1603
|
+
function y() {
|
|
1604
|
+
if (!f.value || o.value) return;
|
|
1605
|
+
let { scrollHeight: e, scrollTop: t, clientHeight: n } = f.value;
|
|
1606
|
+
e - t > n + 2 || _();
|
|
1607
|
+
}
|
|
1608
|
+
He(f, "scroll", y);
|
|
1609
|
+
function b(e) {
|
|
1610
|
+
if (!e) {
|
|
1611
|
+
f.value = null;
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
E(() => {
|
|
1615
|
+
f.value = document.querySelector(".k-form-scroll-select__dropdown .el-select-dropdown__wrap");
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
function x(e) {
|
|
1619
|
+
m.value = e, r("update:modelValue", e);
|
|
1620
|
+
}
|
|
1621
|
+
let S = u(() => {
|
|
1622
|
+
if (n.multiple) {
|
|
1623
|
+
let e = kt(m.value), t = i.value.filter((t) => e.includes(t.value)).map((e) => String(e.label ?? e.name ?? e.value));
|
|
1624
|
+
return t.length ? t.join(", ") : Q(e);
|
|
1625
|
+
}
|
|
1626
|
+
let e = Z(m.value), t = i.value.find((t) => t.value === e);
|
|
1627
|
+
return t ? String(t.label ?? t.name ?? t.value) : Q(e);
|
|
1628
|
+
});
|
|
1629
|
+
return h(), (t, n) => e.readonly ? (j(), p("span", wn, I(S.value), 1)) : (j(), d(z(Pe), {
|
|
1630
|
+
key: 1,
|
|
1631
|
+
"model-value": m.value,
|
|
1632
|
+
remote: "",
|
|
1633
|
+
filterable: "",
|
|
1634
|
+
"remote-method": v,
|
|
1635
|
+
multiple: e.multiple,
|
|
1636
|
+
clearable: e.clearable,
|
|
1637
|
+
disabled: e.disabled,
|
|
1638
|
+
loading: a.value,
|
|
1639
|
+
"popper-class": "k-form-scroll-select__dropdown",
|
|
1640
|
+
class: "k-form-scroll-select",
|
|
1641
|
+
onVisibleChange: b,
|
|
1642
|
+
"onUpdate:modelValue": x
|
|
1643
|
+
}, {
|
|
1644
|
+
default: W(() => [(j(!0), p(c, null, P(i.value, (e, t) => le((j(), d(z(De), {
|
|
1645
|
+
key: `${e.value}-${t}`,
|
|
1646
|
+
label: String(e.label ?? ""),
|
|
1647
|
+
value: e.value
|
|
1648
|
+
}, null, 8, ["label", "value"])), [[ce, e.isShow !== !1]])), 128))]),
|
|
1649
|
+
_: 1
|
|
1650
|
+
}, 8, [
|
|
1651
|
+
"model-value",
|
|
1652
|
+
"multiple",
|
|
1653
|
+
"clearable",
|
|
1654
|
+
"disabled",
|
|
1655
|
+
"loading"
|
|
1656
|
+
]));
|
|
1657
|
+
}
|
|
1658
|
+
}), [["__scopeId", "data-v-dc0bba37"]]), En = {
|
|
1659
|
+
key: 0,
|
|
1660
|
+
class: "k-form-select-multiple__readonly"
|
|
1661
|
+
}, Dn = "all", On = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1662
|
+
name: "KFormSelectMultiple",
|
|
1663
|
+
__name: "SelectMultiple",
|
|
1664
|
+
props: {
|
|
1665
|
+
modelValue: {},
|
|
1666
|
+
options: {},
|
|
1667
|
+
readonly: { type: Boolean },
|
|
1668
|
+
disabled: { type: Boolean },
|
|
1669
|
+
placeholder: { default: "请选择" },
|
|
1670
|
+
showAllItem: {
|
|
1671
|
+
type: Boolean,
|
|
1672
|
+
default: !1
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
emits: ["update:modelValue"],
|
|
1676
|
+
setup(e, { emit: t }) {
|
|
1677
|
+
let n = e, r = t, i = N([]), a = u(() => {
|
|
1678
|
+
let e = n.options ?? [];
|
|
1679
|
+
return !n.showAllItem || e.some((e) => e.value === Dn) ? e : [{
|
|
1680
|
+
label: "全选",
|
|
1681
|
+
value: Dn
|
|
1682
|
+
}, ...e];
|
|
1683
|
+
}), o = u(() => a.value.map((e) => ({
|
|
1684
|
+
label: e.label,
|
|
1685
|
+
value: Dt(e.value),
|
|
1686
|
+
disabled: e.disabled,
|
|
1687
|
+
key: String(e.value)
|
|
1688
|
+
}))), s = u(() => o.value.map((e) => e.value)), l = u(() => {
|
|
1689
|
+
let e = o.value.filter((e) => i.value.includes(e.value)).map((e) => e.label);
|
|
1690
|
+
return e.length ? e.join(", ") : Q(i.value);
|
|
1691
|
+
});
|
|
1692
|
+
U(() => n.modelValue, (e) => {
|
|
1693
|
+
i.value = kt(e);
|
|
1694
|
+
}, { immediate: !0 });
|
|
1695
|
+
function f(e, t) {
|
|
1696
|
+
if (!n.showAllItem) {
|
|
1697
|
+
r("update:modelValue", e);
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
let a = e.includes(Dn), o = t.includes(Dn);
|
|
1701
|
+
a && e.length > t.length ? i.value = [...s.value] : !a && o && e.length !== s.value.length ? i.value = [] : a && e.length !== s.value.length ? i.value = e.filter((e) => e !== Dn) : !a && e.length >= s.value.length - 1 ? i.value = [Dn, ...e] : i.value = e, r("update:modelValue", i.value);
|
|
1702
|
+
}
|
|
1703
|
+
let m = [];
|
|
1704
|
+
function h(e) {
|
|
1705
|
+
f(e, m), m = [...i.value];
|
|
1706
|
+
}
|
|
1707
|
+
return (t, n) => e.readonly ? (j(), p("span", En, I(l.value), 1)) : (j(), d(z(Pe), {
|
|
1708
|
+
key: 1,
|
|
1709
|
+
"model-value": i.value,
|
|
1710
|
+
multiple: "",
|
|
1711
|
+
"collapse-tags": "",
|
|
1712
|
+
"collapse-tags-tooltip": "",
|
|
1713
|
+
placeholder: e.placeholder,
|
|
1714
|
+
disabled: e.disabled,
|
|
1715
|
+
class: "k-form-select-multiple",
|
|
1716
|
+
"onUpdate:modelValue": h
|
|
1717
|
+
}, {
|
|
1718
|
+
default: W(() => [(j(!0), p(c, null, P(o.value, (e) => (j(), d(z(De), {
|
|
1719
|
+
key: e.key,
|
|
1720
|
+
label: e.label,
|
|
1721
|
+
value: e.value,
|
|
1722
|
+
disabled: e.disabled
|
|
1723
|
+
}, null, 8, [
|
|
1724
|
+
"label",
|
|
1725
|
+
"value",
|
|
1726
|
+
"disabled"
|
|
1727
|
+
]))), 128))]),
|
|
1728
|
+
_: 1
|
|
1729
|
+
}, 8, [
|
|
1730
|
+
"model-value",
|
|
1731
|
+
"placeholder",
|
|
1732
|
+
"disabled"
|
|
1733
|
+
]));
|
|
1734
|
+
}
|
|
1735
|
+
}), [["__scopeId", "data-v-e6ca06e1"]]), kn = { class: "k-form-tag" }, An = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1736
|
+
name: "KFormTag",
|
|
1737
|
+
inheritAttrs: !1,
|
|
1738
|
+
__name: "Tag",
|
|
1739
|
+
props: {
|
|
1740
|
+
modelValue: {},
|
|
1741
|
+
options: {},
|
|
1742
|
+
readonly: { type: Boolean },
|
|
1743
|
+
disabled: {
|
|
1744
|
+
type: Boolean,
|
|
1745
|
+
default: !1
|
|
1746
|
+
},
|
|
1747
|
+
hasDefaultOption: {
|
|
1748
|
+
type: Boolean,
|
|
1749
|
+
default: !1
|
|
1750
|
+
},
|
|
1751
|
+
hasAllTag: {
|
|
1752
|
+
type: Boolean,
|
|
1753
|
+
default: !1
|
|
1754
|
+
},
|
|
1755
|
+
canUnSelect: {
|
|
1756
|
+
type: Boolean,
|
|
1757
|
+
default: !0
|
|
1758
|
+
},
|
|
1759
|
+
multiple: {
|
|
1760
|
+
type: Boolean,
|
|
1761
|
+
default: !1
|
|
1762
|
+
}
|
|
1763
|
+
},
|
|
1764
|
+
emits: ["update:modelValue"],
|
|
1765
|
+
setup(e, { emit: t }) {
|
|
1766
|
+
let n = e, r = t, i = N([]), a = u(() => n.hasDefaultOption || n.hasAllTag), o = u(() => {
|
|
1767
|
+
let e = (n.options ?? []).map((e) => ({
|
|
1768
|
+
label: e.label,
|
|
1769
|
+
value: String(e.value)
|
|
1770
|
+
}));
|
|
1771
|
+
return a.value ? [{
|
|
1772
|
+
label: "全部",
|
|
1773
|
+
value: ""
|
|
1774
|
+
}, ...e] : e;
|
|
1775
|
+
});
|
|
1776
|
+
function s() {
|
|
1777
|
+
let e = n.modelValue;
|
|
1778
|
+
if (Array.isArray(e)) {
|
|
1779
|
+
i.value = e.map(String);
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
let t = Z(e);
|
|
1783
|
+
i.value = t ? [String(t)] : [];
|
|
1784
|
+
}
|
|
1785
|
+
U(() => n.modelValue, s, { immediate: !0 });
|
|
1786
|
+
function l() {
|
|
1787
|
+
if (n.multiple) {
|
|
1788
|
+
r("update:modelValue", [...i.value]);
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
r("update:modelValue", i.value[0] ?? "");
|
|
1792
|
+
}
|
|
1793
|
+
function f(e) {
|
|
1794
|
+
if (n.readonly || n.disabled) return;
|
|
1795
|
+
let t = i.value.includes(e);
|
|
1796
|
+
t && n.canUnSelect ? i.value = i.value.filter((t) => t !== e) : n.multiple ? t || i.value.push(e) : i.value = [e], l();
|
|
1797
|
+
}
|
|
1798
|
+
function m(e) {
|
|
1799
|
+
let t = ["k-form-tag__item"];
|
|
1800
|
+
return n.disabled && t.push("is-disabled"), n.readonly && t.push("is-readonly"), i.value.includes(e) && t.push("is-active"), t.join(" ");
|
|
1801
|
+
}
|
|
1802
|
+
return (e, t) => (j(), p("div", kn, [(j(!0), p(c, null, P(o.value, (e) => (j(), d(z(Ie), {
|
|
1803
|
+
key: e.value || "__all__",
|
|
1804
|
+
class: D(["k-form-tag__item", m(e.value)]),
|
|
1805
|
+
type: "info",
|
|
1806
|
+
effect: "plain",
|
|
1807
|
+
"disable-transitions": !0,
|
|
1808
|
+
onClick: (t) => f(e.value)
|
|
1809
|
+
}, {
|
|
1810
|
+
default: W(() => [g(I(e.label), 1)]),
|
|
1811
|
+
_: 2
|
|
1812
|
+
}, 1032, ["class", "onClick"]))), 128))]));
|
|
1813
|
+
}
|
|
1814
|
+
}), [["__scopeId", "data-v-9961a98a"]]), jn = { class: "k-form-text" }, Mn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1815
|
+
name: "KFormText",
|
|
1816
|
+
__name: "Text",
|
|
1817
|
+
props: {
|
|
1818
|
+
modelValue: {},
|
|
1819
|
+
options: {},
|
|
1820
|
+
readonly: { type: Boolean },
|
|
1821
|
+
disabled: { type: Boolean }
|
|
1822
|
+
},
|
|
1823
|
+
setup(e) {
|
|
1824
|
+
let t = e, n = u(() => Ot(t.modelValue));
|
|
1825
|
+
return (e, t) => (j(), p("div", jn, [m("p", null, I(n.value), 1)]));
|
|
1826
|
+
}
|
|
1827
|
+
}), [["__scopeId", "data-v-9dc35114"]]), Nn = { class: "k-form-time-picker" }, Pn = ["innerHTML"], Fn = {
|
|
1828
|
+
key: 1,
|
|
1829
|
+
class: "k-form-time-picker__side k-form-time-picker__side--left"
|
|
1830
|
+
}, In = {
|
|
1831
|
+
key: 2,
|
|
1832
|
+
class: "k-form-time-picker__readonly"
|
|
1833
|
+
}, Ln = {
|
|
1834
|
+
key: 4,
|
|
1835
|
+
class: "k-form-time-picker__side k-form-time-picker__side--right"
|
|
1836
|
+
}, Rn = ["innerHTML"], zn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1837
|
+
name: "KFormTimePicker",
|
|
1838
|
+
inheritAttrs: !1,
|
|
1839
|
+
__name: "TimePicker",
|
|
1840
|
+
props: {
|
|
1841
|
+
modelValue: {},
|
|
1842
|
+
options: {},
|
|
1843
|
+
readonly: { type: Boolean },
|
|
1844
|
+
disabled: { type: Boolean },
|
|
1845
|
+
type: { default: "time" },
|
|
1846
|
+
prepend: { default: "" },
|
|
1847
|
+
append: { default: "" },
|
|
1848
|
+
leftText: { default: "" },
|
|
1849
|
+
rightText: { default: "" },
|
|
1850
|
+
limitTime: {
|
|
1851
|
+
type: Boolean,
|
|
1852
|
+
default: !1
|
|
1853
|
+
},
|
|
1854
|
+
placeholder: { default: "请选择时间" },
|
|
1855
|
+
startPlaceholder: { default: void 0 },
|
|
1856
|
+
endPlaceholder: { default: void 0 },
|
|
1857
|
+
valueFormat: { default: "HH:mm:ss" },
|
|
1858
|
+
format: { default: void 0 },
|
|
1859
|
+
clearable: {
|
|
1860
|
+
type: Boolean,
|
|
1861
|
+
default: !0
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
emits: ["update:modelValue"],
|
|
1865
|
+
setup(e, { emit: t }) {
|
|
1866
|
+
let n = e, r = t, i = u(() => Nt(n.modelValue)), a = u(() => Pt(n.type)), o = u(() => a.value === "timerange"), s = (e, t) => {
|
|
1867
|
+
let n = q(e instanceof Date ? e : String(e));
|
|
1868
|
+
return n.isValid() ? n.format(t) : Q(e);
|
|
1869
|
+
}, c = u(() => {
|
|
1870
|
+
if (!n.modelValue) return Q(n.modelValue);
|
|
1871
|
+
let e = n.valueFormat || "HH:mm:ss";
|
|
1872
|
+
return Array.isArray(n.modelValue) ? n.modelValue.map((t) => s(t, e)).join(" - ") : s(n.modelValue, e);
|
|
1873
|
+
}), l = u(() => {
|
|
1874
|
+
if (!n.limitTime) return;
|
|
1875
|
+
let e = q().hour();
|
|
1876
|
+
return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
|
|
1877
|
+
}), m = u(() => {
|
|
1878
|
+
if (n.limitTime) return (e) => {
|
|
1879
|
+
let t = q();
|
|
1880
|
+
return e > t.hour() ? [] : e < t.hour() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < t.minute());
|
|
1881
|
+
};
|
|
1882
|
+
}), h = u(() => {
|
|
1883
|
+
if (n.limitTime) return (e, t) => {
|
|
1884
|
+
let n = q();
|
|
1885
|
+
return e > n.hour() || e === n.hour() && t > n.minute() ? [] : e < n.hour() || e === n.hour() && t < n.minute() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < n.second());
|
|
1886
|
+
};
|
|
1887
|
+
});
|
|
1888
|
+
function g(e) {
|
|
1889
|
+
r("update:modelValue", e);
|
|
1890
|
+
}
|
|
1891
|
+
return (t, n) => (j(), p("div", Nn, [
|
|
1892
|
+
e.prepend ? (j(), p("span", {
|
|
1893
|
+
key: 0,
|
|
1894
|
+
class: "k-form-time-picker__text",
|
|
1895
|
+
innerHTML: e.prepend
|
|
1896
|
+
}, null, 8, Pn)) : f("", !0),
|
|
1897
|
+
e.leftText ? (j(), p("span", Fn, I(e.leftText), 1)) : f("", !0),
|
|
1898
|
+
e.readonly ? (j(), p("span", In, I(c.value), 1)) : (j(), d(z(Le), {
|
|
1899
|
+
key: 3,
|
|
1900
|
+
"model-value": i.value,
|
|
1901
|
+
"is-range": o.value,
|
|
1902
|
+
placeholder: e.placeholder,
|
|
1903
|
+
"start-placeholder": e.startPlaceholder,
|
|
1904
|
+
"end-placeholder": e.endPlaceholder,
|
|
1905
|
+
"value-format": e.valueFormat,
|
|
1906
|
+
format: e.format,
|
|
1907
|
+
disabled: e.disabled,
|
|
1908
|
+
clearable: e.clearable,
|
|
1909
|
+
"disabled-hours": l.value,
|
|
1910
|
+
"disabled-minutes": m.value,
|
|
1911
|
+
"disabled-seconds": h.value,
|
|
1912
|
+
"onUpdate:modelValue": g
|
|
1913
|
+
}, null, 8, [
|
|
1914
|
+
"model-value",
|
|
1915
|
+
"is-range",
|
|
1916
|
+
"placeholder",
|
|
1917
|
+
"start-placeholder",
|
|
1918
|
+
"end-placeholder",
|
|
1919
|
+
"value-format",
|
|
1920
|
+
"format",
|
|
1921
|
+
"disabled",
|
|
1922
|
+
"clearable",
|
|
1923
|
+
"disabled-hours",
|
|
1924
|
+
"disabled-minutes",
|
|
1925
|
+
"disabled-seconds"
|
|
1926
|
+
])),
|
|
1927
|
+
e.rightText ? (j(), p("span", Ln, I(e.rightText), 1)) : f("", !0),
|
|
1928
|
+
e.append ? (j(), p("span", {
|
|
1929
|
+
key: 5,
|
|
1930
|
+
class: "k-form-time-picker__text",
|
|
1931
|
+
innerHTML: e.append
|
|
1932
|
+
}, null, 8, Rn)) : f("", !0)
|
|
1933
|
+
]));
|
|
1934
|
+
}
|
|
1935
|
+
}), [["__scopeId", "data-v-8680ec2d"]]), Bn = { class: "k-form-tree-select" }, Vn = {
|
|
1936
|
+
key: 0,
|
|
1937
|
+
class: "k-form-input__readonly"
|
|
1938
|
+
}, Hn = /* @__PURE__ */ y({
|
|
1939
|
+
name: "KFormTreeSelect",
|
|
1940
|
+
__name: "TreeSelect",
|
|
1941
|
+
props: {
|
|
1942
|
+
modelValue: {},
|
|
1943
|
+
options: {},
|
|
1944
|
+
readonly: { type: Boolean },
|
|
1945
|
+
disabled: { type: Boolean },
|
|
1946
|
+
data: { default: () => [] },
|
|
1947
|
+
placeholder: { default: void 0 },
|
|
1948
|
+
clearable: {
|
|
1949
|
+
type: Boolean,
|
|
1950
|
+
default: !0
|
|
1951
|
+
},
|
|
1952
|
+
filterable: {
|
|
1953
|
+
type: Boolean,
|
|
1954
|
+
default: !0
|
|
1955
|
+
},
|
|
1956
|
+
checkStrictly: {
|
|
1957
|
+
type: Boolean,
|
|
1958
|
+
default: !0
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1961
|
+
emits: ["update:modelValue"],
|
|
1962
|
+
setup(e, { emit: t }) {
|
|
1963
|
+
let n = e, r = t, i = u(() => Z(n.modelValue)), a = u(() => It(n.data)), o = u(() => Lt(a.value, i.value) ?? Q(i.value));
|
|
1964
|
+
return (t, n) => (j(), p("div", Bn, [e.readonly ? (j(), p("div", Vn, I(o.value), 1)) : (j(), d(z(ze), {
|
|
1965
|
+
key: 1,
|
|
1966
|
+
"model-value": i.value,
|
|
1967
|
+
data: a.value,
|
|
1968
|
+
placeholder: e.placeholder,
|
|
1969
|
+
clearable: e.clearable,
|
|
1970
|
+
filterable: e.filterable,
|
|
1971
|
+
"check-strictly": e.checkStrictly,
|
|
1972
|
+
disabled: e.disabled,
|
|
1973
|
+
"render-after-expand": !1,
|
|
1974
|
+
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
1975
|
+
}, null, 8, [
|
|
1976
|
+
"model-value",
|
|
1977
|
+
"data",
|
|
1978
|
+
"placeholder",
|
|
1979
|
+
"clearable",
|
|
1980
|
+
"filterable",
|
|
1981
|
+
"check-strictly",
|
|
1982
|
+
"disabled"
|
|
1983
|
+
]))]));
|
|
1984
|
+
}
|
|
1985
|
+
}), Un = { class: "k-upload__file-item" }, Wn = ["src"], Gn = { class: "el-upload-list__item-actions" }, Kn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1986
|
+
name: "KUploadFileItem",
|
|
1987
|
+
__name: "UploadFileItem",
|
|
1988
|
+
props: {
|
|
1989
|
+
file: {},
|
|
1990
|
+
listType: {},
|
|
1991
|
+
disabled: { type: Boolean }
|
|
1992
|
+
},
|
|
1993
|
+
emits: [
|
|
1994
|
+
"zoom",
|
|
1995
|
+
"download",
|
|
1996
|
+
"remove",
|
|
1997
|
+
"play"
|
|
1998
|
+
],
|
|
1999
|
+
setup(e, { emit: t }) {
|
|
2000
|
+
let n = e, r = t, i = u(() => n.listType === "video" || n.listType === "audio"), a = u(() => n.file.status === "uploading"), o = u(() => Math.round(Number(n.file.percentage ?? 0)));
|
|
2001
|
+
return (t, n) => (j(), p("div", Un, [i.value ? (j(), p("button", {
|
|
2002
|
+
key: 0,
|
|
2003
|
+
type: "button",
|
|
2004
|
+
class: "k-upload__media-play",
|
|
2005
|
+
onClick: n[0] ||= (t) => r("play", e.file)
|
|
2006
|
+
}, [_(z(Se), null, {
|
|
2007
|
+
default: W(() => [_(z(Je))]),
|
|
2008
|
+
_: 1
|
|
2009
|
+
})])) : (j(), p(c, { key: 1 }, [F(t.$slots, "preview", { file: e.file }, () => [m("img", {
|
|
2010
|
+
class: "el-upload-list__item-thumbnail",
|
|
2011
|
+
src: e.file.url,
|
|
2012
|
+
alt: ""
|
|
2013
|
+
}, null, 8, Wn)], !0), m("span", Gn, [
|
|
2014
|
+
m("span", {
|
|
2015
|
+
class: "el-upload-list__item-preview",
|
|
2016
|
+
onClick: n[1] ||= (t) => r("zoom", e.file)
|
|
2017
|
+
}, [_(z(Se), null, {
|
|
2018
|
+
default: W(() => [_(z(Ye))]),
|
|
2019
|
+
_: 1
|
|
2020
|
+
})]),
|
|
2021
|
+
e.disabled ? f("", !0) : (j(), p("span", {
|
|
2022
|
+
key: 0,
|
|
2023
|
+
class: "el-upload-list__item-download",
|
|
2024
|
+
onClick: n[2] ||= (t) => r("download", e.file)
|
|
2025
|
+
}, [_(z(Se), null, {
|
|
2026
|
+
default: W(() => [_(z(Ge))]),
|
|
2027
|
+
_: 1
|
|
2028
|
+
})])),
|
|
2029
|
+
e.disabled ? f("", !0) : (j(), p("span", {
|
|
2030
|
+
key: 1,
|
|
2031
|
+
class: "el-upload-list__item-delete",
|
|
2032
|
+
onClick: n[3] ||= (t) => r("remove", e.file)
|
|
2033
|
+
}, [_(z(Se), null, {
|
|
2034
|
+
default: W(() => [_(z(We))]),
|
|
2035
|
+
_: 1
|
|
2036
|
+
})]))
|
|
2037
|
+
])], 64)), a.value ? (j(), d(z(Ae), {
|
|
2038
|
+
key: 2,
|
|
2039
|
+
class: "k-upload__file-progress",
|
|
2040
|
+
type: e.listType === "picture-card" || e.listType === "lottie" ? "circle" : "line",
|
|
2041
|
+
width: e.listType === "picture-card" || e.listType === "lottie" ? 80 : void 0,
|
|
2042
|
+
"stroke-width": 6,
|
|
2043
|
+
percentage: o.value,
|
|
2044
|
+
"show-text": !1
|
|
2045
|
+
}, null, 8, [
|
|
2046
|
+
"type",
|
|
2047
|
+
"width",
|
|
2048
|
+
"percentage"
|
|
2049
|
+
])) : f("", !0)]));
|
|
2050
|
+
}
|
|
2051
|
+
}), [["__scopeId", "data-v-01959ada"]]), qn = { class: "k-upload__inline-actions" }, Jn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2052
|
+
name: "KUploadInlineActions",
|
|
2053
|
+
__name: "UploadInlineActions",
|
|
2054
|
+
props: {
|
|
2055
|
+
templateCode: { default: "" },
|
|
2056
|
+
templateBtnText: { default: "模版下载" },
|
|
2057
|
+
tipType: { default: "text" },
|
|
2058
|
+
tipText: { default: "" }
|
|
2059
|
+
},
|
|
2060
|
+
emits: ["downloadTemplate"],
|
|
2061
|
+
setup(e, { emit: t }) {
|
|
2062
|
+
let n = t;
|
|
2063
|
+
return (t, r) => (j(), p("div", qn, [e.templateCode ? (j(), p("button", {
|
|
2064
|
+
key: 0,
|
|
2065
|
+
type: "button",
|
|
2066
|
+
class: "k-upload__download",
|
|
2067
|
+
onClick: r[0] ||= ue((e) => n("downloadTemplate"), ["stop"])
|
|
2068
|
+
}, [_(z(Se), { class: "k-upload__download-icon" }, {
|
|
2069
|
+
default: W(() => [_(z(Ge))]),
|
|
2070
|
+
_: 1
|
|
2071
|
+
}), m("span", null, I(e.templateBtnText), 1)])) : f("", !0), e.tipType === "tooltip" && e.tipText ? (j(), d(z(Re), {
|
|
2072
|
+
key: 1,
|
|
2073
|
+
placement: "top",
|
|
2074
|
+
content: e.tipText
|
|
2075
|
+
}, {
|
|
2076
|
+
default: W(() => [...r[1] ||= [m("i", {
|
|
2077
|
+
class: "k-upload__tip-icon",
|
|
2078
|
+
"aria-label": "上传说明"
|
|
2079
|
+
}, "?", -1)]]),
|
|
2080
|
+
_: 1
|
|
2081
|
+
}, 8, ["content"])) : f("", !0)]));
|
|
2082
|
+
}
|
|
2083
|
+
}), [["__scopeId", "data-v-55d9c320"]]), Yn = { class: "k-upload__media-wrap" }, Xn = ["src"], Zn = ["src"], Qn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2084
|
+
name: "KUploadMediaDialog",
|
|
2085
|
+
__name: "UploadMediaDialog",
|
|
2086
|
+
props: /*@__PURE__*/ w({
|
|
2087
|
+
url: {},
|
|
2088
|
+
type: {}
|
|
2089
|
+
}, {
|
|
2090
|
+
visible: {
|
|
2091
|
+
type: Boolean,
|
|
2092
|
+
default: !1
|
|
2093
|
+
},
|
|
2094
|
+
visibleModifiers: {}
|
|
2095
|
+
}),
|
|
2096
|
+
emits: ["update:visible"],
|
|
2097
|
+
setup(e) {
|
|
2098
|
+
let t = se(e, "visible");
|
|
2099
|
+
return (n, r) => (j(), d(ut, {
|
|
2100
|
+
visible: t.value,
|
|
2101
|
+
"onUpdate:visible": r[0] ||= (e) => t.value = e,
|
|
2102
|
+
"show-confirm": !1,
|
|
2103
|
+
"show-cancel": !1,
|
|
2104
|
+
width: "640px",
|
|
2105
|
+
title: "预览"
|
|
2106
|
+
}, {
|
|
2107
|
+
default: W(() => [m("div", Yn, [e.type === "video" ? (j(), p("video", {
|
|
2108
|
+
key: 0,
|
|
2109
|
+
src: e.url,
|
|
2110
|
+
controls: "",
|
|
2111
|
+
class: "k-upload__media"
|
|
2112
|
+
}, "您的浏览器不支持视频播放", 8, Xn)) : (j(), p("audio", {
|
|
2113
|
+
key: 1,
|
|
2114
|
+
src: e.url,
|
|
2115
|
+
controls: "",
|
|
2116
|
+
class: "k-upload__media"
|
|
2117
|
+
}, "您的浏览器不支持音频播放", 8, Zn))])]),
|
|
2118
|
+
_: 1
|
|
2119
|
+
}, 8, ["visible"]));
|
|
2120
|
+
}
|
|
2121
|
+
}), [["__scopeId", "data-v-b9720661"]]), $n = { class: "k-upload__tip-area" }, er = ["innerHTML"], tr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2122
|
+
name: "KUploadTipArea",
|
|
2123
|
+
__name: "UploadTipArea",
|
|
2124
|
+
props: {
|
|
2125
|
+
tipType: { default: "text" },
|
|
2126
|
+
tipText: { default: "" },
|
|
2127
|
+
percentage: { default: 0 }
|
|
2128
|
+
},
|
|
2129
|
+
setup(e) {
|
|
2130
|
+
return (t, n) => (j(), p("div", $n, [e.tipType === "text" && e.tipText ? (j(), p("div", {
|
|
2131
|
+
key: 0,
|
|
2132
|
+
class: "el-upload__tip",
|
|
2133
|
+
innerHTML: e.tipText
|
|
2134
|
+
}, null, 8, er)) : f("", !0), e.percentage > 0 ? (j(), d(z(Ae), {
|
|
2135
|
+
key: 1,
|
|
2136
|
+
class: "k-upload__progress",
|
|
2137
|
+
percentage: e.percentage,
|
|
2138
|
+
"show-text": !1
|
|
2139
|
+
}, null, 8, ["percentage"])) : f("", !0)]));
|
|
2140
|
+
}
|
|
2141
|
+
}), [["__scopeId", "data-v-f2b7df65"]]);
|
|
2142
|
+
//#endregion
|
|
2143
|
+
//#region src/components/k-upload/composables/useImagePreview.ts
|
|
2144
|
+
function nr() {
|
|
2145
|
+
let e = N(!1), t = N([]), n = N(0);
|
|
2146
|
+
function r(r, i) {
|
|
2147
|
+
let a = i.map((e) => e.url).filter((e) => !!e), o = r.url;
|
|
2148
|
+
if (o && !a.includes(o) && a.unshift(o), !a.length) return !1;
|
|
2149
|
+
let s = o ? a.indexOf(o) : 0;
|
|
2150
|
+
return t.value = a, n.value = s < 0 ? 0 : s, e.value = !0, !0;
|
|
2151
|
+
}
|
|
2152
|
+
function i() {
|
|
2153
|
+
e.value = !1;
|
|
2154
|
+
}
|
|
2155
|
+
return {
|
|
2156
|
+
visible: e,
|
|
2157
|
+
urlList: t,
|
|
2158
|
+
initialIndex: n,
|
|
2159
|
+
open: r,
|
|
2160
|
+
close: i
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
//#endregion
|
|
2164
|
+
//#region src/components/k-upload/composables/useMediaPreview.ts
|
|
2165
|
+
function rr() {
|
|
2166
|
+
let e = N(!1), t = N(""), n = N("video");
|
|
2167
|
+
function r(r, i) {
|
|
2168
|
+
r.url && (t.value = r.url, n.value = i, e.value = !0);
|
|
2169
|
+
}
|
|
2170
|
+
function i() {
|
|
2171
|
+
e.value = !1, t.value = "";
|
|
2172
|
+
}
|
|
2173
|
+
return {
|
|
2174
|
+
visible: e,
|
|
2175
|
+
url: t,
|
|
2176
|
+
type: n,
|
|
2177
|
+
open: r,
|
|
2178
|
+
close: i
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
//#endregion
|
|
2182
|
+
//#region src/components/k-upload/composables/useUploadFileList.ts
|
|
2183
|
+
function ir(e, t) {
|
|
2184
|
+
return String(e) === String(t);
|
|
2185
|
+
}
|
|
2186
|
+
function ar(e) {
|
|
2187
|
+
let t = N([]);
|
|
2188
|
+
U(() => e.getModelValue(), (e) => {
|
|
2189
|
+
t.value = Array.isArray(e) ? e.map((e) => ({ ...e })) : [];
|
|
2190
|
+
}, {
|
|
2191
|
+
immediate: !0,
|
|
2192
|
+
deep: !0
|
|
2193
|
+
});
|
|
2194
|
+
let n = u(() => t.value.map((e) => ({
|
|
2195
|
+
name: e.name,
|
|
2196
|
+
url: e.url,
|
|
2197
|
+
uid: e.uid,
|
|
2198
|
+
status: e.status ?? "success"
|
|
2199
|
+
})));
|
|
2200
|
+
function r(n) {
|
|
2201
|
+
t.value = n, e.onUpdate(n.map((e) => ({ ...e })));
|
|
2202
|
+
}
|
|
2203
|
+
function i(e) {
|
|
2204
|
+
r(t.value.filter((t) => !ir(t.uid, e)));
|
|
2205
|
+
}
|
|
2206
|
+
function a(n) {
|
|
2207
|
+
if (e.getLimit() === 1) {
|
|
2208
|
+
r([n]);
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
r([...t.value.filter((e) => !ir(e.uid, n.uid)), n]);
|
|
2212
|
+
}
|
|
2213
|
+
function o(e) {
|
|
2214
|
+
return t.value.find((t) => ir(t.uid, e));
|
|
2215
|
+
}
|
|
2216
|
+
return {
|
|
2217
|
+
fileList: t,
|
|
2218
|
+
elFileList: n,
|
|
2219
|
+
publish: r,
|
|
2220
|
+
removeByUid: i,
|
|
2221
|
+
upsert: a,
|
|
2222
|
+
findByUid: o
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
//#endregion
|
|
2226
|
+
//#region src/components/k-upload/composables/useUploadRequest.ts
|
|
2227
|
+
function or() {
|
|
2228
|
+
let e = s();
|
|
2229
|
+
if (!e.uploadRequest) throw Error("[KUpload] uploadRequest 未配置,请在 setupCmsBase 中初始化上传能力");
|
|
2230
|
+
return e;
|
|
2231
|
+
}
|
|
2232
|
+
function sr(e, t) {
|
|
2233
|
+
if (String(e[t.responseCode] ?? "") !== t.responseSuccessCode) {
|
|
2234
|
+
let n = String(e[t.responseMsg] ?? "");
|
|
2235
|
+
throw Error(n || "文件上传失败");
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
function cr(e) {
|
|
2239
|
+
function t(t) {
|
|
2240
|
+
let n = { ...t }, r = e.getTemplateCode();
|
|
2241
|
+
return r && (n.type_code = r), n;
|
|
2242
|
+
}
|
|
2243
|
+
return {
|
|
2244
|
+
httpRequest: async (e) => {
|
|
2245
|
+
let n = or(), r = await n.uploadRequest({
|
|
2246
|
+
file: e.file,
|
|
2247
|
+
action: e.action,
|
|
2248
|
+
data: t(e.data),
|
|
2249
|
+
onProgress: (t) => {
|
|
2250
|
+
e.onProgress?.({ percent: t });
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
return sr(r, n), r;
|
|
2254
|
+
},
|
|
2255
|
+
uploadFile: async (e, n, r) => {
|
|
2256
|
+
let i = or(), a = await i.uploadRequest({
|
|
2257
|
+
file: e,
|
|
2258
|
+
action: n,
|
|
2259
|
+
data: t(r),
|
|
2260
|
+
onProgress: () => {}
|
|
2261
|
+
});
|
|
2262
|
+
return sr(a, i), a;
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
//#endregion
|
|
2267
|
+
//#region src/components/k-upload/composables/useUploadValidation.ts
|
|
2268
|
+
function lr(e) {
|
|
2269
|
+
let t = /* @__PURE__ */ new Set();
|
|
2270
|
+
function n(t) {
|
|
2271
|
+
let n = e.getAccept(), i = n.split(",").map((e) => e.trim()).filter(Boolean), a = t.name.slice(t.name.lastIndexOf(".")).toLowerCase();
|
|
2272
|
+
return i.length && !i.includes(a) ? (Ee.warning(`只能上传后缀是${n}的文件`), r(t), !1) : t.size / 1024 / 1024 > e.getMaxSize() ? (Ee.warning(`文件大小不得超过${e.getMaxSize()}M`), r(t), !1) : !0;
|
|
2273
|
+
}
|
|
2274
|
+
function r(e) {
|
|
2275
|
+
let n = e.uid;
|
|
2276
|
+
typeof n == "number" && t.add(n);
|
|
2277
|
+
}
|
|
2278
|
+
function i(e) {
|
|
2279
|
+
return t.has(e) ? (t.delete(e), !0) : !1;
|
|
2280
|
+
}
|
|
2281
|
+
return {
|
|
2282
|
+
validate: n,
|
|
2283
|
+
consumeRejected: i
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
//#endregion
|
|
2287
|
+
//#region src/components/k-upload/resolveUploadAction.ts
|
|
2288
|
+
function ur(e, t) {
|
|
2289
|
+
if (t) return t;
|
|
2290
|
+
let { urls: n } = s();
|
|
2291
|
+
return e === "text" ? n.UPLOAD_EXCEL_URL : e === "picture" || e === "picture-card" || e === "picture2" ? n.UPLOAD_IMG_URL : n.UPLOAD_FILE_URL;
|
|
2292
|
+
}
|
|
2293
|
+
function dr(e) {
|
|
2294
|
+
let { urls: t } = s();
|
|
2295
|
+
return e === "picture" || e === "picture-card" || e === "picture2" ? t.SHOW_IMG_URL : t.DOWNLOAD_FILE_URL;
|
|
2296
|
+
}
|
|
2297
|
+
//#endregion
|
|
2298
|
+
//#region src/components/k-upload/KUpload.vue?vue&type=script&setup=true&lang.ts
|
|
2299
|
+
var fr = {
|
|
2300
|
+
key: 0,
|
|
2301
|
+
class: "k-upload__trigger-row"
|
|
2302
|
+
}, pr = { class: "picture-card-context" }, mr = ["innerHTML"], hr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2303
|
+
name: "KUpload",
|
|
2304
|
+
inheritAttrs: !1,
|
|
2305
|
+
__name: "KUpload",
|
|
2306
|
+
props: {
|
|
2307
|
+
modelValue: { default: () => [] },
|
|
2308
|
+
listType: { default: "picture" },
|
|
2309
|
+
action: { default: "" },
|
|
2310
|
+
accept: { default: "" },
|
|
2311
|
+
limit: { default: void 0 },
|
|
2312
|
+
maxSize: { default: 2 },
|
|
2313
|
+
disabled: {
|
|
2314
|
+
type: Boolean,
|
|
2315
|
+
default: !1
|
|
2316
|
+
},
|
|
2317
|
+
btnText: { default: "点击上传" },
|
|
2318
|
+
templateCode: { default: "" },
|
|
2319
|
+
templateDomain: { default: "app" },
|
|
2320
|
+
templateDownloadUrl: { default: "" },
|
|
2321
|
+
templateBtnText: { default: "模版下载" },
|
|
2322
|
+
tipType: { default: "text" },
|
|
2323
|
+
fileTips: { default: "" },
|
|
2324
|
+
showSuccMessage: {
|
|
2325
|
+
type: Boolean,
|
|
2326
|
+
default: !0
|
|
2327
|
+
},
|
|
2328
|
+
autoUpload: {
|
|
2329
|
+
type: Boolean,
|
|
2330
|
+
default: !0
|
|
2331
|
+
},
|
|
2332
|
+
openCutter: {
|
|
2333
|
+
type: Boolean,
|
|
2334
|
+
default: !1
|
|
2335
|
+
},
|
|
2336
|
+
cutterOption: { default: () => ({}) }
|
|
2337
|
+
},
|
|
2338
|
+
emits: [
|
|
2339
|
+
"update:modelValue",
|
|
2340
|
+
"success",
|
|
2341
|
+
"error",
|
|
2342
|
+
"remove",
|
|
2343
|
+
"preview",
|
|
2344
|
+
"change",
|
|
2345
|
+
"exceed"
|
|
2346
|
+
],
|
|
2347
|
+
setup(e, { expose: t, emit: n }) {
|
|
2348
|
+
let r = v(() => import("./ImageCutter-B4uKMA_8.js")), i = {
|
|
2349
|
+
picture: ".bmp,.gif,.png,.jpg,.jpeg",
|
|
2350
|
+
"picture-card": ".bmp,.gif,.png,.jpg,.jpeg",
|
|
2351
|
+
text: ".doc,.docx,.xlsx,.xls",
|
|
2352
|
+
video: ".mp4",
|
|
2353
|
+
audio: ".m4a",
|
|
2354
|
+
lottie: ".json"
|
|
2355
|
+
};
|
|
2356
|
+
function a(e, t) {
|
|
2357
|
+
let n = e instanceof Error ? e.message : String(e ?? "");
|
|
2358
|
+
return /timeout/i.test(n) || /ECONNABORTED/i.test(n) ? "请求超时,请稍后重试" : n || t;
|
|
2359
|
+
}
|
|
2360
|
+
let o = e, c = n, l = N(), y = H("cutterRef"), x = N(null), S = N(0);
|
|
2361
|
+
U(y, (e) => {
|
|
2362
|
+
if (!e || !x.value) return;
|
|
2363
|
+
let t = x.value;
|
|
2364
|
+
x.value = null, e.openImgCutter({
|
|
2365
|
+
name: t.name,
|
|
2366
|
+
raw: t.raw
|
|
2367
|
+
});
|
|
2368
|
+
});
|
|
2369
|
+
function C(e) {
|
|
2370
|
+
if (y.value) {
|
|
2371
|
+
y.value.openImgCutter({
|
|
2372
|
+
name: e.name,
|
|
2373
|
+
raw: e.raw
|
|
2374
|
+
});
|
|
2375
|
+
return;
|
|
2376
|
+
}
|
|
2377
|
+
x.value = e;
|
|
2378
|
+
}
|
|
2379
|
+
let w = u(() => o.accept ? o.accept.toLowerCase() : i[o.listType] ?? ""), { fileList: O, elFileList: k, removeByUid: A, upsert: ne, findByUid: M } = ar({
|
|
2380
|
+
getModelValue: () => o.modelValue,
|
|
2381
|
+
onUpdate: (e) => c("update:modelValue", e),
|
|
2382
|
+
getLimit: () => o.limit
|
|
2383
|
+
}), P = lr({
|
|
2384
|
+
getAccept: () => w.value,
|
|
2385
|
+
getMaxSize: () => o.maxSize
|
|
2386
|
+
}), re = cr({ getTemplateCode: () => o.templateCode }), { visible: ie, urlList: ae, initialIndex: oe, open: L, close: R } = nr(), { visible: B, url: se, type: V, open: ce } = rr(), le = u(() => ur(o.listType, o.action)), ue = u(() => {
|
|
2387
|
+
switch (o.listType) {
|
|
2388
|
+
case "picture": return "picture";
|
|
2389
|
+
case "picture-card":
|
|
2390
|
+
case "picture2":
|
|
2391
|
+
case "lottie": return "picture-card";
|
|
2392
|
+
default: return "text";
|
|
2393
|
+
}
|
|
2394
|
+
}), de = u(() => [
|
|
2395
|
+
"picture",
|
|
2396
|
+
"picture-card",
|
|
2397
|
+
"picture2",
|
|
2398
|
+
"lottie"
|
|
2399
|
+
].includes(o.listType)), fe = u(() => [
|
|
2400
|
+
"picture-card",
|
|
2401
|
+
"lottie",
|
|
2402
|
+
"video",
|
|
2403
|
+
"audio"
|
|
2404
|
+
].includes(o.listType)), pe = u(() => o.listType === "picture-card" || o.listType === "lottie"), me = u(() => !pe.value), he = u(() => !o.openCutter && o.autoUpload), ge = u(() => o.limit === 1 ? void 0 : o.limit), _e = u(() => !!(o.limit && o.limit !== 1 && O.value.length >= o.limit)), ve = u(() => !o.disabled), ye = u(() => !pe.value && !o.disabled), G = u(() => o.disabled ? "" : o.fileTips || (w.value ? `支持上传 ${w.value} 后缀文件,且不超过${o.maxSize}M` : "")), be = u(() => {
|
|
2405
|
+
let e = ["k-upload", `k-upload--${o.listType}`];
|
|
2406
|
+
return o.disabled && e.push("k-upload_detail"), _e.value && e.push("k-upload--limit"), e.join(" ");
|
|
2407
|
+
});
|
|
2408
|
+
function xe(e, t, n) {
|
|
2409
|
+
let r = e ?? {}, i = String(r.resource_id ?? ""), a = String(r.file_name ?? n), s = dr(o.listType);
|
|
2410
|
+
return {
|
|
2411
|
+
...r,
|
|
2412
|
+
uid: t,
|
|
2413
|
+
name: a,
|
|
2414
|
+
resource_id: i,
|
|
2415
|
+
file_name: a,
|
|
2416
|
+
imp_id: r.imp_id,
|
|
2417
|
+
url: i ? `${s}${i}` : void 0,
|
|
2418
|
+
status: "success"
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
function we(e, t, n) {
|
|
2422
|
+
let r = xe(e, t, n);
|
|
2423
|
+
ne(r), S.value = 0, o.showSuccMessage && Ee.success("文件上传成功!"), c("success", e, r);
|
|
2424
|
+
}
|
|
2425
|
+
let Te = (e) => P.validate(e), De = (e, t) => {
|
|
2426
|
+
we(e ?? {}, t.uid, t.name);
|
|
2427
|
+
}, Oe = (e, t) => {
|
|
2428
|
+
S.value = 0, Ee.error(a(e, "文件上传失败!")), A(t.uid), c("error", e, t);
|
|
2429
|
+
}, ke = (e) => {
|
|
2430
|
+
if (typeof e.uid == "number" && P.consumeRejected(e.uid)) return;
|
|
2431
|
+
let t = M(e.uid);
|
|
2432
|
+
A(e.uid), t && c("remove", t);
|
|
2433
|
+
}, Ae = (e) => {
|
|
2434
|
+
let t = M(e.uid);
|
|
2435
|
+
t && (c("preview", t), !(de.value && L(t, O.value)) && ze(t));
|
|
2436
|
+
}, je = (e) => {
|
|
2437
|
+
o.listType === "picture2" && (S.value = Math.round(e.percent ?? 0));
|
|
2438
|
+
}, Me = (e) => {
|
|
2439
|
+
if (c("change", e), !(!o.openCutter || e.status !== "ready" || !e.raw)) {
|
|
2440
|
+
if (P.validate(e.raw) === !1) {
|
|
2441
|
+
A(e.uid);
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
A(e.uid), E(() => {
|
|
2445
|
+
l.value?.handleRemove(e), C({
|
|
2446
|
+
name: e.name,
|
|
2447
|
+
raw: e.raw
|
|
2448
|
+
});
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
}, Ne = (e, t) => {
|
|
2452
|
+
c("exceed", e, t);
|
|
2453
|
+
};
|
|
2454
|
+
function Pe(e) {
|
|
2455
|
+
let t = M(e.uid);
|
|
2456
|
+
t && L(t, O.value);
|
|
2457
|
+
}
|
|
2458
|
+
function Fe(e) {
|
|
2459
|
+
let t = M(e.uid);
|
|
2460
|
+
t && ze(t);
|
|
2461
|
+
}
|
|
2462
|
+
function K(e) {
|
|
2463
|
+
let t = M(e.uid);
|
|
2464
|
+
A(e.uid), t && c("remove", t);
|
|
2465
|
+
}
|
|
2466
|
+
function Ie(e) {
|
|
2467
|
+
let t = M(e.uid);
|
|
2468
|
+
t && ce(t, o.listType === "audio" ? "audio" : "video");
|
|
2469
|
+
}
|
|
2470
|
+
async function Le(e) {
|
|
2471
|
+
try {
|
|
2472
|
+
let t = ur("picture", o.action);
|
|
2473
|
+
we(await re.uploadFile(e, t), -Date.now(), e.name);
|
|
2474
|
+
} catch (e) {
|
|
2475
|
+
Ee.error(a(e, "图片上传失败!"));
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
function Re(e, t) {
|
|
2479
|
+
let n = document.createElement("a");
|
|
2480
|
+
n.href = e, n.download = t, n.click();
|
|
2481
|
+
}
|
|
2482
|
+
function ze(e) {
|
|
2483
|
+
e.resource_id && Re(`${dr(o.listType)}${e.resource_id}`, e.name || String(e.resource_id));
|
|
2484
|
+
}
|
|
2485
|
+
function q() {
|
|
2486
|
+
let e = s(), t = e.templateCodeRelation[o.templateCode];
|
|
2487
|
+
if (!t) {
|
|
2488
|
+
Ee.warning("模板未配置");
|
|
2489
|
+
return;
|
|
2490
|
+
}
|
|
2491
|
+
Re(`${o.templateDownloadUrl || (o.templateDomain === "base" ? e.baseTemplateDownloadBaseUrl : e.templateDownloadBaseUrl) || e.urls.BASE_URL}${t}`, t);
|
|
2492
|
+
}
|
|
2493
|
+
return t({
|
|
2494
|
+
submit: () => l.value?.submit(),
|
|
2495
|
+
clearFiles: () => l.value?.clearFiles(),
|
|
2496
|
+
uploadRef: l
|
|
2497
|
+
}), (t, n) => (j(), p("div", { class: D(["k-upload-wrap", be.value]) }, [
|
|
2498
|
+
_(z(Be), T({
|
|
2499
|
+
ref_key: "uploadRef",
|
|
2500
|
+
ref: l
|
|
2501
|
+
}, t.$attrs, {
|
|
2502
|
+
class: "k-upload__inner",
|
|
2503
|
+
"file-list": z(k),
|
|
2504
|
+
action: le.value,
|
|
2505
|
+
"list-type": ue.value,
|
|
2506
|
+
accept: w.value,
|
|
2507
|
+
limit: ge.value,
|
|
2508
|
+
disabled: e.disabled,
|
|
2509
|
+
"auto-upload": he.value,
|
|
2510
|
+
"http-request": z(re).httpRequest,
|
|
2511
|
+
"before-upload": Te,
|
|
2512
|
+
"on-success": De,
|
|
2513
|
+
"on-error": Oe,
|
|
2514
|
+
"on-remove": ke,
|
|
2515
|
+
"on-preview": Ae,
|
|
2516
|
+
"on-progress": je,
|
|
2517
|
+
"on-change": Me,
|
|
2518
|
+
"on-exceed": Ne
|
|
2519
|
+
}), h({
|
|
2520
|
+
tip: W(() => [F(t.$slots, "tip", {}, () => [pe.value && (e.templateCode || e.tipType === "tooltip" && G.value) ? (j(), d(Jn, {
|
|
2521
|
+
key: 0,
|
|
2522
|
+
"template-code": e.templateCode,
|
|
2523
|
+
"template-btn-text": e.templateBtnText,
|
|
2524
|
+
"tip-type": e.tipType,
|
|
2525
|
+
"tip-text": G.value,
|
|
2526
|
+
onDownloadTemplate: q
|
|
2527
|
+
}, null, 8, [
|
|
2528
|
+
"template-code",
|
|
2529
|
+
"template-btn-text",
|
|
2530
|
+
"tip-type",
|
|
2531
|
+
"tip-text"
|
|
2532
|
+
])) : f("", !0), ye.value ? (j(), d(tr, {
|
|
2533
|
+
key: 1,
|
|
2534
|
+
"tip-type": e.tipType,
|
|
2535
|
+
"tip-text": G.value,
|
|
2536
|
+
percentage: S.value
|
|
2537
|
+
}, null, 8, [
|
|
2538
|
+
"tip-type",
|
|
2539
|
+
"tip-text",
|
|
2540
|
+
"percentage"
|
|
2541
|
+
])) : f("", !0)], !0)]),
|
|
2542
|
+
_: 2
|
|
2543
|
+
}, [ve.value ? {
|
|
2544
|
+
name: "default",
|
|
2545
|
+
fn: W(() => [me.value ? (j(), p("div", fr, [
|
|
2546
|
+
F(t.$slots, "buttonBefore", {}, void 0, !0),
|
|
2547
|
+
F(t.$slots, "content", {}, () => [_(Y, {
|
|
2548
|
+
type: "primary",
|
|
2549
|
+
disabled: _e.value
|
|
2550
|
+
}, {
|
|
2551
|
+
default: W(() => [g(I(e.btnText), 1)]),
|
|
2552
|
+
_: 1
|
|
2553
|
+
}, 8, ["disabled"])], !0),
|
|
2554
|
+
_(Jn, {
|
|
2555
|
+
"template-code": e.templateCode,
|
|
2556
|
+
"template-btn-text": e.templateBtnText,
|
|
2557
|
+
"tip-type": e.tipType,
|
|
2558
|
+
"tip-text": G.value,
|
|
2559
|
+
onDownloadTemplate: q
|
|
2560
|
+
}, null, 8, [
|
|
2561
|
+
"template-code",
|
|
2562
|
+
"template-btn-text",
|
|
2563
|
+
"tip-type",
|
|
2564
|
+
"tip-text"
|
|
2565
|
+
]),
|
|
2566
|
+
F(t.$slots, "buttonAfter", {}, void 0, !0)
|
|
2567
|
+
])) : F(t.$slots, "content", {}, () => [m("div", pr, [_(z(Se), { class: "k-upload__plus" }, {
|
|
2568
|
+
default: W(() => [_(z(qe))]),
|
|
2569
|
+
_: 1
|
|
2570
|
+
}), e.tipType === "text" && G.value ? (j(), p("span", {
|
|
2571
|
+
key: 0,
|
|
2572
|
+
class: "picture-card-tips",
|
|
2573
|
+
innerHTML: G.value
|
|
2574
|
+
}, null, 8, mr)) : f("", !0)])], !0, 1)]),
|
|
2575
|
+
key: "0"
|
|
2576
|
+
} : void 0, fe.value ? {
|
|
2577
|
+
name: "file",
|
|
2578
|
+
fn: W(({ file: n }) => [F(t.$slots, "file", { file: n }, () => [_(Kn, {
|
|
2579
|
+
file: n,
|
|
2580
|
+
"list-type": e.listType,
|
|
2581
|
+
disabled: e.disabled,
|
|
2582
|
+
onZoom: Pe,
|
|
2583
|
+
onDownload: Fe,
|
|
2584
|
+
onRemove: K,
|
|
2585
|
+
onPlay: Ie
|
|
2586
|
+
}, h({ _: 2 }, [t.$slots.preview ? {
|
|
2587
|
+
name: "preview",
|
|
2588
|
+
fn: W((e) => [F(t.$slots, "preview", te(b(e)), void 0, !0)]),
|
|
2589
|
+
key: "0"
|
|
2590
|
+
} : void 0]), 1032, [
|
|
2591
|
+
"file",
|
|
2592
|
+
"list-type",
|
|
2593
|
+
"disabled"
|
|
2594
|
+
])], !0)]),
|
|
2595
|
+
key: "1"
|
|
2596
|
+
} : void 0]), 1040, [
|
|
2597
|
+
"file-list",
|
|
2598
|
+
"action",
|
|
2599
|
+
"list-type",
|
|
2600
|
+
"accept",
|
|
2601
|
+
"limit",
|
|
2602
|
+
"disabled",
|
|
2603
|
+
"auto-upload",
|
|
2604
|
+
"http-request"
|
|
2605
|
+
]),
|
|
2606
|
+
e.openCutter ? (j(), d(z(r), {
|
|
2607
|
+
key: 0,
|
|
2608
|
+
ref_key: "cutterRef",
|
|
2609
|
+
ref: y,
|
|
2610
|
+
option: e.cutterOption,
|
|
2611
|
+
onCut: Le
|
|
2612
|
+
}, null, 8, ["option"])) : f("", !0),
|
|
2613
|
+
z(ie) ? (j(), d(z(Ce), {
|
|
2614
|
+
key: 1,
|
|
2615
|
+
"url-list": z(ae),
|
|
2616
|
+
"initial-index": z(oe),
|
|
2617
|
+
onClose: z(R)
|
|
2618
|
+
}, null, 8, [
|
|
2619
|
+
"url-list",
|
|
2620
|
+
"initial-index",
|
|
2621
|
+
"onClose"
|
|
2622
|
+
])) : f("", !0),
|
|
2623
|
+
_(Qn, {
|
|
2624
|
+
visible: z(B),
|
|
2625
|
+
"onUpdate:visible": n[0] ||= (e) => ee(B) ? B.value = e : null,
|
|
2626
|
+
url: z(se),
|
|
2627
|
+
type: z(V)
|
|
2628
|
+
}, null, 8, [
|
|
2629
|
+
"visible",
|
|
2630
|
+
"url",
|
|
2631
|
+
"type"
|
|
2632
|
+
])
|
|
2633
|
+
], 2));
|
|
2634
|
+
}
|
|
2635
|
+
}), [["__scopeId", "data-v-6050c2c6"]]), gr = {
|
|
2636
|
+
Input: Zt,
|
|
2637
|
+
Text: Mn,
|
|
2638
|
+
Select: rn,
|
|
2639
|
+
SelectMultiple: On,
|
|
2640
|
+
DatePicker: qt,
|
|
2641
|
+
Radio: _n,
|
|
2642
|
+
Checkbox: Ut,
|
|
2643
|
+
InputNumber: mn,
|
|
2644
|
+
KInputNumber: mn,
|
|
2645
|
+
Cascader: Bt,
|
|
2646
|
+
TreeSelect: Hn,
|
|
2647
|
+
InputMixInput: tn,
|
|
2648
|
+
InputMixSelect: ln,
|
|
2649
|
+
RadioInput: Cn,
|
|
2650
|
+
ScrollSelect: Tn,
|
|
2651
|
+
Upload: /* @__PURE__ */ y({
|
|
2652
|
+
name: "KFormUpload",
|
|
2653
|
+
inheritAttrs: !1,
|
|
2654
|
+
__name: "Upload",
|
|
2655
|
+
props: {
|
|
2656
|
+
modelValue: {},
|
|
2657
|
+
options: {},
|
|
2658
|
+
readonly: { type: Boolean },
|
|
2659
|
+
disabled: { type: Boolean },
|
|
2660
|
+
listType: { default: "text" },
|
|
2661
|
+
action: { default: "" },
|
|
2662
|
+
limit: { default: 1 },
|
|
2663
|
+
maxSize: { default: 10 },
|
|
2664
|
+
btnText: { default: "点击上传" },
|
|
2665
|
+
templateCode: { default: "" },
|
|
2666
|
+
templateDownloadUrl: { default: "" },
|
|
2667
|
+
templateBtnText: { default: "模版下载" },
|
|
2668
|
+
fileTips: { default: "" },
|
|
2669
|
+
showSuccMessage: {
|
|
2670
|
+
type: Boolean,
|
|
2671
|
+
default: !0
|
|
2672
|
+
}
|
|
2673
|
+
},
|
|
2674
|
+
emits: ["update:modelValue"],
|
|
2675
|
+
setup(e, { emit: t }) {
|
|
2676
|
+
let n = e, r = t, i = u(() => Array.isArray(n.modelValue) ? n.modelValue : []);
|
|
2677
|
+
function a(e) {
|
|
2678
|
+
r("update:modelValue", e);
|
|
2679
|
+
}
|
|
2680
|
+
return (e, t) => (j(), d(hr, T(e.$attrs, {
|
|
2681
|
+
"model-value": i.value,
|
|
2682
|
+
"list-type": n.listType,
|
|
2683
|
+
action: n.action,
|
|
2684
|
+
limit: n.limit,
|
|
2685
|
+
"max-size": n.maxSize,
|
|
2686
|
+
disabled: n.disabled === !0 || n.readonly === !0,
|
|
2687
|
+
"btn-text": n.btnText,
|
|
2688
|
+
"template-code": n.templateCode,
|
|
2689
|
+
"template-download-url": n.templateDownloadUrl,
|
|
2690
|
+
"template-btn-text": n.templateBtnText,
|
|
2691
|
+
"file-tips": n.fileTips,
|
|
2692
|
+
"show-succ-message": n.showSuccMessage,
|
|
2693
|
+
"onUpdate:modelValue": a
|
|
2694
|
+
}), null, 16, [
|
|
2695
|
+
"model-value",
|
|
2696
|
+
"list-type",
|
|
2697
|
+
"action",
|
|
2698
|
+
"limit",
|
|
2699
|
+
"max-size",
|
|
2700
|
+
"disabled",
|
|
2701
|
+
"btn-text",
|
|
2702
|
+
"template-code",
|
|
2703
|
+
"template-download-url",
|
|
2704
|
+
"template-btn-text",
|
|
2705
|
+
"file-tips",
|
|
2706
|
+
"show-succ-message"
|
|
2707
|
+
]));
|
|
2708
|
+
}
|
|
2709
|
+
}),
|
|
2710
|
+
Tag: An,
|
|
2711
|
+
TimePicker: zn,
|
|
2712
|
+
Editor: v(() => import("./Editor-CNxCYFmc.js"))
|
|
2713
|
+
};
|
|
2714
|
+
function _r(e) {
|
|
2715
|
+
return gr[e] ?? Jt;
|
|
2716
|
+
}
|
|
2717
|
+
function vr(e) {
|
|
2718
|
+
Object.assign(gr, e);
|
|
2719
|
+
}
|
|
2720
|
+
//#endregion
|
|
2721
|
+
//#region src/components/k-form/utils/resolveFormFieldComponent.ts
|
|
2722
|
+
function yr(e) {
|
|
2723
|
+
return typeof e == "string";
|
|
2724
|
+
}
|
|
2725
|
+
function br(e) {
|
|
2726
|
+
return typeof e == "object" || typeof e == "function";
|
|
2727
|
+
}
|
|
2728
|
+
function xr(e) {
|
|
2729
|
+
return br(e) ? e : _r(e);
|
|
2730
|
+
}
|
|
2731
|
+
//#endregion
|
|
2732
|
+
//#region src/components/k-form/KFormField.vue
|
|
2733
|
+
var Sr = /* @__PURE__ */ y({
|
|
2734
|
+
name: "KFormField",
|
|
2735
|
+
__name: "KFormField",
|
|
2736
|
+
props: {
|
|
2737
|
+
item: {},
|
|
2738
|
+
modelValue: {},
|
|
2739
|
+
options: {},
|
|
2740
|
+
readonly: { type: Boolean },
|
|
2741
|
+
disabled: { type: Boolean }
|
|
2742
|
+
},
|
|
2743
|
+
emits: ["update:modelValue"],
|
|
2744
|
+
setup(e, { emit: t }) {
|
|
2745
|
+
let n = e, r = t, i = u(() => xr(n.item.component)), a = u(() => yr(n.item.component) ? n.item.component : ""), o = u(() => {
|
|
2746
|
+
let e = { ...n.item.componentProps ?? {} };
|
|
2747
|
+
return delete e.value, delete e.onChange, delete e.style, delete e.readonly, delete e.disabled, [
|
|
2748
|
+
"Complex",
|
|
2749
|
+
"ScrollSelect",
|
|
2750
|
+
"Cascader"
|
|
2751
|
+
].includes(a.value) || delete e.options, {
|
|
2752
|
+
...e,
|
|
2753
|
+
componentType: a.value
|
|
2754
|
+
};
|
|
2755
|
+
}), s = u(() => {
|
|
2756
|
+
if (![
|
|
2757
|
+
"Complex",
|
|
2758
|
+
"ScrollSelect",
|
|
2759
|
+
"Cascader"
|
|
2760
|
+
].includes(a.value)) return n.options;
|
|
2761
|
+
});
|
|
2762
|
+
function c(e) {
|
|
2763
|
+
r("update:modelValue", e);
|
|
2764
|
+
}
|
|
2765
|
+
return (t, n) => (j(), d(ae(i.value), T({
|
|
2766
|
+
"model-value": e.modelValue,
|
|
2767
|
+
options: s.value,
|
|
2768
|
+
readonly: e.readonly,
|
|
2769
|
+
disabled: e.disabled
|
|
2770
|
+
}, o.value, { "onUpdate:modelValue": c }), null, 16, [
|
|
2771
|
+
"model-value",
|
|
2772
|
+
"options",
|
|
2773
|
+
"readonly",
|
|
2774
|
+
"disabled"
|
|
2775
|
+
]));
|
|
2776
|
+
}
|
|
2777
|
+
}), Cr = ["innerHTML"], wr = /* @__PURE__ */ y({
|
|
2778
|
+
name: "KForm",
|
|
2779
|
+
inheritAttrs: !1,
|
|
2780
|
+
__name: "KForm",
|
|
2781
|
+
props: {
|
|
2782
|
+
formConfigs: {},
|
|
2783
|
+
colLength: { default: 2 },
|
|
2784
|
+
inline: {
|
|
2785
|
+
type: Boolean,
|
|
2786
|
+
default: !1
|
|
2787
|
+
},
|
|
2788
|
+
labelWidth: { default: void 0 },
|
|
2789
|
+
autoLayout: {
|
|
2790
|
+
type: Boolean,
|
|
2791
|
+
default: !1
|
|
2792
|
+
},
|
|
2793
|
+
hideLabel: {
|
|
2794
|
+
type: Boolean,
|
|
2795
|
+
default: !1
|
|
2796
|
+
},
|
|
2797
|
+
labelPosition: { default: "right" },
|
|
2798
|
+
modelValue: { default: void 0 },
|
|
2799
|
+
data: { default: () => ({}) },
|
|
2800
|
+
ignoreValidate: {
|
|
2801
|
+
type: Boolean,
|
|
2802
|
+
default: !1
|
|
2803
|
+
},
|
|
2804
|
+
readonly: {
|
|
2805
|
+
type: Boolean,
|
|
2806
|
+
default: !1
|
|
2807
|
+
}
|
|
2808
|
+
},
|
|
2809
|
+
emits: ["update:modelValue", "change"],
|
|
2810
|
+
setup(e, { expose: t, emit: n }) {
|
|
2811
|
+
let r = V(), i = e, a = n, o = B(), s = N(), l = N({});
|
|
2812
|
+
ne(Tt, l);
|
|
2813
|
+
function f(e) {
|
|
2814
|
+
if (e == null || e === "") return;
|
|
2815
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? void 0 : e;
|
|
2816
|
+
if (Array.isArray(e)) {
|
|
2817
|
+
let t = e[0];
|
|
2818
|
+
return t ? f(t) : void 0;
|
|
2819
|
+
}
|
|
2820
|
+
let t = q(e);
|
|
2821
|
+
return t.isValid() ? t.toDate() : void 0;
|
|
2822
|
+
}
|
|
2823
|
+
function v(e, t) {
|
|
2824
|
+
l.value = {
|
|
2825
|
+
...l.value,
|
|
2826
|
+
[`kitDate-${e}`]: f(t)
|
|
2827
|
+
};
|
|
2828
|
+
}
|
|
2829
|
+
function y(e) {
|
|
2830
|
+
return yr(e.component) && e.component === "DatePicker";
|
|
2831
|
+
}
|
|
2832
|
+
let b = u(() => ({
|
|
2833
|
+
colLength: i.colLength,
|
|
2834
|
+
inline: i.inline,
|
|
2835
|
+
labelWidth: x.value,
|
|
2836
|
+
labelPosition: i.labelPosition,
|
|
2837
|
+
autoLayout: i.autoLayout,
|
|
2838
|
+
hideLabel: i.hideLabel
|
|
2839
|
+
})), x = u(() => i.labelWidth ? i.labelWidth : i.autoLayout ? "120px" : "110px"), S = u(() => ({
|
|
2840
|
+
"k-form--inline-layout": i.inline,
|
|
2841
|
+
"k-form--query-layout": i.autoLayout,
|
|
2842
|
+
"k-form--grid-layout": !i.autoLayout && !i.inline
|
|
2843
|
+
})), ee = u(() => ({ "--k-form-cols": String(i.colLength) })), C = u(() => i.modelValue !== void 0), w = wt({
|
|
2844
|
+
formConfigs: L(i, "formConfigs"),
|
|
2845
|
+
data: L(i, "data"),
|
|
2846
|
+
modelValue: L(i, "modelValue"),
|
|
2847
|
+
controlled: C,
|
|
2848
|
+
onChange: (e) => {
|
|
2849
|
+
a("change", e), C.value && a("update:modelValue", e);
|
|
2850
|
+
}
|
|
2851
|
+
});
|
|
2852
|
+
function te() {
|
|
2853
|
+
let e = {};
|
|
2854
|
+
i.formConfigs.forEach((t) => {
|
|
2855
|
+
y(t) && (e[`kitDate-${t.id}`] = f(w.formModel[t.id]));
|
|
2856
|
+
}), l.value = e;
|
|
2857
|
+
}
|
|
2858
|
+
let { normalizedConfigs: k, getFieldOptions: A, resolveItemRules: M, itemStyle: re, itemDisplay: ie, isItemReadonly: ae, isItemDisabled: oe } = vt({
|
|
2859
|
+
formConfigs: L(i, "formConfigs"),
|
|
2860
|
+
layout: b,
|
|
2861
|
+
formReadonly: L(i, "readonly")
|
|
2862
|
+
});
|
|
2863
|
+
U(() => i.formConfigs, () => te(), {
|
|
2864
|
+
immediate: !0,
|
|
2865
|
+
deep: !0
|
|
2866
|
+
}), U(() => w.formModel, () => te(), { deep: !0 });
|
|
2867
|
+
function R(e) {
|
|
2868
|
+
let t = ie(e);
|
|
2869
|
+
return {
|
|
2870
|
+
...re(e),
|
|
2871
|
+
...t ? { display: t } : {}
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2874
|
+
let se = u(() => {
|
|
2875
|
+
let e = { ...o };
|
|
2876
|
+
return delete e.readonly, {
|
|
2877
|
+
inline: i.inline && !i.autoLayout,
|
|
2878
|
+
labelWidth: x.value,
|
|
2879
|
+
labelPosition: i.labelPosition ?? "right",
|
|
2880
|
+
...e
|
|
2881
|
+
};
|
|
2882
|
+
});
|
|
2883
|
+
function H(e, t) {
|
|
2884
|
+
w.updateFieldValue(e, t), y(e) && v(e.id, t), ce(e);
|
|
2885
|
+
}
|
|
2886
|
+
function ce(e) {
|
|
2887
|
+
if (!s.value) return;
|
|
2888
|
+
let t = e.validatePeers ?? [], n = M(e).length > 0;
|
|
2889
|
+
!n && !t.length || E(() => {
|
|
2890
|
+
n && s.value?.validateField(e.id).catch(() => {});
|
|
2891
|
+
for (let e of t) s.value?.validateField(e).catch(() => {});
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2894
|
+
async function le() {
|
|
2895
|
+
let e = w.getVisibleFieldsValue();
|
|
2896
|
+
if (!s.value) return e;
|
|
2897
|
+
try {
|
|
2898
|
+
return await s.value.validate() === !1 ? i.ignoreValidate ? (s.value.clearValidate(), e) : (de(), null) : e;
|
|
2899
|
+
} catch {
|
|
2900
|
+
return i.ignoreValidate ? (s.value.clearValidate(), e) : (de(), null);
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
function de() {
|
|
2904
|
+
((s.value?.$el)?.querySelector(".el-form-item.is-error") ?? document.querySelector(".k-form .el-form-item.is-error"))?.scrollIntoView({
|
|
2905
|
+
block: "center",
|
|
2906
|
+
behavior: "smooth"
|
|
2907
|
+
});
|
|
2908
|
+
}
|
|
2909
|
+
function fe(e) {
|
|
2910
|
+
return w.getFieldsValue(e);
|
|
2911
|
+
}
|
|
2912
|
+
function pe() {
|
|
2913
|
+
return w.getVisibleFieldsValue();
|
|
2914
|
+
}
|
|
2915
|
+
function me(e) {
|
|
2916
|
+
w.setFieldsValue(e);
|
|
2917
|
+
}
|
|
2918
|
+
function he() {
|
|
2919
|
+
s.value?.resetFields(), w.resetFormModel();
|
|
2920
|
+
}
|
|
2921
|
+
function ge(e) {
|
|
2922
|
+
w.resetFieldsValue(e), e.forEach((e) => s.value?.clearValidate(e));
|
|
2923
|
+
}
|
|
2924
|
+
function _e() {
|
|
2925
|
+
s.value?.clearValidate();
|
|
2926
|
+
}
|
|
2927
|
+
function ve() {
|
|
2928
|
+
return s.value;
|
|
2929
|
+
}
|
|
2930
|
+
return t({
|
|
2931
|
+
validateFields: le,
|
|
2932
|
+
getFieldsValue: fe,
|
|
2933
|
+
getParams: pe,
|
|
2934
|
+
setFieldsValue: me,
|
|
2935
|
+
resetForm: he,
|
|
2936
|
+
resetFieldsValue: ge,
|
|
2937
|
+
getFormRef: ve,
|
|
2938
|
+
clearValidate: _e
|
|
2939
|
+
}), (e, t) => (j(), d(z(be), T({
|
|
2940
|
+
ref_key: "formRef",
|
|
2941
|
+
ref: s,
|
|
2942
|
+
class: ["k-form", S.value],
|
|
2943
|
+
style: ee.value,
|
|
2944
|
+
model: z(w).formModel
|
|
2945
|
+
}, se.value, { onSubmit: t[0] ||= ue(() => {}, ["prevent"]) }), {
|
|
2946
|
+
default: W(() => [(j(!0), p(c, null, P(z(k), (n) => (j(), d(z(xe), {
|
|
2947
|
+
key: n.id,
|
|
2948
|
+
"data-label": n.label || "",
|
|
2949
|
+
"data-field-id": n.id,
|
|
2950
|
+
label: n.label ? `${n.label}:` : void 0,
|
|
2951
|
+
prop: n.id,
|
|
2952
|
+
rules: z(M)(n),
|
|
2953
|
+
class: D(["k-form__item", [n.class, {
|
|
2954
|
+
"k-form__item--readonly": z(ae)(n),
|
|
2955
|
+
"k-form__item--disabled": z(oe)(n),
|
|
2956
|
+
"k-form__item--full-row": n.newLineStart,
|
|
2957
|
+
"k-form__item--choice": z(yr)(n.component) && (n.component === "Radio" || n.component === "Checkbox" || n.component === "Tag")
|
|
2958
|
+
}]]),
|
|
2959
|
+
style: O(R(n))
|
|
2960
|
+
}, h({
|
|
2961
|
+
default: W(() => [!n.slot || !z(r)[n.id] ? (j(), d(Sr, {
|
|
2962
|
+
key: 0,
|
|
2963
|
+
item: n,
|
|
2964
|
+
"model-value": z(w).formModel[n.id],
|
|
2965
|
+
options: z(A)(n),
|
|
2966
|
+
readonly: z(ae)(n),
|
|
2967
|
+
disabled: z(oe)(n),
|
|
2968
|
+
"onUpdate:modelValue": (e) => H(n, e)
|
|
2969
|
+
}, null, 8, [
|
|
2970
|
+
"item",
|
|
2971
|
+
"model-value",
|
|
2972
|
+
"options",
|
|
2973
|
+
"readonly",
|
|
2974
|
+
"disabled",
|
|
2975
|
+
"onUpdate:modelValue"
|
|
2976
|
+
])) : F(e.$slots, n.id, {
|
|
2977
|
+
item: n,
|
|
2978
|
+
value: z(w).formModel[n.id],
|
|
2979
|
+
updateValue: (e) => H(n, e)
|
|
2980
|
+
}, void 0, void 0, 1)]),
|
|
2981
|
+
_: 2
|
|
2982
|
+
}, [n.toolTip ? {
|
|
2983
|
+
name: "label",
|
|
2984
|
+
fn: W(() => [_(z(Re), {
|
|
2985
|
+
effect: "dark",
|
|
2986
|
+
placement: "bottom",
|
|
2987
|
+
"popper-class": "k-form__tooltip"
|
|
2988
|
+
}, {
|
|
2989
|
+
content: W(() => [m("span", { innerHTML: n.toolTip }, null, 8, Cr)]),
|
|
2990
|
+
default: W(() => [t[1] ||= m("span", {
|
|
2991
|
+
class: "k-form__tip-icon",
|
|
2992
|
+
"aria-hidden": "true"
|
|
2993
|
+
}, "i", -1)]),
|
|
2994
|
+
_: 2
|
|
2995
|
+
}, 1024), g(" " + I(n.label ? `${n.label}:` : ""), 1)]),
|
|
2996
|
+
key: "0"
|
|
2997
|
+
} : void 0]), 1032, [
|
|
2998
|
+
"data-label",
|
|
2999
|
+
"data-field-id",
|
|
3000
|
+
"label",
|
|
3001
|
+
"prop",
|
|
3002
|
+
"rules",
|
|
3003
|
+
"class",
|
|
3004
|
+
"style"
|
|
3005
|
+
]))), 128)), F(e.$slots, "default")]),
|
|
3006
|
+
_: 3
|
|
3007
|
+
}, 16, [
|
|
3008
|
+
"class",
|
|
3009
|
+
"style",
|
|
3010
|
+
"model"
|
|
3011
|
+
]));
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
3014
|
+
//#endregion
|
|
3015
|
+
//#region src/components/k-form/composables/useKFormTemplateRef.ts
|
|
3016
|
+
function Tr(e) {
|
|
3017
|
+
return H(e);
|
|
3018
|
+
}
|
|
3019
|
+
//#endregion
|
|
3020
|
+
//#region src/components/k-handle-page/KHandlePage.vue?vue&type=script&setup=true&lang.ts
|
|
3021
|
+
var Er = { class: "k-handle-page" }, Dr = {
|
|
3022
|
+
key: 0,
|
|
3023
|
+
class: "k-handle-page__header"
|
|
3024
|
+
}, Or = { class: "k-handle-page__body" }, kr = {
|
|
3025
|
+
key: 0,
|
|
3026
|
+
class: "k-handle-page__loading",
|
|
3027
|
+
role: "status",
|
|
3028
|
+
"aria-live": "polite",
|
|
3029
|
+
"aria-busy": "true",
|
|
3030
|
+
"aria-label": "加载中"
|
|
3031
|
+
}, Ar = { class: "k-handle-page__loading-inner" }, jr = {
|
|
3032
|
+
key: 1,
|
|
3033
|
+
class: "k-handle-page__footer"
|
|
3034
|
+
}, Mr = /* @__PURE__ */ y({
|
|
3035
|
+
name: "KHandlePage",
|
|
3036
|
+
inheritAttrs: !1,
|
|
3037
|
+
__name: "KHandlePage",
|
|
3038
|
+
props: {
|
|
3039
|
+
showFooter: {
|
|
3040
|
+
type: Boolean,
|
|
3041
|
+
default: !0
|
|
3042
|
+
},
|
|
3043
|
+
showSubmit: {
|
|
3044
|
+
type: Boolean,
|
|
3045
|
+
default: !0
|
|
3046
|
+
},
|
|
3047
|
+
cancelText: {
|
|
3048
|
+
type: [String, Boolean],
|
|
3049
|
+
default: "取消"
|
|
3050
|
+
},
|
|
3051
|
+
submitText: {
|
|
3052
|
+
type: [String, Boolean],
|
|
3053
|
+
default: "确定"
|
|
3054
|
+
},
|
|
3055
|
+
submitLoading: {
|
|
3056
|
+
type: Boolean,
|
|
3057
|
+
default: !1
|
|
3058
|
+
},
|
|
3059
|
+
loading: {
|
|
3060
|
+
type: Boolean,
|
|
3061
|
+
default: !1
|
|
3062
|
+
},
|
|
3063
|
+
onSubmit: {
|
|
3064
|
+
type: Function,
|
|
3065
|
+
default: void 0
|
|
3066
|
+
},
|
|
3067
|
+
gap: { default: 16 }
|
|
3068
|
+
},
|
|
3069
|
+
emits: ["cancel", "submit"],
|
|
3070
|
+
setup(e, { emit: t }) {
|
|
3071
|
+
let n = e, r = t, i = V(), a = N(!1), o = u(() => ({ gap: typeof n.gap == "number" ? `${n.gap}px` : n.gap })), s = u(() => n.cancelText === !1 ? "" : n.cancelText || "取消"), c = u(() => n.submitText === !1 ? "" : n.submitText || "确定"), h = u(() => n.cancelText !== !1), v = u(() => n.showSubmit && n.submitText !== !1), y = u(() => n.submitLoading || n.loading || a.value), b = u(() => !!i.header);
|
|
3072
|
+
async function x() {
|
|
3073
|
+
if (!y.value) {
|
|
3074
|
+
if (n.onSubmit) {
|
|
3075
|
+
a.value = !0;
|
|
3076
|
+
try {
|
|
3077
|
+
await n.onSubmit();
|
|
3078
|
+
} catch {} finally {
|
|
3079
|
+
a.value = !1;
|
|
3080
|
+
}
|
|
3081
|
+
return;
|
|
3082
|
+
}
|
|
3083
|
+
r("submit");
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
return (t, n) => (j(), p("div", Er, [
|
|
3087
|
+
b.value ? (j(), p("header", Dr, [F(t.$slots, "header")])) : f("", !0),
|
|
3088
|
+
m("div", Or, [_(l, { name: "k-handle-page-loading" }, {
|
|
3089
|
+
default: W(() => [e.loading ? (j(), p("div", kr, [m("div", Ar, [_(z(Se), {
|
|
3090
|
+
class: "k-handle-page__loading-icon is-loading",
|
|
3091
|
+
size: 32
|
|
3092
|
+
}, {
|
|
3093
|
+
default: W(() => [_(z(Ke))]),
|
|
3094
|
+
_: 1
|
|
3095
|
+
}), n[1] ||= m("span", { class: "k-handle-page__loading-text" }, "加载中...", -1)])])) : f("", !0)]),
|
|
3096
|
+
_: 1
|
|
3097
|
+
}), m("div", {
|
|
3098
|
+
class: D(["k-handle-page__content", { "k-handle-page__content--loading": e.loading }]),
|
|
3099
|
+
style: O(o.value)
|
|
3100
|
+
}, [F(t.$slots, "default")], 6)]),
|
|
3101
|
+
e.showFooter ? (j(), p("footer", jr, [F(t.$slots, "footer", {}, () => [h.value ? (j(), d(Y, {
|
|
3102
|
+
key: 0,
|
|
3103
|
+
onClick: n[0] ||= (e) => r("cancel")
|
|
3104
|
+
}, {
|
|
3105
|
+
default: W(() => [g(I(s.value), 1)]),
|
|
3106
|
+
_: 1
|
|
3107
|
+
})) : f("", !0), v.value ? (j(), d(Y, {
|
|
3108
|
+
key: 1,
|
|
3109
|
+
type: "primary",
|
|
3110
|
+
loading: y.value,
|
|
3111
|
+
onClick: x
|
|
3112
|
+
}, {
|
|
3113
|
+
default: W(() => [g(I(c.value), 1)]),
|
|
3114
|
+
_: 1
|
|
3115
|
+
}, 8, ["loading"])) : f("", !0)])])) : f("", !0)
|
|
3116
|
+
]));
|
|
3117
|
+
}
|
|
3118
|
+
});
|
|
3119
|
+
//#endregion
|
|
3120
|
+
//#region src/components/k-handle-page/useHandlePageInit.ts
|
|
3121
|
+
function Nr(e, t) {
|
|
3122
|
+
let n = N(!1);
|
|
3123
|
+
async function r() {
|
|
3124
|
+
(R(t?.skipLoading) ?? !1) || (n.value = !0);
|
|
3125
|
+
try {
|
|
3126
|
+
await e();
|
|
3127
|
+
} finally {
|
|
3128
|
+
n.value = !1;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
return t?.immediate !== !1 && A(() => {
|
|
3132
|
+
r();
|
|
3133
|
+
}), {
|
|
3134
|
+
pageLoading: n,
|
|
3135
|
+
runInit: r
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
//#endregion
|
|
3139
|
+
//#region src/components/k-icon/resolveLucideIcon.ts
|
|
3140
|
+
var Pr = /* @__PURE__ */ new Map();
|
|
3141
|
+
function Fr(e) {
|
|
3142
|
+
return e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
3143
|
+
}
|
|
3144
|
+
function Ir(e) {
|
|
3145
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
3146
|
+
}
|
|
3147
|
+
function Lr(e) {
|
|
3148
|
+
if (!e || e === "#") return tt(e);
|
|
3149
|
+
let t = e.trim();
|
|
3150
|
+
if (Pr.has(t)) return Pr.get(t) ?? tt(e);
|
|
3151
|
+
let n = Xe[Fr(t)], r = typeof n == "function" ? n : null;
|
|
3152
|
+
return Pr.set(t, r), r ?? tt(e);
|
|
3153
|
+
}
|
|
3154
|
+
var Rr = /* @__PURE__ */ new Set(["createLucideIcon"]), zr = null;
|
|
3155
|
+
function Br() {
|
|
3156
|
+
if (zr) return zr;
|
|
3157
|
+
let e = /* @__PURE__ */ new Set(), t = [];
|
|
3158
|
+
for (let [n, r] of Object.entries(Xe)) Rr.has(n) || n.endsWith("Icon") || typeof r == "function" && (e.has(r) || (e.add(r), t.push(Ir(n))));
|
|
3159
|
+
return zr = t.sort((e, t) => e.localeCompare(t)), zr;
|
|
3160
|
+
}
|
|
3161
|
+
//#endregion
|
|
3162
|
+
//#region src/components/k-icon/KIcon.vue
|
|
3163
|
+
var Vr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3164
|
+
name: "KIcon",
|
|
3165
|
+
__name: "KIcon",
|
|
3166
|
+
props: {
|
|
3167
|
+
name: { default: "" },
|
|
3168
|
+
size: { default: 18 },
|
|
3169
|
+
strokeWidth: { default: 2 }
|
|
3170
|
+
},
|
|
3171
|
+
setup(e) {
|
|
3172
|
+
let t = e, n = u(() => Lr(t.name));
|
|
3173
|
+
return (t, r) => n.value ? (j(), d(ae(n.value), {
|
|
3174
|
+
key: 0,
|
|
3175
|
+
class: "k-icon",
|
|
3176
|
+
size: e.size,
|
|
3177
|
+
"stroke-width": e.strokeWidth
|
|
3178
|
+
}, null, 8, ["size", "stroke-width"])) : f("", !0);
|
|
3179
|
+
}
|
|
3180
|
+
}), [["__scopeId", "data-v-6fd081ab"]]), Hr = { class: "k-link-button__item" }, Ur = {
|
|
3181
|
+
key: 0,
|
|
3182
|
+
class: "k-link-button__divider"
|
|
3183
|
+
}, Wr = ["onClick"], Gr = /* @__PURE__ */ y({
|
|
3184
|
+
name: "KLinkButton",
|
|
3185
|
+
__name: "KLinkButton",
|
|
3186
|
+
props: {
|
|
3187
|
+
data: { default: () => [] },
|
|
3188
|
+
disabled: {
|
|
3189
|
+
type: Boolean,
|
|
3190
|
+
default: !1
|
|
3191
|
+
},
|
|
3192
|
+
align: { default: "center" },
|
|
3193
|
+
tableMode: {
|
|
3194
|
+
type: Boolean,
|
|
3195
|
+
default: !1
|
|
3196
|
+
}
|
|
3197
|
+
},
|
|
3198
|
+
emits: ["click"],
|
|
3199
|
+
setup(e, { emit: t }) {
|
|
3200
|
+
let n = e, r = t, i = u(() => n.data.filter((e) => e.isDisplay !== !1));
|
|
3201
|
+
function a(e) {
|
|
3202
|
+
return n.disabled && e.label !== "查看";
|
|
3203
|
+
}
|
|
3204
|
+
function o(e) {
|
|
3205
|
+
return e.style ? `k-link-button__btn--${e.style}` : "";
|
|
3206
|
+
}
|
|
3207
|
+
function s(e, t) {
|
|
3208
|
+
a(e) || (r("click", e, t), !n.tableMode && e.onClick && e.onClick({}, t));
|
|
3209
|
+
}
|
|
3210
|
+
function l(e) {
|
|
3211
|
+
return !!e.slot;
|
|
3212
|
+
}
|
|
3213
|
+
function h(e) {
|
|
3214
|
+
return typeof e.slot == "string" ? e.slot : "default";
|
|
3215
|
+
}
|
|
3216
|
+
return (t, n) => (j(), p("div", {
|
|
3217
|
+
class: "k-link-button",
|
|
3218
|
+
style: O({ justifyContent: e.align })
|
|
3219
|
+
}, [(j(!0), p(c, null, P(i.value, (e, n) => (j(), d(z(Re), {
|
|
3220
|
+
key: `${e.label}-${n}`,
|
|
3221
|
+
content: e.tooltip,
|
|
3222
|
+
placement: "top",
|
|
3223
|
+
disabled: !e.tooltip
|
|
3224
|
+
}, {
|
|
3225
|
+
default: W(() => [m("div", Hr, [n > 0 ? (j(), p("span", Ur)) : f("", !0), m("a", {
|
|
3226
|
+
class: D(["k-link-button__btn", [o(e), { "k-link-button__btn--readonly": a(e) }]]),
|
|
3227
|
+
onClick: ue((t) => s(e, n), ["prevent"])
|
|
3228
|
+
}, [l(e) ? F(t.$slots, h(e), { item: e }, () => [g(I(e.label), 1)], void 0, 0) : (j(), p(c, { key: 1 }, [g(I(e.label), 1)], 64))], 10, Wr)])]),
|
|
3229
|
+
_: 2
|
|
3230
|
+
}, 1032, ["content", "disabled"]))), 128))], 4));
|
|
3231
|
+
}
|
|
3232
|
+
}), Kr = /* @__PURE__ */ y({
|
|
3233
|
+
name: "KPagination",
|
|
3234
|
+
__name: "KPagination",
|
|
3235
|
+
props: {
|
|
3236
|
+
layout: { default: "total, sizes, prev, pager, next, jumper" },
|
|
3237
|
+
pageSize: { default: 10 },
|
|
3238
|
+
pageSizes: { default: () => [
|
|
3239
|
+
10,
|
|
3240
|
+
20,
|
|
3241
|
+
30,
|
|
3242
|
+
40,
|
|
3243
|
+
50,
|
|
3244
|
+
60,
|
|
3245
|
+
70,
|
|
3246
|
+
80,
|
|
3247
|
+
90,
|
|
3248
|
+
100
|
|
3249
|
+
] }
|
|
3250
|
+
},
|
|
3251
|
+
setup(e) {
|
|
3252
|
+
return (t, n) => (j(), d(z(Oe), T(t.$attrs, {
|
|
3253
|
+
layout: e.layout,
|
|
3254
|
+
"page-size": e.pageSize,
|
|
3255
|
+
"page-sizes": e.pageSizes
|
|
3256
|
+
}), null, 16, [
|
|
3257
|
+
"layout",
|
|
3258
|
+
"page-size",
|
|
3259
|
+
"page-sizes"
|
|
3260
|
+
]));
|
|
3261
|
+
}
|
|
3262
|
+
}), qr = ["id"], Jr = { class: "k-long-page-panel__title" }, Yr = { class: "k-long-page-panel__content" }, Xr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3263
|
+
name: "KLongPagePanel",
|
|
3264
|
+
__name: "KLongPagePanel",
|
|
3265
|
+
props: {
|
|
3266
|
+
panelId: { default: "" },
|
|
3267
|
+
title: { default: "" }
|
|
3268
|
+
},
|
|
3269
|
+
setup(e) {
|
|
3270
|
+
return (t, n) => (j(), p("div", {
|
|
3271
|
+
id: e.panelId || void 0,
|
|
3272
|
+
class: "k-long-page-panel"
|
|
3273
|
+
}, [m("div", Jr, I(e.title), 1), m("div", Yr, [F(t.$slots, "default", {}, void 0, !0)])], 8, qr));
|
|
3274
|
+
}
|
|
3275
|
+
}), [["__scopeId", "data-v-9d6e7832"]]), Zr = 4;
|
|
3276
|
+
function Qr(e) {
|
|
3277
|
+
let t = 0, n = 0, r = !1, i = !1, a = null;
|
|
3278
|
+
function o(o) {
|
|
3279
|
+
if (!r || !e.value || o.pointerId !== a) return;
|
|
3280
|
+
let s = o.clientY - t;
|
|
3281
|
+
if (!i && Math.abs(s) < Zr) return;
|
|
3282
|
+
i = !0, o.preventDefault();
|
|
3283
|
+
let c = Math.min(Math.max(n + s, 0), window.innerHeight - e.value.offsetHeight);
|
|
3284
|
+
e.value.style.top = `${c}px`;
|
|
3285
|
+
}
|
|
3286
|
+
function s() {
|
|
3287
|
+
r = !1, a = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c);
|
|
3288
|
+
}
|
|
3289
|
+
function c() {
|
|
3290
|
+
s();
|
|
3291
|
+
}
|
|
3292
|
+
function l(s) {
|
|
3293
|
+
!e.value || s.button !== 0 || (r = !0, i = !1, a = s.pointerId, t = s.clientY, n = e.value.getBoundingClientRect().top, window.addEventListener("pointermove", o), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c));
|
|
3294
|
+
}
|
|
3295
|
+
function u() {
|
|
3296
|
+
return i ? (i = !1, !0) : !1;
|
|
3297
|
+
}
|
|
3298
|
+
return k(s), {
|
|
3299
|
+
onPointerDown: l,
|
|
3300
|
+
consumeClickIfDragged: u
|
|
3301
|
+
};
|
|
3302
|
+
}
|
|
3303
|
+
//#endregion
|
|
3304
|
+
//#region src/components/k-long-page/icons/icon-base.png?no-inline
|
|
3305
|
+
var $r = "" + new URL("../assets/icon-base-pYrXWQZO.png", import.meta.url).href, ei = "" + new URL("../assets/icon-base-2-CcPa4bmO.png", import.meta.url).href, ti = "" + new URL("../assets/icon-notice-DNvEYor3.png", import.meta.url).href, ni = "" + new URL("../assets/icon-notice-2-JVyxpYo9.png", import.meta.url).href, ri = "" + new URL("../assets/icon-price-4iIa0b5D.png", import.meta.url).href, ii = "" + new URL("../assets/icon-price-2-DMmEoFbh.png", import.meta.url).href, ai = "" + new URL("../assets/icon-restrict-BWJ7LA9s.png", import.meta.url).href, oi = "" + new URL("../assets/icon-restrict-2-BjWtoOXX.png", import.meta.url).href, si = "" + new URL("../assets/icon-setup-DXpIP63L.png", import.meta.url).href, ci = "" + new URL("../assets/icon-setup-2-BO6uKRX4.png", import.meta.url).href, li = {
|
|
3306
|
+
base: [$r, ei],
|
|
3307
|
+
price: [ri, ii],
|
|
3308
|
+
notice: [ti, ni],
|
|
3309
|
+
setup: [si, ci],
|
|
3310
|
+
restrict: [ai, oi]
|
|
3311
|
+
};
|
|
3312
|
+
function ui(e) {
|
|
3313
|
+
return li[e] ?? li.base;
|
|
3314
|
+
}
|
|
3315
|
+
//#endregion
|
|
3316
|
+
//#region src/components/k-long-page/KLongPage.vue?vue&type=script&setup=true&lang.ts
|
|
3317
|
+
var di = ["onClick"], fi = ["src", "alt"], pi = ["src", "alt"], mi = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3318
|
+
name: "KLongPage",
|
|
3319
|
+
__name: "KLongPage",
|
|
3320
|
+
props: { panels: { default: () => [{
|
|
3321
|
+
name: "1",
|
|
3322
|
+
label: "面板一"
|
|
3323
|
+
}] } },
|
|
3324
|
+
setup(e) {
|
|
3325
|
+
let t = H("rootRef"), n = H("navRef"), { onPointerDown: r, consumeClickIfDragged: i } = Qr(n);
|
|
3326
|
+
function a(e) {
|
|
3327
|
+
return ui(e);
|
|
3328
|
+
}
|
|
3329
|
+
async function o(e) {
|
|
3330
|
+
if (i()) return;
|
|
3331
|
+
await E();
|
|
3332
|
+
let n = t.value?.querySelector(`#${CSS.escape(e)}`);
|
|
3333
|
+
(n?.querySelector(".k-long-page-panel__title") ?? n)?.scrollIntoView({
|
|
3334
|
+
block: "start",
|
|
3335
|
+
behavior: "smooth"
|
|
3336
|
+
});
|
|
3337
|
+
}
|
|
3338
|
+
return (i, s) => (j(), p("div", {
|
|
3339
|
+
ref_key: "rootRef",
|
|
3340
|
+
ref: t,
|
|
3341
|
+
class: "k-long-page"
|
|
3342
|
+
}, [(j(!0), p(c, null, P(e.panels, (e) => (j(), d(Xr, {
|
|
3343
|
+
key: e.name,
|
|
3344
|
+
class: "k-long-page__panel",
|
|
3345
|
+
"panel-id": e.name,
|
|
3346
|
+
title: e.label
|
|
3347
|
+
}, {
|
|
3348
|
+
default: W(() => [F(i.$slots, e.name, {}, void 0, !0)]),
|
|
3349
|
+
_: 2
|
|
3350
|
+
}, 1032, ["panel-id", "title"]))), 128)), m("div", {
|
|
3351
|
+
ref_key: "navRef",
|
|
3352
|
+
ref: n,
|
|
3353
|
+
class: "k-long-page__nav",
|
|
3354
|
+
onPointerdown: s[0] ||= (...e) => z(r) && z(r)(...e)
|
|
3355
|
+
}, [(j(!0), p(c, null, P(e.panels, (e) => (j(), p("div", {
|
|
3356
|
+
key: e.name,
|
|
3357
|
+
class: "k-long-page__nav-item",
|
|
3358
|
+
role: "button",
|
|
3359
|
+
tabindex: "0",
|
|
3360
|
+
onClick: (t) => o(e.name)
|
|
3361
|
+
}, [
|
|
3362
|
+
m("img", {
|
|
3363
|
+
class: "k-long-page__nav-item-icon k-long-page__nav-item-icon--default",
|
|
3364
|
+
src: a(e.name)[0],
|
|
3365
|
+
alt: e.label,
|
|
3366
|
+
width: "28",
|
|
3367
|
+
height: "28",
|
|
3368
|
+
draggable: "false"
|
|
3369
|
+
}, null, 8, fi),
|
|
3370
|
+
m("img", {
|
|
3371
|
+
class: "k-long-page__nav-item-icon k-long-page__nav-item-icon--active",
|
|
3372
|
+
src: a(e.name)[1],
|
|
3373
|
+
alt: e.label,
|
|
3374
|
+
width: "28",
|
|
3375
|
+
height: "28",
|
|
3376
|
+
draggable: "false"
|
|
3377
|
+
}, null, 8, pi),
|
|
3378
|
+
m("span", null, I(e.label), 1)
|
|
3379
|
+
], 8, di))), 128))], 544)], 512));
|
|
3380
|
+
}
|
|
3381
|
+
}), [["__scopeId", "data-v-ac934c5d"]]), hi = /* @__PURE__ */ y({
|
|
3382
|
+
name: "KCard",
|
|
3383
|
+
__name: "KCard",
|
|
3384
|
+
setup(e) {
|
|
3385
|
+
return (e, t) => (j(), d(z(fe), te(b(e.$attrs)), h({
|
|
3386
|
+
default: W(() => [F(e.$slots, "default")]),
|
|
3387
|
+
_: 2
|
|
3388
|
+
}, [e.$slots.header ? {
|
|
3389
|
+
name: "header",
|
|
3390
|
+
fn: W(() => [F(e.$slots, "header")]),
|
|
3391
|
+
key: "0"
|
|
3392
|
+
} : void 0, e.$slots.footer ? {
|
|
3393
|
+
name: "footer",
|
|
3394
|
+
fn: W(() => [F(e.$slots, "footer")]),
|
|
3395
|
+
key: "1"
|
|
3396
|
+
} : void 0]), 1040));
|
|
3397
|
+
}
|
|
3398
|
+
}), gi = {
|
|
3399
|
+
key: 0,
|
|
3400
|
+
class: "panel-head"
|
|
3401
|
+
}, _i = { class: "panel-head_left" }, vi = { class: "panel-content" }, yi = /* @__PURE__ */ y({
|
|
3402
|
+
name: "KPanel",
|
|
3403
|
+
__name: "KPanel",
|
|
3404
|
+
props: {
|
|
3405
|
+
title: {},
|
|
3406
|
+
isFold: {
|
|
3407
|
+
type: Boolean,
|
|
3408
|
+
default: !1
|
|
3409
|
+
},
|
|
3410
|
+
unfold: {
|
|
3411
|
+
type: Boolean,
|
|
3412
|
+
default: !0
|
|
3413
|
+
},
|
|
3414
|
+
hover: {
|
|
3415
|
+
type: Boolean,
|
|
3416
|
+
default: !0
|
|
3417
|
+
}
|
|
3418
|
+
},
|
|
3419
|
+
setup(e) {
|
|
3420
|
+
let t = e, n = N(t.unfold ? ["content"] : []), r = u(() => ({
|
|
3421
|
+
panel: !0,
|
|
3422
|
+
"panel-hover": t.hover
|
|
3423
|
+
}));
|
|
3424
|
+
return (t, i) => (j(), p("div", { class: D(r.value) }, [e.isFold ? (j(), d(z(ge), {
|
|
3425
|
+
key: 0,
|
|
3426
|
+
modelValue: n.value,
|
|
3427
|
+
"onUpdate:modelValue": i[0] ||= (e) => n.value = e
|
|
3428
|
+
}, {
|
|
3429
|
+
default: W(() => [_(z(_e), {
|
|
3430
|
+
name: "content",
|
|
3431
|
+
title: e.title
|
|
3432
|
+
}, {
|
|
3433
|
+
default: W(() => [F(t.$slots, "default")]),
|
|
3434
|
+
_: 3
|
|
3435
|
+
}, 8, ["title"])]),
|
|
3436
|
+
_: 3
|
|
3437
|
+
}, 8, ["modelValue"])) : (j(), p(c, { key: 1 }, [e.title || t.$slots.title ? (j(), p("div", gi, [m("div", _i, [F(t.$slots, "title", {}, () => [g(I(e.title), 1)])])])) : f("", !0), m("div", vi, [F(t.$slots, "default")])], 64))], 2));
|
|
3438
|
+
}
|
|
3439
|
+
}), bi = {
|
|
3440
|
+
key: 0,
|
|
3441
|
+
class: "k-panel-query__footer"
|
|
3442
|
+
}, xi = /* @__PURE__ */ y({
|
|
3443
|
+
name: "KPanelQueryActions",
|
|
3444
|
+
__name: "KPanelQueryActions",
|
|
3445
|
+
props: { footer: {
|
|
3446
|
+
type: Boolean,
|
|
3447
|
+
default: !1
|
|
3448
|
+
} },
|
|
3449
|
+
emits: ["query", "reset"],
|
|
3450
|
+
setup(e, { emit: t }) {
|
|
3451
|
+
let n = t;
|
|
3452
|
+
return (t, r) => e.footer ? (j(), p("div", bi, [_(Y, {
|
|
3453
|
+
type: "primary",
|
|
3454
|
+
onClick: r[0] ||= (e) => n("query")
|
|
3455
|
+
}, {
|
|
3456
|
+
default: W(() => [...r[4] ||= [g("查询", -1)]]),
|
|
3457
|
+
_: 1
|
|
3458
|
+
}), _(Y, {
|
|
3459
|
+
class: "k-panel-query__btn-reset",
|
|
3460
|
+
onClick: r[1] ||= (e) => n("reset")
|
|
3461
|
+
}, {
|
|
3462
|
+
default: W(() => [...r[5] ||= [g("重置", -1)]]),
|
|
3463
|
+
_: 1
|
|
3464
|
+
})])) : (j(), p(c, { key: 1 }, [_(Y, {
|
|
3465
|
+
type: "primary",
|
|
3466
|
+
onClick: r[2] ||= (e) => n("query")
|
|
3467
|
+
}, {
|
|
3468
|
+
default: W(() => [...r[6] ||= [g("查询", -1)]]),
|
|
3469
|
+
_: 1
|
|
3470
|
+
}), _(Y, {
|
|
3471
|
+
class: "k-panel-query__btn-reset",
|
|
3472
|
+
onClick: r[3] ||= (e) => n("reset")
|
|
3473
|
+
}, {
|
|
3474
|
+
default: W(() => [...r[7] ||= [g("重置", -1)]]),
|
|
3475
|
+
_: 1
|
|
3476
|
+
})], 64));
|
|
3477
|
+
}
|
|
3478
|
+
}), Si = /* @__PURE__ */ y({
|
|
3479
|
+
name: "KPanelQueryForm",
|
|
3480
|
+
__name: "KPanelQueryForm",
|
|
3481
|
+
props: {
|
|
3482
|
+
formConfigs: {},
|
|
3483
|
+
colLength: { default: 3 },
|
|
3484
|
+
inline: {
|
|
3485
|
+
type: Boolean,
|
|
3486
|
+
default: !0
|
|
3487
|
+
},
|
|
3488
|
+
labelWidth: { default: "120px" },
|
|
3489
|
+
labelPosition: { default: "right" },
|
|
3490
|
+
autoLayout: {
|
|
3491
|
+
type: Boolean,
|
|
3492
|
+
default: !0
|
|
3493
|
+
},
|
|
3494
|
+
hideLabel: {
|
|
3495
|
+
type: Boolean,
|
|
3496
|
+
default: !1
|
|
3497
|
+
}
|
|
3498
|
+
},
|
|
3499
|
+
setup(e, { expose: t }) {
|
|
3500
|
+
let n = N();
|
|
3501
|
+
return t({
|
|
3502
|
+
validateFields: () => n.value?.validateFields(),
|
|
3503
|
+
getParams: () => n.value?.getParams() ?? {},
|
|
3504
|
+
resetForm: () => n.value?.resetForm(),
|
|
3505
|
+
getFormRef: () => n.value?.getFormRef()
|
|
3506
|
+
}), (t, r) => (j(), d(z(wr), {
|
|
3507
|
+
ref_key: "formRef",
|
|
3508
|
+
ref: n,
|
|
3509
|
+
class: "k-panel-query-form",
|
|
3510
|
+
"form-configs": e.formConfigs,
|
|
3511
|
+
"col-length": e.colLength,
|
|
3512
|
+
inline: e.inline,
|
|
3513
|
+
"label-width": e.labelWidth,
|
|
3514
|
+
"label-position": e.labelPosition,
|
|
3515
|
+
"auto-layout": e.autoLayout,
|
|
3516
|
+
"hide-label": e.hideLabel
|
|
3517
|
+
}, null, 8, [
|
|
3518
|
+
"form-configs",
|
|
3519
|
+
"col-length",
|
|
3520
|
+
"inline",
|
|
3521
|
+
"label-width",
|
|
3522
|
+
"label-position",
|
|
3523
|
+
"auto-layout",
|
|
3524
|
+
"hide-label"
|
|
3525
|
+
]));
|
|
3526
|
+
}
|
|
3527
|
+
}), Ci = { class: "k-items k-form" }, wi = { class: "k-items_ul" }, Ti = {
|
|
3528
|
+
key: 0,
|
|
3529
|
+
class: "k-item_label"
|
|
3530
|
+
}, Ei = { class: "k-item_input" }, Di = {
|
|
3531
|
+
key: 0,
|
|
3532
|
+
class: "k-item k-panel-query__item-actions"
|
|
3533
|
+
}, Oi = /* @__PURE__ */ y({
|
|
3534
|
+
name: "KPanelQueryItem",
|
|
3535
|
+
__name: "KPanelQueryItem",
|
|
3536
|
+
props: { formConfigs: {} },
|
|
3537
|
+
setup(e, { expose: t }) {
|
|
3538
|
+
let n = e, r = V(), i = u(() => ({
|
|
3539
|
+
colLength: 1,
|
|
3540
|
+
inline: !0,
|
|
3541
|
+
autoLayout: !1,
|
|
3542
|
+
hideLabel: !1
|
|
3543
|
+
})), a = wt({
|
|
3544
|
+
formConfigs: L(n, "formConfigs"),
|
|
3545
|
+
controlled: u(() => !1)
|
|
3546
|
+
}), { normalizedConfigs: o, getFieldOptions: s } = vt({
|
|
3547
|
+
formConfigs: L(n, "formConfigs"),
|
|
3548
|
+
layout: i
|
|
3549
|
+
});
|
|
3550
|
+
function l(e, t) {
|
|
3551
|
+
a.updateFieldValue(e, t);
|
|
3552
|
+
}
|
|
3553
|
+
async function d() {
|
|
3554
|
+
return a.getVisibleFieldsValue();
|
|
3555
|
+
}
|
|
3556
|
+
function h() {
|
|
3557
|
+
return a.getVisibleFieldsValue();
|
|
3558
|
+
}
|
|
3559
|
+
function g() {
|
|
3560
|
+
a.resetFormModel();
|
|
3561
|
+
}
|
|
3562
|
+
return t({
|
|
3563
|
+
validateFields: d,
|
|
3564
|
+
getParams: h,
|
|
3565
|
+
resetForm: g,
|
|
3566
|
+
getFormRef: () => void 0
|
|
3567
|
+
}), (e, t) => (j(), p("div", Ci, [m("ul", wi, [(j(!0), p(c, null, P(z(o), (e) => (j(), p("li", {
|
|
3568
|
+
key: e.id,
|
|
3569
|
+
class: D(["k-item", { "k-item_flex": !!e.label }])
|
|
3570
|
+
}, [e.label ? (j(), p("label", Ti, I(e.label), 1)) : f("", !0), m("div", Ei, [_(Sr, {
|
|
3571
|
+
item: e,
|
|
3572
|
+
"model-value": z(a).formModel[e.id],
|
|
3573
|
+
options: z(s)(e),
|
|
3574
|
+
"onUpdate:modelValue": (t) => l(e, t)
|
|
3575
|
+
}, null, 8, [
|
|
3576
|
+
"item",
|
|
3577
|
+
"model-value",
|
|
3578
|
+
"options",
|
|
3579
|
+
"onUpdate:modelValue"
|
|
3580
|
+
])])], 2))), 128)), z(r).button ? (j(), p("li", Di, [F(e.$slots, "button")])) : f("", !0)])]));
|
|
3581
|
+
}
|
|
3582
|
+
}), ki = /* @__PURE__ */ y({
|
|
3583
|
+
name: "KPanelQuery",
|
|
3584
|
+
__name: "KPanelQuery",
|
|
3585
|
+
props: {
|
|
3586
|
+
title: { default: "快速查询" },
|
|
3587
|
+
showPanel: {
|
|
3588
|
+
type: Boolean,
|
|
3589
|
+
default: !0
|
|
3590
|
+
},
|
|
3591
|
+
model: { default: "form" },
|
|
3592
|
+
isFold: {
|
|
3593
|
+
type: Boolean,
|
|
3594
|
+
default: !0
|
|
3595
|
+
},
|
|
3596
|
+
unfold: {
|
|
3597
|
+
type: Boolean,
|
|
3598
|
+
default: !0
|
|
3599
|
+
},
|
|
3600
|
+
hover: {
|
|
3601
|
+
type: Boolean,
|
|
3602
|
+
default: !0
|
|
3603
|
+
},
|
|
3604
|
+
hideButton: {
|
|
3605
|
+
type: Boolean,
|
|
3606
|
+
default: !1
|
|
3607
|
+
},
|
|
3608
|
+
hideLabel: {
|
|
3609
|
+
type: Boolean,
|
|
3610
|
+
default: !1
|
|
3611
|
+
},
|
|
3612
|
+
form: {}
|
|
3613
|
+
},
|
|
3614
|
+
emits: ["query", "reset"],
|
|
3615
|
+
setup(e, { expose: t, emit: n }) {
|
|
3616
|
+
let r = e, i = n, a = N(), o = /* @__PURE__ */ new Set([
|
|
3617
|
+
"Input",
|
|
3618
|
+
"Select",
|
|
3619
|
+
"TreeSelect",
|
|
3620
|
+
"Cascader"
|
|
3621
|
+
]);
|
|
3622
|
+
function s(e) {
|
|
3623
|
+
return r.hideLabel ? e.map((e) => {
|
|
3624
|
+
let t = String(e.component ?? ""), n = { ...e.componentProps ?? {} };
|
|
3625
|
+
return o.has(t) ? (n.placeholder = n.placeholder || e.label, {
|
|
3626
|
+
...e,
|
|
3627
|
+
label: "",
|
|
3628
|
+
componentProps: n
|
|
3629
|
+
}) : t === "DatePicker" ? {
|
|
3630
|
+
...e,
|
|
3631
|
+
label: "",
|
|
3632
|
+
componentProps: n
|
|
3633
|
+
} : e;
|
|
3634
|
+
}) : e;
|
|
3635
|
+
}
|
|
3636
|
+
let l = u(() => {
|
|
3637
|
+
let e = r.form;
|
|
3638
|
+
if (!e) return;
|
|
3639
|
+
let t = e.formConfigs.length, n = e.colLength ?? (t > 0 ? Math.min(t, 3) : 3);
|
|
3640
|
+
return {
|
|
3641
|
+
...e,
|
|
3642
|
+
colLength: n,
|
|
3643
|
+
autoLayout: e.autoLayout ?? !0,
|
|
3644
|
+
formConfigs: s(e.formConfigs)
|
|
3645
|
+
};
|
|
3646
|
+
}), m = u(() => r.model === "item");
|
|
3647
|
+
async function g() {
|
|
3648
|
+
let e = await a.value?.validateFields();
|
|
3649
|
+
e && i("query", e);
|
|
3650
|
+
}
|
|
3651
|
+
async function v() {
|
|
3652
|
+
a.value?.resetForm(), i("reset");
|
|
3653
|
+
let e = await a.value?.validateFields();
|
|
3654
|
+
e && i("query", e);
|
|
3655
|
+
}
|
|
3656
|
+
function y() {
|
|
3657
|
+
return a.value?.getParams() ?? {};
|
|
3658
|
+
}
|
|
3659
|
+
function b() {
|
|
3660
|
+
a.value?.resetForm();
|
|
3661
|
+
}
|
|
3662
|
+
return t({
|
|
3663
|
+
getParams: y,
|
|
3664
|
+
resetForm: b,
|
|
3665
|
+
getFormRef: () => a.value?.getFormRef(),
|
|
3666
|
+
submit: g
|
|
3667
|
+
}), (t, n) => (j(), p("div", { class: D(["k-panel-query", {
|
|
3668
|
+
"k-panel-query__form": e.model === "form" && !e.showPanel,
|
|
3669
|
+
"k-panel-query__item": m.value
|
|
3670
|
+
}]) }, [e.showPanel ? (j(), d(z(yi), {
|
|
3671
|
+
key: 1,
|
|
3672
|
+
title: e.title,
|
|
3673
|
+
"is-fold": e.isFold,
|
|
3674
|
+
unfold: e.unfold,
|
|
3675
|
+
hover: e.hover
|
|
3676
|
+
}, {
|
|
3677
|
+
default: W(() => [l.value ? (j(), p(c, { key: 0 }, [m.value ? (j(), d(Oi, T({
|
|
3678
|
+
key: 0,
|
|
3679
|
+
ref_key: "formRef",
|
|
3680
|
+
ref: a
|
|
3681
|
+
}, l.value), h({ _: 2 }, [e.hideButton ? void 0 : {
|
|
3682
|
+
name: "button",
|
|
3683
|
+
fn: W(() => [_(xi, {
|
|
3684
|
+
onQuery: g,
|
|
3685
|
+
onReset: v
|
|
3686
|
+
})]),
|
|
3687
|
+
key: "0"
|
|
3688
|
+
}]), 1040)) : (j(), p(c, { key: 1 }, [_(Si, T({
|
|
3689
|
+
ref_key: "formRef",
|
|
3690
|
+
ref: a
|
|
3691
|
+
}, l.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? f("", !0) : (j(), d(xi, {
|
|
3692
|
+
key: 0,
|
|
3693
|
+
footer: "",
|
|
3694
|
+
onQuery: g,
|
|
3695
|
+
onReset: v
|
|
3696
|
+
}))], 64))], 64)) : f("", !0)]),
|
|
3697
|
+
_: 1
|
|
3698
|
+
}, 8, [
|
|
3699
|
+
"title",
|
|
3700
|
+
"is-fold",
|
|
3701
|
+
"unfold",
|
|
3702
|
+
"hover"
|
|
3703
|
+
])) : (j(), p(c, { key: 0 }, [l.value ? (j(), p(c, { key: 0 }, [m.value ? (j(), d(Oi, T({
|
|
3704
|
+
key: 0,
|
|
3705
|
+
ref_key: "formRef",
|
|
3706
|
+
ref: a
|
|
3707
|
+
}, l.value), h({ _: 2 }, [e.hideButton ? void 0 : {
|
|
3708
|
+
name: "button",
|
|
3709
|
+
fn: W(() => [_(xi, {
|
|
3710
|
+
onQuery: g,
|
|
3711
|
+
onReset: v
|
|
3712
|
+
})]),
|
|
3713
|
+
key: "0"
|
|
3714
|
+
}]), 1040)) : (j(), p(c, { key: 1 }, [_(Si, T({
|
|
3715
|
+
ref_key: "formRef",
|
|
3716
|
+
ref: a
|
|
3717
|
+
}, l.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? f("", !0) : (j(), d(xi, {
|
|
3718
|
+
key: 0,
|
|
3719
|
+
footer: "",
|
|
3720
|
+
onQuery: g,
|
|
3721
|
+
onReset: v
|
|
3722
|
+
}))], 64))], 64)) : f("", !0)], 64))], 2));
|
|
3723
|
+
}
|
|
3724
|
+
});
|
|
3725
|
+
//#endregion
|
|
3726
|
+
//#region src/components/k-table/utils/rowKey.ts
|
|
3727
|
+
function Ai(e, t) {
|
|
3728
|
+
return e[t];
|
|
3729
|
+
}
|
|
3730
|
+
function ji(e, t) {
|
|
3731
|
+
let n = Ai(e, t);
|
|
3732
|
+
return typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? n : n == null ? "" : String(n);
|
|
3733
|
+
}
|
|
3734
|
+
//#endregion
|
|
3735
|
+
//#region src/components/k-table/utils/formatCellValue.ts
|
|
3736
|
+
function Mi(e) {
|
|
3737
|
+
return e === "" || e == null;
|
|
3738
|
+
}
|
|
3739
|
+
function Ni(e) {
|
|
3740
|
+
let t = Number(e);
|
|
3741
|
+
return Number.isNaN(t) ? String(e ?? "") : t.toLocaleString("en-US");
|
|
3742
|
+
}
|
|
3743
|
+
function Pi(e) {
|
|
3744
|
+
return e.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
|
3745
|
+
}
|
|
3746
|
+
function Fi(e, t) {
|
|
3747
|
+
if (Mi(t)) return "";
|
|
3748
|
+
let n = String(t);
|
|
3749
|
+
switch (e) {
|
|
3750
|
+
case "date": return q(n).format("YYYY-MM-DD");
|
|
3751
|
+
case "datetime": return q(n).format("YYYY-MM-DD HH:mm:ss");
|
|
3752
|
+
case "amount": return Ni(t);
|
|
3753
|
+
case "phone": return Pi(n);
|
|
3754
|
+
default: return n;
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
function Ii(e, t, n, r, i) {
|
|
3758
|
+
let a = e.prop ? Ai(t, e.prop) : void 0;
|
|
3759
|
+
return e.formatter ? e.formatter(t, e, a, n) : e.dict && i !== void 0 ? i : Mi(a) ? r : e.showType ? Fi(e.showType, a) : String(a);
|
|
3760
|
+
}
|
|
3761
|
+
//#endregion
|
|
3762
|
+
//#region src/components/k-table/composables/useTableColumns.ts
|
|
3763
|
+
var Li = [
|
|
3764
|
+
"prop",
|
|
3765
|
+
"label",
|
|
3766
|
+
"width",
|
|
3767
|
+
"minWidth",
|
|
3768
|
+
"align",
|
|
3769
|
+
"headerAlign",
|
|
3770
|
+
"fixed",
|
|
3771
|
+
"sortable",
|
|
3772
|
+
"sortMethod",
|
|
3773
|
+
"sortBy",
|
|
3774
|
+
"sortOrders",
|
|
3775
|
+
"resizable",
|
|
3776
|
+
"formatter",
|
|
3777
|
+
"showOverflowTooltip",
|
|
3778
|
+
"className",
|
|
3779
|
+
"labelClassName",
|
|
3780
|
+
"selectable",
|
|
3781
|
+
"reserveSelection",
|
|
3782
|
+
"filters",
|
|
3783
|
+
"filterMethod",
|
|
3784
|
+
"filteredValue"
|
|
3785
|
+
];
|
|
3786
|
+
function Ri(e, t = !1) {
|
|
3787
|
+
let n = e.some((e) => e.type === "selection"), r = e;
|
|
3788
|
+
return t && !n && (r = [{
|
|
3789
|
+
type: "selection",
|
|
3790
|
+
width: 50,
|
|
3791
|
+
align: "center"
|
|
3792
|
+
}, ...r]), r.map((e) => e.prop === "operates" && !e.type ? {
|
|
3793
|
+
...e,
|
|
3794
|
+
type: "operates"
|
|
3795
|
+
} : e);
|
|
3796
|
+
}
|
|
3797
|
+
function zi(e) {
|
|
3798
|
+
let t = {
|
|
3799
|
+
minWidth: e.minWidth ?? "110",
|
|
3800
|
+
align: e.align ?? "center",
|
|
3801
|
+
headerAlign: e.headerAlign ?? "center"
|
|
3802
|
+
};
|
|
3803
|
+
for (let n of Li) e[n] !== void 0 && (t[n] = e[n]);
|
|
3804
|
+
return e.type === "index" && !t.label && (t.label = "序号"), e.type === "expand" && (t.width = e.width ?? 50, delete t.minWidth), e.type !== "selection" && e.type !== "index" && e.type !== "operates" && e.type !== "radio" && e.type !== "expand" && (t.showOverflowTooltip = e.showOverflowTooltip ?? !0), t;
|
|
3805
|
+
}
|
|
3806
|
+
function Bi(e = "--") {
|
|
3807
|
+
let t = S(dt, null);
|
|
3808
|
+
function n(n, r, i) {
|
|
3809
|
+
let a = n.prop ? Ai(r, n.prop) : void 0;
|
|
3810
|
+
return Ii(n, r, i, e, n.dict && t && !Vi(a) ? t.getLabel(n.dict, a) : void 0);
|
|
3811
|
+
}
|
|
3812
|
+
return { getCellDisplayValue: n };
|
|
3813
|
+
}
|
|
3814
|
+
function Vi(e) {
|
|
3815
|
+
return e === "" || e == null;
|
|
3816
|
+
}
|
|
3817
|
+
//#endregion
|
|
3818
|
+
//#region src/components/k-table/utils/columnIdentity.ts
|
|
3819
|
+
function $(e, t = 0) {
|
|
3820
|
+
return e.prop ? `prop:${e.prop}` : e.type ? `type:${e.type}:${t}` : e.label ? `label:${e.label}:${t}` : `index:${t}`;
|
|
3821
|
+
}
|
|
3822
|
+
//#endregion
|
|
3823
|
+
//#region src/components/k-table/KTableColumn.vue
|
|
3824
|
+
var Hi = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3825
|
+
name: "KTableColumn",
|
|
3826
|
+
__name: "KTableColumn",
|
|
3827
|
+
props: {
|
|
3828
|
+
column: {},
|
|
3829
|
+
columnIndex: { default: 0 },
|
|
3830
|
+
indexOffset: { default: 0 },
|
|
3831
|
+
nullValueFormat: { default: "--" },
|
|
3832
|
+
disabled: {
|
|
3833
|
+
type: Boolean,
|
|
3834
|
+
default: !1
|
|
3835
|
+
},
|
|
3836
|
+
rowKey: { default: "id" },
|
|
3837
|
+
radioSelected: {
|
|
3838
|
+
type: [
|
|
3839
|
+
String,
|
|
3840
|
+
Number,
|
|
3841
|
+
Boolean
|
|
3842
|
+
],
|
|
3843
|
+
default: ""
|
|
3844
|
+
}
|
|
3845
|
+
},
|
|
3846
|
+
emits: ["operate-click", "radio-select"],
|
|
3847
|
+
setup(e, { emit: t }) {
|
|
3848
|
+
let n = e, r = t, i = V(), { getCellDisplayValue: a } = Bi(n.nullValueFormat);
|
|
3849
|
+
function o(e) {
|
|
3850
|
+
return e ?? "";
|
|
3851
|
+
}
|
|
3852
|
+
let s = u(() => zi(n.column)), l = (e) => n.indexOffset + e + 1, f = u(() => {
|
|
3853
|
+
let e = n.column.prop;
|
|
3854
|
+
return !!(e && i[o(e)]);
|
|
3855
|
+
}), v = u(() => n.column.type === "operates" ? i.operates ? !0 : !!(n.column.prop && i[o(n.column.prop)]) : !1);
|
|
3856
|
+
function y(e, t, n) {
|
|
3857
|
+
r("operate-click", e, n, t), e.onClick?.(n, t);
|
|
3858
|
+
}
|
|
3859
|
+
function b(e) {
|
|
3860
|
+
return typeof e.slot == "string" ? e.slot : "default";
|
|
3861
|
+
}
|
|
3862
|
+
function x(e) {
|
|
3863
|
+
return ji(e, n.rowKey);
|
|
3864
|
+
}
|
|
3865
|
+
return (t, n) => {
|
|
3866
|
+
let u = re("KTableColumn", !0);
|
|
3867
|
+
return e.column.type === "selection" ? (j(), d(z(K), T({
|
|
3868
|
+
key: `${z($)(e.column, e.columnIndex)}:selection`,
|
|
3869
|
+
type: "selection"
|
|
3870
|
+
}, s.value), null, 16)) : e.column.type === "index" ? (j(), d(z(K), T({ key: `${z($)(e.column, e.columnIndex)}:index` }, s.value), {
|
|
3871
|
+
default: W(({ $index: e }) => [F(t.$slots, "index", {
|
|
3872
|
+
index: e,
|
|
3873
|
+
displayIndex: l(e)
|
|
3874
|
+
}, () => [g(I(l(e)), 1)], !0)]),
|
|
3875
|
+
_: 3
|
|
3876
|
+
}, 16)) : e.column.type === "radio" ? (j(), d(z(K), T({ key: `${z($)(e.column, e.columnIndex)}:radio` }, s.value), {
|
|
3877
|
+
default: W(({ row: t }) => [_(z(je), {
|
|
3878
|
+
class: "k-table-column__radio",
|
|
3879
|
+
"model-value": e.radioSelected,
|
|
3880
|
+
label: x(t),
|
|
3881
|
+
"onUpdate:modelValue": (e) => r("radio-select", t)
|
|
3882
|
+
}, null, 8, [
|
|
3883
|
+
"model-value",
|
|
3884
|
+
"label",
|
|
3885
|
+
"onUpdate:modelValue"
|
|
3886
|
+
])]),
|
|
3887
|
+
_: 1
|
|
3888
|
+
}, 16)) : e.column.type === "operates" ? (j(), d(z(K), T({ key: `${z($)(e.column, e.columnIndex)}:operates` }, s.value), {
|
|
3889
|
+
default: W(({ row: n, column: r, $index: a }) => [v.value ? F(t.$slots, z(i).operates ? "operates" : o(e.column.prop), {
|
|
3890
|
+
row: n,
|
|
3891
|
+
column: r,
|
|
3892
|
+
index: a
|
|
3893
|
+
}, void 0, !0, 0) : (j(), d(z(Gr), {
|
|
3894
|
+
key: 1,
|
|
3895
|
+
data: e.column.operates ?? [],
|
|
3896
|
+
disabled: e.disabled,
|
|
3897
|
+
"table-mode": "",
|
|
3898
|
+
onClick: (e, t) => y(e, t, n)
|
|
3899
|
+
}, h({ _: 2 }, [P(e.column.operates ?? [], (e) => ({
|
|
3900
|
+
name: b(e),
|
|
3901
|
+
fn: W(({ item: i }) => [F(t.$slots, b(e), {
|
|
3902
|
+
row: n,
|
|
3903
|
+
column: r,
|
|
3904
|
+
index: a,
|
|
3905
|
+
item: i
|
|
3906
|
+
}, () => [g(I(i.label), 1)], !0)])
|
|
3907
|
+
}))]), 1032, [
|
|
3908
|
+
"data",
|
|
3909
|
+
"disabled",
|
|
3910
|
+
"onClick"
|
|
3911
|
+
]))]),
|
|
3912
|
+
_: 3
|
|
3913
|
+
}, 16)) : e.column.type === "expand" ? (j(), d(z(K), T({
|
|
3914
|
+
key: `${z($)(e.column, e.columnIndex)}:expand`,
|
|
3915
|
+
type: "expand"
|
|
3916
|
+
}, s.value), {
|
|
3917
|
+
default: W(({ row: e, column: n, $index: r }) => [F(t.$slots, "expand", {
|
|
3918
|
+
row: e,
|
|
3919
|
+
column: n,
|
|
3920
|
+
index: r
|
|
3921
|
+
}, void 0, !0)]),
|
|
3922
|
+
_: 3
|
|
3923
|
+
}, 16)) : e.column.children?.length ? (j(), d(z(K), T({ key: `${z($)(e.column, e.columnIndex)}:group` }, s.value), {
|
|
3924
|
+
default: W(() => [(j(!0), p(c, null, P(e.column.children, (i, a) => (j(), d(u, {
|
|
3925
|
+
key: z($)(i, a),
|
|
3926
|
+
column: i,
|
|
3927
|
+
"column-index": a,
|
|
3928
|
+
"index-offset": e.indexOffset,
|
|
3929
|
+
"null-value-format": e.nullValueFormat,
|
|
3930
|
+
disabled: e.disabled,
|
|
3931
|
+
"row-key": e.rowKey,
|
|
3932
|
+
"radio-selected": e.radioSelected,
|
|
3933
|
+
onOperateClick: n[0] ||= (e, t, n) => r("operate-click", e, t, n),
|
|
3934
|
+
onRadioSelect: n[1] ||= (e) => r("radio-select", e)
|
|
3935
|
+
}, h({ _: 2 }, [P(t.$slots, (e, n) => ({
|
|
3936
|
+
name: n,
|
|
3937
|
+
fn: W((e) => [F(t.$slots, n, T({ ref_for: !0 }, e ?? {}), void 0, !0)])
|
|
3938
|
+
}))]), 1032, [
|
|
3939
|
+
"column",
|
|
3940
|
+
"column-index",
|
|
3941
|
+
"index-offset",
|
|
3942
|
+
"null-value-format",
|
|
3943
|
+
"disabled",
|
|
3944
|
+
"row-key",
|
|
3945
|
+
"radio-selected"
|
|
3946
|
+
]))), 128))]),
|
|
3947
|
+
_: 3
|
|
3948
|
+
}, 16)) : (j(), d(z(K), T({ key: `${z($)(e.column, e.columnIndex)}:default` }, s.value), h({
|
|
3949
|
+
default: W(({ row: n, column: r, $index: i }) => [f.value ? F(t.$slots, o(e.column.prop), {
|
|
3950
|
+
row: n,
|
|
3951
|
+
column: r,
|
|
3952
|
+
index: i
|
|
3953
|
+
}, void 0, !0, 0) : (j(), p(c, { key: 1 }, [g(I(z(a)(e.column, n, i)), 1)], 64))]),
|
|
3954
|
+
_: 2
|
|
3955
|
+
}, [e.column.toolTip ? {
|
|
3956
|
+
name: "header",
|
|
3957
|
+
fn: W(() => [m("span", null, I(e.column.label), 1), _(z(Re), {
|
|
3958
|
+
content: e.column.toolTip,
|
|
3959
|
+
placement: "top"
|
|
3960
|
+
}, {
|
|
3961
|
+
default: W(() => [...n[2] ||= [m("span", { class: "k-table-column__tip" }, "i", -1)]]),
|
|
3962
|
+
_: 1
|
|
3963
|
+
}, 8, ["content"])]),
|
|
3964
|
+
key: "0"
|
|
3965
|
+
} : void 0]), 1040));
|
|
3966
|
+
};
|
|
3967
|
+
}
|
|
3968
|
+
}), [["__scopeId", "data-v-578909bc"]]), Ui = { class: "k-table-column-selector" }, Wi = { class: "k-table-column-selector__header" }, Gi = { class: "k-table-column-selector__content" }, Ki = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3969
|
+
name: "KTableColumnSelector",
|
|
3970
|
+
__name: "KTableColumnSelector",
|
|
3971
|
+
props: { items: {} },
|
|
3972
|
+
emits: ["change", "reset"],
|
|
3973
|
+
setup(e, { emit: t }) {
|
|
3974
|
+
let n = t, r = N(!1);
|
|
3975
|
+
function i(e, t) {
|
|
3976
|
+
n("change", e, t);
|
|
3977
|
+
}
|
|
3978
|
+
function a() {
|
|
3979
|
+
n("reset");
|
|
3980
|
+
}
|
|
3981
|
+
return (t, n) => (j(), d(z(ke), {
|
|
3982
|
+
visible: r.value,
|
|
3983
|
+
"onUpdate:visible": n[0] ||= (e) => r.value = e,
|
|
3984
|
+
placement: "bottom-end",
|
|
3985
|
+
width: 300,
|
|
3986
|
+
trigger: "click",
|
|
3987
|
+
"popper-class": "k-table-column-selector__popover"
|
|
3988
|
+
}, {
|
|
3989
|
+
reference: W(() => [...n[1] ||= [m("button", {
|
|
3990
|
+
type: "button",
|
|
3991
|
+
class: "k-table-column-selector__trigger",
|
|
3992
|
+
"aria-label": "列展示设置"
|
|
3993
|
+
}, [m("span", { class: "k-table-column-selector__icon" })], -1)]]),
|
|
3994
|
+
default: W(() => [m("div", Ui, [
|
|
3995
|
+
m("div", Wi, [n[3] ||= m("span", null, "列展示", -1), _(z(de), {
|
|
3996
|
+
type: "primary",
|
|
3997
|
+
link: "",
|
|
3998
|
+
onClick: a
|
|
3999
|
+
}, {
|
|
4000
|
+
default: W(() => [...n[2] ||= [g("恢复默认", -1)]]),
|
|
4001
|
+
_: 1
|
|
4002
|
+
})]),
|
|
4003
|
+
_(z(G), { class: "k-table-column-selector__divider" }),
|
|
4004
|
+
m("div", Gi, [(j(!0), p(c, null, P(e.items, (e) => (j(), d(z(me), {
|
|
4005
|
+
key: e.key,
|
|
4006
|
+
"model-value": e.checked,
|
|
4007
|
+
disabled: e.disabled,
|
|
4008
|
+
onChange: (t) => i(e.key, !!t)
|
|
4009
|
+
}, {
|
|
4010
|
+
default: W(() => [g(I(e.label), 1)]),
|
|
4011
|
+
_: 2
|
|
4012
|
+
}, 1032, [
|
|
4013
|
+
"model-value",
|
|
4014
|
+
"disabled",
|
|
4015
|
+
"onChange"
|
|
4016
|
+
]))), 128))])
|
|
4017
|
+
])]),
|
|
4018
|
+
_: 1
|
|
4019
|
+
}, 8, ["visible"]));
|
|
4020
|
+
}
|
|
4021
|
+
}), [["__scopeId", "data-v-e0b3cf31"]]), qi = {
|
|
4022
|
+
key: 0,
|
|
4023
|
+
class: "k-table-toolbar k-table-header"
|
|
4024
|
+
}, Ji = {
|
|
4025
|
+
key: 0,
|
|
4026
|
+
class: "k-table-toolbar__main"
|
|
4027
|
+
}, Yi = {
|
|
4028
|
+
key: 1,
|
|
4029
|
+
class: "k-table-toolbar__header"
|
|
4030
|
+
}, Xi = {
|
|
4031
|
+
key: 2,
|
|
4032
|
+
class: "k-table-toolbar__extra"
|
|
4033
|
+
}, Zi = {
|
|
4034
|
+
key: 1,
|
|
4035
|
+
class: "k-table-toolbar__divider"
|
|
4036
|
+
}, Qi = {
|
|
4037
|
+
key: 2,
|
|
4038
|
+
class: "k-table-toolbar__selection"
|
|
4039
|
+
}, $i = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
4040
|
+
name: "KTableToolbar",
|
|
4041
|
+
__name: "KTableToolbar",
|
|
4042
|
+
props: {
|
|
4043
|
+
addButton: {
|
|
4044
|
+
type: [Boolean, String],
|
|
4045
|
+
default: !1
|
|
4046
|
+
},
|
|
4047
|
+
selectionShow: {
|
|
4048
|
+
type: Boolean,
|
|
4049
|
+
default: !1
|
|
4050
|
+
},
|
|
4051
|
+
selectedCount: { default: 0 }
|
|
4052
|
+
},
|
|
4053
|
+
emits: ["add"],
|
|
4054
|
+
setup(e, { emit: t }) {
|
|
4055
|
+
let n = e, r = t, i = V(), a = u(() => !!(n.addButton || i.header || i.extra)), o = u(() => !!(n.addButton && n.selectionShow));
|
|
4056
|
+
return (t, n) => a.value || e.selectionShow ? (j(), p("div", qi, [
|
|
4057
|
+
a.value ? (j(), p("div", Ji, [
|
|
4058
|
+
e.addButton ? (j(), d(Y, {
|
|
4059
|
+
key: 0,
|
|
4060
|
+
type: "primary",
|
|
4061
|
+
icon: z(qe),
|
|
4062
|
+
onClick: n[0] ||= (e) => r("add")
|
|
4063
|
+
}, {
|
|
4064
|
+
default: W(() => [g(I(e.addButton === !0 ? "新建" : e.addButton), 1)]),
|
|
4065
|
+
_: 1
|
|
4066
|
+
}, 8, ["icon"])) : f("", !0),
|
|
4067
|
+
z(i).header ? (j(), p("div", Yi, [F(t.$slots, "header", {}, void 0, !0)])) : f("", !0),
|
|
4068
|
+
z(i).extra ? (j(), p("div", Xi, [F(t.$slots, "extra", {}, void 0, !0)])) : f("", !0)
|
|
4069
|
+
])) : f("", !0),
|
|
4070
|
+
o.value ? (j(), p("div", Zi)) : f("", !0),
|
|
4071
|
+
e.selectionShow ? (j(), p("div", Qi, "已选择" + I(e.selectedCount) + "条数据", 1)) : f("", !0)
|
|
4072
|
+
])) : f("", !0);
|
|
4073
|
+
}
|
|
4074
|
+
}), [["__scopeId", "data-v-bff19ed1"]]), ea = "kayak_table_column_display";
|
|
4075
|
+
function ta(e) {
|
|
4076
|
+
return e.type === "selection" || e.type === "index" || e.type === "radio" || e.type === "expand" || e.required === !0;
|
|
4077
|
+
}
|
|
4078
|
+
function na(e) {
|
|
4079
|
+
return !(e.type === "radio" || e.type === "expand" || e.children?.length);
|
|
4080
|
+
}
|
|
4081
|
+
function ra(e) {
|
|
4082
|
+
let t = N({}), n = N(""), r = Ue(ea, {}), i = u(() => !!R(e.enableColumnCache)), a = u(() => R(e.columns).filter((e) => na(e)));
|
|
4083
|
+
function o() {
|
|
4084
|
+
return R(e.tableKey) || n.value;
|
|
4085
|
+
}
|
|
4086
|
+
function s() {
|
|
4087
|
+
let t = {};
|
|
4088
|
+
return R(e.columns).forEach((e, n) => {
|
|
4089
|
+
na(e) && (t[$(e, n)] = !0);
|
|
4090
|
+
}), t;
|
|
4091
|
+
}
|
|
4092
|
+
function c() {
|
|
4093
|
+
if (!i.value) return null;
|
|
4094
|
+
let e = o();
|
|
4095
|
+
return e ? r.value[e] ?? null : null;
|
|
4096
|
+
}
|
|
4097
|
+
function l() {
|
|
4098
|
+
if (!i.value) return;
|
|
4099
|
+
let e = o();
|
|
4100
|
+
e && (r.value = {
|
|
4101
|
+
...r.value,
|
|
4102
|
+
[e]: t.value
|
|
4103
|
+
});
|
|
4104
|
+
}
|
|
4105
|
+
function d() {
|
|
4106
|
+
if (!i.value) return;
|
|
4107
|
+
let e = o();
|
|
4108
|
+
if (!e) return;
|
|
4109
|
+
let t = { ...r.value };
|
|
4110
|
+
delete t[e], r.value = t;
|
|
4111
|
+
}
|
|
4112
|
+
function f(t, n) {
|
|
4113
|
+
let r = R(e.columns), i = r.findIndex((e) => e === t || e.prop && e.prop === t.prop && e.type === t.type);
|
|
4114
|
+
return i >= 0 ? $(r[i], i) : $(t, n);
|
|
4115
|
+
}
|
|
4116
|
+
function p() {
|
|
4117
|
+
n.value = R(e.tableKey) || `table_${Math.random().toString(36).slice(2, 11)}`;
|
|
4118
|
+
let r = c();
|
|
4119
|
+
t.value = r ? J(r) : s();
|
|
4120
|
+
}
|
|
4121
|
+
function m() {
|
|
4122
|
+
E(() => e.onLayout?.());
|
|
4123
|
+
}
|
|
4124
|
+
function h(n, r) {
|
|
4125
|
+
t.value = {
|
|
4126
|
+
...t.value,
|
|
4127
|
+
[n]: r
|
|
4128
|
+
}, l(), e.onDisplayChange?.(t.value), m();
|
|
4129
|
+
}
|
|
4130
|
+
function g(e, t, n) {
|
|
4131
|
+
h(f(e, t), n);
|
|
4132
|
+
}
|
|
4133
|
+
function _() {
|
|
4134
|
+
d(), t.value = s(), e.onDisplayChange?.(t.value), m();
|
|
4135
|
+
}
|
|
4136
|
+
let v = u(() => {
|
|
4137
|
+
let n = R(e.renderColumns);
|
|
4138
|
+
return i.value ? n.filter((e, n) => {
|
|
4139
|
+
if (ta(e)) return !0;
|
|
4140
|
+
let r = f(e, n);
|
|
4141
|
+
return t.value[r] !== !1;
|
|
4142
|
+
}) : n;
|
|
4143
|
+
}), y = u(() => a.value.map((e, n) => {
|
|
4144
|
+
let r = $(e, n);
|
|
4145
|
+
return {
|
|
4146
|
+
column: e,
|
|
4147
|
+
key: r,
|
|
4148
|
+
label: e.label || "未命名列",
|
|
4149
|
+
checked: t.value[r] !== !1,
|
|
4150
|
+
disabled: ta(e)
|
|
4151
|
+
};
|
|
4152
|
+
}));
|
|
4153
|
+
return U(() => R(e.columns), () => {
|
|
4154
|
+
let e = s();
|
|
4155
|
+
Object.keys(e).forEach((e) => {
|
|
4156
|
+
t.value[e] === void 0 && (t.value[e] = !0);
|
|
4157
|
+
});
|
|
4158
|
+
}, { deep: !0 }), A(() => {
|
|
4159
|
+
p();
|
|
4160
|
+
}), {
|
|
4161
|
+
columnDisplay: t,
|
|
4162
|
+
displayableColumns: a,
|
|
4163
|
+
visibleColumns: v,
|
|
4164
|
+
selectorItems: y,
|
|
4165
|
+
setColumnVisible: g,
|
|
4166
|
+
setColumnVisibleByKey: h,
|
|
4167
|
+
resetColumnDisplay: _
|
|
4168
|
+
};
|
|
4169
|
+
}
|
|
4170
|
+
//#endregion
|
|
4171
|
+
//#region src/components/k-table/composables/useTableData.ts
|
|
4172
|
+
function ia(e) {
|
|
4173
|
+
let t = N([]), n = N(e.initialLoading ?? !1), r = N(!1), i = N(!1);
|
|
4174
|
+
function a() {
|
|
4175
|
+
return {
|
|
4176
|
+
...ft,
|
|
4177
|
+
...R(e.responseConfig)
|
|
4178
|
+
};
|
|
4179
|
+
}
|
|
4180
|
+
function o() {
|
|
4181
|
+
let t = a(), { currentPage: n, pageSize: r } = e.pagination.state.value;
|
|
4182
|
+
return {
|
|
4183
|
+
...R(e.params) ?? {},
|
|
4184
|
+
...R(e.queryParams) ?? {},
|
|
4185
|
+
[t.page]: String(n),
|
|
4186
|
+
[t.limit]: String(r)
|
|
4187
|
+
};
|
|
4188
|
+
}
|
|
4189
|
+
function s(n) {
|
|
4190
|
+
let r = n ?? {}, i = a(), o = r[i.list] ?? [], s = Number(r[i.total] ?? r.total ?? 0);
|
|
4191
|
+
t.value = o, e.pagination.setTotal(s), e.onDataLoaded?.(o, s), o.length === 0 && e.pagination.state.value.currentPage > 1 && (e.pagination.setCurrentPage(e.pagination.state.value.currentPage - 1), c());
|
|
4192
|
+
}
|
|
4193
|
+
async function c() {
|
|
4194
|
+
if (!(!e.action || i.value)) {
|
|
4195
|
+
i.value = !0, n.value = !0;
|
|
4196
|
+
try {
|
|
4197
|
+
s(await e.action(o()));
|
|
4198
|
+
} finally {
|
|
4199
|
+
n.value = !1, r.value = !0, i.value = !1;
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
async function l(t = !1) {
|
|
4204
|
+
t && e.pagination.resetPage(), await c();
|
|
4205
|
+
}
|
|
4206
|
+
return {
|
|
4207
|
+
tableData: t,
|
|
4208
|
+
loading: n,
|
|
4209
|
+
loaded: r,
|
|
4210
|
+
fetchData: c,
|
|
4211
|
+
refresh: l
|
|
4212
|
+
};
|
|
4213
|
+
}
|
|
4214
|
+
//#endregion
|
|
4215
|
+
//#region src/components/k-table/composables/useTablePagination.ts
|
|
4216
|
+
function aa(e) {
|
|
4217
|
+
let t = R(e.pagination), n = N({
|
|
4218
|
+
total: t?.total ?? pt.total,
|
|
4219
|
+
currentPage: t?.currentPage ?? pt.currentPage,
|
|
4220
|
+
pageSize: t?.pageSize ?? pt.pageSize,
|
|
4221
|
+
pageSizes: t?.pageSizes ?? [...pt.pageSizes],
|
|
4222
|
+
layout: t?.layout ?? pt.layout
|
|
4223
|
+
}), r = u(() => ({
|
|
4224
|
+
total: n.value.total,
|
|
4225
|
+
currentPage: n.value.currentPage,
|
|
4226
|
+
pageSize: n.value.pageSize,
|
|
4227
|
+
pageSizes: n.value.pageSizes,
|
|
4228
|
+
layout: n.value.layout
|
|
4229
|
+
})), i = u(() => (n.value.currentPage - 1) * n.value.pageSize);
|
|
4230
|
+
U(() => {
|
|
4231
|
+
let t = R(e.pagination);
|
|
4232
|
+
return [
|
|
4233
|
+
t?.total,
|
|
4234
|
+
t?.currentPage,
|
|
4235
|
+
t?.pageSize,
|
|
4236
|
+
e.hasAction.value
|
|
4237
|
+
];
|
|
4238
|
+
}, ([e, t, r, i]) => {
|
|
4239
|
+
t !== void 0 && (n.value.currentPage = t), r !== void 0 && (n.value.pageSize = r), !i && e !== void 0 && (n.value.total = e);
|
|
4240
|
+
});
|
|
4241
|
+
function a(e) {
|
|
4242
|
+
n.value.total = e;
|
|
4243
|
+
}
|
|
4244
|
+
function o(e) {
|
|
4245
|
+
n.value.currentPage = e;
|
|
4246
|
+
}
|
|
4247
|
+
function s(e) {
|
|
4248
|
+
n.value.pageSize = e;
|
|
4249
|
+
}
|
|
4250
|
+
function c() {
|
|
4251
|
+
n.value.currentPage = 1;
|
|
4252
|
+
}
|
|
4253
|
+
return {
|
|
4254
|
+
state: n,
|
|
4255
|
+
bindProps: r,
|
|
4256
|
+
indexOffset: i,
|
|
4257
|
+
setTotal: a,
|
|
4258
|
+
setCurrentPage: o,
|
|
4259
|
+
setPageSize: s,
|
|
4260
|
+
resetPage: c
|
|
4261
|
+
};
|
|
4262
|
+
}
|
|
4263
|
+
//#endregion
|
|
4264
|
+
//#region src/components/k-table/composables/useTableRadio.ts
|
|
4265
|
+
function oa(e) {
|
|
4266
|
+
let t = N(""), n = u(() => R(e.columns).some((e) => e.type === "radio"));
|
|
4267
|
+
function r(n) {
|
|
4268
|
+
return t.value = n ? ji(n, R(e.rowKey)) : "", n;
|
|
4269
|
+
}
|
|
4270
|
+
function i() {
|
|
4271
|
+
t.value = "";
|
|
4272
|
+
}
|
|
4273
|
+
function a(n) {
|
|
4274
|
+
t.value = ji(n, R(e.rowKey));
|
|
4275
|
+
}
|
|
4276
|
+
function o() {
|
|
4277
|
+
return t.value;
|
|
4278
|
+
}
|
|
4279
|
+
return {
|
|
4280
|
+
radioSelected: t,
|
|
4281
|
+
hasRadioColumn: n,
|
|
4282
|
+
selectRow: r,
|
|
4283
|
+
clearRadioSelection: i,
|
|
4284
|
+
setRadioSelection: a,
|
|
4285
|
+
getRadioSelection: o
|
|
4286
|
+
};
|
|
4287
|
+
}
|
|
4288
|
+
//#endregion
|
|
4289
|
+
//#region src/components/k-table/composables/useTableRowSort.ts
|
|
4290
|
+
function sa(e) {
|
|
4291
|
+
let t = null;
|
|
4292
|
+
function n() {
|
|
4293
|
+
t?.destroy(), t = null;
|
|
4294
|
+
}
|
|
4295
|
+
function r() {
|
|
4296
|
+
if (n(), !R(e.enabled)) return;
|
|
4297
|
+
let r = e.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody");
|
|
4298
|
+
r && (t = Ze.create(r, {
|
|
4299
|
+
disabled: R(e.disabled),
|
|
4300
|
+
animation: 300,
|
|
4301
|
+
handle: ".sort-handle",
|
|
4302
|
+
filter: ".ignore-elements",
|
|
4303
|
+
preventOnFilter: !0,
|
|
4304
|
+
onEnd: (t) => e.onSortEnd(t)
|
|
4305
|
+
}));
|
|
4306
|
+
}
|
|
4307
|
+
return U(() => [
|
|
4308
|
+
R(e.enabled),
|
|
4309
|
+
R(e.rebindKey),
|
|
4310
|
+
e.tableRef.value
|
|
4311
|
+
], () => {
|
|
4312
|
+
E(r);
|
|
4313
|
+
}, { flush: "post" }), U(() => R(e.disabled), (e) => {
|
|
4314
|
+
t && t.option("disabled", e);
|
|
4315
|
+
}), k(n), {
|
|
4316
|
+
initSortable: () => E(r),
|
|
4317
|
+
destroySortable: n
|
|
4318
|
+
};
|
|
4319
|
+
}
|
|
4320
|
+
//#endregion
|
|
4321
|
+
//#region src/components/k-table/composables/useTableTreeLoad.ts
|
|
4322
|
+
function ca(e) {
|
|
4323
|
+
let t = /* @__PURE__ */ new Map();
|
|
4324
|
+
function n(n) {
|
|
4325
|
+
return (r, i, a) => {
|
|
4326
|
+
let o = ji(r, R(e.rowKey));
|
|
4327
|
+
o != null && t.set(o, {
|
|
4328
|
+
row: r,
|
|
4329
|
+
treeNode: i,
|
|
4330
|
+
resolve: a
|
|
4331
|
+
}), n(r, i, a);
|
|
4332
|
+
};
|
|
4333
|
+
}
|
|
4334
|
+
function r(n) {
|
|
4335
|
+
let r = R(e.load), i = t.get(n);
|
|
4336
|
+
if (!i || !r) return;
|
|
4337
|
+
let a = e.tableRef.value?.store?.states?.lazyTreeNodeMap;
|
|
4338
|
+
a && n != null && (a[String(n)] = []), r(i.row, i.treeNode, i.resolve);
|
|
4339
|
+
}
|
|
4340
|
+
function i() {
|
|
4341
|
+
t.clear();
|
|
4342
|
+
}
|
|
4343
|
+
return {
|
|
4344
|
+
wrapLoad: n,
|
|
4345
|
+
refreshTree: r,
|
|
4346
|
+
clearTreeCache: i
|
|
4347
|
+
};
|
|
4348
|
+
}
|
|
4349
|
+
//#endregion
|
|
4350
|
+
//#region src/components/k-table/composables/useKTable.ts
|
|
4351
|
+
function la(e) {
|
|
4352
|
+
let { props: t, emit: n, attrs: r, slots: i, tableRef: a, queryRef: o } = e, s = N({}), c = N(0), l = u(() => !!t.action), d = u(() => !!t.query?.form?.formConfigs?.length), f = u(() => !!i.header);
|
|
4353
|
+
function p(e) {
|
|
4354
|
+
let n = { ...e };
|
|
4355
|
+
s.value = t.convertParams ? t.convertParams(n) : n;
|
|
4356
|
+
}
|
|
4357
|
+
let m = u(() => {
|
|
4358
|
+
let e = Ri(t.columns, t.selectionShow);
|
|
4359
|
+
return t.disabled && (e = e.filter((e) => e.type !== "operates" && e.prop !== "operates")), e;
|
|
4360
|
+
}), h = ra({
|
|
4361
|
+
columns: () => t.columns,
|
|
4362
|
+
renderColumns: m,
|
|
4363
|
+
enableColumnCache: () => t.enableColumnCache,
|
|
4364
|
+
tableKey: () => t.tableKey,
|
|
4365
|
+
onDisplayChange: (e) => n("column-display-change", e),
|
|
4366
|
+
onLayout: () => a.value?.doLayout()
|
|
4367
|
+
}), g = oa({
|
|
4368
|
+
columns: () => t.columns,
|
|
4369
|
+
rowKey: () => t.rowKey
|
|
4370
|
+
}), _ = ca({
|
|
4371
|
+
tableRef: a,
|
|
4372
|
+
rowKey: () => t.rowKey,
|
|
4373
|
+
load: () => t.load
|
|
4374
|
+
}), v = aa({
|
|
4375
|
+
pagination: () => t.pagination,
|
|
4376
|
+
hasAction: l
|
|
4377
|
+
}), y = ia({
|
|
4378
|
+
action: t.action,
|
|
4379
|
+
params: () => t.params,
|
|
4380
|
+
queryParams: s,
|
|
4381
|
+
responseConfig: () => t.responseConfig,
|
|
4382
|
+
pagination: v,
|
|
4383
|
+
initialLoading: !!(t.action && t.initTable),
|
|
4384
|
+
onDataLoaded: (e, t) => n("data-loaded", e, t)
|
|
4385
|
+
}), b = u(() => t.enableColumnCache ? h.visibleColumns.value : m.value), x = u(() => b.value.map((e, t) => $(e, t)).join("|")), S = u(() => !!(t.addButton || t.selectionShow || f.value || t.enableColumnCache)), ee = u(() => l.value ? y.tableData.value : t.data), C = u(() => t.loading === void 0 ? l.value ? y.loading.value : !1 : t.loading), w = u(() => C.value || !!(l.value && t.initTable && !y.loaded.value)), T = u(() => {
|
|
4386
|
+
let e = { ...r };
|
|
4387
|
+
l.value && "data" in e && delete e.data, t.load && delete e.load;
|
|
4388
|
+
let n = {
|
|
4389
|
+
data: ee.value,
|
|
4390
|
+
rowKey: t.rowKey,
|
|
4391
|
+
border: !0,
|
|
4392
|
+
stripe: !0,
|
|
4393
|
+
maxHeight: t.maxHeight,
|
|
4394
|
+
...e
|
|
4395
|
+
};
|
|
4396
|
+
return t.load && (n.load = _.wrapLoad(t.load)), g.hasRadioColumn.value && n.highlightCurrentRow === void 0 && (n.highlightCurrentRow = r["highlight-current-row"] !== !1), typeof document < "u" && document.documentElement.classList.contains("kayak-micro-embed") && (n.tooltipOptions = {
|
|
4397
|
+
...n.tooltipOptions ?? n["tooltip-options"] ?? {},
|
|
4398
|
+
strategy: "absolute"
|
|
4399
|
+
}), n;
|
|
4400
|
+
});
|
|
4401
|
+
sa({
|
|
4402
|
+
enabled: () => t.sort,
|
|
4403
|
+
disabled: () => t.disabled,
|
|
4404
|
+
tableRef: a,
|
|
4405
|
+
rebindKey: () => x.value,
|
|
4406
|
+
onSortEnd: (e) => {
|
|
4407
|
+
let t = [...ee.value];
|
|
4408
|
+
if (e.oldIndex == null || e.newIndex == null) return;
|
|
4409
|
+
let [r] = t.splice(e.oldIndex, 1);
|
|
4410
|
+
t.splice(e.newIndex, 0, r), n("sort-end", e, t);
|
|
4411
|
+
}
|
|
4412
|
+
});
|
|
4413
|
+
function E() {
|
|
4414
|
+
l.value && y.fetchData();
|
|
4415
|
+
}
|
|
4416
|
+
A(() => {
|
|
4417
|
+
!t.initTable || !t.action || (d.value && p(o.value?.getParams() ?? {}), y.fetchData());
|
|
4418
|
+
});
|
|
4419
|
+
function D(e) {
|
|
4420
|
+
c.value = e.length, n("selection-change", e);
|
|
4421
|
+
}
|
|
4422
|
+
function te(e) {
|
|
4423
|
+
n("sort-change", e);
|
|
4424
|
+
}
|
|
4425
|
+
function O() {
|
|
4426
|
+
a.value?.setCurrentRow();
|
|
4427
|
+
}
|
|
4428
|
+
function k(e) {
|
|
4429
|
+
p(e), v.resetPage(), t.clearCurrentRowOnQuery && O(), n("query", s.value), E();
|
|
4430
|
+
}
|
|
4431
|
+
function j() {
|
|
4432
|
+
n("reset"), t.selectionShow && R(), t.clearCurrentRowOnReset && O();
|
|
4433
|
+
}
|
|
4434
|
+
function ne(e) {
|
|
4435
|
+
v.setCurrentPage(e), n("page-change", e), E();
|
|
4436
|
+
}
|
|
4437
|
+
function M(e) {
|
|
4438
|
+
v.setPageSize(e), n("size-change", e), E();
|
|
4439
|
+
}
|
|
4440
|
+
function P() {
|
|
4441
|
+
n("add");
|
|
4442
|
+
}
|
|
4443
|
+
function F(e, t, r) {
|
|
4444
|
+
n("operate-click", e, t, r);
|
|
4445
|
+
}
|
|
4446
|
+
function re(e) {
|
|
4447
|
+
if (!g.hasRadioColumn.value) return;
|
|
4448
|
+
let t = g.selectRow(e);
|
|
4449
|
+
t && n("radio-change", t, g.radioSelected.value);
|
|
4450
|
+
}
|
|
4451
|
+
function ie(e) {
|
|
4452
|
+
re(e);
|
|
4453
|
+
}
|
|
4454
|
+
function ae(e, t) {
|
|
4455
|
+
h.setColumnVisibleByKey(e, t);
|
|
4456
|
+
}
|
|
4457
|
+
function oe() {
|
|
4458
|
+
return a.value;
|
|
4459
|
+
}
|
|
4460
|
+
function I() {
|
|
4461
|
+
return o.value;
|
|
4462
|
+
}
|
|
4463
|
+
function L() {
|
|
4464
|
+
return a.value?.getSelectionRows() ?? [];
|
|
4465
|
+
}
|
|
4466
|
+
function R() {
|
|
4467
|
+
a.value?.clearSelection(), c.value = 0;
|
|
4468
|
+
}
|
|
4469
|
+
function z(e, t) {
|
|
4470
|
+
a.value?.toggleRowSelection(e, t);
|
|
4471
|
+
}
|
|
4472
|
+
async function B(e = !1) {
|
|
4473
|
+
l.value && await y.refresh(e);
|
|
4474
|
+
}
|
|
4475
|
+
function se() {
|
|
4476
|
+
g.clearRadioSelection(), a.value?.setCurrentRow();
|
|
4477
|
+
}
|
|
4478
|
+
function V(e) {
|
|
4479
|
+
g.setRadioSelection(e);
|
|
4480
|
+
}
|
|
4481
|
+
function H() {
|
|
4482
|
+
return g.getRadioSelection();
|
|
4483
|
+
}
|
|
4484
|
+
function ce(e) {
|
|
4485
|
+
_.refreshTree(e);
|
|
4486
|
+
}
|
|
4487
|
+
return {
|
|
4488
|
+
showQuery: d,
|
|
4489
|
+
showToolbar: S,
|
|
4490
|
+
hasHeaderSlot: f,
|
|
4491
|
+
renderColumns: b,
|
|
4492
|
+
tableProps: T,
|
|
4493
|
+
tableLoading: C,
|
|
4494
|
+
showLoadingEmpty: w,
|
|
4495
|
+
columnSelectorItems: h.selectorItems,
|
|
4496
|
+
paginationBind: v.bindProps,
|
|
4497
|
+
indexOffset: v.indexOffset,
|
|
4498
|
+
selectedCount: c,
|
|
4499
|
+
radioSelected: g.radioSelected,
|
|
4500
|
+
getColumnIdentity: $,
|
|
4501
|
+
handleSelectionChange: D,
|
|
4502
|
+
handleSortChange: te,
|
|
4503
|
+
handleQuery: k,
|
|
4504
|
+
handleQueryReset: j,
|
|
4505
|
+
handlePageChange: ne,
|
|
4506
|
+
handleSizeChange: M,
|
|
4507
|
+
handleAdd: P,
|
|
4508
|
+
handleOperateClick: F,
|
|
4509
|
+
handleRowClick: ie,
|
|
4510
|
+
handleRadioChange: re,
|
|
4511
|
+
handleColumnVisibleChange: ae,
|
|
4512
|
+
resetColumnDisplay: h.resetColumnDisplay,
|
|
4513
|
+
getTableRef: oe,
|
|
4514
|
+
getQueryRef: I,
|
|
4515
|
+
getSelection: L,
|
|
4516
|
+
clearSelection: R,
|
|
4517
|
+
toggleRowSelection: z,
|
|
4518
|
+
refresh: B,
|
|
4519
|
+
clearRadioSelection: se,
|
|
4520
|
+
setRadioSelection: V,
|
|
4521
|
+
getRadioSelection: H,
|
|
4522
|
+
refreshTree: ce
|
|
4523
|
+
};
|
|
4524
|
+
}
|
|
4525
|
+
var ua = {
|
|
4526
|
+
hidePagination: !1,
|
|
4527
|
+
initTable: !0,
|
|
4528
|
+
nullValueFormat: "--",
|
|
4529
|
+
selectionShow: !1,
|
|
4530
|
+
rowKey: "id",
|
|
4531
|
+
maxHeight: 560,
|
|
4532
|
+
addButton: !1,
|
|
4533
|
+
disabled: !1,
|
|
4534
|
+
enableColumnCache: !0,
|
|
4535
|
+
tableKey: "",
|
|
4536
|
+
sort: !1,
|
|
4537
|
+
data: () => [],
|
|
4538
|
+
sortFilter: () => []
|
|
4539
|
+
}, da = { class: "k-table__box" }, fa = { class: "k-table" }, pa = {
|
|
4540
|
+
key: 0,
|
|
4541
|
+
class: "k-table__loading-empty"
|
|
4542
|
+
}, ma = { class: "k-table-footer" }, ha = /*@__PURE__*/ y({
|
|
4543
|
+
name: "KTable",
|
|
4544
|
+
inheritAttrs: !0,
|
|
4545
|
+
__name: "KTable",
|
|
4546
|
+
props: /*@__PURE__*/ C({
|
|
4547
|
+
columns: {},
|
|
4548
|
+
data: {},
|
|
4549
|
+
action: { type: Function },
|
|
4550
|
+
params: {},
|
|
4551
|
+
responseConfig: {},
|
|
4552
|
+
pagination: {},
|
|
4553
|
+
hidePagination: { type: Boolean },
|
|
4554
|
+
initTable: { type: Boolean },
|
|
4555
|
+
loading: { type: Boolean },
|
|
4556
|
+
nullValueFormat: {},
|
|
4557
|
+
selectionShow: { type: Boolean },
|
|
4558
|
+
rowKey: {},
|
|
4559
|
+
maxHeight: {},
|
|
4560
|
+
query: {},
|
|
4561
|
+
convertParams: { type: Function },
|
|
4562
|
+
addButton: { type: [Boolean, String] },
|
|
4563
|
+
disabled: { type: Boolean },
|
|
4564
|
+
clearCurrentRowOnQuery: { type: Boolean },
|
|
4565
|
+
clearCurrentRowOnReset: { type: Boolean },
|
|
4566
|
+
enableColumnCache: { type: Boolean },
|
|
4567
|
+
tableKey: {},
|
|
4568
|
+
sort: { type: Boolean },
|
|
4569
|
+
sortFilter: {},
|
|
4570
|
+
load: { type: Function }
|
|
4571
|
+
}, {
|
|
4572
|
+
...ua,
|
|
4573
|
+
data: () => []
|
|
4574
|
+
}),
|
|
4575
|
+
emits: [
|
|
4576
|
+
"selection-change",
|
|
4577
|
+
"page-change",
|
|
4578
|
+
"size-change",
|
|
4579
|
+
"data-loaded",
|
|
4580
|
+
"query",
|
|
4581
|
+
"reset",
|
|
4582
|
+
"add",
|
|
4583
|
+
"operate-click",
|
|
4584
|
+
"column-display-change",
|
|
4585
|
+
"radio-change",
|
|
4586
|
+
"sort-end",
|
|
4587
|
+
"sort-change"
|
|
4588
|
+
],
|
|
4589
|
+
setup(e, { expose: t, emit: n }) {
|
|
4590
|
+
let r = e, i = n, a = V(), o = N(), s = N(), l = M(la({
|
|
4591
|
+
props: r,
|
|
4592
|
+
emit: i,
|
|
4593
|
+
attrs: B(),
|
|
4594
|
+
slots: a,
|
|
4595
|
+
tableRef: o,
|
|
4596
|
+
queryRef: s
|
|
4597
|
+
})), v = u(() => {
|
|
4598
|
+
let e = /* @__PURE__ */ new Set();
|
|
4599
|
+
a.operates && e.add("operates"), a.index && e.add("index"), a.expand && e.add("expand");
|
|
4600
|
+
for (let t of l.renderColumns) {
|
|
4601
|
+
t.type === "expand" && e.add("expand"), t.prop && a[t.prop] && e.add(t.prop);
|
|
4602
|
+
for (let n of t.operates ?? []) typeof n.slot == "string" && a[n.slot] && e.add(n.slot);
|
|
4603
|
+
}
|
|
4604
|
+
return [...e];
|
|
4605
|
+
});
|
|
4606
|
+
return t({
|
|
4607
|
+
getTableRef: l.getTableRef,
|
|
4608
|
+
getQueryRef: l.getQueryRef,
|
|
4609
|
+
getSelection: l.getSelection,
|
|
4610
|
+
clearSelection: l.clearSelection,
|
|
4611
|
+
toggleRowSelection: l.toggleRowSelection,
|
|
4612
|
+
refresh: l.refresh,
|
|
4613
|
+
clearRadioSelection: l.clearRadioSelection,
|
|
4614
|
+
setRadioSelection: l.setRadioSelection,
|
|
4615
|
+
getRadioSelection: l.getRadioSelection,
|
|
4616
|
+
refreshTree: l.refreshTree
|
|
4617
|
+
}), (t, n) => {
|
|
4618
|
+
let r = ie("loading");
|
|
4619
|
+
return j(), p("div", da, [l.showQuery ? (j(), d(z(ki), T({
|
|
4620
|
+
key: 0,
|
|
4621
|
+
ref_key: "queryRef",
|
|
4622
|
+
ref: s,
|
|
4623
|
+
class: "k-table-query"
|
|
4624
|
+
}, e.query, {
|
|
4625
|
+
onQuery: l.handleQuery,
|
|
4626
|
+
onReset: l.handleQueryReset
|
|
4627
|
+
}), null, 16, ["onQuery", "onReset"])) : f("", !0), m("div", fa, [
|
|
4628
|
+
l.showToolbar ? (j(), d($i, {
|
|
4629
|
+
key: 0,
|
|
4630
|
+
"add-button": e.addButton,
|
|
4631
|
+
"selection-show": e.selectionShow,
|
|
4632
|
+
"selected-count": l.selectedCount,
|
|
4633
|
+
onAdd: l.handleAdd
|
|
4634
|
+
}, h({ _: 2 }, [l.hasHeaderSlot ? {
|
|
4635
|
+
name: "header",
|
|
4636
|
+
fn: W(() => [F(t.$slots, "header", {}, void 0, !0)]),
|
|
4637
|
+
key: "0"
|
|
4638
|
+
} : void 0, e.enableColumnCache ? {
|
|
4639
|
+
name: "extra",
|
|
4640
|
+
fn: W(() => [_(Ki, {
|
|
4641
|
+
items: l.columnSelectorItems,
|
|
4642
|
+
onChange: l.handleColumnVisibleChange,
|
|
4643
|
+
onReset: l.resetColumnDisplay
|
|
4644
|
+
}, null, 8, [
|
|
4645
|
+
"items",
|
|
4646
|
+
"onChange",
|
|
4647
|
+
"onReset"
|
|
4648
|
+
])]),
|
|
4649
|
+
key: "1"
|
|
4650
|
+
} : void 0]), 1032, [
|
|
4651
|
+
"add-button",
|
|
4652
|
+
"selection-show",
|
|
4653
|
+
"selected-count",
|
|
4654
|
+
"onAdd"
|
|
4655
|
+
])) : f("", !0),
|
|
4656
|
+
le((j(), d(z(Fe), T({
|
|
4657
|
+
ref_key: "tableRef",
|
|
4658
|
+
ref: o,
|
|
4659
|
+
class: "k-table__main"
|
|
4660
|
+
}, l.tableProps, {
|
|
4661
|
+
onSelectionChange: l.handleSelectionChange,
|
|
4662
|
+
onSortChange: l.handleSortChange,
|
|
4663
|
+
onRowClick: l.handleRowClick
|
|
4664
|
+
}), {
|
|
4665
|
+
empty: W(() => [l.showLoadingEmpty ? le((j(), p("span", pa, null, 512)), [[r, l.showLoadingEmpty]]) : F(t.$slots, "empty", {}, () => [g(I(t.$attrs.emptyText ?? t.$attrs["empty-text"] ?? "暂无数据"), 1)], !0, 1)]),
|
|
4666
|
+
default: W(() => [e.sort ? (j(), d(z(K), {
|
|
4667
|
+
key: 0,
|
|
4668
|
+
label: "拖拽排序",
|
|
4669
|
+
align: "center",
|
|
4670
|
+
width: "100"
|
|
4671
|
+
}, {
|
|
4672
|
+
default: W(({ row: n, column: r, $index: i }) => [F(t.$slots, "sort", {
|
|
4673
|
+
row: n,
|
|
4674
|
+
column: r,
|
|
4675
|
+
index: i
|
|
4676
|
+
}, () => [m("span", {
|
|
4677
|
+
class: D(e.sortFilter.includes(i) ? "ignore-elements" : "sort-handle k-table__sort-handle"),
|
|
4678
|
+
"aria-hidden": "true"
|
|
4679
|
+
}, "⋮⋮", 2)], !0)]),
|
|
4680
|
+
_: 3
|
|
4681
|
+
})) : f("", !0), (j(!0), p(c, null, P(l.renderColumns, (n, r) => (j(), d(Hi, {
|
|
4682
|
+
key: l.getColumnIdentity(n, r),
|
|
4683
|
+
column: n,
|
|
4684
|
+
"column-index": r,
|
|
4685
|
+
"index-offset": l.indexOffset,
|
|
4686
|
+
"null-value-format": e.nullValueFormat,
|
|
4687
|
+
disabled: e.disabled,
|
|
4688
|
+
"row-key": e.rowKey,
|
|
4689
|
+
"radio-selected": l.radioSelected,
|
|
4690
|
+
onOperateClick: l.handleOperateClick,
|
|
4691
|
+
onRadioSelect: l.handleRadioChange
|
|
4692
|
+
}, h({ _: 2 }, [P(v.value, (e) => ({
|
|
4693
|
+
name: e,
|
|
4694
|
+
fn: W((n) => [F(t.$slots, e, T({ ref_for: !0 }, n ?? {}), void 0, !0)])
|
|
4695
|
+
}))]), 1032, [
|
|
4696
|
+
"column",
|
|
4697
|
+
"column-index",
|
|
4698
|
+
"index-offset",
|
|
4699
|
+
"null-value-format",
|
|
4700
|
+
"disabled",
|
|
4701
|
+
"row-key",
|
|
4702
|
+
"radio-selected",
|
|
4703
|
+
"onOperateClick",
|
|
4704
|
+
"onRadioSelect"
|
|
4705
|
+
]))), 128))]),
|
|
4706
|
+
_: 3
|
|
4707
|
+
}, 16, [
|
|
4708
|
+
"onSelectionChange",
|
|
4709
|
+
"onSortChange",
|
|
4710
|
+
"onRowClick"
|
|
4711
|
+
])), [[r, l.tableLoading]]),
|
|
4712
|
+
m("div", ma, [e.hidePagination ? f("", !0) : (j(), d(z(Kr), T({
|
|
4713
|
+
key: 0,
|
|
4714
|
+
class: "pagination"
|
|
4715
|
+
}, l.paginationBind, {
|
|
4716
|
+
onCurrentChange: l.handlePageChange,
|
|
4717
|
+
onSizeChange: l.handleSizeChange
|
|
4718
|
+
}), null, 16, ["onCurrentChange", "onSizeChange"])), F(t.$slots, "footer", {}, void 0, !0)])
|
|
4719
|
+
])]);
|
|
4720
|
+
};
|
|
4721
|
+
}
|
|
4722
|
+
}), ga = /*#__PURE__*/ e(ha, [["__scopeId", "data-v-ccb6f7c6"]]);
|
|
4723
|
+
//#endregion
|
|
4724
|
+
//#region src/components/k-table/dictOptions.ts
|
|
4725
|
+
function _a(e) {
|
|
4726
|
+
return e.map((e) => ({
|
|
4727
|
+
value: String(e.item_key ?? ""),
|
|
4728
|
+
label: String(e.item_value ?? e.item_key ?? "")
|
|
4729
|
+
}));
|
|
4730
|
+
}
|
|
4731
|
+
//#endregion
|
|
4732
|
+
//#region src/components/k-table/composables/useKTableTemplateRef.ts
|
|
4733
|
+
function va(e) {
|
|
4734
|
+
return H(e);
|
|
4735
|
+
}
|
|
4736
|
+
//#endregion
|
|
4737
|
+
//#region src/components/k-table/composables/useKTableCrossPageSelection.ts
|
|
4738
|
+
function ya(e) {
|
|
4739
|
+
let t = oe([]), n = oe([]), r = oe(!1), i = va(e.tableRefKey ?? "tableRef");
|
|
4740
|
+
function a() {
|
|
4741
|
+
return e.tableRef == null ? i.value : R(e.tableRef);
|
|
4742
|
+
}
|
|
4743
|
+
function o(t) {
|
|
4744
|
+
return String(ji(t, R(e.rowKey)));
|
|
4745
|
+
}
|
|
4746
|
+
function s(e) {
|
|
4747
|
+
t.value = [...e];
|
|
4748
|
+
}
|
|
4749
|
+
function c() {
|
|
4750
|
+
t.value = [];
|
|
4751
|
+
}
|
|
4752
|
+
function l() {
|
|
4753
|
+
n.value = [];
|
|
4754
|
+
}
|
|
4755
|
+
function u(i) {
|
|
4756
|
+
n.value = i;
|
|
4757
|
+
let s = new Set(t.value.map(o));
|
|
4758
|
+
if (R(e.mode) === "single") {
|
|
4759
|
+
let e = i.find((e) => s.has(o(e)));
|
|
4760
|
+
e && a()?.setRadioSelection(e);
|
|
4761
|
+
return;
|
|
4762
|
+
}
|
|
4763
|
+
r.value = !0, E(async () => {
|
|
4764
|
+
let e = a();
|
|
4765
|
+
i.forEach((t) => {
|
|
4766
|
+
s.has(o(t)) && e?.toggleRowSelection(t, !0);
|
|
4767
|
+
}), await E(), r.value = !1;
|
|
4768
|
+
});
|
|
4769
|
+
}
|
|
4770
|
+
function d(e) {
|
|
4771
|
+
if (r.value) return;
|
|
4772
|
+
let i = new Set(n.value.map(o));
|
|
4773
|
+
t.value = [...t.value.filter((e) => !i.has(o(e))), ...e];
|
|
4774
|
+
}
|
|
4775
|
+
function f(e) {
|
|
4776
|
+
t.value = [e];
|
|
4777
|
+
}
|
|
4778
|
+
return {
|
|
4779
|
+
selection: t,
|
|
4780
|
+
pageRows: n,
|
|
4781
|
+
tableRef: i,
|
|
4782
|
+
setSelection: s,
|
|
4783
|
+
clearSelection: c,
|
|
4784
|
+
resetPageRows: l,
|
|
4785
|
+
onDataLoaded: u,
|
|
4786
|
+
onSelectionChange: d,
|
|
4787
|
+
onRadioChange: f
|
|
4788
|
+
};
|
|
4789
|
+
}
|
|
4790
|
+
//#endregion
|
|
4791
|
+
//#region src/components/k-table/report/convertDownloadCol.ts
|
|
4792
|
+
function ba(e) {
|
|
4793
|
+
return e.filter((e) => e.type !== "expand").map((e) => ({
|
|
4794
|
+
sTitle: e.label ?? "",
|
|
4795
|
+
mDataProp: e.prop ?? "",
|
|
4796
|
+
dict: e.dict ?? "",
|
|
4797
|
+
show: ""
|
|
4798
|
+
}));
|
|
4799
|
+
}
|
|
4800
|
+
//#endregion
|
|
4801
|
+
//#region src/components/k-table/report/pickExportColumns.ts
|
|
4802
|
+
function xa(e, t) {
|
|
4803
|
+
let n = e;
|
|
4804
|
+
return t?.excludeLast && (n = n.slice(0, -1)), t?.excludeOperates && (n = n.filter((e) => e.type !== "operates" && e.prop !== "operates")), n.filter((e) => e.type !== "expand" && e.type !== "index" && e.type !== "selection" && e.type !== "radio");
|
|
4805
|
+
}
|
|
4806
|
+
//#endregion
|
|
4807
|
+
//#region src/components/k-table/report/exportKTableReport.ts
|
|
4808
|
+
function Sa(e) {
|
|
4809
|
+
let t = e.tableRef.value?.getQueryRef()?.getParams() ?? {}, n = e.convertParams ? e.convertParams(t) : t, r = xa(e.columns, e);
|
|
4810
|
+
return e.exportApi({
|
|
4811
|
+
globColumnlist: ba(r),
|
|
4812
|
+
jsondata: n
|
|
4813
|
+
});
|
|
4814
|
+
}
|
|
4815
|
+
function Ca(e) {
|
|
4816
|
+
let t = xa(e.columns, e);
|
|
4817
|
+
return e.exportApi({
|
|
4818
|
+
globColumnlist: ba(t),
|
|
4819
|
+
jsondata: e.jsondata
|
|
4820
|
+
});
|
|
4821
|
+
}
|
|
4822
|
+
//#endregion
|
|
4823
|
+
//#region src/components/k-table/report/mergeQueryConfig.ts
|
|
4824
|
+
function wa(e, t) {
|
|
4825
|
+
return e.map((e) => {
|
|
4826
|
+
let n = t[e.id];
|
|
4827
|
+
return n ? {
|
|
4828
|
+
...e,
|
|
4829
|
+
componentProps: {
|
|
4830
|
+
...e.componentProps,
|
|
4831
|
+
...n
|
|
4832
|
+
}
|
|
4833
|
+
} : e;
|
|
4834
|
+
});
|
|
4835
|
+
}
|
|
4836
|
+
function Ta(e, t) {
|
|
4837
|
+
let n = e.form;
|
|
4838
|
+
return n ? {
|
|
4839
|
+
...e,
|
|
4840
|
+
form: {
|
|
4841
|
+
...n,
|
|
4842
|
+
formConfigs: wa(n.formConfigs ?? [], t)
|
|
4843
|
+
}
|
|
4844
|
+
} : e;
|
|
4845
|
+
}
|
|
4846
|
+
function Ea(e, t) {
|
|
4847
|
+
return e.query ? {
|
|
4848
|
+
...e,
|
|
4849
|
+
query: Ta(e.query, t)
|
|
4850
|
+
} : e;
|
|
4851
|
+
}
|
|
4852
|
+
//#endregion
|
|
4853
|
+
//#region src/components/k-table/report/useExportKTableReport.ts
|
|
4854
|
+
function Da(e) {
|
|
4855
|
+
let t = N(!1);
|
|
4856
|
+
async function n() {
|
|
4857
|
+
if (!t.value) {
|
|
4858
|
+
t.value = !0;
|
|
4859
|
+
try {
|
|
4860
|
+
await Sa({
|
|
4861
|
+
tableRef: e.tableRef,
|
|
4862
|
+
columns: R(e.columns),
|
|
4863
|
+
exportApi: e.exportApi,
|
|
4864
|
+
convertParams: e.convertParams,
|
|
4865
|
+
excludeOperates: R(e.excludeOperates),
|
|
4866
|
+
excludeLast: R(e.excludeLast)
|
|
4867
|
+
});
|
|
4868
|
+
} finally {
|
|
4869
|
+
t.value = !1;
|
|
4870
|
+
}
|
|
4871
|
+
}
|
|
4872
|
+
}
|
|
4873
|
+
return {
|
|
4874
|
+
exportTable: n,
|
|
4875
|
+
exportLoading: t
|
|
4876
|
+
};
|
|
4877
|
+
}
|
|
4878
|
+
//#endregion
|
|
4879
|
+
//#region src/components/k-upload/utils/uploadFileValue.ts
|
|
4880
|
+
function Oa(e, t, n = {}) {
|
|
4881
|
+
let r = `${dr(n.listType ?? "text")}${e}`;
|
|
4882
|
+
return [{
|
|
4883
|
+
uid: e,
|
|
4884
|
+
name: t,
|
|
4885
|
+
resource_id: e,
|
|
4886
|
+
file_name: t,
|
|
4887
|
+
imp_id: n.impId,
|
|
4888
|
+
url: r
|
|
4889
|
+
}];
|
|
4890
|
+
}
|
|
4891
|
+
function ka(e, t = {}) {
|
|
4892
|
+
return Array.isArray(e) ? e : typeof e != "string" || !e ? [] : Oa(e, t.fileName ?? e, { listType: t.listType });
|
|
4893
|
+
}
|
|
4894
|
+
function Aa(e, t = {}) {
|
|
4895
|
+
if (typeof e == "string") return e ? {
|
|
4896
|
+
resource_id: e,
|
|
4897
|
+
file_name: t.fileName
|
|
4898
|
+
} : null;
|
|
4899
|
+
if (!Array.isArray(e) || !e.length) return null;
|
|
4900
|
+
let n = e[0];
|
|
4901
|
+
return !n?.resource_id && !n?.imp_id ? null : {
|
|
4902
|
+
resource_id: n.resource_id,
|
|
4903
|
+
file_name: n.file_name ?? n.name,
|
|
4904
|
+
imp_id: n.imp_id,
|
|
4905
|
+
imp_count: n.imp_count
|
|
4906
|
+
};
|
|
4907
|
+
}
|
|
4908
|
+
function ja(e, t = {}) {
|
|
4909
|
+
let n = Aa(e, t);
|
|
4910
|
+
return {
|
|
4911
|
+
resource_id: n?.resource_id ?? "",
|
|
4912
|
+
file_name: n?.file_name ?? t.fileName ?? "",
|
|
4913
|
+
imp_id: n?.imp_id ?? "",
|
|
4914
|
+
imp_count: n?.imp_count
|
|
4915
|
+
};
|
|
4916
|
+
}
|
|
4917
|
+
function Ma(e) {
|
|
4918
|
+
return !!(e.resource_id || e.imp_id);
|
|
4919
|
+
}
|
|
4920
|
+
//#endregion
|
|
4921
|
+
//#region src/components/index.ts
|
|
4922
|
+
var Na = /* @__PURE__ */ $e({
|
|
4923
|
+
DICT_KEY: () => dt,
|
|
4924
|
+
KAffix: () => Pa,
|
|
4925
|
+
KBreadcrumb: () => Fa,
|
|
4926
|
+
KButton: () => Y,
|
|
4927
|
+
KCard: () => hi,
|
|
4928
|
+
KCascader: () => Ia,
|
|
4929
|
+
KCheckbox: () => Ut,
|
|
4930
|
+
KColorPicker: () => La,
|
|
4931
|
+
KDatePicker: () => qt,
|
|
4932
|
+
KDialog: () => ut,
|
|
4933
|
+
KDialogHeader: () => ct,
|
|
4934
|
+
KForm: () => wr,
|
|
4935
|
+
KHandlePage: () => Mr,
|
|
4936
|
+
KIcon: () => Vr,
|
|
4937
|
+
KInput: () => Zt,
|
|
4938
|
+
KLinkButton: () => Gr,
|
|
4939
|
+
KLongPage: () => mi,
|
|
4940
|
+
KPagination: () => Kr,
|
|
4941
|
+
KPanel: () => yi,
|
|
4942
|
+
KPanelQuery: () => ki,
|
|
4943
|
+
KRadio: () => _n,
|
|
4944
|
+
KSelect: () => rn,
|
|
4945
|
+
KTable: () => ga,
|
|
4946
|
+
KTimePicker: () => zn,
|
|
4947
|
+
KUpload: () => hr,
|
|
4948
|
+
countEditorHtmlWords: () => a,
|
|
4949
|
+
countEditorWords: () => o,
|
|
4950
|
+
createUploadFileItem: () => Oa,
|
|
4951
|
+
exportKTableReport: () => Sa,
|
|
4952
|
+
exportKTableReportData: () => Ca,
|
|
4953
|
+
getAllLucideKebabNames: () => Br,
|
|
4954
|
+
getEditorHtml: () => r,
|
|
4955
|
+
getEditorWordCount: () => t,
|
|
4956
|
+
getUploadConfig: () => s,
|
|
4957
|
+
hasUploadSubmitFields: () => Ma,
|
|
4958
|
+
mapGroupDictToOptions: () => _a,
|
|
4959
|
+
pascalToKebab: () => Ir,
|
|
4960
|
+
registerFormComponents: () => vr,
|
|
4961
|
+
resolveLucideIcon: () => Lr,
|
|
4962
|
+
toKEditorValue: () => i,
|
|
4963
|
+
toLucidePascalName: () => Fr,
|
|
4964
|
+
toUploadFiles: () => ka,
|
|
4965
|
+
toUploadSubmitFields: () => ja,
|
|
4966
|
+
updateUploadConfig: () => n,
|
|
4967
|
+
useExportKTableReport: () => Da,
|
|
4968
|
+
useHandlePageInit: () => Nr,
|
|
4969
|
+
useKFormTemplateRef: () => Tr,
|
|
4970
|
+
useKTableCrossPageSelection: () => ya,
|
|
4971
|
+
useKTableTemplateRef: () => va,
|
|
4972
|
+
withQueryFieldOptions: () => Ea
|
|
4973
|
+
}), Pa = et("KAffix"), Fa = et("KBreadcrumb"), Ia = et("KCascader"), La = et("KColorPicker");
|
|
4974
|
+
//#endregion
|
|
4975
|
+
export { Mr as A, Ut as B, Gr as C, Lr as D, Ir as E, zn as F, ut as H, _n as I, rn as L, wr as M, vr as N, Fr as O, hr as P, Zt as R, Kr as S, Br as T, ct as U, dt as V, Y as W, ga as _, Na as a, hi as b, ka as c, Ea as d, Sa as f, _a as g, va as h, La as i, Tr as j, Nr as k, ja as l, ya as m, Fa as n, Oa as o, Ca as p, Ia as r, Ma as s, Pa as t, Da as u, ki as v, Vr as w, mi as x, yi as y, qt as z };
|