wyxd与聊天页面的切换,
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
</view>
|
||||
<view class="new-chat-btn" @click="goContactPages">
|
||||
<text>+ 聊天列表</text>
|
||||
<text>+ 更多聊天列表</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="chat-history">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name" : "test1",
|
||||
"name" : "宇恒一号",
|
||||
"appid" : "__UNI__923FD9E",
|
||||
"description" : "",
|
||||
"versionName" : "1.1.1",
|
||||
|
||||
@@ -105,11 +105,13 @@
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
color: #1a1a2e;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ncd-header uni-icons {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ncd-options {
|
||||
@@ -325,6 +327,62 @@
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
/* ==========WYXD 文件入口横幅========== */
|
||||
.wyxd-banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14rpx 24rpx;
|
||||
margin: 6rpx 20rpx;
|
||||
background: linear-gradient(135deg, #e8f4fd, #f0e6ff);
|
||||
border: 1.5rpx solid rgba(120, 120, 220, 0.25);
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(100, 100, 200, 0.08);
|
||||
}
|
||||
|
||||
.wyxd-banner:active {
|
||||
background: linear-gradient(135deg, #d8eafb, #e6d8ff);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.wyxd-banner-icon {
|
||||
font-size: 32rpx;
|
||||
color: #6c6ce0;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.wyxd-banner-text {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #4a4ab8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wyxd-banner-arrow {
|
||||
font-size: 24rpx;
|
||||
color: #9999cc;
|
||||
}
|
||||
|
||||
.wyxd-banner-close {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #9999cc;
|
||||
border-radius: 50%;
|
||||
background: rgba(100, 100, 200, 0.08);
|
||||
margin-left: 8rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wyxd-banner-close:active {
|
||||
background: rgba(100, 100, 200, 0.18);
|
||||
color: #6c6ce0;
|
||||
}
|
||||
|
||||
/* ==========聊天主体部分========== */
|
||||
.main-chat {
|
||||
display: flex;
|
||||
|
||||
@@ -64,6 +64,15 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- WYXD 文件入口(从工作区 AI 修改进入时显示) -->
|
||||
<view v-if="hasWyxdFile" class="wyxd-banner">
|
||||
<view class="wyxd-banner-icon iconfont icon-wenjian"></view>
|
||||
<view class="wyxd-banner-text" @click="goWyxdViewer">查看: {{ wyxdFileName }}</view>
|
||||
<view class="wyxd-banner-arrow" @click="goWyxdViewer">›</view>
|
||||
<view class="wyxd-banner-close" @click.stop="hasWyxdFile = false">×</view>
|
||||
</view>
|
||||
|
||||
<view class="main-chat">
|
||||
<scroll-view class="chat-messages" direction="vertical" scroll-y :scroll-into-view="scrollToView"
|
||||
:upper-threshold="0" :scroll-with-animation="!isThinking" @scroll="onScroll">
|
||||
@@ -293,6 +302,7 @@
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onUnload
|
||||
} from '@dcloudio/uni-app';
|
||||
@@ -356,6 +366,13 @@
|
||||
// 聊天类型(ai,好友,群聊)
|
||||
const ChatType = ref(0)
|
||||
|
||||
// WYXD 关联数据(从 WorkSpace 的「AI修改」进入时携带)
|
||||
const wyxdWorkspaceId = ref('')
|
||||
const wyxdFilePath = ref('')
|
||||
const wyxdFileName = ref('')
|
||||
const wyxdUserToken = ref('')
|
||||
const hasWyxdFile = ref(false)
|
||||
|
||||
|
||||
// marked.setOptions({
|
||||
// breaks: true, // 自动把换行符转成 <br> 换行
|
||||
@@ -621,6 +638,17 @@
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转到 WYXD 查看器(强制重新下载,不走缓存)
|
||||
const goWyxdViewer = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/WYXD/WYXD?workspaceId=' + encodeURIComponent(wyxdWorkspaceId.value)
|
||||
+ '&filePath=' + encodeURIComponent(wyxdFilePath.value)
|
||||
+ '&fileName=' + encodeURIComponent(wyxdFileName.value)
|
||||
+ '&userToken=' + encodeURIComponent(wyxdUserToken.value)
|
||||
+ '&forceDownload=1'
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转到云端数据库
|
||||
const goCloudDatabase = () => {
|
||||
// 保存当前会话id,确保从工作区返回时能恢复
|
||||
@@ -1480,6 +1508,7 @@
|
||||
if (oldId && oldId !== newId) {
|
||||
isLoadingMessages.value = true
|
||||
allmessages.value = []
|
||||
hasWyxdFile.value = false
|
||||
}
|
||||
switch (ChatType.value) {
|
||||
case 0:
|
||||
@@ -1503,6 +1532,17 @@
|
||||
immediate: true
|
||||
})
|
||||
|
||||
// 接收 WYXD 参数(从工作区「AI修改」进入时由 navigateTo 传入)
|
||||
onLoad((options) => {
|
||||
if (options.wyxdFilePath) {
|
||||
wyxdWorkspaceId.value = options.wyxdWorkspaceId ? decodeURIComponent(options.wyxdWorkspaceId) : ''
|
||||
wyxdFilePath.value = decodeURIComponent(options.wyxdFilePath)
|
||||
wyxdFileName.value = options.wyxdFileName ? decodeURIComponent(options.wyxdFileName) : '未命名文档'
|
||||
wyxdUserToken.value = options.wyxdUserToken ? decodeURIComponent(options.wyxdUserToken) : ''
|
||||
hasWyxdFile.value = true
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// currentSessionId.value = getCurrentSessionId()
|
||||
})
|
||||
|
||||
@@ -188,7 +188,8 @@ onLoad((options) => {
|
||||
userToken: userToken.value
|
||||
})
|
||||
|
||||
if (isWyxdCached(workspaceId.value, filePath.value)) {
|
||||
// forceDownload 强制重新下载不走缓存
|
||||
if (options.forceDownload !== '1' && isWyxdCached(workspaceId.value, filePath.value)) {
|
||||
loadFromCache()
|
||||
} else {
|
||||
startDownload()
|
||||
|
||||
@@ -284,10 +284,12 @@
|
||||
const handleLongPress = (folder) => {
|
||||
if (isSelectFolder.value) return;
|
||||
const isWyxd = folder.name && folder.name.toLowerCase().endsWith('.wyxd');
|
||||
const itemList = isWyxd ? ['下载', '删除', 'WYXD查看器'] : ['下载', '删除'];
|
||||
const itemList = isWyxd ? ['下载', '删除', 'WYXD查看器', 'AI修改'] : ['下载', '删除'];
|
||||
uni.showActionSheet({
|
||||
title: folder.name,
|
||||
itemList: itemList,
|
||||
success: (res) => {
|
||||
if (isWyxd) {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
handleDownload(folder);
|
||||
@@ -296,8 +298,21 @@
|
||||
handleDelete(folder);
|
||||
break;
|
||||
case 2:
|
||||
if (isWyxd) openWyxdViewer(folder);
|
||||
openWyxdViewer(folder);
|
||||
break;
|
||||
case 3: // 'AI修改',
|
||||
handleAiModify(folder);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
handleDownload(folder);
|
||||
break;
|
||||
case 1:
|
||||
handleDelete(folder);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -472,6 +487,17 @@
|
||||
});
|
||||
};
|
||||
|
||||
// AI修改入口:跳转对话页并传入 WYXD 信息
|
||||
const handleAiModify = (folder) => {
|
||||
const filePath = folder.path.startsWith('./') ? folder.path.slice(2) : folder.path;
|
||||
uni.navigateTo({
|
||||
url: '/pages/Chat/Chat?wyxdWorkspaceId=' + encodeURIComponent(workspaceId.value)
|
||||
+ '&wyxdFilePath=' + encodeURIComponent(filePath)
|
||||
+ '&wyxdFileName=' + encodeURIComponent(folder.name)
|
||||
+ '&wyxdUserToken=' + encodeURIComponent(UserToken.value)
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = (folder) => {
|
||||
uni.showModal({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
;(function(){
|
||||
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
|
||||
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"test1","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"5.07","entryPagePath":"pages/Login/Login","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{},"darkmode":false,"themeConfig":{}};
|
||||
const __uniRoutes = [{"path":"pages/Login/Login","meta":{"isQuit":true,"isEntry":true,"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"登录页面","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Chat/Chat","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"聊天页面(主页面)","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/WorkSpace/WorkSpace","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"工作区文件管理","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/UserProfileModal/UserProfileModal","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/ContactPages/ContactPages","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/WorkSpace/TemplateSpace/TemplateSpace","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/CloudDatabase/CloudDatabase","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"云端数据","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/CloudDbDetail/CloudDbDetail","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"数据库详情","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/text/text","meta":{"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/text/IntuitiveAipptViewer","meta":{"navigationBar":{"titleText":"","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
|
||||
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"宇恒一号","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"5.07","entryPagePath":"pages/Login/Login","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{},"darkmode":false,"themeConfig":{}};
|
||||
const __uniRoutes = [{"path":"pages/Login/Login","meta":{"isQuit":true,"isEntry":true,"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"登录页面","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/Chat/Chat","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"聊天页面(主页面)","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/WorkSpace/WorkSpace","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"工作区文件管理","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/UserProfileModal/UserProfileModal","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/ContactPages/ContactPages","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/WorkSpace/TemplateSpace/TemplateSpace","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/CloudDatabase/CloudDatabase","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"云端数据","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/CloudDbDetail/CloudDbDetail","meta":{"titleNView":false,"bounce":"none","softinputMode":"adjustResize","navigationBar":{"titleText":"数据库详情","style":"custom","type":"default"},"isNVue":false}},{"path":"pages/text/text","meta":{"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/text/IntuitiveAipptViewer","meta":{"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/WYXD/WYXD","meta":{"titleNView":false,"bounce":"none","navigationBar":{"titleText":"","style":"custom","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
|
||||
__uniConfig.styles=[];//styles
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
|
||||
15
unpackage/dist/build/app-plus/app-service.js
vendored
15
unpackage/dist/build/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/manifest.json
vendored
2
unpackage/dist/build/app-plus/manifest.json
vendored
@@ -5,7 +5,7 @@
|
||||
"iPad"
|
||||
],
|
||||
"id": "__UNI__923FD9E",
|
||||
"name": "test1",
|
||||
"name": "宇恒一号",
|
||||
"version": {
|
||||
"name": "1.1.1",
|
||||
"code": 2
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
unpackage/dist/build/app-plus/pages/WYXD/WYXD.css
vendored
Normal file
1
unpackage/dist/build/app-plus/pages/WYXD/WYXD.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
201
unpackage/dist/dev/app-plus/app-service.js
vendored
201
unpackage/dist/dev/app-plus/app-service.js
vendored
@@ -2727,7 +2727,7 @@ if (uni.restoreGlobal) {
|
||||
class: "new-chat-btn",
|
||||
onClick: $setup.goContactPages
|
||||
}, [
|
||||
vue.createElementVNode("text", null, "+ 聊天列表")
|
||||
vue.createElementVNode("text", null, "+ 更多聊天列表")
|
||||
])
|
||||
]),
|
||||
vue.createElementVNode("view", { class: "chat-history" }, [
|
||||
@@ -5639,7 +5639,7 @@ This will fail in production.`);
|
||||
if (friendSocketStore.isConnected)
|
||||
return;
|
||||
if (!userToken.value || !UserId.value) {
|
||||
formatAppLog("warn", "at pages/Chat/Chat.vue:345", "Token或UserId未准备好");
|
||||
formatAppLog("warn", "at pages/Chat/Chat.vue:355", "Token或UserId未准备好");
|
||||
return;
|
||||
}
|
||||
friendSocketStore.connect({
|
||||
@@ -5649,6 +5649,11 @@ This will fail in production.`);
|
||||
};
|
||||
const socketStore = useSocketStore();
|
||||
const ChatType = vue.ref(0);
|
||||
const wyxdWorkspaceId = vue.ref("");
|
||||
const wyxdFilePath = vue.ref("");
|
||||
const wyxdFileName = vue.ref("");
|
||||
const wyxdUserToken = vue.ref("");
|
||||
const hasWyxdFile = vue.ref(false);
|
||||
const convertMarkdownTable = (text) => {
|
||||
const lines = text.split("\n");
|
||||
let result = [];
|
||||
@@ -5725,7 +5730,7 @@ This will fail in production.`);
|
||||
);
|
||||
return html;
|
||||
} catch (e2) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:471", "解析失败", e2);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:488", "解析失败", e2);
|
||||
return content;
|
||||
}
|
||||
};
|
||||
@@ -5784,7 +5789,7 @@ This will fail in production.`);
|
||||
files
|
||||
};
|
||||
} catch (e2) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:548", "解析文件信息失败:", e2);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:565", "解析文件信息失败:", e2);
|
||||
return {
|
||||
textContent: content,
|
||||
files: []
|
||||
@@ -5822,7 +5827,7 @@ This will fail in production.`);
|
||||
closeNewChatModal();
|
||||
takeUserConversations();
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:594", "新建普通会话失败:", error);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:611", "新建普通会话失败:", error);
|
||||
uni.showToast({
|
||||
title: "创建会话失败,请重试",
|
||||
icon: "none"
|
||||
@@ -5845,6 +5850,11 @@ This will fail in production.`);
|
||||
url: "/pages/WorkSpace/WorkSpace"
|
||||
});
|
||||
};
|
||||
const goWyxdViewer = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/WYXD/WYXD?workspaceId=" + encodeURIComponent(wyxdWorkspaceId.value) + "&filePath=" + encodeURIComponent(wyxdFilePath.value) + "&fileName=" + encodeURIComponent(wyxdFileName.value) + "&userToken=" + encodeURIComponent(wyxdUserToken.value) + "&forceDownload=1"
|
||||
});
|
||||
};
|
||||
const goCloudDatabase = () => {
|
||||
if (currentSessionId.value) {
|
||||
uni.setStorageSync("currentSessionId", currentSessionId.value);
|
||||
@@ -5860,7 +5870,7 @@ This will fail in production.`);
|
||||
};
|
||||
const previewFileArray = vue.ref([]);
|
||||
const uploadPhoto = () => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:643", "点击了拍照上传");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:671", "点击了拍照上传");
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ["camera", "album"],
|
||||
@@ -5883,7 +5893,7 @@ This will fail in production.`);
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:661", "选择图片失败", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:689", "选择图片失败", err);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -5892,12 +5902,12 @@ This will fail in production.`);
|
||||
};
|
||||
const fileList = vue.ref([]);
|
||||
const uploadFile = () => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:672", "点击了上传文件");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:700", "点击了上传文件");
|
||||
chooseFile({
|
||||
count: 5,
|
||||
type: "all",
|
||||
success: (res) => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:677", "成功了");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:705", "成功了");
|
||||
fileList.value = res.tempFiles;
|
||||
previewFileArray.value.push(...res.tempFiles);
|
||||
uni.showToast({
|
||||
@@ -5906,7 +5916,7 @@ This will fail in production.`);
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:688", "选择失败:", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:716", "选择失败:", err);
|
||||
uni.showToast({
|
||||
title: "选择失败",
|
||||
icon: "error"
|
||||
@@ -6108,7 +6118,7 @@ This will fail in production.`);
|
||||
previewFileArray.value = [];
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:923", "文件上传失败:", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:951", "文件上传失败:", err);
|
||||
uni.showToast({
|
||||
title: "文件上传失败,请重试",
|
||||
icon: "error"
|
||||
@@ -6242,15 +6252,15 @@ This will fail in production.`);
|
||||
}
|
||||
};
|
||||
const stopConversation = async () => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1093", "中断对话 - 当前会话ID:", currentSessionId.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1121", "中断对话 - 当前会话ID:", currentSessionId.value);
|
||||
try {
|
||||
await socketStore.send({
|
||||
type: "stop",
|
||||
conversation_id: currentSessionId.value
|
||||
});
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1099", "中断指令已发送成功");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1127", "中断指令已发送成功");
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1101", "中断指令发送失败:", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1129", "中断指令发送失败:", err);
|
||||
}
|
||||
if (streamingMessageId.value) {
|
||||
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
||||
@@ -6268,9 +6278,9 @@ This will fail in production.`);
|
||||
});
|
||||
};
|
||||
vue.watch(() => socketStore.isThinking, (newVal, oldVal) => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1125", "isThinking 变化:", oldVal, "→", newVal, "messageString:", socketStore.messageString);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1153", "isThinking 变化:", oldVal, "→", newVal, "messageString:", socketStore.messageString);
|
||||
if (!oldVal && newVal) {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1128", "AI开始回复(跨设备同步),锁定输入框");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1156", "AI开始回复(跨设备同步),锁定输入框");
|
||||
isThinking.value = true;
|
||||
if (!streamingMessageId.value) {
|
||||
streamingMessageId.value = "streaming-" + Date.now();
|
||||
@@ -6284,7 +6294,7 @@ This will fail in production.`);
|
||||
return;
|
||||
}
|
||||
if (oldVal && !newVal) {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1144", "AI回复结束(正常/中断),解锁并刷新消息列表");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1172", "AI回复结束(正常/中断),解锁并刷新消息列表");
|
||||
if (streamingMessageId.value) {
|
||||
allmessages.value = allmessages.value.filter((m) => m._id !== streamingMessageId.value);
|
||||
streamingMessageId.value = null;
|
||||
@@ -6336,15 +6346,15 @@ This will fail in production.`);
|
||||
UserData.value = await getUserInfo(userToken.value);
|
||||
UserId.value = UserData.value._id;
|
||||
UserAvatar.value = UserData.value.avatar || "";
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1208", "用户信息已加载:", UserId.value, UserAvatar.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1236", "用户信息已加载:", UserId.value, UserAvatar.value);
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1210", "获取用户信息失败:", error);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1238", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
const takeUserConversations = async () => {
|
||||
try {
|
||||
userToken.value = getToken();
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1218", "token:", userToken.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1246", "token:", userToken.value);
|
||||
UserConversations.value = await getUserConversations(userToken.value) || [];
|
||||
const savedSessionId = getCurrentSessionId();
|
||||
if (savedSessionId && UserConversations.value.some((c) => c._id === savedSessionId)) {
|
||||
@@ -6354,7 +6364,7 @@ This will fail in production.`);
|
||||
} else {
|
||||
currentSessionId.value = "";
|
||||
}
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1230", "保存会话id:", currentSessionId.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1258", "保存会话id:", currentSessionId.value);
|
||||
uni.setStorageSync("currentSessionId", currentSessionId.value);
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
@@ -6366,17 +6376,17 @@ This will fail in production.`);
|
||||
const FriendInfoList = vue.ref([]);
|
||||
const takeFriendList = async () => {
|
||||
try {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1245", "开始获取好友列表");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1273", "开始获取好友列表");
|
||||
const friendList = await getChatFriend(UserId.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1248", "friendList:", friendList);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1276", "friendList:", friendList);
|
||||
if (friendList && friendList.length) {
|
||||
FriendInfoList.value = await takeUserAvatar(friendList);
|
||||
} else {
|
||||
FriendInfoList.value = [];
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1253", "好友列表为空");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1281", "好友列表为空");
|
||||
}
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1256", "获取好友列表失败:", error);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1284", "获取好友列表失败:", error);
|
||||
FriendInfoList.value = [];
|
||||
} finally {
|
||||
UserConversations.value = FriendInfoList.value;
|
||||
@@ -6403,17 +6413,17 @@ This will fail in production.`);
|
||||
};
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1286", "获取好友头像失败", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1314", "获取好友头像失败", err);
|
||||
return friendList;
|
||||
}
|
||||
};
|
||||
const GroupList = vue.ref([]);
|
||||
const takeGroupList = async () => {
|
||||
try {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1296", "开始获取群聊列表");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1324", "开始获取群聊列表");
|
||||
GroupList.value = await getGroup(UserId.value);
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1301", "获取群聊列表失败:", error);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1329", "获取群聊列表失败:", error);
|
||||
GroupList.value = [];
|
||||
} finally {
|
||||
UserConversations.value = GroupList.value;
|
||||
@@ -6425,22 +6435,22 @@ This will fail in production.`);
|
||||
return [];
|
||||
try {
|
||||
const memberIds = memberList.map((item) => item.groupContactId);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1315", "请求头像的ID列表:", memberIds);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1343", "请求头像的ID列表:", memberIds);
|
||||
const memberAvatarList = await getUserAvatar(userToken.value, memberIds);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1317", "头像接口返回数据:", memberAvatarList);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1345", "头像接口返回数据:", memberAvatarList);
|
||||
const userMap = new Map(memberAvatarList.map((user) => [user.user_id, user]) || []);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1320", "userMap的keys:", Array.from(userMap.keys()));
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1348", "userMap的keys:", Array.from(userMap.keys()));
|
||||
return memberList.map((member) => {
|
||||
const memberId = member.groupContactId;
|
||||
const userInfo = userMap.get(memberId);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1325", `查找 ${memberId} 的头像:`, userInfo);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1353", `查找 ${memberId} 的头像:`, userInfo);
|
||||
return {
|
||||
...member,
|
||||
avatar: (userInfo == null ? void 0 : userInfo.avatar) || null
|
||||
};
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1332", "获取群成员头像失败", err);
|
||||
formatAppLog("error", "at pages/Chat/Chat.vue:1360", "获取群成员头像失败", err);
|
||||
return memberList;
|
||||
}
|
||||
};
|
||||
@@ -6487,12 +6497,12 @@ This will fail in production.`);
|
||||
const takeGroupMessages = async () => {
|
||||
try {
|
||||
allmessages.value = await getGroupMessages(currentSessionId.value) || [];
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1396", "群聊消息:", allmessages.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1424", "群聊消息:", allmessages.value);
|
||||
const memberList = await getGroupMemberList(currentSessionId.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1399", "获取到的群成员列表:", memberList);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1427", "获取到的群成员列表:", memberList);
|
||||
if (memberList && memberList.length) {
|
||||
groupMemberList.value = await takeGroupMemberAvatar(memberList);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1402", "群成员列表(带头像):", groupMemberList.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1430", "群成员列表(带头像):", groupMemberList.value);
|
||||
} else {
|
||||
groupMemberList.value = [];
|
||||
}
|
||||
@@ -6516,9 +6526,9 @@ This will fail in production.`);
|
||||
}
|
||||
};
|
||||
vue.watch(() => friendSocketStore.MessageReceived, (newId) => {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1449", "收到了好友消息");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1477", "收到了好友消息");
|
||||
if (newId) {
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1451", "ChatType:", ChatType.value);
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1479", "ChatType:", ChatType.value);
|
||||
switch (ChatType.value) {
|
||||
case 0:
|
||||
takeConversationMessages();
|
||||
@@ -6533,7 +6543,7 @@ This will fail in production.`);
|
||||
friendSocketStore.MessageReceived = false;
|
||||
break;
|
||||
default:
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1467", "default 分支");
|
||||
formatAppLog("log", "at pages/Chat/Chat.vue:1495", "default 分支");
|
||||
friendSocketStore.MessageReceived = false;
|
||||
break;
|
||||
}
|
||||
@@ -6547,6 +6557,7 @@ This will fail in production.`);
|
||||
if (oldId && oldId !== newId) {
|
||||
isLoadingMessages.value = true;
|
||||
allmessages.value = [];
|
||||
hasWyxdFile.value = false;
|
||||
}
|
||||
switch (ChatType.value) {
|
||||
case 0:
|
||||
@@ -6568,6 +6579,15 @@ This will fail in production.`);
|
||||
}, {
|
||||
immediate: true
|
||||
});
|
||||
onLoad((options) => {
|
||||
if (options.wyxdFilePath) {
|
||||
wyxdWorkspaceId.value = options.wyxdWorkspaceId ? decodeURIComponent(options.wyxdWorkspaceId) : "";
|
||||
wyxdFilePath.value = decodeURIComponent(options.wyxdFilePath);
|
||||
wyxdFileName.value = options.wyxdFileName ? decodeURIComponent(options.wyxdFileName) : "未命名文档";
|
||||
wyxdUserToken.value = options.wyxdUserToken ? decodeURIComponent(options.wyxdUserToken) : "";
|
||||
hasWyxdFile.value = true;
|
||||
}
|
||||
});
|
||||
vue.onMounted(() => {
|
||||
});
|
||||
onShow(async () => {
|
||||
@@ -6602,11 +6622,13 @@ This will fail in production.`);
|
||||
onUnload(() => {
|
||||
socketStore.disconnect();
|
||||
});
|
||||
const __returned__ = { friendSocketStore, handleFriendConnect, socketStore, ChatType, convertMarkdownTable, renderTable, escapeLoneUnderscores, pareseMarkdown, sanitizeContent, previewImage, openFile, formatFileSize, parseFileInfo, selectNormalChat, showNewChatModal, closeNewChatModal, isChatSidebar, handleChatSidebar, goWorkSpace, goCloudDatabase, logOut, previewFileArray, uploadPhoto, deleteImage, fileList, uploadFile, handleConnect, isThinking, isSelfSent, isUploading, isLoadingMessages, uploadedFiles, streamingMessageId, showMessageModal, detailLinks, handleChatContentClick, extractLinks, extractFileNameFromUrl, showMessageDetail, closeMessageDetail, downloadToast, get downloadToastTimer() {
|
||||
const __returned__ = { friendSocketStore, handleFriendConnect, socketStore, ChatType, wyxdWorkspaceId, wyxdFilePath, wyxdFileName, wyxdUserToken, hasWyxdFile, convertMarkdownTable, renderTable, escapeLoneUnderscores, pareseMarkdown, sanitizeContent, previewImage, openFile, formatFileSize, parseFileInfo, selectNormalChat, showNewChatModal, closeNewChatModal, isChatSidebar, handleChatSidebar, goWorkSpace, goWyxdViewer, goCloudDatabase, logOut, previewFileArray, uploadPhoto, deleteImage, fileList, uploadFile, handleConnect, isThinking, isSelfSent, isUploading, isLoadingMessages, uploadedFiles, streamingMessageId, showMessageModal, detailLinks, handleChatContentClick, extractLinks, extractFileNameFromUrl, showMessageDetail, closeMessageDetail, downloadToast, get downloadToastTimer() {
|
||||
return downloadToastTimer;
|
||||
}, set downloadToastTimer(v) {
|
||||
downloadToastTimer = v;
|
||||
}, showDownloadToast, hideDownloadToast, openLink, downloadAndHandle, sendMessage, sendFriendMessage, sendGroupMessage, sendAIMessage, stopConversation, textMessage, UserConversations, currentSessionId, userToken, UserId, UserAvatar, UserData, takeUserInfo, takeUserConversations, FriendInfoList, takeFriendList, takeTalkUserAvatar, takeUserAvatar, GroupList, takeGroupList, groupMemberList, takeGroupMemberAvatar, getGroupMemberAvatarById, allmessages, scrollToView, bottomToggle, isLoadingMore, currentPage, currentMessages, takeConversationMessages, takeFriendMessages, takeGroupMessages, onScroll, scrollToBottom, computed: vue.computed, getCurrentInstance: vue.getCurrentInstance, nextTick: vue.nextTick, onMounted: vue.onMounted, ref: vue.ref, watch: vue.watch, get onShow() {
|
||||
}, showDownloadToast, hideDownloadToast, openLink, downloadAndHandle, sendMessage, sendFriendMessage, sendGroupMessage, sendAIMessage, stopConversation, textMessage, UserConversations, currentSessionId, userToken, UserId, UserAvatar, UserData, takeUserInfo, takeUserConversations, FriendInfoList, takeFriendList, takeTalkUserAvatar, takeUserAvatar, GroupList, takeGroupList, groupMemberList, takeGroupMemberAvatar, getGroupMemberAvatarById, allmessages, scrollToView, bottomToggle, isLoadingMore, currentPage, currentMessages, takeConversationMessages, takeFriendMessages, takeGroupMessages, onScroll, scrollToBottom, computed: vue.computed, getCurrentInstance: vue.getCurrentInstance, nextTick: vue.nextTick, onMounted: vue.onMounted, ref: vue.ref, watch: vue.watch, get onLoad() {
|
||||
return onLoad;
|
||||
}, get onShow() {
|
||||
return onShow;
|
||||
}, get onUnload() {
|
||||
return onUnload;
|
||||
@@ -6790,6 +6812,30 @@ This will fail in production.`);
|
||||
])
|
||||
])
|
||||
]),
|
||||
$setup.hasWyxdFile ? (vue.openBlock(), vue.createElementBlock("view", {
|
||||
key: 0,
|
||||
class: "wyxd-banner"
|
||||
}, [
|
||||
vue.createElementVNode("view", { class: "wyxd-banner-icon iconfont icon-wenjian" }),
|
||||
vue.createElementVNode(
|
||||
"view",
|
||||
{
|
||||
class: "wyxd-banner-text",
|
||||
onClick: $setup.goWyxdViewer
|
||||
},
|
||||
"查看: " + vue.toDisplayString($setup.wyxdFileName),
|
||||
1
|
||||
/* TEXT */
|
||||
),
|
||||
vue.createElementVNode("view", {
|
||||
class: "wyxd-banner-arrow",
|
||||
onClick: $setup.goWyxdViewer
|
||||
}, "›"),
|
||||
vue.createElementVNode("view", {
|
||||
class: "wyxd-banner-close",
|
||||
onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => $setup.hasWyxdFile = false, ["stop"]))
|
||||
}, "×")
|
||||
])) : vue.createCommentVNode("v-if", true),
|
||||
vue.createElementVNode("view", { class: "main-chat" }, [
|
||||
vue.createElementVNode("scroll-view", {
|
||||
class: "chat-messages",
|
||||
@@ -7125,7 +7171,7 @@ This will fail in production.`);
|
||||
"view",
|
||||
{
|
||||
class: vue.normalizeClass(["chat-interactive-btn", { disabled: $setup.isThinking }]),
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => !$setup.isThinking && $setup.uploadPhoto())
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => !$setup.isThinking && $setup.uploadPhoto())
|
||||
},
|
||||
"拍照上传",
|
||||
2
|
||||
@@ -7135,7 +7181,7 @@ This will fail in production.`);
|
||||
"view",
|
||||
{
|
||||
class: vue.normalizeClass(["chat-interactive-btn", { disabled: $setup.isThinking }]),
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => !$setup.isThinking && $setup.uploadFile())
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => !$setup.isThinking && $setup.uploadFile())
|
||||
},
|
||||
"上传文件",
|
||||
2
|
||||
@@ -7183,7 +7229,7 @@ This will fail in production.`);
|
||||
class: "message-input",
|
||||
placeholder: $setup.isThinking ? $setup.isSelfSent ? "AI 正在回复中..." : "电脑正在运行,请稍后" : "输入消息...",
|
||||
disabled: $setup.isThinking,
|
||||
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.textMessage = $event),
|
||||
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.textMessage = $event),
|
||||
"auto-height": ""
|
||||
}, null, 8, ["placeholder", "disabled"]), [
|
||||
[vue.vModelText, $setup.textMessage]
|
||||
@@ -7197,7 +7243,7 @@ This will fail in production.`);
|
||||
])) : (vue.openBlock(), vue.createElementBlock("view", {
|
||||
key: 1,
|
||||
class: "input-btn-group send-message-btn",
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $setup.sendMessage())
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $setup.sendMessage())
|
||||
}, [
|
||||
vue.createElementVNode("view", { class: "iconfont icon-fasong" })
|
||||
]))
|
||||
@@ -7219,7 +7265,7 @@ This will fail in production.`);
|
||||
}, [
|
||||
vue.createElementVNode("view", {
|
||||
class: "ncd-card message-detail-card",
|
||||
onClick: _cache[9] || (_cache[9] = vue.withModifiers(() => {
|
||||
onClick: _cache[10] || (_cache[10] = vue.withModifiers(() => {
|
||||
}, ["stop"]))
|
||||
}, [
|
||||
vue.createElementVNode("view", { class: "ncd-header" }, [
|
||||
@@ -7465,10 +7511,26 @@ This will fail in production.`);
|
||||
if (isSelectFolder.value)
|
||||
return;
|
||||
const isWyxd = folder.name && folder.name.toLowerCase().endsWith(".wyxd");
|
||||
const itemList = isWyxd ? ["下载", "删除", "WYXD查看器"] : ["下载", "删除"];
|
||||
const itemList = isWyxd ? ["下载", "AI修改", "删除", "WYXD查看器"] : ["下载", "删除"];
|
||||
uni.showActionSheet({
|
||||
itemList,
|
||||
success: (res) => {
|
||||
if (isWyxd) {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
handleDownload(folder);
|
||||
break;
|
||||
case 1:
|
||||
handleAiModify(folder);
|
||||
break;
|
||||
case 2:
|
||||
handleDelete(folder);
|
||||
break;
|
||||
case 3:
|
||||
openWyxdViewer(folder);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (res.tapIndex) {
|
||||
case 0:
|
||||
handleDownload(folder);
|
||||
@@ -7476,10 +7538,7 @@ This will fail in production.`);
|
||||
case 1:
|
||||
handleDelete(folder);
|
||||
break;
|
||||
case 2:
|
||||
if (isWyxd)
|
||||
openWyxdViewer(folder);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -7511,7 +7570,7 @@ This will fail in production.`);
|
||||
initCurrentFolderList();
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:338", "重命名失败:", error);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:352", "重命名失败:", error);
|
||||
uni.showToast({
|
||||
title: typeof error === "string" ? error : "重命名失败,请重试",
|
||||
icon: "error"
|
||||
@@ -7556,7 +7615,7 @@ This will fail in production.`);
|
||||
uni.hideLoading();
|
||||
if (downloadRes.statusCode === 200) {
|
||||
const tempPath = downloadRes.tempFilePath;
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:395", "// 下载成功,文件下载路径为:", tempPath);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:409", "// 下载成功,文件下载路径为:", tempPath);
|
||||
openFile(tempPath);
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -7567,7 +7626,7 @@ This will fail in production.`);
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:406", "下载文件失败:", err);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:420", "下载文件失败:", err);
|
||||
uni.showToast({
|
||||
title: "下载失败,请重试",
|
||||
icon: "error"
|
||||
@@ -7576,7 +7635,7 @@ This will fail in production.`);
|
||||
});
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:415", "获取下载链接失败:", error);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:429", "获取下载链接失败:", error);
|
||||
uni.showToast({
|
||||
title: "获取下载链接失败,请重试",
|
||||
icon: "error"
|
||||
@@ -7591,7 +7650,7 @@ This will fail in production.`);
|
||||
icon: "success"
|
||||
}),
|
||||
fail: (err) => {
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:432", "打开文件失败:", err);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:446", "打开文件失败:", err);
|
||||
uni.showToast({
|
||||
title: "无法打开此文件",
|
||||
icon: "error"
|
||||
@@ -7608,7 +7667,7 @@ This will fail in production.`);
|
||||
icon: "success"
|
||||
}),
|
||||
fail: (err) => {
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:451", "打开文件失败:", err);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:465", "打开文件失败:", err);
|
||||
uni.showToast({
|
||||
title: "无法打开此文件",
|
||||
icon: "error"
|
||||
@@ -7618,14 +7677,20 @@ This will fail in production.`);
|
||||
};
|
||||
const openWyxdViewer = (folder) => {
|
||||
const filePath = folder.path.startsWith("./") ? folder.path.slice(2) : folder.path;
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:463", "解析文件路径:", filePath);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:464", "folder", folder);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:465", "encode", encodeURIComponent(filePath));
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:466", "encode", encodeURIComponent(folder.name));
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:477", "解析文件路径:", filePath);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:478", "folder", folder);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:479", "encode", encodeURIComponent(filePath));
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:480", "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)
|
||||
});
|
||||
};
|
||||
const handleAiModify = (folder) => {
|
||||
const filePath = folder.path.startsWith("./") ? folder.path.slice(2) : folder.path;
|
||||
uni.navigateTo({
|
||||
url: "/pages/Chat/Chat?wyxdWorkspaceId=" + encodeURIComponent(workspaceId.value) + "&wyxdFilePath=" + encodeURIComponent(filePath) + "&wyxdFileName=" + encodeURIComponent(folder.name) + "&wyxdUserToken=" + encodeURIComponent(UserToken.value)
|
||||
});
|
||||
};
|
||||
const handleDelete = (folder) => {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
@@ -7634,7 +7699,7 @@ This will fail in production.`);
|
||||
if (res.confirm) {
|
||||
try {
|
||||
const filePath = `./${folder.path}`;
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:485", "删除的是:", filePath);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:510", "删除的是:", filePath);
|
||||
await daleteWorkspace(UserToken.value, workspaceId.value, filePath);
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
@@ -7642,7 +7707,7 @@ This will fail in production.`);
|
||||
});
|
||||
initCurrentFolderList();
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:493", "删除失败:", error);
|
||||
formatAppLog("error", "at pages/WorkSpace/WorkSpace.vue:518", "删除失败:", error);
|
||||
uni.showToast({
|
||||
title: "删除失败,请重试",
|
||||
icon: "error"
|
||||
@@ -7710,7 +7775,7 @@ This will fail in production.`);
|
||||
const currentFolderList = vue.ref([]);
|
||||
const getCurrentFolderList = () => {
|
||||
var _a, _b;
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:574", "当前路径为:", JSON.stringify(folderStack.value));
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:599", "当前路径为:", 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) || [];
|
||||
@@ -7734,7 +7799,7 @@ This will fail in production.`);
|
||||
const initCurrentFolderList = async () => {
|
||||
workspaceId.value = getWorkspaceId();
|
||||
UserToken.value = getToken();
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:601", "getWorkspaceId:", workspaceId.value);
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:626", "getWorkspaceId:", workspaceId.value);
|
||||
allFoldersData.value = await getWorkspaceList(UserToken.value, workspaceId.value);
|
||||
currentFolderList.value = getCurrentFolderList();
|
||||
};
|
||||
@@ -7781,7 +7846,7 @@ This will fail in production.`);
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
fail() {
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:661", "返回失败,进入兜底跳转");
|
||||
formatAppLog("log", "at pages/WorkSpace/WorkSpace.vue:686", "返回失败,进入兜底跳转");
|
||||
uni.reLaunch({
|
||||
url: "/pages/Chat/Chat"
|
||||
});
|
||||
@@ -7792,7 +7857,7 @@ This will fail in production.`);
|
||||
vue.onMounted(() => {
|
||||
initCurrentFolderList();
|
||||
});
|
||||
const __returned__ = { UserToken, workspaceId, navbarBeforeTitle, navbarTitle, isSelectFolder, selectFileList, handleSelectFolder, selectFolder, showNewFolder, isNFNFocused, newFolderName, closeNewFolderModal, newWorkspaceFolder, handleUploadFile, doUploadWorkspaceFiles, currentFolderPath, folderPathPreview, confirmCreateFolder, handleLongPress, handleRename, handleDownload, openFile, openFileWithMenu, openWyxdViewer, handleDelete, isMenuOpen, handleMenu, searchKeyword, isSearchFocus, handleSearchFocus, getFileIcon, allFoldersData, folderStack, currentFolderList, getCurrentFolderList, initCurrentFolderList, handleFolderClick, handleSelectAll, handleBackOrCheck, onMounted: vue.onMounted, ref: vue.ref, computed: vue.computed, get getWorkspaceId() {
|
||||
const __returned__ = { UserToken, workspaceId, navbarBeforeTitle, navbarTitle, isSelectFolder, selectFileList, handleSelectFolder, selectFolder, showNewFolder, isNFNFocused, newFolderName, closeNewFolderModal, newWorkspaceFolder, handleUploadFile, doUploadWorkspaceFiles, currentFolderPath, folderPathPreview, confirmCreateFolder, handleLongPress, handleRename, handleDownload, openFile, openFileWithMenu, openWyxdViewer, handleAiModify, handleDelete, isMenuOpen, handleMenu, searchKeyword, isSearchFocus, handleSearchFocus, getFileIcon, allFoldersData, folderStack, currentFolderList, getCurrentFolderList, initCurrentFolderList, handleFolderClick, handleSelectAll, handleBackOrCheck, onMounted: vue.onMounted, ref: vue.ref, computed: vue.computed, get getWorkspaceId() {
|
||||
return getWorkspaceId;
|
||||
}, get getToken() {
|
||||
return getToken;
|
||||
@@ -18117,7 +18182,7 @@ This will fail in production.`);
|
||||
fileName: fileName.value,
|
||||
userToken: userToken.value
|
||||
});
|
||||
if (isWyxdCached(workspaceId.value, filePath.value)) {
|
||||
if (options.forceDownload !== "1" && isWyxdCached(workspaceId.value, filePath.value)) {
|
||||
loadFromCache();
|
||||
} else {
|
||||
startDownload();
|
||||
|
||||
51
unpackage/dist/dev/app-plus/pages/Chat/Chat.css
vendored
51
unpackage/dist/dev/app-plus/pages/Chat/Chat.css
vendored
@@ -1006,10 +1006,12 @@ to { opacity: 1; transform: translateY(0) scale(1);
|
||||
font-size: 1.125rem;
|
||||
font-weight: 700;
|
||||
color: #1a1a2e;
|
||||
align-items: center;
|
||||
}
|
||||
.ncd-header uni-icons[data-v-5eb7b895] {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.ncd-options[data-v-5eb7b895] {
|
||||
display: flex;
|
||||
@@ -1192,6 +1194,55 @@ to { opacity: 1; transform: translateY(0) scale(1);
|
||||
.log-out .iconfont[data-v-5eb7b895] {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
/* ==========WYXD 文件入口横幅========== */
|
||||
.wyxd-banner[data-v-5eb7b895] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.4375rem 0.75rem;
|
||||
margin: 0.1875rem 0.625rem;
|
||||
background: linear-gradient(135deg, #e8f4fd, #f0e6ff);
|
||||
border: 0.04688rem solid rgba(120, 120, 220, 0.25);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 0.0625rem 0.25rem rgba(100, 100, 200, 0.08);
|
||||
}
|
||||
.wyxd-banner[data-v-5eb7b895]:active {
|
||||
background: linear-gradient(135deg, #d8eafb, #e6d8ff);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
.wyxd-banner-icon[data-v-5eb7b895] {
|
||||
font-size: 1rem;
|
||||
color: #6c6ce0;
|
||||
margin-right: 0.375rem;
|
||||
}
|
||||
.wyxd-banner-text[data-v-5eb7b895] {
|
||||
flex: 1;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: #4a4ab8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wyxd-banner-arrow[data-v-5eb7b895] {
|
||||
font-size: 0.75rem;
|
||||
color: #9999cc;
|
||||
}
|
||||
.wyxd-banner-close[data-v-5eb7b895] {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
line-height: 1.125rem;
|
||||
text-align: center;
|
||||
font-size: 0.875rem;
|
||||
color: #9999cc;
|
||||
border-radius: 50%;
|
||||
background: rgba(100, 100, 200, 0.08);
|
||||
margin-left: 0.25rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wyxd-banner-close[data-v-5eb7b895]:active {
|
||||
background: rgba(100, 100, 200, 0.18);
|
||||
color: #6c6ce0;
|
||||
}
|
||||
/* ==========聊天主体部分========== */
|
||||
.main-chat[data-v-5eb7b895] {
|
||||
display: flex;
|
||||
|
||||
51
unpackage/dist/dev/app-plus/pages/text/text.css
vendored
51
unpackage/dist/dev/app-plus/pages/text/text.css
vendored
@@ -1006,10 +1006,12 @@ to { opacity: 1; transform: translateY(0) scale(1);
|
||||
font-size: 1.125rem;
|
||||
font-weight: 700;
|
||||
color: #1a1a2e;
|
||||
align-items: center;
|
||||
}
|
||||
.ncd-header uni-icons[data-v-fdf84df1] {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
}
|
||||
.ncd-options[data-v-fdf84df1] {
|
||||
display: flex;
|
||||
@@ -1192,6 +1194,55 @@ to { opacity: 1; transform: translateY(0) scale(1);
|
||||
.log-out .iconfont[data-v-fdf84df1] {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
/* ==========WYXD 文件入口横幅========== */
|
||||
.wyxd-banner[data-v-fdf84df1] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.4375rem 0.75rem;
|
||||
margin: 0.1875rem 0.625rem;
|
||||
background: linear-gradient(135deg, #e8f4fd, #f0e6ff);
|
||||
border: 0.04688rem solid rgba(120, 120, 220, 0.25);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 0.0625rem 0.25rem rgba(100, 100, 200, 0.08);
|
||||
}
|
||||
.wyxd-banner[data-v-fdf84df1]:active {
|
||||
background: linear-gradient(135deg, #d8eafb, #e6d8ff);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
.wyxd-banner-icon[data-v-fdf84df1] {
|
||||
font-size: 1rem;
|
||||
color: #6c6ce0;
|
||||
margin-right: 0.375rem;
|
||||
}
|
||||
.wyxd-banner-text[data-v-fdf84df1] {
|
||||
flex: 1;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: #4a4ab8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wyxd-banner-arrow[data-v-fdf84df1] {
|
||||
font-size: 0.75rem;
|
||||
color: #9999cc;
|
||||
}
|
||||
.wyxd-banner-close[data-v-fdf84df1] {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
line-height: 1.125rem;
|
||||
text-align: center;
|
||||
font-size: 0.875rem;
|
||||
color: #9999cc;
|
||||
border-radius: 50%;
|
||||
background: rgba(100, 100, 200, 0.08);
|
||||
margin-left: 0.25rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.wyxd-banner-close[data-v-fdf84df1]:active {
|
||||
background: rgba(100, 100, 200, 0.18);
|
||||
color: #6c6ce0;
|
||||
}
|
||||
/* ==========聊天主体部分========== */
|
||||
.main-chat[data-v-fdf84df1] {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user