ow
This commit is contained in:
1 parent
ef688db767
commit
3759fcc14a
8 files changed
+338
-263
No files matched your search
@@ -101,15 +101,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
ref,
|
||||
unref,
|
||||
h,
|
||||
provide,
|
||||
} from "vue";
|
||||
import { reactive, onMounted, onUnmounted, ref, unref, h, provide } from "vue";
|
||||
import { BindOption } from "@/data/custom/bindOption";
|
||||
import { SelectOption } from "@/data/auto/selectOption";
|
||||
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
|
||||
@@ -245,9 +237,8 @@ const shareEnquiry = ref<ShareEnquiry | null>(null);
|
||||
|
||||
const sound = ref();
|
||||
|
||||
const toUploadView = (
|
||||
r: Record<string, any>,
|
||||
): DmsFileUploadViewDisplayData => r as DmsFileUploadViewDisplayData;
|
||||
const toUploadView = (r: Record<string, any>): DmsFileUploadViewDisplayData =>
|
||||
r as DmsFileUploadViewDisplayData;
|
||||
|
||||
onUnmounted(() => {
|
||||
sound.value?.stop();
|
||||
@@ -340,9 +331,7 @@ onMounted(async () => {
|
||||
|
||||
await initBindOption();
|
||||
|
||||
pathStack.value = [
|
||||
{ value: rootPath.value, displayName: "我的云盘" },
|
||||
];
|
||||
pathStack.value = [{ value: rootPath.value, displayName: "我的云盘" }];
|
||||
|
||||
onSearchByFilePath(rootPath.value);
|
||||
});
|
||||
@@ -421,11 +410,15 @@ const uploadChunk = async (
|
||||
}
|
||||
};
|
||||
|
||||
const CHUNK_SIZE = 1024 * 1024;
|
||||
const CHUNK_SIZE = 100 * 1024 * 1024;
|
||||
|
||||
const splitFile = (file: any) => {
|
||||
const chunks: Blob[] = [];
|
||||
if (!file || typeof file.size !== "number" || typeof file.slice !== "function") {
|
||||
if (
|
||||
!file ||
|
||||
typeof file.size !== "number" ||
|
||||
typeof file.slice !== "function"
|
||||
) {
|
||||
return chunks;
|
||||
}
|
||||
let start = 0;
|
||||
@@ -489,10 +482,7 @@ const onVideoPlay = async (fid: number) => {
|
||||
});
|
||||
};
|
||||
|
||||
const onPreviewFile = async (
|
||||
usernameOrRecord: any,
|
||||
orderKey?: string,
|
||||
) => {
|
||||
const onPreviewFile = async (usernameOrRecord: any, orderKey?: string) => {
|
||||
let username: string;
|
||||
let fname: string;
|
||||
if (typeof usernameOrRecord === "object") {
|
||||
@@ -506,10 +496,7 @@ const onPreviewFile = async (
|
||||
getPreviewFile(username, fname);
|
||||
};
|
||||
|
||||
const onPreviewOrgFile = async (
|
||||
usernameOrRecord: any,
|
||||
orderKey?: string,
|
||||
) => {
|
||||
const onPreviewOrgFile = async (usernameOrRecord: any, orderKey?: string) => {
|
||||
let fileId: number;
|
||||
let orgFileName: string;
|
||||
if (typeof usernameOrRecord === "object") {
|
||||
@@ -1128,11 +1115,20 @@ const onShareSelected = (items: DmsFileUploadViewDisplayData[]) => {
|
||||
const onPublishSelected = (items: DmsFileUploadViewDisplayData[]) => {
|
||||
if (items.length === 0) return;
|
||||
const first = items[0];
|
||||
if (fileTypePolicy.isImage(first.OrderKey) || fileTypePolicy.isImage(first.OrgFileName)) {
|
||||
if (
|
||||
fileTypePolicy.isImage(first.OrderKey) ||
|
||||
fileTypePolicy.isImage(first.OrgFileName)
|
||||
) {
|
||||
onPublishPhoto();
|
||||
} else if (fileTypePolicy.isVideo(first.OrderKey) || fileTypePolicy.isVideo(first.OrgFileName)) {
|
||||
} else if (
|
||||
fileTypePolicy.isVideo(first.OrderKey) ||
|
||||
fileTypePolicy.isVideo(first.OrgFileName)
|
||||
) {
|
||||
onPublishVideo();
|
||||
} else if (fileTypePolicy.isAudio(first.OrderKey) || fileTypePolicy.isAudio(first.OrgFileName)) {
|
||||
} else if (
|
||||
fileTypePolicy.isAudio(first.OrderKey) ||
|
||||
fileTypePolicy.isAudio(first.OrgFileName)
|
||||
) {
|
||||
onPublishAudio();
|
||||
}
|
||||
};
|
||||
@@ -1140,11 +1136,20 @@ const onPublishSelected = (items: DmsFileUploadViewDisplayData[]) => {
|
||||
const onViewPreviewSelected = (items: DmsFileUploadViewDisplayData[]) => {
|
||||
if (items.length === 0) return;
|
||||
const first = items[0];
|
||||
if (fileTypePolicy.isImage(first.OrderKey) || fileTypePolicy.isImage(first.OrgFileName)) {
|
||||
if (
|
||||
fileTypePolicy.isImage(first.OrderKey) ||
|
||||
fileTypePolicy.isImage(first.OrgFileName)
|
||||
) {
|
||||
onViewPreviewPhoto(first.FilePath);
|
||||
} else if (fileTypePolicy.isVideo(first.OrderKey) || fileTypePolicy.isVideo(first.OrgFileName)) {
|
||||
} else if (
|
||||
fileTypePolicy.isVideo(first.OrderKey) ||
|
||||
fileTypePolicy.isVideo(first.OrgFileName)
|
||||
) {
|
||||
onViewPreviewVideo(first.FilePath);
|
||||
} else if (fileTypePolicy.isAudio(first.OrderKey) || fileTypePolicy.isAudio(first.OrgFileName)) {
|
||||
} else if (
|
||||
fileTypePolicy.isAudio(first.OrderKey) ||
|
||||
fileTypePolicy.isAudio(first.OrgFileName)
|
||||
) {
|
||||
onViewPreviewAudio(first.FilePath);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user