easy3wui 1.5.76-beta.2 → 1.5.77-beta
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/assets/card.css +14 -0
- package/assets/formPage.css +67 -3
- package/assets/gridPage.css +6 -0
- package/assets/index.css +87 -3
- package/lib/Easy3wDownLoad/index copy.js +333 -0
- package/lib/Easy3wDownLoad/index.js +18 -13
- package/lib/Easy3wFormPage/index.js +30 -4009
- package/lib/Easy3wFormPage/indexM.js +4266 -0
- package/lib/Easy3wFormPage/indexPC.js +4014 -0
- package/lib/Easy3wGridPage/index.js +7 -662
- package/lib/Easy3wGridPage/indexM.js +680 -0
- package/lib/Easy3wGridPage/indexPC.js +668 -0
- package/package.json +1 -1
package/assets/card.css
CHANGED
|
@@ -32,3 +32,17 @@ s {
|
|
|
32
32
|
margin: 0 8px -4px 0;
|
|
33
33
|
background-color: #ad7c59;
|
|
34
34
|
}
|
|
35
|
+
@media (max-width: 768px) {
|
|
36
|
+
:global .positionDiv {
|
|
37
|
+
display: none !important;
|
|
38
|
+
}
|
|
39
|
+
:global .ant-card-head-title {
|
|
40
|
+
padding: 12px 0 !important;
|
|
41
|
+
}
|
|
42
|
+
:global .ant-card-head {
|
|
43
|
+
padding: 0 12px !important;
|
|
44
|
+
}
|
|
45
|
+
:global .ant-card-body {
|
|
46
|
+
padding: 12px !important;
|
|
47
|
+
}
|
|
48
|
+
}
|
package/assets/formPage.css
CHANGED
|
@@ -37,11 +37,9 @@
|
|
|
37
37
|
.e3wFormPageWrap .inputDigit .inputNumberBtns .e3wFootBtn {
|
|
38
38
|
margin: 0;
|
|
39
39
|
}
|
|
40
|
-
.ant-input-number:hover input.ant-input-number-input {
|
|
41
|
-
padding-right: 33px;
|
|
42
|
-
}
|
|
43
40
|
input.ant-input-number-input {
|
|
44
41
|
text-align: right;
|
|
42
|
+
padding-right: 21px;
|
|
45
43
|
}
|
|
46
44
|
.rightText {
|
|
47
45
|
text-align: right;
|
|
@@ -140,3 +138,69 @@ input.ant-input-number-input {
|
|
|
140
138
|
float: right;
|
|
141
139
|
white-space: nowrap;
|
|
142
140
|
}
|
|
141
|
+
@media (max-width: 768px) {
|
|
142
|
+
:global .ant-form-item-label {
|
|
143
|
+
padding: 0;
|
|
144
|
+
height: 30px;
|
|
145
|
+
line-height: 30px;
|
|
146
|
+
text-align: right;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
}
|
|
151
|
+
:global .ant-form-item-control {
|
|
152
|
+
line-height: 30px;
|
|
153
|
+
white-space: wrap;
|
|
154
|
+
color: black;
|
|
155
|
+
}
|
|
156
|
+
:global .ant-form-item-label,
|
|
157
|
+
:global .ant-form-item-control-wrapper {
|
|
158
|
+
width: unset;
|
|
159
|
+
}
|
|
160
|
+
:global .ant-form-item-label::after {
|
|
161
|
+
content: ":";
|
|
162
|
+
}
|
|
163
|
+
:global .ant-col-6 {
|
|
164
|
+
width: 25% !important;
|
|
165
|
+
}
|
|
166
|
+
:global .ant-col-12 {
|
|
167
|
+
width: 50% !important;
|
|
168
|
+
}
|
|
169
|
+
:global .ant-col-18 {
|
|
170
|
+
width: 75% !important;
|
|
171
|
+
}
|
|
172
|
+
:global .ant-form-item {
|
|
173
|
+
font-size: 12px !important;
|
|
174
|
+
}
|
|
175
|
+
:global .ant-radio-wrapper {
|
|
176
|
+
font-size: 12px !important;
|
|
177
|
+
}
|
|
178
|
+
:global .ant-checkbox-wrapper {
|
|
179
|
+
font-size: 12px !important;
|
|
180
|
+
}
|
|
181
|
+
:global .ant-input {
|
|
182
|
+
font-size: 12px !important;
|
|
183
|
+
}
|
|
184
|
+
:global .ant-input[disabled] {
|
|
185
|
+
background-color: #fcfcfc !important;
|
|
186
|
+
}
|
|
187
|
+
:global .ant-table-body {
|
|
188
|
+
font-size: 12px !important;
|
|
189
|
+
}
|
|
190
|
+
:global .adm-collapse-panel-content {
|
|
191
|
+
padding: 0 12px;
|
|
192
|
+
}
|
|
193
|
+
:global .adm-list-item-content-main {
|
|
194
|
+
width: 100%;
|
|
195
|
+
}
|
|
196
|
+
:global .adm-form-item-horizontal .adm-list-item-content-main {
|
|
197
|
+
text-align: right;
|
|
198
|
+
}
|
|
199
|
+
:global .ant-form-item-label > label {
|
|
200
|
+
color: rgba(0, 0, 0, 0.75);
|
|
201
|
+
}
|
|
202
|
+
:global .adm-text-area-element,
|
|
203
|
+
:global .adm-text-area-count {
|
|
204
|
+
font-size: var(--adm-font-size-6);
|
|
205
|
+
}
|
|
206
|
+
}
|
package/assets/gridPage.css
CHANGED
package/assets/index.css
CHANGED
|
@@ -95,6 +95,20 @@ s {
|
|
|
95
95
|
margin: 0 8px -4px 0;
|
|
96
96
|
background-color: #ad7c59;
|
|
97
97
|
}
|
|
98
|
+
@media (max-width: 768px) {
|
|
99
|
+
:global .positionDiv {
|
|
100
|
+
display: none !important;
|
|
101
|
+
}
|
|
102
|
+
:global .ant-card-head-title {
|
|
103
|
+
padding: 12px 0 !important;
|
|
104
|
+
}
|
|
105
|
+
:global .ant-card-head {
|
|
106
|
+
padding: 0 12px !important;
|
|
107
|
+
}
|
|
108
|
+
:global .ant-card-body {
|
|
109
|
+
padding: 12px !important;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
98
112
|
.e3wGlobalFooterDiv {
|
|
99
113
|
padding: 0 16px;
|
|
100
114
|
margin: 24px 0 24px 0;
|
|
@@ -2386,6 +2400,12 @@ s {
|
|
|
2386
2400
|
.onRow tr:hover {
|
|
2387
2401
|
cursor: pointer;
|
|
2388
2402
|
}
|
|
2403
|
+
@media (max-width: 768px) {
|
|
2404
|
+
.gridBox td a:not([href]) {
|
|
2405
|
+
pointer-events: none;
|
|
2406
|
+
color: #000000;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2389
2409
|
.ant-upload-list-item {
|
|
2390
2410
|
width: auto;
|
|
2391
2411
|
}
|
|
@@ -2425,11 +2445,9 @@ s {
|
|
|
2425
2445
|
.e3wFormPageWrap .inputDigit .inputNumberBtns .e3wFootBtn {
|
|
2426
2446
|
margin: 0;
|
|
2427
2447
|
}
|
|
2428
|
-
.ant-input-number:hover input.ant-input-number-input {
|
|
2429
|
-
padding-right: 33px;
|
|
2430
|
-
}
|
|
2431
2448
|
input.ant-input-number-input {
|
|
2432
2449
|
text-align: right;
|
|
2450
|
+
padding-right: 21px;
|
|
2433
2451
|
}
|
|
2434
2452
|
.rightText {
|
|
2435
2453
|
text-align: right;
|
|
@@ -2528,6 +2546,72 @@ input.ant-input-number-input {
|
|
|
2528
2546
|
float: right;
|
|
2529
2547
|
white-space: nowrap;
|
|
2530
2548
|
}
|
|
2549
|
+
@media (max-width: 768px) {
|
|
2550
|
+
:global .ant-form-item-label {
|
|
2551
|
+
padding: 0;
|
|
2552
|
+
height: 30px;
|
|
2553
|
+
line-height: 30px;
|
|
2554
|
+
text-align: right;
|
|
2555
|
+
overflow: hidden;
|
|
2556
|
+
white-space: nowrap;
|
|
2557
|
+
text-overflow: ellipsis;
|
|
2558
|
+
}
|
|
2559
|
+
:global .ant-form-item-control {
|
|
2560
|
+
line-height: 30px;
|
|
2561
|
+
white-space: wrap;
|
|
2562
|
+
color: black;
|
|
2563
|
+
}
|
|
2564
|
+
:global .ant-form-item-label,
|
|
2565
|
+
:global .ant-form-item-control-wrapper {
|
|
2566
|
+
width: unset;
|
|
2567
|
+
}
|
|
2568
|
+
:global .ant-form-item-label::after {
|
|
2569
|
+
content: ":";
|
|
2570
|
+
}
|
|
2571
|
+
:global .ant-col-6 {
|
|
2572
|
+
width: 25% !important;
|
|
2573
|
+
}
|
|
2574
|
+
:global .ant-col-12 {
|
|
2575
|
+
width: 50% !important;
|
|
2576
|
+
}
|
|
2577
|
+
:global .ant-col-18 {
|
|
2578
|
+
width: 75% !important;
|
|
2579
|
+
}
|
|
2580
|
+
:global .ant-form-item {
|
|
2581
|
+
font-size: 12px !important;
|
|
2582
|
+
}
|
|
2583
|
+
:global .ant-radio-wrapper {
|
|
2584
|
+
font-size: 12px !important;
|
|
2585
|
+
}
|
|
2586
|
+
:global .ant-checkbox-wrapper {
|
|
2587
|
+
font-size: 12px !important;
|
|
2588
|
+
}
|
|
2589
|
+
:global .ant-input {
|
|
2590
|
+
font-size: 12px !important;
|
|
2591
|
+
}
|
|
2592
|
+
:global .ant-input[disabled] {
|
|
2593
|
+
background-color: #fcfcfc !important;
|
|
2594
|
+
}
|
|
2595
|
+
:global .ant-table-body {
|
|
2596
|
+
font-size: 12px !important;
|
|
2597
|
+
}
|
|
2598
|
+
:global .adm-collapse-panel-content {
|
|
2599
|
+
padding: 0 12px;
|
|
2600
|
+
}
|
|
2601
|
+
:global .adm-list-item-content-main {
|
|
2602
|
+
width: 100%;
|
|
2603
|
+
}
|
|
2604
|
+
:global .adm-form-item-horizontal .adm-list-item-content-main {
|
|
2605
|
+
text-align: right;
|
|
2606
|
+
}
|
|
2607
|
+
:global .ant-form-item-label > label {
|
|
2608
|
+
color: rgba(0, 0, 0, 0.75);
|
|
2609
|
+
}
|
|
2610
|
+
:global .adm-text-area-element,
|
|
2611
|
+
:global .adm-text-area-count {
|
|
2612
|
+
font-size: var(--adm-font-size-6);
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2531
2615
|
.e3wFootBtn {
|
|
2532
2616
|
margin: 0px 8px;
|
|
2533
2617
|
}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _icon = require('antd/lib/icon');
|
|
6
|
+
|
|
7
|
+
var _icon2 = _interopRequireDefault(_icon);
|
|
8
|
+
|
|
9
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
10
|
+
|
|
11
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
12
|
+
|
|
13
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
14
|
+
|
|
15
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
16
|
+
|
|
17
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
18
|
+
|
|
19
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
20
|
+
|
|
21
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
22
|
+
|
|
23
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
24
|
+
|
|
25
|
+
require('antd/lib/icon/style');
|
|
26
|
+
|
|
27
|
+
var _react = require('react');
|
|
28
|
+
|
|
29
|
+
var _react2 = _interopRequireDefault(_react);
|
|
30
|
+
|
|
31
|
+
var _propTypes = require('prop-types');
|
|
32
|
+
|
|
33
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
34
|
+
|
|
35
|
+
var _tooltip = require('antd/lib/tooltip');
|
|
36
|
+
|
|
37
|
+
var _tooltip2 = _interopRequireDefault(_tooltip);
|
|
38
|
+
|
|
39
|
+
require('antd/lib/tooltip/style');
|
|
40
|
+
|
|
41
|
+
var _reactImages = require('react-images');
|
|
42
|
+
|
|
43
|
+
var _reactImages2 = _interopRequireDefault(_reactImages);
|
|
44
|
+
|
|
45
|
+
var _classnames = require('classnames');
|
|
46
|
+
|
|
47
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
48
|
+
|
|
49
|
+
var _antd = require('antd');
|
|
50
|
+
|
|
51
|
+
var _comonConfig = require('comonConfigPath/comonConfig');
|
|
52
|
+
|
|
53
|
+
var _Easy3wPDFView = require('./Easy3wPDFView');
|
|
54
|
+
|
|
55
|
+
var _Easy3wPDFView2 = _interopRequireDefault(_Easy3wPDFView);
|
|
56
|
+
|
|
57
|
+
var _Easy3wFileView = require('./Easy3wFileView');
|
|
58
|
+
|
|
59
|
+
var _Easy3wFileView2 = _interopRequireDefault(_Easy3wFileView);
|
|
60
|
+
|
|
61
|
+
var _Easy3wRCView = require('./Easy3wRCView');
|
|
62
|
+
|
|
63
|
+
var _Easy3wRCView2 = _interopRequireDefault(_Easy3wRCView);
|
|
64
|
+
|
|
65
|
+
var _Easy3wGetCookie = require('../Easy3wGetCookie');
|
|
66
|
+
|
|
67
|
+
var _Easy3wGetCookie2 = _interopRequireDefault(_Easy3wGetCookie);
|
|
68
|
+
|
|
69
|
+
var _Easy3wAESEncrypt = require('../Easy3wAESEncrypt');
|
|
70
|
+
|
|
71
|
+
var _Easy3wAESEncrypt2 = _interopRequireDefault(_Easy3wAESEncrypt);
|
|
72
|
+
|
|
73
|
+
var _Easy3wUIConfig = require('../Easy3wUIConfig');
|
|
74
|
+
|
|
75
|
+
var _Easy3wUIConfig2 = _interopRequireDefault(_Easy3wUIConfig);
|
|
76
|
+
|
|
77
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
78
|
+
|
|
79
|
+
var objPreviewFileDefault = _Easy3wUIConfig2['default'].objPreviewFileDefault;
|
|
80
|
+
|
|
81
|
+
var Easy3wDownLoad = function (_Component) {
|
|
82
|
+
(0, _inherits3['default'])(Easy3wDownLoad, _Component);
|
|
83
|
+
|
|
84
|
+
function Easy3wDownLoad(props) {
|
|
85
|
+
(0, _classCallCheck3['default'])(this, Easy3wDownLoad);
|
|
86
|
+
|
|
87
|
+
var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
|
|
88
|
+
|
|
89
|
+
_this.onPreview = function (file, url) {
|
|
90
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, objPreviewFileDefault, _comonConfig.objPreviewFile, _this.props.objPreviewFile);
|
|
91
|
+
var previewFileUrl = objPreviewFileNew.previewFileUrl,
|
|
92
|
+
previewFileType = objPreviewFileNew.previewFileType;
|
|
93
|
+
var uid = file.uid,
|
|
94
|
+
name = file.name;
|
|
95
|
+
|
|
96
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
97
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
98
|
+
if (previewFileType.indexOf(fileType) >= 0) {
|
|
99
|
+
var src = _this.urlDeal(previewFileUrl, uid);
|
|
100
|
+
window.open(src, '_blank');
|
|
101
|
+
} else {
|
|
102
|
+
// window.open(url);
|
|
103
|
+
var aEle = document.createElement('a');
|
|
104
|
+
aEle.setAttribute('href', url);
|
|
105
|
+
aEle.setAttribute('target', '_blank');
|
|
106
|
+
aEle.setAttribute('id', 'downReportFile');
|
|
107
|
+
document.body.appendChild(aEle);
|
|
108
|
+
if (!document.getElementById('downReportFile')) {
|
|
109
|
+
document.body.appendChild(aEle);
|
|
110
|
+
}
|
|
111
|
+
aEle.click();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
_this.touchDownload = function (file, url) {
|
|
116
|
+
var uid = file.uid,
|
|
117
|
+
name = file.name;
|
|
118
|
+
// const src = this.urlDeal(previewFileUrl, uid);
|
|
119
|
+
// window.open(url);
|
|
120
|
+
|
|
121
|
+
var aEle = document.createElement('a');
|
|
122
|
+
aEle.setAttribute('href', url);
|
|
123
|
+
aEle.setAttribute('target', '_blank');
|
|
124
|
+
aEle.setAttribute('id', 'downReportFile');
|
|
125
|
+
document.body.appendChild(aEle);
|
|
126
|
+
if (!document.getElementById('downReportFile')) {
|
|
127
|
+
document.body.appendChild(aEle);
|
|
128
|
+
}
|
|
129
|
+
aEle.click();
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
_this.urlDeal = function (urlDownloadFile, uid) {
|
|
133
|
+
var propsAFlag = _this.props.propsAFlag; // propsAFlag 加密标识 从引用组件处传入 '1':加密 '0':不加密
|
|
134
|
+
|
|
135
|
+
var retUrl = '';
|
|
136
|
+
if (uid !== '' && propsAFlag === '1' || uid !== '' && propsAFlag !== '0' && (_comonConfig.aFlag === '1' || _comonConfig.aFlag === '2')) {
|
|
137
|
+
var authToken = (0, _Easy3wGetCookie2['default'])('userToken') || 'E3WSAFEAPPQWEFGHYI7I483S';
|
|
138
|
+
var nowStr = _.now();
|
|
139
|
+
var encUrl = (0, _Easy3wAESEncrypt2['default'])(uid + '@#' + nowStr + '@#' + authToken, _comonConfig.a, _comonConfig.b);
|
|
140
|
+
return '' + urlDownloadFile + encUrl;
|
|
141
|
+
} else {
|
|
142
|
+
retUrl = '' + urlDownloadFile + uid;
|
|
143
|
+
return retUrl;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
_this.showFileView = function (uid, name, apiKey, fileViewURL, fileCallURL) {
|
|
148
|
+
var callURl = fileCallURL + '?fileId=' + uid;
|
|
149
|
+
var crypto = require('crypto');
|
|
150
|
+
var hmac = crypto.createHmac('md5', apiKey);
|
|
151
|
+
var data = hmac.update(callURl);
|
|
152
|
+
var sign = data.digest('hex');
|
|
153
|
+
var btaoFileCallURL = btoa(callURl);
|
|
154
|
+
var viewFileUrl = fileViewURL + '?callURL=' + btaoFileCallURL + '&sign=' + sign;
|
|
155
|
+
_this.setState({ fileId: uid, fileName: name, fileViewFlag: true, viewFileUrl: viewFileUrl });
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
_this.hideFileModal = function () {
|
|
159
|
+
_this.setState({ fileId: '', fileURL: '', fileName: '', fileViewFlag: false });
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
_this.showPdfView = function (uid, url, name) {
|
|
163
|
+
_this.setState({ pdfViewFlag: true, fileId: uid, fileURL: url, fileName: name });
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
_this.hidePDFModal = function () {
|
|
167
|
+
_this.setState({ fileId: '', fileURL: '', fileName: '', pdfViewFlag: false });
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
_this.showImageView = function (url) {
|
|
171
|
+
_this.setState({ imageViewURL: url });
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
_this.hideImageView = function () {
|
|
175
|
+
_this.setState({ imageViewURL: '' });
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
_this.state = {
|
|
179
|
+
pdfViewFlag: false, // pdf预览
|
|
180
|
+
fileViewFlag: false, // xls、xlsx、doc、docx等office文件预览
|
|
181
|
+
fileId: '', // 文件id
|
|
182
|
+
fileName: '', // 文件名称
|
|
183
|
+
fileURL: '', // 文件url
|
|
184
|
+
imageViewURL: '' // 图片预览url
|
|
185
|
+
};
|
|
186
|
+
return _this;
|
|
187
|
+
}
|
|
188
|
+
// 预览
|
|
189
|
+
|
|
190
|
+
// 下载
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
Easy3wDownLoad.prototype.render = function render() {
|
|
194
|
+
var _this2 = this;
|
|
195
|
+
|
|
196
|
+
var _props = this.props,
|
|
197
|
+
urlDownloadFile = _props.urlDownloadFile,
|
|
198
|
+
downloadArr = _props.downloadArr,
|
|
199
|
+
previwPdfFlag = _props.previwPdfFlag,
|
|
200
|
+
fileViewFlag = _props.fileViewFlag,
|
|
201
|
+
apiKey = _props.apiKey,
|
|
202
|
+
fileViewURL = _props.fileViewURL,
|
|
203
|
+
fileCallURL = _props.fileCallURL;
|
|
204
|
+
|
|
205
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, objPreviewFileDefault, _comonConfig.objPreviewFile, this.props.objPreviewFile);
|
|
206
|
+
var previewFileFlag = objPreviewFileNew.previewFileFlag,
|
|
207
|
+
downloadFileFlag = objPreviewFileNew.downloadFileFlag,
|
|
208
|
+
previewFileType = objPreviewFileNew.previewFileType;
|
|
209
|
+
|
|
210
|
+
var retObj = '';
|
|
211
|
+
if (downloadArr) {
|
|
212
|
+
retObj = downloadArr.map(function (obj) {
|
|
213
|
+
var uid = obj.uid,
|
|
214
|
+
name = obj.name;
|
|
215
|
+
|
|
216
|
+
var url = _this2.urlDeal(urlDownloadFile, uid);
|
|
217
|
+
var fileNameArr = name.toLowerCase().split('.');
|
|
218
|
+
var fileType = fileNameArr[fileNameArr.length - 1];
|
|
219
|
+
if (previewFileFlag && fileViewFlag !== false && fileType.indexOf('png') < 0 && fileType.indexOf('jpg') < 0 && fileType.indexOf('jpeg') < 0) {
|
|
220
|
+
// 预览
|
|
221
|
+
return _react2['default'].createElement(
|
|
222
|
+
'div',
|
|
223
|
+
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
224
|
+
_react2['default'].createElement(
|
|
225
|
+
_tooltip2['default'],
|
|
226
|
+
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
227
|
+
_react2['default'].createElement(
|
|
228
|
+
'a',
|
|
229
|
+
{ onClick: function onClick() {
|
|
230
|
+
return _this2.onPreview(obj, url);
|
|
231
|
+
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
232
|
+
name
|
|
233
|
+
)
|
|
234
|
+
),
|
|
235
|
+
downloadFileFlag === '1' ? _react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
236
|
+
return _this2.touchDownload(obj, url);
|
|
237
|
+
}, style: { float: 'right', lineHeight: '100%' } }) : downloadFileFlag === '0' ? '' : previewFileType.indexOf(fileType) >= 0 ? '' : _react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
238
|
+
return _this2.touchDownload(obj, url);
|
|
239
|
+
}, style: { float: 'right', lineHeight: '100%' } })
|
|
240
|
+
);
|
|
241
|
+
} else if (previwPdfFlag && fileType.indexOf('pdf') >= 0) {
|
|
242
|
+
return _react2['default'].createElement(
|
|
243
|
+
'div',
|
|
244
|
+
null,
|
|
245
|
+
_react2['default'].createElement(
|
|
246
|
+
'a',
|
|
247
|
+
{ onClick: function onClick() {
|
|
248
|
+
return _this2.showPdfView(uid, url, name);
|
|
249
|
+
} },
|
|
250
|
+
name
|
|
251
|
+
)
|
|
252
|
+
);
|
|
253
|
+
} else if (fileType && fileViewFlag && (fileType.indexOf('doc') >= 0 || fileType.indexOf('docx') >= 0 || fileType.indexOf('xls') >= 0 || fileType.indexOf('xlsx') >= 0 || fileType.indexOf('txt') >= 0)) {
|
|
254
|
+
return _react2['default'].createElement(
|
|
255
|
+
'div',
|
|
256
|
+
null,
|
|
257
|
+
_react2['default'].createElement(
|
|
258
|
+
'a',
|
|
259
|
+
{ onClick: function onClick() {
|
|
260
|
+
return _this2.showFileView(uid, name, apiKey, fileViewURL, fileCallURL);
|
|
261
|
+
} },
|
|
262
|
+
name
|
|
263
|
+
)
|
|
264
|
+
);
|
|
265
|
+
} else if (fileType && (fileType.indexOf('png') >= 0 || fileType.indexOf('jpg') >= 0 || fileType.indexOf('jpeg') >= 0)) {
|
|
266
|
+
return _react2['default'].createElement(
|
|
267
|
+
'div',
|
|
268
|
+
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
269
|
+
_react2['default'].createElement(
|
|
270
|
+
'a',
|
|
271
|
+
{ onClick: function onClick() {
|
|
272
|
+
return _this2.showImageView(url);
|
|
273
|
+
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
274
|
+
name
|
|
275
|
+
),
|
|
276
|
+
_react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
277
|
+
return _this2.touchDownload(obj, url);
|
|
278
|
+
}, style: { float: 'right', lineHeight: '100%' } })
|
|
279
|
+
);
|
|
280
|
+
} else {
|
|
281
|
+
return _react2['default'].createElement(
|
|
282
|
+
'div',
|
|
283
|
+
null,
|
|
284
|
+
_react2['default'].createElement(
|
|
285
|
+
_tooltip2['default'],
|
|
286
|
+
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
287
|
+
_react2['default'].createElement(
|
|
288
|
+
'a',
|
|
289
|
+
{ href: url },
|
|
290
|
+
name
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
var viewPDFObj = _react2['default'].createElement(_Easy3wPDFView2['default'], {
|
|
298
|
+
fileId: this.state.fileId,
|
|
299
|
+
fileName: this.state.fileName,
|
|
300
|
+
fileURL: this.state.fileURL,
|
|
301
|
+
visible: this.state.pdfViewFlag,
|
|
302
|
+
hideModal: this.hidePDFModal
|
|
303
|
+
});
|
|
304
|
+
var viewFileObj = _react2['default'].createElement(_Easy3wFileView2['default'], {
|
|
305
|
+
fileId: this.state.fileId,
|
|
306
|
+
fileName: this.state.fileName,
|
|
307
|
+
fileURL: this.state.fileURL,
|
|
308
|
+
visible: this.state.fileViewFlag,
|
|
309
|
+
hideModal: this.hideFileModal,
|
|
310
|
+
viewFileUrl: this.state.viewFileUrl
|
|
311
|
+
});
|
|
312
|
+
var viewImgObj = _react2['default'].createElement(_Easy3wRCView2['default'], { imgUrl: this.state.imageViewURL, hideModal: this.hideImageView });
|
|
313
|
+
return _react2['default'].createElement(
|
|
314
|
+
'div',
|
|
315
|
+
null,
|
|
316
|
+
retObj,
|
|
317
|
+
viewPDFObj,
|
|
318
|
+
viewFileObj,
|
|
319
|
+
viewImgObj
|
|
320
|
+
);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
return Easy3wDownLoad;
|
|
324
|
+
}(_react.Component);
|
|
325
|
+
|
|
326
|
+
Easy3wDownLoad.propTypes = {
|
|
327
|
+
urlDownloadFile: _propTypes2['default'].string
|
|
328
|
+
};
|
|
329
|
+
Easy3wDownLoad.defaultProps = {
|
|
330
|
+
urlDownloadFile: ''
|
|
331
|
+
};
|
|
332
|
+
exports['default'] = Easy3wDownLoad;
|
|
333
|
+
module.exports = exports['default'];
|
|
@@ -86,7 +86,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
86
86
|
|
|
87
87
|
var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
|
|
88
88
|
|
|
89
|
-
_this.onPreview = function (file, url) {
|
|
89
|
+
_this.onPreview = function (e, file, url) {
|
|
90
|
+
e.preventDefault();
|
|
90
91
|
var objPreviewFileNew = (0, _extends3['default'])({}, objPreviewFileDefault, _comonConfig.objPreviewFile, _this.props.objPreviewFile);
|
|
91
92
|
var previewFileUrl = objPreviewFileNew.previewFileUrl,
|
|
92
93
|
previewFileType = objPreviewFileNew.previewFileType;
|
|
@@ -144,7 +145,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
144
145
|
}
|
|
145
146
|
};
|
|
146
147
|
|
|
147
|
-
_this.showFileView = function (uid, name, apiKey, fileViewURL, fileCallURL) {
|
|
148
|
+
_this.showFileView = function (e, uid, name, apiKey, fileViewURL, fileCallURL) {
|
|
149
|
+
e.preventDefault();
|
|
148
150
|
var callURl = fileCallURL + '?fileId=' + uid;
|
|
149
151
|
var crypto = require('crypto');
|
|
150
152
|
var hmac = crypto.createHmac('md5', apiKey);
|
|
@@ -159,7 +161,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
159
161
|
_this.setState({ fileId: '', fileURL: '', fileName: '', fileViewFlag: false });
|
|
160
162
|
};
|
|
161
163
|
|
|
162
|
-
_this.showPdfView = function (uid, url, name) {
|
|
164
|
+
_this.showPdfView = function (e, uid, url, name) {
|
|
165
|
+
e.preventDefault();
|
|
163
166
|
_this.setState({ pdfViewFlag: true, fileId: uid, fileURL: url, fileName: name });
|
|
164
167
|
};
|
|
165
168
|
|
|
@@ -167,7 +170,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
167
170
|
_this.setState({ fileId: '', fileURL: '', fileName: '', pdfViewFlag: false });
|
|
168
171
|
};
|
|
169
172
|
|
|
170
|
-
_this.showImageView = function (url) {
|
|
173
|
+
_this.showImageView = function (e, url) {
|
|
174
|
+
e.preventDefault();
|
|
171
175
|
_this.setState({ imageViewURL: url });
|
|
172
176
|
};
|
|
173
177
|
|
|
@@ -204,7 +208,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
204
208
|
|
|
205
209
|
var objPreviewFileNew = (0, _extends3['default'])({}, objPreviewFileDefault, _comonConfig.objPreviewFile, this.props.objPreviewFile);
|
|
206
210
|
var previewFileFlag = objPreviewFileNew.previewFileFlag,
|
|
207
|
-
|
|
211
|
+
_objPreviewFileNew$do = objPreviewFileNew.downloadFileFlag,
|
|
212
|
+
downloadFileFlag = _objPreviewFileNew$do === undefined ? '1' : _objPreviewFileNew$do,
|
|
208
213
|
previewFileType = objPreviewFileNew.previewFileType;
|
|
209
214
|
|
|
210
215
|
var retObj = '';
|
|
@@ -226,8 +231,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
226
231
|
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
227
232
|
_react2['default'].createElement(
|
|
228
233
|
'a',
|
|
229
|
-
{ onClick: function onClick() {
|
|
230
|
-
return _this2.onPreview(obj, url);
|
|
234
|
+
{ href: url, onClick: function onClick(e) {
|
|
235
|
+
return _this2.onPreview(e, obj, url);
|
|
231
236
|
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
232
237
|
name
|
|
233
238
|
)
|
|
@@ -244,8 +249,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
244
249
|
null,
|
|
245
250
|
_react2['default'].createElement(
|
|
246
251
|
'a',
|
|
247
|
-
{ onClick: function onClick() {
|
|
248
|
-
return _this2.showPdfView(uid, url, name);
|
|
252
|
+
{ href: url, onClick: function onClick(e) {
|
|
253
|
+
return _this2.showPdfView(e, uid, url, name);
|
|
249
254
|
} },
|
|
250
255
|
name
|
|
251
256
|
)
|
|
@@ -256,8 +261,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
256
261
|
null,
|
|
257
262
|
_react2['default'].createElement(
|
|
258
263
|
'a',
|
|
259
|
-
{ onClick: function onClick() {
|
|
260
|
-
return _this2.showFileView(uid, name, apiKey, fileViewURL, fileCallURL);
|
|
264
|
+
{ href: url, onClick: function onClick(e) {
|
|
265
|
+
return _this2.showFileView(e, uid, name, apiKey, fileViewURL, fileCallURL);
|
|
261
266
|
} },
|
|
262
267
|
name
|
|
263
268
|
)
|
|
@@ -268,8 +273,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
268
273
|
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
269
274
|
_react2['default'].createElement(
|
|
270
275
|
'a',
|
|
271
|
-
{ onClick: function onClick() {
|
|
272
|
-
return _this2.showImageView(url);
|
|
276
|
+
{ href: url, onClick: function onClick(e) {
|
|
277
|
+
return _this2.showImageView(e, url);
|
|
273
278
|
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
274
279
|
name
|
|
275
280
|
),
|