@titaui/pc 1.13.5 → 1.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/avatar/icon-avatar/index.js +1 -1
- package/lib/components/avatar/num-avatar/index.js +1 -1
- package/lib/components/book-demo/components/pc/components/content/index.js +1 -1
- package/lib/components/button/default-button/index.js +1 -1
- package/lib/components/button/icon-btn/index.js +1 -1
- package/lib/components/cascader/index.js +1 -1
- package/lib/components/cascader/time.js +1 -1
- package/lib/components/change-okr-modal/Filter.js +2 -2
- package/lib/components/change-okr-modal/Item.js +2 -2
- package/lib/components/change-okr-modal/filterTab.js +2 -2
- package/lib/components/change-okr-modal/index.js +4 -6
- package/lib/components/checkbox-list/index.css +31 -0
- package/lib/components/checkbox-list/index.js +68 -0
- package/lib/components/common-share/publishMblog.js +2 -4
- package/lib/components/communication/CommunicationAttachments.js +2 -2
- package/lib/components/communication/ConvertUserName.js +2 -2
- package/lib/components/communication/index.js +2 -2
- package/lib/components/create-okr-modal/fields/okr-type-detail.js +2 -4
- package/lib/components/create-okr-modal/fields/okr-visibility-detail.js +2 -4
- package/lib/components/create-okr-modal/index.js +6 -5
- package/lib/components/create-okr-modal/objectType.js +2 -2
- package/lib/components/create-okr-modal/request-api.js +12 -16
- package/lib/components/create-okr-modal/utils/helper.js +2 -6
- package/lib/components/date-picker/BodyItem.js +6 -6
- package/lib/components/date-picker/CalendarBody.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +6 -6
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/date-range-picker/index.js +2 -2
- package/lib/components/delete-confirm-pop/ConfirmPop.js +5 -5
- package/lib/components/dialog/index.js +1 -1
- package/lib/components/dialog-confirm/index.js +1 -1
- package/lib/components/dialog-qq-docs/index.css +106 -0
- package/lib/components/dialog-qq-docs/index.js +505 -0
- package/lib/components/dialog-qq-docs/request-apis.js +16 -0
- package/lib/components/dialog-qq-docs/utils.js +79 -0
- package/lib/components/dialog-select/index.css +9 -0
- package/lib/components/dialog-select/index.js +48 -0
- package/lib/components/dialog-upload/img/folder.svg +40 -0
- package/lib/components/dialog-upload/img/form.svg +38 -0
- package/lib/components/dialog-upload/img/mind.svg +39 -0
- package/lib/components/dialog-upload/index.js +2 -4
- package/lib/components/dialog-upload/util.js +20 -2
- package/lib/components/dialog-upload-type/assets/folder.svg +20 -0
- package/lib/components/dialog-upload-type/assets/qq-docs.svg +20 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.css +14 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.js +36 -0
- package/lib/components/dialog-upload-type/index.css +7 -0
- package/lib/components/dialog-upload-type/index.js +68 -0
- package/lib/components/drawer/headerDrop.js +1 -1
- package/lib/components/drawer/index.js +1 -1
- package/lib/components/drawer-manager/drawerWrapper.js +3 -5
- package/lib/components/drawer-manager/index.js +1 -1
- package/lib/components/drop-selector/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/okr-progress/index.js +3 -2
- package/lib/components/dynamic/dynamic-item/components/progress/components/okr-progress/index.js +2 -4
- package/lib/components/dynamic/dynamic-item/components/schedule/index.js +5 -1
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +4 -6
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +12 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +13 -2
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/utils.js +56 -0
- package/lib/components/dynamic/dynamic-item/components/task-progress/render-row.js +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-discovery/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-learning/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.css +16 -1
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +51 -9
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +29 -12
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +7 -5
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/index.js +24 -4
- package/lib/components/dynamic/dynamic-list/index.js +1 -1
- package/lib/components/dynamic/request-api.js +9 -2
- package/lib/components/eReport/eReportListEmpty.js +2 -2
- package/lib/components/eReport/eReportLists/reportList.js +5 -5
- package/lib/components/eReport/eReportShare/index.js +2 -2
- package/lib/components/eReport/eReportShare/toast/index.js +2 -2
- package/lib/components/edit-kr-wight/EditKrWightModal.js +2 -2
- package/lib/components/edit-kr-wight/FormItemV2.js +2 -2
- package/lib/components/emotions-selector/selector-content.js +2 -2
- package/lib/components/emotions-selector/selector-pop.js +5 -5
- package/lib/components/ereport-list/index.js +5 -5
- package/lib/components/error-boundary/index.js +2 -2
- package/lib/components/file-list/components/single-file/index.css +29 -0
- package/lib/components/file-list/components/single-file/index.js +19 -28
- package/lib/components/file-list/img/folder.svg +40 -0
- package/lib/components/file-list/img/form.svg +38 -0
- package/lib/components/file-list/img/mind.svg +39 -0
- package/lib/components/file-list/index.js +2 -1
- package/lib/components/file-list/util.js +20 -2
- package/lib/components/file-preview/index.css +44 -0
- package/lib/components/file-preview/index.js +68 -0
- package/lib/components/firework/index.js +2 -6
- package/lib/components/form/form-fields/date/index.js +1 -1
- package/lib/components/form/form-fields/dropdown/index.js +1 -1
- package/lib/components/form/form-fields/input/index.js +1 -1
- package/lib/components/form/form-fields/input-verification-code/index.js +2 -4
- package/lib/components/form/form-fields/user/index.js +1 -1
- package/lib/components/grid-layout/util/network.js +6 -10
- package/lib/components/guide-tip/index.js +1 -1
- package/lib/components/help-card/index.js +1 -1
- package/lib/components/import-modal/import-task-modal/index.js +1 -1
- package/lib/components/import-modal/tree/okr-tree/index.js +2 -4
- package/lib/components/import-modal/tree-node/index.js +1 -1
- package/lib/components/loading/assets/loading.gif +0 -0
- package/lib/components/loading/index.css +28 -0
- package/lib/components/loading/index.js +64 -0
- package/lib/components/mblog/components/ConfirmPop.js +2 -2
- package/lib/components/mblog/components/MblogAction.js +5 -5
- package/lib/components/mblog/components/MblogContent.js +2 -2
- package/lib/components/mblog/index.js +2 -2
- package/lib/components/menus/components/menu-tree/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/index.js +1 -1
- package/lib/components/nav/index.css +37 -0
- package/lib/components/nav/index.js +31 -0
- package/lib/components/nav-top/components/app-center/index.js +1 -6
- package/lib/components/nav-top/components/menu/index.js +14 -44
- package/lib/components/nav-top/components/user-message/components/reply/reply-item.js +2 -1
- package/lib/components/nav-top/index.css +6 -0
- package/lib/components/nav-top/index.js +138 -2
- package/lib/components/nav-top/request.apis.js +10 -2
- package/lib/components/okr-detail/auth.js +2 -2
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +2 -4
- package/lib/components/okr-detail/components/ao-nice/index.js +4 -6
- package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +2 -2
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +2 -2
- package/lib/components/okr-detail/components/base-okr-type/object-type.js +2 -2
- package/lib/components/okr-detail/components/header/edit-name.js +2 -4
- package/lib/components/okr-detail/components/header/o-avatar.js +2 -4
- package/lib/components/okr-detail/components/header/o-classify.js +2 -4
- package/lib/components/okr-detail/components/header/o-score.js +1 -1
- package/lib/components/okr-detail/components/icon-text/index.js +1 -1
- package/lib/components/okr-detail/components/o-classify.js +2 -4
- package/lib/components/okr-detail/components/o-progress-update/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +5 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +2 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +6 -8
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +2 -4
- package/lib/components/okr-detail/detail-footer/index.js +2 -4
- package/lib/components/okr-detail/detail-header/index.js +10 -12
- package/lib/components/okr-detail/okr-list/index.js +2 -4
- package/lib/components/okr-detail/request-apis.js +2 -6
- package/lib/components/okr-flow/child-node/fields/creator.js +2 -4
- package/lib/components/okr-flow/child-node/work-node.js +2 -4
- package/lib/components/okr-flow/export-modal/index.js +4 -6
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +8 -10
- package/lib/components/okr-flow/request-apis.js +2 -6
- package/lib/components/okr-flow/root-node/index.js +2 -4
- package/lib/components/okr-guide/constant.js +23 -0
- package/lib/components/okr-guide/img/left-img.jpg +0 -0
- package/lib/components/okr-guide/index.css +148 -0
- package/lib/components/okr-guide/index.js +242 -0
- package/lib/components/okr-guide/request-api.js +57 -0
- package/lib/components/okr-progress/components/o-progress-update/index.js +2 -4
- package/lib/components/okr-progress-modal/index.js +2 -4
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +4 -6
- package/lib/components/okr-review/ReviewPop/components/Toast/index.js +2 -2
- package/lib/components/okr-review/ReviewPop/index.js +2 -2
- package/lib/components/okr-review/components/ReviewItem/index.js +5 -5
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +5 -5
- package/lib/components/okr-review/index.js +2 -2
- package/lib/components/okr-share/common-painter/darwAvatar.js +4 -8
- package/lib/components/okr-share/common-painter/openDataPainter.js +2 -6
- package/lib/components/okr-share/common-painter/utils.js +4 -8
- package/lib/components/okr-share/pink-card/drawDepartmentName.js +2 -6
- package/lib/components/okr-share/pink-card/drawKrs.js +2 -6
- package/lib/components/okr-share/pink-card/drawQuote.js +2 -6
- package/lib/components/okr-share/pink-card/drawUserName.js +2 -6
- package/lib/components/okr-share/pink-card/index.js +2 -6
- package/lib/components/okr-share/publishMblog.js +2 -4
- package/lib/components/okr-share/shareCardSelector.js +4 -6
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +2 -4
- package/lib/components/okrcase-library/server/network.js +20 -24
- package/lib/components/open-data-painter/index.js +2 -6
- package/lib/components/operation-records/OperationRecordItem.js +2 -2
- package/lib/components/operation-records/index.js +2 -2
- package/lib/components/pagination/pagination.js +1 -1
- package/lib/components/period-selector/components/button/index.js +1 -1
- package/lib/components/period-selector/helper/index.js +2 -6
- package/lib/components/picker/components/panels/date-panel/index.js +1 -1
- package/lib/components/picker/components/panels/month-panel/index.js +1 -1
- package/lib/components/picker/components/panels/month-panel/month-head.js +1 -1
- package/lib/components/picker/components/panels/week-panel/index.js +1 -1
- package/lib/components/picker/components/panels/year-panel/index.js +1 -1
- package/lib/components/picker/components/panels/year-panel/year-head.js +1 -1
- package/lib/components/picker/picker.js +1 -1
- package/lib/components/picker/range-picker/index.js +1 -1
- package/lib/components/point-demo/drop-down-box/index.js +1 -1
- package/lib/components/point-demo/input/index.js +3 -3
- package/lib/components/point-demo/popup/index.js +1 -1
- package/lib/components/popup/index.js +1 -1
- package/lib/components/praise-record/PraiseRecordItem.js +2 -2
- package/lib/components/praise-record/index.js +2 -2
- package/lib/components/range-picker-pop/index.js +3 -3
- package/lib/components/range-selector-pop/RangeList.js +2 -2
- package/lib/components/range-selector-pop/RangeSelectorPop.js +5 -5
- package/lib/components/rate/index.js +1 -1
- package/lib/components/rich-editor/models/schema.js +8 -8
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +10 -10
- package/lib/components/rich-editor/plugins/block/heading/index.js +10 -10
- package/lib/components/rich-editor/plugins/block/lists/index.js +16 -16
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +7 -7
- package/lib/components/rich-editor/plugins/core/index.js +6 -6
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +7 -7
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +6 -6
- package/lib/components/rich-editor/plugins/inline/color/index.js +13 -13
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +10 -10
- package/lib/components/rich-editor/plugins/inline/em/index.js +7 -7
- package/lib/components/rich-editor/plugins/inline/link/index.js +10 -10
- package/lib/components/rich-editor/plugins/inline/strong/index.js +10 -10
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +10 -10
- package/lib/components/rich-editor/react/reactNodeView.js +4 -4
- package/lib/components/rich-editor/react/uiProvider.js +5 -5
- package/lib/components/rich-editor/ui/Popup/index.js +5 -5
- package/lib/components/rich-editor-at/index.js +85 -13
- package/lib/components/scroll-container/index.js +29 -8
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/scrollbar/simplebar-react.js +1 -1
- package/lib/components/search-dropdown/index.js +1 -1
- package/lib/components/search-input/index.css +2 -2
- package/lib/components/search-input/index.js +4 -0
- package/lib/components/select/Option.js +6 -6
- package/lib/components/select/index.js +3 -3
- package/lib/components/select-layer/index.js +1 -1
- package/lib/components/select-tags/index.js +1 -1
- package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +2 -6
- package/lib/components/superset-charts/fetch-assets-and-append/index.js +4 -8
- package/lib/components/survey-model/request-api.js +2 -6
- package/lib/components/switch/index.js +1 -1
- package/lib/components/table/index.js +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/task-relation-modal/index.js +5 -7
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +1 -1
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +1 -1
- package/lib/components/task-relation-modal/tree/category-tree/index.js +2 -4
- package/lib/components/task-relation-modal/tree/okr-tree/index.js +2 -4
- package/lib/components/task-relation-modal/tree/work-tree/index.js +2 -4
- package/lib/components/task-relation-modal/tree-node/index.js +1 -1
- package/lib/components/task-relation-modal/work-relation/index.js +5 -7
- package/lib/components/task-tree/task-item-node/e-project.js +2 -4
- package/lib/components/task-tree/task-item-node/e-task.js +2 -4
- package/lib/components/task-tree/task-item-node/task-node-render.js +1 -1
- package/lib/components/task-tree/task-tree.js +1 -1
- package/lib/components/textarea/index.js +1 -1
- package/lib/components/time-picker/time-picker-selector.js +1 -1
- package/lib/components/time-picker/time-picker.js +1 -1
- package/lib/components/time-picker/timer-picker-input.js +1 -1
- package/lib/components/tita-chart/charts/liquid-ball.js +1 -1
- package/lib/components/tita-chart/charts/pie.js +1 -1
- package/lib/components/tita-chart/errorBoundary/index.js +5 -5
- package/lib/components/toast/index.js +8 -12
- package/lib/components/tooltip/error-tip.js +1 -1
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tree/index.js +1 -1
- package/lib/components/upload/components/uploadedPreview.js +2 -2
- package/lib/components/upload/img/folder.svg +40 -0
- package/lib/components/upload/img/form.svg +38 -0
- package/lib/components/upload/img/mind.svg +39 -0
- package/lib/components/upload/index.js +195 -27
- package/lib/components/upload/index2.js +379 -0
- package/lib/components/upload/util.js +20 -2
- package/lib/components/upvote/index.js +5 -7
- package/lib/components/user-selector/export-modules/multiple-user-selector--bak/index.js +1 -1
- package/lib/components/user-selector/request-apis.js +3 -3
- package/lib/components/user-selector/select-tree/choose-tree/index.js +1 -1
- package/lib/components/user-selector/select-tree/selected-tree/index.js +1 -1
- package/lib/components/version-change-modal/index.js +5 -9
- package/lib/components/version-change-modal/request-api.js +2 -6
- package/lib/components/viewer/ImageListRender.js +2 -2
- package/lib/components/viewer/index.js +2 -2
- package/lib/components/weekly-report/card.js +2 -4
- package/lib/components/weekly-report/common-painter/darwAvatar.js +6 -10
- package/lib/components/weekly-report/common-painter/drawName.js +2 -6
- package/lib/components/weekly-report/common-painter/openDataPainter.js +2 -6
- package/lib/components/weekly-report/index.js +4 -6
- package/lib/components-v1/animate/AnimateChild.js +5 -5
- package/lib/components-v1/animate/animate.js +2 -2
- package/lib/components-v1/avatar/index.js +5 -5
- package/lib/components-v1/buttonv2/ButtonOutlined.js +2 -2
- package/lib/components-v1/buttonv2/ButtonRounded.js +2 -2
- package/lib/components-v1/buttonv2/DefaultButton.js +2 -2
- package/lib/components-v1/confirm/index.js +2 -2
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +5 -5
- package/lib/components-v1/dropDownSelector/dropDownSelector.js +2 -2
- package/lib/components-v1/input/Input.js +3 -3
- package/lib/components-v1/input/InputNumber.js +2 -2
- package/lib/components-v1/placement/placement.js +2 -2
- package/lib/components-v1/placement/placementInner.js +2 -2
- package/lib/components-v1/pop/Pop.js +2 -2
- package/lib/components-v1/pop/PopInner.js +2 -2
- package/lib/components-v1/portals/Portals.js +2 -2
- package/lib/components-v1/progress/CircleProgress.js +5 -5
- package/lib/components-v1/progress/LineProgress.js +2 -2
- package/lib/components-v1/progress/index.js +2 -2
- package/lib/components-v1/radio/radio.js +2 -2
- package/lib/components-v1/radio/radioGroup.js +2 -2
- package/lib/components-v1/search/index.js +2 -2
- package/lib/components-v1/select/Option.js +6 -6
- package/lib/components-v1/select/index.js +3 -3
- package/lib/components-v1/tabs/index.js +2 -2
- package/lib/components-v1/textarea/index.js +2 -2
- package/lib/components-v1/transition/index.js +2 -2
- package/lib/components-v1/userSelector/UserSelectorPop.js +5 -5
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +2 -2
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +2 -2
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +2 -2
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +2 -2
- package/lib/components-v1/userSelector/components/MultiMode/index.js +5 -5
- package/lib/components-v1/userSelector/components/SearchBar.js +2 -2
- package/lib/components-v1/userSelector/components/SingleMode.js +2 -2
- package/lib/components-v1/userSelector/components/UserItem.js +5 -5
- package/lib/components-v1/userSelector/index.js +2 -2
- package/lib/index.js +8 -0
- package/lib/pages/appointment-demo/drop-down-box/index.js +1 -1
- package/lib/pages/appointment-demo/input/index.js +3 -3
- package/lib/pages/appointment-demo/popup/index.js +1 -1
- package/lib/pages/group-management/components/input-form/index.js +3 -3
- package/lib/pages/group-management/components/radio/index.js +1 -1
- package/lib/pages/group-management/groupInterface.js +2 -6
- package/lib/pages/group-management/page-view/importGroupStaff/index.js +1 -1
- package/lib/pages/group-management/tree/index.js +1 -1
- package/lib/pages/new-okr-list/request-api.js +14 -18
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +3 -5
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +1 -1
- package/lib/pages/okr-map/request-apis.js +2 -6
- package/lib/pages/okr-map/share-dialog/index.js +1 -1
- package/lib/utils/auth.js +2 -2
- package/lib/utils/helpers.js +54 -17
- package/lib/utils/open-data.js +97 -60
- package/lib/utils/request-v1.js +2 -6
- package/lib/utils/request.js +2 -6
- package/lib/utils/tools.js +11 -1
- package/package.json +3 -2
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
15
|
+
|
|
16
|
+
var _searchInput = _interopRequireDefault(require("../search-input"));
|
|
17
|
+
|
|
18
|
+
var _getLocale = require("../../utils/getLocale");
|
|
19
|
+
|
|
20
|
+
var _checkboxList = _interopRequireDefault(require("../checkbox-list"));
|
|
21
|
+
|
|
22
|
+
var _filePreview = _interopRequireWildcard(require("../file-preview"));
|
|
23
|
+
|
|
24
|
+
var _nav = _interopRequireDefault(require("../nav"));
|
|
25
|
+
|
|
26
|
+
var _tools = require("../../utils/tools");
|
|
27
|
+
|
|
28
|
+
var _utils = require("./utils");
|
|
29
|
+
|
|
30
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
31
|
+
|
|
32
|
+
var _scrollContainer = _interopRequireDefault(require("../scroll-container"));
|
|
33
|
+
|
|
34
|
+
var _loading = _interopRequireDefault(require("../loading"));
|
|
35
|
+
|
|
36
|
+
require("./index.css");
|
|
37
|
+
|
|
38
|
+
var _excluded = ["title", "defaultQQDocsData", "onSubmit", "fileNumLimit"];
|
|
39
|
+
|
|
40
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
|
+
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
|
+
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
|
+
|
|
46
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
47
|
+
|
|
48
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
49
|
+
|
|
50
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
51
|
+
|
|
52
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
+
|
|
54
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
55
|
+
|
|
56
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
57
|
+
|
|
58
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
59
|
+
|
|
60
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
61
|
+
|
|
62
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
63
|
+
|
|
64
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
65
|
+
|
|
66
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
67
|
+
|
|
68
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
69
|
+
|
|
70
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
71
|
+
|
|
72
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
73
|
+
|
|
74
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
75
|
+
|
|
76
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
77
|
+
|
|
78
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
79
|
+
|
|
80
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
81
|
+
|
|
82
|
+
var preCls = 'titaui-dialog-qq-docs';
|
|
83
|
+
var catchNavPath = [];
|
|
84
|
+
var catchSearchContent = '';
|
|
85
|
+
var init = true;
|
|
86
|
+
var defaultnNavPath = [{
|
|
87
|
+
label: (0, _getLocale.getLocale)('Feed_Breadcrumb_Allfil'),
|
|
88
|
+
id: undefined
|
|
89
|
+
}];
|
|
90
|
+
|
|
91
|
+
var DialogQQDocs = function DialogQQDocs(_ref) {
|
|
92
|
+
var _ref$title = _ref.title,
|
|
93
|
+
title = _ref$title === void 0 ? (0, _getLocale.getLocale)('Pro_newpro_Upload') : _ref$title,
|
|
94
|
+
defaultQQDocsData = _ref.defaultQQDocsData,
|
|
95
|
+
onSubmit = _ref.onSubmit,
|
|
96
|
+
fileNumLimit = _ref.fileNumLimit,
|
|
97
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
98
|
+
|
|
99
|
+
var _useState = (0, _react.useState)(defaultnNavPath),
|
|
100
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
101
|
+
navPath = _useState2[0],
|
|
102
|
+
setNavPath = _useState2[1];
|
|
103
|
+
|
|
104
|
+
var _useState3 = (0, _react.useState)(''),
|
|
105
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
106
|
+
searchContent = _useState4[0],
|
|
107
|
+
setSearchContent = _useState4[1];
|
|
108
|
+
|
|
109
|
+
var _useState5 = (0, _react.useState)(false),
|
|
110
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
111
|
+
loading = _useState6[0],
|
|
112
|
+
setLoading = _useState6[1];
|
|
113
|
+
|
|
114
|
+
var _useState7 = (0, _react.useState)(false),
|
|
115
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
116
|
+
isEnd = _useState8[0],
|
|
117
|
+
setIsEnd = _useState8[1];
|
|
118
|
+
|
|
119
|
+
var isRoot = navPath.length === 1;
|
|
120
|
+
var isSearch = !!searchContent; // 普通查询:next 为 0 时代表已经加载完成了
|
|
121
|
+
// 模糊搜索:list 为空数组时代表已经加载完成了
|
|
122
|
+
|
|
123
|
+
var _useState9 = (0, _react.useState)({
|
|
124
|
+
next: -1,
|
|
125
|
+
list: []
|
|
126
|
+
}),
|
|
127
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
128
|
+
docsData = _useState10[0],
|
|
129
|
+
setDocsData = _useState10[1];
|
|
130
|
+
|
|
131
|
+
var _useState11 = (0, _react.useState)([]),
|
|
132
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
133
|
+
checkListData = _useState12[0],
|
|
134
|
+
setCheckListData = _useState12[1];
|
|
135
|
+
|
|
136
|
+
var checkedNum = checkListData.filter(function (item) {
|
|
137
|
+
return item.checked;
|
|
138
|
+
}).length;
|
|
139
|
+
|
|
140
|
+
function fetch(_x) {
|
|
141
|
+
return _fetch.apply(this, arguments);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function _fetch() {
|
|
145
|
+
_fetch = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(params) {
|
|
146
|
+
var res;
|
|
147
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
148
|
+
while (1) {
|
|
149
|
+
switch (_context.prev = _context.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
setLoading(true);
|
|
152
|
+
_context.prev = 1;
|
|
153
|
+
_context.next = 4;
|
|
154
|
+
return (0, _utils.checkTencentAuth)(params);
|
|
155
|
+
|
|
156
|
+
case 4:
|
|
157
|
+
res = _context.sent;
|
|
158
|
+
return _context.abrupt("return", res);
|
|
159
|
+
|
|
160
|
+
case 8:
|
|
161
|
+
_context.prev = 8;
|
|
162
|
+
_context.t0 = _context["catch"](1);
|
|
163
|
+
|
|
164
|
+
case 10:
|
|
165
|
+
_context.prev = 10;
|
|
166
|
+
setLoading(false);
|
|
167
|
+
return _context.finish(10);
|
|
168
|
+
|
|
169
|
+
case 13:
|
|
170
|
+
return _context.abrupt("return", {
|
|
171
|
+
next: 0,
|
|
172
|
+
list: []
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
case 14:
|
|
176
|
+
case "end":
|
|
177
|
+
return _context.stop();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}, _callee, null, [[1, 8, 10, 13]]);
|
|
181
|
+
}));
|
|
182
|
+
return _fetch.apply(this, arguments);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function changeNavPath(docItem, idx) {
|
|
186
|
+
// 如果传了 idx 说明需要再现有的 nav 中截取(直接点击现有的 nav 的情况)
|
|
187
|
+
if (idx !== undefined) setNavPath(navPath.slice(0, idx + 1));else setNavPath([].concat(_toConsumableArray(navPath), [_objectSpread({
|
|
188
|
+
label: docItem.title
|
|
189
|
+
}, docItem)]));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function refreshFolder() {
|
|
193
|
+
return _refreshFolder.apply(this, arguments);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function _refreshFolder() {
|
|
197
|
+
_refreshFolder = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
198
|
+
var docItem, data;
|
|
199
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
200
|
+
while (1) {
|
|
201
|
+
switch (_context2.prev = _context2.next) {
|
|
202
|
+
case 0:
|
|
203
|
+
docItem = navPath[navPath.length - 1];
|
|
204
|
+
_context2.next = 3;
|
|
205
|
+
return fetch({
|
|
206
|
+
folderID: docItem.id
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
case 3:
|
|
210
|
+
data = _context2.sent;
|
|
211
|
+
|
|
212
|
+
if (data) {
|
|
213
|
+
_context2.next = 6;
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return _context2.abrupt("return");
|
|
218
|
+
|
|
219
|
+
case 6:
|
|
220
|
+
setIsEnd(data.next === 0 || data.list.length < 20);
|
|
221
|
+
setDocsData(data);
|
|
222
|
+
|
|
223
|
+
case 8:
|
|
224
|
+
case "end":
|
|
225
|
+
return _context2.stop();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}, _callee2);
|
|
229
|
+
}));
|
|
230
|
+
return _refreshFolder.apply(this, arguments);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function onSearch(_x2) {
|
|
234
|
+
return _onSearch.apply(this, arguments);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function _onSearch() {
|
|
238
|
+
_onSearch = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(content) {
|
|
239
|
+
var data;
|
|
240
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
241
|
+
while (1) {
|
|
242
|
+
switch (_context3.prev = _context3.next) {
|
|
243
|
+
case 0:
|
|
244
|
+
_context3.next = 2;
|
|
245
|
+
return fetch({
|
|
246
|
+
content: content
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
case 2:
|
|
250
|
+
data = _context3.sent;
|
|
251
|
+
|
|
252
|
+
if (data) {
|
|
253
|
+
_context3.next = 5;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return _context3.abrupt("return");
|
|
258
|
+
|
|
259
|
+
case 5:
|
|
260
|
+
setIsEnd(data.list.length < 20); // 重制 vav
|
|
261
|
+
|
|
262
|
+
setNavPath(defaultnNavPath);
|
|
263
|
+
setDocsData(data);
|
|
264
|
+
|
|
265
|
+
case 8:
|
|
266
|
+
case "end":
|
|
267
|
+
return _context3.stop();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}, _callee3);
|
|
271
|
+
}));
|
|
272
|
+
return _onSearch.apply(this, arguments);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function next() {
|
|
276
|
+
return _next2.apply(this, arguments);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function _next2() {
|
|
280
|
+
_next2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
281
|
+
var newData, lastFolder;
|
|
282
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
283
|
+
while (1) {
|
|
284
|
+
switch (_context4.prev = _context4.next) {
|
|
285
|
+
case 0:
|
|
286
|
+
lastFolder = navPath[navPath.length - 1]; // 分三种情况
|
|
287
|
+
// 1. 普通模式(未搜索,直接查询)
|
|
288
|
+
// 2. 搜索模式(搜索后第一页)
|
|
289
|
+
// 3. 搜索后点击了某个文件夹
|
|
290
|
+
|
|
291
|
+
if (!(searchContent && navPath.length === 1)) {
|
|
292
|
+
_context4.next = 8;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
_context4.next = 4;
|
|
297
|
+
return fetch({
|
|
298
|
+
start: docsData.next,
|
|
299
|
+
content: searchContent
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
case 4:
|
|
303
|
+
newData = _context4.sent;
|
|
304
|
+
setIsEnd(newData.list.length < 20);
|
|
305
|
+
_context4.next = 12;
|
|
306
|
+
break;
|
|
307
|
+
|
|
308
|
+
case 8:
|
|
309
|
+
_context4.next = 10;
|
|
310
|
+
return fetch({
|
|
311
|
+
start: docsData.next,
|
|
312
|
+
folderID: lastFolder.id
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
case 10:
|
|
316
|
+
newData = _context4.sent;
|
|
317
|
+
setIsEnd(newData.next === 0 || newData.list.length < 20);
|
|
318
|
+
|
|
319
|
+
case 12:
|
|
320
|
+
setDocsData({
|
|
321
|
+
next: newData.next,
|
|
322
|
+
list: [].concat(_toConsumableArray(docsData.list), _toConsumableArray(newData.list))
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
case 13:
|
|
326
|
+
case "end":
|
|
327
|
+
return _context4.stop();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}, _callee4);
|
|
331
|
+
}));
|
|
332
|
+
return _next2.apply(this, arguments);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
(0, _react.useEffect)(function () {
|
|
336
|
+
// 初始化会从外部传入文档数据,所以不需要查询
|
|
337
|
+
if (init) {
|
|
338
|
+
init = false;
|
|
339
|
+
return;
|
|
340
|
+
} // navPath 更新后刷新当前的文件列表
|
|
341
|
+
// navPath !== defaultnNavPath 是避免在搜索时重制 nav 造成重复请求到问题,因为搜索会调 onSearch,如果再调 refreshFolder 就重复了
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
if (navPath !== defaultnNavPath) refreshFolder();
|
|
345
|
+
}, [navPath]);
|
|
346
|
+
|
|
347
|
+
var onClickTitleHandler = function onClickTitleHandler(docItem) {
|
|
348
|
+
// 切换文件夹
|
|
349
|
+
if (docItem.type === _filePreview.DocType.FOLDER) {
|
|
350
|
+
changeNavPath(docItem);
|
|
351
|
+
return;
|
|
352
|
+
} // 在线预览
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
(0, _tools.openUrl)(docItem.url);
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
function createCheckListData(list) {
|
|
359
|
+
return list.map(function (docItem, i) {
|
|
360
|
+
return _objectSpread({
|
|
361
|
+
component: /*#__PURE__*/_react["default"].createElement(_filePreview["default"], {
|
|
362
|
+
onClickTitle: function onClickTitle() {
|
|
363
|
+
return onClickTitleHandler(docItem);
|
|
364
|
+
},
|
|
365
|
+
title: docItem.title,
|
|
366
|
+
secondTitle: isSearch ? docItem.lastModifyTime : docItem.createTime,
|
|
367
|
+
type: docItem.type
|
|
368
|
+
}),
|
|
369
|
+
isFolder: docItem.type === _filePreview.DocType.FOLDER,
|
|
370
|
+
checked: checkListData[i] && checkListData[i].checked
|
|
371
|
+
}, docItem);
|
|
372
|
+
});
|
|
373
|
+
} // 文件列表数据更新后,同步更新 checkListData
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
(0, _react.useEffect)(function () {
|
|
377
|
+
setCheckListData(createCheckListData(docsData.list || []));
|
|
378
|
+
}, [docsData]); // 传入默认的文件列表
|
|
379
|
+
|
|
380
|
+
(0, _react.useEffect)(function () {
|
|
381
|
+
if (defaultQQDocsData) {
|
|
382
|
+
setDocsData(defaultQQDocsData);
|
|
383
|
+
setCheckListData(createCheckListData(defaultQQDocsData.list));
|
|
384
|
+
}
|
|
385
|
+
}, [defaultQQDocsData]);
|
|
386
|
+
var onSelectNavHandler = (0, _react.useCallback)(function (idx, nav) {
|
|
387
|
+
// 如果再搜索模式下,切换到了根目录,应该继续执行搜索
|
|
388
|
+
if ((searchContent || catchSearchContent) && idx === 0) {
|
|
389
|
+
setSearchContent('');
|
|
390
|
+
catchSearchContent = '';
|
|
391
|
+
setNavPath([].concat(defaultnNavPath));
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
changeNavPath(nav, idx);
|
|
396
|
+
}, [changeNavPath, searchContent]);
|
|
397
|
+
var onChangeCheckBoxListHandler = (0, _react.useCallback)(function (dataList, idx, item) {
|
|
398
|
+
// 判断点击的是否是文件夹
|
|
399
|
+
if (item.isFolder) {
|
|
400
|
+
setCheckListData(checkListData.map(function (item) {
|
|
401
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
402
|
+
checked: false
|
|
403
|
+
});
|
|
404
|
+
})); // 如果是在搜索模式下,缓存搜索内容,清空搜索框
|
|
405
|
+
|
|
406
|
+
if (searchContent) {
|
|
407
|
+
catchSearchContent = searchContent;
|
|
408
|
+
setSearchContent('');
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
changeNavPath(item);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
setCheckListData(dataList);
|
|
416
|
+
}, [changeNavPath, checkListData]);
|
|
417
|
+
var onSearchHandler = (0, _react.useCallback)(function (e) {
|
|
418
|
+
if (searchContent === e) return; // 清空搜索后,恢复到搜索前的状态
|
|
419
|
+
|
|
420
|
+
if (!e) {
|
|
421
|
+
setSearchContent(e);
|
|
422
|
+
setNavPath(_toConsumableArray(catchNavPath));
|
|
423
|
+
catchSearchContent = '';
|
|
424
|
+
return;
|
|
425
|
+
} // 当触发搜索时,记录一下搜索前到路径
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
catchNavPath = navPath;
|
|
429
|
+
onSearch(e);
|
|
430
|
+
setSearchContent(e);
|
|
431
|
+
}, [navPath, searchContent]);
|
|
432
|
+
var onScrollBottomHandler = (0, _react.useCallback)(function () {
|
|
433
|
+
if (isEnd) return;
|
|
434
|
+
next();
|
|
435
|
+
}, [next, isEnd]);
|
|
436
|
+
var onSubmitHandler = (0, _react.useCallback)(function () {
|
|
437
|
+
if (onSubmit) onSubmit(checkListData.filter(function (item) {
|
|
438
|
+
return item.checked;
|
|
439
|
+
}));
|
|
440
|
+
}, [checkListData]);
|
|
441
|
+
|
|
442
|
+
var footer = /*#__PURE__*/_react["default"].createElement("div", {
|
|
443
|
+
className: "".concat(preCls, "__footer")
|
|
444
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, !!checkedNum && /*#__PURE__*/_react["default"].createElement("p", null, (0, _getLocale.getLocale)('Feed_Set_Pop_Sel'), " ", /*#__PURE__*/_react["default"].createElement("span", {
|
|
445
|
+
className: "".concat(preCls, "__checked-num")
|
|
446
|
+
}, checkedNum), " ", (0, _getLocale.getLocale)('Feed_Set_Pop_Ite'))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
447
|
+
className: "".concat(preCls, "__footer__actions")
|
|
448
|
+
}, /*#__PURE__*/_react["default"].createElement(_button["default"].Rect, {
|
|
449
|
+
onClick: restProps.onClose,
|
|
450
|
+
className: "".concat(preCls, "__cancel-btn")
|
|
451
|
+
}, (0, _getLocale.getLocale)('Mod_Cancel')), /*#__PURE__*/_react["default"].createElement(_button["default"].Rect, {
|
|
452
|
+
onClick: onSubmitHandler,
|
|
453
|
+
disabled: !checkedNum,
|
|
454
|
+
type: "primary"
|
|
455
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Butt_Determine'))));
|
|
456
|
+
|
|
457
|
+
var isSearchNull = checkListData.length === 0 && searchContent;
|
|
458
|
+
var onCloseHandler = (0, _react.useCallback)(function () {
|
|
459
|
+
setSearchContent('');
|
|
460
|
+
setNavPath(defaultnNavPath);
|
|
461
|
+
if (restProps.onClose) restProps.onClose();
|
|
462
|
+
}, [restProps.onClose]);
|
|
463
|
+
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], _extends({
|
|
464
|
+
title: title
|
|
465
|
+
}, restProps, {
|
|
466
|
+
onClose: onCloseHandler,
|
|
467
|
+
extraClass: [preCls, restProps.className || ''],
|
|
468
|
+
footer: footer
|
|
469
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
470
|
+
className: "".concat(preCls, "__content")
|
|
471
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
472
|
+
className: "px-32"
|
|
473
|
+
}, /*#__PURE__*/_react["default"].createElement(_searchInput["default"], {
|
|
474
|
+
onSearch: onSearchHandler,
|
|
475
|
+
value: searchContent,
|
|
476
|
+
placeholder: (0, _getLocale.getLocale)('Feed_Set_Pop_Seaallfil'),
|
|
477
|
+
style: {
|
|
478
|
+
height: 36,
|
|
479
|
+
width: '100%'
|
|
480
|
+
}
|
|
481
|
+
})), !isSearchNull && /*#__PURE__*/_react["default"].createElement("p", {
|
|
482
|
+
className: (0, _classnames["default"])("".concat(preCls, "__search-result-text"), _defineProperty({}, "".concat(preCls, "__search-result-text--hide"), !searchContent))
|
|
483
|
+
}, (0, _getLocale.getLocale)('Per_Ma_form_Searchreslt')), /*#__PURE__*/_react["default"].createElement(_nav["default"], {
|
|
484
|
+
onSelect: onSelectNavHandler,
|
|
485
|
+
className: (0, _classnames["default"])("".concat(preCls, "__nav px-32"), _defineProperty({}, "".concat(preCls, "__nav--hide"), isRoot)),
|
|
486
|
+
dataList: navPath
|
|
487
|
+
}), /*#__PURE__*/_react["default"].createElement(_scrollContainer["default"], {
|
|
488
|
+
className: "".concat(preCls, "__checkbox-list"),
|
|
489
|
+
hideScrollbars: false,
|
|
490
|
+
onScrollBottom: onScrollBottomHandler
|
|
491
|
+
}, /*#__PURE__*/_react["default"].createElement(_checkboxList["default"], {
|
|
492
|
+
onChange: onChangeCheckBoxListHandler,
|
|
493
|
+
dataList: checkListData,
|
|
494
|
+
disabled: fileNumLimit !== undefined && checkedNum >= fileNumLimit
|
|
495
|
+
}), isSearchNull && /*#__PURE__*/_react["default"].createElement("div", {
|
|
496
|
+
className: "".concat(preCls, "__search-null")
|
|
497
|
+
}, (0, _getLocale.getLocale)('Per_Ma_form_NoSearchResul')), !isSearchNull && !loading && isEnd && /*#__PURE__*/_react["default"].createElement("p", {
|
|
498
|
+
className: "".concat(preCls, "__end-text")
|
|
499
|
+
}, (0, _getLocale.getLocale)('Feed_Set_Pop_Datloa'))), /*#__PURE__*/_react["default"].createElement(_loading["default"], {
|
|
500
|
+
visible: loading
|
|
501
|
+
})));
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
var _default = DialogQQDocs;
|
|
505
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTencentDoc = void 0;
|
|
7
|
+
|
|
8
|
+
var _request = require("../../utils/request");
|
|
9
|
+
|
|
10
|
+
var getTencentDoc = function getTencentDoc(params) {
|
|
11
|
+
return (0, _request.rget)('v1')('tencentdoc/folderssearch', {
|
|
12
|
+
params: params
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.getTencentDoc = getTencentDoc;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.test = exports.checkTencentAuth = void 0;
|
|
7
|
+
|
|
8
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
+
|
|
10
|
+
var _tools = require("../../utils/tools");
|
|
11
|
+
|
|
12
|
+
var _requestApis = require("./request-apis");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
+
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
|
|
22
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
23
|
+
|
|
24
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
|
+
|
|
26
|
+
var checkTencentAuth = /*#__PURE__*/function () {
|
|
27
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(props) {
|
|
28
|
+
var tencentDocsRes, _ref2, list;
|
|
29
|
+
|
|
30
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
+
while (1) {
|
|
32
|
+
switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
_context.next = 2;
|
|
35
|
+
return (0, _requestApis.getTencentDoc)(props);
|
|
36
|
+
|
|
37
|
+
case 2:
|
|
38
|
+
tencentDocsRes = _context.sent;
|
|
39
|
+
|
|
40
|
+
if (!(tencentDocsRes.Code === 0)) {
|
|
41
|
+
_context.next = 6;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (tencentDocsRes.Message) (0, _tools.openUrl)(tencentDocsRes.Message);
|
|
46
|
+
return _context.abrupt("return", false);
|
|
47
|
+
|
|
48
|
+
case 6:
|
|
49
|
+
// 格式化时间戳
|
|
50
|
+
_ref2 = tencentDocsRes.Data || {}, list = _ref2.list;
|
|
51
|
+
return _context.abrupt("return", _objectSpread(_objectSpread({}, tencentDocsRes.Data), {}, {
|
|
52
|
+
list: (list || []).map(function (item) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
54
|
+
// 用于普通展示
|
|
55
|
+
createTime: (0, _dayjs["default"])(item.lastBrowseTime * 1000).format('YYYY/MM/DD HH:mm'),
|
|
56
|
+
// 用户搜索展示
|
|
57
|
+
lastModifyTime: (0, _dayjs["default"])(parseInt(item.lastModifyTime)).format('YYYY/MM/DD HH:mm')
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
case 8:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, _callee);
|
|
68
|
+
}));
|
|
69
|
+
|
|
70
|
+
return function checkTencentAuth(_x) {
|
|
71
|
+
return _ref.apply(this, arguments);
|
|
72
|
+
};
|
|
73
|
+
}();
|
|
74
|
+
|
|
75
|
+
exports.checkTencentAuth = checkTencentAuth;
|
|
76
|
+
|
|
77
|
+
var test = function test() {};
|
|
78
|
+
|
|
79
|
+
exports.test = test;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
11
|
+
|
|
12
|
+
require("./index.css");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["data", "onSelect"];
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
+
|
|
24
|
+
var preCls = 'titaui-dialog-select';
|
|
25
|
+
|
|
26
|
+
var DialogSelect = function DialogSelect(_ref) {
|
|
27
|
+
var data = _ref.data,
|
|
28
|
+
onSelect = _ref.onSelect,
|
|
29
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
var onClickItemHandler = function onClickItemHandler(idx) {
|
|
32
|
+
if (onSelect) onSelect(idx, data[idx]);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], _extends({}, restProps, {
|
|
36
|
+
noFooter: true
|
|
37
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
38
|
+
className: preCls
|
|
39
|
+
}, data.map(function (item, i) {
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
|
+
className: "".concat(preCls, "__item"),
|
|
42
|
+
onClick: onClickItemHandler.bind(null, i)
|
|
43
|
+
}, item.component);
|
|
44
|
+
})));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var _default = DialogSelect;
|
|
48
|
+
exports["default"] = _default;
|