From ff07de2040f721fa631a9145370d2cf7a68f4868 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sat, 30 Jul 2022 12:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=A1=8C=E9=9D=A2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=91=E6=A1=8C=E9=9D=A2=E7=AE=A1=E7=90=86=E6=95=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9Elogo=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/sysEveDesktop/sysEveDesktopAdd.js | 16 ++- .../js/sysEveDesktop/sysEveDesktopEdit.js | 21 +++- .../js/sysEveDesktop/sysEveDesktopList.js | 119 +++++++----------- .../js/syseveuserstaff/syseveuserstafflist.js | 3 +- .../tpl/sysEveDesktop/sysEveDesktopAdd.html | 17 ++- .../tpl/sysEveDesktop/sysEveDesktopEdit.html | 17 ++- .../tpl/sysEveDesktop/sysEveDesktopList.html | 35 ++---- 7 files changed, 113 insertions(+), 115 deletions(-) diff --git a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopAdd.js b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopAdd.js index b9f3303af..4ee5d8189 100644 --- a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopAdd.js +++ b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopAdd.js @@ -4,21 +4,29 @@ layui.config({ version: skyeyeVersion }).extend({ window: 'js/winui.window' -}).define(['window', 'jquery', 'winui'], function (exports) { +}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) { winui.renderColor(); layui.use(['form'], function (form) { var index = parent.layer.getFrameIndex(window.name); var $ = layui.$; - + + // 初始化上传 + $("#logo").upload(systemCommonUtil.uploadCommon003Config('logo', 12, '', 1)); matchingLanguage(); form.render(); form.on('submit(formAddBean)', function (data) { if (winui.verifyForm(data.elem)) { var params = { desktopName: $("#desktopName").val(), - desktopCnName: $("#desktopCnName").val() + desktopCnName: $("#desktopCnName").val(), + state: $("input[name='state']:checked").val(), + logo: $("#logo").find("input[name='upload']").attr("oldurl") }; - AjaxPostUtil.request({url: reqBasePath + "desktop002", params: params, type: 'json', callback: function(json) { + if (isNull(params.logo)) { + winui.window.msg('请上传图片', {icon: 2, time: 2000}); + return false; + } + AjaxPostUtil.request({url: reqBasePath + "writeSysEveDesktopMation", params: params, type: 'json', method: "POST", callback: function(json) { parent.layer.close(index); parent.refreshCode = '0'; }}); diff --git a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopEdit.js b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopEdit.js index 2c814829b..0eab121f3 100644 --- a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopEdit.js +++ b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopEdit.js @@ -4,7 +4,7 @@ layui.config({ version: skyeyeVersion }).extend({ window: 'js/winui.window' -}).define(['window', 'jquery', 'winui'], function (exports) { +}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) { winui.renderColor(); layui.use(['form'], function (form) { var index = parent.layer.getFrameIndex(window.name); @@ -13,19 +13,30 @@ layui.config({ showGrid({ id: "showForm", url: reqBasePath + "desktop006", - params: {rowId:parent.rowId}, + params: {id: parent.rowId}, pagination: false, + method: "GET", template: $("#beanTemplate").html(), ajaxSendAfter:function (json) { + $("input:radio[name=state][value=" + json.bean.state + "]").attr("checked", true); + // 初始化上传 + $("#logo").upload(systemCommonUtil.uploadCommon003Config('logo', 12, json.bean.logo, 1)); matchingLanguage(); + form.render(); form.on('submit(formEditBean)', function (data) { if (winui.verifyForm(data.elem)) { var params = { - rowId: parent.rowId, + id: parent.rowId, desktopName: $("#desktopName").val(), - desktopCnName: $("#desktopCnName").val() + desktopCnName: $("#desktopCnName").val(), + state: $("input[name='state']:checked").val(), + logo: $("#logo").find("input[name='upload']").attr("oldurl") }; - AjaxPostUtil.request({url: reqBasePath + "desktop007", params: params, type: 'json', callback: function (json) { + if (isNull(params.logo)) { + winui.window.msg('请上传图片', {icon: 2, time: 2000}); + return false; + } + AjaxPostUtil.request({url: reqBasePath + "writeSysEveDesktopMation", params: params, type: 'json', method: "POST", callback: function (json) { parent.layer.close(index); parent.refreshCode = '0'; }}); diff --git a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopList.js b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopList.js index 5331fd12e..896e1f962 100644 --- a/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopList.js +++ b/userauth/src/main/resources/template/js/sysEveDesktop/sysEveDesktopList.js @@ -25,50 +25,57 @@ layui.config({ limit: getLimit(), cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'}, - { field: 'desktopName', title: '桌面名称', align: 'left', width: 120 }, - { field: 'desktopCnName', title: '英文名称', align: 'left', width: 120 }, - { field: 'allNum', title: '菜单数量', align: 'center', width: 120 }, - { field: 'state', title: '状态', width: 120, align: 'center', templet: function (d) { - if(d.state == '3'){ - return "下线"; - }else if(d.state == '2'){ - return "上线"; + { field: 'desktopName', title: '桌面名称', align: 'left', width: 150 }, + { field: 'desktopCnName', title: '英文名称', align: 'left', width: 150 }, + { field: 'logo', title: 'LOGO', align: 'center', width: 60, templet: function (d) { + if(isNull(d.logo)){ + return ''; + } else { + return ''; + } + }}, + { field: 'allNum', title: '菜单数量', align: 'center', width: 100 }, + { field: 'orderBy', title: '序号', align: 'center', width: 80 }, + { field: 'state', title: '状态', width: 80, align: 'center', templet: function (d) { + if(d.state == '2'){ + return "禁用"; }else if(d.state == '1'){ - return "新建"; + return "启用"; } }}, { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 357, toolbar: '#tableBar'} + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar'} ]], - done: function(){ + done: function(json) { matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入桌面名称", function () { + table.reload("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); } }); table.on('tool(messageTable)', function (obj) { var data = obj.data; var layEvent = obj.event; - if (layEvent === 'edit') { //编辑 - edit(data); - }else if (layEvent === 'delet') { //删除 - delet(data); - }else if (layEvent === 'up') { //上线 - up(data); - }else if (layEvent === 'down') { //下线 - down(data); - }else if (layEvent === 'upMove') { //上移 - upMove(data); - }else if (layEvent === 'downMove') { //下移 - downMove(data); - }else if (layEvent === 'remove') { //一键移除菜单 - remove(data); - } + if (layEvent === 'edit') { //编辑 + edit(data); + } else if (layEvent === 'delet') { //删除 + delet(data); + } else if (layEvent === 'upMove') { //上移 + upMove(data); + } else if (layEvent === 'downMove') { //下移 + downMove(data); + } else if (layEvent === 'remove') { //一键移除菜单 + remove(data); + } else if (layEvent === 'logo') { //logo预览 + systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.logo)); + } }); - //添加 + // 添加 $("body").on("click", "#addBean", function() { _openNewWindows({ url: "../../tpl/sysEveDesktop/sysEveDesktopAdd.html", @@ -81,54 +88,30 @@ 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); - AjaxPostUtil.request({url: reqBasePath + "desktop003", params:{rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "desktop003", params:{id: data.id}, type: 'json', method: "DELETE", callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); }); } - //一键移除菜单 + // 一键移除菜单 function remove(data){ var msg = '确认一键移除菜单选择该桌面的所有菜单吗?'; layer.confirm(msg, { icon: 3, title: '一键移除菜单' }, function (index) { layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "desktop012", params:{rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "desktop012", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) { winui.window.msg("移除成功", {icon: 1, time: 2000}); loadTable(); }}); }); } - //上线 - function up(data){ - var msg = '确认上线选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '上线桌面名称' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "desktop004", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("上线成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - //下线 - function down(data){ - var msg = '确认下线选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '下线桌面名称' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: reqBasePath + "desktop005", params:{rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("下线成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - //编辑 + // 编辑 function edit(data){ rowId = data.id; _openNewWindows({ @@ -143,43 +126,35 @@ layui.config({ }); } - //上移 + // 上移 function upMove(data){ - AjaxPostUtil.request({url: reqBasePath + "desktop008", params:{rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "desktop008", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); } - //下移 + // 下移 function downMove(data){ - AjaxPostUtil.request({url: reqBasePath + "desktop009", params:{rowId: data.id}, type: 'json', callback: function (json) { + AjaxPostUtil.request({url: reqBasePath + "desktop009", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); } - //刷新数据 + form.render(); + + // 刷新数据 $("body").on("click", "#reloadTable", function() { loadTable(); }); - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - table.reload("messageTable", {page: {curr: 1}, where: getTableParams()}); - } - return false; - }); - function loadTable(){ table.reload("messageTable", {where: getTableParams()}); } function getTableParams() { - return { - desktopName: $("#desktopName").val() - }; + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); } exports('sysEveDesktopList', {}); diff --git a/userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js b/userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js index dcb95eff4..394311fd4 100644 --- a/userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js +++ b/userauth/src/main/resources/template/js/syseveuserstaff/syseveuserstafflist.js @@ -17,8 +17,7 @@ layui.config({ form = layui.form, table = layui.table, soulTable = layui.soulTable; - var selTemplate = getFileContent('tpl/template/select-option.tpl') - + authBtn('1555562812681'); var bodyList = new Array(); diff --git a/userauth/src/main/resources/template/tpl/sysEveDesktop/sysEveDesktopAdd.html b/userauth/src/main/resources/template/tpl/sysEveDesktop/sysEveDesktopAdd.html index 9df7073b5..cefb38f33 100644 --- a/userauth/src/main/resources/template/tpl/sysEveDesktop/sysEveDesktopAdd.html +++ b/userauth/src/main/resources/template/tpl/sysEveDesktop/sysEveDesktopAdd.html @@ -12,18 +12,31 @@