🐛 Fix some of the operation functions in the search list cannot be used #112

This commit is contained in:
Aicirou 2020-08-21 22:33:20 +08:00
parent 25abb9d605
commit 398483e864

View File

@ -261,7 +261,7 @@ export default {
inited(viewer) { inited(viewer) {
this.$viewer = viewer; this.$viewer = viewer;
}, },
action(file, target) { action(file, target, isSearch = true) {
// If it is a shortcut, the prompt cannot be downloaded // If it is a shortcut, the prompt cannot be downloaded
if (file.mimeType === "application/vnd.google-apps.shortcut") { if (file.mimeType === "application/vnd.google-apps.shortcut") {
this.$notify({ this.$notify({
@ -271,6 +271,13 @@ export default {
}); });
return; return;
} }
let cmd = this.$route.params.cmd;
if (cmd && cmd === "search" && isSearch) {
this.goSearchResult(file, target);
return;
}
if (file.mimeType.startsWith("image/") && target === "view") { if (file.mimeType.startsWith("image/") && target === "view") {
this.viewer = true; this.viewer = true;
this.$nextTick(() => { this.$nextTick(() => {
@ -281,7 +288,7 @@ export default {
} }
if ( if (
file.mimeType.startsWith("audio/") && file.mimeType.startsWith("audio/") &&
file.mimeType !== "audio/mpegurl" && file.mimeType.indexOf("mpegurl")==-1 &&
target === "view" target === "view"
) { ) {
if (window.aplayer) { if (window.aplayer) {
@ -297,11 +304,6 @@ export default {
} }
return; return;
} }
let cmd = this.$route.params.cmd;
if (cmd && cmd === "search") {
this.goSearchResult(file, target);
return;
}
this.target(file, target); this.target(file, target);
}, },
target(file, target) { target(file, target) {
@ -365,7 +367,7 @@ export default {
let data = res.data; let data = res.data;
if (data) { if (data) {
file.path = `/${id}:${data}`; file.path = `/${id}:${data}`;
this.target(file, target); this.action(file, target, false);
} }
}) })
.catch((e) => { .catch((e) => {