优化文件选项显示

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

@@ -5800,7 +5800,7 @@ This will fail in production.`);
}
});
}
const pageSize$1 = 20;
const pageSize$1 = 100;
const groupSize = 100;
const _sfc_main$a = {
__name: "Chat",
@@ -8351,8 +8351,10 @@ This will fail in production.`);
return;
const isWyxd = folder.name && folder.name.toLowerCase().endsWith(".wyxd");
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({
title: folder.name,
title,
itemList,
success: (res) => {
if (isWyxd) {
@@ -8410,7 +8412,7 @@ This will fail in production.`);
initCurrentFolderList();
} catch (error) {
uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:404", "重命名失败:", error);
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:409", "重命名失败:", error);
uni.showToast({
title: typeof error === "string" ? error : "重命名失败,请重试",
icon: "error"
@@ -8471,7 +8473,7 @@ This will fail in production.`);
},
fail: (err) => {
uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:479", "下载文件失败:", err);
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:484", "下载文件失败:", err);
uni.showToast({
title: "下载失败,请重试",
icon: "error"
@@ -8480,7 +8482,7 @@ This will fail in production.`);
});
} catch (error) {
uni.hideLoading();
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:488", "获取下载链接失败:", error);
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:493", "获取下载链接失败:", error);
uni.showToast({
title: "获取下载链接失败,请重试",
icon: "error"
@@ -8549,10 +8551,10 @@ This will fail in production.`);
const formatDownloadTime = formatTime;
const openWyxdViewer = (folder) => {
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:603", "folder", folder);
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:604", "encode", encodeURIComponent(filePath));
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:605", "encode", encodeURIComponent(folder.name));
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:607", "解析文件路径:", filePath);
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:608", "folder", folder);
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:609", "encode", encodeURIComponent(filePath));
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:610", "encode", encodeURIComponent(folder.name));
uni.navigateTo({
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) {
try {
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);
uni.showToast({
title: "删除成功",
@@ -8579,7 +8581,7 @@ This will fail in production.`);
});
initCurrentFolderList();
} catch (error) {
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:643", "删除失败:", error);
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:648", "删除失败:", error);
uni.showToast({
title: "删除失败,请重试",
icon: "error"
@@ -8647,7 +8649,7 @@ This will fail in production.`);
const currentFolderList = vue.ref([]);
const getCurrentFolderList = () => {
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 : ".";
if (currentPath === ".") {
return ((_a = allFoldersData.value) == null ? void 0 : _a.children) || [];
@@ -8671,7 +8673,7 @@ This will fail in production.`);
const initCurrentFolderList = async () => {
workspaceId.value = getWorkspaceId();
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);
currentFolderList.value = getCurrentFolderList();
};
@@ -8718,7 +8720,7 @@ This will fail in production.`);
uni.navigateBack({
delta: 1,
fail() {
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:811", "返回失败,进入兜底跳转");
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:816", "返回失败,进入兜底跳转");
uni.reLaunch({
url: "/pages/Chat/Chat"
});