ow
This commit is contained in:
1 parent
ceb3e7beec
commit
f6f3735ab3
29 files changed
+8376
-140
No files matched your search
@@ -15,6 +15,7 @@
|
||||
* 权限暂用 UserOperation(见 routes.ts 的 PAGE_PERMISSIONS);useAuthGuard 兜冷启动直达。
|
||||
*/
|
||||
import type { FolderRow } from "@/components/folder-move-picker/folder-move-picker.vue";
|
||||
import type { ShareTarget } from "@/components/folder-share-picker/folder-share-picker.vue";
|
||||
import type { PickerOption } from "@/components/option-picker/option-picker.vue";
|
||||
import type { FileCategory, FileItem, FileKind, FileTabItem, QuickEntryItem } from "@/data/custom/fileBrowser";
|
||||
import { useLocale } from "uview-pro";
|
||||
@@ -22,14 +23,12 @@ import { computed, ref, watch } from "vue";
|
||||
import { useAuthGuard, useDmsFiles, useThemeGradient } from "@/composables";
|
||||
import { DmsFileEntity } from "@/data/auto/dmsFileEntity";
|
||||
import { FamilyGroupFolderEntity } from "@/data/auto/familyGroupFolderEntity";
|
||||
import { FamilyGroupManagerUserSearchCriteria } from "@/data/auto/familyGroupManagerUserSearchCriteria";
|
||||
import { PublishAudioSearchCriteria } from "@/data/auto/publishAudioSearchCriteria";
|
||||
import { PublishData } from "@/data/auto/publishData";
|
||||
import { PublishPhotoSearchCriteria } from "@/data/auto/publishPhotoSearchCriteria";
|
||||
import { PublishVideoSearchCriteria } from "@/data/auto/publishVideoSearchCriteria";
|
||||
import { pageUrl } from "@/router/routes";
|
||||
import dmsFileService from "@/service/master/dmsFileService";
|
||||
import familyGroupService from "@/service/master/familyGroupService";
|
||||
import publishAudioService from "@/service/master/publishAudioService";
|
||||
import publishPhotoService from "@/service/master/publishPhotoService";
|
||||
import publishVideoService from "@/service/master/publishVideoService";
|
||||
@@ -180,12 +179,37 @@ function onSearch(value: string): void {
|
||||
search(value);
|
||||
}
|
||||
|
||||
/** 展览/播放三入口:以当前目录为上下文,mode=list + key=目录路径跳对应播放器页 */
|
||||
function goShowWithFolder(name: "photoShow" | "audioHall" | "videoHall"): void {
|
||||
const folder = pathStack.value[pathStack.value.length - 1]?.value ?? "";
|
||||
uni.navigateTo({
|
||||
url: `${pageUrl(name)}?mode=list&key=${encodeURIComponent(folder)}`,
|
||||
fail: (err: any) => toast(err?.errMsg || t("FilePage.actionFailed")),
|
||||
});
|
||||
}
|
||||
|
||||
function onQuickClick(key: string): void {
|
||||
// 回收站已落地(pages/trash);其余入口仍是占位提示
|
||||
// 回收站/共享大厅(pages/trash、pages/share-hall);相册/音乐厅/影视厅展览当前目录
|
||||
if (key === "trash") {
|
||||
uni.navigateTo({ url: pageUrl("trash") });
|
||||
return;
|
||||
}
|
||||
if (key === "shareCenter") {
|
||||
uni.navigateTo({ url: pageUrl("shareHall") });
|
||||
return;
|
||||
}
|
||||
if (key === "album") {
|
||||
goShowWithFolder("photoShow");
|
||||
return;
|
||||
}
|
||||
if (key === "musicHall") {
|
||||
goShowWithFolder("audioHall");
|
||||
return;
|
||||
}
|
||||
if (key === "videoHall") {
|
||||
goShowWithFolder("videoHall");
|
||||
return;
|
||||
}
|
||||
const entry = quickEntries.value.find(e => e.key === key);
|
||||
toast(entry ? `${entry.label} · ${t("FilePage.todoTip")}` : t("FilePage.todoTip"));
|
||||
}
|
||||
@@ -600,15 +624,12 @@ function goPlay(type: "video" | "audio", name: string, url: string): void {
|
||||
});
|
||||
}
|
||||
|
||||
// ----- 共享家人:选收藏夹里的家人目录,组装 FamilyGroupFolderEntity 批量建(旧 handleSelectShare)-----
|
||||
// ----- 共享家人:共享大厅式抽屉选目标目录(群组卡→逐级下钻→共享到此),
|
||||
// 多选文件一次批量建(CreateFamilyGroupFolder 数组入参,旧 handleSelectShare 同口径)-----
|
||||
const shareVisible = ref(false);
|
||||
const shareLoading = ref(false);
|
||||
const shareItems = ref<PickerOption[]>([]);
|
||||
/** 展示用 items 之外的组装字段(FamilyName/TopFolderName 提交才需要) */
|
||||
const shareFolders = ref<Array<{ key: string; familyName: string; topFolderName: string }>>([]);
|
||||
const shareTargets = ref<FileItem[]>([]);
|
||||
|
||||
async function actionShare(targets: FileItem[]): Promise<void> {
|
||||
function actionShare(targets: FileItem[]): void {
|
||||
const picked = targets.filter(f => f.kind !== "folder");
|
||||
if (!picked.length) {
|
||||
toast(t("FilePage.shareNoFile"));
|
||||
@@ -616,41 +637,11 @@ async function actionShare(targets: FileItem[]): Promise<void> {
|
||||
}
|
||||
shareTargets.value = picked;
|
||||
shareVisible.value = true;
|
||||
shareLoading.value = true;
|
||||
try {
|
||||
const criteria = new FamilyGroupManagerUserSearchCriteria();
|
||||
criteria.Filter = [];
|
||||
criteria.limit = 999;
|
||||
criteria.page = 1;
|
||||
criteria.GridColumns = [];
|
||||
const data = await familyGroupService.FamilyFolderFavoriteBySearchCriteria(criteria);
|
||||
const favorites = data?.Favorites ?? [];
|
||||
shareFolders.value = favorites.map(f => ({
|
||||
key: f.FolderName,
|
||||
familyName: f.FamilyName,
|
||||
topFolderName: f.TopFolderName,
|
||||
}));
|
||||
shareItems.value = favorites.map(f => ({
|
||||
key: f.FolderName,
|
||||
label: `${f.FamilyLocalName} / ${f.FolderLocalName}`,
|
||||
sub: f.Notice,
|
||||
}));
|
||||
}
|
||||
catch (error: any) {
|
||||
toast(error?.message || t("FilePage.actionFailed"));
|
||||
}
|
||||
finally {
|
||||
shareLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function onShareConfirm(key: string): Promise<void> {
|
||||
const target = shareFolders.value.find(f => f.key === key);
|
||||
shareVisible.value = false;
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
async function onShareConfirm(target: ShareTarget): Promise<void> {
|
||||
const filesToShare = shareTargets.value;
|
||||
shareVisible.value = false;
|
||||
await withBusy(async () => {
|
||||
const rows = filesToShare.map((file) => {
|
||||
const record = recordOf(file);
|
||||
@@ -660,7 +651,7 @@ async function onShareConfirm(key: string): Promise<void> {
|
||||
// 旧系统组装:FolderName 文件系统名、FolderLocalName 原始名、FilePath 目标共享目录
|
||||
fgp.FolderName = record?.FileName ?? file.path;
|
||||
fgp.FolderLocalName = record?.OrgFileName ?? file.name;
|
||||
fgp.FilePath = target.key;
|
||||
fgp.FilePath = target.filePath;
|
||||
return fgp;
|
||||
});
|
||||
await dmsFileService.CreateFamilyGroupFolder(rows);
|
||||
@@ -701,7 +692,8 @@ async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
publishVisible.value = true;
|
||||
publishLoading.value = true;
|
||||
try {
|
||||
let names: string[] = [];
|
||||
// 拉到的专辑行含名称(PublishLocalName)/描述(Notice)/编号(PublishName),不能只留编号
|
||||
let rows: Array<{ PublishName?: string; PublishLocalName?: string; Notice?: string }> = [];
|
||||
if (first.kind === "image") {
|
||||
const criteria = new PublishPhotoSearchCriteria();
|
||||
criteria.Filter = [];
|
||||
@@ -709,7 +701,7 @@ async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
criteria.page = 1;
|
||||
criteria.GridColumns = [];
|
||||
const data = await publishPhotoService.FindBySearchCriteria(criteria);
|
||||
names = (data?.Publishs ?? []).map(p => p.PublishName);
|
||||
rows = data?.Publishs ?? [];
|
||||
}
|
||||
else if (first.kind === "video") {
|
||||
const criteria = new PublishVideoSearchCriteria();
|
||||
@@ -718,7 +710,7 @@ async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
criteria.page = 1;
|
||||
criteria.GridColumns = [];
|
||||
const data = await publishVideoService.FindBySearchCriteria(criteria);
|
||||
names = (data?.Datas ?? []).map(p => p.PublishName);
|
||||
rows = data?.Datas ?? [];
|
||||
}
|
||||
else {
|
||||
const criteria = new PublishAudioSearchCriteria();
|
||||
@@ -727,9 +719,24 @@ async function actionPublish(targets: FileItem[]): Promise<void> {
|
||||
criteria.page = 1;
|
||||
criteria.GridColumns = [];
|
||||
const data = await publishAudioService.FindBySearchCriteria(criteria);
|
||||
names = (data?.Datas ?? []).map(p => p.PublishName);
|
||||
rows = data?.Datas ?? [];
|
||||
}
|
||||
publishItems.value = names.filter(Boolean).map(n => ({ key: n, label: n }));
|
||||
// 主行显示专辑名称(无名称回落编号),副行显示描述 + 编号;key 仍用编号供 onPublishConfirm 发布
|
||||
publishItems.value = rows
|
||||
.filter(p => p?.PublishName)
|
||||
.map((p) => {
|
||||
const code = p.PublishName || "";
|
||||
const hasName = !!p.PublishLocalName;
|
||||
const label = p.PublishLocalName || code;
|
||||
const parts: string[] = [];
|
||||
if (p.Notice) {
|
||||
parts.push(p.Notice);
|
||||
}
|
||||
if (hasName) {
|
||||
parts.push(code);
|
||||
}
|
||||
return { key: code, label, sub: parts.join(" · ") };
|
||||
});
|
||||
}
|
||||
catch (error: any) {
|
||||
toast(error?.message || t("FilePage.actionFailed"));
|
||||
@@ -966,9 +973,8 @@ const transferIconWhite = transferGlyph("#ffffff");
|
||||
<!-- 移动:网盘式逐级下钻选择器(进层浏览,「移动到此」提交当前层后直接调移动接口) -->
|
||||
<folder-move-picker :visible="moveVisible" :exclude-name="moveExcludeName" :source-path="moveSourcePath"
|
||||
:selected-count="moveTargets.length" @close="moveVisible = false" @confirm="onMovePick" />
|
||||
<!-- 共享家人:选家人目录 -->
|
||||
<option-picker :visible="shareVisible" :title="t('FilePage.shareTitle')" :items="shareItems"
|
||||
:loading="shareLoading" :empty-text="t('FilePage.pickerEmpty')" @close="shareVisible = false"
|
||||
<!-- 共享家人:共享大厅式抽屉(群组卡→逐级下钻→「共享到此」),多选文件一次批量共享 -->
|
||||
<folder-share-picker :visible="shareVisible" :selected-count="shareTargets.length" @close="shareVisible = false"
|
||||
@confirm="onShareConfirm" />
|
||||
<!-- 发布:选专辑 -->
|
||||
<option-picker :visible="publishVisible" :title="publishTitle" :items="publishItems" :loading="publishLoading"
|
||||
|
||||
Reference in new issue
Block a user