|
@@ -28,7 +28,7 @@
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { LeftPano } from "@/layout";
|
|
import { LeftPano } from "@/layout";
|
|
import { computed, ref } from "vue";
|
|
import { computed, ref } from "vue";
|
|
-import { getUrlType, MetaType } from "@/utils";
|
|
|
|
|
|
+import { getUrlType, MetaType, saveAs } from "@/utils";
|
|
import { Preview, MediaItem, MediaType } from "@/components/static-preview/index.vue";
|
|
import { Preview, MediaItem, MediaType } from "@/components/static-preview/index.vue";
|
|
import { floderTypes, getFloderByType } from "@/store";
|
|
import { floderTypes, getFloderByType } from "@/store";
|
|
|
|
|
|
@@ -55,7 +55,7 @@ const typeIcons = {
|
|
};
|
|
};
|
|
|
|
|
|
const currentFile = ref<MediaItem | null>(null);
|
|
const currentFile = ref<MediaItem | null>(null);
|
|
-const preview = (floder: Floder) => {
|
|
|
|
|
|
+const preview = async (floder: Floder) => {
|
|
const ext = floder.filesUrl
|
|
const ext = floder.filesUrl
|
|
.substring(floder.filesUrl.lastIndexOf("."))
|
|
.substring(floder.filesUrl.lastIndexOf("."))
|
|
.toLocaleLowerCase();
|
|
.toLocaleLowerCase();
|
|
@@ -76,7 +76,13 @@ const preview = (floder: Floder) => {
|
|
: null;
|
|
: null;
|
|
|
|
|
|
if (!mediaType) {
|
|
if (!mediaType) {
|
|
- window.open(floder.filesUrl + "?time=" + Date.now());
|
|
|
|
|
|
+ const isBlob = floder.filesUrl.includes("blob");
|
|
|
|
+
|
|
|
|
+ if (floder.filesTypeId === 100) {
|
|
|
|
+ saveAs(floder.filesUrl, floder.filesTitle + ".doc");
|
|
|
|
+ } else {
|
|
|
|
+ window.open(floder.filesUrl + (!isBlob ? "?time=" + Date.now() : ""));
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
currentFile.value = {
|
|
currentFile.value = {
|
|
type: mediaType,
|
|
type: mediaType,
|