实现ai对话(电脑同步)

This commit is contained in:
2026-06-06 18:10:29 +08:00
parent dd4975fd2c
commit d284789240
23 changed files with 3768 additions and 1548 deletions

View File

@@ -475,6 +475,10 @@
// 跳转到工作区 // 跳转到工作区
const goWorkSpace = () => { const goWorkSpace = () => {
// 保存当前会话id确保从工作区返回时能恢复
if (currentSessionId.value) {
uni.setStorageSync('currentSessionId', currentSessionId.value)
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/WorkSpace/WorkSpace' url: '/pages/WorkSpace/WorkSpace'
}) })
@@ -732,6 +736,9 @@
// }) // })
// } // }
// } // }
// AI 回复超时定时器
let aiResponseTimer = null
// 发送AI消息 // 发送AI消息
const sendAIMessage = async () => { const sendAIMessage = async () => {
try { try {
@@ -750,7 +757,16 @@
} }
socketStore.send(data) socketStore.send(data)
isThinking.value = true isThinking.value = true
await waitForAIResponse(); // 3分钟超时
aiResponseTimer = setTimeout(() => {
uni.showToast({
title: 'AI回复超时请重试',
icon: 'none'
})
isThinking.value = false
textMessage.value = ''
uploadedFiles.value = []
}, 180000)
} catch (error) { } catch (error) {
isThinking.value = false isThinking.value = false
uni.showToast({ uni.showToast({
@@ -760,43 +776,20 @@
} }
} }
// 等待ai回复信息并保存到数据库 // 全局监听 socketStore.isThinkingtrue → false 时表示 AI 回复结束
const waitForAIResponse = () => { watch(() => socketStore.isThinking, (newVal, oldVal) => {
return new Promise((resolve, reject) => {
// 设置超时
const timeout = setTimeout(() => {
unwatch()
reject(new Error('等待AI回复超时'));
}, 180000); // 3分钟超时
const finish = async () => {
try {
console.log("ai返回的消息", socketStore.messageString);
console.log('AI回复结束刷新消息列表');
await takeConversationMessages();
resolve();
} catch (error) {
console.error('保存AI回复失败', error);
reject(error);
} finally {
isThinking.value = false
textMessage.value = ''
uploadedFiles.value = []
unwatch();
clearTimeout(timeout);
}
}
// 监听 isThinkingfalse → true 时不做处理true → false 时表示 AI 回复结束
const unwatch = watch(() => socketStore.isThinking, (newVal, oldVal) => {
console.log("isThinking 变化:", oldVal, "→", newVal); console.log("isThinking 变化:", oldVal, "→", newVal);
// AI 回复结束:从 true 变为 false且已有回复内容 // AI 回复结束:从 true 变为 false且已有回复内容
if (oldVal && !newVal && socketStore.messageString) { if (oldVal && !newVal && socketStore.messageString) {
finish() clearTimeout(aiResponseTimer)
console.log("ai返回的消息", socketStore.messageString);
console.log('AI回复结束刷新消息列表');
takeConversationMessages()
isThinking.value = false
textMessage.value = ''
uploadedFiles.value = []
} }
}) })
})
}
const textMessage = ref('') const textMessage = ref('')
@@ -829,11 +822,13 @@
console.log("token:", userToken.value); console.log("token:", userToken.value);
UserConversations.value = await getUserConversations(userToken.value) || []; UserConversations.value = await getUserConversations(userToken.value) || [];
console.log("UserConversations:", UserConversations.value); console.log("UserConversations:", UserConversations.value);
// 获取列表第一个会话 // 优先恢复已保存的会话id避免刷新到列表第一个
if (UserConversations.value.length > 0) { const savedSessionId = getCurrentSessionId();
currentSessionId.value = UserConversations.value[0]._id; // 假设会话对象有 id 字段 if (savedSessionId && UserConversations.value.some(c => c._id === savedSessionId)) {
currentSessionId.value = savedSessionId;
} else if (UserConversations.value.length > 0) {
currentSessionId.value = UserConversations.value[0]._id;
} else { } else {
// 如果没有会话,可以创建一个默认会话或设为空
currentSessionId.value = ''; currentSessionId.value = '';
} }
console.log('保存会话id', currentSessionId.value); console.log('保存会话id', currentSessionId.value);

View File

@@ -1,3 +1,87 @@
/* 新建文件夹弹窗样式 */
.create-folder-name {
display: flex;
width: 100%;
padding: 10rpx 20rpx;
box-sizing: border-box;
align-items: center;
background-color: rgba(194, 191, 211, 0.1);
border-radius: 10rpx;
}
.create-folder-name input {
box-sizing: border-box;
width: 100%;
}
.create-folder-name.has-value {
background-color: #ffffff;
border: 2rpx solid #aaaaff;
box-shadow: 0 0 15rpx #aaaaff;
}
/* 新建文件夹弹窗内部样式 */
.new-folder-name {
font-size: 28rpx;
color: #666;
margin-bottom: 12rpx;
}
.nf-path-label {
font-size: 26rpx;
color: #999;
margin-top: 24rpx;
margin-bottom: 8rpx;
}
.nf-path-display {
font-size: 28rpx;
color: #333;
padding: 12rpx 20rpx;
background: #f5f5f5;
border-radius: 10rpx;
word-break: break-all;
}
.nf-path-preview {
font-size: 28rpx;
color: #0073ff;
padding: 12rpx 20rpx;
background: rgba(0, 115, 255, 0.05);
border: 2rpx dashed rgba(0, 115, 255, 0.3);
border-radius: 10rpx;
word-break: break-all;
}
.option-wrapper {
display: flex;
justify-content: space-between;
gap: 20rpx;
margin-top: 40rpx;
}
.opt-btn {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 24rpx 0;
border-radius: 12rpx;
font-size: 30rpx;
}
.opt-cancel {
background: #f5f5f5;
color: #666;
}
.opt-confirm {
background: linear-gradient(135deg, #0073ff, #3ab0ff);
color: #fff;
}
.workspace-container { .workspace-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -145,6 +229,7 @@
transform: translateX(-50%); transform: translateX(-50%);
font-size: 32rpx; font-size: 32rpx;
} }
.folder-null .iconfont { .folder-null .iconfont {
font-size: 180rpx; font-size: 180rpx;
} }
@@ -152,7 +237,7 @@
.folder-grid { .folder-grid {
width: 100%; width: 100%;
display: grid; display: grid;
grid-template-columns: repeat(3,1fr); grid-template-columns: repeat(3, 1fr);
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
gap: 20rpx; gap: 20rpx;
@@ -165,6 +250,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
min-width: 0;
} }
.folder-item.select-folder { .folder-item.select-folder {
@@ -172,6 +258,19 @@
background: rgba(9, 9, 9, 0.1); background: rgba(9, 9, 9, 0.1);
} }
.folder-item .folder-name {
max-width: 150rpx;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
text-align: center;
line-height: 40rpx;
min-width: 0;
}
.folder-item-style { .folder-item-style {
font-size: 160rpx !important; font-size: 160rpx !important;
font-weight: 10rpx !important; font-weight: 10rpx !important;

View File

@@ -1,7 +1,40 @@
<template> <template>
<view class="status-bar"></view> <view class="status-bar"></view>
<view class="workspace-container page-container">
<!-- ===== 新建文件夹设置弹窗 ===== -->
<view v-if="showNewFolder" class="popup-overlay" @click="closeNewFolderModal">
<view class="popup-card" @click.stop>
<!-- 关闭按钮 -->
<view class="close-popup-card" @click="closeNewFolderModal">
<view class="iconfont icon-quxiao"></view>
</view>
<!-- 标题 -->
<view class="popup-title">新建工作区目录</view>
<!-- 目录名称输入 -->
<view class="new-folder-name">目录名称</view>
<view class="create-folder-name" :class="{'has-value': isNFNFocused || newFolderName}">
<input v-model="newFolderName" @focus="isNFNFocused=true"
@blur="isNFNFocused=false" type="text" placeholder="输入目录名称,如:项目资料/设计图" />
</view>
<!-- 当前路径 -->
<view class="nf-path-label">当前路径</view>
<view class="nf-path-display">{{ currentFolderPath }}</view>
<!-- 路径预览 -->
<view class="nf-path-label">路径预览</view>
<view class="nf-path-preview">{{ folderPathPreview }}</view>
<!-- 底部按钮 -->
<view class="option-wrapper">
<view class="opt-btn opt-cancel" @click="closeNewFolderModal">取消</view>
<view class="opt-btn opt-confirm" @click="confirmCreateFolder">确认</view>
</view>
</view>
</view>
<view class="workspace-container page-container">
<view class="workspace-header"> <view class="workspace-header">
<view class="custom-navbar"> <view class="custom-navbar">
<view class="navbar-left" @click="handleBackOrCheck "> <view class="navbar-left" @click="handleBackOrCheck ">
@@ -19,7 +52,7 @@
<view v-if="isMenuOpen" class="menu-card"> <view v-if="isMenuOpen" class="menu-card">
<view class="menu-card-item" @click="handleSelectFolder();handleMenu()">选择</view> <view class="menu-card-item" @click="handleSelectFolder();handleMenu()">选择</view>
<view class="solid-line"></view> <view class="solid-line"></view>
<view class="menu-card-item">新建文件夹</view> <view class="menu-card-item" @click="newWorkspaceFolder();handleMenu()">新建文件夹</view>
</view> </view>
</view> </view>
<view class="search-file-warpper"> <view class="search-file-warpper">
@@ -38,15 +71,17 @@
文件夹为空 文件夹为空
</view> </view>
<view class="folder-grid" v-if="currentFolderList.length>0"> <view class="folder-grid" v-if="currentFolderList.length>0">
<view class="folder-item" :class="{'select-folder':selectFileList.includes(folder.id)}" <view class="folder-item" :class="{'select-folder':selectFileList.includes(folder.path)}"
v-for="folder in currentFolderList" :key="folder.id" v-for="folder in currentFolderList" :key="folder.path"
@click="isSelectFolder?selectFolder(folder.id):handleFolderClick(folder)" @click="isSelectFolder?selectFolder(folder.path):handleFolderClick(folder)"
@longpress="handleLongPress(folder)"> @longpress="handleLongPress(folder)">
<view class="iconfont icon-a-wenjianjiawenjian folder-item-style"></view> <view v-if="folder.type === 'directory'"
class="iconfont icon-a-wenjianjiawenjian folder-item-style"></view>
<view v-else class="iconfont folder-item-style" :class="getFileIcon(folder.extension)"></view>
<view class="folder-name">{{folder.name}}</view> <view class="folder-name">{{folder.name}}</view>
<view v-if="isSelectFolder" class="folder-checkbox" <view v-if="isSelectFolder" class="folder-checkbox"
:class="{'select-folder':selectFileList.includes(folder.id)}"> :class="{'select-folder':selectFileList.includes(folder.path)}">
<uni-icons v-if="selectFileList.includes(folder.id)" type="checkmarkempty" <uni-icons v-if="selectFileList.includes(folder.path)" type="checkmarkempty"
color="#fff"></uni-icons> color="#fff"></uni-icons>
</view> </view>
</view> </view>
@@ -65,11 +100,21 @@
<script setup> <script setup>
import { import {
onMounted, onMounted,
ref ref,
computed
} from 'vue'; } from 'vue';
import {getWorkspaceId} from '@/utils/user-info.js' import {
import {getWorkspaceList} from '@/utils/cloud-api.js' getWorkspaceId,
getToken
} from '@/utils/user-info.js'
import {
getWorkspaceList,
createWorkspaceFolder,
daleteWorkspace,
getWorkspaceFileURL
} from '@/utils/cloud-api.js'
const UserToken = ref('')
const workspaceId = ref('') const workspaceId = ref('')
const navbarBeforeTitle = ref(''); const navbarBeforeTitle = ref('');
const navbarTitle = ref('工作区'); const navbarTitle = ref('工作区');
@@ -91,12 +136,62 @@
selectFileList.value.push(id); selectFileList.value.push(id);
} }
} }
// 新建文件夹
const showNewFolder = ref(false)
const isNFNFocused = ref(false)
const newFolderName = ref('')
const closeNewFolderModal = () => {
showNewFolder.value = false
newFolderName.value = ''
}
const newWorkspaceFolder = () => {
showNewFolder.value = true
}
// 当前文件夹路径
const currentFolderPath = computed(() => {
if (folderStack.value.length === 0) return '根目录'
return '/' + folderStack.value.map(f => f.name).join('/')
})
// 路径预览:./ + 当前路径 + 新文件夹名
const folderPathPreview = computed(() => {
const folderPath = folderStack.value.map(f => f.name).join('/')
const name = newFolderName.value.trim()
if (name) {
return folderPath ? `./${folderPath}/${name}` : `./${name}`
}
return folderPath ? `./${folderPath}/` : './'
})
// 确认创建文件夹
const confirmCreateFolder = async () => {
const name = newFolderName.value.trim()
if (!name) {
uni.showToast({ title: '请输入目录名称', icon: 'none' })
return
}
try {
// 拼接路径:./ 开头,如 ./项目资料/设计图
const folderPath = folderStack.value.map(f => f.name).join('/')
const dirPath = folderPath ? `./${folderPath}/${name}` : `./${name}`
await createWorkspaceFolder(UserToken.value, workspaceId.value, dirPath)
uni.showToast({ title: '创建成功', icon: 'success' })
closeNewFolderModal()
initCurrentFolderList()
} catch (error) {
console.error('创建文件夹失败:', error)
uni.showToast({ title: '创建失败,请重试', icon: 'error' })
}
}
// 长按文件
const handleLongPress = (folder) => { const handleLongPress = (folder) => {
if (isSelectFolder.value) return; if (isSelectFolder.value) return;
uni.showActionSheet({ uni.showActionSheet({
itemList:['重命名','删除','下载','压缩'], itemList: ['重命名', '删除', '下载', '压缩'],
success: (res) => { success: (res) => {
switch(res.tapIndex) { switch (res.tapIndex) {
case 0: case 0:
handleRename(folder); handleRename(folder);
break; break;
@@ -130,24 +225,155 @@
}); });
}; };
// 移动 // // 下载文件
const handleDownload = (folder) => { // const handleDownload = async (folder) => {
// 可以选择跳转到移动页面或显示选择器 // // 目录不能下载
// if (folder.type === 'directory') {
// uni.showToast({ title: '暂不支持下载目录', icon: 'none' });
// return;
// }
// try {
// uni.showLoading({ title: '获取下载链接...' });
// // 构建文件路径,去掉开头的 ./
// const filePath = folder.path.startsWith('./') ? folder.path.slice(2) : folder.path;
// const result = await getWorkspaceFileURL(UserToken.value, workspaceId.value, filePath);
// uni.hideLoading();
// // 接口返回数组,取第一个文件的 url
// const fileInfo = Array.isArray(result) ? result[0] : result;
// if (!fileInfo || !fileInfo.url) {
// uni.showToast({ title: '获取下载链接失败', icon: 'error' });
// return;
// }
// const downloadUrl = fileInfo.url;
// const fileName = folder.name;
// uni.showLoading({ title: '下载中...' });
// uni.downloadFile({
// url: downloadUrl,
// success: (downloadRes) => {
// uni.hideLoading();
// if (downloadRes.statusCode === 200) {
// // 保存到手机相册/文件
// uni.saveFile({
// tempFilePath: downloadRes.tempFilePath,
// success: (saveRes) => {
// uni.showToast({ title: '下载成功', icon: 'success' });
// console.log('文件已保存到:', saveRes.savedFilePath);
// },
// fail: (err) => {
// console.error('保存文件失败:', err);
// uni.showToast({ title: '保存文件失败', icon: 'error' });
// }
// });
// } else {
// uni.showToast({ title: '下载失败', icon: 'error' });
// }
// },
// fail: (err) => {
// uni.hideLoading();
// console.error('下载文件失败:', err);
// uni.showToast({ title: '下载失败,请重试', icon: 'error' });
// }
// });
// } catch (error) {
// uni.hideLoading();
// console.error('获取下载链接失败:', error);
// uni.showToast({ title: '获取下载链接失败,请重试', icon: 'error' });
// }
// };
const handleDownload = async (folder) => {
// 目录不能下载
if (folder.type === 'directory') {
uni.showToast({ title: '暂不支持下载目录', icon: 'none' });
return;
}
try {
uni.showLoading({ title: '获取下载链接...' });
// 构建文件路径,去掉开头的 ./
const filePath = folder.path.startsWith('./') ? folder.path.slice(2) : folder.path;
const result = await getWorkspaceFileURL(UserToken.value, workspaceId.value, filePath);
uni.hideLoading();
// 接口返回数组,取第一个文件的 url
const fileInfo = Array.isArray(result) ? result[0] : result;
if (!fileInfo || !fileInfo.url) {
uni.showToast({ title: '获取下载链接失败', icon: 'error' });
return;
}
const downloadUrl = fileInfo.url;
const fileName = folder.name;
uni.showLoading({ title: '下载中...' });
uni.downloadFile({
url: downloadUrl,
name: fileName, // 重要:指定文件名,保证打开正常
success: (downloadRes) => {
uni.hideLoading();
if (downloadRes.statusCode === 200) {
// 下载成功 → 直接打开文件
uni.openDocument({
filePath: downloadRes.tempFilePath,
showMenu: true, // 右上角显示 分享/保存 按钮
success: () => {
uni.showToast({ uni.showToast({
title: '移动功能开发中', title: '打开成功',
icon: 'none' icon: 'success'
}); });
},
fail: (err) => {
console.error('打开失败:', err);
uni.showToast({
title: '无法打开此文件',
icon: 'error'
});
}
});
} else {
uni.showToast({ title: '下载失败', icon: 'error' });
}
},
fail: (err) => {
uni.hideLoading();
console.error('下载文件失败:', err);
uni.showToast({ title: '下载失败,请重试', icon: 'error' });
}
});
} catch (error) {
uni.hideLoading();
console.error('获取下载链接失败:', error);
uni.showToast({ title: '获取下载链接失败,请重试', icon: 'error' });
}
}; };
// 删除 // 删除
const handleDelete = (folder) => { const handleDelete = (folder) => {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: `确定要删除文件夹"${folder.name}"吗?`, content: `确定要删除"${folder.name}"吗?`,
success: (res) => { success: async (res) => {
if (res.confirm) { if (res.confirm) {
// deleteFolder(folder.id); try {
console.log('确认删除文件夹'); // 路径加 ./ 前缀
const filePath = `./${folder.path}`
console.log("删除的是:",filePath);
await daleteWorkspace(UserToken.value, workspaceId.value, filePath)
uni.showToast({ title: '删除成功', icon: 'success' })
initCurrentFolderList()
} catch (error) {
console.error('删除失败:', error)
uni.showToast({ title: '删除失败,请重试', icon: 'error' })
}
} }
} }
}); });
@@ -170,160 +396,102 @@
isSearchFocus.value = !isSearchFocus.value isSearchFocus.value = !isSearchFocus.value
} }
const allFoldersData = ref({ // 根据文件后缀返回对应图标
// 根目录下的文件夹 const getFileIcon = (ext) => {
'root': [{ const iconMap = {
id: 1, '.png': 'icon-wenjiantupian',
name: '文档资料', '.jpg': 'icon-wenjiantupian',
parentId: 'root', '.jpeg': 'icon-wenjiantupian',
children: [{ '.gif': 'icon-wenjiantupian',
id: 11, '.svg': 'icon-SVG',
name: '工作文档', '.bmp': 'icon-wenjiantupian',
parentId: 1, '.webp': 'icon-wenjiantupian',
children: [] '.mp4': 'icon-wenjianshipin',
}, '.avi': 'icon-wenjianshipin',
{ '.mov': 'icon-wenjianshipin',
id: 12, '.wmv': 'icon-wenjianshipin',
name: '学习笔记', '.flv': 'icon-wenjianshipin',
parentId: 1, '.mkv': 'icon-wenjianshipin',
children: [] '.mp3': 'icon-wenjianyinpin',
}, '.wav': 'icon-wenjianyinpin',
{ '.flac': 'icon-wenjianyinpin',
id: 13, '.aac': 'icon-wenjianyinpin',
name: '合同模板', '.pdf': 'icon-PDF',
parentId: 1, '.doc': 'icon-DOC',
children: [] '.docx': 'icon-DOC',
} '.xls': 'icon-XLS',
] '.xlsx': 'icon-XLS',
}, '.ppt': 'icon-PPT',
{ '.pptx': 'icon-PPT',
id: 2, '.txt': 'icon-TXT',
name: '图片素材', '.md': 'icon-file-markdown-fill',
parentId: 'root', '.zip': 'icon-wenjianyasuo',
children: [{ '.rar': 'icon-wenjianyasuo',
id: 21, '.7z': 'icon-wenjianyasuo',
name: '风景图片', '.tar': 'icon-wenjianyasuo',
parentId: 2, '.gz': 'icon-wenjianyasuo',
children: [] '.js': 'icon-JS',
}, '.ts': 'icon-daimawenjia',
{ '.vue': 'icon-daimawenjia',
id: 22, '.html': 'icon-HTML',
name: '人物照片', '.css': 'icon-CSS',
parentId: 2, '.py': 'icon-daimawenjian',
children: [] '.java': 'icon-daimawenjian',
}, '.json': 'icon-JSON',
{ };
id: 23, return iconMap[ext?.toLowerCase()] || 'icon-qitawenjian';
name: 'UI图标', };
parentId: 2,
children: [] const allFoldersData = ref({})
}
]
},
{
id: 3,
name: '视频文件',
parentId: 'root',
children: [{
id: 31,
name: '教程视频',
parentId: 3,
children: []
},
{
id: 32,
name: '会议录像',
parentId: 3,
children: []
}
]
},
{
id: 4,
name: '项目代码',
parentId: 'root',
children: [{
id: 41,
name: '前端项目',
parentId: 4,
children: []
},
{
id: 42,
name: '后端服务',
parentId: 4,
children: []
}
]
},
{
id: 5,
name: '安装包',
parentId: 'root',
children: []
},
{
id: 6,
name: '备份文件',
parentId: 'root',
children: []
},
{
id: 7,
name: '临时文件',
parentId: 'root',
children: []
},
{
id: 8,
name: '个人收藏',
parentId: 'root',
children: []
}
]
});
// 文件夹路径栈 // 文件夹路径栈
const folderStack = ref([]); const folderStack = ref([]);
// 当前显示的文件夹列表 // 当前显示的文件夹列表
const currentFolderList = ref([]); const currentFolderList = ref([]);
const getCurrentFolderList = () => { const getCurrentFolderList = () => {
const currentPath = folderStack.value.length > 0 ? folderStack.value[folderStack.value.length - 1].id : 'root'; console.log("当前路径为:", JSON.stringify(folderStack.value));
if (currentPath === "root") { // 当前路径:栈为空时在根目录,路径为 "."
return allFoldersData.value['root'] || []; const currentPath = folderStack.value.length > 0 ? folderStack.value[folderStack.value.length - 1].path : '.';
// 在根目录下,直接返回根节点的 children
if (currentPath === '.') {
return allFoldersData.value?.children || [];
} }
const findFolderById = (folders, id) => { // 递归在树中按 path 查找目标节点
for (const folder of folders) { const findFolderByPath = (list, targetPath) => {
if (folder.id === id) return folder; for (const item of list) {
if (folder.children && folder.children.length > 0) { if (item.path === targetPath) return item;
const found = findFolderById(folder.children, id); if (item.type === 'directory' && item.children?.length) {
if (found) return found; const res = findFolderByPath(item.children, targetPath);
if (res) return res;
} }
} }
return null; return null;
}; };
const currentFolder = findFolderById(allFoldersData.value['root'], currentPath); // 从根节点的 children 开始搜索
const currentFolder = findFolderByPath(allFoldersData.value?.children || [], currentPath);
return currentFolder ? currentFolder.children : []; return currentFolder ? currentFolder.children : [];
} }
// 初始化当前文件夹列表 // 初始化当前文件夹列表
const initCurrentFolderList = () => { const initCurrentFolderList = async () => {
workspaceId.value = getWorkspaceId(); workspaceId.value = getWorkspaceId();
console.log("getWorkspaceId:",workspaceId.value); UserToken.value = getToken();
console.log("getWorkspaceId:", workspaceId.value);
allFoldersData.value = await getWorkspaceList(UserToken.value, workspaceId.value);
currentFolderList.value = getCurrentFolderList(); currentFolderList.value = getCurrentFolderList();
}; };
// 处理文件夹点击(非选择模式下进入文件夹) // 处理文件夹点击(非选择模式下进入文件夹,仅目录可点击进入
const handleFolderClick = (folder) => { const handleFolderClick = (folder) => {
if (folder.type !== 'directory') return;
folderStack.value.push({ folderStack.value.push({
id: folder.id, path: folder.path,
name: folder.name name: folder.name
}); });
navbarTitle.value = folder.name; navbarTitle.value = folder.name;
navbarBeforeTitle.value = folderStack.value.length > 1 ? folderStack.value[folderStack.value.length - 2].name : navbarBeforeTitle.value = folderStack.value.length > 1 ? folderStack.value[folderStack.value.length - 2].name :
'工作区'; '工作区';
initCurrentFolderList(); currentFolderList.value = getCurrentFolderList();
searchKeyword.value = ''; searchKeyword.value = '';
isSearchFocus.value = false; isSearchFocus.value = false;
}; };
@@ -333,7 +501,7 @@
if (selectFileList.value.length === currentFolderList.value.length) { if (selectFileList.value.length === currentFolderList.value.length) {
selectFileList.value = []; selectFileList.value = [];
} else { } else {
selectFileList.value = currentFolderList.value.map(f => f.id); selectFileList.value = currentFolderList.value.map(f => f.path);
} }
}; };

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id */ font-family: "iconfont"; /* Project id 4890805 */
src: url('iconfont.ttf?t=1776936195904') format('truetype'); src: url('iconfont.woff2?t=1780384681439') format('woff2'),
url('iconfont.woff?t=1780384681439') format('woff'),
url('iconfont.ttf?t=1780384681439') format('truetype');
} }
.iconfont { .iconfont {
@@ -11,6 +13,178 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-qitawenjian:before {
content: "\e7b6";
}
.icon-wenjianyasuo:before {
content: "\e643";
}
.icon-wenjianshipin:before {
content: "\e644";
}
.icon-wenjianyinpin:before {
content: "\e645";
}
.icon-wenjiantupian:before {
content: "\e646";
}
.icon-daimawenjian:before {
content: "\e66a";
}
.icon-file-markdown-fill:before {
content: "\ebb1";
}
.icon-SVG:before {
content: "\e614";
}
.icon-HTML:before {
content: "\e615";
}
.icon-CSS:before {
content: "\e618";
}
.icon-CSV:before {
content: "\e619";
}
.icon-JSON:before {
content: "\e61b";
}
.icon-JS:before {
content: "\e61c";
}
.icon-PDF:before {
content: "\e61e";
}
.icon-PHP:before {
content: "\e621";
}
.icon-TXT:before {
content: "\e622";
}
.icon-XLS:before {
content: "\e623";
}
.icon-DOC:before {
content: "\e624";
}
.icon-PPT:before {
content: "\e626";
}
.icon-SQL:before {
content: "\e627";
}
.icon-bianji:before {
content: "\e605";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e67c";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e67d";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
}
.icon-del:before { .icon-del:before {
content: "\e616"; content: "\e616";
} }
@@ -67,95 +241,7 @@
content: "\e647"; content: "\e647";
} }
.icon-bianji:before { .icon-qita:before {
content: "\e605"; content: "\e600";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e667";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e661";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
} }

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,311 @@
{ {
"id": "", "id": "4890805",
"name": "", "name": "information",
"font_family": "iconfont", "font_family": "iconfont",
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "35959059",
"name": "其他文件",
"font_class": "qitawenjian",
"unicode": "e7b6",
"unicode_decimal": 59318
},
{
"icon_id": "1004650",
"name": "文件-压缩",
"font_class": "wenjianyasuo",
"unicode": "e643",
"unicode_decimal": 58947
},
{
"icon_id": "1004652",
"name": "文件-视频",
"font_class": "wenjianshipin",
"unicode": "e644",
"unicode_decimal": 58948
},
{
"icon_id": "1004653",
"name": "文件-音频",
"font_class": "wenjianyinpin",
"unicode": "e645",
"unicode_decimal": 58949
},
{
"icon_id": "1004654",
"name": "文件-图片",
"font_class": "wenjiantupian",
"unicode": "e646",
"unicode_decimal": 58950
},
{
"icon_id": "26618450",
"name": "代码文件",
"font_class": "daimawenjian",
"unicode": "e66a",
"unicode_decimal": 58986
},
{
"icon_id": "19702974",
"name": "markdown文件",
"font_class": "file-markdown-fill",
"unicode": "ebb1",
"unicode_decimal": 60337
},
{
"icon_id": "12904094",
"name": "SVG",
"font_class": "SVG",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "12904096",
"name": "HTML",
"font_class": "HTML",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "12904097",
"name": "CSS",
"font_class": "CSS",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "12904100",
"name": "CSV",
"font_class": "CSV",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "12904101",
"name": "JSON",
"font_class": "JSON",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "12904102",
"name": "JS",
"font_class": "JS",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "12904106",
"name": "PDF",
"font_class": "PDF",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "12904107",
"name": "PHP",
"font_class": "PHP",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "12904108",
"name": "TXT",
"font_class": "TXT",
"unicode": "e622",
"unicode_decimal": 58914
},
{
"icon_id": "12904109",
"name": "XLS",
"font_class": "XLS",
"unicode": "e623",
"unicode_decimal": 58915
},
{
"icon_id": "12904116",
"name": "DOC",
"font_class": "DOC",
"unicode": "e624",
"unicode_decimal": 58916
},
{
"icon_id": "12904119",
"name": "PPT",
"font_class": "PPT",
"unicode": "e626",
"unicode_decimal": 58918
},
{
"icon_id": "12904126",
"name": "SQL",
"font_class": "SQL",
"unicode": "e627",
"unicode_decimal": 58919
},
{
"icon_id": "7515699",
"name": "编辑",
"font_class": "bianji",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "8440993",
"name": "发送",
"font_class": "fasong",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "9512543",
"name": "下载",
"font_class": "download",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "9512544",
"name": "编辑",
"font_class": "edit-fill",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "9512556",
"name": "收藏",
"font_class": "favorite-fill",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "9512559",
"name": "收藏",
"font_class": "favorite",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "9512675",
"name": "上传",
"font_class": "upload",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "11633996",
"name": "用户资料",
"font_class": "yonghuziliao",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "17775968",
"name": "笔",
"font_class": "pen-fill",
"unicode": "e67c",
"unicode_decimal": 59004
},
{
"icon_id": "18537099",
"name": "群聊",
"font_class": "qunliao",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "18537375",
"name": "视频通话",
"font_class": "shipintonghua",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "18654056",
"name": "添加",
"font_class": "tianjia",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "18655694",
"name": "通讯录",
"font_class": "tongxunlu",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "18656610",
"name": "添加好友",
"font_class": "tianjiahaoyou",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "24660909",
"name": "删除",
"font_class": "shanchu",
"unicode": "e6d3",
"unicode_decimal": 59091
},
{
"icon_id": "25015243",
"name": "选择箭头-fill",
"font_class": "choose-fill",
"unicode": "e6a2",
"unicode_decimal": 59042
},
{
"icon_id": "27229314",
"name": "文件夹,文件",
"font_class": "a-wenjianjiawenjian",
"unicode": "e69e",
"unicode_decimal": 59038
},
{
"icon_id": "27995029",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e6eb",
"unicode_decimal": 59115
},
{
"icon_id": "28661052",
"name": "Robot",
"font_class": "Robot",
"unicode": "e67d",
"unicode_decimal": 59005
},
{
"icon_id": "32429618",
"name": "扫除",
"font_class": "saochu",
"unicode": "e6a3",
"unicode_decimal": 59043
},
{
"icon_id": "38950621",
"name": "返回",
"font_class": "fanhui",
"unicode": "e765",
"unicode_decimal": 59237
},
{
"icon_id": "42230703",
"name": "brain-2-fill",
"font_class": "brain-2-fill",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "43005043",
"name": "更多",
"font_class": "gengduo",
"unicode": "e6c5",
"unicode_decimal": 59077
},
{ {
"icon_id": "109713", "icon_id": "109713",
"name": "垃圾桶", "name": "垃圾桶",
@@ -104,165 +405,11 @@
"unicode_decimal": 58951 "unicode_decimal": 58951
}, },
{ {
"icon_id": "7515699", "icon_id": "1250",
"name": "编辑", "name": "其它",
"font_class": "bianji", "font_class": "qita",
"unicode": "e605", "unicode": "e600",
"unicode_decimal": 58885 "unicode_decimal": 58880
},
{
"icon_id": "8440993",
"name": "发送",
"font_class": "fasong",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "9512543",
"name": "下载",
"font_class": "download",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "9512544",
"name": "编辑",
"font_class": "edit-fill",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "9512556",
"name": "收藏",
"font_class": "favorite-fill",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "9512559",
"name": "收藏",
"font_class": "favorite",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "9512675",
"name": "上传",
"font_class": "upload",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "11633996",
"name": "用户资料",
"font_class": "yonghuziliao",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "17775968",
"name": "笔",
"font_class": "pen-fill",
"unicode": "e667",
"unicode_decimal": 58983
},
{
"icon_id": "18537099",
"name": "群聊",
"font_class": "qunliao",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "18537375",
"name": "视频通话",
"font_class": "shipintonghua",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "18654056",
"name": "添加",
"font_class": "tianjia",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "18655694",
"name": "通讯录",
"font_class": "tongxunlu",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "18656610",
"name": "添加好友",
"font_class": "tianjiahaoyou",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "24660909",
"name": "删除",
"font_class": "shanchu",
"unicode": "e6d3",
"unicode_decimal": 59091
},
{
"icon_id": "25015243",
"name": "选择箭头-fill",
"font_class": "choose-fill",
"unicode": "e6a2",
"unicode_decimal": 59042
},
{
"icon_id": "27229314",
"name": "文件夹,文件",
"font_class": "a-wenjianjiawenjian",
"unicode": "e69e",
"unicode_decimal": 59038
},
{
"icon_id": "27995029",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e6eb",
"unicode_decimal": 59115
},
{
"icon_id": "28661052",
"name": "Robot",
"font_class": "Robot",
"unicode": "e661",
"unicode_decimal": 58977
},
{
"icon_id": "32429618",
"name": "扫除",
"font_class": "saochu",
"unicode": "e6a3",
"unicode_decimal": 59043
},
{
"icon_id": "38950621",
"name": "返回",
"font_class": "fanhui",
"unicode": "e765",
"unicode_decimal": 59237
},
{
"icon_id": "42230703",
"name": "brain-2-fill",
"font_class": "brain-2-fill",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "43005043",
"name": "更多",
"font_class": "gengduo",
"unicode": "e6c5",
"unicode_decimal": 59077
} }
] ]
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -146,40 +146,6 @@ export const useSocketStore = defineStore('socket', () => {
return timer return timer
} }
// function handleMessage(messageData) {
// addLog('receive', `收到: ${JSON.stringify(messageData)}`)
// const {
// ws_event,
// queue,
// data
// } = messageData || {}
// if (data?.task_call_id) {
// taskCallId.value = data.task_call_id
// uni.setStorageSync('taskCallId', data.task_call_id)
// }
// switch (ws_event) {
// case 'connect':
// addLog('success', '连接成功')
// handleBindConversation(messageData)
// break
// case 'disconnect':
// addLog('warn', '收到服务端断开指令')
// disconnect()
// break
// case 'message':
// handleBusinessMessage(messageData)
// break
// default:
// addLog('info', `未知事件类型: ${ws_event}`)
// }
// }
function handleMessage(messageData) { function handleMessage(messageData) {
addLog('receive', `收到: ${JSON.stringify(messageData)}`) addLog('receive', `收到: ${JSON.stringify(messageData)}`)
@@ -240,44 +206,6 @@ export const useSocketStore = defineStore('socket', () => {
} }
} }
// function handleBusinessMessage(messageData) {
// const {
// ws_event,
// queue,
// data
// } = messageData
// const messageContent = data?.content || data?.chunk || ''
// // 调用工具
// if (data?.cmd === 'list_tools' || data?.cmd === 'catalog') {
// socketManager.send({
// "ws_event": "message",
// "data": {
// "task_call_id": taskCallId.value,
// "result": {
// "tools": []
// }
// },
// })
// addLog('info', `调用工具: ${data?.module}`)
// return
// }
// // 消息事件:渲染队列的业务消息
// if (ws_event === 'message' && queue === 'render') {
// messageString.value += messageContent
// // 有任务ID时自动回复消息确认包
// if (data.task_call_id) {
// socketManager.send({
// "ws_event": "message",
// "data": {
// "task_call_id": taskCallId.value
// }
// }).catch(err => console.error('发送确认失败:', err))
// }
// }
// }
function handleBusinessMessage(data) { function handleBusinessMessage(data) {
// 处理 data 为字符串 "exit" 的情况 // 处理 data 为字符串 "exit" 的情况
if (data === "exit") { if (data === "exit") {
@@ -289,6 +217,8 @@ export const useSocketStore = defineStore('socket', () => {
// 处理 data 为对象的情况 // 处理 data 为对象的情况
if (!data || typeof data !== 'object') return if (!data || typeof data !== 'object') return
const { const {
role, role,
chunk, chunk,

File diff suppressed because it is too large Load Diff

View File

@@ -27,8 +27,10 @@
/* 文章场景相关 */ /* 文章场景相关 */
/*每个页面公共css */ /*每个页面公共css */
@font-face { @font-face {
font-family: "iconfont"; /* Project id */ font-family: "iconfont"; /* Project id 4890805 */
src: url('static/iconfont/iconfont.ttf?t=1776936195904') format('truetype'); src: url('static/iconfont/iconfont.woff2?t=1780384681439') format('woff2'),
url('static/iconfont/iconfont.woff?t=1780384681439') format('woff'),
url('static/iconfont/iconfont.ttf?t=1780384681439') format('truetype');
} }
.iconfont { .iconfont {
font-family: "iconfont" !important; font-family: "iconfont" !important;
@@ -37,6 +39,135 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-qitawenjian:before {
content: "\e7b6";
}
.icon-wenjianyasuo:before {
content: "\e643";
}
.icon-wenjianshipin:before {
content: "\e644";
}
.icon-wenjianyinpin:before {
content: "\e645";
}
.icon-wenjiantupian:before {
content: "\e646";
}
.icon-daimawenjian:before {
content: "\e66a";
}
.icon-file-markdown-fill:before {
content: "\ebb1";
}
.icon-SVG:before {
content: "\e614";
}
.icon-HTML:before {
content: "\e615";
}
.icon-CSS:before {
content: "\e618";
}
.icon-CSV:before {
content: "\e619";
}
.icon-JSON:before {
content: "\e61b";
}
.icon-JS:before {
content: "\e61c";
}
.icon-PDF:before {
content: "\e61e";
}
.icon-PHP:before {
content: "\e621";
}
.icon-TXT:before {
content: "\e622";
}
.icon-XLS:before {
content: "\e623";
}
.icon-DOC:before {
content: "\e624";
}
.icon-PPT:before {
content: "\e626";
}
.icon-SQL:before {
content: "\e627";
}
.icon-bianji:before {
content: "\e605";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e67c";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e67d";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
}
.icon-del:before { .icon-del:before {
content: "\e616"; content: "\e616";
} }
@@ -79,74 +210,8 @@
.icon-biezhen:before { .icon-biezhen:before {
content: "\e647"; content: "\e647";
} }
.icon-bianji:before { .icon-qita:before {
content: "\e605"; content: "\e600";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e667";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e661";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
} }
/* 顶部状态栏占位(自动适配刘海高度) */ /* 顶部状态栏占位(自动适配刘海高度) */
.status-bar { .status-bar {

View File

@@ -1,3 +1,74 @@
/* 新建文件夹弹窗样式 */
.create-folder-name[data-v-769edd25] {
display: flex;
width: 100%;
padding: 0.3125rem 0.625rem;
box-sizing: border-box;
align-items: center;
background-color: rgba(194, 191, 211, 0.1);
border-radius: 0.3125rem;
}
.create-folder-name uni-input[data-v-769edd25] {
box-sizing: border-box;
width: 100%;
}
.create-folder-name.has-value[data-v-769edd25] {
background-color: #ffffff;
border: 0.0625rem solid #aaaaff;
box-shadow: 0 0 0.46875rem #aaaaff;
}
/* 新建文件夹弹窗内部样式 */
.new-folder-name[data-v-769edd25] {
font-size: 0.875rem;
color: #666;
margin-bottom: 0.375rem;
}
.nf-path-label[data-v-769edd25] {
font-size: 0.8125rem;
color: #999;
margin-top: 0.75rem;
margin-bottom: 0.25rem;
}
.nf-path-display[data-v-769edd25] {
font-size: 0.875rem;
color: #333;
padding: 0.375rem 0.625rem;
background: #f5f5f5;
border-radius: 0.3125rem;
word-break: break-all;
}
.nf-path-preview[data-v-769edd25] {
font-size: 0.875rem;
color: #0073ff;
padding: 0.375rem 0.625rem;
background: rgba(0, 115, 255, 0.05);
border: 0.0625rem dashed rgba(0, 115, 255, 0.3);
border-radius: 0.3125rem;
word-break: break-all;
}
.option-wrapper[data-v-769edd25] {
display: flex;
justify-content: space-between;
gap: 0.625rem;
margin-top: 1.25rem;
}
.opt-btn[data-v-769edd25] {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 0.75rem 0;
border-radius: 0.375rem;
font-size: 0.9375rem;
}
.opt-cancel[data-v-769edd25] {
background: #f5f5f5;
color: #666;
}
.opt-confirm[data-v-769edd25] {
background: linear-gradient(135deg, #0073ff, #3ab0ff);
color: #fff;
}
.workspace-container[data-v-769edd25] { .workspace-container[data-v-769edd25] {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -96,7 +167,6 @@
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
/* 菜单卡片 */ /* 菜单卡片 */
.menu-card[data-v-769edd25] { .menu-card[data-v-769edd25] {
position: absolute; position: absolute;
@@ -134,7 +204,7 @@
.folder-grid[data-v-769edd25] { .folder-grid[data-v-769edd25] {
width: 100%; width: 100%;
display: grid; display: grid;
grid-template-columns: repeat(3,1fr); grid-template-columns: repeat(3, 1fr);
padding: 0.625rem; padding: 0.625rem;
box-sizing: border-box; box-sizing: border-box;
gap: 0.625rem; gap: 0.625rem;
@@ -146,11 +216,23 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
min-width: 0;
} }
.folder-item.select-folder[data-v-769edd25] { .folder-item.select-folder[data-v-769edd25] {
border-radius: 0.9375rem; border-radius: 0.9375rem;
background: rgba(9, 9, 9, 0.1); background: rgba(9, 9, 9, 0.1);
} }
.folder-item .folder-name[data-v-769edd25] {
max-width: 4.6875rem;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
text-align: center;
line-height: 1.25rem;
min-width: 0;
}
.folder-item-style[data-v-769edd25] { .folder-item-style[data-v-769edd25] {
font-size: 5rem !important; font-size: 5rem !important;
font-weight: 0.3125rem !important; font-weight: 0.3125rem !important;
@@ -191,7 +273,6 @@
.workspace-footer .iconfont[data-v-769edd25] { .workspace-footer .iconfont[data-v-769edd25] {
font-size: 1.25rem !important; font-size: 1.25rem !important;
} }
/* 编辑模板弹窗 */ /* 编辑模板弹窗 */
.edit-template-wrapper[data-v-769edd25] { .edit-template-wrapper[data-v-769edd25] {
} }

View File

@@ -530,6 +530,77 @@
text-decoration: none; text-decoration: none;
text-align: center; text-align: center;
} }
/* 新建文件夹弹窗样式 */
.create-folder-name[data-v-c1a60359] {
display: flex;
width: 100%;
padding: 0.3125rem 0.625rem;
box-sizing: border-box;
align-items: center;
background-color: rgba(194, 191, 211, 0.1);
border-radius: 0.3125rem;
}
.create-folder-name uni-input[data-v-c1a60359] {
box-sizing: border-box;
width: 100%;
}
.create-folder-name.has-value[data-v-c1a60359] {
background-color: #ffffff;
border: 0.0625rem solid #aaaaff;
box-shadow: 0 0 0.46875rem #aaaaff;
}
/* 新建文件夹弹窗内部样式 */
.new-folder-name[data-v-c1a60359] {
font-size: 0.875rem;
color: #666;
margin-bottom: 0.375rem;
}
.nf-path-label[data-v-c1a60359] {
font-size: 0.8125rem;
color: #999;
margin-top: 0.75rem;
margin-bottom: 0.25rem;
}
.nf-path-display[data-v-c1a60359] {
font-size: 0.875rem;
color: #333;
padding: 0.375rem 0.625rem;
background: #f5f5f5;
border-radius: 0.3125rem;
word-break: break-all;
}
.nf-path-preview[data-v-c1a60359] {
font-size: 0.875rem;
color: #0073ff;
padding: 0.375rem 0.625rem;
background: rgba(0, 115, 255, 0.05);
border: 0.0625rem dashed rgba(0, 115, 255, 0.3);
border-radius: 0.3125rem;
word-break: break-all;
}
.option-wrapper[data-v-c1a60359] {
display: flex;
justify-content: space-between;
gap: 0.625rem;
margin-top: 1.25rem;
}
.opt-btn[data-v-c1a60359] {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 0.75rem 0;
border-radius: 0.375rem;
font-size: 0.9375rem;
}
.opt-cancel[data-v-c1a60359] {
background: #f5f5f5;
color: #666;
}
.opt-confirm[data-v-c1a60359] {
background: linear-gradient(135deg, #0073ff, #3ab0ff);
color: #fff;
}
.workspace-container[data-v-c1a60359] { .workspace-container[data-v-c1a60359] {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -628,7 +699,6 @@
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
/* 菜单卡片 */ /* 菜单卡片 */
.menu-card[data-v-c1a60359] { .menu-card[data-v-c1a60359] {
position: absolute; position: absolute;
@@ -666,7 +736,7 @@
.folder-grid[data-v-c1a60359] { .folder-grid[data-v-c1a60359] {
width: 100%; width: 100%;
display: grid; display: grid;
grid-template-columns: repeat(3,1fr); grid-template-columns: repeat(3, 1fr);
padding: 0.625rem; padding: 0.625rem;
box-sizing: border-box; box-sizing: border-box;
gap: 0.625rem; gap: 0.625rem;
@@ -678,11 +748,23 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
min-width: 0;
} }
.folder-item.select-folder[data-v-c1a60359] { .folder-item.select-folder[data-v-c1a60359] {
border-radius: 0.9375rem; border-radius: 0.9375rem;
background: rgba(9, 9, 9, 0.1); background: rgba(9, 9, 9, 0.1);
} }
.folder-item .folder-name[data-v-c1a60359] {
max-width: 4.6875rem;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
text-align: center;
line-height: 1.25rem;
min-width: 0;
}
.folder-item-style[data-v-c1a60359] { .folder-item-style[data-v-c1a60359] {
font-size: 5rem !important; font-size: 5rem !important;
font-weight: 0.3125rem !important; font-weight: 0.3125rem !important;

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id */ font-family: "iconfont"; /* Project id 4890805 */
src: url('iconfont.ttf?t=1776936195904') format('truetype'); src: url('iconfont.woff2?t=1780384681439') format('woff2'),
url('iconfont.woff?t=1780384681439') format('woff'),
url('iconfont.ttf?t=1780384681439') format('truetype');
} }
.iconfont { .iconfont {
@@ -11,6 +13,178 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-qitawenjian:before {
content: "\e7b6";
}
.icon-wenjianyasuo:before {
content: "\e643";
}
.icon-wenjianshipin:before {
content: "\e644";
}
.icon-wenjianyinpin:before {
content: "\e645";
}
.icon-wenjiantupian:before {
content: "\e646";
}
.icon-daimawenjian:before {
content: "\e66a";
}
.icon-file-markdown-fill:before {
content: "\ebb1";
}
.icon-SVG:before {
content: "\e614";
}
.icon-HTML:before {
content: "\e615";
}
.icon-CSS:before {
content: "\e618";
}
.icon-CSV:before {
content: "\e619";
}
.icon-JSON:before {
content: "\e61b";
}
.icon-JS:before {
content: "\e61c";
}
.icon-PDF:before {
content: "\e61e";
}
.icon-PHP:before {
content: "\e621";
}
.icon-TXT:before {
content: "\e622";
}
.icon-XLS:before {
content: "\e623";
}
.icon-DOC:before {
content: "\e624";
}
.icon-PPT:before {
content: "\e626";
}
.icon-SQL:before {
content: "\e627";
}
.icon-bianji:before {
content: "\e605";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e67c";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e67d";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
}
.icon-del:before { .icon-del:before {
content: "\e616"; content: "\e616";
} }
@@ -67,95 +241,7 @@
content: "\e647"; content: "\e647";
} }
.icon-bianji:before { .icon-qita:before {
content: "\e605"; content: "\e600";
}
.icon-fasong:before {
content: "\e705";
}
.icon-download:before {
content: "\e61a";
}
.icon-edit-fill:before {
content: "\e61d";
}
.icon-favorite-fill:before {
content: "\e61f";
}
.icon-favorite:before {
content: "\e620";
}
.icon-upload:before {
content: "\e63e";
}
.icon-yonghuziliao:before {
content: "\e6a1";
}
.icon-pen-fill:before {
content: "\e667";
}
.icon-qunliao:before {
content: "\e606";
}
.icon-shipintonghua:before {
content: "\e609";
}
.icon-tianjia:before {
content: "\e60d";
}
.icon-tongxunlu:before {
content: "\e612";
}
.icon-tianjiahaoyou:before {
content: "\e613";
}
.icon-shanchu:before {
content: "\e6d3";
}
.icon-choose-fill:before {
content: "\e6a2";
}
.icon-a-wenjianjiawenjian:before {
content: "\e69e";
}
.icon-sousuo:before {
content: "\e6eb";
}
.icon-Robot:before {
content: "\e661";
}
.icon-saochu:before {
content: "\e6a3";
}
.icon-fanhui:before {
content: "\e765";
}
.icon-brain-2-fill:before {
content: "\e800";
}
.icon-gengduo:before {
content: "\e6c5";
} }

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,311 @@
{ {
"id": "", "id": "4890805",
"name": "", "name": "information",
"font_family": "iconfont", "font_family": "iconfont",
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "35959059",
"name": "其他文件",
"font_class": "qitawenjian",
"unicode": "e7b6",
"unicode_decimal": 59318
},
{
"icon_id": "1004650",
"name": "文件-压缩",
"font_class": "wenjianyasuo",
"unicode": "e643",
"unicode_decimal": 58947
},
{
"icon_id": "1004652",
"name": "文件-视频",
"font_class": "wenjianshipin",
"unicode": "e644",
"unicode_decimal": 58948
},
{
"icon_id": "1004653",
"name": "文件-音频",
"font_class": "wenjianyinpin",
"unicode": "e645",
"unicode_decimal": 58949
},
{
"icon_id": "1004654",
"name": "文件-图片",
"font_class": "wenjiantupian",
"unicode": "e646",
"unicode_decimal": 58950
},
{
"icon_id": "26618450",
"name": "代码文件",
"font_class": "daimawenjian",
"unicode": "e66a",
"unicode_decimal": 58986
},
{
"icon_id": "19702974",
"name": "markdown文件",
"font_class": "file-markdown-fill",
"unicode": "ebb1",
"unicode_decimal": 60337
},
{
"icon_id": "12904094",
"name": "SVG",
"font_class": "SVG",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "12904096",
"name": "HTML",
"font_class": "HTML",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "12904097",
"name": "CSS",
"font_class": "CSS",
"unicode": "e618",
"unicode_decimal": 58904
},
{
"icon_id": "12904100",
"name": "CSV",
"font_class": "CSV",
"unicode": "e619",
"unicode_decimal": 58905
},
{
"icon_id": "12904101",
"name": "JSON",
"font_class": "JSON",
"unicode": "e61b",
"unicode_decimal": 58907
},
{
"icon_id": "12904102",
"name": "JS",
"font_class": "JS",
"unicode": "e61c",
"unicode_decimal": 58908
},
{
"icon_id": "12904106",
"name": "PDF",
"font_class": "PDF",
"unicode": "e61e",
"unicode_decimal": 58910
},
{
"icon_id": "12904107",
"name": "PHP",
"font_class": "PHP",
"unicode": "e621",
"unicode_decimal": 58913
},
{
"icon_id": "12904108",
"name": "TXT",
"font_class": "TXT",
"unicode": "e622",
"unicode_decimal": 58914
},
{
"icon_id": "12904109",
"name": "XLS",
"font_class": "XLS",
"unicode": "e623",
"unicode_decimal": 58915
},
{
"icon_id": "12904116",
"name": "DOC",
"font_class": "DOC",
"unicode": "e624",
"unicode_decimal": 58916
},
{
"icon_id": "12904119",
"name": "PPT",
"font_class": "PPT",
"unicode": "e626",
"unicode_decimal": 58918
},
{
"icon_id": "12904126",
"name": "SQL",
"font_class": "SQL",
"unicode": "e627",
"unicode_decimal": 58919
},
{
"icon_id": "7515699",
"name": "编辑",
"font_class": "bianji",
"unicode": "e605",
"unicode_decimal": 58885
},
{
"icon_id": "8440993",
"name": "发送",
"font_class": "fasong",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "9512543",
"name": "下载",
"font_class": "download",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "9512544",
"name": "编辑",
"font_class": "edit-fill",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "9512556",
"name": "收藏",
"font_class": "favorite-fill",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "9512559",
"name": "收藏",
"font_class": "favorite",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "9512675",
"name": "上传",
"font_class": "upload",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "11633996",
"name": "用户资料",
"font_class": "yonghuziliao",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "17775968",
"name": "笔",
"font_class": "pen-fill",
"unicode": "e67c",
"unicode_decimal": 59004
},
{
"icon_id": "18537099",
"name": "群聊",
"font_class": "qunliao",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "18537375",
"name": "视频通话",
"font_class": "shipintonghua",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "18654056",
"name": "添加",
"font_class": "tianjia",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "18655694",
"name": "通讯录",
"font_class": "tongxunlu",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "18656610",
"name": "添加好友",
"font_class": "tianjiahaoyou",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "24660909",
"name": "删除",
"font_class": "shanchu",
"unicode": "e6d3",
"unicode_decimal": 59091
},
{
"icon_id": "25015243",
"name": "选择箭头-fill",
"font_class": "choose-fill",
"unicode": "e6a2",
"unicode_decimal": 59042
},
{
"icon_id": "27229314",
"name": "文件夹,文件",
"font_class": "a-wenjianjiawenjian",
"unicode": "e69e",
"unicode_decimal": 59038
},
{
"icon_id": "27995029",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e6eb",
"unicode_decimal": 59115
},
{
"icon_id": "28661052",
"name": "Robot",
"font_class": "Robot",
"unicode": "e67d",
"unicode_decimal": 59005
},
{
"icon_id": "32429618",
"name": "扫除",
"font_class": "saochu",
"unicode": "e6a3",
"unicode_decimal": 59043
},
{
"icon_id": "38950621",
"name": "返回",
"font_class": "fanhui",
"unicode": "e765",
"unicode_decimal": 59237
},
{
"icon_id": "42230703",
"name": "brain-2-fill",
"font_class": "brain-2-fill",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "43005043",
"name": "更多",
"font_class": "gengduo",
"unicode": "e6c5",
"unicode_decimal": 59077
},
{ {
"icon_id": "109713", "icon_id": "109713",
"name": "垃圾桶", "name": "垃圾桶",
@@ -104,165 +405,11 @@
"unicode_decimal": 58951 "unicode_decimal": 58951
}, },
{ {
"icon_id": "7515699", "icon_id": "1250",
"name": "编辑", "name": "其它",
"font_class": "bianji", "font_class": "qita",
"unicode": "e605", "unicode": "e600",
"unicode_decimal": 58885 "unicode_decimal": 58880
},
{
"icon_id": "8440993",
"name": "发送",
"font_class": "fasong",
"unicode": "e705",
"unicode_decimal": 59141
},
{
"icon_id": "9512543",
"name": "下载",
"font_class": "download",
"unicode": "e61a",
"unicode_decimal": 58906
},
{
"icon_id": "9512544",
"name": "编辑",
"font_class": "edit-fill",
"unicode": "e61d",
"unicode_decimal": 58909
},
{
"icon_id": "9512556",
"name": "收藏",
"font_class": "favorite-fill",
"unicode": "e61f",
"unicode_decimal": 58911
},
{
"icon_id": "9512559",
"name": "收藏",
"font_class": "favorite",
"unicode": "e620",
"unicode_decimal": 58912
},
{
"icon_id": "9512675",
"name": "上传",
"font_class": "upload",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "11633996",
"name": "用户资料",
"font_class": "yonghuziliao",
"unicode": "e6a1",
"unicode_decimal": 59041
},
{
"icon_id": "17775968",
"name": "笔",
"font_class": "pen-fill",
"unicode": "e667",
"unicode_decimal": 58983
},
{
"icon_id": "18537099",
"name": "群聊",
"font_class": "qunliao",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "18537375",
"name": "视频通话",
"font_class": "shipintonghua",
"unicode": "e609",
"unicode_decimal": 58889
},
{
"icon_id": "18654056",
"name": "添加",
"font_class": "tianjia",
"unicode": "e60d",
"unicode_decimal": 58893
},
{
"icon_id": "18655694",
"name": "通讯录",
"font_class": "tongxunlu",
"unicode": "e612",
"unicode_decimal": 58898
},
{
"icon_id": "18656610",
"name": "添加好友",
"font_class": "tianjiahaoyou",
"unicode": "e613",
"unicode_decimal": 58899
},
{
"icon_id": "24660909",
"name": "删除",
"font_class": "shanchu",
"unicode": "e6d3",
"unicode_decimal": 59091
},
{
"icon_id": "25015243",
"name": "选择箭头-fill",
"font_class": "choose-fill",
"unicode": "e6a2",
"unicode_decimal": 59042
},
{
"icon_id": "27229314",
"name": "文件夹,文件",
"font_class": "a-wenjianjiawenjian",
"unicode": "e69e",
"unicode_decimal": 59038
},
{
"icon_id": "27995029",
"name": "搜索",
"font_class": "sousuo",
"unicode": "e6eb",
"unicode_decimal": 59115
},
{
"icon_id": "28661052",
"name": "Robot",
"font_class": "Robot",
"unicode": "e661",
"unicode_decimal": 58977
},
{
"icon_id": "32429618",
"name": "扫除",
"font_class": "saochu",
"unicode": "e6a3",
"unicode_decimal": 59043
},
{
"icon_id": "38950621",
"name": "返回",
"font_class": "fanhui",
"unicode": "e765",
"unicode_decimal": 59237
},
{
"icon_id": "42230703",
"name": "brain-2-fill",
"font_class": "brain-2-fill",
"unicode": "e800",
"unicode_decimal": 59392
},
{
"icon_id": "43005043",
"name": "更多",
"font_class": "gengduo",
"unicode": "e6c5",
"unicode_decimal": 59077
} }
] ]
} }

Binary file not shown.

Binary file not shown.

View File

@@ -384,6 +384,7 @@ export const searchUsers = (token, keyword) => {
}) })
} }
// 工作区
// 获取工作区文件目录 // 获取工作区文件目录
export const getWorkspaceList = (token, workspacesId) => { export const getWorkspaceList = (token, workspacesId) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -420,3 +421,99 @@ export const getWorkspaceList = (token, workspacesId) => {
}) })
}) })
} }
// 删除工作区文件
export const daleteWorkspace = (token, workspacesId, path) => {
return new Promise((resolve, reject) => {
uni.request({
url: `${BASE_URL}/cloud_api/phone/workspace/delete`,
method: "POST",
header: {
'Content-Type': 'application/json'
},
data: {
"access_token": token,
"workspaces_id": workspacesId,
"file_path": path
},
success: (res) => {
if(res.statusCode === 200){
const respond = res.data
if (respond.success) {
resolve(respond.message)
} else {
const msg = respond?.error || '删除工作区文件出错啦'
reject(msg)
}
}else {
reject(`删除工作区文件失败:${res.statusCode}`)
}
}
})
})
}
// 创建工作区文件夹(目录)
export const createWorkspaceFolder = (token, workspacesId, path) => {
return new Promise((resolve, reject) => {
uni.request({
url: `${BASE_URL}/cloud_api/phone/workspace/create`,
method: "POST",
header: {
'Content-Type': 'application/json'
},
data: {
"access_token": token,
"workspaces_id": workspacesId,
"dir_path": path
},
success: (res) => {
if(res.statusCode === 200){
const respond = res.data
if (respond.success) {
resolve(respond.message)
} else {
const msg = respond?.error || '创建工作区文件夹出错啦'
reject(msg)
}
}else {
reject(`创建工作区文件夹失败:${res.statusCode}`)
}
}
})
})
}
// 获取工作区文URL
export const getWorkspaceFileURL = (token, workspacesId, path) => {
return new Promise((resolve, reject) => {
uni.request({
url: `${BASE_URL}/cloud_api/phone/workspace/downloadFile`,
method: "POST",
header: {
'Content-Type': 'application/json'
},
data: {
"access_token": token,
"workspaces_id": workspacesId,
"file_path": path
},
success: (res) => {
if(res.statusCode === 200){
const respond = res.data
// 兼容两种返回格式:{success: true, message: [...]} 或直接返回数组
if (respond.success) {
resolve(respond.message || respond.data)
} else if (Array.isArray(respond)) {
resolve(respond)
} else {
const msg = respond?.error || '获取工作区文URL出错啦'
reject(msg)
}
}else {
reject(`获取工作区文URL失败${res.statusCode}`)
}
}
})
})
}