@titaui/pc 1.5.82 → 1.5.83
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.css +15 -0
- package/lib/components/avatar/icon-avatar/index.js +50 -0
- package/lib/components/avatar/index.js +9 -1
- package/lib/components/avatar/num-avatar/index.css +12 -0
- package/lib/components/avatar/num-avatar/index.js +34 -0
- package/lib/components/button/admin-button/default.js +35 -0
- package/lib/components/button/admin-button/drop-down-arrow.js +93 -0
- package/lib/components/button/admin-button/index.css +86 -0
- package/lib/components/button/admin-button/index.js +40 -0
- package/lib/components/button/admin-button/primary.js +33 -0
- package/lib/components/button/admin-button/secondary.js +35 -0
- package/lib/components/button/default-button/index.css +49 -0
- package/lib/components/button/default-button/index.js +51 -0
- package/lib/components/button/export-button/index.css +51 -0
- package/lib/components/button/export-button/index.js +81 -0
- package/lib/components/button/images/daoru.svg +18 -0
- package/lib/components/button/index.js +23 -0
- package/lib/components/button/interface.js +5 -0
- package/lib/components/change-okr/Filter.js +133 -65
- package/lib/components/change-okr/Item.js +6 -0
- package/lib/components/change-okr/filterTab.js +2 -0
- package/lib/components/change-okr/index.js +2 -2
- package/lib/components/checkbox/index.js +4 -3
- package/lib/components/communication/CommunicationRecord.js +116 -161
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.css +63 -0
- package/lib/components/communication/index.js +53 -28
- package/lib/components/communication/style.js +21 -25
- package/lib/components/create-okr/animation/check-animation.js +2746 -0
- package/lib/components/create-okr/constant.js +27 -0
- package/lib/components/create-okr/createCycle.js +193 -0
- package/lib/components/create-okr/createSuccessCmp.js +233 -0
- package/lib/components/create-okr/createSuccessCmpWrapper.js +20 -0
- package/lib/components/create-okr/fields/date-cycle.js +98 -0
- package/lib/components/create-okr/fields/index.css +346 -0
- package/lib/components/create-okr/fields/index.js +17 -0
- package/lib/components/create-okr/fields/input-with-err-popup.js +57 -0
- package/lib/components/create-okr/fields/o-new-name.js +197 -0
- package/lib/components/create-okr/fields/okr-case.js +98 -0
- package/lib/components/create-okr/fields/okr-classify.js +51 -0
- package/lib/components/create-okr/fields/okr-create-suggest.js +147 -0
- package/lib/components/create-okr/fields/okr-new-user-selector.js +106 -0
- package/lib/components/create-okr/fields/okr-parent.js +157 -0
- package/lib/components/create-okr/fields/okr-type-detail.js +196 -0
- package/lib/components/create-okr/fields/okr-type.js +131 -0
- package/lib/components/create-okr/fields/okr-visibility-detail.js +224 -0
- package/lib/components/create-okr/fields/okr-visibility.js +169 -0
- package/lib/components/create-okr/img/check-normal.svg +29 -0
- package/lib/components/create-okr/img/check-right.svg +16 -0
- package/lib/components/create-okr/img/check-wrong.svg +29 -0
- package/lib/components/create-okr/img/create-success-head.png +0 -0
- package/lib/components/create-okr/img/create-success-left-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-message.svg +1 -0
- package/lib/components/create-okr/img/create-success-right-quotation.svg +14 -0
- package/lib/components/create-okr/img/create-success-shadow.svg +23 -0
- package/lib/components/create-okr/img/example.svg +11 -0
- package/lib/components/create-okr/img/hand.svg +12 -0
- package/lib/components/create-okr/img/kr-add.svg +12 -0
- package/lib/components/create-okr/img/left-quotation.svg +12 -0
- package/lib/components/create-okr/img/light.svg +1 -0
- package/lib/components/create-okr/img/pack-up.js +28 -0
- package/lib/components/create-okr/img/qr-code.png +0 -0
- package/lib/components/create-okr/img/right-quotation.svg +12 -0
- package/lib/components/create-okr/img/shower.png +0 -0
- package/lib/components/create-okr/img/target.svg +19 -0
- package/lib/components/create-okr/img/teach-okr.svg +17 -0
- package/lib/components/create-okr/img/wave.png +0 -0
- package/lib/components/create-okr/img/weight.svg +12 -0
- package/lib/components/create-okr/index.css +446 -0
- package/lib/components/create-okr/index.js +911 -0
- package/lib/components/create-okr/interface.js +5 -0
- package/lib/components/create-okr/kr-items/index.css +180 -0
- package/lib/components/create-okr/kr-items/kr-item-weight.js +194 -0
- package/lib/components/create-okr/kr-items/krDatas.js +299 -0
- package/lib/components/create-okr/kr-items/krItem.js +167 -0
- package/lib/components/create-okr/objectType.js +273 -0
- package/lib/components/create-okr/request-api.js +220 -0
- package/lib/components/create-okr/style.js +100 -0
- package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +124 -0
- package/lib/components/create-okr/utils/helper.js +99 -0
- package/lib/components/create-okr/utils/index.js +23 -0
- package/lib/components/dropdown-layer/icon-item.js +5 -3
- package/lib/components/dropdown-layer/index.css +16 -0
- package/lib/components/dropdown-layer/index.js +21 -14
- package/lib/components/dynamic/components/condition-render/index.js +20 -0
- package/lib/components/dynamic/components/dangerous-html/index.js +22 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +78 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +192 -0
- package/lib/components/dynamic/components/obj-status/index.css +22 -0
- package/lib/components/dynamic/components/obj-status/index.js +38 -0
- package/lib/components/dynamic/components/percent/index.css +21 -0
- package/lib/components/dynamic/components/percent/index.js +38 -0
- package/lib/components/dynamic/components/title/index.css +35 -0
- package/lib/components/dynamic/components/title/index.js +59 -0
- package/lib/components/dynamic/constant.js +97 -0
- package/lib/components/dynamic/context/index.js +13 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.css +101 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.js +299 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.css +10 -0
- package/lib/components/dynamic/dynamic-item/components/icon/index.js +35 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +173 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +48 -0
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +89 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +96 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +171 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +67 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +110 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +158 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +215 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +16 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +91 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +125 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +22 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +95 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +192 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +183 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +153 -0
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +138 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +97 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +207 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +59 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +107 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +111 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +164 -0
- package/lib/components/dynamic/dynamic-item/index.css +128 -0
- package/lib/components/dynamic/dynamic-item/index.js +352 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +126 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +157 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +107 -0
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
- package/lib/components/dynamic/dynamic-liking/index.css +81 -0
- package/lib/components/dynamic/dynamic-liking/index.js +76 -0
- package/lib/components/dynamic/dynamic-liking/item.js +91 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.css +36 -0
- package/lib/components/dynamic/dynamic-list/index.js +61 -0
- package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +148 -0
- package/lib/components/dynamic/dynamic-topping/index.js +80 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +140 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +204 -0
- package/lib/components/dynamic/dynamic.js +391 -0
- package/lib/components/dynamic/export-module/index.js +33 -0
- package/lib/components/dynamic/img/dynamic-P1.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P2.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P3.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P4.svg +15 -0
- package/lib/components/dynamic/img/dynamic-P5.svg +15 -0
- package/lib/components/dynamic/img/dynamic-delay.svg +17 -0
- package/lib/components/dynamic/img/dynamic-desire.svg +61 -0
- package/lib/components/dynamic/img/dynamic-empty.png +0 -0
- package/lib/components/dynamic/img/dynamic-end.svg +17 -0
- package/lib/components/dynamic/img/dynamic-left-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
- package/lib/components/dynamic/img/dynamic-normal.svg +17 -0
- package/lib/components/dynamic/img/dynamic-promise.svg +61 -0
- package/lib/components/dynamic/img/dynamic-reword.svg +24 -0
- package/lib/components/dynamic/img/dynamic-right-quoto.svg +13 -0
- package/lib/components/dynamic/img/dynamic-risk.svg +17 -0
- package/lib/components/dynamic/img/dynamic-submit-delay.svg +16 -0
- package/lib/components/dynamic/img/dynamic-submit-normal.svg +18 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +27 -0
- package/lib/components/dynamic/interface.js +5 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +37 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +42 -0
- package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +51 -0
- package/lib/components/dynamic/quick-operation/index.js +112 -0
- package/lib/components/dynamic/request-api.js +92 -0
- package/lib/components/dynamic/util.js +140 -0
- package/lib/components/emotionsSelector/style.js +1 -1
- package/lib/components/file-list/components/single-file/index.css +84 -0
- package/lib/components/file-list/components/single-file/index.js +115 -0
- package/lib/components/file-list/img/new-file-list-doc.svg +1 -0
- package/lib/components/file-list/img/new-file-list-other.svg +1 -0
- package/lib/components/file-list/img/new-file-list-pdf.svg +1 -0
- package/lib/components/file-list/img/new-file-list-ppt.svg +1 -0
- package/lib/components/file-list/img/new-file-list-radio.svg +1 -0
- package/lib/components/file-list/img/new-file-list-video.svg +1 -0
- package/lib/components/file-list/img/new-file-list-xls.svg +1 -0
- package/lib/components/file-list/index.css +5 -0
- package/lib/components/file-list/index.js +61 -0
- package/lib/components/file-list/interface.js +5 -0
- package/lib/components/file-list/util.js +78 -0
- package/lib/components/form/form-fields/input/index.css +11 -0
- package/lib/components/form/form-fields/input/index.js +3 -1
- package/lib/components/grid-page/image/{Assistant.svg → assistant.svg} +0 -0
- package/lib/components/grid-page/image/{Boss.svg → boss.svg} +0 -0
- package/lib/components/grid-page/image/{Default-background.png → default-background.png} +0 -0
- package/lib/components/grid-page/image/{UserManager.svg → userManager.svg} +0 -0
- package/lib/components/grid-page/personal-info/index.js +5 -5
- package/lib/components/img-viewer/icon/enlarge.js +30 -0
- package/lib/components/img-viewer/icon/left-rotate.js +46 -0
- package/lib/components/img-viewer/icon/right-rotate.js +44 -0
- package/lib/components/img-viewer/icon/shrink.js +37 -0
- package/lib/components/img-viewer/image/loading.gif +0 -0
- package/lib/components/img-viewer/index.css +155 -0
- package/lib/components/img-viewer/index.js +228 -0
- package/lib/components/img-viewer/interface.js +5 -0
- package/lib/components/img-viewer/util.js +16 -0
- package/lib/components/mblog/components/MblogAction.js +10 -6
- package/lib/components/mblog/index.js +24 -11
- package/lib/components/mblog/style.js +8 -8
- package/lib/components/okr-detail/components/header/index.css +4 -0
- package/lib/components/okr-detail/components/header/o-cycle.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +15 -8
- package/lib/components/okr-flow/child-node/work-node.js +7 -1
- package/lib/components/okr-period-selector/select-cycle.js +139 -151
- package/lib/components/okr-progress-detail/index.css +1 -0
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
- package/lib/components/okr-review/ReviewPop/index.js +4 -4
- package/lib/components/period-selector/common.js +168 -17
- package/lib/components/period-selector/components/selector/index.js +103 -38
- package/lib/components/period-selector/components/selector/style.js +23 -9
- package/lib/components/period-selector/index.js +29 -28
- package/lib/components/popup/index.js +3 -1
- package/lib/components/publish-dynamic-modal/index.js +13 -0
- package/lib/components/publish-dynamic-modal/interface.js +5 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +3 -0
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +191 -0
- package/lib/components/publish-dynamic-modal/requist-api.js +48 -0
- package/lib/components/radio/index.css +5 -0
- package/lib/components/radio/radio.js +12 -4
- package/lib/components/search-key-handle/index.js +39 -0
- package/lib/components/table/index.css +0 -1
- package/lib/components/upload/components/uploadedPreview.js +62 -54
- package/lib/components/upload/img/doc.svg +1 -0
- package/lib/components/upload/img/other.svg +1 -0
- package/lib/components/upload/img/pdf.svg +1 -0
- package/lib/components/upload/img/ppt.svg +1 -0
- package/lib/components/upload/img/radio.svg +1 -0
- package/lib/components/upload/img/video.svg +1 -0
- package/lib/components/upload/img/xls.svg +1 -0
- package/lib/components/upload/index.css +26 -0
- package/lib/components/upload/index.js +89 -57
- package/lib/components/upload/style.js +7 -7
- package/lib/components/upload/type.js +15 -15
- package/lib/components/upload/util.js +102 -0
- package/lib/components/upvote/index.js +37 -14
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +4 -0
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +50 -24
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +11 -2
- package/lib/components/user-selector/layout/index.css +1 -1
- package/lib/components-v1/buttonv2/ButtonLinked.js +35 -0
- package/lib/components-v1/buttonv2/ButtonOutlined.js +64 -0
- package/lib/components-v1/buttonv2/ButtonRounded.js +101 -0
- package/lib/components-v1/buttonv2/DefaultButton.js +86 -0
- package/lib/components-v1/buttonv2/index.js +37 -0
- package/lib/components-v1/buttonv2/style/style.js +53 -0
- package/lib/components-v1/buttonv2/style/theme.css +3 -0
- package/lib/components-v1/confirm/index.js +158 -0
- package/lib/index.js +49 -5
- package/lib/pages/dynamic/index.css +5 -0
- package/lib/pages/dynamic/index.js +25 -0
- package/lib/pages/home-page/components/data-list/nav-selector/index.js +18 -0
- package/lib/pages/home-page/components/data-list/table/utils-function.js +6 -3
- package/lib/pages/like-ranking/column.js +141 -0
- package/lib/pages/like-ranking/filter-buttons/department.js +44 -0
- package/lib/pages/like-ranking/filter-buttons/group.js +34 -0
- package/lib/pages/like-ranking/filter-buttons/index.css +19 -0
- package/lib/pages/like-ranking/filter-buttons/index.js +40 -0
- package/lib/pages/like-ranking/filter-buttons/modular.js +110 -0
- package/lib/pages/like-ranking/filter-buttons/name.js +73 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +27 -0
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +38 -0
- package/lib/pages/like-ranking/filter-buttons/timer.js +56 -0
- package/lib/pages/like-ranking/image/dynamic-empty.png +0 -0
- package/lib/pages/like-ranking/image/loading.gif +0 -0
- package/lib/pages/like-ranking/image/ranking-1.png +0 -0
- package/lib/pages/like-ranking/image/ranking-2.png +0 -0
- package/lib/pages/like-ranking/image/ranking-3.png +0 -0
- package/lib/pages/like-ranking/index.css +185 -0
- package/lib/pages/like-ranking/index.js +252 -0
- package/lib/pages/like-ranking/mock.js +366 -0
- package/lib/pages/like-ranking/request-api.js +15 -0
- package/lib/utils/auth.js +46 -5
- package/lib/utils/bs-global.js +26 -2
- package/lib/utils/format-time.js +161 -0
- package/lib/utils/helpers.js +41 -0
- package/lib/utils/roundWeight.js +105 -0
- package/lib/utils/tools.js +140 -20
- package/package.json +2 -2
|
@@ -11,10 +11,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _titaUi = require("tita-ui");
|
|
13
13
|
|
|
14
|
-
var _type = require("../type");
|
|
15
|
-
|
|
16
14
|
var _style = require("../style");
|
|
17
15
|
|
|
16
|
+
require("../index.css");
|
|
17
|
+
|
|
18
|
+
var _util = require("../util");
|
|
19
|
+
|
|
18
20
|
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); }
|
|
19
21
|
|
|
20
22
|
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; }
|
|
@@ -55,16 +57,14 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
55
57
|
var uploadResultItem = _this.props.uploadResultItem; // 上传中或不是图片文件时用默认icon
|
|
56
58
|
|
|
57
59
|
if (uploadResultItem.uploadStatus === 2 || !uploadResultItem.IsImage) {
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
color: (0, _type._dealAttachmentType)(uploadResultItem.FileType).IconColor
|
|
62
|
-
}
|
|
60
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
61
|
+
src: (0, _util.getFileTypeMapIcon)(uploadResultItem.FileType),
|
|
62
|
+
className: "upload-preview-img"
|
|
63
63
|
});
|
|
64
64
|
} else {
|
|
65
65
|
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
66
66
|
src: uploadResultItem.ClientUrl,
|
|
67
|
-
|
|
67
|
+
className: "upload-preview-img"
|
|
68
68
|
}); // 上传成功且为图片时
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -72,17 +72,19 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
72
72
|
_this.dealPreviewOptions = function (uploadStatus, index, deleteable, smallImageUrl) {
|
|
73
73
|
var onSubmit = _this.props.onSubmit;
|
|
74
74
|
|
|
75
|
-
if (uploadStatus === 2) {
|
|
75
|
+
if (uploadStatus === 2 || uploadStatus === 1) {
|
|
76
76
|
// 上传中
|
|
77
77
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
78
78
|
content: "\u53D6\u6D88\u4E0A\u4F20",
|
|
79
79
|
container: document.body
|
|
80
80
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
81
|
-
className: "
|
|
81
|
+
className: "upload-file-action-wrapper"
|
|
82
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
83
|
+
className: "tu-icon-canceled action-icon action-icon-delete",
|
|
82
84
|
onMouseDown: function onMouseDown() {
|
|
83
85
|
return onSubmit(index, 'cancel');
|
|
84
86
|
}
|
|
85
|
-
}));
|
|
87
|
+
})));
|
|
86
88
|
} else if (uploadStatus === 3) {
|
|
87
89
|
// 上传成功
|
|
88
90
|
if (smallImageUrl && deleteable) {
|
|
@@ -91,84 +93,95 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
91
93
|
content: "\u9884\u89C8",
|
|
92
94
|
container: document.body
|
|
93
95
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
94
|
-
className: "
|
|
96
|
+
className: "upload-file-action-wrapper"
|
|
97
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
98
|
+
className: "tu-icon-yulan action-icon",
|
|
95
99
|
onMouseDown: function onMouseDown() {
|
|
96
100
|
return onSubmit(index, 'preview');
|
|
97
101
|
}
|
|
98
|
-
})), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
102
|
+
}))), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
99
103
|
content: "\u5220\u9664",
|
|
100
104
|
container: document.body
|
|
101
105
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
102
|
-
className: "
|
|
106
|
+
className: "upload-file-action-wrapper"
|
|
107
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
108
|
+
className: "tu-icon-canceled action-icon delete",
|
|
103
109
|
onMouseDown: function onMouseDown() {
|
|
104
110
|
return onSubmit(index, 'delete');
|
|
105
111
|
}
|
|
106
|
-
}))];
|
|
112
|
+
})))];
|
|
107
113
|
} else if (!smallImageUrl && deleteable) {
|
|
108
114
|
// 不是图片但能删除
|
|
109
115
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
110
116
|
content: "\u5220\u9664",
|
|
111
117
|
container: document.body
|
|
112
118
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
113
|
-
className: "
|
|
119
|
+
className: "upload-file-action-wrapper"
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
121
|
+
className: "tu-icon-canceled action-icon delete",
|
|
114
122
|
onMouseDown: function onMouseDown() {
|
|
115
123
|
return onSubmit(index, 'delete');
|
|
116
124
|
}
|
|
117
|
-
}));
|
|
125
|
+
})));
|
|
118
126
|
} else if (smallImageUrl && !deleteable) {
|
|
119
127
|
// 是图片不能删除
|
|
120
128
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
121
129
|
content: "\u9884\u89C8",
|
|
122
130
|
container: document.body
|
|
131
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
132
|
+
className: "upload-file-action-wrapper"
|
|
123
133
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
124
134
|
className: "tu-icon-magnifier-circle action-icon",
|
|
125
135
|
onMouseDown: function onMouseDown() {
|
|
126
136
|
return onSubmit(index, 'preview');
|
|
127
137
|
}
|
|
128
|
-
}));
|
|
138
|
+
})));
|
|
129
139
|
} else {
|
|
130
140
|
// 不是图片也不能删除
|
|
131
141
|
return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
132
142
|
}
|
|
133
|
-
} else {
|
|
134
|
-
// 4:上传失败
|
|
143
|
+
} else if (uploadStatus === 5) {
|
|
135
144
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
136
145
|
content: "\u5220\u9664",
|
|
137
146
|
container: document.body
|
|
138
147
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
139
|
-
className: "
|
|
148
|
+
className: "upload-file-action-wrapper"
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
150
|
+
className: "tu-icon-canceled action-icon delete",
|
|
151
|
+
onMouseDown: function onMouseDown() {
|
|
152
|
+
return onSubmit(index, 'delete');
|
|
153
|
+
}
|
|
154
|
+
})));
|
|
155
|
+
} else {
|
|
156
|
+
// 4:上传失败
|
|
157
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
158
|
+
content: "\u91CD\u65B0\u4E0A\u4F20",
|
|
159
|
+
container: document.body
|
|
160
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
161
|
+
className: "upload-file-action-wrapper"
|
|
162
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
163
|
+
className: "tu-icon-gengxin1 action-icon",
|
|
140
164
|
onMouseDown: function onMouseDown() {
|
|
141
165
|
return onSubmit(index, 'reupload');
|
|
142
166
|
}
|
|
143
|
-
}))
|
|
167
|
+
}))), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
168
|
+
content: "\u5220\u9664",
|
|
169
|
+
container: document.body
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
171
|
+
className: "upload-file-action-wrapper"
|
|
172
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
173
|
+
className: "tu-icon-canceled action-icon delete",
|
|
174
|
+
onMouseDown: function onMouseDown() {
|
|
175
|
+
return onSubmit(index, 'delete');
|
|
176
|
+
}
|
|
177
|
+
}))));
|
|
144
178
|
}
|
|
145
179
|
};
|
|
146
180
|
|
|
147
|
-
_this.state = {
|
|
148
|
-
isDismiss: false
|
|
149
|
-
};
|
|
150
181
|
return _this;
|
|
151
182
|
}
|
|
152
183
|
|
|
153
184
|
_createClass(UploadedPreview, [{
|
|
154
|
-
key: "componentWillReceiveProps",
|
|
155
|
-
value: function componentWillReceiveProps(nextProps) {
|
|
156
|
-
var _this2 = this;
|
|
157
|
-
|
|
158
|
-
var _nextProps$uploadResu = nextProps.uploadResultItem,
|
|
159
|
-
percentComplete = _nextProps$uploadResu.percentComplete,
|
|
160
|
-
IsSuccess = _nextProps$uploadResu.IsSuccess;
|
|
161
|
-
|
|
162
|
-
if (percentComplete === 100 && IsSuccess) {
|
|
163
|
-
clearTimeout(this.updateStatusTimer);
|
|
164
|
-
this.updateStatusTimer = setTimeout(function () {
|
|
165
|
-
_this2.setState({
|
|
166
|
-
isDismiss: true
|
|
167
|
-
});
|
|
168
|
-
}, 2000);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
185
|
key: "componentWillUnmount",
|
|
173
186
|
value: function componentWillUnmount() {
|
|
174
187
|
clearTimeout(this.updateStatusTimer);
|
|
@@ -181,7 +194,6 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
181
194
|
className = _this$props.className,
|
|
182
195
|
uploadResultItem = _this$props.uploadResultItem,
|
|
183
196
|
index = _this$props.index;
|
|
184
|
-
var isDismiss = this.state.isDismiss;
|
|
185
197
|
return /*#__PURE__*/_react["default"].createElement(_style.PreviewContent, {
|
|
186
198
|
className: ['preview__content', className].join(' ')
|
|
187
199
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewImageWrapper, null, this.renderPreviewThumbnail()), /*#__PURE__*/_react["default"].createElement(_style.PreviewMessageWrapper, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
@@ -190,18 +202,14 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
190
202
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewFileTitle, {
|
|
191
203
|
"data-tip": uploadResultItem.FileName,
|
|
192
204
|
key: uploadResultItem.uid
|
|
193
|
-
}, uploadResultItem.FileName, uploadResultItem.uploadStatus === 2 ? /*#__PURE__*/_react["default"].createElement(_style.UploadProgress, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
|
+
}, uploadResultItem.FileName, (uploadResultItem.uploadStatus === 2 || uploadResultItem.uploadStatus === 3) && uploadResultItem.percentComplete !== 100 ? /*#__PURE__*/_react["default"].createElement(_style.UploadProgress, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
194
206
|
style: {
|
|
195
207
|
width: uploadResultItem.percentComplete + '%'
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
className: uploadResultItem.
|
|
200
|
-
|
|
201
|
-
color: uploadResultItem.IsSuccess ? '#2dab92' : '#eb4447',
|
|
202
|
-
opacity: isDismiss ? 0 : 1
|
|
203
|
-
}
|
|
204
|
-
}, uploadResultItem.Msg)), /*#__PURE__*/_react["default"].createElement(_style.PreviewOptionsWrapper, null, this.dealPreviewOptions(uploadResultItem.uploadStatus, index, uploadResultItem.Deleteable, uploadResultItem.SmallImageUrl), " "));
|
|
208
|
+
},
|
|
209
|
+
className: 'upload-file--progress'
|
|
210
|
+
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
211
|
+
className: uploadResultItem.uploadStatus === 3 || uploadResultItem.uploadStatus === 2 ? 'upload-file-size' : 'upload-file-size upload-file-size--error'
|
|
212
|
+
}, uploadResultItem.uploadStatus === 3 || uploadResultItem.uploadStatus === 2 ? (0, _util.getFileSize)(uploadResultItem.FileSize) : uploadResultItem.Msg)))), /*#__PURE__*/_react["default"].createElement(_style.PreviewOptionsWrapper, null, this.dealPreviewOptions(uploadResultItem.uploadStatus, index, uploadResultItem.Deleteable, uploadResultItem.SmallImageUrl), " "));
|
|
205
213
|
}
|
|
206
214
|
}]);
|
|
207
215
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#2879FF" offset="0%"/><stop stop-color="#005BDC" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b"><stop stop-color="#88BCFF" offset="0%"/><stop stop-color="#2879FF" offset="100%"/></linearGradient><filter x="-31.7%" y="-38%" width="163.3%" height="176%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".8" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".4" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.105882353 0 0 0 0 0.435294118 0 0 0 0 0.952941176 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(6.533 8.773)"><path d="M.677 4.775h9.846a.677.677 0 1 1 0 1.355H.677a.677.677 0 1 1 0-1.355z" fill="#D2E3FF"/><path d="M.677 1.162h4.246a.677.677 0 0 1 0 1.355H.677a.677.677 0 0 1 0-1.355z" fill="#FFF"/><path d="M.677 8.351h9.846a.677.677 0 1 1 0 1.355H.677a.677.677 0 0 1 0-1.355z" fill="#A8C9FF"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#26D8F0" offset="0%"/><stop stop-color="#00A7BD" offset="100%"/></linearGradient><linearGradient x1="50%" y1="99.348%" x2="50%" y2="0%" id="b"><stop stop-color="#00BDD6" offset="0%"/><stop stop-color="#9EF4FF" offset="100%"/></linearGradient><filter x="-31.7%" y="-35.3%" width="163.3%" height="170.6%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".8" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".4" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0.741176471 0 0 0 0 0.839215686 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 7.677h15.555c.86 0 1.556.669 1.556 1.493v14.176c0 .825-.696 1.493-1.556 1.493H8.09c-.86 0-1.556-.668-1.556-1.493V9.17c0-.824.697-1.493 1.556-1.493z" fill="url(#a)" fill-rule="nonzero" transform="translate(0 .452)"/><path d="M20.291 2.258c.84 0 1.521.674 1.521 1.505v19.57c0 .832.681 1.506 1.521 1.506H4.321c-.84 0-1.521-.674-1.521-1.506V3.763c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero" transform="translate(0 .452)"/><g filter="url(#c)" transform="translate(6.3 8.6)" fill-rule="nonzero"><path d="M8.846 1.02H3.395l1.267 2.198A2 2 0 0 0 6.38 4.22l4.126.031V2.664c0-.916-.753-1.643-1.66-1.643zm0 1.175c.268 0 .486.21.486.47v.399l-3.416-.02-.49-.85h3.42z" fill="#C7F8FF"/><path d="M3.298 0H1.403C.628 0 0 .628 0 1.403v7.964c0 .775.628 1.403 1.403 1.403h9.193a1.403 1.403 0 0 0 1.403-1.403L12 4.545l-.006-.126a1.4 1.4 0 0 0-1.373-1.27l-4.678-.037L4.615.807C4.331.337 3.856 0 3.298 0zM1.403 1.174h1.895c.094 0 .222.09.306.23l1.49 2.585c.104.18.295.291.503.293l5.01.04c.12.002.219.102.22.225l-.002 4.82a.23.23 0 0 1-.229.23H1.403a.23.23 0 0 1-.23-.23V1.403a.23.23 0 0 1 .23-.23z" fill="#FFF"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#FD4F54" offset="0%"/><stop stop-color="#CD1116" offset="100%"/></linearGradient><linearGradient x1="50%" y1="100%" x2="50%" y2="0%" id="b"><stop stop-color="#EC3C3C" offset="0%"/><stop stop-color="#FF8383" offset="100%"/></linearGradient><linearGradient x1="47.638%" y1="10.393%" x2="52.642%" y2="90.65%" id="d"><stop stop-color="#FFF" offset="0%"/><stop stop-color="#F6AFAF" offset="45.302%"/><stop stop-color="#FFF" offset="100%"/></linearGradient><filter x="-15.6%" y="-15.6%" width="131.2%" height="131.2%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".5" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".25" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.878431373 0 0 0 0 0.125490196 0 0 0 0 0.125490196 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(4 6.032)" fill-rule="nonzero"><path d="m11.249.837.176.048.189.062c.729.268 1.145.751 1.297 1.338.31 1.258-.573 2.82-2.161 4.553l-.334.355.101.388c.175.649.362 1.257.564 1.823l.155.417.131.33.215.099c1.977.926 3.282 1.856 3.643 2.845l.045.141.032.143c.103.492-.05.963-.441 1.359-.329.282-.684.43-1.06.43-1.233 0-2.347-1.514-3.368-3.854l-.082-.188-.421-.174a24.406 24.406 0 0 0-1.997-.705l-.49-.143L7.043 10l-.206.136c-1.307.845-2.517 1.418-3.54 1.549l-.217.02-.21.008c-.924 0-1.603-.48-1.851-1.311-.172-.587-.078-1.098.184-1.43.4-.557 1.189-.824 2.353-.824.815 0 1.813.13 2.908.379l.322.076.345-.251c.414-.31.815-.636 1.195-.97l.374-.338.28-.267-.04-.192c-.412-2.088-.448-3.81.134-4.852l.092-.151.096-.135c.465-.59 1.17-.801 1.986-.609zm.968 11.202.039.07c.628 1.126 1.235 1.783 1.545 1.783.033 0 .077-.018.145-.075.085-.085.094-.119.08-.18-.073-.369-.656-.928-1.695-1.534l-.114-.064zm-8.66-2.594c-.813 0-1.194.138-1.303.27l-.024.046c-.024.053-.027.134.016.289.065.26.22.386.625.386.511 0 1.225-.234 2.084-.68l.27-.146-.089-.016a10.444 10.444 0 0 0-1.345-.145l-.234-.004zM9.333 8.21l-.263.229-.337.283-.374.305.172.052c.36.112.723.235 1.078.364l.12.045-.067-.195a21.92 21.92 0 0 1-.205-.656l-.124-.427zm1.348-6.148a.506.506 0 0 0-.418.193c-.348.437-.439 1.523-.247 2.97l.061.414.085-.095c1.02-1.189 1.577-2.254 1.512-2.853l-.016-.095c-.031-.158-.143-.297-.471-.415l-.134-.043a.994.994 0 0 0-.372-.076z" fill="#FFF"/><path d="m10.416 7.193.101.388c.175.649.362 1.257.564 1.823l.155.417.131.33c.817 2.33 1.982 3.858 3.494 4.587-.329.282-.684.43-1.06.43-1.233 0-2.347-1.514-3.368-3.854l-.082-.188a25.48 25.48 0 0 1-.766-2.113 27.948 27.948 0 0 1-.605-2.237l-.038-.192c-.413-2.088-.449-3.81.133-4.852l.092-.151.096-.135c.465-.59 1.17-.801 1.986-.609l.176.048.189.062c.729.268 1.684 1.674-.427 1.23-1.408-.297-1.665 1.375-.77 5.016z" fill="url(#d)"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#F0A326" offset="0%"/><stop stop-color="#D68500" offset="100%"/></linearGradient><linearGradient x1="50%" y1="99.348%" x2="50%" y2="0%" id="b"><stop stop-color="#F0A326" offset="0%"/><stop stop-color="#FFDA9E" offset="100%"/></linearGradient><filter x="-47.5%" y="-34.5%" width="195%" height="169.1%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".8" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".4" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.839215686 0 0 0 0 0.521568627 0 0 0 0 0 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(8 9)"><path d="M.933 9.687V2.7a.7.7 0 1 1 1.4 0v6.987a.7.7 0 1 1-1.4 0z" fill="#FFDA9E"/><path d="M4.57 0c2.222 0 3.333.91 3.333 2.745 0 1.847-1.125 2.77-3.36 2.77H.933a.608.608 0 0 1-.56-.592.597.597 0 0 1 .656-.586l3.423.002c.706 0 1.215-.126 1.542-.38.314-.252.484-.657.484-1.214 0-.557-.17-.961-.497-1.189-.327-.253-.837-.38-1.53-.38H.934a.602.602 0 0 1-.56-.589C.373.263.645 0 .98 0L.932.003.933 0z" fill="#FFF" fill-rule="nonzero"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#F026D8" offset="0%"/><stop stop-color="#BD00A7" offset="100%"/></linearGradient><linearGradient x1="50%" y1="99.348%" x2="50%" y2=".295%" id="b"><stop stop-color="#F026D8" offset="0%"/><stop stop-color="#FF9EF4" offset="100%"/></linearGradient><filter x="-31.7%" y="-31.7%" width="163.3%" height="163.3%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".8" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".4" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.839215686 0 0 0 0 0 0 0 0 0 0.741176471 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(6 8.37)" fill-rule="nonzero"><path d="M3.285 5.04a.567.567 0 0 1-.081-1.129l3.902-.703a.568.568 0 0 1 .166 1.12l-3.902.704a.448.448 0 0 1-.085.007z" fill="#FFC7F8"/><path d="M10.926.137a.569.569 0 0 1 .197.43v8.059a.566.566 0 0 1-.032.187c-.148.82-.946 1.447-1.903 1.447-1.063 0-1.928-.772-1.928-1.72s.865-1.72 1.928-1.72c.285 0 .556.056.8.156v-5.75l.484-1.22a.57.57 0 0 1 .454.131zM9.187 7.955c-.43 0-.792.268-.792.585 0 .317.363.585.793.585.43 0 .792-.268.792-.585 0-.317-.363-.585-.793-.585z" fill="#FFF"/><path d="M3.287 10.278a.568.568 0 0 1-.568-.567V1.652c0-.281.205-.52.483-.561l7.27-1.085a.57.57 0 0 1 .65.561c-.002.165-.035.287-.1.365a.49.49 0 0 1-.27.159l-6.9 1.051v7.57a.564.564 0 0 1-.565.566z" fill="#FFF"/><path d="M1.927 7.905c1.062 0 1.927.772 1.927 1.72s-.865 1.72-1.927 1.72C.864 11.344 0 10.572 0 9.624s.864-1.72 1.927-1.72zm0 1.135c-.43 0-.793.267-.793.585 0 .317.363.585.793.585.43 0 .793-.268.793-.585 0-.318-.364-.585-.793-.585z" fill="#FFF"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#A226F0" offset="0%"/><stop stop-color="#7500BD" offset="100%"/></linearGradient><linearGradient x1="50%" y1="99.348%" x2="50%" y2="0%" id="b"><stop stop-color="#A226F0" offset="0%"/><stop stop-color="#DA9EFF" offset="100%"/></linearGradient><filter x="-31.7%" y="-31.7%" width="163.3%" height="163.3%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".8" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".4" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.458823529 0 0 0 0 0 0 0 0 0 0.741176471 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(6 8)"><path d="M6 10.6h5.3a.7.7 0 0 1 0 1.4H6v-1.4z" fill="#EAC7FF"/><circle stroke="#FFF" stroke-width="1.4" cx="6" cy="6" r="5.3"/><path d="M5.032 7.75c.842 0 2.916-.746 2.916-1.75S5.874 4.25 5.032 4.25c-.843 0-.843 3.5 0 3.5z" stroke="#FFF" stroke-width="1.2" stroke-linejoin="round"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="100%" y1="29.782%" x2="83.621%" y2="29.782%" id="a"><stop stop-color="#3FC87D" offset="0%"/><stop stop-color="#009B46" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b"><stop stop-color="#21E9AA" offset="0%"/><stop stop-color="#00BF77" offset="100%"/></linearGradient><filter x="-20.8%" y="-22.7%" width="141.7%" height="145.5%" filterUnits="objectBoundingBox" id="c"><feOffset dy=".5" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".25" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.0745098039 0 0 0 0 0.662745098 0 0 0 0 0.337254902 0 0 0 1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g fill="none" fill-rule="evenodd"><path d="M0 .452h28v27.097H0z"/><path d="M8.089 8.129h15.555c.86 0 1.556.668 1.556 1.492v14.177c0 .824-.696 1.492-1.556 1.492H8.09c-.86 0-1.556-.668-1.556-1.492V9.621c0-.824.697-1.492 1.556-1.492z" fill="url(#a)" fill-rule="nonzero"/><path d="M20.291 2.71c.84 0 1.521.674 1.521 1.505v19.57c0 .831.681 1.505 1.521 1.505H4.321c-.84 0-1.521-.674-1.521-1.505V4.215c0-.831.681-1.505 1.521-1.505h15.97z" fill="url(#b)" fill-rule="nonzero"/><g filter="url(#c)" transform="translate(6.067 9.032)"><path d="M10.99 8.129H1.143a.677.677 0 1 1 0-1.355h9.845a.677.677 0 0 1 0 1.355z" fill="#A1EDD3"/><path d="M2.567 9.461V.926a.7.7 0 1 1 1.4 0V9.46a.7.7 0 0 1-1.4 0z" fill="#FFF"/></g></g></svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.upload-preview-img {
|
|
2
|
+
margin-right: 8px;
|
|
3
|
+
width: 36px;
|
|
4
|
+
height: 36px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.upload-file-action-wrapper {
|
|
8
|
+
width: 20px;
|
|
9
|
+
height: 20px;
|
|
10
|
+
border: 1px solid #DFE3EA;
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
margin-left: 10px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.upload-file-action-wrapper:hover .action-icon {
|
|
20
|
+
color: #2879ff;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.upload-file-action-wrapper .action-icon {
|
|
24
|
+
font-size: 22px;
|
|
25
|
+
transform: scale(0.5);
|
|
26
|
+
}
|
|
@@ -19,14 +19,16 @@ var _requestV = require("../../utils/request-v1");
|
|
|
19
19
|
|
|
20
20
|
var _popDownNotification = require("../pop-down-notification");
|
|
21
21
|
|
|
22
|
-
var _viewer = require("../viewer");
|
|
23
|
-
|
|
24
22
|
var _uploadedPreview = _interopRequireDefault(require("./components/uploadedPreview"));
|
|
25
23
|
|
|
26
24
|
var _type = require("./type");
|
|
27
25
|
|
|
28
26
|
var _style = require("./style");
|
|
29
27
|
|
|
28
|
+
var _imgViewer = _interopRequireDefault(require("../img-viewer"));
|
|
29
|
+
|
|
30
|
+
var _util = require("./util");
|
|
31
|
+
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
33
|
|
|
32
34
|
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); }
|
|
@@ -71,25 +73,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
71
73
|
|
|
72
74
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
73
75
|
|
|
74
|
-
var RVIewerOptions = {
|
|
75
|
-
className: 'preview-image-container',
|
|
76
|
-
toolbar: {
|
|
77
|
-
zoomIn: 4,
|
|
78
|
-
zoomOut: 4,
|
|
79
|
-
oneToOne: 4,
|
|
80
|
-
reset: 4,
|
|
81
|
-
prev: 4,
|
|
82
|
-
play: {
|
|
83
|
-
show: false
|
|
84
|
-
},
|
|
85
|
-
next: 4,
|
|
86
|
-
rotateLeft: 4,
|
|
87
|
-
rotateRight: 4,
|
|
88
|
-
flipHorizontal: false,
|
|
89
|
-
flipVertical: false
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
76
|
var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
94
77
|
_inherits(Upload, _PureComponent);
|
|
95
78
|
|
|
@@ -119,7 +102,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
119
102
|
};
|
|
120
103
|
|
|
121
104
|
_this.dealSelectFiles = function (uploadSelectFilesObj) {
|
|
122
|
-
var
|
|
105
|
+
var _this$state = _this.state,
|
|
106
|
+
uploadSuccessFiles = _this$state.uploadSuccessFiles,
|
|
107
|
+
selectFiles = _this$state.selectFiles;
|
|
123
108
|
var _this$props = _this.props,
|
|
124
109
|
action = _this$props.action,
|
|
125
110
|
fileNumLimit = _this$props.fileNumLimit,
|
|
@@ -129,7 +114,17 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
129
114
|
|
|
130
115
|
var uploadSuccessFilesLen = uploadSuccessFiles.length; // 已上传成功的文件数量
|
|
131
116
|
|
|
132
|
-
var allFilesTotal = uploadSuccessFilesLen + uploadSelectFilesLen;
|
|
117
|
+
var allFilesTotal = uploadSuccessFilesLen + uploadSelectFilesLen; // 把文件字节流保存,用来文件重传用
|
|
118
|
+
|
|
119
|
+
uploadSelectFilesObj.forEach(function (ele) {
|
|
120
|
+
if (!selectFiles[ele.name]) {
|
|
121
|
+
selectFiles[ele.name] = ele;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
_this.setState({
|
|
126
|
+
selectFiles: selectFiles
|
|
127
|
+
});
|
|
133
128
|
|
|
134
129
|
if (filesTotal && allFilesTotal > filesTotal) {
|
|
135
130
|
_popDownNotification.Toast.Error("\u6700\u591A\u53EF\u4E0A\u4F20 ".concat(filesTotal, " \u4E2A\u6587\u4EF6"), {
|
|
@@ -168,7 +163,6 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
168
163
|
uploadStartFile = {
|
|
169
164
|
FileName: element.name,
|
|
170
165
|
FileType: (0, _type._dealAttachmentType)(uploadFileType).FileType,
|
|
171
|
-
IconColor: (0, _type._dealAttachmentType)(uploadFileType).IconColor,
|
|
172
166
|
FileSize: element.size,
|
|
173
167
|
FileLastModified: element.lastModified,
|
|
174
168
|
IsImage: (0, _type._dealAttachmentType)(uploadFileType).IsImage,
|
|
@@ -189,12 +183,19 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
189
183
|
DownloadUrl: '',
|
|
190
184
|
Msg: '',
|
|
191
185
|
AllowUploadAttachmentSize: 50,
|
|
192
|
-
Deleteable: true
|
|
186
|
+
Deleteable: true,
|
|
187
|
+
requestXHR: new XMLHttpRequest() //在这创建是为了取消用
|
|
188
|
+
|
|
193
189
|
};
|
|
194
190
|
var sameFile = uploadSuccessFiles.find(function (file) {
|
|
195
|
-
return _this.isSameFile(file, uploadStartFile);
|
|
191
|
+
return _this.isSameFile(file, uploadStartFile) && file.uploadStatus !== 4;
|
|
196
192
|
});
|
|
197
|
-
|
|
193
|
+
|
|
194
|
+
if (sameFile) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
;
|
|
198
199
|
uploadStartFiles.push(uploadStartFile);
|
|
199
200
|
|
|
200
201
|
_this._dealUploadStart(uploadStartFiles); // 处理开始上传的文件
|
|
@@ -209,18 +210,17 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
210
|
|
|
210
211
|
_this._dealUploadXHRRequest = function (formData, url, uploadStartFile) {
|
|
211
212
|
if (uploadStartFile.FileSize > _this.props.fileSizeLimit * 1024 * 1024) {
|
|
212
|
-
_popDownNotification.Toast.Error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ".concat(_this.props.fileSizeLimit, "M"));
|
|
213
|
-
|
|
214
213
|
setTimeout(function () {
|
|
215
214
|
_this._dealUploadSuccess(_objectSpread(_objectSpread({}, uploadStartFile), {
|
|
216
|
-
Msg: '
|
|
217
|
-
IsImage: false
|
|
215
|
+
Msg: '上传失败,文件过大',
|
|
216
|
+
IsImage: false,
|
|
217
|
+
uploadStatus: 5
|
|
218
218
|
}));
|
|
219
219
|
}, 300);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
var xhr =
|
|
223
|
+
var xhr = uploadStartFile.requestXHR;
|
|
224
224
|
|
|
225
225
|
xhr.onreadystatechange = function () {
|
|
226
226
|
if (xhr.readyState == 4 && xhr.status == 200) {
|
|
@@ -236,7 +236,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
xhr.upload.onprogress = function (evt) {
|
|
239
|
-
var uploadSuccessFiles =
|
|
239
|
+
var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
240
240
|
|
|
241
241
|
if (evt.lengthComputable) {
|
|
242
242
|
uploadSuccessFiles.forEach(function (item) {
|
|
@@ -253,7 +253,22 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
-
xhr.upload.onerror = function (evt) {
|
|
256
|
+
xhr.upload.onerror = function (evt) {
|
|
257
|
+
var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
258
|
+
|
|
259
|
+
uploadSuccessFiles.forEach(function (item) {
|
|
260
|
+
if (_this.isSameFile(item, uploadStartFile)) {
|
|
261
|
+
item.uploadStatus = 4; // 上传失败
|
|
262
|
+
|
|
263
|
+
item.percentComplete = Math.round(evt.loaded * 100 / evt.total);
|
|
264
|
+
item.Msg = '网络异常,请重新上传';
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
_this.setState({
|
|
269
|
+
uploadSuccessFiles: uploadSuccessFiles
|
|
270
|
+
});
|
|
271
|
+
};
|
|
257
272
|
|
|
258
273
|
xhr.open('POST', url, true);
|
|
259
274
|
xhr.send(formData); //开始上传,发送form数据
|
|
@@ -261,8 +276,19 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
261
276
|
|
|
262
277
|
_this._dealUploadStart = function (uploadStartFiles) {
|
|
263
278
|
var uploadSuccessFiles = [];
|
|
264
|
-
|
|
265
|
-
var
|
|
279
|
+
|
|
280
|
+
var uploadedFiles = _toConsumableArray(_this.state.uploadSuccessFiles); // 处理重传文件,直接展开会导致同样的文件展示两个
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
var uploadFilesConcatArr = uploadedFiles;
|
|
284
|
+
var isReloadFile = uploadFilesConcatArr.filter(function (item) {
|
|
285
|
+
return _this.isSameFile(item, uploadStartFiles[0]);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
if (!isReloadFile || isReloadFile.length === 0) {
|
|
289
|
+
uploadFilesConcatArr = [].concat(_toConsumableArray(uploadedFiles), _toConsumableArray(uploadStartFiles));
|
|
290
|
+
}
|
|
291
|
+
|
|
266
292
|
uploadFilesConcatArr.forEach(function (item) {
|
|
267
293
|
var res = uploadSuccessFiles.filter(function (v) {
|
|
268
294
|
return _this.isSameFile(item, v);
|
|
@@ -285,7 +311,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
285
311
|
|
|
286
312
|
_this._dealUploadSuccess = function (uploadSuccessFile) {
|
|
287
313
|
var onSubmit = _this.props.onSubmit;
|
|
288
|
-
|
|
314
|
+
|
|
315
|
+
var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
316
|
+
|
|
289
317
|
var uploadSuccessFilesFormat = uploadSuccessFiles.map(function (element) {
|
|
290
318
|
return _this.isSameFile(uploadSuccessFile, element) ? uploadSuccessFile : element;
|
|
291
319
|
});
|
|
@@ -297,9 +325,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
297
325
|
|
|
298
326
|
_this.setState({
|
|
299
327
|
uploadSuccessFiles: uploadSuccessFilesFormat,
|
|
300
|
-
attachmentPreviewUrl:
|
|
301
|
-
return item.ClientUrl;
|
|
302
|
-
})
|
|
328
|
+
attachmentPreviewUrl: (0, _util.getPreviewImgs)(uploadSuccessFilesFormat)
|
|
303
329
|
});
|
|
304
330
|
};
|
|
305
331
|
|
|
@@ -308,8 +334,14 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
308
334
|
onSubmit = _this$props2.onSubmit,
|
|
309
335
|
onDelete = _this$props2.onDelete;
|
|
310
336
|
|
|
311
|
-
if (options === '
|
|
312
|
-
var
|
|
337
|
+
if (options === 'cancel') {
|
|
338
|
+
var reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
339
|
+
reUploadFileInfo.requestXHR.abort();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (options === 'delete' || options === 'cancel') {
|
|
343
|
+
var uploadResultFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
344
|
+
|
|
313
345
|
var deleteFiles = uploadResultFiles[index];
|
|
314
346
|
onDelete && onDelete(deleteFiles.documentId ? deleteFiles.documentId : deleteFiles.DfsPath);
|
|
315
347
|
uploadResultFiles.splice(index, 1);
|
|
@@ -324,12 +356,17 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
324
356
|
uploadSuccessFiles: uploadResultFiles
|
|
325
357
|
});
|
|
326
358
|
} else if (options === 'preview') {
|
|
327
|
-
_this.refs.
|
|
359
|
+
_this.refs.imgViewerRef.show(index);
|
|
360
|
+
} else if (options === 'reupload') {
|
|
361
|
+
var _reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
362
|
+
var reUploadFile = _this.state.selectFiles[_reUploadFileInfo.FileName];
|
|
363
|
+
|
|
364
|
+
_this.dealSelectFiles([reUploadFile]);
|
|
328
365
|
}
|
|
329
366
|
};
|
|
330
367
|
|
|
331
368
|
_this.isSameFile = function (item, element) {
|
|
332
|
-
return item.
|
|
369
|
+
return item.FileName === element.FileName && item.FileSize === element.FileSize && item.FileLastModified === element.FileLastModified;
|
|
333
370
|
};
|
|
334
371
|
|
|
335
372
|
_this.renderUploadList = function (list) {
|
|
@@ -339,10 +376,10 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
339
376
|
return /*#__PURE__*/_react["default"].createElement(_Portals["default"], {
|
|
340
377
|
domNode: attachmentPreviewBox,
|
|
341
378
|
className: "uploadFile__preview__list"
|
|
342
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
343
|
-
|
|
344
|
-
ref: "
|
|
345
|
-
|
|
379
|
+
}, /*#__PURE__*/_react["default"].createElement(_imgViewer["default"], {
|
|
380
|
+
data: attachmentPreviewUrl,
|
|
381
|
+
ref: "imgViewerRef",
|
|
382
|
+
showDownload: false
|
|
346
383
|
}), list.map(function (item, index) {
|
|
347
384
|
return /*#__PURE__*/_react["default"].createElement(_uploadedPreview["default"], {
|
|
348
385
|
uploadResultItem: item,
|
|
@@ -367,9 +404,8 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
367
404
|
|
|
368
405
|
_this.state = {
|
|
369
406
|
uploadSuccessFiles: props.attachments || [],
|
|
370
|
-
attachmentPreviewUrl: props.attachments ? props.attachments
|
|
371
|
-
|
|
372
|
-
}) : []
|
|
407
|
+
attachmentPreviewUrl: props.attachments ? (0, _util.getPreviewImgs)(props.attachments) : [],
|
|
408
|
+
selectFiles: {}
|
|
373
409
|
};
|
|
374
410
|
return _this;
|
|
375
411
|
}
|
|
@@ -380,9 +416,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
380
416
|
var attachments = this.props.attachments;
|
|
381
417
|
this.setState({
|
|
382
418
|
uploadSuccessFiles: attachments || [],
|
|
383
|
-
attachmentPreviewUrl: attachments ?
|
|
384
|
-
return item.ClientUrl;
|
|
385
|
-
}) : []
|
|
419
|
+
attachmentPreviewUrl: attachments ? (0, _util.getPreviewImgs)(attachments) : []
|
|
386
420
|
});
|
|
387
421
|
}
|
|
388
422
|
}, {
|
|
@@ -396,9 +430,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
396
430
|
} else {
|
|
397
431
|
this.setState({
|
|
398
432
|
// uploadSuccessFiles: nextProps.attachments || [],
|
|
399
|
-
attachmentPreviewUrl: nextProps.attachments ? nextProps.attachments
|
|
400
|
-
return item.ClientUrl;
|
|
401
|
-
}) : []
|
|
433
|
+
attachmentPreviewUrl: nextProps.attachments ? (0, _util.getPreviewImgs)(nextProps.attachments) : []
|
|
402
434
|
});
|
|
403
435
|
}
|
|
404
436
|
|
|
@@ -21,27 +21,27 @@ var UploadForm = _styledComponents["default"].form(_templateObject2 || (_templat
|
|
|
21
21
|
|
|
22
22
|
exports.UploadForm = UploadForm;
|
|
23
23
|
|
|
24
|
-
var PreviewContent = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width:
|
|
24
|
+
var PreviewContent = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 320px;\n height: 60px;\n padding: 10px;\n box-sizing: border-box;\n font-size: 12px;\n background-color: #f7f8fa;\n display: flex;\n align-items: center;\n"])));
|
|
25
25
|
|
|
26
26
|
exports.PreviewContent = PreviewContent;
|
|
27
27
|
|
|
28
|
-
var PreviewImageWrapper = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width:
|
|
28
|
+
var PreviewImageWrapper = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n line-height: 36px;\n margin-right: 8px;\n text-align: center;\n border-radius: 4px;\n\n img {\n max-width: 36px;\n max-height: 36px;\n border-radius: 4px;\n }\n"])));
|
|
29
29
|
|
|
30
30
|
exports.PreviewImageWrapper = PreviewImageWrapper;
|
|
31
31
|
|
|
32
|
-
var PreviewImageIcon = _styledComponents["default"].
|
|
32
|
+
var PreviewImageIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n"])));
|
|
33
33
|
|
|
34
34
|
exports.PreviewImageIcon = PreviewImageIcon;
|
|
35
35
|
|
|
36
|
-
var PreviewMessageWrapper = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n justify-content: space-between
|
|
36
|
+
var PreviewMessageWrapper = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n /* justify-content: space-between; */\n align-items: center;\n"])));
|
|
37
37
|
|
|
38
38
|
exports.PreviewMessageWrapper = PreviewMessageWrapper;
|
|
39
39
|
|
|
40
|
-
var PreviewFileTitle = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width:
|
|
40
|
+
var PreviewFileTitle = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 184px;\n font-size: 14px;\n line-height: 22px;\n color: #3F4755;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n .upload-file-size {\n font-size: 12px;\n color: #89919F;\n line-height: 18px;\n }\n .upload-file-size--error {\n color: #f05e5e;\n }\n"])));
|
|
41
41
|
|
|
42
42
|
exports.PreviewFileTitle = PreviewFileTitle;
|
|
43
43
|
|
|
44
|
-
var UploadProgress = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 100%;\n height: 4px;\n border-radius:
|
|
44
|
+
var UploadProgress = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-top: 8px;\n width: 100%;\n height: 4px;\n border-radius: 2px;\n background: #E9ECF0;\n\n div {\n height: 100%;\n border-radius: 2px;\n }\n .upload-file--progress {\n background: #2879ff;\n }\n"])));
|
|
45
45
|
|
|
46
46
|
exports.UploadProgress = UploadProgress;
|
|
47
47
|
|
|
@@ -49,6 +49,6 @@ var UploadStatus = _styledComponents["default"].span(_templateObject9 || (_templ
|
|
|
49
49
|
|
|
50
50
|
exports.UploadStatus = UploadStatus;
|
|
51
51
|
|
|
52
|
-
var PreviewOptionsWrapper = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-left: 6px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n span {\n
|
|
52
|
+
var PreviewOptionsWrapper = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-left: 6px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n span {\n font-size: 14px;\n color: #a9b8bf;\n vertical-align: middle;\n cursor: pointer;\n }\n"])));
|
|
53
53
|
|
|
54
54
|
exports.PreviewOptionsWrapper = PreviewOptionsWrapper;
|