优化文件选项显示

This commit is contained in:
2026-08-06 17:21:21 +08:00
parent 6bb7f37276
commit 5c3769019e
3 changed files with 23 additions and 16 deletions

View File

@@ -1694,7 +1694,7 @@ import { openFile as openFileNative, downloadAndOpen } from '@/utils/fileOpener.
const aiPageNumber = ref(0) // AI 会话当前服务端页码0-based const aiPageNumber = ref(0) // AI 会话当前服务端页码0-based
const hasMoreAIMessages = ref(true) // AI 会话是否还有更多消息可加载 const hasMoreAIMessages = ref(true) // AI 会话是否还有更多消息可加载
const currentPage = ref(1) // 当前页码(如果后端支持分页) const currentPage = ref(1) // 当前页码(如果后端支持分页)
const pageSize = 20; const pageSize = 100;
// 好友消息分页 // 好友消息分页
const isFriendLoadingMore = ref(false) // 好友会话是否正在加载更多 const isFriendLoadingMore = ref(false) // 好友会话是否正在加载更多

View File

@@ -336,8 +336,13 @@ import {
if (isSelectFolder.value) return; if (isSelectFolder.value) return;
const isWyxd = folder.name && folder.name.toLowerCase().endsWith('.wyxd'); const isWyxd = folder.name && folder.name.toLowerCase().endsWith('.wyxd');
const itemList = isWyxd ? ['下载', '删除', 'WYXD查看器', 'AI修改'] : ['下载', '删除']; const itemList = isWyxd ? ['下载', '删除', 'WYXD查看器', 'AI修改'] : ['下载', '删除'];
// 截断过长文件名,避免撑开弹窗遮挡操作按钮
const maxTitleLen = 40;
const title = folder.name && folder.name.length > maxTitleLen
? folder.name.substring(0, maxTitleLen) + '...'
: folder.name;
uni.showActionSheet({ uni.showActionSheet({
title: folder.name, title: title,
itemList: itemList, itemList: itemList,
success: (res) => { success: (res) => {
if (isWyxd) { if (isWyxd) {

View File

@@ -5800,7 +5800,7 @@ This will fail in production.`);
} }
}); });
} }
const pageSize$1 = 20; const pageSize$1 = 100;
const groupSize = 100; const groupSize = 100;
const _sfc_main$a = { const _sfc_main$a = {
__name: "Chat", __name: "Chat",
@@ -8351,8 +8351,10 @@ This will fail in production.`);
return; return;
const isWyxd = folder.name && folder.name.toLowerCase().endsWith(".wyxd"); const isWyxd = folder.name && folder.name.toLowerCase().endsWith(".wyxd");
const itemList = isWyxd ? ["下载", "删除", "WYXD查看器", "AI修改"] : ["下载", "删除"]; const itemList = isWyxd ? ["下载", "删除", "WYXD查看器", "AI修改"] : ["下载", "删除"];
const maxTitleLen = 40;
const title = folder.name && folder.name.length > maxTitleLen ? folder.name.substring(0, maxTitleLen) + "..." : folder.name;
uni.showActionSheet({ uni.showActionSheet({
title: folder.name, title,
itemList, itemList,
success: (res) => { success: (res) => {
if (isWyxd) { if (isWyxd) {
@@ -8410,7 +8412,7 @@ This will fail in production.`);
initCurrentFolderList(); initCurrentFolderList();
} catch (error) { } catch (error) {
uni.hideLoading(); uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:404", "重命名失败:", error); formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:409", "重命名失败:", error);
uni.showToast({ uni.showToast({
title: typeof error === "string" ? error : "重命名失败,请重试", title: typeof error === "string" ? error : "重命名失败,请重试",
icon: "error" icon: "error"
@@ -8471,7 +8473,7 @@ This will fail in production.`);
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading(); uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:479", "下载文件失败:", err); formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:484", "下载文件失败:", err);
uni.showToast({ uni.showToast({
title: "下载失败,请重试", title: "下载失败,请重试",
icon: "error" icon: "error"
@@ -8480,7 +8482,7 @@ This will fail in production.`);
}); });
} catch (error) { } catch (error) {
uni.hideLoading(); uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:488", "获取下载链接失败:", error); formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:493", "获取下载链接失败:", error);
uni.showToast({ uni.showToast({
title: "获取下载链接失败,请重试", title: "获取下载链接失败,请重试",
icon: "error" icon: "error"
@@ -8549,10 +8551,10 @@ This will fail in production.`);
const formatDownloadTime = formatTime; const formatDownloadTime = formatTime;
const openWyxdViewer = (folder) => { const openWyxdViewer = (folder) => {
const filePath = folder.path.startsWith("./") ? folder.path.slice(2) : folder.path; const filePath = folder.path.startsWith("./") ? folder.path.slice(2) : folder.path;
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:602", "解析文件路径:", filePath); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:607", "解析文件路径:", filePath);
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:603", "folder", folder); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:608", "folder", folder);
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:604", "encode", encodeURIComponent(filePath)); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:609", "encode", encodeURIComponent(filePath));
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:605", "encode", encodeURIComponent(folder.name)); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:610", "encode", encodeURIComponent(folder.name));
uni.navigateTo({ uni.navigateTo({
url: "/pages/WYXD/WYXD?workspaceId=" + encodeURIComponent(workspaceId.value) + "&filePath=" + encodeURIComponent(filePath) + "&fileName=" + encodeURIComponent(folder.name) + "&userToken=" + encodeURIComponent(UserToken.value) url: "/pages/WYXD/WYXD?workspaceId=" + encodeURIComponent(workspaceId.value) + "&filePath=" + encodeURIComponent(filePath) + "&fileName=" + encodeURIComponent(folder.name) + "&userToken=" + encodeURIComponent(UserToken.value)
}); });
@@ -8571,7 +8573,7 @@ This will fail in production.`);
if (res.confirm) { if (res.confirm) {
try { try {
const filePath = `./${folder.path}`; const filePath = `./${folder.path}`;
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:635", "删除的是:", filePath); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:640", "删除的是:", filePath);
await daleteWorkspace(UserToken.value, workspaceId.value, filePath); await daleteWorkspace(UserToken.value, workspaceId.value, filePath);
uni.showToast({ uni.showToast({
title: "删除成功", title: "删除成功",
@@ -8579,7 +8581,7 @@ This will fail in production.`);
}); });
initCurrentFolderList(); initCurrentFolderList();
} catch (error) { } catch (error) {
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:643", "删除失败:", error); formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:648", "删除失败:", error);
uni.showToast({ uni.showToast({
title: "删除失败,请重试", title: "删除失败,请重试",
icon: "error" icon: "error"
@@ -8647,7 +8649,7 @@ This will fail in production.`);
const currentFolderList = vue.ref([]); const currentFolderList = vue.ref([]);
const getCurrentFolderList = () => { const getCurrentFolderList = () => {
var _a, _b; var _a, _b;
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:724", "当前路径为:", JSON.stringify(folderStack.value)); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:729", "当前路径为:", JSON.stringify(folderStack.value));
const currentPath = folderStack.value.length > 0 ? folderStack.value[folderStack.value.length - 1].path : "."; const currentPath = folderStack.value.length > 0 ? folderStack.value[folderStack.value.length - 1].path : ".";
if (currentPath === ".") { if (currentPath === ".") {
return ((_a = allFoldersData.value) == null ? void 0 : _a.children) || []; return ((_a = allFoldersData.value) == null ? void 0 : _a.children) || [];
@@ -8671,7 +8673,7 @@ This will fail in production.`);
const initCurrentFolderList = async () => { const initCurrentFolderList = async () => {
workspaceId.value = getWorkspaceId(); workspaceId.value = getWorkspaceId();
UserToken.value = getToken(); UserToken.value = getToken();
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:751", "getWorkspaceId:", workspaceId.value); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:756", "getWorkspaceId:", workspaceId.value);
allFoldersData.value = await getWorkspaceList(UserToken.value, workspaceId.value); allFoldersData.value = await getWorkspaceList(UserToken.value, workspaceId.value);
currentFolderList.value = getCurrentFolderList(); currentFolderList.value = getCurrentFolderList();
}; };
@@ -8718,7 +8720,7 @@ This will fail in production.`);
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
fail() { fail() {
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:811", "返回失败,进入兜底跳转"); formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:816", "返回失败,进入兜底跳转");
uni.reLaunch({ uni.reLaunch({
url: "/pages/Chat/Chat" url: "/pages/Chat/Chat"
}); });