dtable-ui-component 5.3.8 → 5.3.9-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.
|
@@ -88,7 +88,8 @@ class ImageThumbnail extends _react.default.Component {
|
|
|
88
88
|
index,
|
|
89
89
|
downloadImage,
|
|
90
90
|
src,
|
|
91
|
-
className
|
|
91
|
+
className,
|
|
92
|
+
name
|
|
92
93
|
} = this.props;
|
|
93
94
|
const {
|
|
94
95
|
imageThumbnailUrl
|
|
@@ -130,7 +131,7 @@ class ImageThumbnail extends _react.default.Component {
|
|
|
130
131
|
hide: 0
|
|
131
132
|
},
|
|
132
133
|
fade: false
|
|
133
|
-
}, (0, _url.getFileName)(src)));
|
|
134
|
+
}, name || (0, _url.getFileName)(src)));
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
var _default = exports.default = ImageThumbnail;
|
|
@@ -113,10 +113,11 @@ class RowExpandFileEditor extends _react.default.Component {
|
|
|
113
113
|
fileArr = value.map((file, index) => {
|
|
114
114
|
const {
|
|
115
115
|
fileIconUrl
|
|
116
|
-
} = (0, _url.getFileThumbnailInfo)(file
|
|
116
|
+
} = (0, _url.getFileThumbnailInfo)(file);
|
|
117
117
|
return /*#__PURE__*/_react.default.createElement(_ImageThumbnail.default, {
|
|
118
118
|
key: 'file-' + index,
|
|
119
119
|
src: fileIconUrl,
|
|
120
|
+
name: file.name,
|
|
120
121
|
index: index,
|
|
121
122
|
config: config,
|
|
122
123
|
deleteTip: (0, _lang.getLocale)('Are_you_sure_you_want_to_delete_this_file'),
|
package/lib/utils/url.js
CHANGED
|
@@ -124,8 +124,13 @@ const getImageThumbnailUrl = function (url) {
|
|
|
124
124
|
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
125
125
|
const getFileName = url => {
|
|
126
126
|
if (!url) return null;
|
|
127
|
-
let
|
|
128
|
-
|
|
127
|
+
let validUrl = url;
|
|
128
|
+
let qIndex = url.indexOf('/?');
|
|
129
|
+
if (qIndex !== -1) {
|
|
130
|
+
validUrl = validUrl.slice(0, qIndex);
|
|
131
|
+
}
|
|
132
|
+
const lastIndex = validUrl.lastIndexOf('/');
|
|
133
|
+
return url.slice(lastIndex + 1, qIndex);
|
|
129
134
|
};
|
|
130
135
|
exports.getFileName = getFileName;
|
|
131
136
|
const imageCheck = filename => {
|
|
@@ -189,7 +194,7 @@ const getFileThumbnailInfo = function (file) {
|
|
|
189
194
|
fileIconUrl: defaultIconUrl['192']
|
|
190
195
|
};
|
|
191
196
|
const isImage = imageCheck(file.name);
|
|
192
|
-
if (isImage) return {
|
|
197
|
+
if (isImage && server) return {
|
|
193
198
|
isImage,
|
|
194
199
|
fileIconUrl: getImageThumbnailUrl(file.url, {
|
|
195
200
|
server
|