From 1be241b7a385e56d13eb0426b842085351ac121a Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Mon, 21 Mar 2022 11:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/knowledgetype/knowledgetypeedit.js | 5 +-- .../js/knowledgetype/knowledgetypelist.js | 42 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypeedit.js b/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypeedit.js index d9043b065..78c3e3fc4 100644 --- a/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypeedit.js +++ b/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypeedit.js @@ -10,7 +10,6 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); var $ = layui.$; - var parentType; showGrid({ id: "showForm", url: reqBasePath + "knowledgetype006", @@ -27,12 +26,12 @@ layui.config({ rowId: parent.rowId, name: $("#typeName").val() }; - AjaxPostUtil.request({url:reqBasePath + "knowledgetype007", params:params, type:'json', callback:function(json){ + AjaxPostUtil.request({url: reqBasePath + "knowledgetype007", params: params, type: 'json', method: "POST", callback: function(json){ if(json.returnCode == 0){ parent.layer.close(index); parent.refreshCode = '0'; }else{ - winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); } }}); } diff --git a/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypelist.js b/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypelist.js index 96ff20326..fab25e51f 100644 --- a/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypelist.js +++ b/knowlg/src/main/resources/template/js/knowledgetype/knowledgetypelist.js @@ -61,15 +61,7 @@ layui.config({ } }); - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - loadTable(); - } - return false; - }); - - //添加 + // 添加 $("body").on("click", "#addBean", function(){ _openNewWindows({ url: "../../tpl/knowledgetype/knowledgetypeadd.html", @@ -86,7 +78,7 @@ layui.config({ }}); }); - //删除 + // 删除 function delet(data){ layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ layer.close(index); @@ -101,39 +93,39 @@ layui.config({ }); } - //上线 + // 上线 function up(data){ var msg = '确认上线选中数据吗?'; layer.confirm(msg, { icon: 3, title: '上线知识库类型' }, function (index) { layer.close(index); - AjaxPostUtil.request({url:reqBasePath + "knowledgetype004", params:{rowId: data.id}, type:'json', callback:function(json){ + AjaxPostUtil.request({url: reqBasePath + "knowledgetype004", params: {rowId: data.id}, type: 'json', method: 'POST', callback: function(json){ if(json.returnCode == 0){ - winui.window.msg("上线成功", {icon: 1,time: 2000}); + winui.window.msg("上线成功", {icon: 1, time: 2000}); loadTable(); }else{ - winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); } }}); }); } - //下线 + // 下线 function down(data){ var msg = '确认下线选中数据吗?'; layer.confirm(msg, { icon: 3, title: '下线知识库类型' }, function (index) { layer.close(index); - AjaxPostUtil.request({url:reqBasePath + "knowledgetype005", params:{rowId: data.id}, type:'json', callback:function(json){ + AjaxPostUtil.request({url: reqBasePath + "knowledgetype005", params: {rowId: data.id}, type: 'json', method: 'POST', callback: function(json){ if(json.returnCode == 0){ - winui.window.msg("下线成功", {icon: 1,time: 2000}); + winui.window.msg("下线成功", {icon: 1, time: 2000}); loadTable(); }else{ - winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); } }}); }); } - //编辑 + // 编辑 function edit(data){ rowId = data.id; _openNewWindows({ @@ -151,8 +143,16 @@ layui.config({ } }); } - - //刷新数据 + + form.render(); + form.on('submit(formSearch)', function (data) { + if (winui.verifyForm(data.elem)) { + loadTable(); + } + return false; + }); + + // 刷新数据 $("body").on("click", "#reloadTable", function(){ loadTable(); }); -- GitLab