@openli1115/lowcode-edit-pro-table 1.0.23
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/CHANGELOG.md +0 -0
- package/README.md +25 -0
- package/build/docs/404.html +47 -0
- package/build/docs/_demos/:uuid +47 -0
- package/build/docs/colorful-button.html +48 -0
- package/build/docs/colorful-input.html +48 -0
- package/build/docs/index.html +48 -0
- package/build/docs/umi.9219e122.js +1 -0
- package/build/docs/umi.a7e52c7a.css +8 -0
- package/build/docs/~demos/:uuid.html +47 -0
- package/build/docs/~demos/colorful-button-demo.html +47 -0
- package/build/docs/~demos/colorful-input-demo.html +47 -0
- package/build/index.css +2 -0
- package/build/index.html +1 -0
- package/build/index.js +53 -0
- package/build/lowcode/assets-daily.json +103 -0
- package/build/lowcode/assets-dev.json +103 -0
- package/build/lowcode/assets-prod.json +103 -0
- package/build/lowcode/designer.html +302 -0
- package/build/lowcode/index.html +304 -0
- package/build/lowcode/index.js +1 -0
- package/build/lowcode/meta.design.js +1 -0
- package/build/lowcode/meta.js +1 -0
- package/build/lowcode/preview.css +1 -0
- package/build/lowcode/preview.html +33 -0
- package/build/lowcode/preview.js +310 -0
- package/build/lowcode/render/default/view.css +1 -0
- package/build/lowcode/render/default/view.js +375 -0
- package/build/lowcode/view.css +1 -0
- package/build/lowcode/view.js +375 -0
- package/dist/BizComps.css +1 -0
- package/dist/BizComps.js +75 -0
- package/dist/BizComps.js.map +1 -0
- package/es/components/PrintButton/index.d.ts +7 -0
- package/es/components/PrintButton/index.js +97 -0
- package/es/components/ProCascaderSelect/index.d.ts +3 -0
- package/es/components/ProCascaderSelect/index.js +48 -0
- package/es/components/ProCheckbox/index.d.ts +14 -0
- package/es/components/ProCheckbox/index.js +59 -0
- package/es/components/ProDatePicker/index.d.ts +3 -0
- package/es/components/ProDatePicker/index.js +45 -0
- package/es/components/ProInput/index.d.ts +10 -0
- package/es/components/ProInput/index.js +53 -0
- package/es/components/ProNextText/index.js +160 -0
- package/es/components/ProNextText/index.scss +283 -0
- package/es/components/ProRadio/index.d.ts +14 -0
- package/es/components/ProRadio/index.js +60 -0
- package/es/components/ProSelect/index.d.ts +3 -0
- package/es/components/ProSelect/index.js +48 -0
- package/es/components/ProTextArea/index.d.ts +3 -0
- package/es/components/ProTextArea/index.js +45 -0
- package/es/components/ProTimePicker/index.d.ts +3 -0
- package/es/components/ProTimePicker/index.js +61 -0
- package/es/components/colorful-button/colorful-button.d.ts +12 -0
- package/es/components/colorful-button/colorful-button.js +29 -0
- package/es/components/colorful-button/index.d.ts +3 -0
- package/es/components/colorful-button/index.js +2 -0
- package/es/components/colorful-button/index.scss +5 -0
- package/es/components/colorful-input/colorful-input.d.ts +8 -0
- package/es/components/colorful-input/colorful-input.js +23 -0
- package/es/components/colorful-input/index.d.ts +3 -0
- package/es/components/colorful-input/index.js +2 -0
- package/es/components/colorful-input/index.scss +5 -0
- package/es/components/edit-pro-table/components/ExportExcelButton.d.ts +7 -0
- package/es/components/edit-pro-table/components/ExportExcelButton.js +91 -0
- package/es/components/edit-pro-table/components/ImportExcelButton.d.ts +6 -0
- package/es/components/edit-pro-table/components/ImportExcelButton.js +105 -0
- package/es/components/edit-pro-table/edit-pro-table.d.ts +38 -0
- package/es/components/edit-pro-table/edit-pro-table.js +458 -0
- package/es/components/edit-pro-table/index.d.ts +3 -0
- package/es/components/edit-pro-table/index.js +2 -0
- package/es/components/pro-table/index.d.ts +3 -0
- package/es/components/pro-table/index.js +2 -0
- package/es/components/pro-table/pro-table.d.ts +25 -0
- package/es/components/pro-table/pro-table.js +144 -0
- package/es/components/utils/index.d.ts +6 -0
- package/es/components/utils/index.js +27 -0
- package/es/context/FormProvider.d.ts +5 -0
- package/es/context/FormProvider.js +32 -0
- package/es/context/useComponentContext.d.ts +4 -0
- package/es/context/useComponentContext.js +29 -0
- package/es/index.d.ts +17 -0
- package/es/index.js +15 -0
- package/es/index.scss +1 -0
- package/es/shared/index.d.ts +7 -0
- package/es/shared/index.js +43 -0
- package/es/style.js +18 -0
- package/es/variables.d.ts +2 -0
- package/es/variables.js +2 -0
- package/es/variables.scss +51 -0
- package/lib/components/PrintButton/index.d.ts +7 -0
- package/lib/components/PrintButton/index.js +102 -0
- package/lib/components/ProCascaderSelect/index.d.ts +3 -0
- package/lib/components/ProCascaderSelect/index.js +53 -0
- package/lib/components/ProCheckbox/index.d.ts +14 -0
- package/lib/components/ProCheckbox/index.js +64 -0
- package/lib/components/ProDatePicker/index.d.ts +3 -0
- package/lib/components/ProDatePicker/index.js +50 -0
- package/lib/components/ProInput/index.d.ts +10 -0
- package/lib/components/ProInput/index.js +58 -0
- package/lib/components/ProNextText/index.js +165 -0
- package/lib/components/ProNextText/index.scss +283 -0
- package/lib/components/ProRadio/index.d.ts +14 -0
- package/lib/components/ProRadio/index.js +65 -0
- package/lib/components/ProSelect/index.d.ts +3 -0
- package/lib/components/ProSelect/index.js +53 -0
- package/lib/components/ProTextArea/index.d.ts +3 -0
- package/lib/components/ProTextArea/index.js +50 -0
- package/lib/components/ProTimePicker/index.d.ts +3 -0
- package/lib/components/ProTimePicker/index.js +66 -0
- package/lib/components/colorful-button/colorful-button.d.ts +12 -0
- package/lib/components/colorful-button/colorful-button.js +34 -0
- package/lib/components/colorful-button/index.d.ts +3 -0
- package/lib/components/colorful-button/index.js +7 -0
- package/lib/components/colorful-button/index.scss +5 -0
- package/lib/components/colorful-input/colorful-input.d.ts +8 -0
- package/lib/components/colorful-input/colorful-input.js +28 -0
- package/lib/components/colorful-input/index.d.ts +3 -0
- package/lib/components/colorful-input/index.js +7 -0
- package/lib/components/colorful-input/index.scss +5 -0
- package/lib/components/edit-pro-table/components/ExportExcelButton.d.ts +7 -0
- package/lib/components/edit-pro-table/components/ExportExcelButton.js +96 -0
- package/lib/components/edit-pro-table/components/ImportExcelButton.d.ts +6 -0
- package/lib/components/edit-pro-table/components/ImportExcelButton.js +110 -0
- package/lib/components/edit-pro-table/edit-pro-table.d.ts +38 -0
- package/lib/components/edit-pro-table/edit-pro-table.js +463 -0
- package/lib/components/edit-pro-table/index.d.ts +3 -0
- package/lib/components/edit-pro-table/index.js +7 -0
- package/lib/components/pro-table/index.d.ts +3 -0
- package/lib/components/pro-table/index.js +7 -0
- package/lib/components/pro-table/pro-table.d.ts +25 -0
- package/lib/components/pro-table/pro-table.js +150 -0
- package/lib/components/utils/index.d.ts +6 -0
- package/lib/components/utils/index.js +31 -0
- package/lib/context/FormProvider.d.ts +5 -0
- package/lib/context/FormProvider.js +37 -0
- package/lib/context/useComponentContext.d.ts +4 -0
- package/lib/context/useComponentContext.js +34 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.js +38 -0
- package/lib/index.scss +1 -0
- package/lib/shared/index.d.ts +7 -0
- package/lib/shared/index.js +48 -0
- package/lib/style.js +18 -0
- package/lib/variables.d.ts +2 -0
- package/lib/variables.js +5 -0
- package/lib/variables.scss +51 -0
- package/lowcode/auto-complete/meta.ts +1159 -0
- package/lowcode/combobox/meta.ts +10330 -0
- package/lowcode/component-provider/meta.ts +56 -0
- package/lowcode/date-picker/meta.ts +1912 -0
- package/lowcode/edit-pro-table/actionColumnFields.ts +265 -0
- package/lowcode/edit-pro-table/meta.ts +642 -0
- package/lowcode/edit-pro-table/snippets.ts +20 -0
- package/lowcode/form-provider/meta.ts +78 -0
- package/lowcode/group/meta.ts +333 -0
- package/lowcode/month-picker/meta.ts +9860 -0
- package/lowcode/next-text/meta.ts +180 -0
- package/lowcode/next-text/snippets.ts +27 -0
- package/lowcode/option/meta.ts +364 -0
- package/lowcode/option-group/meta.ts +259 -0
- package/lowcode/password/meta.ts +1121 -0
- package/lowcode/print-button/iconprint.png +0 -0
- package/lowcode/print-button/meta.ts +168 -0
- package/lowcode/print-button/printer.svg +1 -0
- package/lowcode/pro-cascader-select/adaptor.ts +23 -0
- package/lowcode/pro-cascader-select/meta.design.ts +440 -0
- package/lowcode/pro-cascader-select/meta.ts +493 -0
- package/lowcode/pro-cascader-select/snippets.design.ts +46 -0
- package/lowcode/pro-cascader-select/snippets.ts +39 -0
- package/lowcode/pro-checkbox/meta.ts +257 -0
- package/lowcode/pro-checkbox/snippets.ts +15 -0
- package/lowcode/pro-date-picker/meta.ts +310 -0
- package/lowcode/pro-date-picker/snippets.ts +50 -0
- package/lowcode/pro-input/meta.ts +649 -0
- package/lowcode/pro-input/snippets.ts +40 -0
- package/lowcode/pro-next-text/meta.ts +182 -0
- package/lowcode/pro-next-text/snippets.ts +27 -0
- package/lowcode/pro-radio/meta.ts +105 -0
- package/lowcode/pro-radio/radio-group.png +0 -0
- package/lowcode/pro-radio/snippets.ts +42 -0
- package/lowcode/pro-radio-group/meta.ts +291 -0
- package/lowcode/pro-select/meta.design.ts +231 -0
- package/lowcode/pro-select/meta.ts +316 -0
- package/lowcode/pro-select/snippets.design.ts +37 -0
- package/lowcode/pro-select/snippets.ts +29 -0
- package/lowcode/pro-select-option/meta.ts +36 -0
- package/lowcode/pro-table/meta.ts +437 -0
- package/lowcode/pro-table/snippets.ts +20 -0
- package/lowcode/pro-text-area/meta.ts +454 -0
- package/lowcode/pro-time-picker/meta.ts +361 -0
- package/lowcode/pro-time-picker/snippets.ts +18 -0
- package/lowcode/quarter-picker/meta.ts +1559 -0
- package/lowcode/range-picker/meta.ts +10097 -0
- package/lowcode/text-area/meta.ts +823 -0
- package/lowcode/time-picker/meta.ts +1636 -0
- package/lowcode/utils/component-wrapper.ts +36 -0
- package/lowcode/utils/index.ts +81 -0
- package/lowcode/utils/parse-data.ts +113 -0
- package/lowcode/week-picker/meta.ts +9781 -0
- package/lowcode/year-picker/meta.ts +9829 -0
- package/lowcode_es/auto-complete/meta.d.ts +22 -0
- package/lowcode_es/auto-complete/meta.js +1046 -0
- package/lowcode_es/combobox/meta.d.ts +22 -0
- package/lowcode_es/combobox/meta.js +1 -0
- package/lowcode_es/component-provider/meta.d.ts +22 -0
- package/lowcode_es/component-provider/meta.js +48 -0
- package/lowcode_es/date-picker/meta.d.ts +22 -0
- package/lowcode_es/date-picker/meta.js +1722 -0
- package/lowcode_es/edit-pro-table/actionColumnFields.d.ts +12 -0
- package/lowcode_es/edit-pro-table/actionColumnFields.js +232 -0
- package/lowcode_es/edit-pro-table/meta.d.ts +22 -0
- package/lowcode_es/edit-pro-table/meta.js +591 -0
- package/lowcode_es/edit-pro-table/snippets.d.ts +2 -0
- package/lowcode_es/edit-pro-table/snippets.js +16 -0
- package/lowcode_es/form-provider/meta.d.ts +22 -0
- package/lowcode_es/form-provider/meta.js +69 -0
- package/lowcode_es/group/meta.d.ts +22 -0
- package/lowcode_es/group/meta.js +301 -0
- package/lowcode_es/meta.js +194 -0
- package/lowcode_es/month-picker/meta.d.ts +22 -0
- package/lowcode_es/month-picker/meta.js +9064 -0
- package/lowcode_es/next-text/meta.js +154 -0
- package/lowcode_es/next-text/snippets.js +25 -0
- package/lowcode_es/option/meta.d.ts +22 -0
- package/lowcode_es/option/meta.js +325 -0
- package/lowcode_es/option-group/meta.d.ts +22 -0
- package/lowcode_es/option-group/meta.js +231 -0
- package/lowcode_es/password/meta.d.ts +22 -0
- package/lowcode_es/password/meta.js +1026 -0
- package/lowcode_es/print-button/iconprint.png +0 -0
- package/lowcode_es/print-button/meta.d.ts +22 -0
- package/lowcode_es/print-button/meta.js +143 -0
- package/lowcode_es/print-button/printer.svg +1 -0
- package/lowcode_es/pro-cascader-select/adaptor.d.ts +1 -0
- package/lowcode_es/pro-cascader-select/adaptor.js +29 -0
- package/lowcode_es/pro-cascader-select/meta.d.ts +287 -0
- package/lowcode_es/pro-cascader-select/meta.design.d.ts +304 -0
- package/lowcode_es/pro-cascader-select/meta.design.js +388 -0
- package/lowcode_es/pro-cascader-select/meta.js +435 -0
- package/lowcode_es/pro-cascader-select/snippets.d.ts +25 -0
- package/lowcode_es/pro-cascader-select/snippets.design.d.ts +38 -0
- package/lowcode_es/pro-cascader-select/snippets.design.js +44 -0
- package/lowcode_es/pro-cascader-select/snippets.js +30 -0
- package/lowcode_es/pro-checkbox/meta.d.ts +164 -0
- package/lowcode_es/pro-checkbox/meta.js +230 -0
- package/lowcode_es/pro-checkbox/snippets.d.ts +12 -0
- package/lowcode_es/pro-checkbox/snippets.js +13 -0
- package/lowcode_es/pro-date-picker/meta.d.ts +119 -0
- package/lowcode_es/pro-date-picker/meta.js +278 -0
- package/lowcode_es/pro-date-picker/snippets.d.ts +9 -0
- package/lowcode_es/pro-date-picker/snippets.js +49 -0
- package/lowcode_es/pro-input/meta.d.ts +273 -0
- package/lowcode_es/pro-input/meta.js +585 -0
- package/lowcode_es/pro-input/snippets.d.ts +14 -0
- package/lowcode_es/pro-input/snippets.js +39 -0
- package/lowcode_es/pro-next-text/meta.d.ts +130 -0
- package/lowcode_es/pro-next-text/meta.js +155 -0
- package/lowcode_es/pro-next-text/snippets.d.ts +12 -0
- package/lowcode_es/pro-next-text/snippets.js +25 -0
- package/lowcode_es/pro-radio/meta.d.ts +50 -0
- package/lowcode_es/pro-radio/meta.js +87 -0
- package/lowcode_es/pro-radio/radio-group.png +0 -0
- package/lowcode_es/pro-radio/snippets.d.ts +14 -0
- package/lowcode_es/pro-radio/snippets.js +35 -0
- package/lowcode_es/pro-radio-group/meta.d.ts +192 -0
- package/lowcode_es/pro-radio-group/meta.js +263 -0
- package/lowcode_es/pro-select/meta.d.ts +271 -0
- package/lowcode_es/pro-select/meta.design.d.ts +220 -0
- package/lowcode_es/pro-select/meta.design.js +216 -0
- package/lowcode_es/pro-select/meta.js +288 -0
- package/lowcode_es/pro-select/snippets.d.ts +17 -0
- package/lowcode_es/pro-select/snippets.design.d.ts +17 -0
- package/lowcode_es/pro-select/snippets.design.js +34 -0
- package/lowcode_es/pro-select/snippets.js +22 -0
- package/lowcode_es/pro-select-option/meta.js +33 -0
- package/lowcode_es/pro-table/meta.d.ts +22 -0
- package/lowcode_es/pro-table/meta.js +449 -0
- package/lowcode_es/pro-table/snippets.d.ts +2 -0
- package/lowcode_es/pro-table/snippets.js +16 -0
- package/lowcode_es/pro-text-area/meta.d.ts +245 -0
- package/lowcode_es/pro-text-area/meta.js +414 -0
- package/lowcode_es/pro-time-picker/meta.d.ts +244 -0
- package/lowcode_es/pro-time-picker/meta.js +318 -0
- package/lowcode_es/pro-time-picker/snippets.d.ts +16 -0
- package/lowcode_es/pro-time-picker/snippets.js +15 -0
- package/lowcode_es/quarter-picker/meta.d.ts +22 -0
- package/lowcode_es/quarter-picker/meta.js +1407 -0
- package/lowcode_es/range-picker/meta.d.ts +22 -0
- package/lowcode_es/range-picker/meta.js +9281 -0
- package/lowcode_es/text-area/meta.d.ts +22 -0
- package/lowcode_es/text-area/meta.js +736 -0
- package/lowcode_es/time-picker/meta.d.ts +22 -0
- package/lowcode_es/time-picker/meta.js +1475 -0
- package/lowcode_es/utils/component-wrapper.d.ts +11 -0
- package/lowcode_es/utils/component-wrapper.js +38 -0
- package/lowcode_es/utils/index.d.ts +10 -0
- package/lowcode_es/utils/index.js +79 -0
- package/lowcode_es/utils/parse-data.d.ts +25 -0
- package/lowcode_es/utils/parse-data.js +89 -0
- package/lowcode_es/view.js +18 -0
- package/lowcode_es/week-picker/meta.d.ts +22 -0
- package/lowcode_es/week-picker/meta.js +8989 -0
- package/lowcode_es/year-picker/meta.d.ts +22 -0
- package/lowcode_es/year-picker/meta.js +9035 -0
- package/lowcode_lib/auto-complete/meta.d.ts +22 -0
- package/lowcode_lib/auto-complete/meta.js +1051 -0
- package/lowcode_lib/combobox/meta.d.ts +22 -0
- package/lowcode_lib/combobox/meta.js +1 -0
- package/lowcode_lib/component-provider/meta.d.ts +22 -0
- package/lowcode_lib/component-provider/meta.js +53 -0
- package/lowcode_lib/date-picker/meta.d.ts +22 -0
- package/lowcode_lib/date-picker/meta.js +1727 -0
- package/lowcode_lib/edit-pro-table/actionColumnFields.d.ts +12 -0
- package/lowcode_lib/edit-pro-table/actionColumnFields.js +237 -0
- package/lowcode_lib/edit-pro-table/meta.d.ts +22 -0
- package/lowcode_lib/edit-pro-table/meta.js +596 -0
- package/lowcode_lib/edit-pro-table/snippets.d.ts +2 -0
- package/lowcode_lib/edit-pro-table/snippets.js +20 -0
- package/lowcode_lib/form-provider/meta.d.ts +22 -0
- package/lowcode_lib/form-provider/meta.js +74 -0
- package/lowcode_lib/group/meta.d.ts +22 -0
- package/lowcode_lib/group/meta.js +306 -0
- package/lowcode_lib/meta.js +198 -0
- package/lowcode_lib/month-picker/meta.d.ts +22 -0
- package/lowcode_lib/month-picker/meta.js +9069 -0
- package/lowcode_lib/next-text/meta.js +156 -0
- package/lowcode_lib/next-text/snippets.js +27 -0
- package/lowcode_lib/option/meta.d.ts +22 -0
- package/lowcode_lib/option/meta.js +330 -0
- package/lowcode_lib/option-group/meta.d.ts +22 -0
- package/lowcode_lib/option-group/meta.js +236 -0
- package/lowcode_lib/password/meta.d.ts +22 -0
- package/lowcode_lib/password/meta.js +1031 -0
- package/lowcode_lib/print-button/iconprint.png +0 -0
- package/lowcode_lib/print-button/meta.d.ts +22 -0
- package/lowcode_lib/print-button/meta.js +148 -0
- package/lowcode_lib/print-button/printer.svg +1 -0
- package/lowcode_lib/pro-cascader-select/adaptor.d.ts +1 -0
- package/lowcode_lib/pro-cascader-select/adaptor.js +32 -0
- package/lowcode_lib/pro-cascader-select/meta.d.ts +287 -0
- package/lowcode_lib/pro-cascader-select/meta.design.d.ts +304 -0
- package/lowcode_lib/pro-cascader-select/meta.design.js +393 -0
- package/lowcode_lib/pro-cascader-select/meta.js +440 -0
- package/lowcode_lib/pro-cascader-select/snippets.d.ts +25 -0
- package/lowcode_lib/pro-cascader-select/snippets.design.d.ts +38 -0
- package/lowcode_lib/pro-cascader-select/snippets.design.js +49 -0
- package/lowcode_lib/pro-cascader-select/snippets.js +34 -0
- package/lowcode_lib/pro-checkbox/meta.d.ts +164 -0
- package/lowcode_lib/pro-checkbox/meta.js +235 -0
- package/lowcode_lib/pro-checkbox/snippets.d.ts +12 -0
- package/lowcode_lib/pro-checkbox/snippets.js +17 -0
- package/lowcode_lib/pro-date-picker/meta.d.ts +119 -0
- package/lowcode_lib/pro-date-picker/meta.js +283 -0
- package/lowcode_lib/pro-date-picker/snippets.d.ts +9 -0
- package/lowcode_lib/pro-date-picker/snippets.js +53 -0
- package/lowcode_lib/pro-input/meta.d.ts +273 -0
- package/lowcode_lib/pro-input/meta.js +590 -0
- package/lowcode_lib/pro-input/snippets.d.ts +14 -0
- package/lowcode_lib/pro-input/snippets.js +43 -0
- package/lowcode_lib/pro-next-text/meta.d.ts +130 -0
- package/lowcode_lib/pro-next-text/meta.js +160 -0
- package/lowcode_lib/pro-next-text/snippets.d.ts +12 -0
- package/lowcode_lib/pro-next-text/snippets.js +29 -0
- package/lowcode_lib/pro-radio/meta.d.ts +50 -0
- package/lowcode_lib/pro-radio/meta.js +92 -0
- package/lowcode_lib/pro-radio/radio-group.png +0 -0
- package/lowcode_lib/pro-radio/snippets.d.ts +14 -0
- package/lowcode_lib/pro-radio/snippets.js +40 -0
- package/lowcode_lib/pro-radio-group/meta.d.ts +192 -0
- package/lowcode_lib/pro-radio-group/meta.js +267 -0
- package/lowcode_lib/pro-select/meta.d.ts +271 -0
- package/lowcode_lib/pro-select/meta.design.d.ts +220 -0
- package/lowcode_lib/pro-select/meta.design.js +221 -0
- package/lowcode_lib/pro-select/meta.js +293 -0
- package/lowcode_lib/pro-select/snippets.d.ts +17 -0
- package/lowcode_lib/pro-select/snippets.design.d.ts +17 -0
- package/lowcode_lib/pro-select/snippets.design.js +39 -0
- package/lowcode_lib/pro-select/snippets.js +26 -0
- package/lowcode_lib/pro-select-option/meta.js +35 -0
- package/lowcode_lib/pro-table/meta.d.ts +22 -0
- package/lowcode_lib/pro-table/meta.js +454 -0
- package/lowcode_lib/pro-table/snippets.d.ts +2 -0
- package/lowcode_lib/pro-table/snippets.js +20 -0
- package/lowcode_lib/pro-text-area/meta.d.ts +245 -0
- package/lowcode_lib/pro-text-area/meta.js +418 -0
- package/lowcode_lib/pro-time-picker/meta.d.ts +244 -0
- package/lowcode_lib/pro-time-picker/meta.js +323 -0
- package/lowcode_lib/pro-time-picker/snippets.d.ts +16 -0
- package/lowcode_lib/pro-time-picker/snippets.js +19 -0
- package/lowcode_lib/quarter-picker/meta.d.ts +22 -0
- package/lowcode_lib/quarter-picker/meta.js +1412 -0
- package/lowcode_lib/range-picker/meta.d.ts +22 -0
- package/lowcode_lib/range-picker/meta.js +9286 -0
- package/lowcode_lib/text-area/meta.d.ts +22 -0
- package/lowcode_lib/text-area/meta.js +741 -0
- package/lowcode_lib/time-picker/meta.d.ts +22 -0
- package/lowcode_lib/time-picker/meta.js +1480 -0
- package/lowcode_lib/utils/component-wrapper.d.ts +11 -0
- package/lowcode_lib/utils/component-wrapper.js +43 -0
- package/lowcode_lib/utils/index.d.ts +10 -0
- package/lowcode_lib/utils/index.js +84 -0
- package/lowcode_lib/utils/parse-data.d.ts +25 -0
- package/lowcode_lib/utils/parse-data.js +93 -0
- package/lowcode_lib/view.js +28 -0
- package/lowcode_lib/week-picker/meta.d.ts +22 -0
- package/lowcode_lib/week-picker/meta.js +8994 -0
- package/lowcode_lib/year-picker/meta.d.ts +22 -0
- package/lowcode_lib/year-picker/meta.js +9040 -0
- package/package.json +109 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import _Button from "antd/es/button";
|
|
2
|
+
import _Card from "antd/es/card";
|
|
3
|
+
import _Space from "antd/es/space";
|
|
4
|
+
import _message from "antd/es/message";
|
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
6
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
7
|
+
import _Popconfirm from "antd/es/popconfirm";
|
|
8
|
+
import _Form from "antd/es/form";
|
|
9
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
10
|
+
var _excluded = ["tableName", "columns", "dataSource", "exportButton", "importButton", "importTemplateList", "tableHeaderBold", "tableHeaderSize", "rowKey", "screen_inner_id", "bind_inner_field", "headerTitle", "toolBarRender", "scroll", "loading", "rowCheck", "pagination", "actionColumnProps", "onSubmit"],
|
|
11
|
+
_excluded2 = ["index"];
|
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useEffect, useRef, useState } from 'react';
|
|
15
|
+
import { EditableProTable } from '@ant-design/pro-components';
|
|
16
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
17
|
+
import moment from 'moment';
|
|
18
|
+
// 导入分页配置类型
|
|
19
|
+
import ImportExcelButton from "./components/ImportExcelButton";
|
|
20
|
+
import ExportExcelButton from "./components/ExportExcelButton";
|
|
21
|
+
var EditProTable = function EditProTable(_ref) {
|
|
22
|
+
var tableName = _ref.tableName,
|
|
23
|
+
_ref$columns = _ref.columns,
|
|
24
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
25
|
+
_ref$dataSource = _ref.dataSource,
|
|
26
|
+
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
27
|
+
exportButton = _ref.exportButton,
|
|
28
|
+
importButton = _ref.importButton,
|
|
29
|
+
importTemplateList = _ref.importTemplateList,
|
|
30
|
+
tableHeaderBold = _ref.tableHeaderBold,
|
|
31
|
+
tableHeaderSize = _ref.tableHeaderSize,
|
|
32
|
+
rowKey = _ref.rowKey,
|
|
33
|
+
screen_inner_id = _ref.screen_inner_id,
|
|
34
|
+
_ref$bind_inner_field = _ref.bind_inner_field,
|
|
35
|
+
bind_inner_field = _ref$bind_inner_field === void 0 ? 'selected_flag' : _ref$bind_inner_field,
|
|
36
|
+
headerTitle = _ref.headerTitle,
|
|
37
|
+
toolBarRender = _ref.toolBarRender,
|
|
38
|
+
_ref$scroll = _ref.scroll,
|
|
39
|
+
scroll = _ref$scroll === void 0 ? {} : _ref$scroll,
|
|
40
|
+
_ref$loading = _ref.loading,
|
|
41
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
42
|
+
_ref$rowCheck = _ref.rowCheck,
|
|
43
|
+
rowCheck = _ref$rowCheck === void 0 ? false : _ref$rowCheck,
|
|
44
|
+
pagination = _ref.pagination,
|
|
45
|
+
actionColumnProps = _ref.actionColumnProps,
|
|
46
|
+
onSubmit = _ref.onSubmit,
|
|
47
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
48
|
+
var actionRef = useRef();
|
|
49
|
+
var _useState = useState([]),
|
|
50
|
+
selectedRowKeys = _useState[0],
|
|
51
|
+
setSelectedRowKeys = _useState[1];
|
|
52
|
+
var _useState2 = useState([]),
|
|
53
|
+
selectedColumns = _useState2[0],
|
|
54
|
+
setSelectedColumns = _useState2[1];
|
|
55
|
+
var _useState3 = useState([]),
|
|
56
|
+
editableKeys = _useState3[0],
|
|
57
|
+
setEditableRowKeys = _useState3[1];
|
|
58
|
+
var _useState4 = useState([]),
|
|
59
|
+
originalColumns = _useState4[0],
|
|
60
|
+
setOriginalColumns = _useState4[1];
|
|
61
|
+
var _useState5 = useState([]),
|
|
62
|
+
tableDataSource = _useState5[0],
|
|
63
|
+
setTableDataSource = _useState5[1];
|
|
64
|
+
var _useState6 = useState([]),
|
|
65
|
+
originalDataSource = _useState6[0],
|
|
66
|
+
setOriginalDataSource = _useState6[1];
|
|
67
|
+
var _Form$useForm = _Form.useForm(),
|
|
68
|
+
form = _Form$useForm[0];
|
|
69
|
+
var screenStructure = screen_inner_id ? screen_inner_id.split('__')[1] : '';
|
|
70
|
+
console.log('editProTable otherProps', otherProps);
|
|
71
|
+
console.log('dataSource', dataSource);
|
|
72
|
+
// console.log('screen_inner_id', screen_inner_id);
|
|
73
|
+
// console.log('bind_inner_field', bind_inner_field);
|
|
74
|
+
|
|
75
|
+
var generateProTableColumns = function generateProTableColumns(columns) {
|
|
76
|
+
// console.log('generateProTableColumns', columns);
|
|
77
|
+
columns.forEach(function (column, index) {
|
|
78
|
+
if (column.hasCheckbox) return;
|
|
79
|
+
column.title = /*#__PURE__*/React.createElement("span", null, column.title, column.required ? /*#__PURE__*/React.createElement("span", {
|
|
80
|
+
style: {
|
|
81
|
+
color: 'red',
|
|
82
|
+
marginLeft: 5
|
|
83
|
+
}
|
|
84
|
+
}, "*") : null);
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var extraColumns = [{
|
|
88
|
+
title: 'ID',
|
|
89
|
+
dataIndex: 'id',
|
|
90
|
+
width: 100,
|
|
91
|
+
fixed: 'left',
|
|
92
|
+
hideInTable: true
|
|
93
|
+
}, {
|
|
94
|
+
title: (actionColumnProps === null || actionColumnProps === void 0 ? void 0 : actionColumnProps.title) || '操作',
|
|
95
|
+
valueType: 'option',
|
|
96
|
+
width: (actionColumnProps === null || actionColumnProps === void 0 ? void 0 : actionColumnProps.width) || 150,
|
|
97
|
+
fixed: (actionColumnProps === null || actionColumnProps === void 0 ? void 0 : actionColumnProps.fixed) || false,
|
|
98
|
+
render: function render(text, record, _, action) {
|
|
99
|
+
return [/*#__PURE__*/React.createElement("a", {
|
|
100
|
+
key: "editable",
|
|
101
|
+
onClick: function onClick() {
|
|
102
|
+
var _action$startEditable;
|
|
103
|
+
action === null || action === void 0 ? void 0 : (_action$startEditable = action.startEditable) === null || _action$startEditable === void 0 ? void 0 : _action$startEditable.call(action, record[rowKey]);
|
|
104
|
+
}
|
|
105
|
+
}, "\u7F16\u8F91"), /*#__PURE__*/React.createElement(_Popconfirm, {
|
|
106
|
+
key: "delete",
|
|
107
|
+
title: "\u786E\u5B9A\u5220\u9664\u6B64\u884C\u5417\uFF1F",
|
|
108
|
+
onConfirm: function onConfirm() {
|
|
109
|
+
return handleDelete(record);
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
112
|
+
style: {
|
|
113
|
+
color: '#ff4d4f'
|
|
114
|
+
}
|
|
115
|
+
}, "\u5220\u9664"))];
|
|
116
|
+
}
|
|
117
|
+
}];
|
|
118
|
+
useEffect(function () {
|
|
119
|
+
console.log('columns', columns);
|
|
120
|
+
setOriginalColumns(columns);
|
|
121
|
+
// console.log('editProTable columns', columns);
|
|
122
|
+
// console.log('editProTable dataSource', dataSource);
|
|
123
|
+
if (dataSource.length) {
|
|
124
|
+
var convertedDataSource = convertTimeData(dataSource, 'moment');
|
|
125
|
+
setTableDataSource(convertedDataSource);
|
|
126
|
+
setOriginalDataSource(JSON.parse(JSON.stringify(convertedDataSource)));
|
|
127
|
+
setSelectedRowKeys([]);
|
|
128
|
+
window.selectedRowKeys = [];
|
|
129
|
+
}
|
|
130
|
+
}, [dataSource]);
|
|
131
|
+
|
|
132
|
+
// 辅助函数:移除对象中的指定属性
|
|
133
|
+
var omit = function omit(obj, keys) {
|
|
134
|
+
var result = _extends({}, obj);
|
|
135
|
+
keys.forEach(function (key) {
|
|
136
|
+
return delete result[key];
|
|
137
|
+
});
|
|
138
|
+
return result;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// 比较数据并标记状态
|
|
142
|
+
var compareAndMarkStatus = function compareAndMarkStatus(newData) {
|
|
143
|
+
// console.log('newData', newData);
|
|
144
|
+
var markedData = newData.map(function (row) {
|
|
145
|
+
// 新数据中找不到对应的原始数据,说明是新增的
|
|
146
|
+
var originalRow = originalDataSource.find(function (origin) {
|
|
147
|
+
return origin.id === row.id;
|
|
148
|
+
});
|
|
149
|
+
if (!originalRow) {
|
|
150
|
+
return _extends({}, row, {
|
|
151
|
+
inner_status: 'add'
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 比较数据是否有变化(排除 inner_status 字段)
|
|
156
|
+
var columnDataIndices = originalColumns.map(function (col) {
|
|
157
|
+
return col.dataIndex;
|
|
158
|
+
}).filter(function (dataIndex) {
|
|
159
|
+
return dataIndex !== undefined;
|
|
160
|
+
});
|
|
161
|
+
var currentData = {};
|
|
162
|
+
var originalData = {};
|
|
163
|
+
columnDataIndices.forEach(function (key) {
|
|
164
|
+
// 将 date/time 字段转换成moment对象比较
|
|
165
|
+
var columnItem = originalColumns.find(function (col) {
|
|
166
|
+
return col.dataIndex === key;
|
|
167
|
+
});
|
|
168
|
+
if (columnItem && ['date', 'time'].includes(columnItem.valueType || '')) {
|
|
169
|
+
// Convert both values to moment objects for proper comparison
|
|
170
|
+
currentData[key] = row[key] ? moment.isMoment(row[key]) ? row[key] : moment(row[key]) : null;
|
|
171
|
+
originalData[key] = originalRow[key] ? moment.isMoment(originalRow[key]) ? originalRow[key] : moment(originalRow[key]) : null;
|
|
172
|
+
} else {
|
|
173
|
+
currentData[key] = row[key];
|
|
174
|
+
originalData[key] = originalRow[key];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
var hasChanged = JSON.stringify(currentData) !== JSON.stringify(originalData);
|
|
178
|
+
return hasChanged ? _extends({}, row, {
|
|
179
|
+
inner_status: 'edit'
|
|
180
|
+
}) : row;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// 找出被删除的数据
|
|
184
|
+
var deletedRows = originalDataSource.filter(function (origin) {
|
|
185
|
+
return !newData.find(function (row) {
|
|
186
|
+
return row.id === origin.id;
|
|
187
|
+
});
|
|
188
|
+
}).map(function (origin) {
|
|
189
|
+
// 如果原始数据是新增的,则直接移除
|
|
190
|
+
if (origin.inner_status === 'add') {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
// 其他情况标记为删除
|
|
194
|
+
return _extends({}, origin, {
|
|
195
|
+
inner_status: 'delete'
|
|
196
|
+
});
|
|
197
|
+
}).filter(Boolean);
|
|
198
|
+
markedData = [].concat(markedData, deletedRows);
|
|
199
|
+
markedData.forEach(function (row, rowIndex) {
|
|
200
|
+
Object.keys(row).forEach(function (columnKey) {
|
|
201
|
+
// 如果是日期或时间格式且有值,则格式化为对应的日期或者时间格式字符串
|
|
202
|
+
var columnItem = columns.find(function (col) {
|
|
203
|
+
return col.dataIndex === columnKey;
|
|
204
|
+
});
|
|
205
|
+
if (columnItem && columnItem.valueType === 'date' && typeof row[columnKey] === 'string') {
|
|
206
|
+
markedData[rowIndex][columnKey] = moment(row[columnKey]); //.format('YYYY-MM-DD');
|
|
207
|
+
}
|
|
208
|
+
if (columnItem && columnItem.valueType === 'time' && typeof row[columnKey] === 'string') {
|
|
209
|
+
markedData[rowIndex][columnKey] = moment(row[columnKey]); //.format('HH:mm:ss');
|
|
210
|
+
}
|
|
211
|
+
// 如果开启了选中行,且绑定了内表字段,该行的该内表字段传值'x'
|
|
212
|
+
if (rowCheck && bind_inner_field) {
|
|
213
|
+
markedData[rowIndex][bind_inner_field] = window.selectedRowKeys.includes(row[rowKey]) ? 'x' : '';
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
return markedData;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// 只在初始化 dataSource 时,把日期和时间组件的字符串格式的值转为 moment 对象
|
|
221
|
+
var convertTimeData = function convertTimeData(data, toType) {
|
|
222
|
+
if (toType === void 0) {
|
|
223
|
+
toType = 'moment';
|
|
224
|
+
}
|
|
225
|
+
return data.map(function (row) {
|
|
226
|
+
var newRow = _extends({}, row);
|
|
227
|
+
Object.keys(newRow).forEach(function (key) {
|
|
228
|
+
var col = columns.find(function (c) {
|
|
229
|
+
return c.dataIndex === key;
|
|
230
|
+
});
|
|
231
|
+
if (!col || !['time', 'date'].includes(col.valueType)) return;
|
|
232
|
+
var value = newRow[key];
|
|
233
|
+
if (toType === 'moment') {
|
|
234
|
+
if (!value || value === '') {
|
|
235
|
+
newRow[key] = null;
|
|
236
|
+
} else if (typeof value === 'string') {
|
|
237
|
+
var format = col.valueType === 'time' ? 'HH:mm:ss' : 'YYYY-MM-DD HH:mm:ss';
|
|
238
|
+
var m = moment(value, format, true);
|
|
239
|
+
newRow[key] = m.isValid() ? m : null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
return newRow;
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
var handleUpdateData = function handleUpdateData(data, changeTableData) {
|
|
247
|
+
if (changeTableData === void 0) {
|
|
248
|
+
changeTableData = true;
|
|
249
|
+
}
|
|
250
|
+
var newData = JSON.parse(JSON.stringify(data));
|
|
251
|
+
if (changeTableData) {
|
|
252
|
+
setTableDataSource(newData);
|
|
253
|
+
}
|
|
254
|
+
var markedData = compareAndMarkStatus(newData);
|
|
255
|
+
console.log('markedData', markedData);
|
|
256
|
+
if (!screenStructure) return;
|
|
257
|
+
screenStructure && window.screenStructures && (window.screenStructures[screenStructure] = markedData);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// 处理保存
|
|
261
|
+
var handleSave = /*#__PURE__*/function () {
|
|
262
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(key, row) {
|
|
263
|
+
var newData, index, restRow, rowIndex;
|
|
264
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
265
|
+
while (1) switch (_context.prev = _context.next) {
|
|
266
|
+
case 0:
|
|
267
|
+
console.log('handleSave row', row);
|
|
268
|
+
console.log('handleSave originalColumns', originalColumns);
|
|
269
|
+
originalColumns.forEach(function (columnItem) {
|
|
270
|
+
var _columnItem$title, _columnItem$title$pro, _columnItem$title$pro2;
|
|
271
|
+
var title = typeof columnItem.title === 'object' ? (_columnItem$title = columnItem.title) === null || _columnItem$title === void 0 ? void 0 : (_columnItem$title$pro = _columnItem$title.props) === null || _columnItem$title$pro === void 0 ? void 0 : (_columnItem$title$pro2 = _columnItem$title$pro.children) === null || _columnItem$title$pro2 === void 0 ? void 0 : _columnItem$title$pro2[0] : columnItem.title;
|
|
272
|
+
if (columnItem && columnItem.required && !row[columnItem.dataIndex]) {
|
|
273
|
+
_message.error("\u5B57\u6BB5 " + title + " \u662F\u5FC5\u586B\u9879");
|
|
274
|
+
throw new Error("\u5B57\u6BB5 " + title + " \u662F\u5FC5\u586B\u9879");
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
newData = JSON.parse(JSON.stringify(tableDataSource));
|
|
278
|
+
index = row.index, restRow = _objectWithoutPropertiesLoose(row, _excluded2);
|
|
279
|
+
rowIndex = newData.findIndex(function (item) {
|
|
280
|
+
return item.id === key;
|
|
281
|
+
});
|
|
282
|
+
if (rowIndex > -1) {
|
|
283
|
+
newData[rowIndex] = restRow;
|
|
284
|
+
} else {
|
|
285
|
+
newData.push(restRow);
|
|
286
|
+
}
|
|
287
|
+
handleUpdateData(newData);
|
|
288
|
+
case 1:
|
|
289
|
+
case "end":
|
|
290
|
+
return _context.stop();
|
|
291
|
+
}
|
|
292
|
+
}, _callee);
|
|
293
|
+
}));
|
|
294
|
+
return function handleSave(_x, _x2) {
|
|
295
|
+
return _ref2.apply(this, arguments);
|
|
296
|
+
};
|
|
297
|
+
}();
|
|
298
|
+
|
|
299
|
+
// 处理删除
|
|
300
|
+
var handleDelete = function handleDelete(record) {
|
|
301
|
+
var newData = tableDataSource.filter(function (item) {
|
|
302
|
+
return item.id !== record.id;
|
|
303
|
+
});
|
|
304
|
+
handleUpdateData(newData);
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// 处理新增
|
|
308
|
+
var handleAdd = function handleAdd() {
|
|
309
|
+
var _actionRef$current, _actionRef$current$ad;
|
|
310
|
+
var newRow = {
|
|
311
|
+
id: (Math.random() * 1000000).toFixed(0)
|
|
312
|
+
};
|
|
313
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ad = _actionRef$current.addEditRecord) === null || _actionRef$current$ad === void 0 ? void 0 : _actionRef$current$ad.call(_actionRef$current, newRow);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// 行选中
|
|
317
|
+
var handleRowChange = /*#__PURE__*/function () {
|
|
318
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(key, row) {
|
|
319
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
320
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
321
|
+
case 0:
|
|
322
|
+
// console.log('handleRowChange', key, row);
|
|
323
|
+
setSelectedRowKeys(key);
|
|
324
|
+
window.selectedRowKeys = key;
|
|
325
|
+
setTimeout(function () {
|
|
326
|
+
var newData = JSON.parse(JSON.stringify(tableDataSource));
|
|
327
|
+
handleUpdateData(newData);
|
|
328
|
+
}, 500);
|
|
329
|
+
case 1:
|
|
330
|
+
case "end":
|
|
331
|
+
return _context2.stop();
|
|
332
|
+
}
|
|
333
|
+
}, _callee2);
|
|
334
|
+
}));
|
|
335
|
+
return function handleRowChange(_x3, _x4) {
|
|
336
|
+
return _ref3.apply(this, arguments);
|
|
337
|
+
};
|
|
338
|
+
}();
|
|
339
|
+
|
|
340
|
+
// 处理导入
|
|
341
|
+
var handleImport = /*#__PURE__*/function () {
|
|
342
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(response) {
|
|
343
|
+
var newData, newColumns;
|
|
344
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
345
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
346
|
+
case 0:
|
|
347
|
+
if (!(!response || !response.columns || !response.data || !response.data.length)) {
|
|
348
|
+
_context3.next = 1;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
return _context3.abrupt("return");
|
|
352
|
+
case 1:
|
|
353
|
+
newData = response.data.map(function (item, index) {
|
|
354
|
+
return _extends({
|
|
355
|
+
id: index
|
|
356
|
+
}, item);
|
|
357
|
+
});
|
|
358
|
+
newColumns = response.columns;
|
|
359
|
+
setOriginalColumns(newColumns);
|
|
360
|
+
setTableDataSource(newData);
|
|
361
|
+
setOriginalDataSource(newData);
|
|
362
|
+
if (screenStructure) {
|
|
363
|
+
_context3.next = 2;
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
return _context3.abrupt("return");
|
|
367
|
+
case 2:
|
|
368
|
+
screenStructure && window.screenStructures && (window.screenStructures[screenStructure] = newData);
|
|
369
|
+
// screenStructure && window.updateGlobalStructure && window.updateGlobalStructure({[screenStructure]: newData});
|
|
370
|
+
case 3:
|
|
371
|
+
case "end":
|
|
372
|
+
return _context3.stop();
|
|
373
|
+
}
|
|
374
|
+
}, _callee3);
|
|
375
|
+
}));
|
|
376
|
+
return function handleImport(_x5) {
|
|
377
|
+
return _ref4.apply(this, arguments);
|
|
378
|
+
};
|
|
379
|
+
}();
|
|
380
|
+
var tableClassName = 'edit-pro-table';
|
|
381
|
+
if (tableHeaderBold) {
|
|
382
|
+
tableClassName += ' th-bold';
|
|
383
|
+
}
|
|
384
|
+
if (tableHeaderSize) {
|
|
385
|
+
tableClassName += " th-font-" + tableHeaderSize;
|
|
386
|
+
}
|
|
387
|
+
generateProTableColumns(originalColumns);
|
|
388
|
+
return /*#__PURE__*/React.createElement(_Card, {
|
|
389
|
+
bordered: false,
|
|
390
|
+
bodyStyle: {
|
|
391
|
+
padding: 0
|
|
392
|
+
},
|
|
393
|
+
style: {
|
|
394
|
+
width: '100%'
|
|
395
|
+
}
|
|
396
|
+
}, (exportButton || importButton) && /*#__PURE__*/React.createElement(_Card, {
|
|
397
|
+
bordered: false,
|
|
398
|
+
bodyStyle: {
|
|
399
|
+
padding: '0 0 12px'
|
|
400
|
+
}
|
|
401
|
+
}, /*#__PURE__*/React.createElement(_Space, null, exportButton && /*#__PURE__*/React.createElement(ExportExcelButton, {
|
|
402
|
+
tableDataSource: tableDataSource,
|
|
403
|
+
columns: originalColumns,
|
|
404
|
+
tableName: tableName
|
|
405
|
+
}), importButton && /*#__PURE__*/React.createElement(ImportExcelButton, {
|
|
406
|
+
importTemplateList: importTemplateList,
|
|
407
|
+
onImport: handleImport
|
|
408
|
+
}))), /*#__PURE__*/React.createElement(EditableProTable, _extends({}, otherProps, {
|
|
409
|
+
rowKey: rowKey,
|
|
410
|
+
rowSelection: rowKey && rowCheck ? {
|
|
411
|
+
selectedRowKeys: selectedRowKeys,
|
|
412
|
+
onChange: handleRowChange
|
|
413
|
+
} : false,
|
|
414
|
+
actionRef: actionRef,
|
|
415
|
+
headerTitle: headerTitle,
|
|
416
|
+
recordCreatorProps: false // 关闭默认的新建按钮
|
|
417
|
+
,
|
|
418
|
+
search: false,
|
|
419
|
+
columns: [].concat(originalColumns, extraColumns),
|
|
420
|
+
value: tableDataSource,
|
|
421
|
+
loading: loading,
|
|
422
|
+
editable: {
|
|
423
|
+
form: form,
|
|
424
|
+
editableKeys: editableKeys,
|
|
425
|
+
onSave: handleSave,
|
|
426
|
+
onChange: setEditableRowKeys,
|
|
427
|
+
actionRender: function actionRender(row, config, dom) {
|
|
428
|
+
return [dom.save, dom.cancel];
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
scroll: scroll,
|
|
432
|
+
pagination: _extends({
|
|
433
|
+
showSizeChanger: true,
|
|
434
|
+
showQuickJumper: true
|
|
435
|
+
}, pagination, {
|
|
436
|
+
defaultPageSize: 10,
|
|
437
|
+
showTotal: function showTotal(total) {
|
|
438
|
+
return "\u5171 " + total + " \u6761\u6570\u636E";
|
|
439
|
+
},
|
|
440
|
+
pageSizeOptions: ['10', '20', '30', '50', '100']
|
|
441
|
+
}),
|
|
442
|
+
className: tableClassName
|
|
443
|
+
})), /*#__PURE__*/React.createElement(_Card, {
|
|
444
|
+
bordered: false,
|
|
445
|
+
bodyStyle: {
|
|
446
|
+
padding: '0 0 40px'
|
|
447
|
+
},
|
|
448
|
+
style: {
|
|
449
|
+
width: '100%'
|
|
450
|
+
}
|
|
451
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
452
|
+
type: "dashed",
|
|
453
|
+
onClick: handleAdd,
|
|
454
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
455
|
+
block: true
|
|
456
|
+
}, "\u65B0\u589E\u4E00\u884C")));
|
|
457
|
+
};
|
|
458
|
+
export default EditProTable;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ProColumns } from '@ant-design/pro-components';
|
|
3
|
+
import type { TablePaginationConfig } from 'antd/es/table';
|
|
4
|
+
interface ProTableProps {
|
|
5
|
+
rowKey?: string;
|
|
6
|
+
tableName?: string;
|
|
7
|
+
columns?: ProColumns[];
|
|
8
|
+
dataSource?: [];
|
|
9
|
+
headerTitle?: string;
|
|
10
|
+
exportButton?: boolean;
|
|
11
|
+
importButton?: boolean;
|
|
12
|
+
importTemplateList?: string;
|
|
13
|
+
tableHeaderBold?: boolean;
|
|
14
|
+
tableHeaderSize?: string;
|
|
15
|
+
screen_inner_id?: string;
|
|
16
|
+
toolBarRender?: boolean;
|
|
17
|
+
scroll?: {
|
|
18
|
+
x?: number | string;
|
|
19
|
+
y?: number | string;
|
|
20
|
+
};
|
|
21
|
+
pagination?: false | TablePaginationConfig;
|
|
22
|
+
}
|
|
23
|
+
declare const ProTable: React.FC<ProTableProps>;
|
|
24
|
+
export type { ProTableProps };
|
|
25
|
+
export default ProTable;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import _Card from "antd/es/card";
|
|
2
|
+
import _Space from "antd/es/space";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
6
|
+
var _excluded = ["rowKey", "columns", "dataSource", "tableName", "headerTitle", "exportButton", "importButton", "importTemplateList", "tableHeaderBold", "tableHeaderSize", "toolBarRender", "screen_inner_id", "scroll", "pagination"];
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { useEffect, useState } from 'react';
|
|
10
|
+
import { ProTable as OriginalProTable } from '@ant-design/pro-components';
|
|
11
|
+
import ImportExcelButton from "../edit-pro-table/components/ImportExcelButton";
|
|
12
|
+
import ExportExcelButton from "../edit-pro-table/components/ExportExcelButton";
|
|
13
|
+
var ProTable = function ProTable(_ref) {
|
|
14
|
+
var _ref$rowKey = _ref.rowKey,
|
|
15
|
+
rowKey = _ref$rowKey === void 0 ? 'id' : _ref$rowKey,
|
|
16
|
+
_ref$columns = _ref.columns,
|
|
17
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
18
|
+
_ref$dataSource = _ref.dataSource,
|
|
19
|
+
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
20
|
+
tableName = _ref.tableName,
|
|
21
|
+
headerTitle = _ref.headerTitle,
|
|
22
|
+
exportButton = _ref.exportButton,
|
|
23
|
+
importButton = _ref.importButton,
|
|
24
|
+
importTemplateList = _ref.importTemplateList,
|
|
25
|
+
tableHeaderBold = _ref.tableHeaderBold,
|
|
26
|
+
tableHeaderSize = _ref.tableHeaderSize,
|
|
27
|
+
toolBarRender = _ref.toolBarRender,
|
|
28
|
+
screen_inner_id = _ref.screen_inner_id,
|
|
29
|
+
_ref$scroll = _ref.scroll,
|
|
30
|
+
scroll = _ref$scroll === void 0 ? {} : _ref$scroll,
|
|
31
|
+
pagination = _ref.pagination,
|
|
32
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
33
|
+
var _useState = useState([]),
|
|
34
|
+
tableDataSource = _useState[0],
|
|
35
|
+
setTableDataSource = _useState[1];
|
|
36
|
+
var _useState2 = useState([]),
|
|
37
|
+
originalColumns = _useState2[0],
|
|
38
|
+
setOriginalColumns = _useState2[1];
|
|
39
|
+
var screenStructure = screen_inner_id ? screen_inner_id.split('__')[1] : '';
|
|
40
|
+
console.log('proTable otherProps', otherProps);
|
|
41
|
+
console.log('proTable dataSource', dataSource);
|
|
42
|
+
var extraColumns = [{
|
|
43
|
+
title: 'ID',
|
|
44
|
+
dataIndex: 'id',
|
|
45
|
+
width: 100,
|
|
46
|
+
fixed: 'left',
|
|
47
|
+
hideInTable: true
|
|
48
|
+
}];
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
setOriginalColumns(columns);
|
|
51
|
+
if (dataSource.length) {
|
|
52
|
+
setTableDataSource(dataSource);
|
|
53
|
+
}
|
|
54
|
+
}, [dataSource]);
|
|
55
|
+
|
|
56
|
+
// 处理导入
|
|
57
|
+
var handleImport = /*#__PURE__*/function () {
|
|
58
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
59
|
+
var newData;
|
|
60
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
61
|
+
while (1) switch (_context.prev = _context.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
if (!(!response || !response.columns || !response.data || !response.data.length)) {
|
|
64
|
+
_context.next = 1;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
return _context.abrupt("return");
|
|
68
|
+
case 1:
|
|
69
|
+
newData = response.data.map(function (item, index) {
|
|
70
|
+
return _extends({
|
|
71
|
+
id: index
|
|
72
|
+
}, item);
|
|
73
|
+
});
|
|
74
|
+
setOriginalColumns(response.columns);
|
|
75
|
+
setTableDataSource(newData);
|
|
76
|
+
if (screenStructure) {
|
|
77
|
+
_context.next = 2;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
return _context.abrupt("return");
|
|
81
|
+
case 2:
|
|
82
|
+
screenStructure && window.screenStructures && (window.screenStructures[screenStructure] = newData);
|
|
83
|
+
case 3:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
86
|
+
}
|
|
87
|
+
}, _callee);
|
|
88
|
+
}));
|
|
89
|
+
return function handleImport(_x) {
|
|
90
|
+
return _ref2.apply(this, arguments);
|
|
91
|
+
};
|
|
92
|
+
}();
|
|
93
|
+
var tableClassName = 'pro-table';
|
|
94
|
+
if (tableHeaderBold) {
|
|
95
|
+
tableClassName += ' th-bold';
|
|
96
|
+
}
|
|
97
|
+
if (tableHeaderSize) {
|
|
98
|
+
tableClassName += " th-font-" + tableHeaderSize;
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/React.createElement(_Card, {
|
|
101
|
+
bordered: false,
|
|
102
|
+
bodyStyle: {
|
|
103
|
+
padding: 0
|
|
104
|
+
},
|
|
105
|
+
style: {
|
|
106
|
+
width: '100%'
|
|
107
|
+
}
|
|
108
|
+
}, (exportButton || importButton) && /*#__PURE__*/React.createElement(_Card, {
|
|
109
|
+
bordered: false,
|
|
110
|
+
bodyStyle: {
|
|
111
|
+
padding: '0 0 12px'
|
|
112
|
+
}
|
|
113
|
+
}, /*#__PURE__*/React.createElement(_Space, null, exportButton && /*#__PURE__*/React.createElement(ExportExcelButton, {
|
|
114
|
+
tableDataSource: tableDataSource,
|
|
115
|
+
columns: originalColumns,
|
|
116
|
+
tableName: tableName
|
|
117
|
+
}), importButton && /*#__PURE__*/React.createElement(ImportExcelButton, {
|
|
118
|
+
importTemplateList: importTemplateList,
|
|
119
|
+
onImport: handleImport
|
|
120
|
+
}))), /*#__PURE__*/React.createElement(OriginalProTable, _extends({}, otherProps, {
|
|
121
|
+
rowKey: rowKey,
|
|
122
|
+
headerTitle: headerTitle,
|
|
123
|
+
search: false,
|
|
124
|
+
columns: [].concat(originalColumns, extraColumns),
|
|
125
|
+
dataSource: tableDataSource,
|
|
126
|
+
scroll: scroll,
|
|
127
|
+
pagination: _extends({
|
|
128
|
+
showSizeChanger: true,
|
|
129
|
+
showQuickJumper: true
|
|
130
|
+
}, pagination, {
|
|
131
|
+
defaultPageSize: 10,
|
|
132
|
+
showTotal: function showTotal(total) {
|
|
133
|
+
return "\u5171 " + total + " \u6761\u6570\u636E";
|
|
134
|
+
},
|
|
135
|
+
pageSizeOptions: ['10', '20', '30', '50', '100']
|
|
136
|
+
}),
|
|
137
|
+
toolBarRender: false,
|
|
138
|
+
style: {
|
|
139
|
+
width: '100%'
|
|
140
|
+
},
|
|
141
|
+
className: tableClassName
|
|
142
|
+
})));
|
|
143
|
+
};
|
|
144
|
+
export default ProTable;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const updateScreenStructure: (screen_structure: any, screen_structure_field: any, value: any) => void;
|
|
2
|
+
export declare const getStructureFieldName: (screen_structure: string, screen_structure_field: string) => {
|
|
3
|
+
structureName: string;
|
|
4
|
+
structureField: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const baseUrl: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export var updateScreenStructure = function updateScreenStructure(screen_structure, screen_structure_field, value) {
|
|
2
|
+
console.log('value', value);
|
|
3
|
+
if (screen_structure && window.screenStructures) {
|
|
4
|
+
var structureName = screen_structure.split('__')[1];
|
|
5
|
+
var structureField = screen_structure_field.split('__')[1];
|
|
6
|
+
if (!window.screenStructures[structureName]) {
|
|
7
|
+
window.screenStructures[structureName] = {};
|
|
8
|
+
}
|
|
9
|
+
window.screenStructures[structureName][structureField] = value;
|
|
10
|
+
console.log('update screenStructures', value, structureName, structureField);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export var getStructureFieldName = function getStructureFieldName(screen_structure, screen_structure_field) {
|
|
14
|
+
if (screen_structure && screen_structure_field) {
|
|
15
|
+
var structureName = screen_structure.split('__')[1];
|
|
16
|
+
var structureField = screen_structure_field.split('__')[1];
|
|
17
|
+
return {
|
|
18
|
+
structureName: structureName,
|
|
19
|
+
structureField: structureField
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
structureName: '',
|
|
24
|
+
structureField: ''
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export var baseUrl = "https://" + window.location.hostname + ":18080/prod-api";
|