easy3wui 4.0.34 → 4.0.35

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.
@@ -68,7 +68,8 @@ var Easy3wDownLoad = function (_Component) {
68
68
 
69
69
  var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
70
70
 
71
- _this.onPreview = function (file, url) {
71
+ _this.onPreview = function (e, file, url) {
72
+ e.preventDefault();
72
73
  var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, _this.props.objPreviewFile);
73
74
  var previewFileUrl = objPreviewFileNew.previewFileUrl,
74
75
  previewFileType = objPreviewFileNew.previewFileType;
@@ -115,7 +116,8 @@ var Easy3wDownLoad = function (_Component) {
115
116
  }
116
117
  };
117
118
 
118
- _this.showFileView = function (uid, name, apiKey, fileViewURL, fileCallURL) {
119
+ _this.showFileView = function (e, uid, name, apiKey, fileViewURL, fileCallURL) {
120
+ e.preventDefault();
119
121
  var callURl = fileCallURL + '?fileId=' + uid;
120
122
  var crypto = require('crypto');
121
123
  var hmac = crypto.createHmac('md5', apiKey);
@@ -126,6 +128,11 @@ var Easy3wDownLoad = function (_Component) {
126
128
  _this.setState({ fileId: uid, fileName: name, fileViewFlag: true, viewFileUrl: viewFileUrl });
127
129
  };
128
130
 
131
+ _this.showPdfView = function (e, uid, url, name) {
132
+ e.preventDefault();
133
+ _this.setState({ pdfViewFlag: true, fileId: uid, fileURL: url, fileName: name });
134
+ };
135
+
129
136
  _this.hidePDFModal = function () {
130
137
  _this.setState({ fileId: '', fileURL: '', fileName: '', pdfViewFlag: false });
131
138
  };
@@ -138,7 +145,8 @@ var Easy3wDownLoad = function (_Component) {
138
145
  _this.setState({ fileId: '', fileURL: '', fileName: '' });
139
146
  };
140
147
 
141
- _this.showImageView = function (url) {
148
+ _this.showImageView = function (e, url) {
149
+ e.preventDefault();
142
150
  _this.setState({ imageViewURL: url });
143
151
  };
144
152
 
@@ -158,6 +166,12 @@ var Easy3wDownLoad = function (_Component) {
158
166
 
159
167
  // url处理
160
168
 
169
+ // 显示文件预览
170
+
171
+ // 显示pdf预览
172
+
173
+ // 图片预览
174
+
161
175
 
162
176
  Easy3wDownLoad.prototype.render = function render() {
163
177
  var _this2 = this;
@@ -173,7 +187,8 @@ var Easy3wDownLoad = function (_Component) {
173
187
 
174
188
  var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, this.props.objPreviewFile);
175
189
  var previewFileFlag = objPreviewFileNew.previewFileFlag,
176
- downloadFileFlag = objPreviewFileNew.downloadFileFlag,
190
+ _objPreviewFileNew$do = objPreviewFileNew.downloadFileFlag,
191
+ downloadFileFlag = _objPreviewFileNew$do === undefined ? '' : _objPreviewFileNew$do,
177
192
  previewFileType = objPreviewFileNew.previewFileType;
178
193
 
179
194
  var retObj = '';
@@ -196,8 +211,8 @@ var Easy3wDownLoad = function (_Component) {
196
211
  { placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
197
212
  _react2['default'].createElement(
198
213
  'a',
199
- { onClick: function onClick() {
200
- return _this2.onPreview(obj, url);
214
+ { href: url, onClick: function onClick(e) {
215
+ return _this2.onPreview(e, obj, url);
201
216
  }, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
202
217
  name
203
218
  )
@@ -214,8 +229,8 @@ var Easy3wDownLoad = function (_Component) {
214
229
  null,
215
230
  _react2['default'].createElement(
216
231
  'a',
217
- { onClick: function onClick() {
218
- return _this2.setState({ pdfViewFlag: true, fileId: uid, fileURL: url, fileName: name });
232
+ { href: url, onClick: function onClick(e) {
233
+ return _this2.showPdfView(e, uid, url, name);
219
234
  } },
220
235
  name
221
236
  )
@@ -226,8 +241,8 @@ var Easy3wDownLoad = function (_Component) {
226
241
  null,
227
242
  _react2['default'].createElement(
228
243
  'a',
229
- { onClick: function onClick() {
230
- return _this2.showFileView(uid, name, apiKey, fileViewURL, fileCallURL);
244
+ { href: url, onClick: function onClick(e) {
245
+ return _this2.showFileView(e, uid, name, apiKey, fileViewURL, fileCallURL);
231
246
  } },
232
247
  name
233
248
  )
@@ -238,8 +253,8 @@ var Easy3wDownLoad = function (_Component) {
238
253
  { style: { width: '100%', display: 'flex', alignItems: 'center' } },
239
254
  _react2['default'].createElement(
240
255
  'a',
241
- { onClick: function onClick() {
242
- return _this2.showImageView(url);
256
+ { href: url, onClick: function onClick(e) {
257
+ return _this2.showImageView(e, url);
243
258
  }, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
244
259
  name
245
260
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "4.0.34",
3
+ "version": "4.0.35",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",