@titaui/pc 1.5.78 → 1.5.82
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/index.js +1 -9
- package/lib/components/change-okr/Filter.js +65 -133
- package/lib/components/change-okr/Item.js +0 -6
- package/lib/components/change-okr/filterTab.js +0 -2
- package/lib/components/change-okr/index.js +2 -2
- package/lib/components/checkbox/index.js +3 -4
- package/lib/components/communication/CommunicationRecord.js +161 -116
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.js +28 -53
- package/lib/components/communication/style.js +25 -21
- package/lib/components/dropdown-layer/icon-item.js +3 -5
- package/lib/components/dropdown-layer/index.css +0 -16
- package/lib/components/dropdown-layer/index.js +14 -21
- package/lib/components/emotionsSelector/style.js +1 -1
- package/lib/components/form/form-fields/input/index.css +0 -11
- package/lib/components/form/form-fields/input/index.js +1 -3
- package/lib/components/grid-page/personal-info/index.js +4 -4
- package/lib/components/mblog/components/MblogAction.js +6 -10
- package/lib/components/mblog/index.js +11 -24
- package/lib/components/mblog/style.js +8 -8
- package/lib/components/okr-detail/components/header/index.css +0 -4
- 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 +8 -15
- package/lib/components/okr-flow/child-node/work-node.js +1 -7
- package/lib/components/okr-period-selector/select-cycle.js +151 -139
- package/lib/components/okr-progress-detail/index.css +0 -1
- 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 +4 -149
- package/lib/components/period-selector/components/selector/index.js +38 -103
- package/lib/components/period-selector/components/selector/style.js +9 -23
- package/lib/components/period-selector/index.js +28 -29
- package/lib/components/popup/index.js +1 -3
- package/lib/components/radio/index.css +0 -5
- package/lib/components/radio/radio.js +4 -12
- package/lib/components/table/index.css +1 -0
- package/lib/components/upload/components/uploadedPreview.js +54 -62
- package/lib/components/upload/index.js +57 -89
- package/lib/components/upload/style.js +7 -7
- package/lib/components/upload/type.js +15 -15
- package/lib/components/upvote/index.js +14 -37
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +0 -4
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +24 -50
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +2 -11
- package/lib/components/user-selector/layout/index.css +1 -1
- package/lib/index.js +5 -49
- package/lib/pages/home-page/components/data-list/nav-selector/index.js +0 -18
- package/lib/pages/home-page/components/data-list/table/utils-function.js +3 -6
- package/lib/utils/auth.js +5 -46
- package/lib/utils/bs-global.js +2 -26
- package/lib/utils/tools.js +20 -140
- package/package.json +2 -2
- package/lib/components/avatar/icon-avatar/index.css +0 -15
- package/lib/components/avatar/icon-avatar/index.js +0 -50
- package/lib/components/avatar/num-avatar/index.css +0 -12
- package/lib/components/avatar/num-avatar/index.js +0 -34
- package/lib/components/button/admin-button/default.js +0 -35
- package/lib/components/button/admin-button/drop-down-arrow.js +0 -93
- package/lib/components/button/admin-button/index.css +0 -86
- package/lib/components/button/admin-button/index.js +0 -40
- package/lib/components/button/admin-button/primary.js +0 -33
- package/lib/components/button/admin-button/secondary.js +0 -35
- package/lib/components/button/default-button/index.css +0 -49
- package/lib/components/button/default-button/index.js +0 -51
- package/lib/components/button/export-button/index.css +0 -51
- package/lib/components/button/export-button/index.js +0 -81
- package/lib/components/button/images/daoru.svg +0 -18
- package/lib/components/button/index.js +0 -23
- package/lib/components/button/interface.js +0 -5
- package/lib/components/communication/index.css +0 -63
- package/lib/components/create-okr/animation/check-animation.js +0 -2746
- package/lib/components/create-okr/constant.js +0 -27
- package/lib/components/create-okr/createCycle.js +0 -171
- package/lib/components/create-okr/createSuccessCmp.js +0 -233
- package/lib/components/create-okr/createSuccessCmpWrapper.js +0 -20
- package/lib/components/create-okr/fields/date-cycle.js +0 -98
- package/lib/components/create-okr/fields/index.css +0 -346
- package/lib/components/create-okr/fields/index.js +0 -17
- package/lib/components/create-okr/fields/input-with-err-popup.js +0 -57
- package/lib/components/create-okr/fields/o-new-name.js +0 -197
- package/lib/components/create-okr/fields/okr-case.js +0 -98
- package/lib/components/create-okr/fields/okr-classify.js +0 -51
- package/lib/components/create-okr/fields/okr-create-suggest.js +0 -147
- package/lib/components/create-okr/fields/okr-new-user-selector.js +0 -106
- package/lib/components/create-okr/fields/okr-parent.js +0 -157
- package/lib/components/create-okr/fields/okr-type-detail.js +0 -196
- package/lib/components/create-okr/fields/okr-type.js +0 -131
- package/lib/components/create-okr/fields/okr-visibility-detail.js +0 -224
- package/lib/components/create-okr/fields/okr-visibility.js +0 -169
- package/lib/components/create-okr/img/check-normal.svg +0 -29
- package/lib/components/create-okr/img/check-right.svg +0 -16
- package/lib/components/create-okr/img/check-wrong.svg +0 -29
- package/lib/components/create-okr/img/create-success-head.png +0 -0
- package/lib/components/create-okr/img/create-success-left-quotation.svg +0 -14
- package/lib/components/create-okr/img/create-success-message.svg +0 -1
- package/lib/components/create-okr/img/create-success-right-quotation.svg +0 -14
- package/lib/components/create-okr/img/create-success-shadow.svg +0 -23
- package/lib/components/create-okr/img/example.svg +0 -11
- package/lib/components/create-okr/img/hand.svg +0 -12
- package/lib/components/create-okr/img/kr-add.svg +0 -12
- package/lib/components/create-okr/img/left-quotation.svg +0 -12
- package/lib/components/create-okr/img/light.svg +0 -1
- package/lib/components/create-okr/img/pack-up.js +0 -28
- package/lib/components/create-okr/img/qr-code.png +0 -0
- package/lib/components/create-okr/img/right-quotation.svg +0 -12
- package/lib/components/create-okr/img/shower.png +0 -0
- package/lib/components/create-okr/img/target.svg +0 -19
- package/lib/components/create-okr/img/teach-okr.svg +0 -17
- package/lib/components/create-okr/img/wave.png +0 -0
- package/lib/components/create-okr/img/weight.svg +0 -12
- package/lib/components/create-okr/index.css +0 -446
- package/lib/components/create-okr/index.js +0 -911
- package/lib/components/create-okr/interface.js +0 -5
- package/lib/components/create-okr/kr-items/index.css +0 -180
- package/lib/components/create-okr/kr-items/kr-item-weight.js +0 -194
- package/lib/components/create-okr/kr-items/krDatas.js +0 -299
- package/lib/components/create-okr/kr-items/krItem.js +0 -167
- package/lib/components/create-okr/objectType.js +0 -273
- package/lib/components/create-okr/request-api.js +0 -220
- package/lib/components/create-okr/style.js +0 -100
- package/lib/components/create-okr/utils/getCreateOkrSurpassPercent.js +0 -124
- package/lib/components/create-okr/utils/helper.js +0 -99
- package/lib/components/create-okr/utils/index.js +0 -23
- package/lib/components/dynamic/components/condition-render/index.js +0 -20
- package/lib/components/dynamic/components/dangerous-html/index.js +0 -22
- package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -78
- package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -192
- package/lib/components/dynamic/components/obj-status/index.css +0 -22
- package/lib/components/dynamic/components/obj-status/index.js +0 -38
- package/lib/components/dynamic/components/percent/index.css +0 -21
- package/lib/components/dynamic/components/percent/index.js +0 -38
- package/lib/components/dynamic/components/title/index.css +0 -35
- package/lib/components/dynamic/components/title/index.js +0 -59
- package/lib/components/dynamic/constant.js +0 -96
- package/lib/components/dynamic/context/index.js +0 -13
- package/lib/components/dynamic/dynamic-item/components/header/index.css +0 -101
- package/lib/components/dynamic/dynamic-item/components/header/index.js +0 -294
- package/lib/components/dynamic/dynamic-item/components/icon/index.css +0 -10
- package/lib/components/dynamic/dynamic-item/components/icon/index.js +0 -35
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +0 -173
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +0 -54
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +0 -107
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +0 -48
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +0 -89
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +0 -96
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +0 -171
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +0 -67
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +0 -110
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +0 -16
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +0 -111
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +0 -158
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +0 -215
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +0 -16
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +0 -91
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +0 -125
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +0 -95
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +0 -192
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +0 -138
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +0 -183
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +0 -153
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +0 -138
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +0 -97
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +0 -207
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +0 -54
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +0 -107
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +0 -50
- 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 +0 -111
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +0 -164
- package/lib/components/dynamic/dynamic-item/index.css +0 -128
- package/lib/components/dynamic/dynamic-item/index.js +0 -352
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
- 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 +0 -126
- package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -157
- package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -107
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
- package/lib/components/dynamic/dynamic-liking/index.css +0 -81
- package/lib/components/dynamic/dynamic-liking/index.js +0 -76
- package/lib/components/dynamic/dynamic-liking/item.js +0 -90
- package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
- package/lib/components/dynamic/dynamic-list/index.css +0 -36
- package/lib/components/dynamic/dynamic-list/index.js +0 -61
- package/lib/components/dynamic/dynamic-topping/image/quotationMark.svg +0 -16
- package/lib/components/dynamic/dynamic-topping/image/topIcon.svg +0 -30
- package/lib/components/dynamic/dynamic-topping/index.css +0 -130
- package/lib/components/dynamic/dynamic-topping/index.js +0 -78
- package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
- package/lib/components/dynamic/dynamic-topping/item.js +0 -138
- package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/lib/components/dynamic/dynamic.css +0 -204
- package/lib/components/dynamic/dynamic.js +0 -391
- package/lib/components/dynamic/export-module/index.js +0 -33
- package/lib/components/dynamic/img/dynamic-P1.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P2.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P3.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P4.svg +0 -15
- package/lib/components/dynamic/img/dynamic-P5.svg +0 -15
- package/lib/components/dynamic/img/dynamic-delay.svg +0 -17
- package/lib/components/dynamic/img/dynamic-desire.svg +0 -61
- package/lib/components/dynamic/img/dynamic-empty.png +0 -0
- package/lib/components/dynamic/img/dynamic-end.svg +0 -17
- package/lib/components/dynamic/img/dynamic-left-quoto.svg +0 -13
- package/lib/components/dynamic/img/dynamic-loading.gif +0 -0
- package/lib/components/dynamic/img/dynamic-normal.svg +0 -17
- package/lib/components/dynamic/img/dynamic-promise.svg +0 -61
- package/lib/components/dynamic/img/dynamic-reword.svg +0 -24
- package/lib/components/dynamic/img/dynamic-right-quoto.svg +0 -13
- package/lib/components/dynamic/img/dynamic-risk.svg +0 -17
- package/lib/components/dynamic/img/dynamic-submit-delay.svg +0 -16
- package/lib/components/dynamic/img/dynamic-submit-normal.svg +0 -18
- package/lib/components/dynamic/img/dynamic-top.svg +0 -14
- package/lib/components/dynamic/index.js +0 -27
- package/lib/components/dynamic/interface.js +0 -5
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -37
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -42
- 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 +0 -51
- package/lib/components/dynamic/quick-operation/index.js +0 -112
- package/lib/components/dynamic/request-api.js +0 -92
- package/lib/components/dynamic/util.js +0 -140
- package/lib/components/file-list/components/single-file/index.css +0 -84
- package/lib/components/file-list/components/single-file/index.js +0 -115
- package/lib/components/file-list/img/new-file-list-doc.svg +0 -1
- package/lib/components/file-list/img/new-file-list-other.svg +0 -1
- package/lib/components/file-list/img/new-file-list-pdf.svg +0 -1
- package/lib/components/file-list/img/new-file-list-ppt.svg +0 -1
- package/lib/components/file-list/img/new-file-list-radio.svg +0 -1
- package/lib/components/file-list/img/new-file-list-video.svg +0 -1
- package/lib/components/file-list/img/new-file-list-xls.svg +0 -1
- package/lib/components/file-list/index.css +0 -5
- package/lib/components/file-list/index.js +0 -61
- package/lib/components/file-list/interface.js +0 -5
- package/lib/components/file-list/util.js +0 -78
- package/lib/components/img-viewer/icon/enlarge.js +0 -30
- package/lib/components/img-viewer/icon/left-rotate.js +0 -46
- package/lib/components/img-viewer/icon/right-rotate.js +0 -44
- package/lib/components/img-viewer/icon/shrink.js +0 -37
- package/lib/components/img-viewer/image/loading.gif +0 -0
- package/lib/components/img-viewer/index.css +0 -155
- package/lib/components/img-viewer/index.js +0 -228
- package/lib/components/img-viewer/interface.js +0 -5
- package/lib/components/img-viewer/util.js +0 -16
- package/lib/components/publish-dynamic-modal/index.js +0 -13
- package/lib/components/publish-dynamic-modal/interface.js +0 -5
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +0 -3
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +0 -191
- package/lib/components/publish-dynamic-modal/requist-api.js +0 -48
- package/lib/components/search-key-handle/index.js +0 -39
- package/lib/components/upload/img/doc.svg +0 -1
- package/lib/components/upload/img/other.svg +0 -1
- package/lib/components/upload/img/pdf.svg +0 -1
- package/lib/components/upload/img/ppt.svg +0 -1
- package/lib/components/upload/img/radio.svg +0 -1
- package/lib/components/upload/img/video.svg +0 -1
- package/lib/components/upload/img/xls.svg +0 -1
- package/lib/components/upload/index.css +0 -26
- package/lib/components/upload/util.js +0 -102
- package/lib/components-v1/buttonv2/ButtonLinked.js +0 -35
- package/lib/components-v1/buttonv2/ButtonOutlined.js +0 -64
- package/lib/components-v1/buttonv2/ButtonRounded.js +0 -101
- package/lib/components-v1/buttonv2/DefaultButton.js +0 -86
- package/lib/components-v1/buttonv2/index.js +0 -37
- package/lib/components-v1/buttonv2/style/style.js +0 -53
- package/lib/components-v1/buttonv2/style/theme.css +0 -3
- package/lib/components-v1/confirm/index.js +0 -158
- package/lib/pages/dynamic/index.css +0 -5
- package/lib/pages/dynamic/index.js +0 -25
- package/lib/pages/like-ranking/column.js +0 -141
- package/lib/pages/like-ranking/filter-buttons/department.js +0 -44
- package/lib/pages/like-ranking/filter-buttons/group.js +0 -34
- package/lib/pages/like-ranking/filter-buttons/index.css +0 -19
- package/lib/pages/like-ranking/filter-buttons/index.js +0 -44
- package/lib/pages/like-ranking/filter-buttons/modular.js +0 -110
- package/lib/pages/like-ranking/filter-buttons/name.js +0 -73
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.css +0 -27
- package/lib/pages/like-ranking/filter-buttons/search-dropdown/index.js +0 -38
- package/lib/pages/like-ranking/filter-buttons/timer.js +0 -56
- 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 +0 -185
- package/lib/pages/like-ranking/index.js +0 -252
- package/lib/pages/like-ranking/mock.js +0 -366
- package/lib/pages/like-ranking/request-api.js +0 -15
- package/lib/utils/format-time.js +0 -161
- package/lib/utils/helpers.js +0 -41
- package/lib/utils/roundWeight.js +0 -105
- package/yarn-error.log +0 -15894
|
@@ -11,11 +11,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _titaUi = require("tita-ui");
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
require("../index.css");
|
|
14
|
+
var _type = require("../type");
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var _style = require("../style");
|
|
19
17
|
|
|
20
18
|
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); }
|
|
21
19
|
|
|
@@ -57,14 +55,16 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
57
55
|
var uploadResultItem = _this.props.uploadResultItem; // 上传中或不是图片文件时用默认icon
|
|
58
56
|
|
|
59
57
|
if (uploadResultItem.uploadStatus === 2 || !uploadResultItem.IsImage) {
|
|
60
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_style.PreviewImageIcon, {
|
|
59
|
+
className: "tu-icon-".concat((0, _type._dealAttachmentType)(uploadResultItem.FileType).FileType),
|
|
60
|
+
style: {
|
|
61
|
+
color: (0, _type._dealAttachmentType)(uploadResultItem.FileType).IconColor
|
|
62
|
+
}
|
|
63
63
|
});
|
|
64
64
|
} else {
|
|
65
65
|
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
66
66
|
src: uploadResultItem.ClientUrl,
|
|
67
|
-
|
|
67
|
+
alt: ""
|
|
68
68
|
}); // 上传成功且为图片时
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -72,19 +72,17 @@ 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) {
|
|
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: "
|
|
82
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
83
|
-
className: "tu-icon-canceled action-icon action-icon-delete",
|
|
81
|
+
className: "tu-icon-cross action-icon action-icon-delete",
|
|
84
82
|
onMouseDown: function onMouseDown() {
|
|
85
83
|
return onSubmit(index, 'cancel');
|
|
86
84
|
}
|
|
87
|
-
}))
|
|
85
|
+
}));
|
|
88
86
|
} else if (uploadStatus === 3) {
|
|
89
87
|
// 上传成功
|
|
90
88
|
if (smallImageUrl && deleteable) {
|
|
@@ -93,95 +91,84 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
93
91
|
content: "\u9884\u89C8",
|
|
94
92
|
container: document.body
|
|
95
93
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
96
|
-
className: "
|
|
97
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
98
|
-
className: "tu-icon-yulan action-icon",
|
|
94
|
+
className: "tu-icon-magnifier-circle action-icon",
|
|
99
95
|
onMouseDown: function onMouseDown() {
|
|
100
96
|
return onSubmit(index, 'preview');
|
|
101
97
|
}
|
|
102
|
-
}))
|
|
98
|
+
})), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
103
99
|
content: "\u5220\u9664",
|
|
104
100
|
container: document.body
|
|
105
101
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
|
-
className: "
|
|
107
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
108
|
-
className: "tu-icon-canceled action-icon delete",
|
|
102
|
+
className: "tu-icon-cross action-icon action-icon-delete delete",
|
|
109
103
|
onMouseDown: function onMouseDown() {
|
|
110
104
|
return onSubmit(index, 'delete');
|
|
111
105
|
}
|
|
112
|
-
}))
|
|
106
|
+
}))];
|
|
113
107
|
} else if (!smallImageUrl && deleteable) {
|
|
114
108
|
// 不是图片但能删除
|
|
115
109
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
116
110
|
content: "\u5220\u9664",
|
|
117
111
|
container: document.body
|
|
118
112
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
119
|
-
className: "
|
|
120
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
121
|
-
className: "tu-icon-canceled action-icon delete",
|
|
113
|
+
className: "tu-icon-cross action-icon action-icon-delete delete",
|
|
122
114
|
onMouseDown: function onMouseDown() {
|
|
123
115
|
return onSubmit(index, 'delete');
|
|
124
116
|
}
|
|
125
|
-
}))
|
|
117
|
+
}));
|
|
126
118
|
} else if (smallImageUrl && !deleteable) {
|
|
127
119
|
// 是图片不能删除
|
|
128
120
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
129
121
|
content: "\u9884\u89C8",
|
|
130
122
|
container: document.body
|
|
131
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
132
|
-
className: "upload-file-action-wrapper"
|
|
133
123
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
134
124
|
className: "tu-icon-magnifier-circle action-icon",
|
|
135
125
|
onMouseDown: function onMouseDown() {
|
|
136
126
|
return onSubmit(index, 'preview');
|
|
137
127
|
}
|
|
138
|
-
}))
|
|
128
|
+
}));
|
|
139
129
|
} else {
|
|
140
130
|
// 不是图片也不能删除
|
|
141
131
|
return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
142
132
|
}
|
|
143
|
-
} else if (uploadStatus === 5) {
|
|
144
|
-
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
145
|
-
content: "\u5220\u9664",
|
|
146
|
-
container: document.body
|
|
147
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
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
133
|
} else {
|
|
156
134
|
// 4:上传失败
|
|
157
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
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",
|
|
164
|
-
onMouseDown: function onMouseDown() {
|
|
165
|
-
return onSubmit(index, 'reupload');
|
|
166
|
-
}
|
|
167
|
-
}))), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
135
|
+
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
168
136
|
content: "\u5220\u9664",
|
|
169
137
|
container: document.body
|
|
170
138
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
171
|
-
className: "
|
|
172
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
173
|
-
className: "tu-icon-canceled action-icon delete",
|
|
139
|
+
className: "tu-icon-cross action-icon",
|
|
174
140
|
onMouseDown: function onMouseDown() {
|
|
175
|
-
return onSubmit(index, '
|
|
141
|
+
return onSubmit(index, 'reupload');
|
|
176
142
|
}
|
|
177
|
-
}))
|
|
143
|
+
}));
|
|
178
144
|
}
|
|
179
145
|
};
|
|
180
146
|
|
|
147
|
+
_this.state = {
|
|
148
|
+
isDismiss: false
|
|
149
|
+
};
|
|
181
150
|
return _this;
|
|
182
151
|
}
|
|
183
152
|
|
|
184
153
|
_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
|
+
}, {
|
|
185
172
|
key: "componentWillUnmount",
|
|
186
173
|
value: function componentWillUnmount() {
|
|
187
174
|
clearTimeout(this.updateStatusTimer);
|
|
@@ -194,6 +181,7 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
194
181
|
className = _this$props.className,
|
|
195
182
|
uploadResultItem = _this$props.uploadResultItem,
|
|
196
183
|
index = _this$props.index;
|
|
184
|
+
var isDismiss = this.state.isDismiss;
|
|
197
185
|
return /*#__PURE__*/_react["default"].createElement(_style.PreviewContent, {
|
|
198
186
|
className: ['preview__content', className].join(' ')
|
|
199
187
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewImageWrapper, null, this.renderPreviewThumbnail()), /*#__PURE__*/_react["default"].createElement(_style.PreviewMessageWrapper, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
@@ -202,14 +190,18 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
202
190
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewFileTitle, {
|
|
203
191
|
"data-tip": uploadResultItem.FileName,
|
|
204
192
|
key: uploadResultItem.uid
|
|
205
|
-
}, uploadResultItem.FileName,
|
|
193
|
+
}, uploadResultItem.FileName, uploadResultItem.uploadStatus === 2 ? /*#__PURE__*/_react["default"].createElement(_style.UploadProgress, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
206
194
|
style: {
|
|
207
195
|
width: uploadResultItem.percentComplete + '%'
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
className: uploadResultItem.
|
|
212
|
-
|
|
196
|
+
}
|
|
197
|
+
})) : /*#__PURE__*/_react["default"].createElement("div", null))), /*#__PURE__*/_react["default"].createElement(_style.UploadStatus, {
|
|
198
|
+
ref: "previewStatusText",
|
|
199
|
+
className: uploadResultItem.percentComplete === 100 ? 'preview__status-end' : '',
|
|
200
|
+
style: {
|
|
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), " "));
|
|
213
205
|
}
|
|
214
206
|
}]);
|
|
215
207
|
|
|
@@ -19,16 +19,14 @@ var _requestV = require("../../utils/request-v1");
|
|
|
19
19
|
|
|
20
20
|
var _popDownNotification = require("../pop-down-notification");
|
|
21
21
|
|
|
22
|
+
var _viewer = require("../viewer");
|
|
23
|
+
|
|
22
24
|
var _uploadedPreview = _interopRequireDefault(require("./components/uploadedPreview"));
|
|
23
25
|
|
|
24
26
|
var _type = require("./type");
|
|
25
27
|
|
|
26
28
|
var _style = require("./style");
|
|
27
29
|
|
|
28
|
-
var _imgViewer = _interopRequireDefault(require("../img-viewer"));
|
|
29
|
-
|
|
30
|
-
var _util = require("./util");
|
|
31
|
-
|
|
32
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
31
|
|
|
34
32
|
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); }
|
|
@@ -73,6 +71,25 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
73
71
|
|
|
74
72
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
73
|
|
|
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
|
+
|
|
76
93
|
var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
77
94
|
_inherits(Upload, _PureComponent);
|
|
78
95
|
|
|
@@ -102,9 +119,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
119
|
};
|
|
103
120
|
|
|
104
121
|
_this.dealSelectFiles = function (uploadSelectFilesObj) {
|
|
105
|
-
var
|
|
106
|
-
uploadSuccessFiles = _this$state.uploadSuccessFiles,
|
|
107
|
-
selectFiles = _this$state.selectFiles;
|
|
122
|
+
var uploadSuccessFiles = _this.state.uploadSuccessFiles;
|
|
108
123
|
var _this$props = _this.props,
|
|
109
124
|
action = _this$props.action,
|
|
110
125
|
fileNumLimit = _this$props.fileNumLimit,
|
|
@@ -114,17 +129,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
114
129
|
|
|
115
130
|
var uploadSuccessFilesLen = uploadSuccessFiles.length; // 已上传成功的文件数量
|
|
116
131
|
|
|
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
|
-
});
|
|
132
|
+
var allFilesTotal = uploadSuccessFilesLen + uploadSelectFilesLen;
|
|
128
133
|
|
|
129
134
|
if (filesTotal && allFilesTotal > filesTotal) {
|
|
130
135
|
_popDownNotification.Toast.Error("\u6700\u591A\u53EF\u4E0A\u4F20 ".concat(filesTotal, " \u4E2A\u6587\u4EF6"), {
|
|
@@ -163,6 +168,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
163
168
|
uploadStartFile = {
|
|
164
169
|
FileName: element.name,
|
|
165
170
|
FileType: (0, _type._dealAttachmentType)(uploadFileType).FileType,
|
|
171
|
+
IconColor: (0, _type._dealAttachmentType)(uploadFileType).IconColor,
|
|
166
172
|
FileSize: element.size,
|
|
167
173
|
FileLastModified: element.lastModified,
|
|
168
174
|
IsImage: (0, _type._dealAttachmentType)(uploadFileType).IsImage,
|
|
@@ -183,19 +189,12 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
183
189
|
DownloadUrl: '',
|
|
184
190
|
Msg: '',
|
|
185
191
|
AllowUploadAttachmentSize: 50,
|
|
186
|
-
Deleteable: true
|
|
187
|
-
requestXHR: new XMLHttpRequest() //在这创建是为了取消用
|
|
188
|
-
|
|
192
|
+
Deleteable: true
|
|
189
193
|
};
|
|
190
194
|
var sameFile = uploadSuccessFiles.find(function (file) {
|
|
191
|
-
return _this.isSameFile(file, uploadStartFile)
|
|
195
|
+
return _this.isSameFile(file, uploadStartFile);
|
|
192
196
|
});
|
|
193
|
-
|
|
194
|
-
if (sameFile) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
;
|
|
197
|
+
if (sameFile) return;
|
|
199
198
|
uploadStartFiles.push(uploadStartFile);
|
|
200
199
|
|
|
201
200
|
_this._dealUploadStart(uploadStartFiles); // 处理开始上传的文件
|
|
@@ -210,17 +209,18 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
210
209
|
|
|
211
210
|
_this._dealUploadXHRRequest = function (formData, url, uploadStartFile) {
|
|
212
211
|
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
|
+
|
|
213
214
|
setTimeout(function () {
|
|
214
215
|
_this._dealUploadSuccess(_objectSpread(_objectSpread({}, uploadStartFile), {
|
|
215
|
-
Msg: '
|
|
216
|
-
IsImage: false
|
|
217
|
-
uploadStatus: 5
|
|
216
|
+
Msg: '文件过大!',
|
|
217
|
+
IsImage: false
|
|
218
218
|
}));
|
|
219
219
|
}, 300);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
var xhr =
|
|
223
|
+
var xhr = new XMLHttpRequest(); //创建xhr
|
|
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 = JSON.parse(JSON.stringify(_this.state.uploadSuccessFiles));
|
|
240
240
|
|
|
241
241
|
if (evt.lengthComputable) {
|
|
242
242
|
uploadSuccessFiles.forEach(function (item) {
|
|
@@ -253,22 +253,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
255
|
|
|
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
|
-
};
|
|
256
|
+
xhr.upload.onerror = function (evt) {};
|
|
272
257
|
|
|
273
258
|
xhr.open('POST', url, true);
|
|
274
259
|
xhr.send(formData); //开始上传,发送form数据
|
|
@@ -276,19 +261,8 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
276
261
|
|
|
277
262
|
_this._dealUploadStart = function (uploadStartFiles) {
|
|
278
263
|
var uploadSuccessFiles = [];
|
|
279
|
-
|
|
280
|
-
var
|
|
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
|
-
|
|
264
|
+
var uploadedFiles = JSON.parse(JSON.stringify(_this.state.uploadSuccessFiles));
|
|
265
|
+
var uploadFilesConcatArr = [].concat(_toConsumableArray(uploadedFiles), _toConsumableArray(uploadStartFiles));
|
|
292
266
|
uploadFilesConcatArr.forEach(function (item) {
|
|
293
267
|
var res = uploadSuccessFiles.filter(function (v) {
|
|
294
268
|
return _this.isSameFile(item, v);
|
|
@@ -311,9 +285,7 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
311
285
|
|
|
312
286
|
_this._dealUploadSuccess = function (uploadSuccessFile) {
|
|
313
287
|
var onSubmit = _this.props.onSubmit;
|
|
314
|
-
|
|
315
|
-
var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
316
|
-
|
|
288
|
+
var uploadSuccessFiles = JSON.parse(JSON.stringify(_this.state.uploadSuccessFiles));
|
|
317
289
|
var uploadSuccessFilesFormat = uploadSuccessFiles.map(function (element) {
|
|
318
290
|
return _this.isSameFile(uploadSuccessFile, element) ? uploadSuccessFile : element;
|
|
319
291
|
});
|
|
@@ -325,7 +297,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
325
297
|
|
|
326
298
|
_this.setState({
|
|
327
299
|
uploadSuccessFiles: uploadSuccessFilesFormat,
|
|
328
|
-
attachmentPreviewUrl: (
|
|
300
|
+
attachmentPreviewUrl: uploadSuccessFilesFormat.map(function (item) {
|
|
301
|
+
return item.ClientUrl;
|
|
302
|
+
})
|
|
329
303
|
});
|
|
330
304
|
};
|
|
331
305
|
|
|
@@ -334,14 +308,8 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
334
308
|
onSubmit = _this$props2.onSubmit,
|
|
335
309
|
onDelete = _this$props2.onDelete;
|
|
336
310
|
|
|
337
|
-
if (options === 'cancel') {
|
|
338
|
-
var
|
|
339
|
-
reUploadFileInfo.requestXHR.abort();
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (options === 'delete' || options === 'cancel') {
|
|
343
|
-
var uploadResultFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
344
|
-
|
|
311
|
+
if (options === 'delete' || options === 'cancel' || options === 'reupload') {
|
|
312
|
+
var uploadResultFiles = JSON.parse(JSON.stringify(_this.state.uploadSuccessFiles));
|
|
345
313
|
var deleteFiles = uploadResultFiles[index];
|
|
346
314
|
onDelete && onDelete(deleteFiles.documentId ? deleteFiles.documentId : deleteFiles.DfsPath);
|
|
347
315
|
uploadResultFiles.splice(index, 1);
|
|
@@ -356,17 +324,12 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
356
324
|
uploadSuccessFiles: uploadResultFiles
|
|
357
325
|
});
|
|
358
326
|
} else if (options === 'preview') {
|
|
359
|
-
_this.refs.
|
|
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]);
|
|
327
|
+
_this.refs.RViewers.show(index);
|
|
365
328
|
}
|
|
366
329
|
};
|
|
367
330
|
|
|
368
331
|
_this.isSameFile = function (item, element) {
|
|
369
|
-
return item.
|
|
332
|
+
return item.documentId && element.documentId ? item.documentId == element.documentId : item.uid == element.uid;
|
|
370
333
|
};
|
|
371
334
|
|
|
372
335
|
_this.renderUploadList = function (list) {
|
|
@@ -376,10 +339,10 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
376
339
|
return /*#__PURE__*/_react["default"].createElement(_Portals["default"], {
|
|
377
340
|
domNode: attachmentPreviewBox,
|
|
378
341
|
className: "uploadFile__preview__list"
|
|
379
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
380
|
-
|
|
381
|
-
ref: "
|
|
382
|
-
|
|
342
|
+
}, /*#__PURE__*/_react["default"].createElement(_viewer.RViewer, {
|
|
343
|
+
imageUrls: attachmentPreviewUrl,
|
|
344
|
+
ref: "RViewers",
|
|
345
|
+
options: RVIewerOptions
|
|
383
346
|
}), list.map(function (item, index) {
|
|
384
347
|
return /*#__PURE__*/_react["default"].createElement(_uploadedPreview["default"], {
|
|
385
348
|
uploadResultItem: item,
|
|
@@ -404,8 +367,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
404
367
|
|
|
405
368
|
_this.state = {
|
|
406
369
|
uploadSuccessFiles: props.attachments || [],
|
|
407
|
-
attachmentPreviewUrl: props.attachments ? (
|
|
408
|
-
|
|
370
|
+
attachmentPreviewUrl: props.attachments ? props.attachments.map(function (item) {
|
|
371
|
+
return item.ClientUrl;
|
|
372
|
+
}) : []
|
|
409
373
|
};
|
|
410
374
|
return _this;
|
|
411
375
|
}
|
|
@@ -416,7 +380,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
416
380
|
var attachments = this.props.attachments;
|
|
417
381
|
this.setState({
|
|
418
382
|
uploadSuccessFiles: attachments || [],
|
|
419
|
-
attachmentPreviewUrl: attachments ? (
|
|
383
|
+
attachmentPreviewUrl: attachments ? attachments.map(function (item) {
|
|
384
|
+
return item.ClientUrl;
|
|
385
|
+
}) : []
|
|
420
386
|
});
|
|
421
387
|
}
|
|
422
388
|
}, {
|
|
@@ -430,7 +396,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
430
396
|
} else {
|
|
431
397
|
this.setState({
|
|
432
398
|
// uploadSuccessFiles: nextProps.attachments || [],
|
|
433
|
-
attachmentPreviewUrl: nextProps.attachments ? (
|
|
399
|
+
attachmentPreviewUrl: nextProps.attachments ? nextProps.attachments.map(function (item) {
|
|
400
|
+
return item.ClientUrl;
|
|
401
|
+
}) : []
|
|
434
402
|
});
|
|
435
403
|
}
|
|
436
404
|
|
|
@@ -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: 310px;\n height: 30px;\n padding: 5px;\n font-size: 12px;\n background-color: #f5f8fa;\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: 30px;\n height: 30px;\n line-height: 30px;\n margin-right: 10px;\n background-color: #e4ebf0;\n text-align: center;\n\n img {\n max-width: 30px;\n max-height: 30px;\n background-color: #fff;\n }\n"])));
|
|
29
29
|
|
|
30
30
|
exports.PreviewImageWrapper = PreviewImageWrapper;
|
|
31
31
|
|
|
32
|
-
var PreviewImageIcon = _styledComponents["default"].
|
|
32
|
+
var PreviewImageIcon = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 30px;\n height: 30px;\n line-height: 30px;\n font-size: 30px;\n display: inline-block;\n text-align: center;\n background-color: #ffffff;\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
|
|
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: 160px;\n color: #647481;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
41
41
|
|
|
42
42
|
exports.PreviewFileTitle = PreviewFileTitle;
|
|
43
43
|
|
|
44
|
-
var UploadProgress = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n
|
|
44
|
+
var UploadProgress = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 100%;\n height: 4px;\n border-radius: 4px;\n background: #E4ECF2;\n\n div {\n height: 100%;\n border-radius: 4px;\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 font-size: 14px;\n color: #a9b8bf;\n vertical-align: middle;\n cursor: pointer;\n }\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 margin-left: 4px;\n font-size: 14px;\n color: #a9b8bf;\n vertical-align: middle;\n cursor: pointer;\n\n &.tu-icon-magnifier-circle:hover {\n color: #2879ff;\n }\n\n &.action-icon-delete:hover {\n color: #f05e5e;\n }\n }\n"])));
|
|
53
53
|
|
|
54
54
|
exports.PreviewOptionsWrapper = PreviewOptionsWrapper;
|
|
@@ -7,27 +7,27 @@ exports._dealAttachmentType = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _dealAttachmentType = function _dealAttachmentType(fileType) {
|
|
9
9
|
var IsImage = false;
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
// IconColor = '#44CF85';
|
|
13
|
-
// } else if (/^(exe|pdf|txt|doc|docx|ppt|pptx|xls|xlsx)$/.test(fileType)) {
|
|
14
|
-
// IconColor = '#49B9DD';
|
|
15
|
-
// } else if (/^(rar|zip)$/.test(fileType)) {
|
|
16
|
-
// IconColor = '#FFBA46';
|
|
17
|
-
// } else if (/^(mp3|wma|wav|flac|ape|ogg|aac|m4a)$/.test(fileType)) {
|
|
18
|
-
// IconColor = '#8479D6';
|
|
19
|
-
// } else if (/^(mp4|mkv|rm|rmvb|avi|3gp|flv|wmv|asf|mpeg|mpg|mov|ts|m4v)$/.test(fileType)) {
|
|
20
|
-
// IconColor = '#3EBBA8';
|
|
21
|
-
// } else {
|
|
22
|
-
// FileType = 'none'
|
|
23
|
-
// }
|
|
10
|
+
var IconColor = '#FF730C';
|
|
11
|
+
var FileType = fileType;
|
|
24
12
|
|
|
25
|
-
if (/^(jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
13
|
+
if (/^(jpg|png|gif|jpeg|image|JPG|PNG|GIF|JPEG)$/.test(fileType)) {
|
|
26
14
|
IsImage = true;
|
|
15
|
+
IconColor = '#44CF85';
|
|
16
|
+
} else if (/^(exe|pdf|txt|doc|docx|ppt|pptx|xls|xlsx)$/.test(fileType)) {
|
|
17
|
+
IconColor = '#49B9DD';
|
|
18
|
+
} else if (/^(rar|zip)$/.test(fileType)) {
|
|
19
|
+
IconColor = '#FFBA46';
|
|
20
|
+
} else if (/^(mp3|wma|wav|flac|ape|ogg|aac|m4a)$/.test(fileType)) {
|
|
21
|
+
IconColor = '#8479D6';
|
|
22
|
+
} else if (/^(mp4|mkv|rm|rmvb|avi|3gp|flv|wmv|asf|mpeg|mpg|mov|ts|m4v)$/.test(fileType)) {
|
|
23
|
+
IconColor = '#3EBBA8';
|
|
24
|
+
} else {
|
|
25
|
+
FileType = 'none';
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
return {
|
|
30
29
|
IsImage: IsImage,
|
|
30
|
+
IconColor: IconColor,
|
|
31
31
|
FileType: FileType
|
|
32
32
|
};
|
|
33
33
|
};
|