|
@@ -144,11 +144,16 @@ const TypeFilter = (url) => {
|
|
|
const fileType = url.substring(url.lastIndexOf(".")).toLowerCase();
|
|
|
return fileType;
|
|
|
}
|
|
|
+ const verifySuffix = (imageName) => {
|
|
|
+ const suffix = `(bmp|jpg|png|tif|gif|pcx|tga|exif|fpx|svg|psd|cdr|pcd|dxf|ufo|eps|ai|raw|WMF|webp|jpeg)`
|
|
|
+ const regular = new RegExp(`.*\.${suffix}`)
|
|
|
+ return regular.test(imageName)
|
|
|
+}
|
|
|
watchEffect(() => {
|
|
|
if (props.list.length) {
|
|
|
console.log(props.list, "watchEffect");
|
|
|
let newlist = props.list.map(item => item.filesUrl || item.fileUrl);
|
|
|
- initFileList.value = newlist.filter(item => item.type == 1);
|
|
|
+ initFileList.value = newlist.filter(item => verifySuffix(item.filesUrl));
|
|
|
}
|
|
|
});
|
|
|
|