From 4883ba89368426b09cd67fea3e3ca08530920eb2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-ESU4BDD\\WeiZhiQiang" <598748873@qq.com> Date: Wed, 11 Oct 2023 09:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=BB=E5=BA=94=E7=94=A8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=89=98=E7=AE=A1=E5=88=B0=E8=A1=A8=E5=8D=95=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/lightAppType/lightAppTypeAdd.js | 67 ------- .../js/lightAppType/lightAppTypeEdit.js | 96 ---------- .../js/lightAppType/lightAppTypeList.js | 180 ------------------ .../tpl/lightAppType/lightAppTypeAdd.html | 61 ------ .../tpl/lightAppType/lightAppTypeEdit.html | 68 ------- .../tpl/lightAppType/lightAppTypeList.html | 53 ------ .../layui/customer/common/systemCommonUtil.js | 11 +- 7 files changed, 10 insertions(+), 526 deletions(-) delete mode 100644 light-app/src/main/resources/template/js/lightAppType/lightAppTypeAdd.js delete mode 100644 light-app/src/main/resources/template/js/lightAppType/lightAppTypeEdit.js delete mode 100644 light-app/src/main/resources/template/js/lightAppType/lightAppTypeList.js delete mode 100644 light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeAdd.html delete mode 100644 light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeEdit.html delete mode 100644 light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeList.html diff --git a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeAdd.js b/light-app/src/main/resources/template/js/lightAppType/lightAppTypeAdd.js deleted file mode 100644 index 599c845f5..000000000 --- a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeAdd.js +++ /dev/null @@ -1,67 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - - // 初始化上传 - $("#iconpicPath").upload(systemCommonUtil.uploadCommon003Config('iconpicPath', 12, '', 1)); - - // 图标类型变化事件 - form.on('radio(iconType)', function (data) { - var val = data.value; - if(val == '1'){//icon - $(".menuIconTypeIsTwo").addClass("layui-hide"); - $(".menuIconTypeIsOne").removeClass("layui-hide"); - } else if (val == '2'){//图片 - $(".menuIconTypeIsTwo").removeClass("layui-hide"); - $(".menuIconTypeIsOne").addClass("layui-hide"); - } else { - winui.window.msg('状态值错误', {icon: 2, time: 2000}); - } - }); - - // 图标选中事件 - $("body").on("focus", "#iconPath", function (e) { - systemCommonUtil.openSysEveIconChoosePage(function(sysIconChooseClass){ - $("#iconPath").val(sysIconChooseClass); - $("#iconShow").css({'color': 'black'}); - $("#iconShow").attr("class", "fa fa-fw " + $("#iconPath").val()); - }); - }); - - matchingLanguage(); - form.render(); - form.on('submit(formAddBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - typeName: $("#typeName").val(), - iconType: data.field.iconType - }; - if (data.field.iconType == '1'){ - params.iconPath = $("#iconPath").val(); - } else if (data.field.iconType == '2'){ - params.iconPath = $("#iconpicPath").find("input[type='hidden'][name='upload']").attr("oldurl"); - } else { - winui.window.msg("状态值错误。", {icon: 2, time: 2000}); - return false; - } - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype002", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - }); -}); \ No newline at end of file diff --git a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeEdit.js b/light-app/src/main/resources/template/js/lightAppType/lightAppTypeEdit.js deleted file mode 100644 index 9952d5658..000000000 --- a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeEdit.js +++ /dev/null @@ -1,96 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$; - - showGrid({ - id: "showForm", - url: sysMainMation.lightAppBasePath + "lightapptype003", - params: {rowId: parent.rowId}, - pagination: false, - template: $("#beanTemplate").html(), - ajaxSendLoadBefore: function(hdb) { - }, - ajaxSendAfter:function (json) { - //类型 - $("input:radio[name=iconType][value=" + json.bean.iconType + "]").attr("checked", true); - if(json.bean.iconType == '1'){//icon - $(".menuIconTypeIsTwo").addClass("layui-hide"); - $(".menuIconTypeIsOne").removeClass("layui-hide"); - // 初始化上传 - $("#iconpicPath").upload(systemCommonUtil.uploadCommon003Config('iconpicPath', 12, '', 1)); - } else if (json.bean.iconType == '2'){//图片 - $(".menuIconTypeIsTwo").removeClass("layui-hide"); - // 初始化上传 - $("#iconpicPath").upload(systemCommonUtil.uploadCommon003Config('iconpicPath', 12, json.bean.iconPath, 1)); - $(".menuIconTypeIsOne").addClass("layui-hide"); - } - - $("#iconShow").attr("class", "fa fa-fw " + $("#iconPath").val()); - $("#iconShow").css({'color': 'black'}); - - matchingLanguage(); - form.render(); - - //图标类型变化事件 - form.on('radio(iconType)', function (data) { - var val = data.value; - if(val == '1'){//icon - $(".menuIconTypeIsTwo").addClass("layui-hide"); - $(".menuIconTypeIsOne").removeClass("layui-hide"); - } else if (val == '2'){//图片 - $(".menuIconTypeIsTwo").removeClass("layui-hide"); - $(".menuIconTypeIsOne").addClass("layui-hide"); - } else { - winui.window.msg('状态值错误', {icon: 2, time: 2000}); - } - }); - - // 图标选中事件 - $("body").on("focus", "#iconPath", function (e) { - systemCommonUtil.openSysEveIconChoosePage(function(sysIconChooseClass){ - $("#iconPath").val(sysIconChooseClass); - $("#iconShow").css({'color': 'black'}); - $("#iconShow").attr("class", "fa fa-fw " + $("#iconPath").val()); - }); - }); - - form.on('submit(formEditMenu)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - typeName: $("#typeName").val(), - iconType: data.field.iconType, - rowId: parent.rowId, - }; - if (data.field.iconType == '1'){ - params.iconPath = $("#iconPath").val(); - } else if (data.field.iconType == '2'){ - params.iconPath = $("#iconpicPath").find("input[type='hidden'][name='upload']").attr("oldurl"); - } else { - winui.window.msg("状态值错误。", {icon: 2, time: 2000}); - return false; - } - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype004", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - } - }); - - // 取消 - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - - }); -}); \ No newline at end of file diff --git a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeList.js b/light-app/src/main/resources/template/js/lightAppType/lightAppTypeList.js deleted file mode 100644 index acbfd86df..000000000 --- a/light-app/src/main/resources/template/js/lightAppType/lightAppTypeList.js +++ /dev/null @@ -1,180 +0,0 @@ - -var rowId = ""; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { - winui.renderColor(); - var $ = layui.$, - form = layui.form, - table = layui.table; - - authBtn('1559201340836'); - table.render({ - id: 'messageTable', - elem: '#messageTable', - method: 'post', - url: sysMainMation.lightAppBasePath + 'lightapptype001', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'typeName', title: '名称', width: 120 }, - { field: 'iconPath', title: 'logo', width: 60, templet: function (d) { - if(isNull(d.iconPath)){ - return ''; - } else { - var str = ''; - if(d.iconType == '1'){ - str += '
'; - str += ''; - str += '
'; - } else if (d.iconType = '2'){ - str = ''; - } - return str; - } - }}, - { field: 'useNum', title: '轻应用数量', align: 'center', width: 120 }, - { field: 'state', title: '状态', width: 100, align: 'center', templet: function (d) { - if(d.state == '1'){ - return "新建"; - } else if (d.state == '2'){ - return "上线"; - } else if (d.state == '3'){ - return "下线"; - } else { - return "参数错误"; - } - }}, - { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 }, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#tableBar' } - ]], - done: function(json) { - matchingLanguage(); - initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称", function () { - table.reloadData("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 === 'iconPath') { // 预览 - systemCommonUtil.showPicImg(fileBasePath + data.iconPath); - } else if (layEvent === 'delete') { // 删除 - del(data); - } else if (layEvent === 'up') { // 上线 - up(data); - } else if (layEvent === 'down') { // 下线 - down(data); - } else if (layEvent === 'top') { // 上移 - topOne(data); - } else if (layEvent === 'lower') { // 下移 - lowerOne(data); - } - }); - - // 新增 - $("body").on("click", "#addBean", function() { - _openNewWindows({ - url: "../../tpl/lightAppType/lightAppTypeAdd.html", - title: systemLanguage["com.skyeye.addPageTitle"][languageType], - pageId: "lightAppTypeAdd", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - - // 编辑 - function edit(data) { - rowId = data.id; - _openNewWindows({ - url: "../../tpl/lightAppType/lightAppTypeEdit.html", - title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "lightAppTypeEdit", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - } - - // 删除 - function del(data, obj) { - var msg = obj ? '确认删除【' + obj.data.typeName + '】吗?' : '确认删除选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '删除轻应用类型' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype007", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 上线 - function up(data, obj){ - var msg = obj ? '确认将【' + obj.data.typeName + '】上线吗?' : '确认将选中数据上线吗?'; - layer.confirm(msg, { icon: 3, title: '轻应用类型上线' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype008", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("上线成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 下线 - function down(data, obj){ - var msg = obj ? '确认将【' + obj.data.typeName + '】下线吗?' : '确认将选中数据下线吗?'; - layer.confirm(msg, { icon: 3, title: '轻应用类型下线' }, function (index) { - layer.close(index); - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype009", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg("下线成功", {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 上移 - function topOne(data) { - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype005", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - } - - // 下移 - function lowerOne(data) { - AjaxPostUtil.request({url: sysMainMation.lightAppBasePath + "lightapptype006", params: {rowId: data.id}, type: 'json', callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - } - - form.render(); - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } - - function getTableParams() { - return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); - } - - exports('lightAppTypeList', {}); -}); diff --git a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeAdd.html b/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeAdd.html deleted file mode 100644 index d05691c52..000000000 --- a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeAdd.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - -
-
-
- -
- -
-
-
- -
- - -
-
- - - -
-
- - -
-
-
-
- - - - - \ No newline at end of file diff --git a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeEdit.html b/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeEdit.html deleted file mode 100644 index 741d101f9..000000000 --- a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeEdit.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - -
-
- -
-
- - - - - - - - \ No newline at end of file diff --git a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeList.html b/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeList.html deleted file mode 100644 index eb6a53be5..000000000 --- a/light-app/src/main/resources/template/tpl/lightAppType/lightAppTypeList.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -
-
- - -
-
-
-
- -
- - - - - \ No newline at end of file diff --git a/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js index 1479762be..9decfc5dc 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/common/systemCommonUtil.js @@ -424,6 +424,7 @@ var systemCommonUtil = { initIconChooseHtml: function (showBoxId, form, colorpicker, uploadType) { $("#" + showBoxId).html(systemCommonUtil.iconChooseHtml); systemCommonUtil.initIconEvent(form, colorpicker, uploadType, "", "#1c97f5" , "#1c97f5"); + form.render(); }, // 编辑时初始化html,并添加监听事件 initEditIconChooseHtml: function (showBoxId, form, colorpicker, uploadType, params) { @@ -460,6 +461,7 @@ var systemCommonUtil = { $("#iconShow").parent().css({'background-color': params.iconBg}); } systemCommonUtil.initIconEvent(form, colorpicker, uploadType, params.iconPic, params.iconBg, params.iconColor); + form.render(); }, initIconEvent: function (form, colorpicker, uploadType, uploadDefaultValue, iconBg, iconColor) { // 初始化上传 @@ -531,7 +533,11 @@ var systemCommonUtil = { }); }, // 获取图标选中数据 - getIconChoose: function (params) { + getIconChoose: function (inputParams) { + var params = {}; + if (!isNull(inputParams)) { + params = inputParams; + } params["iconChooseResult"] = true; var iconType = $("input[name='iconType']:checked").val(); params["iconType"] = iconType; @@ -560,6 +566,9 @@ var systemCommonUtil = { initIconShow: function (bean) { var str = ''; if (bean.iconType == '1') { + if (isNull(bean.icon)) { + return str; + } if (isNull(bean.iconBg)) { str += '
'; } else { -- GitLab