From c74e8952b5f98e0cf53c2deae96a10632af4146c Mon Sep 17 00:00:00 2001 From: godo Date: Sat, 7 Dec 2024 20:49:07 +0800 Subject: [PATCH] change context menu --- README.md | 9 ++--- frontend/src/components/computer/Computer.vue | 2 +- frontend/src/components/oa/ShareFiles.vue | 20 +++++++--- frontend/src/hook/useContextMenu.ts | 38 +++++++++---------- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 373b8cb..f88e58f 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ -## 🎉 V1.0.3更新日志(未打包) +## 🎉 V1.0.3更新日志 -- 新增ai模型管理,可下载管理ollama模型 +- 新增ai模型管理,可下载管理ollama模型(需要先安装ollama) - 新增ai助手,可控制整个系统的prompt - word新增ai优化/续写/纠错/翻译/总结,生成大纲,根据大纲一键创建文章 - markdown更换为更实用的cherry-markdown,支持draw.io绘图,支持导出为思维导图/pdf/长图/docx/md/html格式 @@ -28,11 +28,10 @@ - 更改文档存储方式,支持选择文件夹 - 内网聊天新增ai对话,可保存对话历史,可更换模型和prompt - 新增可定义端口和访问路径,支持web端系统重启 -- 新增企业端gitee登录和github登录 - 新增每个文件可独立设置密码,支持不可逆加密文件(加密文件后不可更改密码) ## 🏭 第三阶段目标(十二月底发布) -1. **文档处理与Markdown智能升级**: +1. **文档处理与Markdown智能升级**:(已完成) - **AI续写**:借助先进的自然语言处理技术,让您的文档创作灵感不断,续写流畅无阻。 - **智能总结**:一键提取文档精髓,快速生成精炼总结,助力高效阅读与信息提炼。 - **纠错优化**:智能识别并纠正文档中的语法、拼写错误,确保内容准确无误。 @@ -45,7 +44,7 @@ - 创新功能上线,只需简单操作,即可根据文字描述或数据自动生成高质量图表与图像,为报告、演示增添视觉亮点。 4. **Markdown扩展功能**: - - **思维导图生成**:支持Markdown内容直接转换为思维导图,可视化呈现信息架构,提升思维整理效率。 + - **思维导图生成**:支持Markdown内容直接转换为思维导图,可视化呈现信息架构,提升思维整理效率。(已完成) - **PPT一键制作**:无缝衔接Markdown文档,轻松导出专业级PPT,让汇报与分享更加生动、专业。 5. **文字转声音功能**: diff --git a/frontend/src/components/computer/Computer.vue b/frontend/src/components/computer/Computer.vue index 5257ccc..ea75e58 100644 --- a/frontend/src/components/computer/Computer.vue +++ b/frontend/src/components/computer/Computer.vue @@ -136,7 +136,7 @@ import { useContextMenu } from "@/hook/useContextMenu"; import { useFileDrag } from "@/hook/useFileDrag"; import { Rect, useRectChosen } from "@/hook/useRectChosen"; - import { getSystemConfig } from "@/system/config"; + // import { getSystemConfig } from "@/system/config"; import { emitEvent, mountEvent } from "@/system/event"; import { BrowserWindow, diff --git a/frontend/src/components/oa/ShareFiles.vue b/frontend/src/components/oa/ShareFiles.vue index 9a1338f..2558527 100644 --- a/frontend/src/components/oa/ShareFiles.vue +++ b/frontend/src/components/oa/ShareFiles.vue @@ -37,7 +37,6 @@ const window: BrowserWindow | undefined = inject("browserWindow"); const userList: any = ref([]); const checkAll = ref(false); const form: any = ref({ - senderid: "", receiverId: [], path: "", iswrite: "0", @@ -73,7 +72,7 @@ const handleCheckAll = (val: any) => { if (val) { form.value.receiverId = userList.value.map((d: any) => d.value); } else { - form.value.receiverId.value = []; + form.value.receiverId = []; } }; const checkUsers = (val: any) => { @@ -87,10 +86,19 @@ const checkUsers = (val: any) => { }; const onSubmit = async () => { const apiUrl = config.value.userInfo.url + "/files/share"; - form.value.path = window?.config.path || ""; - const temp = { ...form.value }; - temp.receiverId = temp.receiverId.map((item: any) => item.toString()); - const res = await fetchPost(apiUrl, new URLSearchParams(temp)); + const path = window?.config.path || ""; + const receiverIds = form.value.receiverId.map((item: any) => item*1); + if(receiverIds.length < 1){ + notifyError("请选择分享对象") + return; + } + const postData = { + path: path, + receiverId: receiverIds, + isWrite : form.value.iswrite * 1 + } + //console.log(postData) + const res = await fetchPost(apiUrl, JSON.stringify(postData)); const result = await res.json(); if (res.ok && result.success) { notifySuccess(result.message || "分享文件成功"); diff --git a/frontend/src/hook/useContextMenu.ts b/frontend/src/hook/useContextMenu.ts index c3f0ab7..8554493 100644 --- a/frontend/src/hook/useContextMenu.ts +++ b/frontend/src/hook/useContextMenu.ts @@ -119,24 +119,24 @@ function useContextMenu() { }, }, ]; - const userInfo: any = system.getConfig('userInfo'); - if (userInfo.user_auths && userInfo.user_auths.length > 0 && userInfo.user_auths != "") { - menuArr.push( - { - label: '安排任务', - click: () => { - const win = new BrowserWindow({ - title: '安排任务', - content: "PlanTasks", - width: 600, - height: 600, - center: true, - }); - win.show(); - } - } - ) - } + // const userInfo: any = system.getConfig('userInfo'); + // if (userInfo.user_auths && userInfo.user_auths.length > 0 && userInfo.user_auths != "") { + // menuArr.push( + // { + // label: '安排任务', + // click: () => { + // const win = new BrowserWindow({ + // title: '安排任务', + // content: "PlanTasks", + // width: 600, + // height: 600, + // center: true, + // }); + // win.show(); + // } + // } + // ) + // } menuArr = [...menuArr, ...(system._rootState.options.contextMenus || [])] const menu = Menu.buildFromTemplate( uniqBy( @@ -249,7 +249,7 @@ function useContextMenu() { if (filePath === "/") return; if (file.isDirectory) { - if (["/", "/B", "/C", "/D", "/E"].includes(file.path)) return; + if (["/", "/B", "/C", "/D", "/E", "/F"].includes(file.path)) return; } //console.log(file) const vol = filePath.charAt(1);