easy3wui 1.6.2 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/assets/btn.css +3 -9
- package/assets/card.css +0 -8
- package/assets/flow.css +133 -287
- package/assets/formPage.css +3 -85
- package/assets/gridPage.css +1 -53
- package/assets/index.css +141 -444
- package/assets/login.css +0 -4
- package/assets/userLayout.css +1 -2
- package/lib/Easy3wButton/index.js +4 -8
- package/lib/Easy3wButtonOne/index.js +1 -1
- package/lib/Easy3wCaHandler/index.js +130 -24
- package/lib/Easy3wDownLoad/index.js +96 -9
- package/lib/Easy3wFlow/index.js +36 -216
- package/lib/Easy3wFormPage/index.js +140 -579
- package/lib/Easy3wMAESDecrypt/index.js +21 -0
- package/lib/Easy3wMAESEncrypt/index.js +20 -0
- package/lib/Easy3wMActionSheet/index.js +41 -0
- package/lib/Easy3wMAutoCenter/index.js +47 -0
- package/lib/Easy3wMAvatar/index.js +41 -0
- package/lib/Easy3wMBadge/index.js +47 -0
- package/lib/Easy3wMButton/index.js +158 -0
- package/lib/Easy3wMButton/index.less +7 -0
- package/lib/Easy3wMCalendar/index.js +41 -0
- package/lib/Easy3wMCapsuleTabs/index.js +50 -0
- package/lib/Easy3wMCaptcha/index.js +117 -0
- package/lib/Easy3wMCard/index.js +47 -0
- package/lib/Easy3wMCascadePicker/index.js +47 -0
- package/lib/Easy3wMCascadePickerView/index.js +47 -0
- package/lib/Easy3wMCascader/index.js +47 -0
- package/lib/Easy3wMCascaderView/index.js +47 -0
- package/lib/Easy3wMCenterPopup/index.js +47 -0
- package/lib/Easy3wMCheckList/index.js +50 -0
- package/lib/Easy3wMCheckbox/index.js +50 -0
- package/lib/Easy3wMCollapse/index.js +50 -0
- package/lib/Easy3wMDatePicker/index.js +47 -0
- package/lib/Easy3wMDatePickerView/index.js +47 -0
- package/lib/Easy3wMDialog/index.js +47 -0
- package/lib/Easy3wMDictCode/index.js +50 -0
- package/lib/Easy3wMDivider/index.js +48 -0
- package/lib/Easy3wMDownLoad/Easy3wMFileView.js +84 -0
- package/lib/Easy3wMDownLoad/Easy3wMImgView.js +75 -0
- package/lib/Easy3wMDownLoad/Easy3wMPDFView.js +145 -0
- package/lib/Easy3wMDownLoad/Easy3wMRCView.js +65 -0
- package/lib/Easy3wMDownLoad/index.js +284 -0
- package/lib/Easy3wMDropdown/index.js +50 -0
- package/lib/Easy3wMEllipsis/index.js +41 -0
- package/lib/Easy3wMEmpty/index.js +41 -0
- package/lib/Easy3wMErrorBlock/index.js +47 -0
- package/lib/Easy3wMException/index.js +55 -0
- package/lib/Easy3wMFloatingBubble/index.js +47 -0
- package/lib/Easy3wMFloatingPanel/index.js +47 -0
- package/lib/Easy3wMForm/index.js +57 -0
- package/lib/Easy3wMFormPage/index.js +191 -0
- package/lib/Easy3wMGetCookie/index.js +14 -0
- package/lib/Easy3wMGlobalFooter/index.js +77 -0
- package/lib/Easy3wMGlobalFooter/index.less +3 -0
- package/lib/Easy3wMGlobalHeader/index.js +65 -0
- package/lib/Easy3wMGrid/index.js +51 -0
- package/lib/Easy3wMGridPage/index.js +173 -0
- package/lib/Easy3wMImageUploader/index.js +47 -0
- package/lib/Easy3wMImageViewer/index.js +45 -0
- package/lib/Easy3wMIndexBar/index.js +50 -0
- package/lib/Easy3wMInfiniteScroll/index.js +47 -0
- package/lib/Easy3wMInput/index.js +41 -0
- package/lib/Easy3wMInsideLayout/index.js +131 -0
- package/lib/Easy3wMInsideLayout/index.less +31 -0
- package/lib/Easy3wMJumboTabs/index.js +50 -0
- package/lib/Easy3wMList/index.js +50 -0
- package/lib/Easy3wMLogin/index.js +174 -0
- package/lib/Easy3wMMask/index.js +47 -0
- package/lib/Easy3wMModal/index.js +47 -0
- package/lib/Easy3wMNavBar/index.js +47 -0
- package/lib/Easy3wMNoticeBar/index.js +41 -0
- package/lib/Easy3wMNumberKeyboard/index.js +41 -0
- package/lib/Easy3wMPageIndicator/index.js +41 -0
- package/lib/Easy3wMPasscodeInput/index.js +41 -0
- package/lib/Easy3wMPicker/index.js +47 -0
- package/lib/Easy3wMPickerView/index.js +47 -0
- package/lib/Easy3wMPopover/index.js +51 -0
- package/lib/Easy3wMPopoverMenu/index.js +49 -0
- package/lib/Easy3wMPopup/index.js +47 -0
- package/lib/Easy3wMProgressBar/index.js +41 -0
- package/lib/Easy3wMProgressCircle/index.js +47 -0
- package/lib/Easy3wMPullToRefresh/index.js +47 -0
- package/lib/Easy3wMRadio/index.js +51 -0
- package/lib/Easy3wMRate/index.js +47 -0
- package/lib/Easy3wMResult/index.js +41 -0
- package/lib/Easy3wMSafeArea/index.js +41 -0
- package/lib/Easy3wMSearchBar/index.js +41 -0
- package/lib/Easy3wMSelector/index.js +41 -0
- package/lib/Easy3wMSetCookie/index.js +13 -0
- package/lib/Easy3wMSideBar/index.js +51 -0
- package/lib/Easy3wMSkeleton/index.js +47 -0
- package/lib/Easy3wMSlider/index.js +41 -0
- package/lib/Easy3wMSpace/index.js +47 -0
- package/lib/Easy3wMSpin/index.js +66 -0
- package/lib/Easy3wMSpin/index.less +15 -0
- package/lib/Easy3wMStepper/index.js +41 -0
- package/lib/Easy3wMSteps/index.js +45 -0
- package/lib/Easy3wMSwipeAction/index.js +47 -0
- package/lib/Easy3wMSwiper/index.js +45 -0
- package/lib/Easy3wMSwitch/index.js +41 -0
- package/lib/Easy3wMTabBar/index.js +51 -0
- package/lib/Easy3wMTabs/index.js +51 -0
- package/lib/Easy3wMTag/index.js +41 -0
- package/lib/Easy3wMTextArea/index.js +41 -0
- package/lib/Easy3wMToast/index.js +47 -0
- package/lib/Easy3wMTreeSelect/index.js +41 -0
- package/lib/Easy3wMUserLayout/index.js +139 -0
- package/lib/Easy3wMUserLayout/index.less +11 -0
- package/lib/Easy3wMVirtualInput/index.js +41 -0
- package/lib/Easy3wMWaterMark/index.js +41 -0
- package/lib/Easy3wPositionButton/index.js +1 -1
- package/lib/Easy3wUpload/index.js +44 -16
- package/lib/Easy3wUploadB/index copy 2.js +1011 -0
- package/lib/Easy3wUploadB/index.js +101 -74
- package/lib/Easy3wUploadM/index.js +40 -14
- package/lib/index.js +810 -0
- package/package.json +2 -2
- package/lib/Easy3wFormPage/easy3wFormPage.less +0 -37
- package/lib/Easy3wPositionButton/easy3wPositionButton.less +0 -8
|
@@ -78,24 +78,33 @@ require('antd/lib/modal/style');
|
|
|
78
78
|
|
|
79
79
|
var _comonConfig = require('comonConfigPath/comonConfig');
|
|
80
80
|
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
var _Easy3wGetCookie2 = _interopRequireDefault(_Easy3wGetCookie);
|
|
84
|
-
|
|
85
|
-
var _Easy3wDownLoad = require('./../Easy3wDownLoad');
|
|
81
|
+
var _Easy3wDownLoad = require('../Easy3wDownLoad');
|
|
86
82
|
|
|
87
83
|
var _Easy3wDownLoad2 = _interopRequireDefault(_Easy3wDownLoad);
|
|
88
84
|
|
|
89
|
-
var _Easy3wAESEncrypt = require('
|
|
85
|
+
var _Easy3wAESEncrypt = require('../Easy3wAESEncrypt');
|
|
90
86
|
|
|
91
87
|
var _Easy3wAESEncrypt2 = _interopRequireDefault(_Easy3wAESEncrypt);
|
|
92
88
|
|
|
93
89
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
94
90
|
|
|
91
|
+
var _ref = _comonConfig.objPreviewFile || {},
|
|
92
|
+
previewFileUrl = _ref.previewFileUrl,
|
|
93
|
+
previewFileFlag = _ref.previewFileFlag,
|
|
94
|
+
previewFileType = _ref.previewFileType;
|
|
95
|
+
|
|
95
96
|
var formItemStyle = {
|
|
96
|
-
|
|
97
|
-
margin: 3
|
|
97
|
+
marginBottom: 6
|
|
98
98
|
};
|
|
99
|
+
function Easy3wGetCookie(name) {
|
|
100
|
+
var arr = void 0;
|
|
101
|
+
var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
|
|
102
|
+
if (arr = document.cookie.match(reg)) {
|
|
103
|
+
return unescape(arr[2]);
|
|
104
|
+
} else {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
99
108
|
|
|
100
109
|
var BigFileUpload = function (_Component) {
|
|
101
110
|
(0, _inherits3['default'])(BigFileUpload, _Component);
|
|
@@ -147,6 +156,10 @@ var BigFileUpload = function (_Component) {
|
|
|
147
156
|
}
|
|
148
157
|
}
|
|
149
158
|
};
|
|
159
|
+
// 预览
|
|
160
|
+
|
|
161
|
+
// url处理
|
|
162
|
+
|
|
150
163
|
|
|
151
164
|
BigFileUpload.prototype.render = function render() {
|
|
152
165
|
var _this2 = this;
|
|
@@ -166,7 +179,8 @@ var BigFileUpload = function (_Component) {
|
|
|
166
179
|
wrapperCol = _props.wrapperCol,
|
|
167
180
|
showUploadList = _props.showUploadList,
|
|
168
181
|
urlDownloadFile = _props.urlDownloadFile,
|
|
169
|
-
initialValue = _props.initialValue
|
|
182
|
+
initialValue = _props.initialValue,
|
|
183
|
+
propsAFlag = _props.propsAFlag;
|
|
170
184
|
var _state = this.state,
|
|
171
185
|
preUploading = _state.preUploading,
|
|
172
186
|
uploadPercent = _state.uploadPercent,
|
|
@@ -241,20 +255,10 @@ var BigFileUpload = function (_Component) {
|
|
|
241
255
|
var fileTypePass = true;
|
|
242
256
|
var fileNameArr = file.name.toLowerCase().split('.');
|
|
243
257
|
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
244
|
-
if (file.name.length > 100) {
|
|
245
|
-
_modal2['default'].info({
|
|
246
|
-
style: { top: '38%' },
|
|
247
|
-
content: '文件名称至多100个字符',
|
|
248
|
-
okText: '知道了'
|
|
249
|
-
});
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
var acceptDefault = '.msg,.rplib,.xls,.doc,.jpg,.pdf,.png,.zip,.bmp,.rar,.txt,.docx,.ico,.bid,.xlsx,.jpeg,.json,.xml,.ebid,.dwg,.pptx,.xmind,.xps,.crx,.7z,.ppt,.svg,.pdm,.xlsm,.vsd,.gif,.tif,.docm,.csv,.ttf,.wps,.psd,.mp4,.tiff,.rtf,.tlb,.xlsb';
|
|
253
258
|
if (accept && accept.length > 0) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
fileTypePass = false;
|
|
259
|
+
if (accept.indexOf(fileType) < 0) {
|
|
260
|
+
fileTypePass = false;
|
|
261
|
+
}
|
|
258
262
|
}
|
|
259
263
|
if (!fileTypePass) {
|
|
260
264
|
_modal2['default'].error({
|
|
@@ -275,6 +279,9 @@ var BigFileUpload = function (_Component) {
|
|
|
275
279
|
fileList = _state3.fileList,
|
|
276
280
|
iniSetedFlag = _state3.iniSetedFlag;
|
|
277
281
|
|
|
282
|
+
if (!iniSetedFlag) {
|
|
283
|
+
iniSetedFlag = true;
|
|
284
|
+
}
|
|
278
285
|
if (!multiple) {
|
|
279
286
|
fileList = [file];
|
|
280
287
|
} else {
|
|
@@ -304,8 +311,11 @@ var BigFileUpload = function (_Component) {
|
|
|
304
311
|
},
|
|
305
312
|
fileList: this.state.fileList
|
|
306
313
|
};
|
|
314
|
+
if (previewFileFlag) {
|
|
315
|
+
uploadProp.onPreview = this.onPreview;
|
|
316
|
+
}
|
|
307
317
|
if (isRead) {
|
|
308
|
-
uploadProp =
|
|
318
|
+
uploadProp.children = true;
|
|
309
319
|
}
|
|
310
320
|
return isRead ? _react2['default'].createElement(
|
|
311
321
|
_form2['default'].Item,
|
|
@@ -320,7 +330,8 @@ var BigFileUpload = function (_Component) {
|
|
|
320
330
|
pdfViewFlag: true,
|
|
321
331
|
imgVisible: true,
|
|
322
332
|
urlDownloadFile: urlDownloadFile,
|
|
323
|
-
downloadArr: initialValue
|
|
333
|
+
downloadArr: initialValue,
|
|
334
|
+
propsAFlag: propsAFlag
|
|
324
335
|
}))
|
|
325
336
|
) : _react2['default'].createElement(
|
|
326
337
|
_form2['default'].Item,
|
|
@@ -342,7 +353,7 @@ var BigFileUpload = function (_Component) {
|
|
|
342
353
|
(0, _extends3['default'])({}, uploadProp, {
|
|
343
354
|
disabled: this.state.loading
|
|
344
355
|
}),
|
|
345
|
-
|
|
356
|
+
_react2['default'].createElement(
|
|
346
357
|
_popover2['default'],
|
|
347
358
|
{
|
|
348
359
|
placement: 'right',
|
|
@@ -455,6 +466,22 @@ BigFileUpload.defaultProps = {
|
|
|
455
466
|
var _initialiseProps = function _initialiseProps() {
|
|
456
467
|
var _this3 = this;
|
|
457
468
|
|
|
469
|
+
this.onPreview = function (file) {
|
|
470
|
+
var uid = file.uid,
|
|
471
|
+
url = file.url,
|
|
472
|
+
name = file.name;
|
|
473
|
+
|
|
474
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
475
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
476
|
+
if (previewFileType.indexOf(fileType) >= 0) {
|
|
477
|
+
// const src = previewFileUrl + uid;
|
|
478
|
+
var src = _this3.urlDeal(previewFileUrl, uid);
|
|
479
|
+
window.open(src, '_blank');
|
|
480
|
+
} else {
|
|
481
|
+
window.open(url);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
|
|
458
485
|
this.setUploadValue = function (v) {
|
|
459
486
|
var _setFieldsValue;
|
|
460
487
|
|
|
@@ -466,25 +493,13 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
466
493
|
setFieldsValue((_setFieldsValue = {}, _setFieldsValue[name] = v, _setFieldsValue));
|
|
467
494
|
};
|
|
468
495
|
|
|
469
|
-
this.urlDeal = function (urlDownloadFile, uid) {
|
|
470
|
-
var retUrl = '';
|
|
471
|
-
if (uid !== '' && _comonConfig.aFlag && (_comonConfig.aFlag === '1' || _comonConfig.aFlag === '2')) {
|
|
472
|
-
var authToken = (0, _Easy3wGetCookie2['default'])('userToken') || 'E3WSAFEAPPQWEFGHYI7I483S';
|
|
473
|
-
var nowStr = _.now();
|
|
474
|
-
var encUrl = (0, _Easy3wAESEncrypt2['default'])(uid + '@#' + nowStr + '@#' + authToken, _comonConfig.a, _comonConfig.b);
|
|
475
|
-
return '' + urlDownloadFile + encUrl;
|
|
476
|
-
} else {
|
|
477
|
-
retUrl = '' + urlDownloadFile + uid;
|
|
478
|
-
return retUrl;
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
|
|
482
496
|
this.iniValDeal = function (initialValue) {
|
|
483
497
|
var urlDownloadFile = _this3.props.urlDownloadFile;
|
|
484
498
|
|
|
485
499
|
var iniVal = initialValue.map(function (obj) {
|
|
486
500
|
var uid = obj.uid,
|
|
487
501
|
name = obj.name;
|
|
502
|
+
// const url = `${urlDownloadFile}${uid}`;
|
|
488
503
|
|
|
489
504
|
var url = _this3.urlDeal(urlDownloadFile, uid);
|
|
490
505
|
var status = 'done';
|
|
@@ -496,11 +511,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
496
511
|
this.checkFile = function (uploadParams) {
|
|
497
512
|
_this3.setState({ uploadRequest: true });
|
|
498
513
|
var formData = new FormData();
|
|
499
|
-
var authToken = (
|
|
500
|
-
// const timeStr = new Date().getTime();
|
|
501
|
-
// if (AESFlag && AESFlag === '1') {
|
|
502
|
-
// authToken = Easy3wAESEncrypt(`${authToken}@#${timeStr}`, AESKey, AESIV);
|
|
503
|
-
// }
|
|
514
|
+
var authToken = Easy3wGetCookie('userToken') || '40572da23bee5fd59cc5b6c8d8bfb36d';
|
|
504
515
|
var _props3 = _this3.props,
|
|
505
516
|
name = _props3.name,
|
|
506
517
|
urlCheckProgress = _props3.urlCheckProgress,
|
|
@@ -609,7 +620,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
609
620
|
var _index2 = _fileList2.indexOf(_currentFile);
|
|
610
621
|
if (_index2 >= 0) {
|
|
611
622
|
_fileList2.splice(_index2, 1);
|
|
612
|
-
_this3.setState((0, _extends3['default'])({}, _this3.state, {
|
|
623
|
+
_this3.setState((0, _extends3['default'])({}, _this3.state, { fileList: _fileList2, loading: false }), function () {
|
|
613
624
|
_this3.setUploadValue(_fileList2);
|
|
614
625
|
});
|
|
615
626
|
}
|
|
@@ -617,7 +628,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
617
628
|
});
|
|
618
629
|
};
|
|
619
630
|
|
|
620
|
-
this.handlePartUpload = function () {
|
|
631
|
+
this.handlePartUpload = function (sIndex, eIndex) {
|
|
621
632
|
try {
|
|
622
633
|
var _state6 = _this3.state,
|
|
623
634
|
currentFile = _state6.currentFile,
|
|
@@ -679,21 +690,25 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
679
690
|
} else {
|
|
680
691
|
end = fileSize;
|
|
681
692
|
}
|
|
693
|
+
var start = CUSize;
|
|
694
|
+
if (sIndex && sIndex > 0 && eIndex && eIndex > 0) {
|
|
695
|
+
end = eIndex;
|
|
696
|
+
start = sIndex;
|
|
697
|
+
}
|
|
682
698
|
uploadFileReader.onload = function (e) {
|
|
683
699
|
if (chunkCheckErr) {
|
|
684
700
|
return;
|
|
685
701
|
}
|
|
702
|
+
var mainFileSpark = new _sparkMd2['default'].ArrayBuffer(); // 对arrayBuffer数据进行md5加密,产生一个md5字符串 主文件
|
|
703
|
+
mainFileSpark.append(e.target.result);
|
|
704
|
+
var chunkMD5 = mainFileSpark.end();
|
|
686
705
|
// 上传附件
|
|
687
706
|
var file = uploadData.file;
|
|
688
707
|
|
|
689
708
|
var formData = new FormData();
|
|
690
|
-
var authToken = (
|
|
691
|
-
// const timeStr = new Date().getTime();
|
|
692
|
-
// if (AESFlag && AESFlag === '1') {
|
|
693
|
-
// authToken = Easy3wAESEncrypt(`${authToken}@#${timeStr}`, AESKey, AESIV);
|
|
694
|
-
// }
|
|
709
|
+
var authToken = Easy3wGetCookie('userToken') || '40572da23bee5fd59cc5b6c8d8bfb36d';
|
|
695
710
|
var blob = new Blob([e.target.result], { type: 'application/octet-stream' });
|
|
696
|
-
var postParam = (0, _extends3['default'])({ fileInfo: file }, sendData, { currentSize: end });
|
|
711
|
+
var postParam = (0, _extends3['default'])({ fileInfo: file }, sendData, { currentSize: end, startSize: start, chunkMD5: chunkMD5 });
|
|
697
712
|
formData.append('chunk', blob);
|
|
698
713
|
formData.append('sendTime', new Date().getTime());
|
|
699
714
|
formData.append('appType', '01');
|
|
@@ -733,16 +748,26 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
733
748
|
blob = null;
|
|
734
749
|
formData = null;
|
|
735
750
|
if (res && res.body.rspCode === '0000') {
|
|
736
|
-
var useTime = (new Date().getTime() - startTime) / 1000; // 用时秒
|
|
737
|
-
// 1秒传输速率
|
|
738
|
-
var curSpeed = Math.floor(1 / useTime * size);
|
|
739
751
|
var _res$body$data2 = res.body.data,
|
|
740
752
|
uploadStatus = _res$body$data2.uploadStatus,
|
|
741
753
|
fileId = _res$body$data2.fileId,
|
|
742
754
|
checkStatus = _res$body$data2.checkStatus,
|
|
743
|
-
uploadedSize = _res$body$data2.uploadedSize
|
|
755
|
+
uploadedSize = _res$body$data2.uploadedSize,
|
|
756
|
+
startIndex = _res$body$data2.startIndex,
|
|
757
|
+
endIndex = _res$body$data2.endIndex;
|
|
744
758
|
|
|
759
|
+
var useTime = (new Date().getTime() - startTime) / 1000; // 用时秒
|
|
745
760
|
var upSize = Number(uploadedSize);
|
|
761
|
+
// 1秒传输速率
|
|
762
|
+
var curSpeed = Math.floor(1 / useTime * size);
|
|
763
|
+
if (checkStatus && checkStatus === 'RETRY') {
|
|
764
|
+
_this3.setState((0, _extends3['default'])({}, _this3.state, {
|
|
765
|
+
speed: curSpeed
|
|
766
|
+
}), function () {
|
|
767
|
+
setImmediate(_this3.handlePartUpload, startIndex, endIndex);
|
|
768
|
+
});
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
746
771
|
// 计算上传进度
|
|
747
772
|
uploadPercent = Math.floor(upSize / fileSize * 100 * 10) / 10;
|
|
748
773
|
if (checkStatus === '0') {
|
|
@@ -828,10 +853,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
828
853
|
setImmediate(_this3.handlePartUpload);
|
|
829
854
|
});
|
|
830
855
|
}
|
|
831
|
-
} else
|
|
856
|
+
} else {
|
|
832
857
|
_modal2['default'].error({
|
|
833
858
|
style: { top: '38%' },
|
|
834
|
-
content: res.body.rspMsg
|
|
859
|
+
content: res && res.body.rspMsg ? res.body.rspMsg : '上传失败'
|
|
835
860
|
});
|
|
836
861
|
var _fileList4 = _this3.state.fileList;
|
|
837
862
|
|
|
@@ -842,25 +867,11 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
842
867
|
_this3.setUploadValue(_fileList4);
|
|
843
868
|
});
|
|
844
869
|
}
|
|
845
|
-
} else {
|
|
846
|
-
_modal2['default'].error({
|
|
847
|
-
style: { top: '38%' },
|
|
848
|
-
content: '上传失败'
|
|
849
|
-
});
|
|
850
|
-
var _fileList5 = _this3.state.fileList;
|
|
851
|
-
|
|
852
|
-
var _index5 = _fileList5.indexOf(currentFile);
|
|
853
|
-
if (_index5 >= 0) {
|
|
854
|
-
_fileList5.splice(_index5, 1);
|
|
855
|
-
_this3.setState((0, _extends3['default'])({}, _this3.state, { loading: false, fileList: _fileList5 }), function () {
|
|
856
|
-
_this3.setUploadValue(_fileList5);
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
870
|
}
|
|
860
871
|
});
|
|
861
872
|
};
|
|
862
|
-
// console.log('读取文件', `文件大小:${currentFile.size}`, `已上传大小${
|
|
863
|
-
uploadFileReader.readAsArrayBuffer(blobSlice.call(currentFile,
|
|
873
|
+
// console.log('读取文件', `文件大小:${currentFile.size}`, `已上传大小${start}`, `结束值${end}`, `切片大小${speed}`);
|
|
874
|
+
uploadFileReader.readAsArrayBuffer(blobSlice.call(currentFile, start, end));
|
|
864
875
|
} catch (error) {
|
|
865
876
|
_modal2['default'].error({
|
|
866
877
|
style: { top: '38%' },
|
|
@@ -880,6 +891,21 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
880
891
|
}
|
|
881
892
|
};
|
|
882
893
|
|
|
894
|
+
this.urlDeal = function (urlDownloadFile, uid) {
|
|
895
|
+
var propsAFlag = _this3.props.propsAFlag; // propsAFlag 加密标识 从引用组件处传入 '1':加密 '0':不加密
|
|
896
|
+
|
|
897
|
+
var retUrl = '';
|
|
898
|
+
if (uid !== '' && propsAFlag === '1' || uid !== '' && propsAFlag !== '0' && (_comonConfig.aFlag === '1' || _comonConfig.aFlag === '2')) {
|
|
899
|
+
var authToken = Easy3wGetCookie('userToken') || 'E3WSAFEAPPQWEFGHYI7I483S';
|
|
900
|
+
var nowStr = _.now();
|
|
901
|
+
var encUrl = (0, _Easy3wAESEncrypt2['default'])(uid + '@#' + nowStr + '@#' + authToken, _comonConfig.a, _comonConfig.b);
|
|
902
|
+
return '' + urlDownloadFile + encUrl;
|
|
903
|
+
} else {
|
|
904
|
+
retUrl = '' + urlDownloadFile + uid;
|
|
905
|
+
return retUrl;
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
|
|
883
909
|
this.readFile = function (file) {
|
|
884
910
|
try {
|
|
885
911
|
var chunkReader = new FileReader();
|
|
@@ -940,7 +966,8 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
940
966
|
if (sliceIndex < sliceCount) {
|
|
941
967
|
_this3.setState((0, _extends3['default'])({}, _this3.state, {
|
|
942
968
|
preUploading: true,
|
|
943
|
-
preUploadPercent: Number((sliceIndex / sliceCount * 100).toFixed(1))
|
|
969
|
+
preUploadPercent: Number((sliceIndex / sliceCount * 100).toFixed(1))
|
|
970
|
+
}));
|
|
944
971
|
setImmediate(_loadNext, sliceIndex, tempreadFileSize);
|
|
945
972
|
} else {
|
|
946
973
|
var mainFileMD5 = mainFileSpark.end();
|
|
@@ -64,23 +64,27 @@ require('antd/lib/modal/style');
|
|
|
64
64
|
|
|
65
65
|
var _comonConfig = require('comonConfigPath/comonConfig');
|
|
66
66
|
|
|
67
|
-
var _Easy3wGetCookie = require('
|
|
67
|
+
var _Easy3wGetCookie = require('../Easy3wGetCookie');
|
|
68
68
|
|
|
69
69
|
var _Easy3wGetCookie2 = _interopRequireDefault(_Easy3wGetCookie);
|
|
70
70
|
|
|
71
|
-
var _Easy3wDownLoad = require('
|
|
71
|
+
var _Easy3wDownLoad = require('../Easy3wDownLoad');
|
|
72
72
|
|
|
73
73
|
var _Easy3wDownLoad2 = _interopRequireDefault(_Easy3wDownLoad);
|
|
74
74
|
|
|
75
|
-
var _Easy3wAESEncrypt = require('
|
|
75
|
+
var _Easy3wAESEncrypt = require('../Easy3wAESEncrypt');
|
|
76
76
|
|
|
77
77
|
var _Easy3wAESEncrypt2 = _interopRequireDefault(_Easy3wAESEncrypt);
|
|
78
78
|
|
|
79
79
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
80
80
|
|
|
81
|
+
var _ref = _comonConfig.objPreviewFile || {},
|
|
82
|
+
previewFileUrl = _ref.previewFileUrl,
|
|
83
|
+
previewFileFlag = _ref.previewFileFlag,
|
|
84
|
+
previewFileType = _ref.previewFileType;
|
|
85
|
+
|
|
81
86
|
var formItemStyle = {
|
|
82
|
-
|
|
83
|
-
margin: 3
|
|
87
|
+
marginBottom: 6
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
var Easy3wUploadM = function (_Component) {
|
|
@@ -97,9 +101,25 @@ var Easy3wUploadM = function (_Component) {
|
|
|
97
101
|
|
|
98
102
|
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
|
|
99
103
|
fileList: [{}]
|
|
104
|
+
// 预览
|
|
105
|
+
}, _this.onPreview = function (file) {
|
|
106
|
+
var uid = file.uid,
|
|
107
|
+
url = file.url,
|
|
108
|
+
name = file.name;
|
|
109
|
+
|
|
110
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
111
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
112
|
+
if (previewFileType.indexOf(fileType) >= 0) {
|
|
113
|
+
var src = _this.urlDeal(previewFileUrl, uid);
|
|
114
|
+
window.open(src, '_blank');
|
|
115
|
+
} else {
|
|
116
|
+
window.open(url);
|
|
117
|
+
}
|
|
100
118
|
}, _this.urlDeal = function (urlDownloadFile, uid) {
|
|
119
|
+
var propsAFlag = _this.props.propsAFlag; // propsAFlag 加密标识 从引用组件处传入 '1':加密 '0':不加密
|
|
120
|
+
|
|
101
121
|
var retUrl = '';
|
|
102
|
-
if (uid !== '' &&
|
|
122
|
+
if (uid !== '' && propsAFlag === '1' || uid !== '' && propsAFlag !== '0' && (_comonConfig.aFlag === '1' || _comonConfig.aFlag === '2')) {
|
|
103
123
|
var authToken = (0, _Easy3wGetCookie2['default'])('userToken') || 'E3WSAFEAPPQWEFGHYI7I483S';
|
|
104
124
|
var nowStr = _.now();
|
|
105
125
|
var encUrl = (0, _Easy3wAESEncrypt2['default'])(uid + '@#' + nowStr + '@#' + authToken, _comonConfig.a, _comonConfig.b);
|
|
@@ -136,7 +156,8 @@ var Easy3wUploadM = function (_Component) {
|
|
|
136
156
|
extendBack = _props.extendBack,
|
|
137
157
|
uploadDoneCallback = _props.uploadDoneCallback,
|
|
138
158
|
removeCallback = _props.removeCallback,
|
|
139
|
-
downloadAllFlag = _props.downloadAllFlag
|
|
159
|
+
downloadAllFlag = _props.downloadAllFlag,
|
|
160
|
+
propsAFlag = _props.propsAFlag;
|
|
140
161
|
var warnMessage = this.props.warnMessage;
|
|
141
162
|
|
|
142
163
|
var iniVal = [];
|
|
@@ -144,7 +165,8 @@ var Easy3wUploadM = function (_Component) {
|
|
|
144
165
|
if (initialValue) {
|
|
145
166
|
iniVal = initialValue.map(function (obj) {
|
|
146
167
|
var uid = obj.uid,
|
|
147
|
-
name = obj.name
|
|
168
|
+
name = obj.name,
|
|
169
|
+
status = obj.status;
|
|
148
170
|
|
|
149
171
|
if (allivaule === '') {
|
|
150
172
|
allivaule = uid;
|
|
@@ -152,7 +174,7 @@ var Easy3wUploadM = function (_Component) {
|
|
|
152
174
|
allivaule = allivaule + ',' + uid;
|
|
153
175
|
}
|
|
154
176
|
var url = _this2.urlDeal(urlDownloadFile, uid);
|
|
155
|
-
return { uid: uid, name: name, url: url };
|
|
177
|
+
return { uid: uid, name: name, url: url, status: status || 'done' };
|
|
156
178
|
});
|
|
157
179
|
}
|
|
158
180
|
if (!warnMessage) {
|
|
@@ -189,7 +211,10 @@ var Easy3wUploadM = function (_Component) {
|
|
|
189
211
|
}
|
|
190
212
|
};
|
|
191
213
|
if (isRead) {
|
|
192
|
-
upProps = (0, _extends3['default'])({}, upProps, { showUploadList: { showPreviewIcon:
|
|
214
|
+
upProps = (0, _extends3['default'])({}, upProps, { children: true, showUploadList: { showPreviewIcon: false, showRemoveIcon: false } });
|
|
215
|
+
}
|
|
216
|
+
if (previewFileFlag) {
|
|
217
|
+
upProps.onPreview = this.onPreview;
|
|
193
218
|
}
|
|
194
219
|
var beforeUpload = function beforeUpload(file) {
|
|
195
220
|
// 限制上传大小
|
|
@@ -200,7 +225,7 @@ var Easy3wUploadM = function (_Component) {
|
|
|
200
225
|
|
|
201
226
|
var fileNameArr = name.toLowerCase().split('.');
|
|
202
227
|
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
203
|
-
var acceptDefault = '.
|
|
228
|
+
var acceptDefault = '.rplib,.xls,.doc,.jpg,.pdf,.png,.zip,.bmp,.rar,.txt,.docx,.ico,.bid,.xlsx,.jpeg,.json,.xml,.ebid,.dwg,.pptx,.xmind,.xps,.crx,.7z,.ppt,.svg,.pdm,.xlsm,.vsd,.gif,.tif,.docm,.csv,.ttf,.wps,.psd,.mp4,.tiff,.rtf,.tlb,.xlsb';
|
|
204
229
|
if (name.length > 100) {
|
|
205
230
|
_modal2['default'].info({
|
|
206
231
|
style: { top: '38%' },
|
|
@@ -257,7 +282,7 @@ var Easy3wUploadM = function (_Component) {
|
|
|
257
282
|
var correctTypeFlag = true;
|
|
258
283
|
var fileNameArr = name.toLowerCase().split('.');
|
|
259
284
|
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
260
|
-
var acceptDefault = '.
|
|
285
|
+
var acceptDefault = '.xls,.doc,.jpg,.pdf,.png,.zip,.bmp,.rar,.txt,.docx,.ico,.bid,.xlsx,.jpeg,.json,.xml,.ebid,.dwg,.pptx,.xmind,.xps,.crx,.7z,.ppt,.svg,.pdm,.xlsm,.vsd,.gif,.tif,.docm,.csv,.ttf,.wps,.psd,.mp4,.tiff,.rtf,.tlb,.xlsb';
|
|
261
286
|
if (name.length > 100) {
|
|
262
287
|
return false;
|
|
263
288
|
}
|
|
@@ -376,7 +401,8 @@ var Easy3wUploadM = function (_Component) {
|
|
|
376
401
|
pdfViewFlag: true,
|
|
377
402
|
imgVisible: true,
|
|
378
403
|
urlDownloadFile: urlDownloadFile,
|
|
379
|
-
downloadArr: initialValue
|
|
404
|
+
downloadArr: initialValue,
|
|
405
|
+
propsAFlag: propsAFlag
|
|
380
406
|
})),
|
|
381
407
|
extendBackShowFlag ? extendBack : ''
|
|
382
408
|
) : _react2['default'].createElement(
|
|
@@ -403,7 +429,7 @@ var Easy3wUploadM = function (_Component) {
|
|
|
403
429
|
onRemove: handleRemove,
|
|
404
430
|
multiple: true
|
|
405
431
|
}),
|
|
406
|
-
_react2['default'].createElement(
|
|
432
|
+
isRead ? '' : _react2['default'].createElement(
|
|
407
433
|
_popover2['default'],
|
|
408
434
|
{
|
|
409
435
|
placement: 'top',
|