Merge pull request #246 from jamebal/search

perf: 优化iframe预览,不区分大小写;预览背景不透明
This commit is contained in:
jmal 2024-07-30 14:07:29 +08:00 committed by GitHub
commit 5dbe8c693d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -4358,13 +4358,16 @@ export default {
return this.notPreviewDialogVisible;
},
hasIframePreview(suffix, fileHandlers) {
// 将 suffix 转换为小写
const lowerCaseSuffix = suffix.toLowerCase();
for (let key in fileHandlers) {
const extensions = key.split(',')
if (extensions.includes(suffix)) {
return fileHandlers[key]
// 将 key 中的扩展名全部转换为小写
const extensions = key.split(',').map(extension => extension.toLowerCase());
if (extensions.includes(lowerCaseSuffix)) {
return fileHandlers[key];
}
}
return null
return null;
},
determineDownload(file) {
this.download(file)

View File

@ -13,7 +13,7 @@
:value="item.value">
</el-option>
</el-select>
<el-button size="medium" type="primary" @click="openUrl"><svg-icon icon-class="wailian"/></el-button>
<el-button title="外部打开" size="medium" type="primary" @click="openUrl"><svg-icon icon-class="wailian"/></el-button>
</div>
</div>
</div>
@ -153,6 +153,7 @@ export default {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
background: #dcdfe6;
iframe {
width: 100%;
height: 100%;