提交 314b974c 编写于 作者: Skyeye云's avatar Skyeye云

feat: 笔记模块重构完成

上级 8327a2f3
......@@ -36,7 +36,7 @@ layui.config({
var ztree = null;
fsTree.render({
id: "treeDemo",
url: sysMainMation.noteBasePath + "mynote001",
url: sysMainMation.noteBasePath + "queryFolderByUserId",
checkEnable: false,
dragEnable: true,
loadEnable: true,//异步加载
......@@ -168,7 +168,7 @@ layui.config({
//编辑节点名称
function onRename(event, treeId, treeNode) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote004", params: {catalogName: treeNode.name, fileType : 'folder', rowId : treeNode.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "editFileFolderById", params: {name: treeNode.name, fileType: 'folder', id: treeNode.id}, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("保存成功", {icon: 1, time: 2000});
folderId = treeNode.id;
showListById();//获取文件夹和笔记列表
......@@ -337,7 +337,7 @@ layui.config({
text: "输出为PDF",
img: "../../assets/images/decompression-now.png",
callback: function() {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote014", params: {rowId: clickId, type: "2"}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "outputNoteIsZipJob", params: {id: clickId, type: "file"}, type: 'json', method: 'POST', callback: function (json) {
layer.alert('笔记输出为PDF任务已创建,请前往 <a href="../../tpl/jobSpace/jobSpace.html" style="color: blue;" target="_blank">我的输出</a> 查看。');
}});
}
......@@ -361,14 +361,14 @@ layui.config({
obj.find("div[class='folder-item-title-content']").find("input").select();
obj.find("div[class='folder-item-title-content']").find("input").blur(function(){
var value = obj.find("div[class='folder-item-title-content']").find("input").val();
if(value.length > 0){
if (value.length > 0) {
var nowhtml = "<span>" + value + "</span>";
obj.find("div[class='folder-item-title-content']").html(nowhtml);
if(html != value){
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote004", params: {catalogName: value, fileType : clickType, rowId : clickId}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "editFileFolderById", params: {name: value, fileType: clickType, id: clickId}, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("保存成功", {icon: 1, time: 2000});
if(clickType == "folder"){
//刷新节点
if (clickType == "folder") {
// 刷新节点
refreshTreePointNode();
// 设置选中节点
chooseNodeSelect(folderId);
......@@ -393,22 +393,22 @@ layui.config({
pageId: "noteFileTree",
area: ['300px', '400px'],
callBack: function (refreshCode) {
if(refreshCode != "" && refreshCode != undefined){
if(refreshCode != "-9999"){
if (refreshCode != "" && refreshCode != undefined) {
if (refreshCode != "-9999") {
winui.window.msg("保存成功", {icon: 1, time: 2000});
noteId = "";
if(clickType == "folder"){
if (clickType == "folder") {
folderId = refreshCode;
//刷新节点
refreshTreePointNode();
// 设置选中节点
//刷新节点
refreshTreePointNode();
// 设置选中节点
chooseNodeSelect(folderId);
var selNode = ztree.getNodeByParam("id", clickId, null);
ztree.removeNode(selNode);//移除节点
var selNode = ztree.getNodeByParam("id", clickId, null);
ztree.removeNode(selNode);//移除节点
}
// 获取文件夹和笔记列表
showListById();
}else if (refreshCode == '-9999') {
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2, time: 2000});
}
}
......@@ -512,7 +512,7 @@ layui.config({
// 树操作--输出压缩包
$("body").on("click", ".treereOutPutZIPContent", function (e) {
hideRMenu();
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote014", params: {rowId: folderId, type: "1"}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "outputNoteIsZipJob", params: {id: folderId, type: "folder"}, type: 'json', method: 'POST', callback: function (json) {
layer.alert('笔记输出压缩包任务已创建,请前往 <a href="../../tpl/jobSpace/jobSpace.html" style="color: #0000ff;" target="_blank">我的输出</a> 查看。');
}});
});
......@@ -602,9 +602,9 @@ layui.config({
// 删除指定文件夹或笔记
function deleteFileOrNote(id){
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote003", params: {rowId: id, fileType: clickType}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "deleteFileFolderById", params: {id: id, fileType: clickType}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
if(clickType == "folder"){
if (clickType == "folder") {
var selNode = ztree.getNodeByParam("id", id, null);
ztree.selectNode(selNode.getParentNode());// 设置选中节点
// 重置folderid
......@@ -624,7 +624,7 @@ layui.config({
scrollElem: "#folderChildList",
done: function(page, next) { //到达临界点(默认滚动触发),触发下一页
var lis = [];
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote005", params: {page: page, limit: 15, search: searchTitle}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "queryNewNoteListByUserId", params: {page: page, limit: 15, keyword: searchTitle}, type: 'json', method: 'POST', callback: function (json) {
lis.push(getDataUseHandlebars(folderchildlisetTemplate, json));
next(lis.join(''), (page * 15) < json.total);
initRightMenu();
......
......@@ -20,7 +20,7 @@ layui.config({
var ztree = null;
fsTree.render({
id: "treeDemo",
url: sysMainMation.noteBasePath + "mynote012?moveId=" + clickId,
url: sysMainMation.noteBasePath + "queryFolderByUserId?moveId=" + clickId,
checkEnable: true,
chkStyle: "radio",
loadEnable: true,//异步加载
......
......@@ -34,7 +34,7 @@ layui.config({
}
function loadNote(){
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "mynote013", params: {rowId: rowId}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.noteBasePath + "queryNoteById", params: {id: rowId}, type: 'json', method: 'GET', callback: function (json) {
$("#noteTile").html(json.bean.title);
$("#createName").html(json.bean.createName);
$("#createTime").html(json.bean.createTime);
......
......@@ -15,7 +15,7 @@
<div class="file-write-left">
<div class="left-content">
<ul id="treeDemo" class="ztree fsTree" method="get" isRoot="0"
treeIdKey="id" inputs="parentId" treePIdKey="pId" clickCallbackInputs="parentId:$id" treeName="name"></ul>
treeIdKey="id" inputs="parentId" treePIdKey="parentId" clickCallbackInputs="parentId:$id" treeName="name"></ul>
</div>
</div>
<div class="file-write-center">
......@@ -98,21 +98,21 @@
<!-- folderchildlisetTemplate.tpl -->
<script type="text/x-handlebars-template" id="folderchildlisetTemplate">
{{#each rows}}
<div class="folder-item" id="{{id}}" rowname="{{name}}" rowtype="{{fileType}}" title="笔记:{{name}}&#10;简介:{{desc}}">
<div class="folder-item" id="{{id}}" rowname="{{name}}" rowtype="{{type}}" title="笔记:{{name}}&#10;简介:{{remark}}">
<div class="folder-item-title">
<div class="folder-item-title-icon">
<img src="{{icon}}"/>
<img src="{{iconLogo}}"/>
</div>
<div class="folder-item-title-content">
<span>{{name}}</span>
</div>
</div>
<div class="folder-item-desc">
{{desc}}
{{remark}}
</div>
<div class="folder-item-mation">
<div class="folder-item-mation-time">
{{createTime}}
{{lastUpdateTime}}
</div>
</div>
</div>
......
......@@ -12,7 +12,7 @@
<body class="corlor-36">
<div style="margin:0 auto; overflow-x: hidden; height: calc(100% - 40px);">
<ul id="treeDemo" class="ztree fsTree" method="get" isRoot="0"
treeIdKey="id" inputs="parentId" treePIdKey="pId"
treeIdKey="id" inputs="parentId" treePIdKey="parentId"
clickCallbackInputs="parentId:$id" treeName="name"></ul>
</div>
<div style="margin:0 auto; overflow-x: hidden; height: 40px; text-align: center; line-height: 40px;">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册