linkmore-design 1.0.64 → 1.0.68
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/README.md +1 -1
- package/dist/Approval/demos/basic.d.ts +2 -0
- package/dist/Approval/handle.d.ts +11 -0
- package/dist/Approval/index.d.ts +4 -0
- package/dist/Approval/style/index.d.ts +1 -0
- package/dist/Approval/type.d.ts +55 -0
- package/dist/Approval/util.d.ts +26 -0
- package/dist/AutoComplete/index.d.ts +2 -1
- package/dist/Calendar/demos/basic.d.ts +2 -0
- package/dist/Calendar/index.d.ts +4 -0
- package/dist/Calendar/style/index.d.ts +1 -0
- package/dist/CardTable/hooks/usePagination.d.ts +1 -1
- package/dist/CardTable/utils.d.ts +2 -2
- package/dist/Carousel/demos/basic.d.ts +2 -0
- package/dist/Carousel/index.d.ts +3 -0
- package/dist/Carousel/style/index.d.ts +1 -0
- package/dist/CkFilter/components/CascaderFilter.d.ts +1 -1
- package/dist/Collapse/demos/basic.d.ts +2 -0
- package/dist/Collapse/index.d.ts +3 -0
- package/dist/Collapse/style/index.d.ts +1 -0
- package/dist/Comment/demos/basic.d.ts +2 -0
- package/dist/Comment/index.d.ts +3 -0
- package/dist/Comment/style/index.d.ts +1 -0
- package/dist/Form/index.d.ts +1 -1
- package/dist/LmEditTable/EditTable.d.ts +1 -0
- package/dist/LmFilter/components/CascaderFilter.d.ts +1 -1
- package/dist/LmFilter/components/CheckboxFilter.d.ts +1 -1
- package/dist/LmFilter/components/DateFilter.d.ts +1 -1
- package/dist/LmFilter/components/SelectFilter.d.ts +1 -1
- package/dist/LmFilter/filterFns/index.d.ts +5 -0
- package/dist/LmSelect/useCheckboxOptions.d.ts +1 -1
- package/dist/LmTable/components/DndContainer.d.ts +5 -0
- package/dist/LmTable/components/sortableBoxCol.d.ts +5 -0
- package/dist/LmTable/components/sortableItemCol.d.ts +1 -0
- package/dist/LmTable/demos/musort.d.ts +2 -0
- package/dist/LmTable/demos/tableColSort.d.ts +2 -0
- package/dist/LmUpload/LmUpload.d.ts +6 -0
- package/dist/LmUpload/UploadList/ItemPicture.d.ts +4 -0
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/dist/LmUpload/UploadList/ItemText.d.ts +4 -0
- package/dist/LmUpload/UploadList/RenderItem.d.ts +6 -0
- package/dist/LmUpload/UploadList/index.d.ts +4 -0
- package/dist/LmUpload/body/Progress.d.ts +4 -0
- package/dist/LmUpload/body/UploadCore.d.ts +4 -0
- package/dist/LmUpload/body/UploadPicture.d.ts +4 -0
- package/dist/LmUpload/components/card.d.ts +2 -0
- package/dist/LmUpload/demos/basic.d.ts +2 -0
- package/dist/LmUpload/fns/index.d.ts +16 -0
- package/dist/LmUpload/index.d.ts +2 -0
- package/dist/LmUpload/style/index.d.ts +1 -0
- package/dist/LmUpload/utils.d.ts +4 -0
- package/dist/LmUpload/view/index.d.ts +4 -0
- package/dist/LmUpload/wrapper/Upload.d.ts +4 -0
- package/dist/LmUpload/wrapper/UploadContainer.d.ts +4 -0
- package/dist/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/dist/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/dist/LmUpload/wrapper/reducer.d.ts +8 -0
- package/dist/Modal/index.d.ts +1 -1
- package/dist/Popconfirm/demos/basic.d.ts +2 -0
- package/dist/Popconfirm/index.d.ts +3 -0
- package/dist/Popconfirm/style/index.d.ts +1 -0
- package/dist/Progress/demos/basic.d.ts +2 -0
- package/dist/Progress/demos/circle.d.ts +2 -0
- package/dist/Progress/demos/dynamic.d.ts +2 -0
- package/dist/Progress/demos/small.d.ts +2 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/style/index.d.ts +1 -0
- package/dist/Segmented/demos/basic.d.ts +2 -0
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/style/index.d.ts +1 -0
- package/dist/Slider/demos/basic.d.ts +2 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/style/index.d.ts +1 -0
- package/dist/Statistic/demos/basic.d.ts +2 -0
- package/dist/Statistic/index.d.ts +3 -0
- package/dist/Statistic/style/index.d.ts +1 -0
- package/dist/TimePicker/demos/basic.d.ts +3 -0
- package/dist/TimePicker/index.d.ts +3 -0
- package/dist/TimePicker/style/index.d.ts +1 -0
- package/dist/Timeline/demos/basic.d.ts +2 -0
- package/dist/Timeline/index.d.ts +3 -0
- package/dist/Timeline/style/index.d.ts +1 -0
- package/dist/Transfer/demos/basic.d.ts +2 -0
- package/dist/Transfer/index.d.ts +3 -0
- package/dist/Transfer/style/index.d.ts +1 -0
- package/dist/TreeSelect/demos/basic.d.ts +2 -0
- package/dist/TreeSelect/index.d.ts +3 -0
- package/dist/TreeSelect/style/index.d.ts +1 -0
- package/dist/hooks/useFullscreen/demos/useInModal.d.ts +2 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.umd.js +3970 -1406
- package/dist/index.umd.min.js +6 -6
- package/es/Alert/index.js +27 -5
- package/es/Alert/style/index.css +1 -1
- package/es/Approval/handle.d.ts +11 -0
- package/es/Approval/handle.js +138 -0
- package/es/Approval/index.d.ts +4 -0
- package/es/Approval/index.js +461 -0
- package/es/Approval/style/index.css +696 -0
- package/es/Approval/style/index.d.ts +1 -0
- package/es/Approval/style/index.js +1 -0
- package/es/Approval/type.d.ts +55 -0
- package/es/Approval/type.js +97 -0
- package/es/Approval/util.d.ts +26 -0
- package/es/Approval/util.js +132 -0
- package/es/AutoComplete/index.d.ts +2 -1
- package/es/Calendar/index.d.ts +4 -0
- package/es/Calendar/index.js +3 -0
- package/es/Calendar/style/index.css +505 -0
- package/es/Calendar/style/index.d.ts +1 -0
- package/es/Calendar/style/index.js +1 -0
- package/es/Carousel/index.d.ts +3 -0
- package/es/Carousel/index.js +3 -0
- package/es/Carousel/style/index.css +505 -0
- package/es/Carousel/style/index.d.ts +1 -0
- package/es/Carousel/style/index.js +1 -0
- package/es/Collapse/index.d.ts +3 -0
- package/es/Collapse/index.js +3 -0
- package/es/Collapse/style/index.css +505 -0
- package/es/Collapse/style/index.d.ts +1 -0
- package/es/Collapse/style/index.js +1 -0
- package/es/Comment/index.d.ts +3 -0
- package/es/Comment/index.js +3 -0
- package/es/Comment/style/index.css +505 -0
- package/es/Comment/style/index.d.ts +1 -0
- package/es/Comment/style/index.js +1 -0
- package/es/CustomTableOption/index.js +6 -6
- package/es/Form/container.js +17 -1
- package/es/Form/index.d.ts +1 -1
- package/es/Form/index.js +5 -2
- package/es/Form/style/index.css +18 -3
- package/es/LmEditTable/DragHandle.js +2 -1
- package/es/LmEditTable/EditTable.d.ts +1 -0
- package/es/LmEditTable/EditTable.js +145 -52
- package/es/LmEditTable/style/index.css +12 -0
- package/es/LmFilter/LmFilter.js +2 -0
- package/es/LmFilter/components/DropdownFIlter.js +0 -1
- package/es/LmFilter/customFilter/index.js +2 -1
- package/es/LmFilter/customFilter/saveModal.js +5 -6
- package/es/LmFilter/filterFns/index.js +8 -2
- package/es/LmFilter/wrapper/Filter.js +3 -2
- package/es/LmSelect/NormalSelect.js +5 -1
- package/es/LmSelect/style/index.css +2 -1
- package/es/LmSelect/useCheckboxOptions.d.ts +1 -1
- package/es/LmSelect/useCheckboxOptions.js +2 -1
- package/es/LmTable/Table.js +89 -46
- package/es/LmTable/components/DndContainer.d.ts +5 -0
- package/es/LmTable/components/DndContainer.js +35 -0
- package/es/LmTable/components/sortableBoxCol.js +24 -0
- package/es/LmTable/components/sortableItemCol.js +54 -0
- package/es/LmUpload/LmUpload.d.ts +6 -0
- package/es/LmUpload/LmUpload.js +58 -0
- package/es/LmUpload/UploadList/ItemPicture.d.ts +4 -0
- package/es/LmUpload/UploadList/ItemPicture.js +25 -0
- package/es/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/es/LmUpload/UploadList/ItemPictureCard.js +126 -0
- package/es/LmUpload/UploadList/ItemText.d.ts +4 -0
- package/es/LmUpload/UploadList/ItemText.js +25 -0
- package/es/LmUpload/UploadList/RenderItem.d.ts +6 -0
- package/es/LmUpload/UploadList/RenderItem.js +31 -0
- package/es/LmUpload/UploadList/index.d.ts +4 -0
- package/es/LmUpload/UploadList/index.js +22 -0
- package/es/LmUpload/body/Progress.d.ts +4 -0
- package/es/LmUpload/body/Progress.js +16 -0
- package/es/LmUpload/body/UploadCore.d.ts +4 -0
- package/es/LmUpload/body/UploadCore.js +52 -0
- package/es/LmUpload/body/UploadPicture.d.ts +4 -0
- package/es/LmUpload/body/UploadPicture.js +35 -0
- package/es/LmUpload/components/card.d.ts +2 -0
- package/es/LmUpload/components/card.js +9 -0
- package/es/LmUpload/fns/index.d.ts +16 -0
- package/es/LmUpload/fns/index.js +184 -0
- package/es/LmUpload/index.d.ts +2 -0
- package/es/LmUpload/index.js +2 -0
- package/es/LmUpload/style/index.css +205 -0
- package/es/LmUpload/style/index.js +3 -0
- package/es/LmUpload/utils.d.ts +4 -0
- package/es/LmUpload/utils.js +20 -0
- package/es/LmUpload/view/index.d.ts +4 -0
- package/es/LmUpload/view/index.js +10 -0
- package/es/LmUpload/wrapper/Upload.d.ts +4 -0
- package/es/LmUpload/wrapper/Upload.js +12 -0
- package/es/LmUpload/wrapper/UploadContainer.d.ts +4 -0
- package/es/LmUpload/wrapper/UploadContainer.js +12 -0
- package/es/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/es/LmUpload/wrapper/UploadRoot.js +41 -0
- package/es/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/es/LmUpload/wrapper/UploadWrapper.js +21 -0
- package/es/LmUpload/wrapper/reducer.d.ts +8 -0
- package/es/LmUpload/wrapper/reducer.js +32 -0
- package/es/Modal/index.d.ts +1 -1
- package/es/Popconfirm/index.d.ts +3 -0
- package/es/Popconfirm/index.js +3 -0
- package/es/Popconfirm/style/index.css +505 -0
- package/es/Popconfirm/style/index.d.ts +1 -0
- package/es/Popconfirm/style/index.js +1 -0
- package/es/Progress/index.d.ts +3 -0
- package/es/Progress/index.js +3 -0
- package/es/Progress/style/index.css +505 -0
- package/es/Progress/style/index.d.ts +1 -0
- package/es/Progress/style/index.js +1 -0
- package/es/Segmented/index.d.ts +3 -0
- package/es/Segmented/index.js +3 -0
- package/es/Segmented/style/index.css +505 -0
- package/es/Segmented/style/index.d.ts +1 -0
- package/es/Segmented/style/index.js +1 -0
- package/es/Slider/index.d.ts +2 -0
- package/es/Slider/index.js +3 -0
- package/es/Slider/style/index.css +505 -0
- package/es/Slider/style/index.d.ts +1 -0
- package/es/Slider/style/index.js +1 -0
- package/es/Statistic/index.d.ts +3 -0
- package/es/Statistic/index.js +3 -0
- package/es/Statistic/style/index.css +505 -0
- package/es/Statistic/style/index.d.ts +1 -0
- package/es/Statistic/style/index.js +1 -0
- package/es/TimePicker/index.d.ts +3 -0
- package/es/TimePicker/index.js +3 -0
- package/es/TimePicker/style/index.css +505 -0
- package/es/TimePicker/style/index.d.ts +1 -0
- package/es/TimePicker/style/index.js +1 -0
- package/es/Timeline/index.d.ts +3 -0
- package/es/Timeline/index.js +3 -0
- package/es/Timeline/style/index.css +505 -0
- package/es/Timeline/style/index.d.ts +1 -0
- package/es/Timeline/style/index.js +1 -0
- package/es/Transfer/index.d.ts +3 -0
- package/es/Transfer/index.js +3 -0
- package/es/Transfer/style/index.css +505 -0
- package/es/Transfer/style/index.d.ts +1 -0
- package/es/Transfer/style/index.js +1 -0
- package/es/TreeSelect/index.d.ts +3 -0
- package/es/TreeSelect/index.js +3 -0
- package/es/TreeSelect/style/index.css +505 -0
- package/es/TreeSelect/style/index.d.ts +1 -0
- package/es/TreeSelect/style/index.js +1 -0
- package/es/hooks/useFullscreen/index.js +6 -8
- package/es/index.d.ts +18 -0
- package/es/index.js +10 -1
- package/lib/Alert/index.js +27 -5
- package/lib/Alert/style/index.css +1 -1
- package/lib/Approval/handle.d.ts +11 -0
- package/lib/Approval/handle.js +160 -0
- package/lib/Approval/index.d.ts +4 -0
- package/lib/Approval/index.js +481 -0
- package/lib/Approval/style/index.css +696 -0
- package/lib/Approval/style/index.d.ts +1 -0
- package/lib/Approval/style/index.js +3 -0
- package/lib/Approval/type.d.ts +55 -0
- package/lib/Approval/type.js +105 -0
- package/lib/Approval/util.d.ts +26 -0
- package/lib/Approval/util.js +148 -0
- package/lib/AutoComplete/index.d.ts +2 -1
- package/lib/Calendar/index.d.ts +4 -0
- package/lib/Calendar/index.js +15 -0
- package/lib/Calendar/style/index.css +505 -0
- package/lib/Calendar/style/index.d.ts +1 -0
- package/lib/Calendar/style/index.js +3 -0
- package/lib/Carousel/index.d.ts +3 -0
- package/lib/Carousel/index.js +15 -0
- package/lib/Carousel/style/index.css +505 -0
- package/lib/Carousel/style/index.d.ts +1 -0
- package/lib/Carousel/style/index.js +3 -0
- package/lib/Collapse/index.d.ts +3 -0
- package/lib/Collapse/index.js +15 -0
- package/lib/Collapse/style/index.css +505 -0
- package/lib/Collapse/style/index.d.ts +1 -0
- package/lib/Collapse/style/index.js +3 -0
- package/lib/Comment/index.d.ts +3 -0
- package/lib/Comment/index.js +15 -0
- package/lib/Comment/style/index.css +505 -0
- package/lib/Comment/style/index.d.ts +1 -0
- package/lib/Comment/style/index.js +3 -0
- package/lib/CustomTableOption/index.js +6 -6
- package/lib/Form/container.js +17 -1
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/index.js +5 -2
- package/lib/Form/style/index.css +18 -3
- package/lib/LmEditTable/DragHandle.js +2 -1
- package/lib/LmEditTable/EditTable.d.ts +1 -0
- package/lib/LmEditTable/EditTable.js +145 -52
- package/lib/LmEditTable/style/index.css +12 -0
- package/lib/LmFilter/LmFilter.js +2 -0
- package/lib/LmFilter/components/DropdownFIlter.js +0 -1
- package/lib/LmFilter/customFilter/index.js +2 -1
- package/lib/LmFilter/customFilter/saveModal.js +5 -6
- package/lib/LmFilter/filterFns/index.js +8 -2
- package/lib/LmFilter/wrapper/Filter.js +3 -2
- package/lib/LmSelect/NormalSelect.js +5 -1
- package/lib/LmSelect/style/index.css +2 -1
- package/lib/LmSelect/useCheckboxOptions.d.ts +1 -1
- package/lib/LmSelect/useCheckboxOptions.js +2 -1
- package/lib/LmTable/Table.js +89 -46
- package/lib/LmTable/components/DndContainer.d.ts +5 -0
- package/lib/LmTable/components/DndContainer.js +49 -0
- package/lib/LmTable/components/sortableBoxCol.js +24 -0
- package/lib/LmTable/components/sortableItemCol.js +54 -0
- package/lib/LmUpload/LmUpload.d.ts +6 -0
- package/lib/LmUpload/LmUpload.js +73 -0
- package/lib/LmUpload/UploadList/ItemPicture.d.ts +4 -0
- package/lib/LmUpload/UploadList/ItemPicture.js +37 -0
- package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/lib/LmUpload/UploadList/ItemPictureCard.js +141 -0
- package/lib/LmUpload/UploadList/ItemText.d.ts +4 -0
- package/lib/LmUpload/UploadList/ItemText.js +36 -0
- package/lib/LmUpload/UploadList/RenderItem.d.ts +6 -0
- package/lib/LmUpload/UploadList/RenderItem.js +44 -0
- package/lib/LmUpload/UploadList/index.d.ts +4 -0
- package/lib/LmUpload/UploadList/index.js +36 -0
- package/lib/LmUpload/body/Progress.d.ts +4 -0
- package/lib/LmUpload/body/Progress.js +26 -0
- package/lib/LmUpload/body/UploadCore.d.ts +4 -0
- package/lib/LmUpload/body/UploadCore.js +66 -0
- package/lib/LmUpload/body/UploadPicture.d.ts +4 -0
- package/lib/LmUpload/body/UploadPicture.js +50 -0
- package/lib/LmUpload/components/card.d.ts +2 -0
- package/lib/LmUpload/components/card.js +19 -0
- package/lib/LmUpload/fns/index.d.ts +16 -0
- package/lib/LmUpload/fns/index.js +197 -0
- package/lib/LmUpload/index.d.ts +2 -0
- package/lib/LmUpload/index.js +13 -0
- package/lib/LmUpload/style/index.css +205 -0
- package/lib/LmUpload/style/index.js +3 -0
- package/lib/LmUpload/utils.d.ts +4 -0
- package/lib/LmUpload/utils.js +39 -0
- package/lib/LmUpload/view/index.d.ts +4 -0
- package/lib/LmUpload/view/index.js +20 -0
- package/lib/LmUpload/wrapper/Upload.d.ts +4 -0
- package/lib/LmUpload/wrapper/Upload.js +25 -0
- package/lib/LmUpload/wrapper/UploadContainer.d.ts +4 -0
- package/lib/LmUpload/wrapper/UploadContainer.js +25 -0
- package/lib/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/lib/LmUpload/wrapper/UploadRoot.js +58 -0
- package/lib/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/lib/LmUpload/wrapper/UploadWrapper.js +36 -0
- package/lib/LmUpload/wrapper/reducer.d.ts +8 -0
- package/lib/LmUpload/wrapper/reducer.js +45 -0
- package/lib/Modal/index.d.ts +1 -1
- package/lib/Popconfirm/index.d.ts +3 -0
- package/lib/Popconfirm/index.js +15 -0
- package/lib/Popconfirm/style/index.css +505 -0
- package/lib/Popconfirm/style/index.d.ts +1 -0
- package/lib/Popconfirm/style/index.js +3 -0
- package/lib/Progress/index.d.ts +3 -0
- package/lib/Progress/index.js +15 -0
- package/lib/Progress/style/index.css +505 -0
- package/lib/Progress/style/index.d.ts +1 -0
- package/lib/Progress/style/index.js +3 -0
- package/lib/Segmented/index.d.ts +3 -0
- package/lib/Segmented/index.js +15 -0
- package/lib/Segmented/style/index.css +505 -0
- package/lib/Segmented/style/index.d.ts +1 -0
- package/lib/Segmented/style/index.js +3 -0
- package/lib/Slider/index.d.ts +2 -0
- package/lib/Slider/index.js +15 -0
- package/lib/Slider/style/index.css +505 -0
- package/lib/Slider/style/index.d.ts +1 -0
- package/lib/Slider/style/index.js +3 -0
- package/lib/Statistic/index.d.ts +3 -0
- package/lib/Statistic/index.js +15 -0
- package/lib/Statistic/style/index.css +505 -0
- package/lib/Statistic/style/index.d.ts +1 -0
- package/lib/Statistic/style/index.js +3 -0
- package/lib/TimePicker/index.d.ts +3 -0
- package/lib/TimePicker/index.js +15 -0
- package/lib/TimePicker/style/index.css +505 -0
- package/lib/TimePicker/style/index.d.ts +1 -0
- package/lib/TimePicker/style/index.js +3 -0
- package/lib/Timeline/index.d.ts +3 -0
- package/lib/Timeline/index.js +15 -0
- package/lib/Timeline/style/index.css +505 -0
- package/lib/Timeline/style/index.d.ts +1 -0
- package/lib/Timeline/style/index.js +3 -0
- package/lib/Transfer/index.d.ts +3 -0
- package/lib/Transfer/index.js +15 -0
- package/lib/Transfer/style/index.css +505 -0
- package/lib/Transfer/style/index.d.ts +1 -0
- package/lib/Transfer/style/index.js +3 -0
- package/lib/TreeSelect/index.d.ts +3 -0
- package/lib/TreeSelect/index.js +15 -0
- package/lib/TreeSelect/style/index.css +505 -0
- package/lib/TreeSelect/style/index.d.ts +1 -0
- package/lib/TreeSelect/style/index.js +3 -0
- package/lib/hooks/useFullscreen/index.js +6 -10
- package/lib/index.d.ts +18 -0
- package/lib/index.js +73 -1
- package/package.json +3 -2
- package/typings/index.d.ts +1 -1
package/es/Alert/index.js
CHANGED
|
@@ -85,8 +85,8 @@ var Alert = function Alert(_a) {
|
|
|
85
85
|
_a$className = _a.className,
|
|
86
86
|
className = _a$className === void 0 ? '' : _a$className,
|
|
87
87
|
style = _a.style,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
_onMouseEnter = _a.onMouseEnter,
|
|
89
|
+
_onMouseLeave = _a.onMouseLeave,
|
|
90
90
|
onClick = _a.onClick,
|
|
91
91
|
afterClose = _a.afterClose,
|
|
92
92
|
showIcon = _a.showIcon,
|
|
@@ -103,6 +103,11 @@ var Alert = function Alert(_a) {
|
|
|
103
103
|
closed = _React$useState2[0],
|
|
104
104
|
setClosed = _React$useState2[1];
|
|
105
105
|
|
|
106
|
+
var _React$useState3 = React.useState(false),
|
|
107
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
108
|
+
hovering = _React$useState4[0],
|
|
109
|
+
setHovering = _React$useState4[1];
|
|
110
|
+
|
|
106
111
|
var ref = React.useRef();
|
|
107
112
|
|
|
108
113
|
var _React$useContext = React.useContext(ConfigContext),
|
|
@@ -134,7 +139,18 @@ var Alert = function Alert(_a) {
|
|
|
134
139
|
var type = getType(); // banner 模式默认有 Icon
|
|
135
140
|
|
|
136
141
|
var isShowIcon = banner && showIcon === undefined ? true : showIcon;
|
|
137
|
-
var alertCls = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-with-description"), !!description), _defineProperty(_classNames2, "".concat(prefixCls, "-no-icon"), !isShowIcon), _defineProperty(_classNames2, "".concat(prefixCls, "-banner"), !!banner), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames2), className, 'lm_alert');
|
|
142
|
+
var alertCls = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-with-description"), !!description), _defineProperty(_classNames2, "".concat(prefixCls, "-no-icon"), !isShowIcon), _defineProperty(_classNames2, "".concat(prefixCls, "-banner"), !!banner), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames2), className, 'lm_alert'); // @ts-ignore
|
|
143
|
+
|
|
144
|
+
React.useEffect(function () {
|
|
145
|
+
if (!hovering && duration > 0) {
|
|
146
|
+
var timeout = setTimeout(function () {
|
|
147
|
+
handleClose();
|
|
148
|
+
}, duration * 1000);
|
|
149
|
+
return function () {
|
|
150
|
+
clearTimeout(timeout);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}, [duration, hovering]);
|
|
138
154
|
var dataOrAriaProps = getDataOrAriaProps(props);
|
|
139
155
|
return /*#__PURE__*/React.createElement(CSSMotion, {
|
|
140
156
|
visible: !closed,
|
|
@@ -155,8 +171,14 @@ var Alert = function Alert(_a) {
|
|
|
155
171
|
"data-show": !closed,
|
|
156
172
|
className: classNames(alertCls, motionClassName),
|
|
157
173
|
style: Object.assign(Object.assign({}, style), motionStyle),
|
|
158
|
-
onMouseEnter: onMouseEnter
|
|
159
|
-
|
|
174
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
175
|
+
setHovering(true);
|
|
176
|
+
_onMouseEnter === null || _onMouseEnter === void 0 ? void 0 : _onMouseEnter(e);
|
|
177
|
+
},
|
|
178
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
179
|
+
setHovering(false);
|
|
180
|
+
_onMouseLeave === null || _onMouseLeave === void 0 ? void 0 : _onMouseLeave(e);
|
|
181
|
+
},
|
|
160
182
|
onClick: onClick,
|
|
161
183
|
role: "alert"
|
|
162
184
|
}, dataOrAriaProps), isShowIcon ? /*#__PURE__*/React.createElement(IconNode, {
|
package/es/Alert/style/index.css
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IApprovalItemProps } from "./type";
|
|
2
|
+
/**
|
|
3
|
+
* 获取现在到之前的时间差
|
|
4
|
+
* @param time
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function getDistanceTime(time: string | number | Date): string;
|
|
8
|
+
export declare function getCurrentTime(): string;
|
|
9
|
+
export declare const wrapperComment: (user: string, steps: Array<IApprovalItemProps>, update: any, setUpdate: any) => (value: string) => void;
|
|
10
|
+
export declare const wrapperAgree: (user: string, steps: Array<IApprovalItemProps>, update: any, setUpdate: any) => (value: string) => void;
|
|
11
|
+
export declare const wrapperRefuse: (user: string, steps: Array<IApprovalItemProps>, update: any, setUpdate: any) => (value: string) => void;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { ApprovalType, StatusType } from "./type";
|
|
3
|
+
/**
|
|
4
|
+
* 获取现在到之前的时间差
|
|
5
|
+
* @param time
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export function getDistanceTime(time) {
|
|
10
|
+
if (typeof time === 'string' || typeof time === 'number') {
|
|
11
|
+
time = new Date(time);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var result = '';
|
|
15
|
+
var dis = Date.now() - time.getTime();
|
|
16
|
+
var second = parseInt(dis / 1000 + '');
|
|
17
|
+
var day = parseInt(second / 3600 / 24 + '');
|
|
18
|
+
var hour = parseInt(second / 3600 % 24 + '');
|
|
19
|
+
var minute = parseInt(second / 60 % 60 + '');
|
|
20
|
+
|
|
21
|
+
if (day > 0) {
|
|
22
|
+
result += day + '天' + hour + '小时' + minute + '分钟';
|
|
23
|
+
} else {
|
|
24
|
+
if (hour > 0) {
|
|
25
|
+
result += hour + '小时' + minute + '分钟';
|
|
26
|
+
} else {
|
|
27
|
+
result += minute + '分钟';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
export function getCurrentTime() {
|
|
34
|
+
var _Date$toLocaleString$ = new Date().toLocaleString().split(' '),
|
|
35
|
+
_Date$toLocaleString$2 = _slicedToArray(_Date$toLocaleString$, 2),
|
|
36
|
+
t1 = _Date$toLocaleString$2[0],
|
|
37
|
+
t2 = _Date$toLocaleString$2[1];
|
|
38
|
+
|
|
39
|
+
var _t1$split = t1.split('/'),
|
|
40
|
+
_t1$split2 = _slicedToArray(_t1$split, 3),
|
|
41
|
+
y = _t1$split2[0],
|
|
42
|
+
m = _t1$split2[1],
|
|
43
|
+
d = _t1$split2[2];
|
|
44
|
+
|
|
45
|
+
var _t2$split = t2.split(':'),
|
|
46
|
+
_t2$split2 = _slicedToArray(_t2$split, 2),
|
|
47
|
+
h = _t2$split2[0],
|
|
48
|
+
minute = _t2$split2[1];
|
|
49
|
+
|
|
50
|
+
if (m.length === 1) {
|
|
51
|
+
m = 0 + m;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (d.length === 1) {
|
|
55
|
+
d = 0 + d;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
|
|
59
|
+
}
|
|
60
|
+
export var wrapperComment = function wrapperComment(user, steps, update, setUpdate) {
|
|
61
|
+
return function (value) {
|
|
62
|
+
var index = steps.findIndex(function (step) {
|
|
63
|
+
return ApprovalType.isPending(step.type, step.approvalStatus);
|
|
64
|
+
});
|
|
65
|
+
steps.splice(index, 0, {
|
|
66
|
+
name: user,
|
|
67
|
+
time: getCurrentTime(),
|
|
68
|
+
type: ApprovalType.ONLY_COMMENT,
|
|
69
|
+
comment: value
|
|
70
|
+
});
|
|
71
|
+
setUpdate(!update);
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export var wrapperAgree = function wrapperAgree(user, steps, update, setUpdate) {
|
|
75
|
+
return function (value) {
|
|
76
|
+
var currentTime = getCurrentTime();
|
|
77
|
+
var index = steps.findIndex(function (step) {
|
|
78
|
+
return ApprovalType.isPending(step.type, step.approvalStatus);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (index < 0) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var step = steps[index];
|
|
86
|
+
|
|
87
|
+
if (step.agreeList.length >= step.approverList.length) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
step.agreeList.push(user);
|
|
92
|
+
|
|
93
|
+
if (step.everyoneAgree) {
|
|
94
|
+
if (step.agreeList.length === step.approverList.length) {
|
|
95
|
+
step.approvalStatus = StatusType.AGREE;
|
|
96
|
+
step.name = user;
|
|
97
|
+
step.comment = value;
|
|
98
|
+
step.time = currentTime;
|
|
99
|
+
} else {
|
|
100
|
+
// 新增一条记录
|
|
101
|
+
steps.splice(index, 0, {
|
|
102
|
+
name: user,
|
|
103
|
+
time: currentTime,
|
|
104
|
+
type: ApprovalType.APPROVAL,
|
|
105
|
+
approvalStatus: StatusType.AGREE,
|
|
106
|
+
comment: value
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
step.approvalStatus = StatusType.AGREE;
|
|
111
|
+
step.name = user;
|
|
112
|
+
step.comment = value;
|
|
113
|
+
step.time = currentTime;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
var nextNode = steps.find(function (step) {
|
|
117
|
+
return ApprovalType.isPending(step.type, step.approvalStatus);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (nextNode) {
|
|
121
|
+
nextNode.time = currentTime;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setUpdate(!update);
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export var wrapperRefuse = function wrapperRefuse(user, steps, update, setUpdate) {
|
|
128
|
+
return function (value) {
|
|
129
|
+
var step = steps.find(function (step) {
|
|
130
|
+
return ApprovalType.isPending(step.type, step.approvalStatus);
|
|
131
|
+
});
|
|
132
|
+
step.refuse = user;
|
|
133
|
+
step.approvalStatus = StatusType.REFUSE;
|
|
134
|
+
step.comment = value;
|
|
135
|
+
step.time = getCurrentTime();
|
|
136
|
+
setUpdate(!update);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
|
|
3
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
import React, { forwardRef, useImperativeHandle, useState } from 'react';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import { Button, Drawer, IconFont, Space } from '..';
|
|
19
|
+
import { ApprovalType } from './type';
|
|
20
|
+
import { currentUserIsApprover, currentUserIsProposer, getStatus } from './util';
|
|
21
|
+
import { wrapperAgree, wrapperComment, wrapperRefuse, getCurrentTime, getDistanceTime } from './handle';
|
|
22
|
+
var prefixCls = 'lm_approval';
|
|
23
|
+
var colors = ['#36BCF1', '#AE86DC', '#8BD248', '#F5A173'];
|
|
24
|
+
var cacheColorMap = new Map();
|
|
25
|
+
|
|
26
|
+
var getColorWithCache = function getColorWithCache(key) {
|
|
27
|
+
var color;
|
|
28
|
+
|
|
29
|
+
if (cacheColorMap.has(key)) {
|
|
30
|
+
color = cacheColorMap.get(key);
|
|
31
|
+
} else {
|
|
32
|
+
color = colors[parseInt(Math.random() * 4 + '')];
|
|
33
|
+
cacheColorMap.set(key, color);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return color;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var getLastChar = function getLastChar(name) {
|
|
40
|
+
return name.substring(name.length - 1, name.length);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var LMDrawer = function LMDrawer(props) {
|
|
44
|
+
var _props$visible = props.visible,
|
|
45
|
+
visible = _props$visible === void 0 ? false : _props$visible,
|
|
46
|
+
_props$title = props.title,
|
|
47
|
+
title = _props$title === void 0 ? '' : _props$title,
|
|
48
|
+
user = props.user,
|
|
49
|
+
onClose = props.onClose,
|
|
50
|
+
children = props.children,
|
|
51
|
+
_props$steps = props.steps,
|
|
52
|
+
steps = _props$steps === void 0 ? [] : _props$steps,
|
|
53
|
+
_props$onComment = props.onComment,
|
|
54
|
+
onComment = _props$onComment === void 0 ? function () {} : _props$onComment,
|
|
55
|
+
_props$onRefuse = props.onRefuse,
|
|
56
|
+
onRefuse = _props$onRefuse === void 0 ? function () {} : _props$onRefuse,
|
|
57
|
+
_props$onAgree = props.onAgree,
|
|
58
|
+
onAgree = _props$onAgree === void 0 ? function () {} : _props$onAgree;
|
|
59
|
+
var status = getStatus(steps);
|
|
60
|
+
var currentStatusCls = classNames(prefixCls + '_title_status');
|
|
61
|
+
var drawerCls = classNames(prefixCls + '_drawer');
|
|
62
|
+
var statusText = ApprovalType.toText(ApprovalType.APPROVAL, status);
|
|
63
|
+
|
|
64
|
+
var handleClose = function handleClose() {
|
|
65
|
+
visible = false;
|
|
66
|
+
onClose();
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
70
|
+
className: drawerCls,
|
|
71
|
+
visible: visible,
|
|
72
|
+
title: title,
|
|
73
|
+
onClose: handleClose,
|
|
74
|
+
extra: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: currentStatusCls
|
|
76
|
+
}, ApprovalType.isPending(ApprovalType.APPROVAL, status) && /*#__PURE__*/React.createElement(IconFont, {
|
|
77
|
+
className: 'icon blue',
|
|
78
|
+
type: "lmweb-yuanxing-gengduo"
|
|
79
|
+
}), ApprovalType.isAgree(ApprovalType.APPROVAL, status) && /*#__PURE__*/React.createElement(IconFont, {
|
|
80
|
+
className: 'icon green',
|
|
81
|
+
type: "lmweb-check-circle-fill"
|
|
82
|
+
}), ApprovalType.isRefuse(ApprovalType.APPROVAL, status) && /*#__PURE__*/React.createElement(IconFont, {
|
|
83
|
+
className: 'icon grey',
|
|
84
|
+
type: "lmweb-stop"
|
|
85
|
+
}), /*#__PURE__*/React.createElement("span", null, statusText)), ApprovalType.isPending(ApprovalType.APPROVAL, status) && currentUserIsApprover(steps, user) && /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
86
|
+
size: "small",
|
|
87
|
+
onClick: onComment
|
|
88
|
+
}, "\u4EC5\u8BC4\u8BBA"), /*#__PURE__*/React.createElement(Button, {
|
|
89
|
+
size: "small",
|
|
90
|
+
onClick: onRefuse,
|
|
91
|
+
style: {
|
|
92
|
+
borderColor: '#FA4F53',
|
|
93
|
+
color: '#FA4F53'
|
|
94
|
+
}
|
|
95
|
+
}, "\u62D2\u7EDD"), /*#__PURE__*/React.createElement(Button, {
|
|
96
|
+
size: "small",
|
|
97
|
+
onClick: onAgree,
|
|
98
|
+
type: "primary"
|
|
99
|
+
}, "\u540C\u610F")))
|
|
100
|
+
}, children);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
var ApprovalItem = function ApprovalItem(props) {
|
|
104
|
+
var _props$avator = props.avator,
|
|
105
|
+
avator = _props$avator === void 0 ? '' : _props$avator,
|
|
106
|
+
_props$name = props.name,
|
|
107
|
+
name = _props$name === void 0 ? '' : _props$name,
|
|
108
|
+
_props$time = props.time,
|
|
109
|
+
time = _props$time === void 0 ? '' : _props$time,
|
|
110
|
+
type = props.type,
|
|
111
|
+
_props$agreeList = props.agreeList,
|
|
112
|
+
agreeList = _props$agreeList === void 0 ? [] : _props$agreeList,
|
|
113
|
+
_props$approverList = props.approverList,
|
|
114
|
+
approverList = _props$approverList === void 0 ? [] : _props$approverList,
|
|
115
|
+
_props$everyoneAgree = props.everyoneAgree,
|
|
116
|
+
everyoneAgree = _props$everyoneAgree === void 0 ? false : _props$everyoneAgree,
|
|
117
|
+
_props$comment = props.comment,
|
|
118
|
+
comment = _props$comment === void 0 ? null : _props$comment,
|
|
119
|
+
_props$carbonCopyList = props.carbonCopyList,
|
|
120
|
+
carbonCopyList = _props$carbonCopyList === void 0 ? [] : _props$carbonCopyList,
|
|
121
|
+
_props$urge = props.urge,
|
|
122
|
+
urge = _props$urge === void 0 ? false : _props$urge,
|
|
123
|
+
approvalStatus = props.approvalStatus,
|
|
124
|
+
_isSelf = props._isSelf,
|
|
125
|
+
_user = props._user,
|
|
126
|
+
onUrge = props.onUrge,
|
|
127
|
+
onDeleteComment = props.onDeleteComment;
|
|
128
|
+
var itemCls = classNames(prefixCls + '_item');
|
|
129
|
+
var itemHeaderCls = classNames(itemCls + '_header');
|
|
130
|
+
var itemBodyCls = classNames(itemCls + '_body');
|
|
131
|
+
|
|
132
|
+
var getIcon = function getIcon() {
|
|
133
|
+
if (ApprovalType.isRefuse(type, approvalStatus)) {
|
|
134
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
135
|
+
className: 'icon red',
|
|
136
|
+
type: "lmweb-close-circle-fill"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (ApprovalType.isPending(type, approvalStatus)) {
|
|
141
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
142
|
+
className: 'icon blue',
|
|
143
|
+
type: "lmweb-yuanxing-gengduo"
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
148
|
+
className: 'icon green',
|
|
149
|
+
type: "lmweb-check-circle-fill"
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var getApprovalText = function getApprovalText() {
|
|
154
|
+
if (ApprovalType.isPending(type, approvalStatus)) {
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: 'desc blue'
|
|
157
|
+
}, "\u5BA1\u6838\u4E2D");
|
|
158
|
+
} else if (ApprovalType.isAgree(type, approvalStatus)) {
|
|
159
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: 'desc green'
|
|
161
|
+
}, "\u5DF2\u540C\u610F");
|
|
162
|
+
} else if (ApprovalType.isRefuse(type, approvalStatus)) {
|
|
163
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
className: 'desc red'
|
|
165
|
+
}, "\u62D2\u7EDD");
|
|
166
|
+
} else if (type === ApprovalType.START) {
|
|
167
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: 'desc green'
|
|
169
|
+
}, "\u53D1\u8D77\u5BA1\u6279");
|
|
170
|
+
} else if (type === ApprovalType.ONLY_COMMENT) {
|
|
171
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
className: 'desc grey'
|
|
173
|
+
}, "\u4EC5\u8BC4\u8BBA");
|
|
174
|
+
} else if (type === ApprovalType.CARBON_COPY) {
|
|
175
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: 'desc grey'
|
|
177
|
+
}, "\u5DF2\u6284\u9001", carbonCopyList.length, "\u4EBA");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return null;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
var renderTip = function renderTip() {
|
|
184
|
+
if (ApprovalType.isPending(type, approvalStatus)) {
|
|
185
|
+
if (everyoneAgree) {
|
|
186
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
187
|
+
className: "agree-tip"
|
|
188
|
+
}, "\u9700\u8981\u6240\u6709\u5BA1\u6279\u4EBA\u90FD\u540C\u610F");
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
192
|
+
className: "agree-tip"
|
|
193
|
+
}, "\u81F3\u5C11\u4E00\u4E2A\u5BA1\u6279\u4EBA\u540C\u610F\u5373\u53EF");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return null;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
var renderComment = function renderComment() {
|
|
200
|
+
if (comment) {
|
|
201
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
className: 'comment'
|
|
203
|
+
}, comment, ApprovalType.isOnlyComment(type) && currentUserIsProposer(_user, name) && /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
className: 'comment-delete',
|
|
205
|
+
onClick: onDeleteComment
|
|
206
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
207
|
+
className: "icon",
|
|
208
|
+
type: "lmweb-delete"
|
|
209
|
+
}), " \u5220\u9664")));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return null;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
var renderUrge = function renderUrge() {
|
|
216
|
+
// 当前用户是提议发起者 && 审核中
|
|
217
|
+
if (_isSelf && ApprovalType.isPending(type, approvalStatus)) {
|
|
218
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
219
|
+
className: "urge",
|
|
220
|
+
disabled: urge,
|
|
221
|
+
size: "small",
|
|
222
|
+
onClick: onUrge
|
|
223
|
+
}, urge ? '已催办' : '催一下');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return null;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
var renderList = function renderList() {
|
|
230
|
+
var list = [];
|
|
231
|
+
|
|
232
|
+
if (ApprovalType.isCC(type)) {
|
|
233
|
+
list = carbonCopyList;
|
|
234
|
+
} else if (ApprovalType.isApproval(type)) {
|
|
235
|
+
list = approverList.slice(agreeList.length);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
var separate = type === ApprovalType.APPROVAL && everyoneAgree; // 审批拒绝
|
|
239
|
+
|
|
240
|
+
if (ApprovalType.isRefuse(type, approvalStatus)) {
|
|
241
|
+
return null;
|
|
242
|
+
} // 审批通过
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
if (ApprovalType.isAgree(type, approvalStatus)) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (list.length) {
|
|
250
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
251
|
+
className: 'lm-approver-wrapper'
|
|
252
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: 'lm-approver-box'
|
|
254
|
+
}, list.map(function (item, i) {
|
|
255
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
256
|
+
key: item + i
|
|
257
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
258
|
+
className: 'lm-approver-cell'
|
|
259
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
className: 'lm-approver-circle',
|
|
261
|
+
style: {
|
|
262
|
+
backgroundColor: getColorWithCache(item)
|
|
263
|
+
}
|
|
264
|
+
}, getLastChar(item)), /*#__PURE__*/React.createElement("span", null, item)), separate && i != list.length - 1 && /*#__PURE__*/React.createElement(IconFont, {
|
|
265
|
+
className: 'icon',
|
|
266
|
+
type: "lmweb-icon_m_put_away"
|
|
267
|
+
}));
|
|
268
|
+
})), renderUrge());
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return null;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
var renderTime = function renderTime() {
|
|
275
|
+
// 当前用户是提议发起者 && 审核中
|
|
276
|
+
if (_isSelf && ApprovalType.isPending(type, approvalStatus)) {
|
|
277
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
278
|
+
className: 'yellow'
|
|
279
|
+
}, "\u5DF2\u7B49\u5F85".concat(getDistanceTime(time)));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return /*#__PURE__*/React.createElement("span", null, time);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var renderAvator = function renderAvator() {
|
|
286
|
+
if (ApprovalType.isCC(type)) {
|
|
287
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
className: 'cc-box'
|
|
289
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
290
|
+
className: 'cc',
|
|
291
|
+
type: "lmweb-a-chaosongrenchaosongyonghu-02"
|
|
292
|
+
})), getIcon());
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (ApprovalType.isPending(type, approvalStatus)) {
|
|
296
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
className: 'cc-box'
|
|
298
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
299
|
+
className: 'cc',
|
|
300
|
+
type: "lmweb-audit"
|
|
301
|
+
})), getIcon());
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (avator) {
|
|
305
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
306
|
+
className: 'picture',
|
|
307
|
+
src: avator,
|
|
308
|
+
alt: ""
|
|
309
|
+
}), getIcon());
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
313
|
+
className: 'subname',
|
|
314
|
+
style: {
|
|
315
|
+
backgroundColor: getColorWithCache(name)
|
|
316
|
+
}
|
|
317
|
+
}, getLastChar(name)), getIcon());
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
321
|
+
className: itemCls
|
|
322
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
323
|
+
className: itemHeaderCls
|
|
324
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
325
|
+
className: "avator"
|
|
326
|
+
}, renderAvator()), /*#__PURE__*/React.createElement("div", {
|
|
327
|
+
className: "content"
|
|
328
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
329
|
+
className: 'name'
|
|
330
|
+
}, name), getApprovalText()), /*#__PURE__*/React.createElement("div", {
|
|
331
|
+
className: "right"
|
|
332
|
+
}, renderTime())), type !== ApprovalType.START && /*#__PURE__*/React.createElement("div", {
|
|
333
|
+
className: itemBodyCls
|
|
334
|
+
}, renderTip(), renderComment(), renderList()));
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
var Approval = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
338
|
+
var _props$proposer = props.proposer,
|
|
339
|
+
proposer = _props$proposer === void 0 ? '' : _props$proposer,
|
|
340
|
+
_props$user = props.user,
|
|
341
|
+
user = _props$user === void 0 ? '' : _props$user,
|
|
342
|
+
_props$steps2 = props.steps,
|
|
343
|
+
steps = _props$steps2 === void 0 ? [] : _props$steps2,
|
|
344
|
+
_onUrge2 = props.onUrge,
|
|
345
|
+
_props$onCarbonCopy = props.onCarbonCopy,
|
|
346
|
+
onCarbonCopy = _props$onCarbonCopy === void 0 ? function () {} : _props$onCarbonCopy,
|
|
347
|
+
_props$onDeleteCommen = props.onDeleteComment,
|
|
348
|
+
_onDeleteComment = _props$onDeleteCommen === void 0 ? function () {} : _props$onDeleteCommen;
|
|
349
|
+
|
|
350
|
+
var weakmap = new WeakMap();
|
|
351
|
+
|
|
352
|
+
var _isSelf = currentUserIsProposer(proposer, user);
|
|
353
|
+
|
|
354
|
+
var mark = false;
|
|
355
|
+
steps.forEach(function (step) {
|
|
356
|
+
if (ApprovalType.isPending(step.type, step.approvalStatus) && !step.name) {
|
|
357
|
+
step.name = '审批';
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (ApprovalType.isCC(step.type) && !step.name) {
|
|
361
|
+
step.name = '抄送人';
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (step.refuse) {
|
|
365
|
+
step.name = step.refuse;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (!step.name) {
|
|
369
|
+
step.name = 'unkonwn';
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (mark) {
|
|
373
|
+
weakmap.set(step, {
|
|
374
|
+
hidden: true
|
|
375
|
+
});
|
|
376
|
+
} // 拒绝|审核中,后面的不展示
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
if (ApprovalType.isPending(step.type, step.approvalStatus) || ApprovalType.isRefuse(step.type, step.approvalStatus)) {
|
|
380
|
+
mark = true;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
var list = []; // 210 012
|
|
384
|
+
|
|
385
|
+
var _loop = function _loop(i) {
|
|
386
|
+
var step = steps[i];
|
|
387
|
+
var obj = weakmap.get(step);
|
|
388
|
+
|
|
389
|
+
if (obj && obj.hidden) {
|
|
390
|
+
return "continue";
|
|
391
|
+
} // 抄送
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
if (ApprovalType.isCC(step.type) && !step.isCarbonCopy) {
|
|
395
|
+
onCarbonCopy(step, i, steps);
|
|
396
|
+
step.time = getCurrentTime();
|
|
397
|
+
step.isCarbonCopy = true;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
var element = /*#__PURE__*/React.createElement(ApprovalItem, Object.assign({
|
|
401
|
+
key: step.name + i,
|
|
402
|
+
_isSelf: _isSelf,
|
|
403
|
+
_user: user
|
|
404
|
+
}, step, {
|
|
405
|
+
onUrge: function onUrge() {
|
|
406
|
+
_onUrge2(step, i, steps);
|
|
407
|
+
},
|
|
408
|
+
onDeleteComment: function onDeleteComment() {
|
|
409
|
+
_onDeleteComment(step, i, steps);
|
|
410
|
+
}
|
|
411
|
+
}));
|
|
412
|
+
list.push(element);
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
for (var i = steps.length - 1; i >= 0; i--) {
|
|
416
|
+
var _ret = _loop(i);
|
|
417
|
+
|
|
418
|
+
if (_ret === "continue") continue;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, list);
|
|
422
|
+
});
|
|
423
|
+
var LMApproval = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
424
|
+
var className = props.className,
|
|
425
|
+
_props$onUrge = props.onUrge,
|
|
426
|
+
onUrge = _props$onUrge === void 0 ? function () {} : _props$onUrge,
|
|
427
|
+
_props$onDeleteCommen2 = props.onDeleteComment,
|
|
428
|
+
onDeleteComment = _props$onDeleteCommen2 === void 0 ? function () {} : _props$onDeleteCommen2,
|
|
429
|
+
others = __rest(props, ["className", "onUrge", "onDeleteComment"]);
|
|
430
|
+
|
|
431
|
+
var _useState = useState(false),
|
|
432
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
433
|
+
update = _useState2[0],
|
|
434
|
+
setUpdate = _useState2[1];
|
|
435
|
+
|
|
436
|
+
var comment = wrapperComment(others.user, others.steps, update, setUpdate);
|
|
437
|
+
var agree = wrapperAgree(others.user, others.steps, update, setUpdate);
|
|
438
|
+
var refuse = wrapperRefuse(others.user, others.steps, update, setUpdate);
|
|
439
|
+
useImperativeHandle(ref, function () {
|
|
440
|
+
return {
|
|
441
|
+
comment: comment,
|
|
442
|
+
agree: agree,
|
|
443
|
+
refuse: refuse
|
|
444
|
+
};
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
var _onUrge = function _onUrge(step, i, steps) {
|
|
448
|
+
step.urge = true;
|
|
449
|
+
onUrge(step, i, steps);
|
|
450
|
+
setUpdate(!update);
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
return /*#__PURE__*/React.createElement(LMDrawer, Object.assign({
|
|
454
|
+
className: classNames(className, prefixCls)
|
|
455
|
+
}, others), /*#__PURE__*/React.createElement(Approval, Object.assign({}, others, {
|
|
456
|
+
onUrge: _onUrge,
|
|
457
|
+
onDeleteComment: onDeleteComment,
|
|
458
|
+
__update: update
|
|
459
|
+
})));
|
|
460
|
+
});
|
|
461
|
+
export default LMApproval;
|