easy3wui 1.5.14 → 1.5.17
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/Easy3wDownLoad/index.js +27 -11
- package/lib/Easy3wFormPage/index.js +20 -1
- package/package.json +1 -1
|
@@ -125,9 +125,8 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
125
125
|
_this.setState({ imageViewURL: '' });
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
_this.onPreview = function (file) {
|
|
128
|
+
_this.onPreview = function (file, url) {
|
|
129
129
|
var uid = file.uid,
|
|
130
|
-
url = file.url,
|
|
131
130
|
name = file.name;
|
|
132
131
|
|
|
133
132
|
var fileNameArr = name.toLowerCase().split('.');
|
|
@@ -136,17 +135,34 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
136
135
|
var src = _this.urlDeal(previewFileUrl, uid);
|
|
137
136
|
window.open(src, '_blank');
|
|
138
137
|
} else {
|
|
139
|
-
window.open(url);
|
|
138
|
+
// window.open(url);
|
|
139
|
+
var _a = document.createElement('a');
|
|
140
|
+
_a.setAttribute('href', url);
|
|
141
|
+
_a.setAttribute('target', '_blank');
|
|
142
|
+
_a.setAttribute('id', 'downReportFile');
|
|
143
|
+
document.body.appendChild(_a);
|
|
144
|
+
if (!document.getElementById('downReportFile')) {
|
|
145
|
+
document.body.appendChild(_a);
|
|
146
|
+
}
|
|
147
|
+
_a.click();
|
|
140
148
|
}
|
|
141
149
|
};
|
|
142
150
|
|
|
143
|
-
_this.touchDownload = function (file) {
|
|
151
|
+
_this.touchDownload = function (file, url) {
|
|
144
152
|
var uid = file.uid,
|
|
145
|
-
url = file.url,
|
|
146
153
|
name = file.name;
|
|
147
154
|
// const src = this.urlDeal(previewFileUrl, uid);
|
|
148
|
-
|
|
149
|
-
|
|
155
|
+
// window.open(url);
|
|
156
|
+
|
|
157
|
+
var a = document.createElement('a');
|
|
158
|
+
a.setAttribute('href', url);
|
|
159
|
+
a.setAttribute('target', '_blank');
|
|
160
|
+
a.setAttribute('id', 'downReportFile');
|
|
161
|
+
document.body.appendChild(a);
|
|
162
|
+
if (!document.getElementById('downReportFile')) {
|
|
163
|
+
document.body.appendChild(a);
|
|
164
|
+
}
|
|
165
|
+
a.click();
|
|
150
166
|
};
|
|
151
167
|
|
|
152
168
|
_this.state = {
|
|
@@ -189,20 +205,20 @@ var Easy3wDownLoad = function (_Component) {
|
|
|
189
205
|
// 预览
|
|
190
206
|
return _react2['default'].createElement(
|
|
191
207
|
'div',
|
|
192
|
-
{ style: { width: '100%', display: 'flex', alignItems: 'center'
|
|
208
|
+
{ style: { width: '100%', display: 'flex', alignItems: 'center' } },
|
|
193
209
|
_react2['default'].createElement(
|
|
194
210
|
_tooltip2['default'],
|
|
195
211
|
{ placement: 'topLeft', title: name, style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' } },
|
|
196
212
|
_react2['default'].createElement(
|
|
197
213
|
'a',
|
|
198
214
|
{ onClick: function onClick() {
|
|
199
|
-
return _this2.onPreview(obj);
|
|
200
|
-
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } },
|
|
215
|
+
return _this2.onPreview(obj, url);
|
|
216
|
+
}, style: { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', paddingRight: '12px' } },
|
|
201
217
|
name
|
|
202
218
|
)
|
|
203
219
|
),
|
|
204
220
|
_react2['default'].createElement(_icon2['default'], { type: 'download', onClick: function onClick() {
|
|
205
|
-
return _this2.touchDownload(obj);
|
|
221
|
+
return _this2.touchDownload(obj, url);
|
|
206
222
|
}, style: { float: 'right', lineHeight: '100%' } })
|
|
207
223
|
);
|
|
208
224
|
} else if (previwPdfFlag && fileType.indexOf('pdf') >= 0) {
|
|
@@ -1205,6 +1205,7 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1205
1205
|
|
|
1206
1206
|
return _react2['default'].createElement(_inputNumber2['default'], cmptPros);
|
|
1207
1207
|
}, _this.inputNumberFormatHandler = function (item, formItemLayout) {
|
|
1208
|
+
var allReadFlag = _this.props.allReadFlag;
|
|
1208
1209
|
var getFieldDecorator = _this.props.form.getFieldDecorator;
|
|
1209
1210
|
var cmptPros = item.cmptPros,
|
|
1210
1211
|
label = item.label,
|
|
@@ -1213,7 +1214,8 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1213
1214
|
required = item.required,
|
|
1214
1215
|
value = item.value,
|
|
1215
1216
|
disableFlag = item.disableFlag,
|
|
1216
|
-
formItemProps = item.formItemProps
|
|
1217
|
+
formItemProps = item.formItemProps,
|
|
1218
|
+
readFlag = item.readFlag;
|
|
1217
1219
|
|
|
1218
1220
|
var addrules = [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }];
|
|
1219
1221
|
if (cmptPros && cmptPros.rules) {
|
|
@@ -1222,6 +1224,23 @@ var Easy3wFormPage = function (_Component) {
|
|
|
1222
1224
|
addrules.push.apply(addrules, rules);
|
|
1223
1225
|
}
|
|
1224
1226
|
var afterBtns = _this.getAfterBtn(item);
|
|
1227
|
+
if (readFlag || allReadFlag) {
|
|
1228
|
+
return _react2['default'].createElement(
|
|
1229
|
+
FormItem,
|
|
1230
|
+
(0, _extends3['default'])({
|
|
1231
|
+
label: label
|
|
1232
|
+
}, formItemLayout, formItemProps, {
|
|
1233
|
+
style: formItemStyle
|
|
1234
|
+
}),
|
|
1235
|
+
getFieldDecorator(fieldId + 'Easy3wView', {
|
|
1236
|
+
initialValue: 'easy3wView',
|
|
1237
|
+
rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }]
|
|
1238
|
+
})(_react2['default'].createElement(_input2['default'], { type: 'hidden' })),
|
|
1239
|
+
value,
|
|
1240
|
+
' ',
|
|
1241
|
+
afterBtns
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1225
1244
|
return _react2['default'].createElement(
|
|
1226
1245
|
FormItem,
|
|
1227
1246
|
(0, _extends3['default'])({
|