From 1a78b34d3112f558d69bf7fa5256d01467edd970 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 11:03:20 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E3=80=90organization.js=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=A0=E9=99=A4=E4=B8=8D=E5=88=B7=E6=96=B0=E6=A0=91?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/modular/system/organization/organization.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/assets/modular/system/organization/organization.js b/src/main/webapp/assets/modular/system/organization/organization.js index 183bc4d6..c5c12696 100644 --- a/src/main/webapp/assets/modular/system/organization/organization.js +++ b/src/main/webapp/assets/modular/system/organization/organization.js @@ -36,7 +36,10 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel height: 800, title: '修改机构', content: Feng.ctxPath + '/view/organization/editView?orgId=' + data.id, - tableId: Organization.tableId + tableId: Organization.tableId, + endCallback: function () { + renderTree(); + } }); }; @@ -45,7 +48,10 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel var operation = function () { var httpRequest = new HttpRequest(Feng.ctxPath + "/hrOrganization/delete", 'post', function (data) { Feng.success("删除成功!"); + //刷新表格 table.reload(Organization.tableId); + //刷新树 + renderTree(); }, function (data) { Feng.error("删除失败!" + data.message + "!"); }); @@ -66,8 +72,6 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel selObj = obj; $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); - - console.log(obj.data); insTb.reload({ where: {orgParentId: obj.data.id}, page: {curr: 1}, From b897ccd5260cca97ddc769b59da3af27dfecc85b Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 11:04:18 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E3=80=90user=E3=80=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=9C=BA=E6=9E=84=E6=A0=91=E7=9A=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/assets/modular/system/user/user.js | 68 +++++++++++++++++++ .../pages/modular/system/user/user.html | 8 ++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/assets/modular/system/user/user.js b/src/main/webapp/assets/modular/system/user/user.js index cff840d0..a1fec553 100644 --- a/src/main/webapp/assets/modular/system/user/user.js +++ b/src/main/webapp/assets/modular/system/user/user.js @@ -17,6 +17,55 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel tableId: "userTable", //表格id }; + + var Organization = { + + }; + + + /* 点击新增对话框 */ + Organization.openAddDlg = function () { + func.open({ + height: 800, + title: '添加机构', + content: Feng.ctxPath + '/view/organization/addView', + tableId: OrganizationUser.tableId, + endCallback: function () { + renderTree(); + } + }); + }; + + /* 点击编辑对话框 */ + Organization.openEditDlg = function (data) { + func.open({ + height: 800, + title: '修改机构', + content: Feng.ctxPath + '/view/organization/editView?orgId=' + data.id, + tableId: OrganizationUser.tableId, + endCallback: function () { + renderTree(); + } + }); + }; + + /* 点击删除 */ + Organization.delete = function (data) { + var operation = function () { + var httpRequest = new HttpRequest(Feng.ctxPath + "/hrOrganization/delete", 'post', function (data) { + Feng.success("删除成功!"); + table.reload(OrganizationUser.tableId); + //刷新树 + renderTree(); + }, function (data) { + Feng.error("删除失败!" + data.message + "!"); + }); + httpRequest.set(data); + httpRequest.start(true); + }; + Feng.confirm("是否删除?", operation); + }; + /* 点击新增对话框 */ OrganizationUser.openAddDlg = function () { func.open({ @@ -152,6 +201,25 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'tree', 'dropdown', 'xmSel return false; }); + /* 添加 */ + $('#organizationAddBtn').click(function () { + Organization.openAddDlg(); + }); + + /* 修改 */ + $('#organizationEditBtn').click(function () { + if (!selObj) return layer.msg('未选择机构', {icon: 2}); + Organization.openEditDlg(selObj.data) + }); + + /* 删除 */ + $('#organizationDelBtn').click(function () { + if (!selObj) return layer.msg('未选择机构', {icon: 2}); + selObj.data.orgId = selObj.data.id; + Organization.delete(selObj.data) + + }); + /* 表格工具条点击事件 */ table.on('tool(userTable)', function (obj) { if (obj.event === 'edit') { // 修改 diff --git a/src/main/webapp/pages/modular/system/user/user.html b/src/main/webapp/pages/modular/system/user/user.html index fdf85adb..e2e61445 100644 --- a/src/main/webapp/pages/modular/system/user/user.html +++ b/src/main/webapp/pages/modular/system/user/user.html @@ -48,11 +48,15 @@
- +   +
From 84b76be5831f8b60fa31e84e93e444168b24d4b4 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 15:45:42 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E3=80=90common.js=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=85=A8=E5=B1=80=E5=88=86=E9=A1=B5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/common/js/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/webapp/assets/common/js/common.js b/src/main/webapp/assets/common/js/common.js index 5d4eb963..9e392c75 100644 --- a/src/main/webapp/assets/common/js/common.js +++ b/src/main/webapp/assets/common/js/common.js @@ -11,6 +11,9 @@ Feng.parseData = function (res) { "data": res.data.rows //解析数据列表 }; }; +/* 设置分页请求参数 */ +Feng.pageRequest = {pageName: 'pageNo', limitName: 'pageSize'}; + Feng.info = function (info) { top.layer.msg(info, {icon: 6}); }; From fafc516262f79b38be2d0cc6279857bddc64479b Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 15:46:37 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E3=80=90config=E3=80=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/config/ConfigViewController.java | 14 +- .../assets/modular/system/config/config.js | 186 ++++++++++++++++++ .../modular/system/config/config_add.js | 25 +++ .../modular/system/config/sysConfig_add.js | 33 +--- .../modular/system/config/sysConfig_edit.js | 51 +---- .../pages/modular/system/config/config.html | 109 ++++++++++ .../modular/system/config/config_add.html | 57 ++++++ .../modular/system/config/sysConfig_add.html | 19 +- .../modular/system/config/sysConfig_edit.html | 18 +- 9 files changed, 399 insertions(+), 113 deletions(-) create mode 100644 src/main/webapp/assets/modular/system/config/config.js create mode 100644 src/main/webapp/assets/modular/system/config/config_add.js create mode 100644 src/main/webapp/pages/modular/system/config/config.html create mode 100644 src/main/webapp/pages/modular/system/config/config_add.html diff --git a/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java b/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java index ad8a2f6e..ef87ad8d 100644 --- a/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/system/config/ConfigViewController.java @@ -22,7 +22,8 @@ public class ConfigViewController { */ @GetResource(name = "系统配置-列表-视图", path = "/view/config") public String indexView() { - return "/modular/system/config/sysConfig.html"; + return "/modular/system/config/config.html"; + //return "/modular/system/config/sysConfig.html"; } /** @@ -36,6 +37,17 @@ public class ConfigViewController { return "/modular/system/config/sysConfig_add.html"; } + /** + * 系统配置—新增-视图 + * + * @author jiawei + * @date 2021/1/4 13:34 + */ + @GetResource(name = "系统配置—新增-视图", path = "/view/config/addConfigDictView") + public String addConfigDictView() { + return "/modular/system/config/config_add.html"; + } + /** * 系统配置-修改-视图 * diff --git a/src/main/webapp/assets/modular/system/config/config.js b/src/main/webapp/assets/modular/system/config/config.js new file mode 100644 index 00000000..dc8a2ad0 --- /dev/null +++ b/src/main/webapp/assets/modular/system/config/config.js @@ -0,0 +1,186 @@ +layui.use(['layer', 'form', 'table', 'util', 'admin', 'func', 'HttpRequest'], function () { + var $ = layui.jquery; + var layer = layui.layer; + var form = layui.form; + var table = layui.table; + var admin = layui.admin; + var HttpRequest = layui.HttpRequest; + var func = layui.func; + var dictTypeObj; // 左表选中数据 + + var Dict = { + tableId: "dictTable", + }; + + var DictType = { + tableId: "dictTypeTable" + }; + + + /* 字典类型-点击新增对话框 */ + DictType.openAddDlg = function (data) { + console.log(data); + func.open({ + height: 680, + title: '添加系统配置', + content: Feng.ctxPath + '/view/config/addView?groupCode=' + data.dictCode, + tableId: Dict.tableId + }); + }; + + /* 字典类型-点击编辑对话框 */ + DictType.openEditDlg = function (data) { + func.open({ + height: 680, + title: '修改系统配置', + content: Feng.ctxPath + '/view/config/editView?configId=' + data.configId, + tableId: Dict.tableId + }); + }; + + /* 字典类型-点击删除 */ + DictType.onDeleteItem = function (data) { + var operation = function () { + var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/delete", 'post', function (data) { + Feng.success("删除成功!"); + table.reload(Dict.tableId); + }, function (data) { + Feng.error(data.message + "!"); + }); + httpRequest.set(data); + httpRequest.start(true); + }; + Feng.confirm("是否删除?", operation); + }; + + /* 字典类型-点击搜索 */ + form.on('submit(dictTypeTbSearch)', function (data) { + dictTypeTable.reload({where: data.field}); + return false; + }); + + /* 字典类型-点击表格头工具栏 */ + table.on('toolbar(dictTypeTable)', function (obj) { + var data = dictTypeObj.data; + if (obj.event === 'add') { // 添加 + Dict.openAddDlg(); + } else if (obj.event === 'edit') { // 修改 + DictType.openEditDlg(data); + } else if (obj.event === 'del') { // 删除 + Dict.onDeleteItem(data); + } + }); + + /* 字典类型-渲染表格 */ + var dictTypeTable = table.render({ + elem: '#dictTypeTable', + url: Feng.ctxPath + '/dict/getConfigGroupPage', + height: 'full-100', + toolbar: '#dictTypeHtbBar', + defaultToolbar: [], //默认表格头部右侧工具栏 + cols: [[ + {type: 'numbers'}, + {field: 'dictName', title: '类型'}, + {field: 'dictCode', title: '编码'} + ]], + done: function (res, curr, count) { + //加载后自动选中第一行并出发click事件 + $('#dictTypeTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); + }, + parseData: Feng.parseData //解析成 table 组件所规定的数据格式 + }); + + /* 字典类型-监听行单击事件 */ + table.on('row(dictTypeTable)', function (obj) { + dictTypeObj = obj; + obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); + dictTable.reload({ + where: {groupCode: obj.data.dictCode}, + page: {curr: 1}, + url: Feng.ctxPath + '/sysConfig/page' + }); + }); + + + /* 字典-点击新增对话框 */ + Dict.openAddDlg = function (data) { + func.open({ + height: 680, + title: '添加字典', + content: Feng.ctxPath + '/view/config/addConfigDictView', + tableId: DictType.tableId + }); + }; + + /* 字典-点击编辑对话框 */ + Dict.openEditDlg = function (data) { + func.open({ + height: 680, + title: '修改字典', + content: Feng.ctxPath + '/view/dict/editView?dictId=' + data.dictId, + tableId: Dict.tableId + }); + }; + + /* 字典-点击删除 */ + Dict.onDeleteItem = function (data) { + var operation = function () { + var httpRequest = new HttpRequest(Feng.ctxPath + "/dict/deleteDict", 'post', function (data) { + Feng.success("删除成功!"); + table.reload(DictType.tableId); + }, function (data) { + Feng.error("删除失败!" + data.message + "!"); + }); + httpRequest.set(data); + httpRequest.start(true); + }; + Feng.confirm("是否删除?", operation); + }; + + /* 字典-点击搜索 */ + form.on('submit(dictTbSearch)', function (data) { + //赋值左表dictTypeCode + data.field.dictTypeCode = dictTypeObj.data.dictTypeCode; + dictTable.reload({where: data.field}); + return false; + }); + + /* 字典-点击操作工具栏 */ + table.on('tool(dictTable)', function (obj) { + var data = obj.data; + if (obj.event === 'edit') { // 修改 + DictType.openEditDlg(data); + } else if (obj.event === 'del') { // 删除 + DictType.onDeleteItem(data); + } + }); + + // 添加按钮点击事件 + $('#btnAdd').click(function () { + console.log(dictTypeObj.data); + DictType.openAddDlg(dictTypeObj.data); + return false; + }); + + /* 字典-渲染表格 */ + var dictTable = table.render({ + elem: '#dictTable', + data: [], + height: 'full-100', + page: true, + //toolbar: '#dictHtbBar', + cellMinWidth: 100, + cols: [[ + {type: 'checkbox'}, + {type: 'numbers'}, + {field: 'configId', hide: true, title: '主键'}, + {field: 'configName', sort: true, align: "center", title: '名称'}, + {field: 'configCode', sort: true, align: "center", title: '属性编码'}, + {field: 'configValue', sort: true, align: "center", title: '属性值'}, + {field: 'remark', sort: true, align: "center", title: '备注'}, + {align: 'center', toolbar: '#dictTbBar', title: '操作'} + ]], + parseData: Feng.parseData, + request: Feng.pageRequest + }); +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modular/system/config/config_add.js b/src/main/webapp/assets/modular/system/config/config_add.js new file mode 100644 index 00000000..340f4847 --- /dev/null +++ b/src/main/webapp/assets/modular/system/config/config_add.js @@ -0,0 +1,25 @@ +layui.use(['form', 'admin', 'HttpRequest'], function () { + var $ = layui.jquery; + var form = layui.form; + var admin = layui.admin; + var HttpRequest = layui.HttpRequest; + + //获取信息详情填充表单 + var request = new HttpRequest(Feng.ctxPath + '/dictType/getConfigDictTypeDetail', 'get'); + var result = request.start(); + form.val('dictForm', result.data); + + //表单提交事件 + form.on('submit(btnSubmit)', function (data) { + var request = new HttpRequest(Feng.ctxPath + "/dict/addDict", 'post', function (data) { + admin.closeThisDialog(); + Feng.success("添加成功!"); + admin.putTempData('formOk', true); + }, function (data) { + admin.closeThisDialog(); + Feng.error("添加失败!" + data.message); + }); + request.set(data.field); + request.start(true); + }); +}); \ No newline at end of file diff --git a/src/main/webapp/assets/modular/system/config/sysConfig_add.js b/src/main/webapp/assets/modular/system/config/sysConfig_add.js index 38a8f54d..78cb7cc4 100644 --- a/src/main/webapp/assets/modular/system/config/sysConfig_add.js +++ b/src/main/webapp/assets/modular/system/config/sysConfig_add.js @@ -1,39 +1,14 @@ -/** - * 修改 - */ -var SysConfigInfoDlg = { - data: {} -}; - layui.use(['form', 'admin', 'HttpRequest'], function () { var $ = layui.jquery; var form = layui.form; var admin = layui.admin; var HttpRequest = layui.HttpRequest; - // 初始化所属分类字典下拉 - var activeDictSelect = function () { - $("#groupCode").html(''); - - //要删掉 - $("#groupCode").append(''); - - form.render(); - }; + $("#groupCode").val(Feng.getUrlParam("groupCode")); //表单提交事件 form.on('submit(btnSubmit)', function (data) { - - SysConfigInfoDlg.data = $.extend({"sysFlag": data.field.sysFlag ? data.field.sysFlag : 'N'}, data.field) - - var groupCode = $("#groupCode").find("option:selected").val() - if (!groupCode) { - Feng.error("所属分类不能为空") - return false; - } - SysConfigInfoDlg.data = $.extend({"groupCode": groupCode}, data.field) - var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/add", 'post', function (data) { admin.closeThisDialog(); Feng.success("添加成功!"); @@ -42,11 +17,7 @@ layui.use(['form', 'admin', 'HttpRequest'], function () { admin.closeThisDialog(); Feng.error("添加失败!" + data.message) }); - httpRequest.set(SysConfigInfoDlg.data); + httpRequest.set(data.field); httpRequest.start(true); }); - - // 常量所属分类动态赋值 - activeDictSelect(); - }); diff --git a/src/main/webapp/assets/modular/system/config/sysConfig_edit.js b/src/main/webapp/assets/modular/system/config/sysConfig_edit.js index 5a1c35f4..dbc8e929 100644 --- a/src/main/webapp/assets/modular/system/config/sysConfig_edit.js +++ b/src/main/webapp/assets/modular/system/config/sysConfig_edit.js @@ -1,15 +1,7 @@ -/** - * 详情对话框 - */ -var SysConfigInfoDlg = { - data: {} -}; - -layui.use(['form', 'admin', 'selectPlus', 'HttpRequest'], function () { +layui.use(['form', 'admin', 'HttpRequest'], function () { var $ = layui.jquery; var form = layui.form; var admin = layui.admin; - var selectPlus = layui.selectPlus; var HttpRequest = layui.HttpRequest; // 获取详情信息,填充表单 @@ -18,45 +10,9 @@ layui.use(['form', 'admin', 'selectPlus', 'HttpRequest'], function () { form.val('sysConfigForm', result.data); - // 系统参数样式 - if (result.data) { - var mData = result.data; - if (mData.sysFlag == 'Y') { - $('input[name="sysFlag"]').attr('checked', 'checked'); //改变开关为 开 - } else { - $('input[name="sysFlag"]').removeAttr('checked'); //改变开关为 关 - } - /*改变是否系统参数样式*/ - $("input[name='sysFlag']").attr("disabled", "true"); - form.render(); //系统参数禁用 - $("input[name='sysFlag']").next().removeClass("layui-form-onswitch"); // 系统参数去掉样式 - } - - // 初始化所属分类字典下拉 - var activeDictSelect = function () { - - $("#groupCode").html(''); - - //要删掉 - $("#groupCode").append(''); - $("#groupCode").val(result.data.groupCode); - form.render(); - - }; - //表单提交事件 form.on('submit(btnSubmit)', function (data) { - - SysConfigInfoDlg.data = $.extend({"sysFlag": data.field.sysFlag ? data.field.sysFlag : 'N'}, data.field) - - var groupCode = $("#groupCode").find("option:selected").val() - if (!groupCode) { - Feng.error("所属分类不能为空") - return false; - } - SysConfigInfoDlg.data = $.extend({"groupCode": groupCode}, data.field) - var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/edit", 'post', function (data) { admin.closeThisDialog(); Feng.success("修改成功!"); @@ -65,11 +21,8 @@ layui.use(['form', 'admin', 'selectPlus', 'HttpRequest'], function () { admin.closeThisDialog(); Feng.error("修改失败!" + data.message) }); - httpRequest.set(SysConfigInfoDlg.data); + httpRequest.set(data.field); httpRequest.start(true); }); - // 常量所属分类动态赋值 - activeDictSelect(); - }); diff --git a/src/main/webapp/pages/modular/system/config/config.html b/src/main/webapp/pages/modular/system/config/config.html new file mode 100644 index 00000000..49ebdb68 --- /dev/null +++ b/src/main/webapp/pages/modular/system/config/config.html @@ -0,0 +1,109 @@ +@layout("/layout/_container.html",{js:["/assets/modular/system/config/config.js"]}){ + +
+
+
+
+
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
  + + +
+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +@} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/config/config_add.html b/src/main/webapp/pages/modular/system/config/config_add.html new file mode 100644 index 00000000..c4d48a3e --- /dev/null +++ b/src/main/webapp/pages/modular/system/config/config_add.html @@ -0,0 +1,57 @@ +@layout("/layout/_form.html",{js:["/assets/modular/system/config/config_add.js"]}){ + +
+
+
+
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ + +
+ +
+ +@} \ No newline at end of file diff --git a/src/main/webapp/pages/modular/system/config/sysConfig_add.html b/src/main/webapp/pages/modular/system/config/sysConfig_add.html index 232372b2..d4cf0962 100644 --- a/src/main/webapp/pages/modular/system/config/sysConfig_add.html +++ b/src/main/webapp/pages/modular/system/config/sysConfig_add.html @@ -2,42 +2,27 @@
-
基本信息
+
-
-
- -
- -
- -
- -
- -
-
-
@@ -48,7 +33,7 @@
- +
diff --git a/src/main/webapp/pages/modular/system/config/sysConfig_edit.html b/src/main/webapp/pages/modular/system/config/sysConfig_edit.html index 3c2b2d1b..dec48ef1 100644 --- a/src/main/webapp/pages/modular/system/config/sysConfig_edit.html +++ b/src/main/webapp/pages/modular/system/config/sysConfig_edit.html @@ -3,9 +3,10 @@
-
基本信息
+ +
@@ -26,19 +27,6 @@
- -
- -
- -
- -
- -
-
-
@@ -49,7 +37,7 @@
- +
From 4463dc91ddbaba121fe64edd61c97bf190e5c9a6 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 16:59:25 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E3=80=90config=E3=80=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/modular/system/config/config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/assets/modular/system/config/config.js b/src/main/webapp/assets/modular/system/config/config.js index dc8a2ad0..363f70e0 100644 --- a/src/main/webapp/assets/modular/system/config/config.js +++ b/src/main/webapp/assets/modular/system/config/config.js @@ -174,10 +174,10 @@ layui.use(['layer', 'form', 'table', 'util', 'admin', 'func', 'HttpRequest'], fu {type: 'checkbox'}, {type: 'numbers'}, {field: 'configId', hide: true, title: '主键'}, - {field: 'configName', sort: true, align: "center", title: '名称'}, - {field: 'configCode', sort: true, align: "center", title: '属性编码'}, - {field: 'configValue', sort: true, align: "center", title: '属性值'}, - {field: 'remark', sort: true, align: "center", title: '备注'}, + {field: 'configName', sort: true, title: '名称'}, + {field: 'configCode', sort: true, title: '属性编码'}, + {field: 'configValue', sort: true, title: '属性值'}, + {field: 'remark', sort: true, title: '备注'}, {align: 'center', toolbar: '#dictTbBar', title: '操作'} ]], parseData: Feng.parseData, From 5389813ac23bbf8ba3a46beea250e186b96f8c90 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 17:03:12 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E3=80=90login=5Flog.js=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/modular/system/log/login_log.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/modular/system/log/login_log.js b/src/main/webapp/assets/modular/system/log/login_log.js index 0b114cec..c650baa0 100644 --- a/src/main/webapp/assets/modular/system/log/login_log.js +++ b/src/main/webapp/assets/modular/system/log/login_log.js @@ -86,7 +86,8 @@ layui.use(['layer', 'table', 'HttpRequest', 'laydate'], function () { height: "full-98", cellMinWidth: 100, cols: LoginLog.initColumn(), - parseData: Feng.parseData + parseData: Feng.parseData, + request: Feng.pageRequest }); // 搜索按钮点击事件 From dc7b93e9b133a4dcfe2ff8c395a63779e3ce3b5c Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 18:52:28 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E3=80=90dict=E3=80=91=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=B8=8B=E6=8B=89=E6=A1=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/common/js/common.js | 3 +- .../webapp/assets/expand/module/dict/dict.js | 37 +++++++++++++++++++ .../assets/expand/module/dict/readme.md | 8 ++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/main/webapp/assets/expand/module/dict/dict.js create mode 100644 src/main/webapp/assets/expand/module/dict/readme.md diff --git a/src/main/webapp/assets/common/js/common.js b/src/main/webapp/assets/common/js/common.js index 9e392c75..a439ed2a 100644 --- a/src/main/webapp/assets/common/js/common.js +++ b/src/main/webapp/assets/common/js/common.js @@ -149,7 +149,8 @@ layui.config({ iconPicker: '../../expand/module/iconPicker/iconPicker', ztree: '../../expand/module/ztree/ztree-object', HttpRequest: '../../expand/module/HttpRequest/HttpRequest', - func: '../../expand/module/func/func' + func: '../../expand/module/func/func', + dict: '../../expand/module/dict/dict' }).use(['layer', 'admin'], function () { var $ = layui.jquery; var layer = layui.layer; diff --git a/src/main/webapp/assets/expand/module/dict/dict.js b/src/main/webapp/assets/expand/module/dict/dict.js new file mode 100644 index 00000000..45421214 --- /dev/null +++ b/src/main/webapp/assets/expand/module/dict/dict.js @@ -0,0 +1,37 @@ +layui.define(['jquery', 'HttpRequest', 'xmSelect'], function (exports) { + "use strict"; + var dict = function () { + this.v = '1.0'; + }, + $ = layui.$, + HttpRequest = layui.HttpRequest, + xmSelect = layui.xmSelect; + + dict.prototype.render = function (options) { + var opts = options, + url = opts.url || Feng.ctxPath + '/dict/getDictList', + method = opts.method || 'get', + code = opts.code, + elem = opts.elem; + var xm = xmSelect.render({ + el: elem, + radio: true, //单选 + toolbar: {show: true}, //开启工具栏 + data: [] + }) + new HttpRequest(url, method, function (obj) { + //转换成xmSelect格式数据 + for (var i = 0; i < obj.data.length; i++) { + obj.data[i].name = obj.data[i].dictName; + obj.data[i].value = obj.data[i].dictCode; + } + xm.update({ + data: obj.data, + autoRow: true, + }); + }, function (data) { + }).set("dictTypeCode", code).start(); + return new dict(); + }; + exports('dict', new dict()); +}); \ No newline at end of file diff --git a/src/main/webapp/assets/expand/module/dict/readme.md b/src/main/webapp/assets/expand/module/dict/readme.md new file mode 100644 index 00000000..9e44f140 --- /dev/null +++ b/src/main/webapp/assets/expand/module/dict/readme.md @@ -0,0 +1,8 @@ + +
+ + +dict.render({ + elem: '#demo2', //控件 + code: '' //字典dictTypeCode +}); \ No newline at end of file From 94d179557c4767d7e357973dc5ecb04018e29af4 Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 18:54:11 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E3=80=90dict=E3=80=91=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=B8=8B=E6=8B=89=E6=A1=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/expand/module/dict/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/assets/expand/module/dict/readme.md b/src/main/webapp/assets/expand/module/dict/readme.md index 9e44f140..b2358611 100644 --- a/src/main/webapp/assets/expand/module/dict/readme.md +++ b/src/main/webapp/assets/expand/module/dict/readme.md @@ -1,7 +1,10 @@ - +1.添加html标签
+2.引入layui 模块组件'dict' +layui.use(['dict'], function () { +3.渲染组件 dict.render({ elem: '#demo2', //控件 code: '' //字典dictTypeCode From 4e653f98973bda5b4f08e8d580a808b89f60e64a Mon Sep 17 00:00:00 2001 From: chenjinlong <22208488@qq.com> Date: Mon, 25 Jan 2021 20:51:02 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E3=80=90dict=E3=80=91=E3=80=90gunsSelect?= =?UTF-8?q?=E3=80=91=E9=80=9A=E7=94=A8=E7=BB=84=E4=BB=B6=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/assets/common/js/common.js | 4 +- .../webapp/assets/expand/module/dict/dict.js | 7 +++ .../assets/expand/module/dict/readme.md | 14 +++-- .../expand/module/gunsSelect/gunsSelect.js | 54 +++++++++++++++++++ .../assets/expand/module/gunsSelect/readme.md | 17 ++++++ 5 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 src/main/webapp/assets/expand/module/gunsSelect/gunsSelect.js create mode 100644 src/main/webapp/assets/expand/module/gunsSelect/readme.md diff --git a/src/main/webapp/assets/common/js/common.js b/src/main/webapp/assets/common/js/common.js index a439ed2a..93948d5f 100644 --- a/src/main/webapp/assets/common/js/common.js +++ b/src/main/webapp/assets/common/js/common.js @@ -150,7 +150,9 @@ layui.config({ ztree: '../../expand/module/ztree/ztree-object', HttpRequest: '../../expand/module/HttpRequest/HttpRequest', func: '../../expand/module/func/func', - dict: '../../expand/module/dict/dict' + dict: '../../expand/module/dict/dict', + gunsSelect: '../../expand/module/gunsSelect/gunsSelect' + }).use(['layer', 'admin'], function () { var $ = layui.jquery; var layer = layui.layer; diff --git a/src/main/webapp/assets/expand/module/dict/dict.js b/src/main/webapp/assets/expand/module/dict/dict.js index 45421214..32bab719 100644 --- a/src/main/webapp/assets/expand/module/dict/dict.js +++ b/src/main/webapp/assets/expand/module/dict/dict.js @@ -1,3 +1,10 @@ +/** + * 基于xmSelect封装字典通用下拉选项 + * v1.0 + * @author 陈金龙 + * @date 2021/1/25 10:59 + */ + layui.define(['jquery', 'HttpRequest', 'xmSelect'], function (exports) { "use strict"; var dict = function () { diff --git a/src/main/webapp/assets/expand/module/dict/readme.md b/src/main/webapp/assets/expand/module/dict/readme.md index b2358611..f642fe6b 100644 --- a/src/main/webapp/assets/expand/module/dict/readme.md +++ b/src/main/webapp/assets/expand/module/dict/readme.md @@ -4,8 +4,12 @@ 2.引入layui 模块组件'dict' layui.use(['dict'], function () { -3.渲染组件 -dict.render({ - elem: '#demo2', //控件 - code: '' //字典dictTypeCode -}); \ No newline at end of file + var dict = layui.dict; + // 渲染组件 + dict.render({ + elem: '#demo2', //控件 + code: '' //字典dictTypeCode + }); + +} + diff --git a/src/main/webapp/assets/expand/module/gunsSelect/gunsSelect.js b/src/main/webapp/assets/expand/module/gunsSelect/gunsSelect.js new file mode 100644 index 00000000..ac02165d --- /dev/null +++ b/src/main/webapp/assets/expand/module/gunsSelect/gunsSelect.js @@ -0,0 +1,54 @@ +/** + * 封装通用选择组件 + * + * v1.0 + * 目前仅支持下拉框 + * + * @author 陈金龙 + * @date 2021/1/25 10:59 + */ +layui.define(['jquery', 'HttpRequest', 'xmSelect', 'form'], function (exports) { + "use strict"; + var gunsSelect = function () { + this.v = '1.0'; + }, + $ = layui.$, + HttpRequest = layui.HttpRequest, + form = layui.form; + + gunsSelect.prototype.render = function (options) { + + var opts = options, + url = opts.url, + method = opts.method || 'get', + where = opts.where, + fields = opts.fields || {name: 'name', value: 'value'}, + elem = opts.elem; + //渲染 + //渲染 + + var a = { + init: function () { + new HttpRequest(url, method, function (obj) { + for (var i = 0; i < obj.data.length; i++) { + $(elem).append(''); + } + form.render(); + }, function (data) { + }).set(where).start(); + } + } + + var common = { + get: function (obj, key) { + return obj[key]; + } + }; + + a.init(); + return new gunsSelect(); + + + }; + exports('gunsSelect', new gunsSelect()); +}); \ No newline at end of file diff --git a/src/main/webapp/assets/expand/module/gunsSelect/readme.md b/src/main/webapp/assets/expand/module/gunsSelect/readme.md new file mode 100644 index 00000000..4d8d0a33 --- /dev/null +++ b/src/main/webapp/assets/expand/module/gunsSelect/readme.md @@ -0,0 +1,17 @@ +1.添加html标签 + + +2.引入layui 模块组件'dict' +layui.use(['gunsSelect'], function () { + var gunsSelect = layui.gunsSelect; + // 渲染组件 + gunsSelect.render({ + url: Feng.ctxPath + '/dict/getDictList', + elem: '#city', + fields: {name: 'dictName', value: 'dictCode'}, + where:{code:123} + }); +} +