From 08f942baeedbe7be4b362eaed8f41cb608aa98ea Mon Sep 17 00:00:00 2001 From: "DESKTOP-ESU4BDD\\WeiZhiQiang" <598748873@qq.com> Date: Fri, 26 Jan 2024 22:54:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AC=94=E8=AE=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/js/index/myNote.js | 33 ++++++++++--------- .../resources/template/js/note/noteEdit.js | 4 +-- .../template/js/note/noteEditLuckysheet.js | 4 +-- .../template/js/note/noteEditMarkDown.js | 4 +-- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/note/src/main/resources/template/js/index/myNote.js b/note/src/main/resources/template/js/index/myNote.js index 36fa25f8b..cf3ba0ef1 100644 --- a/note/src/main/resources/template/js/index/myNote.js +++ b/note/src/main/resources/template/js/index/myNote.js @@ -450,23 +450,23 @@ layui.config({ // 默认展示当前最新的笔记 showNewNoteList(); - //树操作--新建文件夹 + // 树操作--新建文件夹 $("body").on("click", ".treecreateNewFolder", function (e) { noteId = ""; - if(folderId == "1"){ + if (folderId == "1") { folderId = "2"; } hideRMenu(); - AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote002", params: {parentId: folderId, catalogName: '新建文件夹'}, type: 'json', callback: function (json) { - //刷新节点 + AjaxPostUtil.request({url: sysMainMation.noteBasePath + "writeFolder", params: {parentId: folderId, name: '新建文件夹'}, type: 'json', method: 'POST', callback: function (json) { + // 刷新节点 refreshTreePointNode(); folderId = json.bean.id; - showListById();//获取文件夹和笔记列表 - //执行延时 - setTimeout(function(){ + showListById(); + // 执行延时 + setTimeout(function () { var selNode = ztree.getNodeByParam("id", json.bean.id, null); ztree.editName(selNode); - },1000); + }, 1000); }}); }); @@ -587,15 +587,16 @@ layui.config({ // 新增笔记 function addNote(title, type){ - if(folderId == "1"){ - thisfolderId = "2"; - } else { - thisfolderId = folderId; - } + if (folderId == "1") { + thisfolderId = "2"; + } else { + thisfolderId = folderId; + } hideRMenu(); - AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote007", params: {parentId: thisfolderId, title: title, type: type}, type: 'json', callback: function (json) { - noteId = json.bean.id; - showListById();// 获取文件夹和笔记列表 + AjaxPostUtil.request({url: sysMainMation.noteBasePath + "writeNote", params: {parentId: thisfolderId, name: title, type: type}, type: 'json', method: 'POST', callback: function (json) { + noteId = json.bean.id; + // 获取文件夹和笔记列表 + showListById(); }}); } diff --git a/note/src/main/resources/template/js/note/noteEdit.js b/note/src/main/resources/template/js/note/noteEdit.js index 084a82f95..c7665dcdc 100644 --- a/note/src/main/resources/template/js/note/noteEdit.js +++ b/note/src/main/resources/template/js/note/noteEdit.js @@ -17,10 +17,10 @@ layui.config({ var noteId = parent.noteId; // 显示编辑器内容 - AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote008", params: {rowId: noteId}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: sysMainMation.noteBasePath + "queryNoteById", params: {id: noteId}, type: 'json', method: "GET", callback: function (json) { ue = ueEditorUtil.initEditor('container'); - parent.$("#noteTitle").val(json.bean.title); + parent.$("#noteTitle").val(json.bean.name); ue.addListener("ready", function () { ue.setContent(isNull(json.bean.content) ? "" : json.bean.content); var height = $(".manage-console").height() - $(".edui-editor-toolbarbox").height() - $(".edui-editor-bottomContainer").height() - 15; diff --git a/note/src/main/resources/template/js/note/noteEditLuckysheet.js b/note/src/main/resources/template/js/note/noteEditLuckysheet.js index 08cdc21fd..5a597d179 100644 --- a/note/src/main/resources/template/js/note/noteEditLuckysheet.js +++ b/note/src/main/resources/template/js/note/noteEditLuckysheet.js @@ -13,8 +13,8 @@ layui.config({ form.render(); // 显示编辑器内容 - AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote008", params: {rowId: noteId}, type: 'json', callback: function (json) { - parent.$("#noteTitle").val(json.bean.title); + AjaxPostUtil.request({url: sysMainMation.noteBasePath + "queryNoteById", params: {id: noteId}, type: 'json', method: "GET", callback: function (json) { + parent.$("#noteTitle").val(json.bean.name); var param = { container: 'luckysheet', showtoolbar: true, diff --git a/note/src/main/resources/template/js/note/noteEditMarkDown.js b/note/src/main/resources/template/js/note/noteEditMarkDown.js index a239f3c9d..7d5d9c8ce 100644 --- a/note/src/main/resources/template/js/note/noteEditMarkDown.js +++ b/note/src/main/resources/template/js/note/noteEditMarkDown.js @@ -36,8 +36,8 @@ layui.config({ initPasteDragImg(this); // 加载后富文本编辑器成功后的回调 // 显示编辑器内容 - AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote008", params: {rowId: noteId}, type: 'json', callback: function (json) { - parent.$("#noteTitle").val(json.bean.title); + AjaxPostUtil.request({url: sysMainMation.noteBasePath + "queryNoteById", params: {id: noteId}, type: 'json', method: "GET", callback: function (json) { + parent.$("#noteTitle").val(json.bean.name); layEditor.setMarkdown(json.bean.content); matchingLanguage(); }}); -- GitLab