diff --git a/package.json b/package.json index a5b5a0d..0815835 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "less": "^4.2.0", "less-loader": "^7.3.0", "lodash": "^4.17.21", + "markmap-lib": "^0.18.8", "mitt": "^3.0.1", "nanoid": "^5.0.7", "node-addon-api": "^8.1.0", @@ -102,6 +103,7 @@ "vue-cropper": "1.0.3", "vue-qr": "^4.0.9", "vue-router": "^4.4.0", + "vue3-mindmap": "^0.5.12", "vuedraggable": "^4.1.0", "whiteboard_lyc": "^0.1.3", "xgplayer": "^3.0.19", @@ -139,4 +141,4 @@ "vue-tsc": "^1.8.25", "windicss": "^3.5.6" } -} \ No newline at end of file +} diff --git a/src/main/file.js b/src/main/file.js index a957b42..b370b38 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -452,6 +452,27 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { }) }) + ipcMain.on('export-img64-file', function (event, {base64, name}) { + name = name || '思维导图' + const parts = base64.split(';base64,'); + const contentType = parts[0].split(':')[1]; + const extension = contentType.split('/')[1]; + const data = Buffer.from(parts[1], 'base64'); + + dialog.showSaveDialog({ + title: '保存图片', + defaultPath: path.join(app.getPath('downloads'), `${name}.${extension}`), + filters: [ + { name: 'Image Files', extensions: [extension] } + ] + }).then(result => { + if (!result.canceled) { + fs.writeFileSync(result.filePath, data); + event.reply('export-img64-file-reply') + } + }); + }) + /*导出文件*/ function exportFile(list, callback) { let win = BrowserWindow.getFocusedWindow() diff --git a/src/renderer/public/icons/24px/close.png b/src/renderer/public/icons/24px/close.png new file mode 100644 index 0000000..dabecdc Binary files /dev/null and b/src/renderer/public/icons/24px/close.png differ diff --git a/src/renderer/public/icons/24px/crosshairs-gps.png b/src/renderer/public/icons/24px/crosshairs-gps.png new file mode 100644 index 0000000..9809164 Binary files /dev/null and b/src/renderer/public/icons/24px/crosshairs-gps.png differ diff --git a/src/renderer/public/icons/24px/download.png b/src/renderer/public/icons/24px/download.png new file mode 100644 index 0000000..6080420 Binary files /dev/null and b/src/renderer/public/icons/24px/download.png differ diff --git a/src/renderer/public/icons/24px/fit-to-page-outline.png b/src/renderer/public/icons/24px/fit-to-page-outline.png new file mode 100644 index 0000000..752f27b Binary files /dev/null and b/src/renderer/public/icons/24px/fit-to-page-outline.png differ diff --git a/src/renderer/public/icons/24px/next.png b/src/renderer/public/icons/24px/next.png new file mode 100644 index 0000000..9e749b0 Binary files /dev/null and b/src/renderer/public/icons/24px/next.png differ diff --git a/src/renderer/public/icons/24px/prev.png b/src/renderer/public/icons/24px/prev.png new file mode 100644 index 0000000..a57bc18 Binary files /dev/null and b/src/renderer/public/icons/24px/prev.png differ diff --git a/src/renderer/public/icons/36px/code-json.png b/src/renderer/public/icons/36px/code-json.png new file mode 100644 index 0000000..33888df Binary files /dev/null and b/src/renderer/public/icons/36px/code-json.png differ diff --git a/src/renderer/public/icons/36px/image.png b/src/renderer/public/icons/36px/image.png new file mode 100644 index 0000000..2313472 Binary files /dev/null and b/src/renderer/public/icons/36px/image.png differ diff --git a/src/renderer/public/icons/36px/markdown.png b/src/renderer/public/icons/36px/markdown.png new file mode 100644 index 0000000..9c34a57 Binary files /dev/null and b/src/renderer/public/icons/36px/markdown.png differ diff --git a/src/renderer/src/api/ai/index.js b/src/renderer/src/api/ai/index.js index 5e491d3..13e0ff5 100644 --- a/src/renderer/src/api/ai/index.js +++ b/src/renderer/src/api/ai/index.js @@ -1,12 +1,10 @@ import request from '@/utils/request' // 创建对话 -export const createChart = ({ headers, data }) => { +export const createChart = () => { return request({ url: '/qf/createChart', method: 'post', - headers, - data, }) } // 大模型对话 diff --git a/src/renderer/src/api/mode/index.js b/src/renderer/src/api/mode/index.js index 40c4ce5..a0e7b9d 100644 --- a/src/renderer/src/api/mode/index.js +++ b/src/renderer/src/api/mode/index.js @@ -29,6 +29,20 @@ export function completion(data) { }) } +// 大模型对话 +export function modelChat(data) { + return axios({ + url: '/mind/chat', + method: 'post', + headers: { + Authorization: 'Bearer ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm', + 'Content-Type': 'application/json', + Accept: '*/*' + }, + data: data + }) +} + // 添加提示词 (系统预设) export function addKeyWords(data) { return request({ diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css index 3cb4f54..f5b0135 100644 --- a/src/renderer/src/assets/iconfont/iconfont.css +++ b/src/renderer/src/assets/iconfont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4723712 */ - src: url('iconfont.woff2?t=1735483000546') format('woff2'), - url('iconfont.woff?t=1735483000546') format('woff'), - url('iconfont.ttf?t=1735483000546') format('truetype'); + src: url('iconfont.woff2?t=1737434703828') format('woff2'), + url('iconfont.woff?t=1737434703828') format('woff'), + url('iconfont.ttf?t=1737434703828') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-siweidaotu:before { + content: "\e606"; +} + .icon-chuangzuo:before { content: "\e6cc"; } diff --git a/src/renderer/src/assets/iconfont/iconfont.js b/src/renderer/src/assets/iconfont/iconfont.js index 5b93795..e577454 100644 --- a/src/renderer/src/assets/iconfont/iconfont.js +++ b/src/renderer/src/assets/iconfont/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,i,t,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(i=a,t=l.document,z=!1,o(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,M())})}function M(){z||(z=!0,i())}function o(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window); \ No newline at end of file +window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,i,t,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(i=a,t=l.document,z=!1,o(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,M())})}function M(){z||(z=!0,i())}function o(){try{t.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window); \ No newline at end of file diff --git a/src/renderer/src/assets/iconfont/iconfont.json b/src/renderer/src/assets/iconfont/iconfont.json index 14f52c3..a9fb8c3 100644 --- a/src/renderer/src/assets/iconfont/iconfont.json +++ b/src/renderer/src/assets/iconfont/iconfont.json @@ -5,6 +5,13 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "11685410", + "name": "思维导图", + "font_class": "siweidaotu", + "unicode": "e606", + "unicode_decimal": 58886 + }, { "icon_id": "39170417", "name": "创作", diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf index f03361d..c1e8344 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and b/src/renderer/src/assets/iconfont/iconfont.ttf differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff index 15fa248..90fadd5 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2 index c7518b9..aba6643 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 3914946..bc94188 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -42,7 +42,8 @@ const getFileTypeIcon = () => { airobot: 'icon-jiqirenfushi', // 数字人生成 aiimg: 'icon-xiangmuicon_maobishufa', // 文生图片 aidraw: 'icon-meishu-F', // 文生连环画 - aiyinyue: 'icon-yinle' //文生音乐 + aiyinyue: 'icon-yinle', //文生音乐 + aiswdt: 'icon-siweidaotu' //思维导图 } if (iconObj[name]) { return '#' + iconObj[name] diff --git a/src/renderer/src/layout/index.vue b/src/renderer/src/layout/index.vue index 2b78391..371f47f 100644 --- a/src/renderer/src/layout/index.vue +++ b/src/renderer/src/layout/index.vue @@ -24,7 +24,7 @@ - + @@ -114,8 +114,8 @@ const onBack = () =>{ margin-top: -3px; margin-right: 3px; } - + } - + } diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index e4529ee..b4e79b2 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -11,10 +11,9 @@ import 'virtual:windi.css' import request from "@/utils/request"; //v-md-editor -import VMdPreview from '@kangc/v-md-editor/lib/preview'; -import '@kangc/v-md-editor/lib/style/preview.css'; -// 引入你所使用的主题 此处以 github 主题为例 -import githubTheme from '@kangc/v-md-editor/lib/theme/github'; +import VMdEditor from '@kangc/v-md-editor'; +import '@kangc/v-md-editor/lib/style/base-editor.css'; +import githubTheme from '@kangc/v-md-editor/lib/theme/github.js'; import '@kangc/v-md-editor/lib/theme/style/github.css'; // highlightjs import hljs from 'highlight.js'; @@ -51,7 +50,7 @@ app.config.globalProperties.$requestGetJYW = (url,config)=>{ import Icon from '@/AixPPTist/src/plugins/icon' import Directive from '@/AixPPTist/src/plugins/directive' -VMdPreview.use(githubTheme, { +VMdEditor.use(githubTheme, { Hljs: hljs, }); @@ -93,7 +92,7 @@ app.use(router) .use(Icon) .use(Directive) .use(aiAudio) - .use(VMdPreview) + .use(VMdEditor) .mount('#app') const isStadium = (user) => { diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index b91559f..418e339 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -108,6 +108,12 @@ export const constantRoutes = [ name: 'aiVoice', meta: { title: '语音生成', showBread: true } }, + { + path: 'mindmap', + component: () => import('@/views/mindMap/index.vue'), + name: 'mindmap', + meta: { title: 'AI思维导图' } + }, ] }, diff --git a/src/renderer/src/utils/talkFile/index.js b/src/renderer/src/utils/talkFile/index.js index 495e1cd..3807a1e 100644 --- a/src/renderer/src/utils/talkFile/index.js +++ b/src/renderer/src/utils/talkFile/index.js @@ -87,6 +87,15 @@ export const exportFile = async (list) => { }) } +export const exportImg64File = async (base64, name) => { + return new Promise((resolve, reject) => { + ipcRenderer.send('export-img64-file', {base64,name}) + ipcRenderer.once('export-img64-file-reply', (e) => { + resolve() + }) + }) +} + export const creatPPT = (name, uploadData) => { JSON.parse(JSON.stringify(uploadData)) return new Promise((resolve, reject) => { diff --git a/src/renderer/src/views/mindMap/index.vue b/src/renderer/src/views/mindMap/index.vue new file mode 100644 index 0000000..098bfb0 --- /dev/null +++ b/src/renderer/src/views/mindMap/index.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index d0de80b..70bafe7 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -161,6 +161,10 @@ const tools = reactive([{ name: '文生图片', path: '/model/aiKolors', img: 'aiimg' +},{ + name: 'AI思维导图', + path: '/model/mindmap', + img: 'aiswdt' },{ name: '文生连环画', path: '', diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index f3efd8b..c9f8166 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -17,8 +17,8 @@
- - + +