From 820fdc3ea18e987099e9d764cd9d8dacbe4e291e Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Thu, 21 Jan 2021 21:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Dict=E3=80=91=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/assets/modular/system/dict/dict.js | 153 ---------------- .../modular/system/dictType/dictType.js | 164 ------------------ .../pages/modular/system/dict/dict.html | 38 ---- .../modular/system/dictType/dictType.html | 53 ------ 4 files changed, 408 deletions(-) delete mode 100644 src/main/webapp/assets/modular/system/dict/dict.js delete mode 100644 src/main/webapp/assets/modular/system/dictType/dictType.js delete mode 100644 src/main/webapp/pages/modular/system/dict/dict.html delete mode 100644 src/main/webapp/pages/modular/system/dictType/dictType.html diff --git a/src/main/webapp/assets/modular/system/dict/dict.js b/src/main/webapp/assets/modular/system/dict/dict.js deleted file mode 100644 index 79e3e426..00000000 --- a/src/main/webapp/assets/modular/system/dict/dict.js +++ /dev/null @@ -1,153 +0,0 @@ -layui.use(['table', 'treeTable', 'func', 'HttpRequest'], function () { - var $ = layui.$; - var treeTable = layui.treeTable; - var table = layui.table; - var func = layui.func; - var HttpRequest = layui.HttpRequest; - - //table的初始化实例 - var insTb; - - /** - * 基础字典管理 - */ - var Dict = { - tableId: "dictTable" - }; - - /** - * 初始化表格的列 - */ - Dict.initColumn = function () { - return [ - {type: 'checkbox'}, - {field: 'dictName', align: "center", title: '字典名称'}, - {field: 'dictCode', align: "center", title: '字典编码'}, - {align: 'center', toolbar: '#tableBar', title: '操作'} - ]; - }; - - /** - * 点击查询按钮 - */ - Dict.search = function () { - var queryData = {}; - queryData['dictName'] = $("#condition").val(); - queryData['dictCode'] = $("#condition").val(); - Dict.initTable(Dict.tableId, queryData); - }; - - /** - * 弹出添加对话框 - */ - Dict.openAddDlg = function () { - func.open({ - height: 680, - title: '添加字典', - content: Feng.ctxPath + '/view/dict/addView?dictTypeId=' + $("#dictTypeId").val(), - tableId: Dict.tableId, - endCallback: function () { - Dict.initTable(Dict.tableId); - } - }); - }; - - /** - * 点击编辑 - * - * @param data 点击按钮时候的行数据 - */ - Dict.openEditDlg = function (data) { - func.open({ - height: 680, - title: '修改字典', - content: Feng.ctxPath + '/view/dict/editView?dictId=' + data.dictId, - tableId: Dict.tableId, - endCallback: function () { - Dict.initTable(Dict.tableId); - } - }); - }; - - /** - * 点击删除 - * - * @param data 点击按钮时候的行数据 - */ - Dict.onDeleteItem = function (data) { - var operation = function () { - var httpRequest = new HttpRequest(Feng.ctxPath + "/dict/deleteDict", 'post', function (data) { - Feng.success("删除成功!"); - Dict.search(); - }, function (data) { - Feng.error("删除失败!" + data.message + "!"); - }); - httpRequest.set(data); - httpRequest.start(true); - }; - Feng.confirm("是否删除?", operation); - }; - - /** - * 渲染表格 - */ - Dict.initTable = function (dictId, data) { - return treeTable.render({ - elem: '#' + dictId, - tree: { - iconIndex: 1, // 折叠图标显示在第几列 - idName: 'dictId', // 自定义id字段的名称 - pidName: 'parentId', // 自定义标识是否还有子节点的字段名称 - haveChildName: 'haveChild', // 自定义标识是否还有子节点的字段名称 - isPidData: true // 是否是pid形式数据 - }, - page: true, - request: {pageName: 'pageNo', limitName: 'pageSize'}, //自定义分页参数 - height: "full-98", - cols: Dict.initColumn(), - reqData: function (d, callback) { - var httpRequest = new HttpRequest(Feng.ctxPath + '/dict/getDictTreeList?dictTypeCode=' + $("#dictTypeCode").val(), 'get', function (result) { - callback(result.data); - }, function (result) { - Feng.error("加载失败!" + result.message + "!"); - }); - httpRequest.set(data); - httpRequest.start(); - }, - }); - }; - - insTb = Dict.initTable(Dict.tableId); - - // 搜索按钮点击事件 - $('#btnSearch').click(function () { - Dict.search(); - }); - - // 添加按钮点击事件 - $('#btnAdd').click(function () { - Dict.openAddDlg(); - }); - - // 导出excel - $('#btnExp').click(function () { - Dict.exportExcel(); - }); - - // 关闭页面 - $('#btnBack').click(function () { - window.location.href = Feng.ctxPath + "/view/dictType"; - }); - - // 工具条点击事件 - treeTable.on('tool(' + Dict.tableId + ')', function (obj) { - var data = obj.data; - var layEvent = obj.event; - - if (layEvent === 'edit') { - Dict.openEditDlg(data); - } else if (layEvent === 'delete') { - Dict.onDeleteItem(data); - } - }); -}); diff --git a/src/main/webapp/assets/modular/system/dictType/dictType.js b/src/main/webapp/assets/modular/system/dictType/dictType.js deleted file mode 100644 index f51d3665..00000000 --- a/src/main/webapp/assets/modular/system/dictType/dictType.js +++ /dev/null @@ -1,164 +0,0 @@ -layui.use(['table', 'func', 'HttpRequest', 'form'], function () { - var $ = layui.$; - var table = layui.table; - var func = layui.func; - var HttpRequest = layui.HttpRequest; - var form = layui.form; - - /** - * 字典类型表管理 - */ - var DictType = { - tableId: "dictTypeTable" - }; - - /** - * 初始化表格的列 - */ - DictType.initColumn = function () { - return [[ - {type: 'checkbox'}, - {field: 'dictTypeId', hide: true, title: '字典类型id'}, - { - field: 'dictTypeName', align: "center", sort: true, title: '类型名称', templet: function (d) { - var url = Feng.ctxPath + '/view/dict?dictTypeId=' + d.dictTypeId; - return '' + d.dictTypeName + ''; - } - }, - { - field: 'dictTypeClass', align: "center", sort: true, title: '字典类型', templet: function (d) { - if (d.dictTypeClass === 1) { - return "业务类型"; - } else { - return "系统类型"; - } - } - }, - {field: 'dictTypeNamePinyin', align: "center", sort: true, title: '名词拼音'}, - {field: 'dictTypeCode', align: "center", sort: true, title: '类型编码', minWidth: 166}, - {field: 'dictTypeBusCode', align: "center", sort: true, title: '业务编码', minWidth: 166}, - {field: 'dictTypeDesc', align: "center", sort: true, title: '字典描述'}, - {field: 'statusFlag', sort: true, align: "center", title: '状态', templet: '#statusFlagTpl'}, - {align: 'center', toolbar: '#tableBar', title: '操作'} - ]]; - }; - - /** - * 点击查询按钮 - */ - DictType.search = function () { - var queryData = {}; - queryData['dictTypeName'] = $("#dictTypeName").val(); - queryData['dictTypeClass'] = $("#dictTypeClass").val(); - queryData['statusFlag'] = $("#statusFlag").val(); - table.reload(DictType.tableId, { - where: queryData, page: {curr: 1} - }); - }; - - /** - * 弹出添加对话框 - */ - DictType.openAddDlg = function () { - func.open({ - height: 700, - title: '添加字典类型', - content: Feng.ctxPath + '/view/dictType/addView', - tableId: DictType.tableId - }); - }; - - /** - * 点击编辑 - * - * @param data 点击按钮时候的行数据 - */ - DictType.openEditDlg = function (data) { - func.open({ - height: 700, - title: '修改字典类型', - content: Feng.ctxPath + '/view/dictType/editView?dictTypeId=' + data.dictTypeId, - tableId: DictType.tableId - }); - }; - - /** - * 点击删除 - * - * @param data 点击按钮时候的行数据 - */ - DictType.onDeleteItem = function (data) { - - if (data.dictTypeClass === 2) { - Feng.error("系统类型无法删除"); - return; - } - - var operation = function () { - var httpRequest = new HttpRequest(Feng.ctxPath + "/dictType/deleteDictType", 'post', function (data) { - Feng.success("删除成功!"); - table.reload(DictType.tableId); - }, function (data) { - Feng.error("删除失败!" + data.message + "!"); - }); - httpRequest.set(data); - httpRequest.start(true); - }; - - Feng.confirm("是否删除?", operation); - }; - - // 修改字典类型状态 - DictType.updateStatus = function (dictTypeId, checked) { - var httpRequest = new HttpRequest(Feng.ctxPath + "/dictType/updateStatus", 'post', function (data) { - table.reload(DictType.tableId); - Feng.success("修改成功!"); - }, function (data) { - table.reload(DictType.tableId); - Feng.error("修改失败!" + data.message); - }); - httpRequest.set({"dictTypeId": dictTypeId, "statusFlag": checked}); - httpRequest.start(true); - }; - - // 渲染表格 - var tableResult = table.render({ - elem: '#' + DictType.tableId, - url: Feng.ctxPath + '/dictType/getDictTypePageList', - page: true, - request: {pageName: 'pageNo', limitName: 'pageSize'}, //自定义分页参数 - height: "full-158", - cellMinWidth: 100, - cols: DictType.initColumn(), - parseData: Feng.parseData - }); - - // 搜索按钮点击事件 - $('#btnSearch').click(function () { - DictType.search(); - }); - - // 添加按钮点击事件 - $('#btnAdd').click(function () { - DictType.openAddDlg(); - }); - - // 工具条点击事件 - table.on('tool(' + DictType.tableId + ')', function (obj) { - var data = obj.data; - var layEvent = obj.event; - - if (layEvent === 'edit') { - DictType.openEditDlg(data); - } else if (layEvent === 'delete') { - DictType.onDeleteItem(data); - } - }); - - // 修改状态 - form.on('switch(statusFlag)', function (obj) { - var dictTypeId = obj.elem.value; - var checked = obj.elem.checked ? 1 : 2; - DictType.updateStatus(dictTypeId, checked); - }); -}); diff --git a/src/main/webapp/pages/modular/system/dict/dict.html b/src/main/webapp/pages/modular/system/dict/dict.html deleted file mode 100644 index 86ea5787..00000000 --- a/src/main/webapp/pages/modular/system/dict/dict.html +++ /dev/null @@ -1,38 +0,0 @@ -@layout("/layout/_container.html",{js:["/assets/modular/system/dict/dict.js"]}){ - -